Make WordPress Core

Changeset 45275


Ignore:
Timestamp:
05/01/2019 06:07:46 PM (6 years ago)
Author:
desrosj
Message:

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.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-health-auto-updates.php

    r45223 r45275  
    8787     */
    8888    public function test_wp_version_check_attached() {
     89        if ( ! is_main_site() ) {
     90            return;
     91        }
     92
    8993        $cookies = wp_unslash( $_COOKIE );
    9094        $timeout = 10;
  • trunk/src/wp-admin/includes/class-wp-site-health.php

    r45260 r45275  
    367367
    368368        // Check if there are inactive plugins.
    369         if ( $plugins_total > $plugins_active ) {
     369        if ( $plugins_total > $plugins_active && ! is_multisite() ) {
    370370            $unused_plugins = $plugins_total - $plugins_active;
    371371
     
    522522        }
    523523
    524         if ( $has_unused_themes && $show_unused_themes ) {
     524        if ( $has_unused_themes && $show_unused_themes && ! is_multisite() ) {
    525525
    526526            // This is a child theme, so we want to be a bit more explicit in our messages.
Note: See TracChangeset for help on using the changeset viewer.