Skip to content

Commit

Permalink
Warn for invalid tested up to value
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Sep 6, 2024
1 parent 25c033e commit facea99
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions includes/Checker/Checks/Plugin_Repo/Plugin_Readme_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,22 @@ private function check_headers( Check_Result $result, string $readme_file, Parse
'https://developer.wordpress.org/plugins/wordpress-org/how-your-readme-txt-works/#readme-header-information',
7
);
} elseif ( version_compare( $parser->{$field_key}, number_format( (float) $latest_wordpress_version + 0.1, 1 ), '>' ) ) {
$this->add_result_error_for_file(
$result,
sprintf(

Check warning on line 199 in includes/Checker/Checks/Plugin_Repo/Plugin_Readme_Check.php

View check run for this annotation

Codecov / codecov/patch

includes/Checker/Checks/Plugin_Repo/Plugin_Readme_Check.php#L196-L199

Added lines #L196 - L199 were not covered by tests
/* translators: 1: currently used version, 2: 'Tested up to' */
__( '<strong>Tested up to: %1$s.</strong><br>The "%2$s" value in your plugin is not valid. This version of WordPress does not exist (yet).', 'plugin-check' ),
$parser->{$field_key},
'Tested up to'
),
'nonexistent_tested_upto_header',
$readme_file,
0,
0,
'https://developer.wordpress.org/plugins/wordpress-org/how-your-readme-txt-works/#readme-header-information',
7

Check warning on line 210 in includes/Checker/Checks/Plugin_Repo/Plugin_Readme_Check.php

View check run for this annotation

Codecov / codecov/patch

includes/Checker/Checks/Plugin_Repo/Plugin_Readme_Check.php#L201-L210

Added lines #L201 - L210 were not covered by tests
);
}
} else {
if ( empty( $parser->{$field_key} ) ) {
Expand Down

0 comments on commit facea99

Please sign in to comment.