Make WordPress Core

Opened 6 months ago

#63507 new defect (bug)

Loopback tests should run on admin-ajax again

Reported by: kkmuffme's profile kkmuffme Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

Loopback requests were initially implemented to run a generic admin_url()
This was then changed to use the wp-json API https://core.trac.wordpress.org/changeset/49154 and subequently the site_url(), then home_url()
https://github.com/WordPress/wordpress-develop/commit/dad6b61cfb6fa3016f5f469e4b2c6a8b39b6f046
https://github.com/WordPress/wordpress-develop/commit/85c8cca7d14ab45870cdc57d07f43c5d5e9e953d
https://github.com/WordPress/wordpress-develop/commit/e686cb1b0e7061477cc1b2f537f64e053366d0b8
due to various issues and now currently checks wp-cron.php

However, this wp-cron.php check does not usefully validate that loopbacks actually work, since all WP and plugins use admin-ajax.php for loopbacks (e.g. woocommerce action scheduler) and validating cron isn't useful there.
In contrast there is only a single possible scenario where a wp-cron.php loopback happens - and that is when actually starting wp-cron.php

Since admin-ajax.php also works unauthenticated (unlike previous wp-admin calls, which caused other side effects), this makes more sense and won't have the issue of the original admin_url() loopback test, as well as none of the issues of the loopback tests encountered when using home_url()/site_url()

Additionally, when the DISABLE_WP_CRON constant is defined because cron is only run via CLI, servers are often set up to block public access to wp-cron.php, causing the healthcheck to incorrectly report that loopbacks do not work - when in fact they do, just not for wp-cron.php, bc it's disabled.

Changing the loopback URL https://github.com/WordPress/wordpress-develop/blame/trunk/src/wp-admin/includes/class-wp-site-health.php#L3128 to run on admin_url( 'admin-ajax.php' ) ensures that loopback tests usefully test the loopback capability.

Change History (0)

Note: See TracTickets for help on using tickets.