[wp-trac] [WordPress Trac] #63507: Loopback tests should run on admin-ajax again

WordPress Trac noreply at wordpress.org
Sun Jun 1 19:17:41 UTC 2025


#63507: Loopback tests should run on admin-ajax again
--------------------------+-----------------------------
 Reporter:  kkmuffme      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63507>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list