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. git-svn-id: https://develop.svn.wordpress.org/trunk@45239 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6621b2ec0e
commit
288116c9ff
@ -15,6 +15,7 @@ jQuery( document ).ready( function( $ ) {
|
||||
var data;
|
||||
var clipboard = new ClipboardJS( '.site-health-copy-buttons .copy-button' );
|
||||
var isDebugTab = $( '.health-check-body.health-check-debug-tab' ).length;
|
||||
var pathsSizesSection = $( '#health-check-accordion-block-wp-paths-sizes' );
|
||||
|
||||
// Debug information copy section.
|
||||
clipboard.on( 'success', function( e ) {
|
||||
@ -295,7 +296,7 @@ jQuery( document ).ready( function( $ ) {
|
||||
|
||||
copyButton.attr( 'data-clipboard-text', clipdoardText );
|
||||
|
||||
$( '#health-check-accordion-block-wp-paths-sizes' ).find( 'td[class]' ).each( function( i, element ) {
|
||||
pathsSizesSection.find( 'td[class]' ).each( function( i, element ) {
|
||||
var td = $( element );
|
||||
var name = td.attr( 'class' );
|
||||
|
||||
@ -306,6 +307,10 @@ jQuery( document ).ready( function( $ ) {
|
||||
}
|
||||
|
||||
if ( isDebugTab ) {
|
||||
getDirectorySizes();
|
||||
if ( pathsSizesSection.length ) {
|
||||
getDirectorySizes();
|
||||
} else {
|
||||
RecalculateProgression();
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
@ -4967,7 +4967,7 @@ function wp_ajax_health_check_site_status_result() {
|
||||
function wp_ajax_health_check_get_sizes() {
|
||||
check_ajax_referer( 'health-check-site-status-result' );
|
||||
|
||||
if ( ! current_user_can( 'install_plugins' ) ) {
|
||||
if ( ! current_user_can( 'install_plugins' ) || is_multisite() ) {
|
||||
wp_send_json_error();
|
||||
}
|
||||
|
||||
|
@ -109,10 +109,12 @@ class WP_Debug_Data {
|
||||
),
|
||||
);
|
||||
|
||||
$info['wp-paths-sizes'] = array(
|
||||
'label' => __( 'Directories and Sizes' ),
|
||||
'fields' => array(),
|
||||
);
|
||||
if ( ! $is_multisite ) {
|
||||
$info['wp-paths-sizes'] = array(
|
||||
'label' => __( 'Directories and Sizes' ),
|
||||
'fields' => array(),
|
||||
);
|
||||
}
|
||||
|
||||
$info['wp-dropins'] = array(
|
||||
'label' => __( 'Drop-ins' ),
|
||||
@ -389,56 +391,59 @@ class WP_Debug_Data {
|
||||
);
|
||||
}
|
||||
|
||||
$loading = __( 'Loading…' );
|
||||
// Remove accordion for Directories and Sizes if in Multisite.
|
||||
if ( ! $is_multisite ) {
|
||||
$loading = __( 'Loading…' );
|
||||
|
||||
$info['wp-paths-sizes']['fields'] = array(
|
||||
'wordpress_path' => array(
|
||||
'label' => __( 'WordPress directory location' ),
|
||||
'value' => untrailingslashit( ABSPATH ),
|
||||
),
|
||||
'wordpress_size' => array(
|
||||
'label' => __( 'WordPress directory size' ),
|
||||
'value' => $loading,
|
||||
'debug' => 'loading...',
|
||||
),
|
||||
'uploads_path' => array(
|
||||
'label' => __( 'Uploads directory location' ),
|
||||
'value' => $upload_dir['basedir'],
|
||||
),
|
||||
'uploads_size' => array(
|
||||
'label' => __( 'Uploads directory size' ),
|
||||
'value' => $loading,
|
||||
'debug' => 'loading...',
|
||||
),
|
||||
'themes_path' => array(
|
||||
'label' => __( 'Themes directory location' ),
|
||||
'value' => get_theme_root(),
|
||||
),
|
||||
'themes_size' => array(
|
||||
'label' => __( 'Themes directory size' ),
|
||||
'value' => $loading,
|
||||
'debug' => 'loading...',
|
||||
),
|
||||
'plugins_path' => array(
|
||||
'label' => __( 'Plugins directory location' ),
|
||||
'value' => WP_PLUGIN_DIR,
|
||||
),
|
||||
'plugins_size' => array(
|
||||
'label' => __( 'Plugins directory size' ),
|
||||
'value' => $loading,
|
||||
'debug' => 'loading...',
|
||||
),
|
||||
'database_size' => array(
|
||||
'label' => __( 'Database size' ),
|
||||
'value' => $loading,
|
||||
'debug' => 'loading...',
|
||||
),
|
||||
'total_size' => array(
|
||||
'label' => __( 'Total installation size' ),
|
||||
'value' => $loading,
|
||||
'debug' => 'loading...',
|
||||
),
|
||||
);
|
||||
$info['wp-paths-sizes']['fields'] = array(
|
||||
'wordpress_path' => array(
|
||||
'label' => __( 'WordPress directory location' ),
|
||||
'value' => untrailingslashit( ABSPATH ),
|
||||
),
|
||||
'wordpress_size' => array(
|
||||
'label' => __( 'WordPress directory size' ),
|
||||
'value' => $loading,
|
||||
'debug' => 'loading...',
|
||||
),
|
||||
'uploads_path' => array(
|
||||
'label' => __( 'Uploads directory location' ),
|
||||
'value' => $upload_dir['basedir'],
|
||||
),
|
||||
'uploads_size' => array(
|
||||
'label' => __( 'Uploads directory size' ),
|
||||
'value' => $loading,
|
||||
'debug' => 'loading...',
|
||||
),
|
||||
'themes_path' => array(
|
||||
'label' => __( 'Themes directory location' ),
|
||||
'value' => get_theme_root(),
|
||||
),
|
||||
'themes_size' => array(
|
||||
'label' => __( 'Themes directory size' ),
|
||||
'value' => $loading,
|
||||
'debug' => 'loading...',
|
||||
),
|
||||
'plugins_path' => array(
|
||||
'label' => __( 'Plugins directory location' ),
|
||||
'value' => WP_PLUGIN_DIR,
|
||||
),
|
||||
'plugins_size' => array(
|
||||
'label' => __( 'Plugins directory size' ),
|
||||
'value' => $loading,
|
||||
'debug' => 'loading...',
|
||||
),
|
||||
'database_size' => array(
|
||||
'label' => __( 'Database size' ),
|
||||
'value' => $loading,
|
||||
'debug' => 'loading...',
|
||||
),
|
||||
'total_size' => array(
|
||||
'label' => __( 'Total installation size' ),
|
||||
'value' => $loading,
|
||||
'debug' => 'loading...',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Get a list of all drop-in replacements.
|
||||
$dropins = get_dropins();
|
||||
|
Loading…
Reference in New Issue
Block a user