From 6ac1d4ec1a4e008d29ee50b931c0e0816505f6cd Mon Sep 17 00:00:00 2001 From: desrosj Date: Wed, 1 May 2019 18:08:53 +0000 Subject: [PATCH] Site Health: Disable recommendations that could be problematic on multisite installs. When viewing Site Health for a multisite install, there are a few recommendations that are not appropriate and could have negative implications for other sites on the install if the administrator follows the advice provided. For example, Site Health recommends that inactive plugins and themes for a site should be removed. On a single site install, this is a great recommendation. However, on a multisite install, inactive plugins and themes for one site should not be removed because they could be active for other sites on the network. This change also disables the `test_wp_version_check_attached()` test for multisite. This test checks for the presence of the `wp_version_check()` function on the `wp_version_check` hook, which is not present for every site on multisite. Reviewed by jeremyfelt and desrosj. Props iandunn, Clorith, azaozz, jeremyfelt. Fixes #47084. Built from https://develop.svn.wordpress.org/trunk@45275 git-svn-id: http://core.svn.wordpress.org/trunk@45084 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-site-health-auto-updates.php | 4 ++++ wp-admin/includes/class-wp-site-health.php | 4 ++-- wp-includes/version.php | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/class-wp-site-health-auto-updates.php b/wp-admin/includes/class-wp-site-health-auto-updates.php index d06ae33cb2..b202235f12 100644 --- a/wp-admin/includes/class-wp-site-health-auto-updates.php +++ b/wp-admin/includes/class-wp-site-health-auto-updates.php @@ -86,6 +86,10 @@ class WP_Site_Health_Auto_Updates { * @return array The test results. */ public function test_wp_version_check_attached() { + if ( ! is_main_site() ) { + return; + } + $cookies = wp_unslash( $_COOKIE ); $timeout = 10; $headers = array( diff --git a/wp-admin/includes/class-wp-site-health.php b/wp-admin/includes/class-wp-site-health.php index f777514617..d7a6786a8d 100644 --- a/wp-admin/includes/class-wp-site-health.php +++ b/wp-admin/includes/class-wp-site-health.php @@ -366,7 +366,7 @@ class WP_Site_Health { } // Check if there are inactive plugins. - if ( $plugins_total > $plugins_active ) { + if ( $plugins_total > $plugins_active && ! is_multisite() ) { $unused_plugins = $plugins_total - $plugins_active; $result['status'] = 'recommended'; @@ -521,7 +521,7 @@ class WP_Site_Health { } } - if ( $has_unused_themes && $show_unused_themes ) { + if ( $has_unused_themes && $show_unused_themes && ! is_multisite() ) { // This is a child theme, so we want to be a bit more explicit in our messages. if ( $active_theme->parent() ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 61471e3beb..4232cc72c4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-RC1-45274'; +$wp_version = '5.2-RC1-45275'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.