Skip to content

Commit

Permalink
Change Site Health test from critical back to recommended
Browse files Browse the repository at this point in the history
Co-authored-by: felixarntz <[email protected]>
  • Loading branch information
westonruter and felixarntz committed Jan 17, 2025
1 parent b4736a4 commit b747fd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions plugins/optimization-detective/site-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function od_compose_site_health_result( $response ): array {
$error_description_html = '<p>' . 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' ) . '</p>';

if ( is_wp_error( $response ) ) {
$result['status'] = 'critical';
$result['status'] = 'recommended';
$result['label'] = $error_label;
$result['description'] = $common_description_html . $error_description_html . '<p>' . wp_kses(
sprintf(
Expand All @@ -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 . '<p>' . wp_kses(
sprintf(
Expand Down
8 changes: 4 additions & 4 deletions plugins/optimization-detective/tests/test-site-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -123,13 +123,13 @@ public function data_provider_test_rest_api_availability(): array {
'body' => "<html>\n<head><title>403 Forbidden</title></head>\n<body>\n<center><h1>403 Forbidden</h1></center>\n<hr><center>nginx</center>\n</body>\n</html>",
),
'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,
),
);
Expand Down

0 comments on commit b747fd5

Please sign in to comment.