Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update error message for several error codes #828

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes/Checker/Checks/Plugin_Repo/File_Type_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function ( $file ) use ( $plugin_path ) {
if ( $badly_name ) {
$this->add_result_error_for_file(
$result,
__( 'Badly named files are not permitted.', 'plugin-check' ),
__( 'File and folder names must not contain spaces or special characters.', 'plugin-check' ),
'badly_named_files',
$file,
0,
Expand Down
33 changes: 25 additions & 8 deletions includes/Checker/Checks/Plugin_Repo/Plugin_Readme_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@
$this->add_result_error_for_file(
$result,
sprintf(
/* translators: %s: plugin header tag */
__( '<strong>Your readme is either missing or incomplete.</strong><br>The "%s" field is missing. Your readme has to have headers as well as a proper description and documentation as to how it works and how one can use it.', 'plugin-check' ),
/* translators: %s: readme header field */
__( '<strong>Missing "%s".</strong><br>Your readme has to have headers as well as a proper description and documentation as to how it works and how one can use it.', 'plugin-check' ),
$field['label']
),
'missing_readme_header',
Expand Down Expand Up @@ -313,7 +313,11 @@
if ( empty( $license ) ) {
$this->add_result_error_for_file(
$result,
__( '<strong>Your plugin has no license declared.</strong><br>Please update your readme with a GPLv2 (or later) compatible license. It is necessary to declare the license of this plugin. You can do this by using the fields available both in the plugin readme and in the plugin headers.', 'plugin-check' ),
sprintf(
/* translators: %s: readme header field */
__( '<strong>Missing "%s".</strong><br>Please update your readme with a valid GPLv2 (or later) compatible license.', 'plugin-check' ),
'License'
),
'no_license',
$readme_file,
0,
Expand Down Expand Up @@ -380,7 +384,12 @@
if ( empty( $stable_tag ) ) {
$this->add_result_error_for_file(
$result,
__( "<strong>Incorrect Stable Tag.</strong><br>Your Stable Tag is meant to be the stable version of your plugin, not of WordPress. For your plugin to be properly downloaded from WordPress.org, those values need to be the same. If they're out of sync, your users won't get the right version of your code.", 'plugin-check' ),
sprintf(
/* translators: 1: readme header tag, 2: plugin header tag */
__( '<strong>Invalid or missing %1$s.</strong><br>Your %1$s is meant to be the stable version of your plugin and it needs to be exactly the same with the %2$s in your main plugin file\'s header. Any mismatch can prevent users from downloading the correct plugin files from WordPress.org.', 'plugin-check' ),
'Stable Tag',
'Version'
),
'no_stable_tag',
$readme_file,
0,
Expand All @@ -395,7 +404,13 @@
if ( 'trunk' === $stable_tag ) {
$this->add_result_error_for_file(
$result,
__( "<strong>Incorrect Stable Tag.</strong><br>It's recommended not to use 'Stable Tag: trunk'. Your Stable Tag is meant to be the stable version of your plugin, not of WordPress. For your plugin to be properly downloaded from WordPress.org, those values need to be the same. If they're out of sync, your users won't get the right version of your code.", 'plugin-check' ),
sprintf(
/* translators: 1: readme header tag, 2: example tag, 3: plugin header tag */
__( '<strong>Incorrect %1$s.</strong><br>It\'s recommended not to use "%2$s". Your %1$s is meant to be the stable version of your plugin and it needs to be exactly the same with the %3$s in your main plugin file\'s header. Any mismatch can prevent users from downloading the correct plugin files from WordPress.org.', 'plugin-check' ),
'Stable Tag',
'Stable Tag: trunk',
'Version'
),
'trunk_stable_tag',
$readme_file,
0,
Expand All @@ -417,9 +432,11 @@
$this->add_result_error_for_file(
$result,
sprintf(
/* translators: %s: versions comparison */
__( "<strong>Mismatched Stable Tag: %s.</strong><br>The Stable Tag in your readme file does not match the version in your main plugin file. Your Stable Tag is meant to be the stable version of your plugin, not of WordPress. For your plugin to be properly downloaded from WordPress.org, those values need to be the same. If they're out of sync, your users won't get the right version of your code.", 'plugin-check' ),
esc_html( $stable_tag ) . ' != ' . esc_html( $plugin_data['Version'] )
/* translators: 1: readme header tag, 2: versions comparison, 3: plugin header tag */
__( '<strong>Mismatched %1$s: %2$s.</strong><br>Your %1$s is meant to be the stable version of your plugin and it needs to be exactly the same with the %3$s in your main plugin file\'s header. Any mismatch can prevent users from downloading the correct plugin files from WordPress.org.', 'plugin-check' ),
'Stable Tag',
esc_html( $stable_tag ) . ' != ' . esc_html( $plugin_data['Version'] ),
'Version'

Check warning on line 439 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#L436-L439

Added lines #L436 - L439 were not covered by tests
),
'stable_tag_mismatch',
$readme_file,
Expand Down
Loading