WP_Plugin_Install_List_Table::display_rows()
- Since
- 3.1.0
- Source
wp-admin/includes/class-wp-plugin-install-list-table.php:472
Compatibility
- WordPress
- since 3.1.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 WP_Plugin_Install_List_Table::display_rows() 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
- Heavy
- Scaling
- Scales with input
- Instructions
- 25–27
- Plugin surface
- 2 hooks
- Called by
- 0
Reads stored settings via get_option(), cached per request but not free on a cold cache.
The body loops, so the work grows with how much data it finds.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 508.
Third-party callbacks on 'plugin_install_description', 'plugin_install_action_links' 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 - optionoption read or write
get_option()one call below WP_Plugin_Install_List_Table::display_rows()
Further down the call graph this can also reach cache, serialize, transient, query and http. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 1 distinct outcome
One number would be a lie: the work depends on which branch runs. These are every distinct cost WP_Plugin_Install_List_Table::display_rows() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
| always | 25–27 | _x(), _x(), _x() |
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
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 508 | 25–27 | 34 | |
| 8.5 | 508 | 25–27 | 34 | |
| 8.4 | 508 | 25–27 | 34 | 1 fewer instruction than PHP 8.3 |
| 8.3 | 509 | 25–27 | 34 | |
| 8.2 | 509 | 25–27 | 34 | |
| 8.1 | 509 | 25–27 | 34 | 2 fewer instructions than PHP 7.4 |
| 7.4 | 511 | 25–27 | 34 |
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_Plugin_Install_List_Table::display_rows() runs, in this order:
- apply_filters( plugin_install_description )filterline 542 (+70 into the body)
Filters the plugin card description on the Add Plugins screen.
- apply_filters( plugin_install_action_links )filterline 599 (+127 into the body)
Filters the install action links for a plugin.
Uses · 23
- _x()Retrieves translated string with gettext context.
- esc_html()Escaping for HTML blocks.
- wp_kses()Filters text content and strips out disallowed HTML.
- apply_filters()Calls the callback functions that have been added to a filter hook.
- __()Retrieves the translation of $text.
- is_php_version_compatible()Checks compatibility with the current PHP version.
- is_wp_version_compatible()Checks compatibility with the current WordPress version.
- get_bloginfo()Retrieves information about the current site.
- wp_get_plugin_action_button()Gets the markup for the plugin install action button.
- self_admin_url()Retrieves the URL to the admin area for either the current site or the network depending on context.
- esc_url()Checks and cleans a URL.
- esc_attr()Escaping for HTML attributes.
Show all 23
- sanitize_html_class()Sanitizes an HTML classname to ensure it only contains valid characters.
- current_user_can()Returns whether the current user has the specified capability.
- 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.
- wp_admin_notice()Outputs an admin notice.
- wp_star_rating()Outputs a HTML element with a star rating for a given rating.
- number_format_i18n()Converts float number to format based on the locale.
- _e()Displays translated text.
- human_time_diff()Determines the difference between two timestamps.
- _nx()Translates and retrieves the singular or plural form based on the supplied number, with gettext context.
- WP_Plugin_Install_List_Table::get_dependencies_notice()Returns a notice containing a list of dependencies required by the plugin.
Source code
public function display_rows() { $plugins_allowedtags = array( 'a' => array( 'href' => array(), 'title' => array(), 'target' => array(), ), 'abbr' => array( 'title' => array() ), 'acronym' => array( 'title' => array() ), 'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(), 'p' => array(), 'br' => array(), ); $plugins_group_titles = array( 'Performance' => _x( 'Performance', 'Plugin installer group title' ), 'Social' => _x( 'Social', 'Plugin installer group title' ), 'Tools' => _x( 'Tools', 'Plugin installer group title' ), ); $group = null; foreach ( (array) $this->items as $plugin ) { if ( is_object( $plugin ) ) { $plugin = (array) $plugin; } // Display the group heading if there is one. if ( isset( $plugin['group'] ) && $plugin['group'] !== $group ) { if ( isset( $this->groups[ $plugin['group'] ] ) ) { $group_name = $this->groups[ $plugin['group'] ]; if ( isset( $plugins_group_titles[ $group_name ] ) ) { $group_name = $plugins_group_titles[ $group_name ]; } } else { $group_name = $plugin['group']; } // Starting a new group, close off the divs of the last one. if ( ! empty( $group ) ) { echo '</div></div>'; } echo '<div class="plugin-group"><h3>' . esc_html( $group_name ) . '</h3>'; // Needs an extra wrapping div for nth-child selectors to work. echo '<div class="plugin-items">'; $group = $plugin['group']; } $title = wp_kses( $plugin['name'], $plugins_allowedtags ); // Remove any HTML from the description. $description = strip_tags( $plugin['short_description'] ); /** * Filters the plugin card description on the Add Plugins screen. * * @since 6.0.0 * * @param string $description Plugin card description. * @param array $plugin An array of plugin data. See {@see plugins_api()} * for the list of possible values. */ $description = apply_filters( 'plugin_install_description', $description, $plugin ); $version = wp_kses( $plugin['version'], $plugins_allowedtags ); $name = strip_tags( $title . ' ' . $version ); $author = wp_kses( $plugin['author'], $plugins_allowedtags ); if ( ! empty( $author ) ) { /* translators: %s: Plugin author. */ $author = ' <cite>' . sprintf( __( 'By %s' ), $author ) . '</cite>';Changelog
Introduced in 3.1.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/class-wp-plugin-install-list-table.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.