wp_version_check( array $extra_stats = array(), bool $force_check = false )
- Since
- 2.3.0
- Source
wp-includes/update.php:27
Description
The WordPress version, PHP version, and locale is sent.
Checks against the WordPress server at api.wordpress.org. Will only check if WordPress isn't installing.
Compatibility
- WordPress
- since 2.3.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.
Parameters
$extra_statsarrayoptional- Extra statistics to report to the WordPress.org API.Default:
array() $force_checkbooloptional- Whether to bypass the transient cache and force a fresh update check.
Defaults to false, true if $extra_stats is set.Default:false
Performance profile
How much work a call to wp_version_check() 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
- 164–272
- Plugin surface
- 3 hooks
- Called by
- 5
Reaches an outbound HTTP request via wp_remote_post().
The body loops, so the work grows with what you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 437.
Third-party callbacks on 'core_version_check_locale', 'core_version_check_query_args', 'wp_maybe_auto_update' run inside this call, and their cost is not bounded by anything here.
5 places in core call this, so the cost is paid more often than your own code shows.
What it touches
- transienttransient
get_site_transient()called directly - hookthird-party callbacks
apply_filters()called directly - optionnetwork option
get_site_option()called directly - httpoutbound HTTP request
wp_remote_post()called directly - serializeserialisation
json_decode()called directly - cacheobject cache
wp_cache_get()one call below wp_version_check()
Further down the call graph this can also reach query. That is the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 36 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost wp_version_check() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && is_wp_error() | 164–165 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') | 168–169 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), is_wp_error() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() | 169–170 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() | 173–174 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() | 180–183 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() | 184–187 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && is_wp_error() | 198–201 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') | 203–205 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) | 207–215 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && doing_action() | 211–219 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), doing_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) | 211–219 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && !doing_action() | 214–222 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), doing_action(), do_action() |
24 further outcomes, up to 272 instructions
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') | 214–218 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && doing_action() | 215–223 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), doing_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && !empty($body) | 218–223 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && !doing_action() | 218–226 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), doing_action(), do_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && !empty($body) && doing_action() | 222–227 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), doing_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && !empty($body) | 222–227 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && !empty($body) && !doing_action() | 225–230 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), doing_action(), do_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && !empty($body) | 225–230 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), time(), wp_schedule_single_event() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && !empty($body) && doing_action() | 226–231 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), doing_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && !empty($body) && doing_action() | 229–234 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), time(), wp_schedule_single_event(), doing_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && !empty($body) && !doing_action() | 229–234 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), doing_action(), do_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && !empty($body) | 229–234 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), time(), wp_schedule_single_event() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && !empty($body) && !doing_action() | 232–237 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), time(), wp_schedule_single_event(), doing_action(), do_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && !empty($body) && doing_action() | 233–238 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), time(), wp_schedule_single_event(), doing_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && !is_wp_error() && is_array($body) && isset($body) && !empty($body) && !doing_action() | 236–241 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), time(), wp_schedule_single_event(), doing_action(), do_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && is_array($body) && isset($body) | 241–250 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && is_array($body) && isset($body) && doing_action() | 245–254 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), doing_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && is_array($body) && isset($body) && !doing_action() | 248–257 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), doing_action(), do_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && is_array($body) && isset($body) && !empty($body) | 252–258 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && is_array($body) && isset($body) && !empty($body) && doing_action() | 256–262 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), doing_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && is_array($body) && isset($body) && !empty($body) && !doing_action() | 259–265 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), doing_action(), do_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && is_array($body) && isset($body) && !empty($body) | 259–265 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), time(), wp_schedule_single_event() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && is_array($body) && isset($body) && !empty($body) && doing_action() | 263–269 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), time(), wp_schedule_single_event(), doing_action() |
!wp_installing() && empty($extra_stats) && !isset($current) && !method_exists() && !is_multisite() && !isset($wp_local_package) && !function_exists() && !is_array($extra_stats) && !defined('WP_AUTO_UPDATE_CORE') && is_array($body) && isset($body) && !empty($body) && !doing_action() | 266–272 | wp_installing(), get_site_transient(), wp_get_installed_translations(), get_locale(), apply_filters(), time(), set_site_transient(), method_exists(), method_exists(), is_multisite(), home_url(), get_loaded_extensions(), sort(), wp_get_wp_version(), get_user_count(), get_site_option(), array_map(), array_combine(), function_exists(), apply_filters(), wp_json_encode(), http_build_query(), wp_http_supports(), wp_doing_cron(), wp_get_wp_version(), home_url(), home_url(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), wp_remote_retrieve_body(), json_decode(), wp_install(), time(), wp_get_wp_version(), set_site_transient(), time(), wp_next_scheduled(), time(), wp_schedule_single_event(), doing_action(), do_action() |
This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 437 | 164–272 | 39 | |
| 8.5 | 437 | 164–272 | 39 | |
| 8.4 | 437 | 164–272 | 39 | 9 fewer instructions than PHP 8.3 |
| 8.3 | 446 | 166–277 | 39 | |
| 8.2 | 446 | 166–277 | 39 | |
| 8.1 | 446 | 166–277 | 39 | |
| 7.4 | 446 | 166–277 | 39 |
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 · 3
3 hooks fire while wp_version_check() runs, in this order:
- apply_filters( core_version_check_locale )filterline 69 (+42 into the body)
Filters the locale requested for WordPress core translations.
- apply_filters( core_version_check_query_args )filterline 167 (+140 into the body)
Filters the query arguments sent as part of the core version check.
- do_action( wp_maybe_auto_update )actionline 295 (+268 into the body)
Fires during wp_cron, starting the auto-update process.
Uses · 31
- wp_installing()Checks or sets whether WordPress is in "installation" mode.
- get_site_transient()Retrieves the value of a site transient.
- wp_get_installed_translations()Gets installed translations.
- wp_get_wp_version()Returns the current WordPress version.
- apply_filters()Calls the callback functions that have been added to a filter hook.
- get_locale()Retrieves the current locale.
- set_site_transient()Sets/updates the value of a site transient.
- is_multisite()Determines whether Multisite is enabled.
- get_blog_count()Gets the number of active sites on the installation.
- network_site_url()Retrieves the site URL for the current network.
- home_url()Retrieves the URL for the current site where the front end is accessible.
- get_user_count()Returns the number of active users in your installation.
Show all 31
- get_site_option()Retrieve an option value for the current network based on name of option.
- wp_json_encode()Encodes a variable into JSON, with some confidence checks.
- wp_http_supports()Determines if there is an HTTP Transport that can process this request.
- set_url_scheme()Sets the scheme for a URL.
- wp_doing_cron()Determines whether the current request is a WordPress cron request.
- wp_remote_post()Performs an HTTP request using the POST method and returns its response.
- is_wp_error()Checks whether the given variable is a WordPress Error.
- wp_trigger_error()Generates a user-level error/warning/notice/deprecation message.
- __()Retrieves the translation of $text.
- wp_remote_retrieve_response_code()Retrieves only the response code from the raw response.
- wp_remote_retrieve_body()Retrieves only the body from the raw response.
- esc_url()Checks and cleans a URL.
- esc_html()Escaping for HTML blocks.
- wp_next_scheduled()Retrieves the next timestamp for an event.
- wp_schedule_single_event()Schedules an event to run only once.
- doing_action()Returns whether or not an action hook is currently being processed.
- do_action()Calls the callback functions that have been added to an action hook.
- stdClass::__construct()
- Imagick::queryFormats()
Used by · 5
- Core_Upgrader::upgrade()Upgrades WordPress core.
- WP_Automatic_Updater::run()Kicks off the background update process, looping through all pending updates.
- WP_Debug_Data::check_for_updates()Calls all core functions to check for updates.
- WP_Upgrader::run()Runs an upgrade/installation.
- _maybe_update_core()Determines whether core should be updated.
Source code
function wp_version_check( $extra_stats = array(), $force_check = false ) { global $wpdb, $wp_local_package; if ( wp_installing() ) { return; } $php_version = PHP_VERSION; $current = get_site_transient( 'update_core' ); $translations = wp_get_installed_translations( 'core' ); // Invalidate the transient when $wp_version changes. if ( is_object( $current ) && wp_get_wp_version() !== $current->version_checked ) { $current = false; } if ( ! is_object( $current ) ) { $current = new stdClass(); $current->updates = array(); $current->version_checked = wp_get_wp_version(); } if ( ! empty( $extra_stats ) ) { $force_check = true; } // Wait 1 minute between multiple version check requests. $timeout = MINUTE_IN_SECONDS; $time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked ); if ( ! $force_check && $time_not_changed ) { return; } /** * Filters the locale requested for WordPress core translations. * * @since 2.8.0 * * @param string $locale Current locale. */ $locale = apply_filters( 'core_version_check_locale', get_locale() ); // Update last_checked for current to prevent multiple blocking requests if request hangs. $current->last_checked = time(); set_site_transient( 'update_core', $current ); if ( method_exists( $wpdb, 'db_server_info' ) ) { $mysql_version = $wpdb->db_server_info(); } elseif ( method_exists( $wpdb, 'db_version' ) ) { $mysql_version = preg_replace( '/[^0-9.].*/', '', $wpdb->db_version() ); } else { $mysql_version = 'N/A'; } if ( is_multisite() ) { $num_blogs = get_blog_count(); $wp_install = network_site_url(); $multisite_enabled = 1; } else { $multisite_enabled = 0; $num_blogs = 1; $wp_install = home_url( '/' ); } $extensions = get_loaded_extensions(); sort( $extensions, SORT_STRING | SORT_FLAG_CASE ); $query = array( 'version' => wp_get_wp_version(), 'php' => $php_version, 'locale' => $locale, 'mysql' => $mysql_version, 'local_package' => isset( $wp_local_package ) ? $wp_local_package : '', 'blogs' => $num_blogs, 'users' => get_user_count(), 'multisite_enabled' => $multisite_enabled, 'initial_db_version' => get_site_option( 'initial_db_version' ), 'extensions' => array_combine( $extensions, array_map( 'phpversion', $extensions ) ), 'platform_flags' => array(Changelog
Introduced in 2.3.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-includes/update.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.