From 447536a0e66f069814cb9045adc98f64189265cd Mon Sep 17 00:00:00 2001 From: desrosj Date: Tue, 18 Feb 2020 16:48:06 +0000 Subject: [PATCH] Site Health: Display the REST API test error codes correctly. This change fixes an issue where the error codes associated with failed REST API tests are not being printed to the screen. In addition, the square brackets have been replaced with parentheses for consistency, and the error code (which is much less useful to end-users than the error message itself) has been moved to the end of the line. This also clarifies the associated translator comments. Props afercia, desrosj. Fixes #49426. Built from https://develop.svn.wordpress.org/trunk@47306 git-svn-id: http://core.svn.wordpress.org/trunk@47106 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-site-health.php | 18 +++++++++--------- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/wp-admin/includes/class-wp-site-health.php b/wp-admin/includes/class-wp-site-health.php index 46fd08849b..ef607c581a 100644 --- a/wp-admin/includes/class-wp-site-health.php +++ b/wp-admin/includes/class-wp-site-health.php @@ -1863,10 +1863,10 @@ class WP_Site_Health { '%s
%s', __( 'The REST API request failed due to an error.' ), sprintf( - /* translators: 1: The HTTP response code. 2: The error message returned. */ - __( 'Error: [%1$s] %2$s' ), - wp_remote_retrieve_response_code( $r ), - $r->get_error_message() + /* translators: 1: The WordPress error message. 2: The WordPress error code. */ + __( 'Error: %1$s (%2$s)' ), + $r->get_error_message(), + $r->get_error_code() ) ) ); @@ -1878,7 +1878,7 @@ class WP_Site_Health { $result['description'] .= sprintf( '

%s

', sprintf( - /* translators: 1: The HTTP response code returned. 2: The error message returned. */ + /* translators: 1: The HTTP error code. 2: The HTTP error message. */ __( 'The REST API call gave the following unexpected result: (%1$d) %2$s.' ), wp_remote_retrieve_response_code( $r ), wp_remote_retrieve_body( $r ) @@ -2185,10 +2185,10 @@ class WP_Site_Health { '%s
%s', __( 'The loopback request to your site failed, this means features relying on them are not currently working as expected.' ), sprintf( - /* translators: 1: The HTTP response code. 2: The error message returned. */ - __( 'Error: [%1$s] %2$s' ), - wp_remote_retrieve_response_code( $r ), - $r->get_error_message() + /* translators: 1: The WordPress error message. 2: The WordPress error code. */ + __( 'Error: %1$s (%2$s)' ), + $r->get_error_message(), + $r->get_error_code() ) ), ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 407e8ff2d5..456d3547fa 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-beta1-47305'; +$wp_version = '5.4-beta1-47306'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.