wp_plugin_update_row( string $file, array $plugin_data ): void|false
- Since
- 2.3.0
- Source
wp-admin/includes/update.php:451
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- Void on success, false if the plugin update is not available.
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
- Scaling
- Constant
- Instructions
- 10–172
- Plugin surface
- 1 hook
- Called by
- 0
Reads stored settings via get_site_option(), cached per request but not free on a cold cache.
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 299.
Third-party callbacks on 'in_plugin_update_message-{$file}' run inside this call, and their cost is not bounded by anything here.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- transienttransient
get_site_transient()called directly - hookthird-party callbacks
do_action()called directly - cacheobject cache
wp_cache_get()one call below wp_plugin_update_row() - optionnetwork option
get_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.
| When | Instructions | Calls it makes |
|---|---|---|
!isset($file) | 10 | get_site_transient() |
isset($file) && !isset($response) && !is_network_admin() && is_multisite() | 47–49 | get_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() | 51–52 | get_site_transient(), wp_kses(), self_admin_url(), add_query_arg(), get_current_screen(), screen(), is_network_admin(), is_multisite() |
isset($file) && !isset($response) | 132–139 | get_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() | 133–140 | get_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() | 135–142 | get_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() | 136–143 | get_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) | 136–142 | get_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() | 137–143 | get_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() | 139–145 | get_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() | 140–146 | get_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) | 144–149 | get_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 172 instructions
isset($file) && !isset($response) && is_network_admin() && current_user_can() && !empty($response) | 145–150 | get_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) | 147–152 | get_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) | 148–153 | get_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) | 148–152 | get_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) | 149–153 | get_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) | 151–155 | get_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) | 152–156 | get_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) | 160–165 | get_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) | 161–166 | get_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) | 163–168 | get_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) | 164–169 | get_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) | 164–168 | get_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) | 165–169 | get_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) | 167–171 | get_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) | 168–172 | get_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
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 304 | 10–177 | 14 | 5 more instructions than PHP 8.5 |
| 8.5 | 299 | 10–172 | 14 | |
| 8.4 | 299 | 10–172 | 14 | 5 fewer instructions than PHP 8.3 |
| 8.3 | 304 | 10–174 | 14 | |
| 8.2 | 304 | 10–174 | 14 | |
| 8.1 | 304 | 10–174 | 14 | 1 fewer instruction than PHP 7.4 |
| 7.4 | 305 | 10–175 | 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.
Hooks and filters fired · 1
One hook fires while wp_plugin_update_row() runs, in this order:
- 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
- get_site_transient()Retrieves the value of a site transient.
- wp_kses()Filters text content and strips out disallowed HTML.
- self_admin_url()Retrieves the URL to the admin area for either the current site or the network depending on context.
- add_query_arg()Retrieves a modified URL query string.
- _get_list_table()Fetches an instance of a WP_List_Table class.
- get_current_screen()Get the current screen object
- is_network_admin()Determines whether the current request is for the network administrative interface.
- is_multisite()Determines whether Multisite is enabled.
- is_plugin_active_for_network()Determines whether the plugin is active for the entire network.
- is_plugin_active()Determines whether a plugin is active.
- is_php_version_compatible()Checks compatibility with the current PHP version.
- esc_attr()Escaping for HTML attributes.
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 = $response->slug ?? $response->id; if ( isset( $response->slug ) ) { $details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . '§ion=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 = $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.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.4 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.