WP_Debug_Data::get_wp_core(): array<string,
- Since
- 6.7.0
- Source
wp-admin/includes/class-wp-debug-data.php:147
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<string,- string|array> The debug data for the Info screen.
Performance profile
How much work a call to WP_Debug_Data::get_wp_core() 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
- Expensive
- Scaling
- Scales with input
- Instructions
- 206–264
- Plugin surface
- None
- Called by
- 1
Reaches an outbound HTTP request via wp_remote_get().
The body loops, so the work grows with how much data it finds.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 321.
Nothing here hands control to plugin code.
1 place in core call this, so the cost is paid more often than your own code shows.
What it touches
- optionoption read or write
get_option()called directly - httpoutbound HTTP request
wp_remote_get()called directly - sqldatabase query
->query()called directly - hookthird-party callbacks
apply_filters()one call below WP_Debug_Data::get_wp_core() - cacheobject cache
wp_cache_get()one call below WP_Debug_Data::get_wp_core() - serializeserialisation
maybe_unserialize()one call below WP_Debug_Data::get_wp_core() - transienttransient
get_site_transient()one call below WP_Debug_Data::get_wp_core() - querycontent query
get_user_by()one call below WP_Debug_Data::get_wp_core()
What one call costs · 8 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost WP_Debug_Data::get_wp_core() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
!is_multisite() && !is_wp_error() | 206–214 | get_option(), is_ssl(), get_option(), get_option(), get_option(), wp_get_environment_type(), wp_get_wp_version(), get_core_updates(), __(), __(), get_locale(), __(), get_user_locale(), __(), wp_timezone_string(), __(), get_bloginfo(), __(), get_bloginfo(), __(), __(), __(), __(), is_multisite(), __(), is_multisite(), __(), __(), __(), __(), __(), _x(), __(), is_multisite(), __(), get_user_count(), wp_remote_get(), is_wp_error(), __(), __(), __() |
!is_multisite() && !is_wp_error() | 208–216 | get_option(), is_ssl(), get_option(), get_option(), get_option(), wp_get_environment_type(), wp_get_wp_version(), get_core_updates(), __(), __(), get_locale(), __(), get_user_locale(), __(), wp_timezone_string(), __(), get_bloginfo(), __(), get_bloginfo(), __(), __(), __(), __(), __(), is_multisite(), __(), is_multisite(), __(), __(), __(), __(), __(), _x(), __(), is_multisite(), __(), get_user_count(), wp_remote_get(), is_wp_error(), __(), __(), __() |
!is_multisite() && is_wp_error() | 217–225 | get_option(), is_ssl(), get_option(), get_option(), get_option(), wp_get_environment_type(), wp_get_wp_version(), get_core_updates(), __(), __(), get_locale(), __(), get_user_locale(), __(), wp_timezone_string(), __(), get_bloginfo(), __(), get_bloginfo(), __(), __(), __(), __(), is_multisite(), __(), is_multisite(), __(), __(), __(), __(), __(), _x(), __(), is_multisite(), __(), get_user_count(), wp_remote_get(), is_wp_error(), __(), __(), gethostbyname(), ->get_error_message(), sprintf(), ->get_error_message(), __() |
!is_multisite() && is_wp_error() | 219–227 | get_option(), is_ssl(), get_option(), get_option(), get_option(), wp_get_environment_type(), wp_get_wp_version(), get_core_updates(), __(), __(), get_locale(), __(), get_user_locale(), __(), wp_timezone_string(), __(), get_bloginfo(), __(), get_bloginfo(), __(), __(), __(), __(), __(), is_multisite(), __(), is_multisite(), __(), __(), __(), __(), __(), _x(), __(), is_multisite(), __(), get_user_count(), wp_remote_get(), is_wp_error(), __(), __(), gethostbyname(), ->get_error_message(), sprintf(), ->get_error_message(), __() |
is_multisite() && !is_wp_error() | 242–251 | get_option(), is_ssl(), get_option(), get_option(), get_option(), wp_get_environment_type(), wp_get_wp_version(), get_core_updates(), __(), __(), get_locale(), __(), get_user_locale(), __(), wp_timezone_string(), __(), get_bloginfo(), __(), get_bloginfo(), __(), __(), __(), __(), is_multisite(), __(), is_multisite(), __(), __(), __(), __(), __(), _x(), __(), is_multisite(), get_current_blog_id(), __(), label(), ->query(), __(), __(), __(), get_user_count(), wp_remote_get(), is_wp_error(), __(), __(), __() |
is_multisite() && !is_wp_error() | 244–253 | get_option(), is_ssl(), get_option(), get_option(), get_option(), wp_get_environment_type(), wp_get_wp_version(), get_core_updates(), __(), __(), get_locale(), __(), get_user_locale(), __(), wp_timezone_string(), __(), get_bloginfo(), __(), get_bloginfo(), __(), __(), __(), __(), __(), is_multisite(), __(), is_multisite(), __(), __(), __(), __(), __(), _x(), __(), is_multisite(), get_current_blog_id(), __(), label(), ->query(), __(), __(), __(), get_user_count(), wp_remote_get(), is_wp_error(), __(), __(), __() |
is_multisite() && is_wp_error() | 253–262 | get_option(), is_ssl(), get_option(), get_option(), get_option(), wp_get_environment_type(), wp_get_wp_version(), get_core_updates(), __(), __(), get_locale(), __(), get_user_locale(), __(), wp_timezone_string(), __(), get_bloginfo(), __(), get_bloginfo(), __(), __(), __(), __(), is_multisite(), __(), is_multisite(), __(), __(), __(), __(), __(), _x(), __(), is_multisite(), get_current_blog_id(), __(), label(), ->query(), __(), __(), __(), get_user_count(), wp_remote_get(), is_wp_error(), __(), __(), gethostbyname(), ->get_error_message(), sprintf(), ->get_error_message(), __() |
is_multisite() && is_wp_error() | 255–264 | get_option(), is_ssl(), get_option(), get_option(), get_option(), wp_get_environment_type(), wp_get_wp_version(), get_core_updates(), __(), __(), get_locale(), __(), get_user_locale(), __(), wp_timezone_string(), __(), get_bloginfo(), __(), get_bloginfo(), __(), __(), __(), __(), __(), is_multisite(), __(), is_multisite(), __(), __(), __(), __(), __(), _x(), __(), is_multisite(), get_current_blog_id(), __(), label(), ->query(), __(), __(), __(), get_user_count(), wp_remote_get(), is_wp_error(), __(), __(), gethostbyname(), ->get_error_message(), sprintf(), ->get_error_message(), __() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 310 | 201–258 | 14 | 11 fewer instructions than PHP 8.5 |
| 8.5 | 321 | 206–264 | 14 | |
| 8.4 | 321 | 206–264 | 14 | |
| 8.3 | 321 | 206–264 | 14 | |
| 8.2 | 321 | 206–264 | 14 | |
| 8.1 | 321 | 206–264 | 14 | |
| 7.4 | 321 | 206–264 | 14 |
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.
Uses · 18
- get_option()Retrieves an option value based on an option name.
- is_ssl()Determines if SSL is used.
- wp_get_environment_type()Retrieves the current environment type.
- wp_get_wp_version()Returns the current WordPress version.
- get_core_updates()Gets available core updates.
- __()Retrieves the translation of $text.
- get_locale()Retrieves the current locale.
- get_user_locale()Retrieves the locale of a user.
- wp_timezone_string()Retrieves the timezone of the site as a string.
- get_bloginfo()Retrieves information about the current site.
- is_multisite()Determines whether Multisite is enabled.
- _x()Retrieves translated string with gettext context.
Show all 18
- get_current_blog_id()Retrieves the current site ID.
- get_blog_count()Gets the number of active sites on the installation.
- get_user_count()Returns the number of active users in your installation.
- wp_remote_get()Performs an HTTP request using the GET method and returns its response.
- is_wp_error()Checks whether the given variable is a WordPress Error.
- WP_Network_Query::__construct()Constructor.
Used by · 1
- WP_Debug_Data::debug_data()Static function for generating site debug data when required.
Source code
private static function get_wp_core(): array { // Save few function calls. $permalink_structure = get_option( 'permalink_structure' ); $is_ssl = is_ssl(); $users_can_register = get_option( 'users_can_register' ); $blog_public = get_option( 'blog_public' ); $default_comment_status = get_option( 'default_comment_status' ); $environment_type = wp_get_environment_type(); $core_version = wp_get_wp_version(); $core_updates = get_core_updates(); $core_update_needed = ''; if ( is_array( $core_updates ) ) { foreach ( $core_updates as $core => $update ) { if ( 'upgrade' === $update->response ) { /* translators: %s: Latest WordPress version number. */ $core_update_needed = ' ' . sprintf( __( '(Latest version: %s)' ), $update->version ); } else { $core_update_needed = ''; } } } $fields = array( 'version' => array( 'label' => __( 'Version' ), 'value' => $core_version . $core_update_needed, 'debug' => $core_version, ), 'site_language' => array( 'label' => __( 'Site Language' ), 'value' => get_locale(), ), 'user_language' => array( 'label' => __( 'User Language' ), 'value' => get_user_locale(), ), 'timezone' => array( 'label' => __( 'Timezone' ), 'value' => wp_timezone_string(), ), 'home_url' => array( 'label' => __( 'Home URL' ), 'value' => get_bloginfo( 'url' ), 'private' => true, ), 'site_url' => array( 'label' => __( 'Site URL' ), 'value' => get_bloginfo( 'wpurl' ), 'private' => true, ), 'permalink' => array( 'label' => __( 'Permalink structure' ), 'value' => $permalink_structure ? $permalink_structure : __( 'No permalink structure set' ), 'debug' => $permalink_structure, ), 'https_status' => array( 'label' => __( 'Is this site using HTTPS?' ), 'value' => $is_ssl ? __( 'Yes' ) : __( 'No' ), 'debug' => $is_ssl, ), 'multisite' => array( 'label' => __( 'Is this a multisite?' ), 'value' => is_multisite() ? __( 'Yes' ) : __( 'No' ), 'debug' => is_multisite(), ), 'user_registration' => array( 'label' => __( 'Can anyone register on this site?' ), 'value' => $users_can_register ? __( 'Yes' ) : __( 'No' ), 'debug' => $users_can_register, ), 'blog_public' => array( 'label' => __( 'Is this site discouraging search engines?' ), 'value' => $blog_public ? __( 'No' ) : __( 'Yes' ), 'debug' => $blog_public, ), 'default_comment_status' => array( 'label' => __( 'Default comment status' ), 'value' => 'open' === $default_comment_status ? _x( 'Open', 'comment status' ) : _x( 'Closed', 'comment status' ), 'debug' => $default_comment_status,Changelog
Introduced in 6.7.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
array to array<string,.verified against sourceAbout 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.