Changeset 58830 for trunk/src/wp-admin/includes/class-wp-debug-data.php
- Timestamp:
- 07/29/2024 06:20:11 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-debug-data.php
r58716 r58830 339 339 'value' => ( defined( 'DB_COLLATE' ) ? DB_COLLATE : __( 'Undefined' ) ), 340 340 'debug' => ( defined( 'DB_COLLATE' ) ? DB_COLLATE : 'undefined' ), 341 ),342 ),343 );344 345 $is_writable_abspath = wp_is_writable( ABSPATH );346 $is_writable_wp_content_dir = wp_is_writable( WP_CONTENT_DIR );347 $is_writable_upload_dir = wp_is_writable( $upload_dir['basedir'] );348 $is_writable_wp_plugin_dir = wp_is_writable( WP_PLUGIN_DIR );349 $is_writable_template_directory = wp_is_writable( get_theme_root( get_template() ) );350 $is_writable_fonts_dir = wp_is_writable( wp_get_font_dir()['basedir'] );351 352 $info['wp-filesystem'] = array(353 'label' => __( 'Filesystem Permissions' ),354 'description' => __( 'Shows whether WordPress is able to write to the directories it needs access to.' ),355 'fields' => array(356 'wordpress' => array(357 'label' => __( 'The main WordPress directory' ),358 'value' => ( $is_writable_abspath ? __( 'Writable' ) : __( 'Not writable' ) ),359 'debug' => ( $is_writable_abspath ? 'writable' : 'not writable' ),360 ),361 'wp-content' => array(362 'label' => __( 'The wp-content directory' ),363 'value' => ( $is_writable_wp_content_dir ? __( 'Writable' ) : __( 'Not writable' ) ),364 'debug' => ( $is_writable_wp_content_dir ? 'writable' : 'not writable' ),365 ),366 'uploads' => array(367 'label' => __( 'The uploads directory' ),368 'value' => ( $is_writable_upload_dir ? __( 'Writable' ) : __( 'Not writable' ) ),369 'debug' => ( $is_writable_upload_dir ? 'writable' : 'not writable' ),370 ),371 'plugins' => array(372 'label' => __( 'The plugins directory' ),373 'value' => ( $is_writable_wp_plugin_dir ? __( 'Writable' ) : __( 'Not writable' ) ),374 'debug' => ( $is_writable_wp_plugin_dir ? 'writable' : 'not writable' ),375 ),376 'themes' => array(377 'label' => __( 'The themes directory' ),378 'value' => ( $is_writable_template_directory ? __( 'Writable' ) : __( 'Not writable' ) ),379 'debug' => ( $is_writable_template_directory ? 'writable' : 'not writable' ),380 ),381 'fonts' => array(382 'label' => __( 'The fonts directory' ),383 'value' => ( $is_writable_fonts_dir ? __( 'Writable' ) : __( 'Not writable' ) ),384 'debug' => ( $is_writable_fonts_dir ? 'writable' : 'not writable' ),385 341 ), 386 342 ), … … 1414 1370 } 1415 1371 1416 // Add more filesystem checks. 1417 if ( defined( 'WPMU_PLUGIN_DIR' ) && is_dir( WPMU_PLUGIN_DIR ) ) { 1418 $is_writable_wpmu_plugin_dir = wp_is_writable( WPMU_PLUGIN_DIR ); 1419 1420 $info['wp-filesystem']['fields']['mu-plugins'] = array( 1421 'label' => __( 'The must use plugins directory' ), 1422 'value' => ( $is_writable_wpmu_plugin_dir ? __( 'Writable' ) : __( 'Not writable' ) ), 1423 'debug' => ( $is_writable_wpmu_plugin_dir ? 'writable' : 'not writable' ), 1424 ); 1425 } 1372 $info['wp-filesystem'] = self::get_wp_filesystem(); 1426 1373 1427 1374 /** … … 1491 1438 1492 1439 /** 1440 * Gets the file system section of the debug data. 1441 * 1442 * @since 6.7.0 1443 * 1444 * @return array 1445 */ 1446 private static function get_wp_filesystem(): array { 1447 $upload_dir = wp_upload_dir(); 1448 $is_writable_abspath = wp_is_writable( ABSPATH ); 1449 $is_writable_wp_content_dir = wp_is_writable( WP_CONTENT_DIR ); 1450 $is_writable_upload_dir = wp_is_writable( $upload_dir['basedir'] ); 1451 $is_writable_wp_plugin_dir = wp_is_writable( WP_PLUGIN_DIR ); 1452 $is_writable_template_directory = wp_is_writable( get_theme_root( get_template() ) ); 1453 $is_writable_fonts_dir = wp_is_writable( wp_get_font_dir()['basedir'] ); 1454 1455 $fields = array( 1456 'wordpress' => array( 1457 'label' => __( 'The main WordPress directory' ), 1458 'value' => ( $is_writable_abspath ? __( 'Writable' ) : __( 'Not writable' ) ), 1459 'debug' => ( $is_writable_abspath ? 'writable' : 'not writable' ), 1460 ), 1461 'wp-content' => array( 1462 'label' => __( 'The wp-content directory' ), 1463 'value' => ( $is_writable_wp_content_dir ? __( 'Writable' ) : __( 'Not writable' ) ), 1464 'debug' => ( $is_writable_wp_content_dir ? 'writable' : 'not writable' ), 1465 ), 1466 'uploads' => array( 1467 'label' => __( 'The uploads directory' ), 1468 'value' => ( $is_writable_upload_dir ? __( 'Writable' ) : __( 'Not writable' ) ), 1469 'debug' => ( $is_writable_upload_dir ? 'writable' : 'not writable' ), 1470 ), 1471 'plugins' => array( 1472 'label' => __( 'The plugins directory' ), 1473 'value' => ( $is_writable_wp_plugin_dir ? __( 'Writable' ) : __( 'Not writable' ) ), 1474 'debug' => ( $is_writable_wp_plugin_dir ? 'writable' : 'not writable' ), 1475 ), 1476 'themes' => array( 1477 'label' => __( 'The themes directory' ), 1478 'value' => ( $is_writable_template_directory ? __( 'Writable' ) : __( 'Not writable' ) ), 1479 'debug' => ( $is_writable_template_directory ? 'writable' : 'not writable' ), 1480 ), 1481 'fonts' => array( 1482 'label' => __( 'The fonts directory' ), 1483 'value' => ( $is_writable_fonts_dir ? __( 'Writable' ) : __( 'Not writable' ) ), 1484 'debug' => ( $is_writable_fonts_dir ? 'writable' : 'not writable' ), 1485 ), 1486 ); 1487 1488 // Add more filesystem checks. 1489 if ( defined( 'WPMU_PLUGIN_DIR' ) && is_dir( WPMU_PLUGIN_DIR ) ) { 1490 $is_writable_wpmu_plugin_dir = wp_is_writable( WPMU_PLUGIN_DIR ); 1491 1492 $fields['mu-plugins'] = array( 1493 'label' => __( 'The must use plugins directory' ), 1494 'value' => ( $is_writable_wpmu_plugin_dir ? __( 'Writable' ) : __( 'Not writable' ) ), 1495 'debug' => ( $is_writable_wpmu_plugin_dir ? 'writable' : 'not writable' ), 1496 ); 1497 } 1498 1499 return array( 1500 'label' => __( 'Filesystem Permissions' ), 1501 'description' => __( 'Shows whether WordPress is able to write to the directories it needs access to.' ), 1502 'fields' => $fields, 1503 ); 1504 } 1505 1506 /** 1493 1507 * Returns the value of a MySQL system variable. 1494 1508 *
Note: See TracChangeset
for help on using the changeset viewer.