--- a/wp/wp-admin/includes/class-wp-plugin-install-list-table.php Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-admin/includes/class-wp-plugin-install-list-table.php Wed Sep 21 18:19:35 2022 +0200
@@ -47,15 +47,19 @@
$plugin_info = get_site_transient( 'update_plugins' );
if ( isset( $plugin_info->no_update ) ) {
foreach ( $plugin_info->no_update as $plugin ) {
- $plugin->upgrade = false;
- $plugins[ $plugin->slug ] = $plugin;
+ if ( isset( $plugin->slug ) ) {
+ $plugin->upgrade = false;
+ $plugins[ $plugin->slug ] = $plugin;
+ }
}
}
if ( isset( $plugin_info->response ) ) {
foreach ( $plugin_info->response as $plugin ) {
- $plugin->upgrade = true;
- $plugins[ $plugin->slug ] = $plugin;
+ if ( isset( $plugin->slug ) ) {
+ $plugin->upgrade = true;
+ $plugins[ $plugin->slug ] = $plugin;
+ }
}
}
@@ -101,13 +105,16 @@
if ( 'search' === $tab ) {
$tabs['search'] = __( 'Search Results' );
}
+
if ( 'beta' === $tab || false !== strpos( get_bloginfo( 'version' ), '-' ) ) {
$tabs['beta'] = _x( 'Beta Testing', 'Plugin Installer' );
}
+
$tabs['featured'] = _x( 'Featured', 'Plugin Installer' );
$tabs['popular'] = _x( 'Popular', 'Plugin Installer' );
$tabs['recommended'] = _x( 'Recommended', 'Plugin Installer' );
$tabs['favorites'] = _x( 'Favorites', 'Plugin Installer' );
+
if ( current_user_can( 'upload_plugins' ) ) {
// No longer a real tab. Here for filter compatibility.
// Gets skipped in get_views().
@@ -210,7 +217,14 @@
* Filters API request arguments for each Add Plugins screen tab.
*
* The dynamic portion of the hook name, `$tab`, refers to the plugin install tabs.
- * Default tabs include 'featured', 'popular', 'recommended', 'favorites', and 'upload'.
+ *
+ * Possible hook names include:
+ *
+ * - `install_plugins_table_api_args_favorites`
+ * - `install_plugins_table_api_args_featured`
+ * - `install_plugins_table_api_args_popular`
+ * - `install_plugins_table_api_args_recommended`
+ * - `install_plugins_table_api_args_upload`
*
* @since 3.7.0
*
@@ -427,7 +441,7 @@
$a = $plugin_a->$orderby;
$b = $plugin_b->$orderby;
- if ( $a == $b ) {
+ if ( $a === $b ) {
return 0;
}
@@ -472,7 +486,7 @@
}
// Display the group heading if there is one.
- if ( isset( $plugin['group'] ) && $plugin['group'] != $group ) {
+ 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 ] ) ) {
@@ -493,6 +507,7 @@
$group = $plugin['group'];
}
+
$title = wp_kses( $plugin['name'], $plugins_allowedtags );
// Remove any HTML from the description.
@@ -698,7 +713,7 @@
<h3>
<a href="<?php echo esc_url( $details_link ); ?>" class="thickbox open-plugin-details-modal">
<?php echo $title; ?>
- <img src="<?php echo esc_attr( $plugin_icon_url ); ?>" class="plugin-icon" alt="" />
+ <img src="<?php echo esc_url( $plugin_icon_url ); ?>" class="plugin-icon" alt="" />
</a>
</h3>
</div>
@@ -743,7 +758,7 @@
_nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations' ),
number_format_i18n( $active_installs_millions )
);
- } elseif ( 0 == $plugin['active_installs'] ) {
+ } elseif ( 0 === $plugin['active_installs'] ) {
$active_installs_text = _x( 'Less Than 10', 'Active plugin installations' );
} else {
$active_installs_text = number_format_i18n( $plugin['active_installs'] ) . '+';