wppaste
WordPress

wp_plugin_update_row( string $file, array $plugin_data ): void|false

Since
2.3.0
Source
wp-admin/includes/update.php:451
Displays update information for a plugin.

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

$filestring
Plugin basename.
$plugin_dataarray
Plugin information.

Return value

void|false

Performance profile

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

Reads stored settings via get_site_option(), cached per request but not free on a cold cache.

Scaling
Constant

No loop in the body: the same number of instructions runs whatever you pass in.

Instructions
10–174

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

Plugin surface
1 hook

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

Called by
0

Nothing in core calls this; the cost is only what you spend yourself.

What it touches

  • transienttransientget_site_transient()called directly
  • hookthird-party callbacksdo_action()called directly
  • cacheobject cachewp_cache_get()one call below wp_plugin_update_row()
  • optionnetwork optionget_site_option()one call below wp_plugin_update_row()

Further down the call graph this can also reach serialize and query. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.

What one call costs · 27 distinct outcomes

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

WhenInstructionsCalls it makes
!isset($file)10get_site_transient()
isset($file) && !isset($response) && !is_network_admin() && is_multisite()48–50get_site_transient(), wp_kses(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite()
isset($file) && isset($response) && !is_network_admin() && is_multisite()52–53get_site_transient(), wp_kses(), self_admin_url(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite()
isset($file) && !isset($response)134–141get_site_transient(), wp_kses(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_network_admin(), is_plugin_active(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), printf(), do_action()
isset($file) && !isset($response) && is_network_admin()135–142get_site_transient(), wp_kses(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_network_admin(), is_plugin_active_for_network(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), printf(), do_action()
isset($file) && !isset($response) && !is_network_admin() && !is_multisite()137–144get_site_transient(), wp_kses(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite(), is_network_admin(), is_plugin_active(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), printf(), do_action()
isset($file) && !isset($response) && !is_multisite()138–145get_site_transient(), wp_kses(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite(), is_network_admin(), is_plugin_active_for_network(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), printf(), do_action()
isset($file) && isset($response)138–144get_site_transient(), wp_kses(), self_admin_url(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_network_admin(), is_plugin_active(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), printf(), do_action()
isset($file) && isset($response) && is_network_admin()139–145get_site_transient(), wp_kses(), self_admin_url(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_network_admin(), is_plugin_active_for_network(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), printf(), do_action()
isset($file) && isset($response) && !is_network_admin() && !is_multisite()141–147get_site_transient(), wp_kses(), self_admin_url(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite(), is_network_admin(), is_plugin_active(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), printf(), do_action()
isset($file) && isset($response) && !is_multisite()142–148get_site_transient(), wp_kses(), self_admin_url(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite(), is_network_admin(), is_plugin_active_for_network(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), printf(), do_action()
isset($file) && !isset($response) && current_user_can() && !empty($response)146–151get_site_transient(), wp_kses(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_network_admin(), is_plugin_active(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), wp_get_update_php_url(), esc_url(), printf(), wp_update_php_annotation(), do_action()
15 further outcomes, up to 174 instructions
isset($file) && !isset($response) && is_network_admin() && current_user_can() && !empty($response)147–152get_site_transient(), wp_kses(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_network_admin(), is_plugin_active_for_network(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), wp_get_update_php_url(), esc_url(), printf(), wp_update_php_annotation(), do_action()
isset($file) && !isset($response) && !is_network_admin() && !is_multisite() && current_user_can() && !empty($response)149–154get_site_transient(), wp_kses(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite(), is_network_admin(), is_plugin_active(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), wp_get_update_php_url(), esc_url(), printf(), wp_update_php_annotation(), do_action()
isset($file) && !isset($response) && !is_multisite() && current_user_can() && !empty($response)150–155get_site_transient(), wp_kses(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite(), is_network_admin(), is_plugin_active_for_network(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), wp_get_update_php_url(), esc_url(), printf(), wp_update_php_annotation(), do_action()
isset($file) && isset($response) && current_user_can() && !empty($response)150–154get_site_transient(), wp_kses(), self_admin_url(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_network_admin(), is_plugin_active(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), wp_get_update_php_url(), esc_url(), printf(), wp_update_php_annotation(), do_action()
isset($file) && isset($response) && is_network_admin() && current_user_can() && !empty($response)151–155get_site_transient(), wp_kses(), self_admin_url(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_network_admin(), is_plugin_active_for_network(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), wp_get_update_php_url(), esc_url(), printf(), wp_update_php_annotation(), do_action()
isset($file) && isset($response) && !is_network_admin() && !is_multisite() && current_user_can() && !empty($response)153–157get_site_transient(), wp_kses(), self_admin_url(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite(), is_network_admin(), is_plugin_active(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), wp_get_update_php_url(), esc_url(), printf(), wp_update_php_annotation(), do_action()
isset($file) && isset($response) && !is_multisite() && current_user_can() && !empty($response)154–158get_site_transient(), wp_kses(), self_admin_url(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite(), is_network_admin(), is_plugin_active_for_network(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), wp_get_update_php_url(), esc_url(), printf(), wp_update_php_annotation(), do_action()
isset($file) && !isset($response) && current_user_can() && !empty($response)162–167get_site_transient(), wp_kses(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_network_admin(), is_plugin_active(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), self_admin_url(), wp_nonce_url(), _x(), sprintf(), esc_attr(), printf(), do_action()
isset($file) && !isset($response) && is_network_admin() && current_user_can() && !empty($response)163–168get_site_transient(), wp_kses(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_network_admin(), is_plugin_active_for_network(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), self_admin_url(), wp_nonce_url(), _x(), sprintf(), esc_attr(), printf(), do_action()
isset($file) && !isset($response) && !is_network_admin() && !is_multisite() && current_user_can() && !empty($response)165–170get_site_transient(), wp_kses(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite(), is_network_admin(), is_plugin_active(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), self_admin_url(), wp_nonce_url(), _x(), sprintf(), esc_attr(), printf(), do_action()
isset($file) && !isset($response) && !is_multisite() && current_user_can() && !empty($response)166–171get_site_transient(), wp_kses(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite(), is_network_admin(), is_plugin_active_for_network(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), self_admin_url(), wp_nonce_url(), _x(), sprintf(), esc_attr(), printf(), do_action()
isset($file) && isset($response) && current_user_can() && !empty($response)166–170get_site_transient(), wp_kses(), self_admin_url(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_network_admin(), is_plugin_active(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), self_admin_url(), wp_nonce_url(), _x(), sprintf(), esc_attr(), printf(), do_action()
isset($file) && isset($response) && is_network_admin() && current_user_can() && !empty($response)167–171get_site_transient(), wp_kses(), self_admin_url(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_network_admin(), is_plugin_active_for_network(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), self_admin_url(), wp_nonce_url(), _x(), sprintf(), esc_attr(), printf(), do_action()
isset($file) && isset($response) && !is_network_admin() && !is_multisite() && current_user_can() && !empty($response)169–173get_site_transient(), wp_kses(), self_admin_url(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite(), is_network_admin(), is_plugin_active(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), self_admin_url(), wp_nonce_url(), _x(), sprintf(), esc_attr(), printf(), do_action()
isset($file) && isset($response) && !is_multisite() && current_user_can() && !empty($response)170–174get_site_transient(), wp_kses(), self_admin_url(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite(), is_network_admin(), is_plugin_active_for_network(), is_php_version_compatible(), esc_attr(), esc_attr(), esc_attr(), ->get_column_count(), esc_attr(), printf(), current_user_can(), __(), esc_url(), __(), sprintf(), esc_attr(), esc_attr(), self_admin_url(), wp_nonce_url(), _x(), sprintf(), esc_attr(), printf(), do_action()

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev30810–179145 more instructions than PHP 8.5
8.530310–17414
8.430310–174145 fewer instructions than PHP 8.3
8.330810–17614
8.230810–17614
8.130810–176143 fewer instructions than PHP 7.4
7.431110–17814

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_plugin_update_row() runs, in this order:

  1. do_action( in_plugin_update_message-{$file} )actionline 616 (+165 into the body)

    Fires at the end of the update message container in each row of the plugins list table.

Uses · 20

Show all 20
  • current_user_can()Returns whether the current user has the specified capability.
  • __()Retrieves the translation of $text.
  • esc_url()Checks and cleans a URL.
  • wp_nonce_url()Retrieves URL with nonce added to URL query.
  • _x()Retrieves translated string with gettext context.
  • wp_get_update_php_url()Gets the URL to learn more about updating the PHP version the site is running on.
  • wp_update_php_annotation()Prints the default annotation for the web host altering the "Update PHP" page URL.
  • do_action()Calls the callback functions that have been added to an action hook.

Source code

function wp_plugin_update_row( $file, $plugin_data ) {	$current = get_site_transient( 'update_plugins' ); 	if ( ! isset( $current->response[ $file ] ) ) {		return false;	} 	$response = $current->response[ $file ]; 	$plugins_allowedtags = array(		'a'       => array(			'href'  => array(),			'title' => array(),		),		'abbr'    => array( 'title' => array() ),		'acronym' => array( 'title' => array() ),		'code'    => array(),		'em'      => array(),		'strong'  => array(),	); 	$plugin_name = wp_kses( $plugin_data['Name'], $plugins_allowedtags );	$plugin_slug = isset( $response->slug ) ? $response->slug : $response->id; 	if ( isset( $response->slug ) ) {		$details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . '&section=changelog' );	} elseif ( isset( $response->url ) ) {		$details_url = $response->url;	} else {		$details_url = $plugin_data['PluginURI'];	} 	$details_url = add_query_arg(		array(			'TB_iframe' => 'true',			'width'     => 600,			'height'    => 800,		),		$details_url	); 	/** @var WP_Plugins_List_Table $wp_list_table */	$wp_list_table = _get_list_table(		'WP_Plugins_List_Table',		array(			'screen' => get_current_screen(),		)	); 	if ( is_network_admin() || ! is_multisite() ) {		if ( is_network_admin() ) {			$active_class = is_plugin_active_for_network( $file ) ? ' active' : '';		} else {			$active_class = is_plugin_active( $file ) ? ' active' : '';		} 		$requires_php   = isset( $response->requires_php ) ? $response->requires_php : null;		$compatible_php = is_php_version_compatible( $requires_php );		$notice_type    = $compatible_php ? 'notice-warning' : 'notice-error'; 		printf(			'<tr class="plugin-update-tr%s" id="%s" data-slug="%s" data-plugin="%s">' .			'<td colspan="%s" class="plugin-update colspanchange">' .			'<div class="update-message notice inline %s notice-alt"><p>',			$active_class,			esc_attr( $plugin_slug . '-update' ),			esc_attr( $plugin_slug ),			esc_attr( $file ),			esc_attr( $wp_list_table->get_column_count() ),			$notice_type		); 		if ( ! current_user_can( 'update_plugins' ) ) {			printf(				/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number. */				__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ),				$plugin_name,				esc_url( $details_url ),				sprintf(					'class="thickbox open-plugin-details-modal" aria-label="%s"',

Changelog

Introduced in 2.3.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-admin/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.