Error on multisite: health check – wp_version_check() – WordPress 5.6
-
After updating a wordpress multisite to version 5.6 I see a critical security warning on the health check page of all subsites except the main site:
A plugin has prevented updates by disabling wp_version_check().
I searched where the error message originates and found that it is generated when the function
test_wp_version_check_attached
cannot find a filter for the functionwp_version_check
.So I checked where this filter might be set and I found the following lines in
wp-includes/update.php
close to the end of the file:if ( ( ! is_main_site() && ! is_network_admin() ) || wp_doing_ajax() ) { return; } add_action( 'admin_init', '_maybe_update_core' ); add_action( 'wp_version_check', 'wp_version_check' );
If I understand these lines correctly, there is a
return
statement beforeadd_action( 'wp_version_check', 'wp_version_check' );
can be executed, when eitheris_main_site()
oris_network_admin()
isfalse
. And sinceis_main_site()
is false for all of the subsites’ health check pages, thisreturn
statement will always kick in for those.For testing purposes, I tried the following:
if ( ( ! is_main_site() && ! is_network_admin() ) || wp_doing_ajax() ) { add_action( 'wp_version_check', 'wp_version_check' ); return; } add_action( 'admin_init', '_maybe_update_core' );
and the error message on the health check page of all subsites disappeared.
This looks like a bug to me.
In case it is not, I am thankful for all and any hints of how to get rid of the error.
- The topic ‘Error on multisite: health check – wp_version_check() – WordPress 5.6’ is closed to new replies.