Plugin_Upgrader_Skin::after()
- Since
- 2.8.0
- Source
wp-admin/includes/class-plugin-upgrader-skin.php:79
Compatibility
- WordPress
- since 2.8.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.
Performance profile
How much work a call to Plugin_Upgrader_Skin::after() 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
- Trivial
- Scaling
- Constant
- Instructions
- 57–107
- Plugin surface
- 1 hook
- Called by
- 0
Touches nothing outside its own arguments.
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 107.
Third-party callbacks on 'update_plugin_complete_actions' 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
- hookthird-party callbacks
apply_filters()called directly
Further down the call graph this can also reach option, query, cache, serialize and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 18 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost Plugin_Upgrader_Skin::after() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
empty($value) && empty($update_actions) | 57–59 | ->plugin_info(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), apply_filters() |
empty($value) && !empty($update_actions) | 62–64 | ->plugin_info(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), apply_filters(), ->feedback() |
!empty($value) && empty($update_actions) | 63–67 | ->plugin_info(), is_wp_error(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), apply_filters() |
empty($value) && is_wp_error() && empty($update_actions) | 65 | ->plugin_info(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), is_wp_error(), apply_filters() |
!empty($value) && !empty($update_actions) | 68–72 | ->plugin_info(), is_wp_error(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), apply_filters(), ->feedback() |
empty($value) && is_wp_error() && !empty($update_actions) | 70 | ->plugin_info(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), is_wp_error(), apply_filters(), ->feedback() |
empty($value) && !is_wp_error() && empty($update_actions) | 71–72 | ->plugin_info(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), is_wp_error(), current_user_can(), apply_filters() |
!empty($value) && is_wp_error() && empty($update_actions) | 71–73 | ->plugin_info(), is_wp_error(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), is_wp_error(), apply_filters() |
empty($value) && !is_wp_error() && !empty($update_actions) | 76–77 | ->plugin_info(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), is_wp_error(), current_user_can(), apply_filters(), ->feedback() |
!empty($value) && is_wp_error() && !empty($update_actions) | 76–78 | ->plugin_info(), is_wp_error(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), is_wp_error(), apply_filters(), ->feedback() |
!empty($value) && !is_wp_error() && empty($update_actions) | 77–80 | ->plugin_info(), is_wp_error(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), is_wp_error(), current_user_can(), apply_filters() |
!empty($value) && !is_wp_error() && !empty($update_actions) | 82–85 | ->plugin_info(), is_wp_error(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), is_wp_error(), current_user_can(), apply_filters(), ->feedback() |
6 further outcomes, up to 107 instructions
!empty($value) && !is_wp_error() && empty($update_actions) | 87–89 | ->plugin_info(), is_wp_error(), esc_attr__(), urlencode(), wp_nonce_url(), printf(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), apply_filters() |
!empty($value) && !is_wp_error() && !empty($update_actions) | 92–94 | ->plugin_info(), is_wp_error(), esc_attr__(), urlencode(), wp_nonce_url(), printf(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), apply_filters(), ->feedback() |
!empty($value) && empty($update_actions) | 95 | ->plugin_info(), is_wp_error(), esc_attr__(), urlencode(), wp_nonce_url(), printf(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), is_wp_error(), apply_filters() |
!empty($value) && !empty($update_actions) | 100 | ->plugin_info(), is_wp_error(), esc_attr__(), urlencode(), wp_nonce_url(), printf(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), is_wp_error(), apply_filters(), ->feedback() |
!empty($value) && !is_wp_error() && empty($update_actions) | 101–102 | ->plugin_info(), is_wp_error(), esc_attr__(), urlencode(), wp_nonce_url(), printf(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), is_wp_error(), current_user_can(), apply_filters() |
!empty($value) && !is_wp_error() && !empty($update_actions) | 106–107 | ->plugin_info(), is_wp_error(), esc_attr__(), urlencode(), wp_nonce_url(), printf(), ->decrement_update_count(), urlencode(), wp_nonce_url(), __(), self_admin_url(), __(), is_wp_error(), current_user_can(), apply_filters(), ->feedback() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 109 | 57–109 | 8 | 2 more instructions than PHP 8.5 |
| 8.5 | 107 | 57–107 | 8 | |
| 8.4 | 107 | 57–107 | 8 | 3 fewer instructions than PHP 8.3 |
| 8.3 | 110 | 57–110 | 8 | |
| 8.2 | 110 | 57–110 | 8 | |
| 8.1 | 110 | 57–110 | 8 | |
| 7.4 | 110 | 57–110 | 8 |
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 Plugin_Upgrader_Skin::after() runs, in this order:
- apply_filters( update_plugin_complete_actions )filterline 117 (+38 into the body)
Filters the list of action links available following a single plugin update.
Uses · 9
- is_wp_error()Checks whether the given variable is a WordPress Error.
- esc_attr__()Retrieves the translation of $text and escapes it for safe use in an attribute.
- wp_nonce_url()Retrieves URL with nonce added to URL query.
- __()Retrieves the translation of $text.
- self_admin_url()Retrieves the URL to the admin area for either the current site or the network depending on context.
- current_user_can()Returns whether the current user has the specified capability.
- apply_filters()Calls the callback functions that have been added to a filter hook.
- Plugin_Upgrader_Skin::decrement_update_count()
- Plugin_Upgrader_Skin::feedback()
Source code
public function after() { $this->plugin = $this->upgrader->plugin_info(); if ( ! empty( $this->plugin ) && ! is_wp_error( $this->result ) && $this->plugin_active ) { // Currently used only when JS is off for a single plugin update? printf( '<iframe title="%s" style="border:0;overflow:hidden" width="100%%" height="170" src="%s"></iframe>', esc_attr__( 'Update progress' ), wp_nonce_url( 'update.php?action=activate-plugin&networkwide=' . $this->plugin_network_active . '&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin ) ); } $this->decrement_update_count( 'plugin' ); $update_actions = array( 'activate_plugin' => sprintf( '<a href="%s" target="_parent">%s</a>', wp_nonce_url( 'plugins.php?action=activate&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin ), __( 'Activate Plugin' ) ), 'plugins_page' => sprintf( '<a href="%s" target="_parent">%s</a>', self_admin_url( 'plugins.php' ), __( 'Go to Plugins page' ) ), ); if ( $this->plugin_active || ! $this->result || is_wp_error( $this->result ) || ! current_user_can( 'activate_plugin', $this->plugin ) ) { unset( $update_actions['activate_plugin'] ); } /** * Filters the list of action links available following a single plugin update. * * @since 2.7.0 * * @param string[] $update_actions Array of plugin action links. * @param string $plugin Path to the plugin file relative to the plugins directory. */ $update_actions = apply_filters( 'update_plugin_complete_actions', $update_actions, $this->plugin ); if ( ! empty( $update_actions ) ) { $this->feedback( implode( ' | ', (array) $update_actions ) ); } }Changelog
Introduced in 2.8.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/class-plugin-upgrader-skin.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.