From b747fd575d17e5b0138d7d6688a6925739901b6c Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 17 Jan 2025 10:16:30 -0800 Subject: [PATCH] Change Site Health test from critical back to recommended Co-authored-by: felixarntz --- plugins/optimization-detective/site-health.php | 4 ++-- plugins/optimization-detective/tests/test-site-health.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/optimization-detective/site-health.php b/plugins/optimization-detective/site-health.php index 3a989816c4..0c4a47d0d3 100644 --- a/plugins/optimization-detective/site-health.php +++ b/plugins/optimization-detective/site-health.php @@ -110,7 +110,7 @@ function od_compose_site_health_result( $response ): array { $error_description_html = '

' . esc_html__( 'You may have a plugin active or server configuration which restricts access to logged-in users. Unauthenticated access must be restored in order for Optimization Detective to work.', 'optimization-detective' ) . '

'; if ( is_wp_error( $response ) ) { - $result['status'] = 'critical'; + $result['status'] = 'recommended'; $result['label'] = $error_label; $result['description'] = $common_description_html . $error_description_html . '

' . wp_kses( sprintf( @@ -134,7 +134,7 @@ function od_compose_site_health_result( $response ): array { count( $data['data']['params'] ) > 0 ); if ( ! $is_expected ) { - $result['status'] = 'critical'; + $result['status'] = 'recommended'; $result['label'] = __( 'The Optimization Detective REST API endpoint is unavailable to logged-out users', 'optimization-detective' ); $result['description'] = $common_description_html . $error_description_html . '

' . wp_kses( sprintf( diff --git a/plugins/optimization-detective/tests/test-site-health.php b/plugins/optimization-detective/tests/test-site-health.php index ff105ff18c..8ca97fd51f 100644 --- a/plugins/optimization-detective/tests/test-site-health.php +++ b/plugins/optimization-detective/tests/test-site-health.php @@ -105,13 +105,13 @@ public function data_provider_test_rest_api_availability(): array { 'unauthorized' => array( 'mocked_response' => $this->build_mock_response( ...self::UNAUTHORISED_MOCKED_RESPONSE_ARGS ), 'expected_option' => '1', - 'expected_status' => 'critical', + 'expected_status' => 'recommended', 'expected_unavailable' => true, ), 'forbidden' => array( 'mocked_response' => $this->build_mock_response( ...self::FORBIDDEN_MOCKED_RESPONSE_ARGS ), 'expected_option' => '1', - 'expected_status' => 'critical', + 'expected_status' => 'recommended', 'expected_unavailable' => true, ), 'nginx_forbidden' => array( @@ -123,13 +123,13 @@ public function data_provider_test_rest_api_availability(): array { 'body' => "\n403 Forbidden\n\n

403 Forbidden

\n
nginx
\n\n", ), 'expected_option' => '1', - 'expected_status' => 'critical', + 'expected_status' => 'recommended', 'expected_unavailable' => true, ), 'error' => array( 'mocked_response' => new WP_Error( 'bad', 'Something terrible has happened' ), 'expected_option' => '1', - 'expected_status' => 'critical', + 'expected_status' => 'recommended', 'expected_unavailable' => true, ), );