@@ -1307,7 +1307,7 @@ public function get_test_dotorg_communication() {
13071307 );
13081308
13091309 $ wp_dotorg = wp_remote_get (
1310- WP_UPDATE_API_DEFAULT ,
1310+ ' http:// ' . WP_UPDATE_API_DEFAULT . ' / ' ,
13111311 array (
13121312 'timeout ' => 10 ,
13131313 )
@@ -1350,7 +1350,7 @@ public function get_test_dotorg_communication() {
13501350 /**
13511351 * Tests if the site can communicate with a non-default update API endpoint.
13521352 *
1353- * @since 6.9 .0
1353+ * @since 7.0 .0
13541354 *
13551355 * @return array The test results.
13561356 */
@@ -1371,7 +1371,7 @@ public function get_test_alt_update_api_communication() {
13711371 );
13721372
13731373 $ wp_update_api = wp_remote_get (
1374- wp_get_update_api_base (),
1374+ wp_get_api_request_url (),
13751375 array (
13761376 'timeout ' => 10 ,
13771377 )
@@ -1392,8 +1392,8 @@ public function get_test_alt_update_api_communication() {
13921392 sprintf (
13931393 /* translators: 1: update API URL. 2: The IP address the update API endpoint resolves to. 3: The error returned by the lookup. */
13941394 __ ( 'Your site is unable to reach the specified update API endpoint (%s) at %s, and returned the error: %s ' ),
1395- wp_get_update_api_base (),
1396- gethostbyname ( parse_url ( wp_get_update_api_base (), PHP_URL_HOST ) ),
1395+ wp_get_api_request_url (),
1396+ gethostbyname ( parse_url ( wp_get_api_request_url (), PHP_URL_HOST ) ),
13971397 $ wp_update_api ->get_error_message ()
13981398 )
13991399 )
@@ -1402,7 +1402,7 @@ public function get_test_alt_update_api_communication() {
14021402 $ result ['actions ' ] = sprintf (
14031403 /* translators: URL of update API */
14041404 __ ('Contact the owners of %s for support. ' ),
1405- wp_get_update_api_base ()
1405+ wp_get_api_request_url ()
14061406 );
14071407 }
14081408
@@ -2929,7 +2929,7 @@ public static function get_tests() {
29292929 }
29302930
29312931 // Only check alternate update API endpoint if one has been configured.
2932- if ( WP_UPDATE_API_DEFAULT !== wp_get_update_api_base ( ) ) {
2932+ if ( WP_UPDATE_API_DEFAULT !== parse_url ( wp_get_api_request_url (), PHP_URL_HOST ) ) {
29332933 $ tests ['async ' ]['alt_update_api_communication ' ] = array (
29342934 'label ' => __ ( 'Communication with update API ' ),
29352935 'test ' => rest_url ( 'wp-site-health/v1/tests/alt-update-api-communication ' ),
0 commit comments