Repository navigation
Conversation
`WP_Site_Health_Auto_Updates::test_wp_version_check_attached()` reports a plugin removing `wp_version_check()` from its hook. On multisite, [50035] limited it to the main site, because wp-includes/update.php only adds the hook there. The condition also requires `is_network_admin()`, but Site Health has no network admin screen, and the background updates test runs through the REST API, so the test never reports a problem on multisite. The single site baseline and the test for other sites pass. The main site test fails. See #52135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds tests showing that Site Health never reports a plugin removing
wp_version_check()from its hook on multisite.WP_Site_Health_Auto_Updates::test_wp_version_check_attached()reports the problem when this condition is true:The
is_main_site()part was added in r50035 (#52135).wp-includes/update.phponly adds the hook on the main site, so every other site in a network got a false "A plugin has prevented updates by disablingwp_version_check()" error. The condition also requiresis_network_admin(), though. Site Health has no network admin screen, and the background updates test runs through the REST API (wp-site-health/v1/tests/background-updates), whereis_network_admin()is false. So on multisite, the test never reports anything, even on the main site.Tests:
test_wp_version_check_attached_should_report_removed_check()(ms-excluded, passes): the single site baseline.test_wp_version_check_attached_should_report_removed_check_on_main_site()(ms-required, fails): on the main site, outside the network admin, the test returnsnullinstead of a failure.test_wp_version_check_attached_should_not_report_on_other_sites()(ms-required, passes): keeps the #52135 fix in place for sites other than the main site.Tests only. Changing the condition to
( ! is_multisite() || is_main_site() )makes all three pass. I tried that locally but haven't included it here.Trac ticket: Core-66682.
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Tracing the condition back to #52135, and drafting the tests and this description. To be reviewed by me.
🤖 Generated with Claude Code
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.