display_plugins_table()
- Since
- 2.7.0
- Source
wp-admin/includes/plugin-install.php:390
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.
Performance profile
How much work a call to display_plugins_table() 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
- 10–27
- Plugin surface
- None
- Called by
- 1
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 58.
Nothing here hands control to plugin code.
1 place in core call this, so the cost is paid more often than your own code shows.
What it touches
- hookthird-party callbacks
apply_filters()one call below display_plugins_table()
Further down the call graph this can also reach query, option, 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 · 6 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost display_plugins_table() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
| always | 10–21 | current_filter(), ->display() |
empty($value) && !get_user_option() | 13–21 | current_filter(), get_user_option() |
| always | 17–23 | current_filter(), __(), ->display() |
empty($value) && get_user_option() | 17–25 | current_filter(), get_user_option(), ->display() |
| always | 20–22 | current_filter(), __(), printf(), ->display() |
| always | 23–27 | current_filter(), __(), __(), printf(), ->display() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 58 | 10–27 | 7 | |
| 8.5 | 58 | 10–27 | 7 | |
| 8.4 | 58 | 10–27 | 7 | |
| 8.3 | 58 | 10–27 | 7 | |
| 8.2 | 58 | 10–27 | 7 | 1 more instruction than PHP 8.1 |
| 8.1 | 57 | 10–28 | 7 | |
| 7.4 | 57 | 10–28 | 7 |
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.
Uses · 3
- current_filter()Retrieves the name of the current filter hook.
- __()Retrieves the translation of $text.
- get_user_option()Retrieves user option that can be either per Site or per Network.
Used by · 1
- install_dashboard()Displays the Featured tab of Add Plugins screen.
Source code
function display_plugins_table() { global $wp_list_table; switch ( current_filter() ) { case 'install_plugins_beta': printf( /* translators: %s: URL to "Features as Plugins" page. */ '<p>' . __( 'You are using a development version of WordPress. These feature plugins are also under development. <a href="%s">Learn more</a>.' ) . '</p>', 'https://make.wordpress.org/core/handbook/about/release-cycle/features-as-plugins/' ); break; case 'install_plugins_featured': printf( /* translators: %s: https://wordpress.org/plugins/ */ '<p>' . __( 'Plugins extend and expand the functionality of WordPress. You may install plugins in the <a href="%s">WordPress Plugin Directory</a> right from here, or upload a plugin in .zip format by clicking the button at the top of this page.' ) . '</p>', __( 'https://wordpress.org/plugins/' ) ); break; case 'install_plugins_recommended': echo '<p>' . __( 'These suggestions are based on the plugins you and other users have installed.' ) . '</p>'; break; case 'install_plugins_favorites': if ( empty( $_GET['user'] ) && ! get_user_option( 'wporg_favorites' ) ) { return; } break; } ?> <form id="plugin-filter" method="post"> <?php $wp_list_table->display(); ?> </form> <?php}Changelog
Introduced in 2.7.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-admin/includes/plugin-install.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.