mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 00:01:27 +01:00
Upgrade/Install: Prevent users from sending multiple bulk plugin updates.
This changeset improves `update.js` by adding `is-enqueued` class to enqueued plugin updates to prevent users from asking for several updates for the same plugin at the same time, which previously resulted to …an interesting experience. Props bitnissen, swissspidy, MarcGuay, xkon, afercia, swissspidy, bookdude13, simonemanfre, vasilism, costdev, zunaid321. Fixes #40966. Built from https://develop.svn.wordpress.org/trunk@56009 git-svn-id: http://core.svn.wordpress.org/trunk@55521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
549163d3e9
commit
c77c814942
@ -515,7 +515,7 @@
|
||||
|
||||
if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
|
||||
$pluginRow = $( 'tr[data-plugin="' + response.plugin + '"]' )
|
||||
.removeClass( 'update' )
|
||||
.removeClass( 'update is-enqueued' )
|
||||
.addClass( 'updated' );
|
||||
$updateMessage = $pluginRow.find( '.update-message' )
|
||||
.removeClass( 'updating-message notice-warning' )
|
||||
@ -585,6 +585,8 @@
|
||||
);
|
||||
|
||||
if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
|
||||
$pluginRow = $( 'tr[data-plugin="' + response.plugin + '"]' ).removeClass( 'is-enqueued' );
|
||||
|
||||
if ( response.plugin ) {
|
||||
$message = $( 'tr[data-plugin="' + response.plugin + '"]' ).find( '.update-message' );
|
||||
} else {
|
||||
@ -2468,6 +2470,13 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't add items to the update queue again, even if the user clicks the update button several times.
|
||||
if ( 'update-selected' === bulkAction && $itemRow.hasClass( 'is-enqueued' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$itemRow.addClass( 'is-enqueued' )
|
||||
|
||||
// Add it to the queue.
|
||||
wp.updates.queue.push( {
|
||||
action: action,
|
||||
|
2
wp-admin/js/updates.min.js
vendored
2
wp-admin/js/updates.min.js
vendored
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.3-alpha-56008';
|
||||
$wp_version = '6.3-alpha-56009';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user