From 48c83a56928c7410e9b3039aa25d6e21a5d960eb Mon Sep 17 00:00:00 2001 From: Aditya Dhade Date: Wed, 25 Dec 2024 23:30:46 +0530 Subject: [PATCH] Improve site health status messages for clarity and consistency --- .../site-health/rest-api/helper.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/optimization-detective/site-health/rest-api/helper.php b/plugins/optimization-detective/site-health/rest-api/helper.php index fa9a7263a..bbda348a9 100644 --- a/plugins/optimization-detective/site-health/rest-api/helper.php +++ b/plugins/optimization-detective/site-health/rest-api/helper.php @@ -19,7 +19,7 @@ */ function od_optimization_detective_rest_api_test(): array { $result = array( - 'label' => __( 'Your site has functional Optimization Detective REST API endpoint', 'optimization-detective' ), + 'label' => __( 'The REST API endpoint is functional.', 'optimization-detective' ), 'status' => 'good', 'badge' => array( 'label' => __( 'Optimization Detective', 'optimization-detective' ), @@ -27,7 +27,7 @@ function od_optimization_detective_rest_api_test(): array { ), 'description' => sprintf( '

%s

', - __( 'Optimization Detective can send and store URL metrics via REST API endpoint', 'optimization-detective' ) + __( 'Your site can send and receive URL metrics via the REST API endpoint.', 'optimization-detective' ) ), 'actions' => '', 'test' => 'optimization_detective_rest_api', @@ -44,10 +44,10 @@ function od_optimization_detective_rest_api_test(): array { if ( is_wp_error( $response ) ) { $result['status'] = 'recommended'; - $result['label'] = __( 'Your site encountered error accessing Optimization Detective REST API endpoint', 'optimization-detective' ); + $result['label'] = __( 'Error accessing the REST API endpoint', 'optimization-detective' ); $result['description'] = sprintf( '

%s

', - esc_html__( 'The Optimization Detective endpoint could not be reached. This might mean the REST API is disabled or blocked.', 'optimization-detective' ) + esc_html__( 'There was an issue reaching the REST API endpoint. This might be due to server settings or the REST API being disabled.', 'optimization-detective' ) ); $info = array( 'error_message' => $response->get_error_message(), @@ -73,24 +73,24 @@ function od_optimization_detective_rest_api_test(): array { $info['available'] = true; } elseif ( 401 === $status_code ) { $result['status'] = 'recommended'; - $result['label'] = __( 'Your site encountered unauthorized error for Optimization Detective REST API endpoint', 'optimization-detective' ); + $result['label'] = __( 'Authorization should not be required to access the REST API endpoint.', 'optimization-detective' ); $result['description'] = sprintf( '

%s

', - esc_html__( 'The REST API endpoint requires authentication. Ensure proper credentials are provided.', 'optimization-detective' ) + esc_html__( 'To collect URL metrics, the REST API endpoint should be accessible without requiring authorization.', 'optimization-detective' ) ); } elseif ( 403 === $status_code ) { $result['status'] = 'recommended'; - $result['label'] = __( 'Your site encountered forbidden error for Optimization Detective REST API endpoint', 'optimization-detective' ); + $result['label'] = __( 'The REST API endpoint should not be forbidden.', 'optimization-detective' ); $result['description'] = sprintf( '

%s

', - esc_html__( 'The REST API endpoint is blocked check server or security settings.', 'optimization-detective' ) + esc_html__( 'The REST API endpoint is blocked. Please review your server or security settings.', 'optimization-detective' ) ); } else { $result['status'] = 'recommended'; - $result['label'] = __( 'Your site encountered error accessing Optimization Detective REST API endpoint', 'optimization-detective' ); + $result['label'] = __( 'Error accessing the REST API endpoint', 'optimization-detective' ); $result['description'] = sprintf( '

%s

', - esc_html__( 'The Optimization Detective endpoint could not be reached. This might mean the REST API is disabled or blocked.', 'optimization-detective' ) + esc_html__( 'There was an issue reaching the REST API endpoint. This might be due to server settings or the REST API being disabled.', 'optimization-detective' ) ); } $info['error_message'] = $result['label'];