WP_Debug_Data
- Since
- 5.2.0
- Source
wp-admin/includes/class-wp-debug-data.php:10
Class for providing debug data based on a users WordPress environment.
Compatibility
- WordPress
- since 5.2.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Hooks and filters fired · 5
Every hook that fires from inside WP_Debug_Data, in the order it appears in the class, grouped by the method that fires it.
Methods · 21
- check_for_updates()Calls all core functions to check for updates.
- debug_data()Static function for generating site debug data when required.
- get_wp_core()Gets the WordPress core section of the debug data.
- get_wp_dropins()Gets the WordPress drop-in section of the debug data.
- get_wp_server()Gets the WordPress server section of the debug data.
- get_wp_media()Gets the WordPress media section of the debug data.
- get_wp_mu_plugins()Gets the WordPress MU plugins section of the debug data.
- get_wp_paths_sizes()Gets the WordPress paths and sizes section of the debug data.
- get_wp_plugins_active()Gets the WordPress active plugins section of the debug data.
- get_wp_plugins_inactive()Gets the WordPress inactive plugins section of the debug data.
- get_wp_plugins_raw_data()Gets the raw plugin data for the WordPress active and inactive sections of the debug data.
- get_wp_active_theme()Gets the WordPress active theme section of the debug data.
- get_wp_parent_theme()Gets the WordPress parent theme section of the debug data.
- get_wp_themes_inactive()Gets the WordPress inactive themes section of the debug data.
- get_wp_constants()Gets the WordPress constants section of the debug data.
- get_wp_database()Gets the WordPress database section of the debug data.
- get_wp_filesystem()Gets the file system section of the debug data.
- get_mysql_var()Returns the value of a MySQL system variable.
- format()Formats the information gathered for debugging, in a manner suitable for copying to a forum or support ticket.
- get_database_size()Fetches the total size of all the database tables for the active database user.
- get_sizes()Fetches the sizes of the WordPress directories: `wordpress` (ABSPATH), `plugins`, `themes`, and `uploads`.
Source code
#[AllowDynamicProperties]class WP_Debug_Data { /** * Calls all core functions to check for updates. * * @since 5.2.0 */ public static function check_for_updates() { wp_version_check(); wp_update_plugins(); wp_update_themes(); } /** * Static function for generating site debug data when required. * * @since 5.2.0 * @since 5.3.0 Added database charset, database collation, * and timezone information. * @since 5.5.0 Added pretty permalinks support information. * @since 6.7.0 Modularized into separate theme-oriented methods. * * @throws ImagickException * * @return array The debug data for the site. */ public static function debug_data() { /* * Set up the array that holds all debug information. * * When iterating through the debug data, the ordering of the sections * occurs in insertion-order of the assignments into this array. * * This is the single assignment of the sections before filtering. Null-entries will * be automatically be removed. */ $info = array( 'wp-core' => self::get_wp_core(), 'wp-paths-sizes' => self::get_wp_paths_sizes(), 'wp-dropins' => self::get_wp_dropins(), 'wp-active-theme' => self::get_wp_active_theme(), 'wp-parent-theme' => self::get_wp_parent_theme(), 'wp-themes-inactive' => self::get_wp_themes_inactive(), 'wp-mu-plugins' => self::get_wp_mu_plugins(), 'wp-plugins-active' => self::get_wp_plugins_active(), 'wp-plugins-inactive' => self::get_wp_plugins_inactive(), 'wp-media' => self::get_wp_media(), 'wp-server' => self::get_wp_server(), 'wp-database' => self::get_wp_database(), 'wp-constants' => self::get_wp_constants(), 'wp-filesystem' => self::get_wp_filesystem(), ); /* * Remove null elements from the array. The individual methods are * allowed to return `null`, which communicates that the category * of debug data isn't relevant and shouldn't be passed through. */ $info = array_filter( $info, static function ( $section ) { return isset( $section ); } ); /** * Filters the debug information shown on the Tools -> Site Health -> Info screen. * * Plugin or themes may wish to introduce their own debug information without creating * additional admin pages. They can utilize this filter to introduce their own sections * or add more data to existing sections. * * Array keys for sections added by core are all prefixed with `wp-`. Plugins and themes * should use their own slug as a prefix, both for consistency as well as avoiding * key collisions. Note that the array keys are used as labels for the copied data. * * All strings are expected to be plain text except `$description` that can contain * inline HTML tags (see below). * * @since 5.2.0Changelog
Introduced in 5.2.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-admin/includes/class-wp-debug-data.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.