diff --git a/includes/Checker/Checks/Plugin_Readme_Check.php b/includes/Checker/Checks/Plugin_Readme_Check.php index 3e65aa266..dece0c9ba 100644 --- a/includes/Checker/Checks/Plugin_Readme_Check.php +++ b/includes/Checker/Checks/Plugin_Readme_Check.php @@ -212,29 +212,29 @@ private function check_for_warnings( Check_Result $result, string $readme_file, $messages = array( 'contributor_ignored' => sprintf( /* translators: %s: plugin header tag */ - __( 'One or more contributors listed were ignored. The %s field should only contain WordPress.org usernames. Remember that usernames are case-sensitive.', 'plugin-check' ), - "'Contributors'" + __( 'One or more contributors listed were ignored. The "%s" field should only contain WordPress.org usernames. Remember that usernames are case-sensitive.', 'plugin-check' ), + 'Contributors' ), 'requires_php_header_ignored' => sprintf( /* translators: 1: plugin header tag; 2: Example version 5.2.4. 3: Example version 7.0. */ - __( 'The %1$s field was ignored. This field should only contain a PHP version such as %2$s or %3$s.', 'plugin-check' ), - "'Requires PHP'", - "'5.2.4'", - "'7.0'" + __( 'The "%1$s" field was ignored. This field should only contain a PHP version such as "%2$s" or "%3$s".', 'plugin-check' ), + 'Requires PHP', + '5.2.4', + '7.0' ), 'tested_header_ignored' => sprintf( /* translators: 1: plugin header tag; 2: Example version 5.0. 3: Example version 5.1. */ - __( 'The %1$s field was ignored. This field should only contain a valid WordPress version such as %2$s or %3$s.', 'plugin-check' ), - "'Tested up to'", - "'" . number_format( $latest_wordpress_version, 1 ) . "'", - "'" . number_format( $latest_wordpress_version + 0.1, 1 ) . "'" + __( 'The "%1$s" field was ignored. This field should only contain a valid WordPress version such as "%2$s" or "%3$s".', 'plugin-check' ), + 'Tested up to', + number_format( $latest_wordpress_version, 1 ), + number_format( $latest_wordpress_version + 0.1, 1 ) ), 'requires_header_ignored' => sprintf( /* translators: 1: plugin header tag; 2: Example version 5.0. 3: Example version 4.9. */ - __( 'The %1$s field was ignored. This field should only contain a valid WordPress version such as %2$s or %3$s.', 'plugin-check' ), - "'Requires at least'", - "'" . number_format( $latest_wordpress_version, 1 ) . "'", - "'" . number_format( $latest_wordpress_version - 0.1, 1 ) . "'" + __( 'The "%1$s" field was ignored. This field should only contain a valid WordPress version such as "%2$s" or "%3$s".', 'plugin-check' ), + 'Requires at least', + number_format( $latest_wordpress_version, 1 ), + number_format( $latest_wordpress_version - 0.1, 1 ) ), 'too_many_tags' => sprintf( /* translators: %d: maximum tags limit */ @@ -244,17 +244,17 @@ private function check_for_warnings( Check_Result $result, string $readme_file, 'ignored_tags' => sprintf( /* translators: %s: list of tags not supported */ __( 'One or more tags were ignored. The following tags are not permitted: %s', 'plugin-check' ), - "'" . implode( "', '", $parser->ignore_tags ) . "'" + '"' . implode( '", "', $parser->ignore_tags ) . '"' ), 'no_short_description_present' => sprintf( /* translators: %s: section title */ - __( 'The %s section is missing. An excerpt was generated from your main plugin description.', 'plugin-check' ), - "'Short Description'" + __( 'The "%s" section is missing. An excerpt was generated from your main plugin description.', 'plugin-check' ), + 'Short Description' ), 'trimmed_short_description' => sprintf( /* translators: 1: section title; 2: maximum limit */ - _n( 'The %1$s section is too long and was truncated. A maximum of %2$d character is supported.', 'The %1$s section is too long and was truncated. A maximum of %2$d characters is supported.', 150, 'plugin-check' ), - "'Short Description'", + _n( 'The "%1$s" section is too long and was truncated. A maximum of %2$d character is supported.', 'The "%1$s" section is too long and was truncated. A maximum of %2$d characters is supported.', 150, 'plugin-check' ), + 'Short Description', 150 ), ); @@ -291,7 +291,7 @@ private function get_wordpress_stable_version() { if ( false === $version ) { $response = wp_remote_get( 'https://api.wordpress.org/core/version-check/1.7/' ); - if ( ! is_wp_error( $response ) ) { + if ( ! is_wp_error( $response ) && 200 === wp_remote_retrieve_response_code( $response ) ) { $body = json_decode( wp_remote_retrieve_body( $response ), true ); if ( isset( $body['offers'] ) && ! empty( $body['offers'] ) ) {