Skip to content

Commit

Permalink
changed to ERROR_EXTRA as suggested
Browse files Browse the repository at this point in the history
  • Loading branch information
davidperezgar committed Oct 18, 2024
1 parent 16a33d1 commit 57950b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions includes/CLI/Plugin_Check_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,8 @@ private function get_filtered_results_by_severity( $results, $error_severity, $w
if ( 'ERROR' === $item['type'] && $item['severity'] >= $error_severity ) {
$errors[] = $item;
} elseif ( $include_low_severity_errors && 'ERROR' === $item['type'] && $item['severity'] < $error_severity ) {
$item['type'] = 'WARNING';
$item['severity'] = 10;
$warnings[] = $item;
$item['type'] = 'ERROR_EXTRA';
$warnings[] = $item;
} elseif ( 'WARNING' === $item['type'] && $item['severity'] >= $warning_severity ) {
$warnings[] = $item;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/behat/features/plugin-check-severity.feature
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ Feature: Test that the severity level in plugin check works.
"""
And STDOUT should contain:
"""
default_readme_text,WARNING,7
WordPress.WP.AlternativeFunctions.rand_mt_rand,ERROR_EXTRA,5
"""
And STDOUT should contain:
"""
upgrade_notice_limit,WARNING,10
WordPress.Security.EscapeOutput.OutputNotEscaped,ERROR_EXTRA,5
"""

When I run the WP-CLI command `plugin check foo-bar-wp --format=csv --fields=code,type,severity --severity=10`
Expand Down

0 comments on commit 57950b1

Please sign in to comment.