[wp-trac] [WordPress Trac] #52112: get_test_rest_availability() test should point to diffrent endpoint (where no current_user_can() check is made)
WordPress Trac
noreply at wordpress.org
Fri May 7 20:13:41 UTC 2021
#52112: get_test_rest_availability() test should point to diffrent endpoint (where
no current_user_can() check is made)
----------------------------------------+---------------------
Reporter: szaqal21 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.8
Component: Site Health | Version: 5.6
Severity: normal | Resolution:
Keywords: needs-patch good-first-bug | Focuses:
----------------------------------------+---------------------
Changes (by Clorith):
* keywords: => needs-patch good-first-bug
* milestone: Awaiting Review => 5.8
Comment:
With [49334] the concept of `skip_cron` was added to tests. This, when
set, will make sure that a test can only be ran when the request comes
from a user navigating to the Site Health page, and not when a cron event
runs. This sounds like the same use-case as discussed here.
That means that to resolve this, one would want to add `'skip_cron' =>
true,` to the test registration, and also replicate the check for
[https://github.com/WordPress/wordpress-
develop/blob/d5407ec71923be8e3453e8aca267a0ed65bbc59a/src/wp-
admin/includes/class-wp-site-health.php#L2751-L2753 `skip_cron` check]
that is in the [https://github.com/WordPress/wordpress-
develop/blob/d5407ec71923be8e3453e8aca267a0ed65bbc59a/src/wp-
admin/includes/class-wp-site-health.php#L2712
`WP_Site_Health::wp_cron_scheduled_check()`] function to also look for
this in [https://github.com/WordPress/wordpress-
develop/blob/d5407ec71923be8e3453e8aca267a0ed65bbc59a/src/wp-
admin/includes/class-wp-site-health.php#L2731 direct tests runner
section].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52112#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list