diff --git a/includes/Checker/Checks/General/I18n_Usage_Check.php b/includes/Checker/Checks/General/I18n_Usage_Check.php index 3678c3758..79e69db0b 100644 --- a/includes/Checker/Checks/General/I18n_Usage_Check.php +++ b/includes/Checker/Checks/General/I18n_Usage_Check.php @@ -128,6 +128,21 @@ protected function add_result_message_for_file( Check_Result $result, $error, $m break; } + // Update severity. + switch ( $code ) { + case 'WordPress.WP.I18n.InterpolatedVariableDomain': + case 'WordPress.WP.I18n.MissingArgText': + case 'WordPress.WP.I18n.NoEmptyStrings': + case 'WordPress.WP.I18n.NonSingularStringLiteralContext': + case 'WordPress.WP.I18n.NonSingularStringLiteralDomain': + case 'WordPress.WP.I18n.TooManyFunctionArgs': + $severity = 7; + break; + + default: + break; + } + parent::add_result_message_for_file( $result, $error, $message, $code, $file, $line, $column, $docs, $severity ); } } diff --git a/tests/behat/features/plugin-check.feature b/tests/behat/features/plugin-check.feature index 18f74797e..a90fec119 100644 --- a/tests/behat/features/plugin-check.feature +++ b/tests/behat/features/plugin-check.feature @@ -750,3 +750,53 @@ Feature: Test that the WP-CLI command works. """ application_detected """ + + Scenario: Check for i18n severity + Given a WP install with the Plugin Check plugin + And a wp-content/plugins/foo-sample/foo-sample.php file: + """ +