Make WordPress Core

Changeset 45239


Ignore:
Timestamp:
04/18/2019 12:33:03 AM (7 years ago)
Author:
azaozz
Message:

Site Health info tab: Remove the "Directories and Sizes" section on Multisite installations. Most of the info shown there doesn't apply for multisite.

Props xkon, desrosj, azaozz.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/site-health.js

    r45220 r45239  
    1616    var clipboard = new ClipboardJS( '.site-health-copy-buttons .copy-button' );
    1717    var isDebugTab = $( '.health-check-body.health-check-debug-tab' ).length;
     18    var pathsSizesSection = $( '#health-check-accordion-block-wp-paths-sizes' );
    1819
    1920    // Debug information copy section.
     
    296297        copyButton.attr( 'data-clipboard-text', clipdoardText );
    297298
    298         $( '#health-check-accordion-block-wp-paths-sizes' ).find( 'td[class]' ).each( function( i, element ) {
     299        pathsSizesSection.find( 'td[class]' ).each( function( i, element ) {
    299300            var td = $( element );
    300301            var name = td.attr( 'class' );
     
    307308
    308309    if ( isDebugTab ) {
    309         getDirectorySizes();
     310        if ( pathsSizesSection.length ) {
     311            getDirectorySizes();
     312        } else {
     313            RecalculateProgression();
     314        }
    310315    }
    311316} );
  • trunk/src/wp-admin/includes/ajax-actions.php

    r45220 r45239  
    49684968    check_ajax_referer( 'health-check-site-status-result' );
    49694969
    4970     if ( ! current_user_can( 'install_plugins' ) ) {
     4970    if ( ! current_user_can( 'install_plugins' ) || is_multisite() ) {
    49714971        wp_send_json_error();
    49724972    }
  • trunk/src/wp-admin/includes/class-wp-debug-data.php

    r45237 r45239  
    110110        );
    111111
    112         $info['wp-paths-sizes'] = array(
    113             'label'  => __( 'Directories and Sizes' ),
    114             'fields' => array(),
    115         );
     112        if ( ! $is_multisite ) {
     113            $info['wp-paths-sizes'] = array(
     114                'label'  => __( 'Directories and Sizes' ),
     115                'fields' => array(),
     116            );
     117        }
    116118
    117119        $info['wp-dropins'] = array(
     
    390392        }
    391393
    392         $loading = __( 'Loading…' );
    393 
    394         $info['wp-paths-sizes']['fields'] = array(
    395             'wordpress_path' => array(
    396                 'label' => __( 'WordPress directory location' ),
    397                 'value' => untrailingslashit( ABSPATH ),
    398             ),
    399             'wordpress_size' => array(
    400                 'label' => __( 'WordPress directory size' ),
    401                 'value' => $loading,
    402                 'debug' => 'loading...',
    403             ),
    404             'uploads_path'   => array(
    405                 'label' => __( 'Uploads directory location' ),
    406                 'value' => $upload_dir['basedir'],
    407             ),
    408             'uploads_size'   => array(
    409                 'label' => __( 'Uploads directory size' ),
    410                 'value' => $loading,
    411                 'debug' => 'loading...',
    412             ),
    413             'themes_path'    => array(
    414                 'label' => __( 'Themes directory location' ),
    415                 'value' => get_theme_root(),
    416             ),
    417             'themes_size'    => array(
    418                 'label' => __( 'Themes directory size' ),
    419                 'value' => $loading,
    420                 'debug' => 'loading...',
    421             ),
    422             'plugins_path'   => array(
    423                 'label' => __( 'Plugins directory location' ),
    424                 'value' => WP_PLUGIN_DIR,
    425             ),
    426             'plugins_size'   => array(
    427                 'label' => __( 'Plugins directory size' ),
    428                 'value' => $loading,
    429                 'debug' => 'loading...',
    430             ),
    431             'database_size'  => array(
    432                 'label' => __( 'Database size' ),
    433                 'value' => $loading,
    434                 'debug' => 'loading...',
    435             ),
    436             'total_size'     => array(
    437                 'label' => __( 'Total installation size' ),
    438                 'value' => $loading,
    439                 'debug' => 'loading...',
    440             ),
    441         );
     394        // Remove accordion for Directories and Sizes if in Multisite.
     395        if ( ! $is_multisite ) {
     396            $loading = __( 'Loading…' );
     397
     398            $info['wp-paths-sizes']['fields'] = array(
     399                'wordpress_path' => array(
     400                    'label' => __( 'WordPress directory location' ),
     401                    'value' => untrailingslashit( ABSPATH ),
     402                ),
     403                'wordpress_size' => array(
     404                    'label' => __( 'WordPress directory size' ),
     405                    'value' => $loading,
     406                    'debug' => 'loading...',
     407                ),
     408                'uploads_path'   => array(
     409                    'label' => __( 'Uploads directory location' ),
     410                    'value' => $upload_dir['basedir'],
     411                ),
     412                'uploads_size'   => array(
     413                    'label' => __( 'Uploads directory size' ),
     414                    'value' => $loading,
     415                    'debug' => 'loading...',
     416                ),
     417                'themes_path'    => array(
     418                    'label' => __( 'Themes directory location' ),
     419                    'value' => get_theme_root(),
     420                ),
     421                'themes_size'    => array(
     422                    'label' => __( 'Themes directory size' ),
     423                    'value' => $loading,
     424                    'debug' => 'loading...',
     425                ),
     426                'plugins_path'   => array(
     427                    'label' => __( 'Plugins directory location' ),
     428                    'value' => WP_PLUGIN_DIR,
     429                ),
     430                'plugins_size'   => array(
     431                    'label' => __( 'Plugins directory size' ),
     432                    'value' => $loading,
     433                    'debug' => 'loading...',
     434                ),
     435                'database_size'  => array(
     436                    'label' => __( 'Database size' ),
     437                    'value' => $loading,
     438                    'debug' => 'loading...',
     439                ),
     440                'total_size'     => array(
     441                    'label' => __( 'Total installation size' ),
     442                    'value' => $loading,
     443                    'debug' => 'loading...',
     444                ),
     445            );
     446        }
    442447
    443448        // Get a list of all drop-in replacements.
Note: See TracChangeset for help on using the changeset viewer.