Changeset 7874 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php
- Timestamp:
- 11/20/2018 05:36:35 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php
r7356 r7874 69 69 70 70 // Warnings. 71 if ( empty( $readme->requires ) ) { 71 if ( isset( $readme->warnings['requires_header_ignored'] ) ) { 72 $latest_wordpress_version = defined( 'WP_CORE_STABLE_BRANCH' ) ? WP_CORE_STABLE_BRANCH : '5.0'; 73 74 /* translators: 1: plugin header tag; 2: Example version 5.0. 3: Example version 4.9. */ 75 $warnings[] = sprintf( 76 __( 'The Requires at least field was ignored. %1$s field should only contain a valid WordPress version such as %2$s or %3$s.', 'wporg-plugins' ), 77 '<code>Requires at least</code>', 78 '<code>' . number_format( $latest_wordpress_version, 1 ) . '</code>', 79 '<code>' . number_format( $latest_wordpress_version - 0.1, 1 ) . '</code>' 80 ); 81 } elseif ( empty( $readme->requires ) ) { 72 82 /* translators: %s: plugin header tag */ 73 83 $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Requires at least</code>' ); 74 84 } 75 if ( empty( $readme->tested ) ) { 85 86 if ( isset( $readme->warnings['tested_header_ignored'] ) ) { 87 $latest_wordpress_version = defined( 'WP_CORE_STABLE_BRANCH' ) ? WP_CORE_STABLE_BRANCH : '5.0'; 88 89 /* translators: 1: plugin header tag; 2: Example version 5.0. 3: Example version 5.1. */ 90 $warnings[] = sprintf( 91 __( 'The Tested up to field was ignored. %1$s field should only contain a valid WordPress version such as %2$s or %3$s.', 'wporg-plugins' ), 92 '<code>Tested up to</code>', 93 '<code>' . number_format( $latest_wordpress_version, 1 ) . '</code>', 94 '<code>' . number_format( $latest_wordpress_version + 0.1, 1 ) . '</code>' 95 ); 96 } elseif ( empty( $readme->tested ) ) { 76 97 /* translators: %s: plugin header tag */ 77 98 $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Tested up to</code>' ); 78 99 } 79 if ( isset( $readme->warnings['requires_php_ignored'] ) ) { 100 101 if ( isset( $readme->warnings['requires_php_header_ignored'] ) ) { 80 102 /* translators: 1: plugin header tag; 2: Example version 5.2.4. 3: Example version 7.0. */ 81 103 $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>' ); … … 88 110 $warnings[] = sprintf( __( '%1$s field is missing. Hint: If you treat %2$s as stable, put %3$s.', 'wporg-plugins' ), '<code>Stable tag</code>', '<code>/trunk/</code>', '<code>Stable tag: trunk</code>' ); 89 111 } 90 if ( ! count( $readme->contributors ) ) { 91 /* translators: %s: plugin header tag */ 92 $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Contributors</code>' ); 93 } 112 94 113 if ( isset( $readme->warnings['contributor_ignored'] ) ) { 95 114 /* translators: %s: plugin header tag */ 96 115 $warnings[] = sprintf( __( 'One or more contributors listed were ignored. %s field should only contain WordPress.org usernames.', 'wporg-plugins' ), '<code>Contributors</code>' ); 116 } elseif ( ! count( $readme->contributors ) ) { 117 /* translators: %s: plugin header tag */ 118 $warnings[] = sprintf( __( '%s field is missing.', 'wporg-plugins' ), '<code>Contributors</code>' ); 97 119 } 98 120
Note: See TracChangeset
for help on using the changeset viewer.