WordPress.org

Making WordPress.org


Ignore:
Timestamp:
04/06/2018 05:04:54 AM (19 months ago)
Author:
dd32
Message:

Plugin Directory: Readme: Ignore invalid Requires PHP headers and add a parsing warning clarifying the expected contents.

Fixes #3551.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php

    r7023 r7049  
    7777            $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Tested up to</code>' );
    7878        }
    79         if ( empty( $readme->requires_php ) ) {
     79        if ( isset( $readme->warnings['requires_php_ignored'] ) ) {
     80            /* translators: 1: plugin header tag; 2: Example version 5.2.4. 3: Example version 7.0. */
     81            $warnings[] = sprintf( __( 'The Requires PHP field was ignored. %1$s field should only contain a PHP version such as %2$s or %3$s.', 'wporg-plugins' ), '<code>Requires PHP</code>', '<code>5.2.4</code>', '<code>7.0</code>' );
     82        } elseif ( empty( $readme->requires_php ) ) {
    8083            /* translators: %s: plugin header tag */
    8184            $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Requires PHP</code>' );
     
    8992            $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Contributors</code>' );
    9093        }
    91         if ( $readme->contributor_ignored ) {
     94        if ( isset( $readme->warnings['contributor_ignored'] ) ) {
    9295            /* translators: %s: plugin header tag */
    9396            $warnings[] = sprintf( __( 'One or more contributors listed were ignored. %s field should only contain WordPress.org usernames.', 'wporg-plugins' ), '<code>Contributors</code>' );
Note: See TracChangeset for help on using the changeset viewer.