Making WordPress.org

Changeset 3452


Ignore:
Timestamp:
06/19/2016 09:03:37 AM (10 years ago)
Author:
dd32
Message:

Plugin Directory: Readme Validator: Remove unused headers/sections from the validator and use the correct requires/tested fields.

See #1584

File:
1 edited

Legend:

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

    r3450 r3452  
    7676                $warnings  = array();
    7777                $notes     = array();
     78
    7879                if ( ! empty( $_REQUEST['readme_url'] ) ) {
    7980                        $url = esc_url_raw( $_REQUEST['readme_url'] );
     
    109110
    110111                // Warnings.
    111                 if ( empty( $readme->requires_at_least ) ) {
     112                if ( empty( $readme->requires ) ) {
    112113                        /* Translators: Plugin header tag; */
    113114                        $warnings[] = sprintf( __( '%s is missing.', 'wporg-plugins' ), '<code>Requires at least</code>' );
    114115                }
    115                 if ( empty( $readme->tested_up_to ) ) {
     116                if ( empty( $readme->tested ) ) {
    116117                        /* Translators: Plugin header tag; */
    117118                        $warnings[] = sprintf( __( '%s is missing.', 'wporg-plugins' ), '<code>Tested up to</code>' );
     
    124125                        /* Translators: Plugin header tag; */
    125126                        $warnings[] = sprintf( __( 'No %s listed.', 'wporg-plugins' ), '<code>Contributors</code>' );
    126                 }
    127                 if ( ! count( $readme->tags ) ) {
    128                         /* Translators: Plugin header tag; */
    129                         $warnings[] = sprintf( __( 'No %s specified', 'wporg-plugins' ), '<code>Tags</code>' );
    130                 }
    131                 if ( ! empty( $readme->is_excerpt ) ) {
    132                         /* Translators: Plugin header tag; */
    133                         $warnings[] = sprintf( __( 'No %s section was found... your short description section will be used instead.', 'wporg-plugins' ), '<code>== Description ==</code>' );
    134                 }
    135                 if ( ! empty( $readme->is_truncated ) ) {
    136                         $warnings[] = __( 'Your short description exceeds the 150 character limit.', 'wporg-plugins' );
    137127                }
    138128
     
    149139
    150140                // Notes.
    151                 if ( empty( $readme->license ) ) {
    152                         /* Translators: Plugin header tag; */
    153                         $notes[] = sprintf( __( 'No %s is specified. WordPress is licensed under &#8220;GPLv2 or later&#8221;', 'wporg-plugins' ), '<code>License</code>' );
    154                 }
    155                 if ( empty( $readme->sections['installation'] ) ) {
    156                         /* Translators: Plugin header tag; */
    157                         $notes[] = sprintf( __( 'No %s section was found', 'wporg-plugins' ), '<code>== Installation ==</code>' );
    158                 }
    159141                if ( empty( $readme->sections['frequently_asked_questions'] ) ) {
    160142                        /* Translators: Plugin header tag; */
Note: See TracChangeset for help on using the changeset viewer.