[wp-trac] [WordPress Trac] #61940: `upgrader_process_complete` runs when no plugins selected to upgrade

WordPress Trac noreply at wordpress.org
Tue Aug 27 17:16:21 UTC 2024


#61940: `upgrader_process_complete` runs when no plugins selected to upgrade
-----------------------------+-----------------------------
 Reporter:  brianhenryie     |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Upgrade/Install  |    Version:  6.6.1
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 When JavaScript is disabled it is possible to submit `plugins.php`'s Bulk
 actions `bulk-action-form` Update option `update-selected`:

 > The update process is starting. This process may take a while on some
 hosts, so please be patient.
 > Updating Plugin (1/1)
 >
 > The plugin is at the latest version.
 >
 > updated successfully.
 >
 > All updates have been completed.

 With JavaScript enabled the process halts:

 > Please select at least one item to perform this action on.

 This is problematic where we are listening to the
 `upgrader_process_complete`.

 The trace is ~

 * `plugins.php:147` switch statement case `update-selected` creates an
 iframe with `update.php?action=update-selected&plugins=` and no
 plugins in the list.
 * `update.php:50` creates a `new Plugin_Upgrader()` and calls
 `Plugin_Upgrader::bulk_upgrade()`
 * `class-plugin-upgrader.php:414` fires `do_action(
 'upgrader_process_complete' ... )` where the `$plugins` variables is
 `array( 0 => '' )`


 It would be preferable if `upgrader_process_complete` is never called
 rather than needing to check for the empty-ish array.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61940>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list