WP_Debug_Data::debug_data(): array
- Since
- 5.2.0, 5.3.0, 5.5.0, 6.7.0
- Source
wp-admin/includes/class-wp-debug-data.php:36
Compatibility
- WordPress
- since 6.7.0
- PHP
- 7.4–8.6-dev
- 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), and compiles on PHP 7.4 through 8.6-dev.
Return value
array- The debug data for the site.
Performance profile
How much work a call to WP_Debug_Data::debug_data() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Trivial
- Scaling
- Constant
- Instructions
- 3
- Plugin surface
- 1 hook
- Called by
- 0
Touches nothing outside its own arguments.
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5. The body compiles to 58.
Third-party callbacks on 'debug_information' run inside this call, and their cost is not bounded by anything here.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- hookthird-party callbacks
apply_filters()called directly
What one call costs · 1 distinct outcome
One number would be a lie: the work depends on which branch runs. These are every distinct cost WP_Debug_Data::debug_data() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
| always | 3 | none |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 58 | 3 | 0 | |
| 8.5 | 58 | 3 | 0 | |
| 8.4 | 58 | 3 | 0 | |
| 8.3 | 58 | 3 | 0 | |
| 8.2 | 58 | 3 | 0 | |
| 8.1 | 58 | 3 | 0 | 3 more instructions than PHP 7.4 |
| 7.4 | 55 | 55 | 0 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Hooks and filters fired · 1
One hook fires while WP_Debug_Data::debug_data() runs, in this order:
- apply_filters( debug_information )filterline 135 (+99 into the body)
Filters the debug information shown on the Tools -> Site Health -> Info screen.
Uses · 15
- apply_filters()Calls the callback functions that have been added to a filter hook.
- WP_Debug_Data::get_wp_core()Gets the WordPress core section of the debug data.
- WP_Debug_Data::get_wp_paths_sizes()Gets the WordPress paths and sizes section of the debug data.
- WP_Debug_Data::get_wp_dropins()Gets the WordPress drop-in section of the debug data.
- WP_Debug_Data::get_wp_active_theme()Gets the WordPress active theme section of the debug data.
- WP_Debug_Data::get_wp_parent_theme()Gets the WordPress parent theme section of the debug data.
- WP_Debug_Data::get_wp_themes_inactive()Gets the WordPress inactive themes section of the debug data.
- WP_Debug_Data::get_wp_mu_plugins()Gets the WordPress MU plugins section of the debug data.
- WP_Debug_Data::get_wp_plugins_active()Gets the WordPress active plugins section of the debug data.
- WP_Debug_Data::get_wp_plugins_inactive()Gets the WordPress inactive plugins section of the debug data.
- WP_Debug_Data::get_wp_media()Gets the WordPress media section of the debug data.
- WP_Debug_Data::get_wp_server()Gets the WordPress server section of the debug data.
Show all 15
- WP_Debug_Data::get_wp_database()Gets the WordPress database section of the debug data.
- WP_Debug_Data::get_wp_constants()Gets the WordPress constants section of the debug data.
- WP_Debug_Data::get_wp_filesystem()Gets the file system section of the debug data.
Source code
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.0 * * @param array $args { * The debug information to be added to the core information page. * * This is an associative multi-dimensional array, up to three levels deep. * The topmost array holds the sections, keyed by section ID. * * @type array ...$0 { * Each section has a `$fields` associative array (see below), and each `$value` in `$fields` * can be another associative array of name/value pairs when there is more structured data * to display. * * @type string $label Required. 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, inline tags only as it is * outputted in a paragraph. * @type bool $show_count Optional. If set to `true`, the amount of fields will be included * in the title for this section. Default false. * @type bool $private Optional. If set to `true`, the section and all associated fields * will be excluded from the copied data. Default false. * @type array $fields { * Required. An associative array containing the fields to be displayed in the section, * keyed by field ID. * * @type array ...$0 { * An associative array containing the data to be displayed for the field.Changelog
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 6.7.7 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.