Changeset 59011 for trunk/src/wp-admin/includes/class-wp-debug-data.php
- Timestamp:
- 09/11/2024 02:45:57 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-debug-data.php
r59002 r59011 82 82 'wp-parent-theme' => array(), 83 83 'wp-themes-inactive' => array(), 84 'wp-mu-plugins' => array(),84 'wp-mu-plugins' => self::get_wp_mu_plugins(), 85 85 'wp-plugins-active' => array(), 86 86 'wp-plugins-inactive' => array(), … … 196 196 $info['wp-themes-inactive'] = array( 197 197 'label' => __( 'Inactive Themes' ), 198 'show_count' => true,199 'fields' => array(),200 );201 202 $info['wp-mu-plugins'] = array(203 'label' => __( 'Must Use Plugins' ),204 198 'show_count' => true, 205 199 'fields' => array(), … … 540 534 'debug' => $gs_debug, 541 535 ); 542 543 // List must use plugins if there are any.544 $mu_plugins = get_mu_plugins();545 546 foreach ( $mu_plugins as $plugin_path => $plugin ) {547 $plugin_version = $plugin['Version'];548 $plugin_author = $plugin['Author'];549 550 $plugin_version_string = __( 'No version or author information is available.' );551 $plugin_version_string_debug = 'author: (undefined), version: (undefined)';552 553 if ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) {554 /* translators: 1: Plugin version number. 2: Plugin author name. */555 $plugin_version_string = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author );556 $plugin_version_string_debug = sprintf( 'version: %s, author: %s', $plugin_version, $plugin_author );557 } else {558 if ( ! empty( $plugin_author ) ) {559 /* translators: %s: Plugin author name. */560 $plugin_version_string = sprintf( __( 'By %s' ), $plugin_author );561 $plugin_version_string_debug = sprintf( 'author: %s, version: (undefined)', $plugin_author );562 }563 564 if ( ! empty( $plugin_version ) ) {565 /* translators: %s: Plugin version number. */566 $plugin_version_string = sprintf( __( 'Version %s' ), $plugin_version );567 $plugin_version_string_debug = sprintf( 'author: (undefined), version: %s', $plugin_version );568 }569 }570 571 $info['wp-mu-plugins']['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array(572 'label' => $plugin['Name'],573 'value' => $plugin_version_string,574 'debug' => $plugin_version_string_debug,575 );576 }577 536 578 537 // List all available plugins. … … 1259 1218 1260 1219 /** 1220 * Gets the WordPress plugins section of the debug data. 1221 * 1222 * @since 6.7.0 1223 * 1224 * @return array 1225 */ 1226 public static function get_wp_mu_plugins(): array { 1227 // List must use plugins if there are any. 1228 $mu_plugins = get_mu_plugins(); 1229 $fields = array(); 1230 1231 foreach ( $mu_plugins as $plugin_path => $plugin ) { 1232 $plugin_version = $plugin['Version']; 1233 $plugin_author = $plugin['Author']; 1234 1235 $plugin_version_string = __( 'No version or author information is available.' ); 1236 $plugin_version_string_debug = 'author: (undefined), version: (undefined)'; 1237 1238 if ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) { 1239 /* translators: 1: Plugin version number. 2: Plugin author name. */ 1240 $plugin_version_string = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author ); 1241 $plugin_version_string_debug = sprintf( 'version: %s, author: %s', $plugin_version, $plugin_author ); 1242 } else { 1243 if ( ! empty( $plugin_author ) ) { 1244 /* translators: %s: Plugin author name. */ 1245 $plugin_version_string = sprintf( __( 'By %s' ), $plugin_author ); 1246 $plugin_version_string_debug = sprintf( 'author: %s, version: (undefined)', $plugin_author ); 1247 } 1248 1249 if ( ! empty( $plugin_version ) ) { 1250 /* translators: %s: Plugin version number. */ 1251 $plugin_version_string = sprintf( __( 'Version %s' ), $plugin_version ); 1252 $plugin_version_string_debug = sprintf( 'author: (undefined), version: %s', $plugin_version ); 1253 } 1254 } 1255 1256 $fields[ sanitize_text_field( $plugin['Name'] ) ] = array( 1257 'label' => $plugin['Name'], 1258 'value' => $plugin_version_string, 1259 'debug' => $plugin_version_string_debug, 1260 ); 1261 } 1262 1263 return array( 1264 'label' => __( 'Must Use Plugins' ), 1265 'show_count' => true, 1266 'fields' => $fields, 1267 ); 1268 } 1269 1270 /** 1261 1271 * Gets the WordPress constants section of the debug data. 1262 1272 *
Note: See TracChangeset
for help on using the changeset viewer.