From 85c8cca7d14ab45870cdc57d07f43c5d5e9e953d Mon Sep 17 00:00:00 2001 From: Timothy Jacobs Date: Sat, 2 Jan 2021 20:07:24 +0000 Subject: [PATCH] Site Health: Use a front-end URL for loopback tests. In [49154] the async Site Health tests were changed to use the REST API instead of admin-ajax. An unintended side effect of this change was that the loopback tests which tried to ping the site's `admin_url()` were no longer authenticated because admin-cookies aren't provided to the REST API. This commit adjusts the loopback test to use the front-end `site_url` which checks that cron will function properly. A follow-up ticket will focus on tests that will cover the file editor checks. Props Clorith. Fixes #52097. See #48105. git-svn-id: https://develop.svn.wordpress.org/trunk@49917 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-site-health.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php index 711fe19dc1..19082e73f2 100644 --- a/src/wp-admin/includes/class-wp-site-health.php +++ b/src/wp-admin/includes/class-wp-site-health.php @@ -2545,7 +2545,7 @@ class WP_Site_Health { $headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) ); } - $url = admin_url(); + $url = site_url(); $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) );