Index: src/wp-admin/css/debug.css
===================================================================
--- src/wp-admin/css/debug.css (revision )
+++ src/wp-admin/css/debug.css (revision )
@@ -0,0 +1,17 @@
+body.info-php tbody td {
+ width: 80%;
+}
+
+body.info-php tbody td ul,
+body.info-php tbody td ol {
+ margin: 0;
+}
+
+body.info-php thead th:first-child,
+body.info-php tbody td:first-child {
+ width: 20%;
+}
+
+#wpfooter #footer-debug {
+ margin-left: 10px;
+}
Index: src/wp-admin/admin-footer.php
===================================================================
--- src/wp-admin/admin-footer.php (revision 42647)
+++ src/wp-admin/admin-footer.php (revision )
@@ -43,6 +43,15 @@
echo apply_filters( 'admin_footer_text', '' );
?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ array(
+ 'label' => __( 'WordPress' ),
+ 'fields' => array(
+ array(
+ 'label' => __( 'Version' ),
+ 'value' => get_bloginfo( 'version' )
+ ),
+ array(
+ 'label' => __( 'Site Language' ),
+ 'value' => get_locale()
+ ),
+ array(
+ 'label' => __( 'Home URL' ),
+ 'value' => get_bloginfo( 'url' ),
+ 'private' => true
+ ),
+ array(
+ 'label' => __( 'Site URL' ),
+ 'value' => get_bloginfo( 'wpurl' ),
+ 'private' => true
+ ),
+ array(
+ 'label' => __( 'Permalink structure' ),
+ 'value' => get_option( 'permalink_structure' )
+ ),
+ array(
+ 'label' => __( 'Is this site using HTTPS?' ),
+ 'value' => ( is_ssl() ? __( 'Yes' ) : __( 'No' ) )
+ ),
+ array(
+ 'label' => __( 'Can anyone register on this site?' ),
+ 'value' => ( get_option( 'users_can_register' ) ? __( 'Yes' ) : __( 'No' ) )
+ ),
+ array(
+ 'label' => __( 'Default comment status' ),
+ 'value' => get_option( 'default_comment_status' )
+ ),
+ array(
+ 'label' => __( 'Is this a multisite?' ),
+ 'value' => ( is_multisite() ? __( 'Yes' ) : __( 'No' ) )
+ )
+ ),
+ ),
+ 'wp-dropins' => array(
+ 'label' => __( 'Drop-ins' ),
+ 'description' => __( 'Drop-ins are single files that replace or enhance WordPress features in ways that are not possible for traditional plugins' ),
+ 'fields' => array()
+ ),
+ 'wp-active-theme' => array(
+ 'label' => __( 'Active Theme' ),
+ 'fields' => array()
+ ),
+ 'wp-themes' => array(
+ 'label' => __( 'Other themes' ),
+ 'show_count' => true,
+ 'fields' => array()
+ ),
+ 'wp-mu-plugins' => array(
+ 'label' => __( 'Must Use Plugins' ),
+ 'show_count' => true,
+ 'fields' => array()
+ ),
+ 'wp-plugins-active' => array(
+ 'label' => __( 'Active Plugins' ),
+ 'show_count' => true,
+ 'fields' => array()
+ ),
+ 'wp-plugins-inactive' => array(
+ 'label' => __( 'Inactive Plugins' ),
+ 'show_count' => true,
+ 'fields' => array()
+ ),
+ 'wp-media' => array(
+ 'label' => __( 'Media handling' ),
+ 'fields' => array()
+ ),
+ 'wp-server' => array(
+ 'label' => __( 'Server' ),
+ 'description' => __( 'The options shown below relate to your server setup. If changes are required, you may need your web host\'s assistance.' ),
+ 'fields' => array()
+ ),
+ 'wp-database' => array(
+ 'label' => __( 'Database' ),
+ 'fields' => array()
+ ),
+ 'wp-constants' => array(
+ 'label' => __( 'WordPress constants' ),
+ 'description' => __( 'These values represent values set in your websites code which affect WordPress in various ways that may be of importance when seeking help with your site.' ),
+ 'fields' => array(
+ array(
+ 'label' => 'ABSPATH',
+ 'value' => ( ! defined( 'ABSPATH' ) ? __( 'Undefined' ) : ABSPATH )
+ ),
+ array(
+ 'label' => 'WP_HOME',
+ 'value' => ( ! defined( 'WP_HOME' ) ? __( 'Undefined' ) : WP_HOME )
+ ),
+ array(
+ 'label' => 'WP_SITEURL',
+ 'value' => ( ! defined( 'WP_SITEURL' ) ? __( 'Undefined' ) : WP_SITEURL )
+ ),
+ array(
+ 'label' => 'WP_DEBUG',
+ 'value' => ( ! defined( 'WP_DEBUG' ) ? __( 'Undefined' ) : ( WP_DEBUG ? __( 'Enabled' ) : __( 'Disabled' ) ) )
+ ),
+ array(
+ 'label' => 'WP_MAX_MEMORY_LIMIT',
+ 'value' => ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) ? __( 'Undefined' ) : WP_MAX_MEMORY_LIMIT )
+ ),
+ array(
+ 'label' => 'WP_DEBUG_DISPLAY',
+ 'value' => ( ! defined( 'WP_DEBUG_DISPLAY' ) ? __( 'Undefined' ) : ( WP_DEBUG_DISPLAY ? __( 'Enabled' ) : __( 'Disabled' ) ) )
+ ),
+ array(
+ 'label' => 'WP_DEBUG_LOG',
+ 'value' => ( ! defined( 'WP_DEBUG_LOG' ) ? __( 'Undefined' ) : ( WP_DEBUG_LOG ? __( 'Enabled' ) : __( 'Disabled' ) ) )
+ ),
+ array(
+ 'label' => 'SCRIPT_DEBUG',
+ 'value' => ( ! defined( 'SCRIPT_DEBUG' ) ? __( 'Undefined' ) : ( SCRIPT_DEBUG ? __( 'Enabled' ) : __( 'Disabled' ) ) )
+ ),
+ array(
+ 'label' => 'WP_CACHE',
+ 'value' => ( ! defined( 'WP_CACHE' ) ? __( 'Undefined' ) : ( WP_CACHE ? __( 'Enabled' ) : __( 'Disabled' ) ) )
+ ),
+ array(
+ 'label' => 'CONCATENATE_SCRIPTS',
+ 'value' => ( ! defined( 'CONCATENATE_SCRIPTS' ) ? __( 'Undefined' ) : ( CONCATENATE_SCRIPTS ? __( 'Enabled' ) : __( 'Disabled' ) ) )
+ ),
+ array(
+ 'label' => 'COMPRESS_SCRIPTS',
+ 'value' => ( ! defined( 'COMPRESS_SCRIPTS' ) ? __( 'Undefined' ) : ( COMPRESS_SCRIPTS ? __( 'Enabled' ) : __( 'Disabled' ) ) )
+ ),
+ array(
+ 'label' => 'COMPRESS_CSS',
+ 'value' => ( ! defined( 'COMPRESS_CSS' ) ? __( 'Undefined' ) : ( COMPRESS_CSS ? __( 'Enabled' ) : __( 'Disabled' ) ) )
+ ),
+ array(
+ 'label' => 'WP_LOCAL_DEV',
+ 'value' => ( ! defined( 'WP_LOCAL_DEV' ) ? __( 'Undefined' ) : ( WP_LOCAL_DEV ? __( 'Enabled' ) : __( 'Disabled' ) ) )
+ )
+ )
+ ),
+ 'wp-filesystem' => array(
+ 'label' => __( 'Filesystem permissions' ),
+ 'description' => __( 'The status of various locations WordPress needs to write files in various scenarios.' ),
+ 'fields' => array(
+ array(
+ 'label' => __( 'The main WordPress directory' ),
+ 'value' => ( wp_is_writable( ABSPATH ) ? __( 'Writable' ) : __( 'Not writable' ) )
+ ),
+ array(
+ 'label' => __( 'The wp-content directory' ),
+ 'value' => ( wp_is_writable( WP_CONTENT_DIR ) ? __( 'Writable' ) : __( 'Not writable' ) )
+ ),
+ array(
+ 'label' => __( 'The uploads directory' ),
+ 'value' => ( wp_is_writable( $upload_dir['basedir'] ) ? __( 'Writable' ) : __( 'Not writable' ) )
+ ),
+ array(
+ 'label' => __( 'The plugins directory' ),
+ 'value' => ( wp_is_writable( WP_PLUGIN_DIR ) ? __( 'Writable' ) : __( 'Not writable' ) )
+ ),
+ array(
+ 'label' => __( 'The themes directory' ),
+ 'value' => ( wp_is_writable( get_template_directory() . '/..' ) ? __( 'Writable' ) : __( 'Not writable' ) )
+ )
+ )
+ ),
+ );
+
+
+
+ if ( is_multisite() ) {
+ $network_query = new WP_Network_Query();
+ $network_ids = $network_query->query( array(
+ 'fields' => 'ids',
+ 'number' => 100,
+ 'no_found_rows' => false,
+ ) );
+
+ $site_count = 0;
+ foreach ( $network_ids AS $network_id ) {
+ $site_count += get_blog_count( $network_id );
+ }
+
+ $info['wp-core']['fields'][] = array(
+ 'label' => __( 'User Count' ),
+ 'value' => get_user_count()
+ );
+ $info['wp-core']['fields'][] = array(
+ 'label' => __( 'Site Count' ),
+ 'value' => $site_count
+ );
+ $info['wp-core']['fields'][] = array(
+ 'label' => __( 'Network Count' ),
+ 'value' => $network_query->found_networks
+ );
+ } else {
+ $user_count = count_users();
+
+ $info['wp-core']['fields'][] = array(
+ 'label' => __( 'User Count' ),
+ 'value' => $user_count['total_users']
+ );
+ }
+
+ // WordPress features requiring processing.
+ $wp_dotorg = wp_remote_get( 'https://wordpress.org', array( 'timeout' => 10 ) );
+ if ( ! is_wp_error( $wp_dotorg ) ) {
+ $info['wp-core']['fields'][] = array(
+ 'label' => __( 'Communication with WordPress.org' ),
+ 'value' => sprintf(
+ __( 'WordPress.org is reachable' )
+ )
+ );
+ } else {
+ $info['wp-core']['fields'][] = array(
+ 'label' => __( 'Communication with WordPress.org' ),
+ 'value' => sprintf(
+ // translators: %1$s: The IP address WordPress.org resolves to. %2$s: The error returned by the lookup.
+ __( 'Unable to reach WordPress.org at %1$s: %2$s' ),
+ gethostbyname( 'wordpress.org' ),
+ $wp_dotorg->get_error_message()
+ )
+ );
+ }
+
+ // Get drop-ins.
+ $dropins = get_dropins();
+ $dropin_description = _get_dropins();
+ foreach ( $dropins AS $dropin_key => $dropin ) {
+ $info['wp-dropins']['fields'][] = array(
+ 'label' => $dropin_key,
+ 'value' => $dropin_description[ $dropin_key ][0]
+ );
+ }
+
+ // Populate the media fields.
+ $info['wp-media']['fields'][] = array(
+ 'label' => __( 'Active editor' ),
+ 'value' => _wp_image_editor_choose()
+ );
+
+ // Get ImageMagic information, if available.
+ if ( class_exists( 'Imagick' ) ) {
+ // Save the Imagick instance for later use.
+ $imagick = new Imagick();
+ $imagick_version = $imagick->getVersion();
+ } else {
+ $imagick_version = 'Imagick not available';
+ }
+ $info['wp-media']['fields'][] = array(
+ 'label' => __( 'Imagick Module Version' ),
+ 'value' => ( is_array( $imagick_version ) ? $imagick_version['versionNumber'] : $imagick_version )
+ );
+ $info['wp-media']['fields'][] = array(
+ 'label' => __( 'ImageMagick Version' ),
+ 'value' => ( is_array( $imagick_version ) ? $imagick_version['versionString'] : $imagick_version )
+ );
+
+ // If Imagick is used as our editor, provide some more information about its limitations.
+ if ( 'WP_Image_Editor_Imagick' === _wp_image_editor_choose() && isset( $imagick ) && $imagick instanceof Imagick ) {
+ $limits = array(
+ 'area' => ( defined( 'imagick::RESOURCETYPE_AREA' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_AREA ) ) : 'Not Available' ),
+ 'disk' => ( defined( 'imagick::RESOURCETYPE_DISK' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_DISK ) : 'Not Available' ),
+ 'file' => ( defined( 'imagick::RESOURCETYPE_FILE' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_FILE ) : 'Not Available' ),
+ 'map' => ( defined( 'imagick::RESOURCETYPE_MAP' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MAP ) ) : 'Not Available' ),
+ 'memory' => ( defined( 'imagick::RESOURCETYPE_MEMORY' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MEMORY ) ) : 'Not Available' ),
+ 'thread' => ( defined( 'imagick::RESOURCETYPE_THREAD' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_THREAD ) : 'Not Available' )
+ );
+
+ $info['wp-media']['fields'][] = array(
+ 'label' => __( 'Imagick Resource Limits' ),
+ 'value' => $limits
+ );
+ }
+
+ // Get GD information, if available.
+ if ( function_exists( 'gd_info' ) ) {
+ $gd = gd_info();
+ }
+ else {
+ $gd = false;
+ }
+ $info['wp-media']['fields'][] = array(
+ 'label' => __( 'GD Version' ),
+ 'value' => ( is_array( $gd ) ? $gd['GD Version'] : 'GD not available' )
+ );
+
+ // Get Ghostscript information, if available.
+ if ( function_exists( 'exec' ) ) {
+ $gs = exec( 'gs --version' );
+ $gs = ( ! empty( $gs ) ? $gs : 'Not available' );
+ }
+ else {
+ $gs = __( 'Unable to determine if Ghostscript is installed' );
+ }
+ $info['wp-media']['fields'][] = array(
+ 'label' => __( 'Ghostscript Version' ),
+ 'value' => $gs
+ );
+
+ // Populate the server debug fields.
+ $info['wp-server']['fields'][] = array(
+ 'label' => __( 'Server architecture' ),
+ 'value' => ( ! function_exists( 'php_uname' ) ? __( 'Unable to determine server architecture' ) : sprintf( '%s %s %s', php_uname( 's' ), php_uname( 'r' ), php_uname( 'm' ) ) )
+ );
+ $info['wp-server']['fields'][] = array(
+ 'label' => __( 'PHP Version' ),
+ 'value' => ( ! function_exists( 'phpversion' ) ? __( 'Unable to determine PHP version' ) : sprintf(
+ '%s %s',
+ phpversion(),
+ ( 64 === PHP_INT_SIZE * 8 ? __( '(Supports 64bit values)' ) : '' )
+ )
+ )
+ );
+ $info['wp-server']['fields'][] = array(
+ 'label' => __( 'PHP SAPI' ),
+ 'value' => ( ! function_exists( 'php_sapi_name' ) ? __( 'Unable to determine PHP SAPI' ) : php_sapi_name() )
+ );
+
+ if ( ! function_exists( 'ini_get' ) ) {
+ $info['wp-server']['fields'][] = array(
+ 'label' => __( 'Server settings' ),
+ 'value' => __( 'Unable to determine some settings as the ini_get() function has been disabled' )
+ );
+ } else {
+ $info['wp-server']['fields'][] = array(
+ 'label' => __( 'PHP max input variables' ),
+ 'value' => ini_get( 'max_input_vars' )
+ );
+ $info['wp-server']['fields'][] = array(
+ 'label' => __( 'PHP time limit' ),
+ 'value' => ini_get( 'max_execution_time' )
+ );
+ $info['wp-server']['fields'][] = array(
+ 'label' => __( 'PHP memory limit' ),
+ 'value' => ini_get( 'memory_limit' )
+ );
+ $info['wp-server']['fields'][] = array(
+ 'label' => __( 'Max input time' ),
+ 'value' => ini_get( 'max_input_time' )
+ );
+ $info['wp-server']['fields'][] = array(
+ 'label' => __( 'Upload max filesize' ),
+ 'value' => ini_get( 'upload_max_filesize' )
+ );
+ $info['wp-server']['fields'][] = array(
+ 'label' => __( 'PHP post max size' ),
+ 'value' => ini_get( 'post_max_size' )
+ );
+ }
+
+ if ( function_exists( 'curl_version' ) ) {
+ $cURL = curl_version();
+ $info['wp-server']['fields'][] = array(
+ 'label' => __( 'cURL Version' ),
+ 'value' => sprintf( '%s %s', $cURL['version'], $cURL['ssl_version'] )
+ );
+ } else {
+ $info['wp-server']['fields'][] = array(
+ 'label' => __( 'cURL Version' ),
+ 'value' => __( 'Your server does not support cURL' )
+ );
+ }
+
+ $info['wp-server']['fields'][] = array(
+ 'label' => __( 'SUHOSIN installed' ),
+ 'value' => ( ( extension_loaded( 'suhosin' ) || ( defined( 'SUHOSIN_PATCH' ) && constant( 'SUHOSIN_PATCH' ) ) ) ? __( 'Yes' ) : __( 'No' ) )
+ );
+
+ $info['wp-server']['fields'][] = array(
+ 'label' => __( 'Is the Imagick library available' ),
+ 'value' => ( extension_loaded( 'imagick' ) ? __( 'Yes' ) : __( 'No' ) )
+ );
+
+
+ // Populate the database debug fields.
+ if ( is_resource( $wpdb->dbh ) ) {
+ // Old mysql extension.
+ $extension = 'mysql';
+ } else if ( is_object( $wpdb->dbh ) ) {
+ // mysqli or PDO.
+ $extension = get_class( $wpdb->dbh );
+ } else {
+ // Unknown sql extension.
+ $extension = null;
+ }
+
+ if ( method_exists( $wpdb, 'db_version' ) ) {
+ if ( $wpdb->use_mysqli ) {
+ $server = mysqli_get_server_info( $wpdb->dbh );
+ } else {
+ $server = mysql_get_server_info( $wpdb->dbh );
+ }
+ } else {
+ $server = null;
+ }
+
+ if ( isset( $wpdb->use_mysqli ) && $wpdb->use_mysqli ) {
+ $client_version = $wpdb->dbh->client_info;
+ } else {
+ if ( preg_match( '|[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}|', mysql_get_client_info(), $matches ) ) {
+ $client_version = $matches[0];
+ } else {
+ $client_version = null;
+ }
+ }
+
+ $info['wp-database']['fields'][] = array(
+ 'label' => __( 'Extension' ),
+ 'value' => $extension
+ );
+ $info['wp-database']['fields'][] = array(
+ 'label' => __( 'Server version' ),
+ 'value' => $server
+ );
+ $info['wp-database']['fields'][] = array(
+ 'label' => __( 'Client version' ),
+ 'value' => $client_version
+ );
+ $info['wp-database']['fields'][] = array(
+ 'label' => __( 'Database user' ),
+ 'value' => $wpdb->dbuser,
+ 'private' => true
+ );
+ $info['wp-database']['fields'][] = array(
+ 'label' => __( 'Database host' ),
+ 'value' => $wpdb->dbhost,
+ 'private' => true
+ );
+ $info['wp-database']['fields'][] = array(
+ 'label' => __( 'Database name' ),
+ 'value' => $wpdb->dbname,
+ 'private' => true
+ );
+ $info['wp-database']['fields'][] = array(
+ 'label' => __( 'Database prefix' ),
+ 'value' => $wpdb->prefix
+ );
+
+
+ // List must use plugins if there are any.
+ $mu_plugins = get_mu_plugins();
+
+ foreach ( $mu_plugins AS $plugin_path => $plugin ) {
+ $plugin_version = $plugin['Version'];
+ $plugin_author = $plugin['Author'];
+
+ $plugin_version_string = __( 'No version or author information available' );
+
+ if ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) {
+ // translators: %1$s: Plugin version number. %2$s: Plugin author name.
+ $plugin_version_string = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author );
+ }
+ if ( empty( $plugin_version ) && ! empty( $plugin_author ) ) {
+ // translators: %s: Plugin author name.
+ $plugin_version_string = sprintf( __( 'By %s' ), $plugin_author );
+ }
+ if ( ! empty( $plugin_version ) && empty( $plugin_author ) ) {
+ // translators: %s: Plugin version number.
+ $plugin_version_string = sprintf( __( 'Version %s' ), $plugin_version );
+ }
+
+ $info['wp-mu-plugins']['fields'][] = array(
+ 'label' => $plugin['Name'],
+ 'value' => $plugin_version_string
+ );
+ }
+
+
+ // List all available plugins.
+ $plugins = get_plugins();
+
+ foreach ( $plugins AS $plugin_path => $plugin ) {
+ $plugin_part = ( is_plugin_active( $plugin_path ) ) ? 'wp-plugins-active' : 'wp-plugins-inactive';
+
+ $plugin_version = $plugin['Version'];
+ $plugin_author = $plugin['Author'];
+
+ $plugin_version_string = __( 'No version or author information available' );
+
+ if ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) {
+ // translators: %1$s: Plugin version number. %2$s: Plugin author name.
+ $plugin_version_string = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author );
+ }
+ if ( empty( $plugin_version ) && ! empty( $plugin_author ) ) {
+ // translators: %s: Plugin author name.
+ $plugin_version_string = sprintf( __( 'By %s' ), $plugin_author );
+ }
+ if ( ! empty( $plugin_version ) && empty( $plugin_author ) ) {
+ // translators: %s: Plugin version number.
+ $plugin_version_string = sprintf( __( 'Version %s' ), $plugin_version );
+ }
+
+
+ $info[ $plugin_part ]['fields'][] = array(
+ 'label' => $plugin['Name'],
+ 'value' => $plugin_version_string
+ );
+ }
+
+
+ // Populate the section for the currently active theme.
+ global $_wp_theme_features;
+ $theme_features = array();
+ if ( ! empty( $_wp_theme_features ) ) {
+ foreach ( $_wp_theme_features AS $feature => $options ) {
+ $theme_features[] = $feature;
+ }
+ }
+
+ $active_theme = wp_get_theme();
+ $info['wp-active-theme']['fields'] = array(
+ array(
+ 'label' => __( 'Name' ),
+ 'value' => $active_theme->Name
+ ),
+ array(
+ 'label' => __( 'Version' ),
+ 'value' => $active_theme->Version
+ ),
+ array(
+ 'label' => __( 'Author' ),
+ 'value' => wp_kses( $active_theme->Author, array() )
+ ),
+ array(
+ 'label' => __( 'Author website' ),
+ 'value' => ( $active_theme->offsetGet( 'Author URI' ) ? $active_theme->offsetGet( 'Author URI' ) : __( 'Undefined' ) )
+ ),
+ array(
+ 'label' => __( 'Parent theme' ),
+ 'value' => ( $active_theme->parent_theme ? $active_theme->parent_theme : __( 'Not a child theme' ) )
+ ),
+ array(
+ 'label' => __( 'Supported theme features' ),
+ 'value' => implode( ', ', $theme_features )
+ )
+ );
+
+ // Populate a list of all themes available in the install.
+ $all_themes = wp_get_themes();
+
+ foreach ( $all_themes AS $theme_slug => $theme ) {
+ // Ignore the currently active theme from the list of all themes.
+ if ( $active_theme->stylesheet == $theme_slug ) {
+ continue;
+ }
+
+ $theme_version = $theme->Version;
+ $theme_author = $theme->Author;
+
+ $theme_version_string = __( 'No version or author information available' );
+
+ if ( ! empty( $theme_version ) && ! empty( $theme_author ) ) {
+ // translators: %1$s: Theme version number. %2$s: Theme author name.
+ $theme_version_string = sprintf( __( 'Version %1$s by %2$s' ), $theme_version, wp_kses( $theme_author, array() ) );
+ }
+ if ( empty( $theme_version ) && ! empty( $theme_author ) ) {
+ // translators: %s: Theme author name.
+ $theme_version_string = sprintf( __( 'By %s' ), wp_kses( $theme_author, array() ) );
+ }
+ if ( ! empty( $theme_version ) && empty( $theme_author ) ) {
+ // translators: %s: Theme version number.
+ $theme_version_string = sprintf( __( 'Version %s' ), $theme_version );
+ }
+
+
+ $info['wp-themes']['fields'][] = array(
+ // translators: %1$s: Theme name. %2$s: Theme slug.
+ 'label' => sprintf( __( '%1$s (%2$s)' ), $theme->Name, $theme_slug ),
+ 'value' => $theme_version_string
+ );
+ }
+
+ // Add more filesystem checks
+ if ( defined( 'WPMU_PLUGIN_DIR' ) && is_dir( WPMU_PLUGIN_DIR ) ) {
+ $info['wp-filesystem']['fields'][] = array(
+ 'label' => __( 'The Must Use Plugins directory' ),
+ 'value' => ( wp_is_writable( WPMU_PLUGIN_DIR ) ? __( 'Writable' ) : __( 'Not writable' ) )
+ );
+ }
+
+
+ /**
+ * Add or modify new debug sections.
+ *
+ * Plugin or themes may wish to introduce their own debug information without creating additional admin pages for this
+ * kind of information as it is rarely needed, they can then utilize this filter to introduce their own sections.
+ *
+ * This filter intentionally does not include the fields introduced by core as those should always be un-modified
+ * and reliable for support related scenarios, take note that the core fields will take priority if a filtered value
+ * is trying to use the same array keys.
+ *
+ * Array keys added by core are all prefixed with `wp-`, plugins and themes are encouraged to use their own slug as
+ * a prefix, both for consistency as well as avoiding key collisions.
+ *
+ * @since 5.0.0
+ *
+ * @param array $args {
+ * The debug information to be added to the core information page.
+ *
+ * @type string $label The title for this section of the debug output.
+ * @type string $description Optional. A description for your information section which may contain basic HTML
+ * markup: `em`, `strong` and `a` for linking to documentation or putting emphasis.
+ * @type boolean $show_count Optional. If set to `true` the amount of fields will be included in the title for
+ * this section.
+ * @type boolean $private Optional. If set to `true` the section and all associated fields will be excluded
+ * from the copy-paste text area.
+ * @type array $fields {
+ * An associative array containing the data to be displayed.
+ *
+ * @type string $label The label for this piece of information.
+ * @type string $value The output that is of interest for this field.
+ * @type boolean $private Optional. If set to `true` the field will not be included in the copy-paste text area
+ * on top of the page, allowing you to show, for example, API keys here.
+ * }
+ * }
+ */
+ $external_info = apply_filters( 'debug_information', array() );
+
+ // Merge the core and external debug fields.
+ $info = array_replace_recursive( $info, array_replace_recursive( $external_info, $info ) );
+ ?>
+
+
+
+
+
+ $details ) {
+ if ( empty( $details['fields'] ) ) {
+ continue;
+ }
+
+ $toc[] = sprintf(
+ '
%s',
+ esc_attr( $section ),
+ esc_html( $details['label'] )
+ );
+ }
+
+ echo implode( ' | ', $toc );
+ ?>
+
+
+ $details ) {
+ if ( ! isset( $details['fields'] ) || empty( $details['fields'] ) ) {
+ continue;
+ }
+
+ printf(
+ '
%s%s
',
+ esc_attr( $section ),
+ esc_html( $details['label'] ),
+ ( isset( $details['show_count'] ) && $details['show_count'] ? sprintf( ' (%d)', count( $details['fields'] ) ) : '' )
+ );
+
+ if ( isset( $details['description'] ) && ! empty( $details['description'] ) ) {
+ printf(
+ '
%s
',
+ wp_kses( $details['description'], array(
+ 'a' => array(
+ 'href' => true
+ ),
+ 'strong' => true,
+ 'em' => true,
+ ) )
+ );
+ }
+ ?>
+
+
+ %s | %s | ',
+ esc_html( $field['label'] ),
+ esc_html( $field['value'] )
+ );
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]*>(.*)<\/body>/siU", $phpinfo_raw, $phpinfo );
+
+ // Extract the styles `phpinfo()` creates for this page.
+ preg_match_all( "/';
+ }
+
+ // Output the actual phpinfo data.
+ if ( isset( $phpinfo[1][0] ) ) {
+ echo $phpinfo[1][0];
+ }
+ ?>
+
+
+
+
+
+
+
+
+