diff --git a/wp-admin/includes/class-wp-plugins-list-table.php b/wp-admin/includes/class-wp-plugins-list-table.php index f257354db6..29e5882434 100644 --- a/wp-admin/includes/class-wp-plugins-list-table.php +++ b/wp-admin/includes/class-wp-plugins-list-table.php @@ -677,10 +677,21 @@ class WP_Plugins_List_Table extends WP_List_Table { */ public function single_row( $item ) { global $status, $page, $s, $totals; + static $plugin_id_attrs = array(); list( $plugin_file, $plugin_data ) = $item; - $plugin_slug = isset( $plugin_data['slug'] ) ? $plugin_data['slug'] : sanitize_title( $plugin_data['Name'] ); + $plugin_slug = isset( $plugin_data['slug'] ) ? $plugin_data['slug'] : sanitize_title( $plugin_data['Name'] ); + $plugin_id_attr = $plugin_slug; + + // Ensure the ID attribute is unique. + $suffix = 2; + while ( in_array( $plugin_id_attr, $plugin_id_attrs, true ) ) { + $plugin_id_attr = "$plugin_slug-$suffix"; + $suffix++; + } + + $plugin_id_attrs[] = $plugin_id_attr; $context = $status; $screen = $this->screen; @@ -739,7 +750,7 @@ class WP_Plugins_List_Table extends WP_List_Table { $actions['deactivate'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file ), - esc_attr( $plugin_slug ), + esc_attr( $plugin_id_attr ), /* translators: %s: Plugin name. */ esc_attr( sprintf( _x( 'Network Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ), __( 'Network Deactivate' ) @@ -750,7 +761,7 @@ class WP_Plugins_List_Table extends WP_List_Table { $actions['activate'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=activate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file ), - esc_attr( $plugin_slug ), + esc_attr( $plugin_id_attr ), /* translators: %s: Plugin name. */ esc_attr( sprintf( _x( 'Network Activate %s', 'plugin' ), $plugin_data['Name'] ) ), __( 'Network Activate' ) @@ -761,7 +772,7 @@ class WP_Plugins_List_Table extends WP_List_Table { $actions['delete'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=delete-selected&checked[]=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins' ), - esc_attr( $plugin_slug ), + esc_attr( $plugin_id_attr ), /* translators: %s: Plugin name. */ esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ), __( 'Delete' ) @@ -782,7 +793,7 @@ class WP_Plugins_List_Table extends WP_List_Table { $actions['deactivate'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file ), - esc_attr( $plugin_slug ), + esc_attr( $plugin_id_attr ), /* translators: %s: Plugin name. */ esc_attr( sprintf( _x( 'Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ), __( 'Deactivate' ) @@ -793,7 +804,7 @@ class WP_Plugins_List_Table extends WP_List_Table { $actions['resume'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=resume&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'resume-plugin_' . $plugin_file ), - esc_attr( $plugin_slug ), + esc_attr( $plugin_id_attr ), /* translators: %s: Plugin name. */ esc_attr( sprintf( _x( 'Resume %s', 'plugin' ), $plugin_data['Name'] ) ), __( 'Resume' ) @@ -804,7 +815,7 @@ class WP_Plugins_List_Table extends WP_List_Table { $actions['activate'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=activate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file ), - esc_attr( $plugin_slug ), + esc_attr( $plugin_id_attr ), /* translators: %s: Plugin name. */ esc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin_data['Name'] ) ), __( 'Activate' ) @@ -815,7 +826,7 @@ class WP_Plugins_List_Table extends WP_List_Table { $actions['delete'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=delete-selected&checked[]=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins' ), - esc_attr( $plugin_slug ), + esc_attr( $plugin_id_attr ), /* translators: %s: Plugin name. */ esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ), __( 'Delete' ) diff --git a/wp-includes/version.php b/wp-includes/version.php index 9ca3f0d9ee..6092b48405 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-48373'; +$wp_version = '5.5-alpha-48374'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.