Changeset 59175
- Timestamp:
- 10/05/2024 04:26:17 PM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-debug-data.php
r59174 r59175 57 57 $info = array( 58 58 'wp-core' => self::get_wp_core(), 59 'wp-paths-sizes' => array(),59 'wp-paths-sizes' => self::get_wp_paths_sizes(), 60 60 'wp-dropins' => self::get_wp_dropins(), 61 61 'wp-active-theme' => array(), … … 72 72 ); 73 73 74 // Remove debug data which is only relevant on single-site installs. 75 if ( is_multisite() ) { 76 unset( $info['wp-paths-sizes'] ); 77 } 78 79 if ( ! $is_multisite ) { 80 $info['wp-paths-sizes'] = array( 81 /* translators: Filesystem directory paths and storage sizes. */ 82 'label' => __( 'Directories and Sizes' ), 83 'fields' => array(), 84 ); 85 } 74 /* 75 * Remove null elements from the array. The individual methods are 76 * allowed to return `null`, which communicates that the category 77 * of debug data isn't relevant and shouldn't be passed through. 78 */ 79 $info = array_filter( 80 $info, 81 static function ( $section ) { 82 return isset( $section ); 83 } 84 ); 86 85 87 86 $info['wp-active-theme'] = array( … … 100 99 'fields' => array(), 101 100 ); 102 103 // Remove accordion for Directories and Sizes if in Multisite.104 if ( ! $is_multisite ) {105 $loading = __( 'Loading…' );106 107 $info['wp-paths-sizes']['fields'] = array(108 'wordpress_path' => array(109 'label' => __( 'WordPress directory location' ),110 'value' => untrailingslashit( ABSPATH ),111 ),112 'wordpress_size' => array(113 'label' => __( 'WordPress directory size' ),114 'value' => $loading,115 'debug' => 'loading...',116 ),117 'uploads_path' => array(118 'label' => __( 'Uploads directory location' ),119 'value' => $upload_dir['basedir'],120 ),121 'uploads_size' => array(122 'label' => __( 'Uploads directory size' ),123 'value' => $loading,124 'debug' => 'loading...',125 ),126 'themes_path' => array(127 'label' => __( 'Themes directory location' ),128 'value' => get_theme_root(),129 ),130 'themes_size' => array(131 'label' => __( 'Themes directory size' ),132 'value' => $loading,133 'debug' => 'loading...',134 ),135 'plugins_path' => array(136 'label' => __( 'Plugins directory location' ),137 'value' => WP_PLUGIN_DIR,138 ),139 'plugins_size' => array(140 'label' => __( 'Plugins directory size' ),141 'value' => $loading,142 'debug' => 'loading...',143 ),144 'fonts_path' => array(145 'label' => __( 'Fonts directory location' ),146 'value' => wp_get_font_dir()['basedir'],147 ),148 'fonts_size' => array(149 'label' => __( 'Fonts directory size' ),150 'value' => $loading,151 'debug' => 'loading...',152 ),153 'database_size' => array(154 'label' => __( 'Database size' ),155 'value' => $loading,156 'debug' => 'loading...',157 ),158 'total_size' => array(159 'label' => __( 'Total installation size' ),160 'value' => $loading,161 'debug' => 'loading...',162 ),163 );164 }165 101 166 102 // Populate the section for the currently active theme. … … 1134 1070 1135 1071 /** 1136 * Gets the WordPress plugins section of the debug data.1072 * Gets the WordPress MU plugins section of the debug data. 1137 1073 * 1138 1074 * @since 6.7.0 … … 1181 1117 'show_count' => true, 1182 1118 'fields' => $fields, 1119 ); 1120 } 1121 1122 /** 1123 * Gets the WordPress paths and sizes section of the debug data. 1124 * 1125 * @since 6.7.0 1126 * 1127 * @return array|null Paths and sizes debug data for single sites, 1128 * otherwise `null` for multi-site installs. 1129 */ 1130 private static function get_wp_paths_sizes(): ?array { 1131 if ( is_multisite() ) { 1132 return null; 1133 } 1134 1135 $loading = __( 'Loading…' ); 1136 1137 $fields = array( 1138 'wordpress_path' => array( 1139 'label' => __( 'WordPress directory location' ), 1140 'value' => untrailingslashit( ABSPATH ), 1141 ), 1142 'wordpress_size' => array( 1143 'label' => __( 'WordPress directory size' ), 1144 'value' => $loading, 1145 'debug' => 'loading...', 1146 ), 1147 'uploads_path' => array( 1148 'label' => __( 'Uploads directory location' ), 1149 'value' => wp_upload_dir()['basedir'], 1150 ), 1151 'uploads_size' => array( 1152 'label' => __( 'Uploads directory size' ), 1153 'value' => $loading, 1154 'debug' => 'loading...', 1155 ), 1156 'themes_path' => array( 1157 'label' => __( 'Themes directory location' ), 1158 'value' => get_theme_root(), 1159 ), 1160 'themes_size' => array( 1161 'label' => __( 'Themes directory size' ), 1162 'value' => $loading, 1163 'debug' => 'loading...', 1164 ), 1165 'plugins_path' => array( 1166 'label' => __( 'Plugins directory location' ), 1167 'value' => WP_PLUGIN_DIR, 1168 ), 1169 'plugins_size' => array( 1170 'label' => __( 'Plugins directory size' ), 1171 'value' => $loading, 1172 'debug' => 'loading...', 1173 ), 1174 'fonts_path' => array( 1175 'label' => __( 'Fonts directory location' ), 1176 'value' => wp_get_font_dir()['basedir'], 1177 ), 1178 'fonts_size' => array( 1179 'label' => __( 'Fonts directory size' ), 1180 'value' => $loading, 1181 'debug' => 'loading...', 1182 ), 1183 'database_size' => array( 1184 'label' => __( 'Database size' ), 1185 'value' => $loading, 1186 'debug' => 'loading...', 1187 ), 1188 'total_size' => array( 1189 'label' => __( 'Total installation size' ), 1190 'value' => $loading, 1191 'debug' => 'loading...', 1192 ), 1193 ); 1194 1195 return array( 1196 /* translators: Filesystem directory paths and storage sizes. */ 1197 'label' => __( 'Directories and Sizes' ), 1198 'fields' => $fields, 1183 1199 ); 1184 1200 }
Note: See TracChangeset
for help on using the changeset viewer.