wppaste
WordPress

wp_update_themes( array $extra_stats = array() )

Since
2.7.0
Source
wp-includes/update.php:597
Checks for available updates to themes based on the latest versions hosted on WordPress.org.

Description

Despite its name this function does not actually perform any updates, it only checks for available updates.

A list of all themes installed is sent to api.wordpress.org, along with the site locale.

Checks against the WordPress server at api.wordpress.org. Will only check if WordPress isn't installing.

Compatibility

WordPress
since 2.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.

Parameters

$extra_statsarrayoptional
Extra statistics to report to the WordPress.org API.Default: array()

Performance profile

How much work a call to wp_update_themes() 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

Reaches an outbound HTTP request via wp_remote_post().

Scaling
Scales with input

The body loops, so the work grows with what you pass in.

Instructions
48–215

Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 391.

Plugin surface
2 hooks

Third-party callbacks on 'themes_update_check_locales', 'update_themes_{$hostname}' run inside this call, and their cost is not bounded by anything here.

Called by
4

4 places in core call this, so the cost is paid more often than your own code shows.

What it touches

  • transienttransientget_site_transient()called directly
  • optionoption read or writeget_option()called directly
  • hookthird-party callbacksapply_filters()called directly
  • httpoutbound HTTP requestwp_remote_post()called directly
  • serializeserialisationjson_decode()called directly
  • cacheobject cachewp_cache_get()one call below wp_update_themes()

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 · 37 distinct outcomes

One number would be a lie: the work depends on which branch runs. These are every distinct cost wp_update_themes() can have, taken from its control-flow graph on PHP 8.5.

WhenInstructionsCalls it makes
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update)48–54wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && is_wp_error()111–128wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), wp_remote_post(), is_wp_error()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update)115–132wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), wp_remote_post(), is_wp_error(), is_wp_error()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()116–133wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && is_wp_error()116–133wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && is_wp_error()117–134wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), wp_remote_post(), is_wp_error()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()120–137wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update)120–137wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error(), is_wp_error()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()121–138wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update)121–138wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), wp_remote_post(), is_wp_error(), is_wp_error()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()122–139wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && is_wp_error()122–139wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error()
25 further outcomes, up to 215 instructions
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()125–142wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()126–143wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update)126–143wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error(), is_wp_error()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()127–144wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()131–148wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()141–168wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), themes(), time(), wp_remote_retrieve_body(), json_decode(), set_site_transient()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()145–172wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code(), themes(), time(), wp_remote_retrieve_body(), json_decode(), set_site_transient()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && is_wp_error()145–164wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()146–173wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), themes(), time(), wp_remote_retrieve_body(), json_decode(), set_site_transient()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()147–174wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), themes(), time(), wp_remote_retrieve_body(), json_decode(), set_site_transient()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()150–177wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code(), themes(), time(), wp_remote_retrieve_body(), json_decode(), set_site_transient()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update)150–169wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), 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() && is_object($last_update) && current_filter() && !isset($last_update) && is_wp_error()150–169wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()151–178wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code(), themes(), time(), wp_remote_retrieve_body(), json_decode(), set_site_transient()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && is_wp_error()151–170wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()152–179wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), themes(), time(), wp_remote_retrieve_body(), json_decode(), set_site_transient()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update)155–174wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), set_url_scheme(), 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() && is_object($last_update) && current_filter() && !isset($last_update) && !is_wp_error()156–183wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error(), is_wp_error(), wp_remote_retrieve_response_code(), themes(), time(), wp_remote_retrieve_body(), json_decode(), set_site_transient()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update)156–175wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), 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() && is_object($last_update) && current_filter() && !isset($last_update) && is_wp_error()156–175wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update)161–180wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), set_url_scheme(), 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() && is_object($last_update) && current_filter() && !isset($last_update)175–204wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), themes(), time(), wp_remote_retrieve_body(), json_decode(), set_site_transient()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update)180–209wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), themes(), time(), wp_remote_retrieve_body(), json_decode(), set_site_transient()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update)181–210wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), themes(), time(), wp_remote_retrieve_body(), json_decode(), set_site_transient()
!wp_installing() && is_object($last_update) && current_filter() && !isset($last_update)186–215wp_installing(), wp_get_themes(), wp_get_installed_translations(), get_site_transient(), get_option(), wp_doing_cron(), current_filter(), time(), set_site_transient(), get_available_languages(), array_values(), apply_filters(), array_unique(), wp_json_encode(), wp_json_encode(), wp_json_encode(), wp_get_wp_version(), home_url(), wp_json_encode(), wp_http_supports(), set_url_scheme(), wp_remote_post(), is_wp_error(), __(), __(), sprintf(), __(), headers_sent(), wp_trigger_error(), wp_remote_post(), is_wp_error(), wp_remote_retrieve_response_code(), themes(), time(), wp_remote_retrieve_body(), json_decode(), set_site_transient()

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

PHPCompiledExecutedBranchesNotes
8.6-dev39148–21547
8.539148–21547
8.439148–21547
8.339148–21547
8.239148–215471 more instruction than PHP 8.1
8.139048–215472 fewer instructions than PHP 7.4
7.439248–21447

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 · 2

2 hooks fire while wp_update_themes() runs, in this order:

  1. apply_filters( themes_update_check_locales )filterline 697 (+100 into the body)

    Filters the locales requested for theme translations.

  2. apply_filters( update_themes_{$hostname} )filterline 804 (+207 into the body)

    Filters the update response for a given theme hostname.

Uses · 24

Show all 24

Used by · 4

Source code

function wp_update_themes( $extra_stats = array() ) {	if ( wp_installing() ) {		return;	} 	$installed_themes = wp_get_themes();	$translations     = wp_get_installed_translations( 'themes' ); 	$last_update = get_site_transient( 'update_themes' ); 	if ( ! is_object( $last_update ) ) {		$last_update = new stdClass();	} 	$themes  = array();	$checked = array();	$request = array(); 	// Put slug of active theme into request.	$request['active'] = get_option( 'stylesheet' ); 	foreach ( $installed_themes as $theme ) {		$checked[ $theme->get_stylesheet() ] = $theme->get( 'Version' ); 		$themes[ $theme->get_stylesheet() ] = array(			'Name'       => $theme->get( 'Name' ),			'Title'      => $theme->get( 'Name' ),			'Version'    => $theme->get( 'Version' ),			'Author'     => $theme->get( 'Author' ),			'Author URI' => $theme->get( 'AuthorURI' ),			'UpdateURI'  => $theme->get( 'UpdateURI' ),			'Template'   => $theme->get_template(),			'Stylesheet' => $theme->get_stylesheet(),		);	} 	$doing_cron = wp_doing_cron(); 	// Check for update on a different schedule, depending on the page.	switch ( current_filter() ) {		case 'upgrader_process_complete':			$timeout = 0;			break;		case 'load-update-core.php':			$timeout = MINUTE_IN_SECONDS;			break;		case 'load-themes.php':		case 'load-update.php':			$timeout = HOUR_IN_SECONDS;			break;		default:			if ( $doing_cron ) {				$timeout = 2 * HOUR_IN_SECONDS;			} else {				$timeout = 12 * HOUR_IN_SECONDS;			}	} 	$time_not_changed = isset( $last_update->last_checked ) && $timeout > ( time() - $last_update->last_checked ); 	if ( $time_not_changed && ! $extra_stats ) {		$theme_changed = false; 		foreach ( $checked as $slug => $v ) {			if ( ! isset( $last_update->checked[ $slug ] ) || (string) $last_update->checked[ $slug ] !== (string) $v ) {				$theme_changed = true;			}		} 		if ( isset( $last_update->response ) && is_array( $last_update->response ) ) {			foreach ( $last_update->response as $slug => $update_details ) {				if ( ! isset( $checked[ $slug ] ) ) {					$theme_changed = true;					break;				}			}		} 		// Bail if we've checked recently and if nothing has changed.		if ( ! $theme_changed ) {

Changelog

Introduced in 2.7.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 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.