diff --git a/src/wp-admin/includes/class-wp-debug-data.php b/src/wp-admin/includes/class-wp-debug-data.php index 496a6da34a891..1eac01148d436 100644 --- a/src/wp-admin/includes/class-wp-debug-data.php +++ b/src/wp-admin/includes/class-wp-debug-data.php @@ -93,7 +93,10 @@ public static function debug_data() { // Remove debug data which is only relevant on single-site installs. if ( is_multisite() ) { + // Remove accordion for Directories and Sizes if in Multisite. unset( $info['wp-paths-sizes'] ); + } else { + $info['wp-paths-sizes'] = self::get_wp_paths_sizes(); } $info['wp-core'] = array( @@ -164,14 +167,6 @@ public static function debug_data() { ), ); - if ( ! $is_multisite ) { - $info['wp-paths-sizes'] = array( - /* translators: Filesystem directory paths and storage sizes. */ - 'label' => __( 'Directories and Sizes' ), - 'fields' => array(), - ); - } - $info['wp-active-theme'] = array( 'label' => __( 'Active Theme' ), 'fields' => array(), @@ -262,69 +257,6 @@ public static function debug_data() { ); } - // 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...', - ), - 'fonts_path' => array( - 'label' => __( 'Fonts directory location' ), - 'value' => wp_get_font_dir()['basedir'], - ), - 'fonts_size' => array( - 'label' => __( 'Fonts 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...', - ), - ); - } - // List all available plugins. $plugins = get_plugins(); $plugin_updates = get_plugin_updates(); @@ -1238,7 +1170,7 @@ public static function get_wp_media(): array { /** - * Gets the WordPress plugins section of the debug data. + * Gets the WordPress MU plugins section of the debug data. * * @since 6.7.0 * @@ -1288,6 +1220,81 @@ public static function get_wp_mu_plugins(): array { ); } + /** + * Gets the WordPress paths and sizes section of the debug data. + * + * @since 6.7.0 + * + * @return array + */ + public static function get_wp_paths_sizes(): array { + $loading = __( 'Loading…' ); + + $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' => wp_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...', + ), + 'fonts_path' => array( + 'label' => __( 'Fonts directory location' ), + 'value' => wp_get_font_dir()['basedir'], + ), + 'fonts_size' => array( + 'label' => __( 'Fonts 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...', + ), + ); + + return array( + /* translators: Filesystem directory paths and storage sizes. */ + 'label' => __( 'Directories and Sizes' ), + 'fields' => $fields, + ); + } + /** * Gets the WordPress constants section of the debug data. *