Making WordPress.org


Ignore:
Timestamp:
07/16/2019 05:55:10 AM (5 years ago)
Author:
dd32
Message:

Plugin Directory: Preference the Requires PHP and Requires at least headers defined in the Plugins .php header over the readme.txt values.

This also moves the missing fields in the readme.txt to being notes rather than warnings in the readme validator.

This matches the behaviour in WordPress 5.3, see #WP46938.
Fixes #4514.

File:
1 edited

Legend:

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

    r8469 r9050  
    8686                '<code>' . number_format( $latest_wordpress_version - 0.1, 1 ) . '</code>'
    8787            );
    88         } elseif ( empty( $readme->requires ) ) {
    89             $warnings[] = sprintf(
    90                 /* translators: %s: plugin header tag */
    91                 __( 'The %s field is missing.', 'wporg-plugins' ),
    92                 '<code>Requires at least</code>'
    93             );
    9488        }
    9589
     
    120114                '<code>7.0</code>'
    121115            );
    122         } elseif ( empty( $readme->requires_php ) ) {
    123             $warnings[] = sprintf(
    124                 /* translators: %s: plugin header tag */
    125                 __( 'The %s field is missing.', 'wporg-plugins' ),
    126                 '<code>Requires PHP</code>'
    127             );
    128116        }
     117
    129118        if ( empty( $readme->stable_tag ) ) {
    130119            $warnings[] = sprintf(
     
    152141
    153142        // Notes.
     143        if ( empty( $readme->requires ) ) {
     144            $notes[] = sprintf(
     145                /* translators: %s: plugin header tag */
     146                __( 'The %s field is missing. It should be defined here, or in your main plugin file.', 'wporg-plugins' ),
     147                '<code>Requires at least</code>'
     148            );
     149        }
     150
     151        if ( empty( $readme->requires_php ) ) {
     152            $notes[] = sprintf(
     153                /* translators: %s: plugin header tag */
     154                __( 'The %s field is missing. It should be defined here, or in your main plugin file.', 'wporg-plugins' ),
     155                '<code>Requires PHP</code>'
     156            );
     157        }
     158
    154159        if ( empty( $readme->sections['faq'] ) ) {
    155160            $notes[] = sprintf(
     
    159164            );
    160165        }
     166
    161167        if ( empty( $readme->sections['changelog'] ) ) {
    162168            $notes[] = sprintf(
     
    166172            );
    167173        }
     174
    168175        if ( empty( $readme->upgrade_notice ) ) {
    169176            $notes[] = sprintf(
     
    173180            );
    174181        }
     182
    175183        if ( empty( $readme->screenshots ) ) {
    176184            $notes[] = sprintf(
     
    180188            );
    181189        }
     190
    182191        if ( empty( $readme->donate_link ) ) {
    183192            $notes[] = __( 'No donate link was found', 'wporg-plugins' );
Note: See TracChangeset for help on using the changeset viewer.