Make WordPress Core

Opened 4 weeks ago

Last modified 4 weeks ago

#63596 new defect (bug)

The upgrader_process_complete hook doesn't fire during bulk updates

Reported by: vipulpatil's profile vipulpatil Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: trunk
Component: Upgrade/Install Keywords: has-patch reporter-feedback
Focuses: Cc:

Description

Summary
The upgrader_process_complete action hook is not triggered during bulk plugin updates, causing plugins that depend on post-upgrade actions to malfunction.

Steps to Reproduce
Install plugins that hook into upgrader_process_complete (e.g., caching plugins, backup plugins)
Perform a bulk plugin update from Admin → Plugins → Select multiple plugins → Update
Observe that post-upgrade actions (cache clearing, notifications, etc.) don't execute

Expected Behavior
The upgrader_process_complete hook should fire consistently for both individual and bulk updates, allowing plugins to perform necessary post-upgrade cleanup and maintenance tasks.

Actual Behavior
The hook only fires for individual updates. Bulk updates skip the hook due to an is_multi condition check in WP_Upgrader::run().

Impact
Caching plugins don't clear cache after bulk updates
Security plugins miss configuration updates
Backup plugins don't trigger post-update backups
Plugin update notifications fail to send

Change History (3)

This ticket was mentioned in PR #9013 on WordPress/wordpress-develop by @vipulpatil.


4 weeks ago
#1

  • Keywords has-patch added

## Summary
The upgrader_process_complete hook currently only fires for individual plugin updates but is skipped during bulk operations due to an is_multi condition check. This inconsistency breaks plugins that rely on post-upgrade actions like cache clearing, security scans, and configuration updates.

### Changes Made

  • Move the upgrader_process_complete hook from the is_multi condition in WP_Upgrader::run()
  • Keep the is_multi check only for $this->skin->footer() calls
  • Maintain existing bulk upgrade hooks in Plugin_Upgrader and Theme_Upgrader for backward compatibility

Trac ticket: [](https://core.trac.wordpress.org/ticket/63596)

@vipulpatil commented on PR #9013:


4 weeks ago
#2

@SergeyBiryukov Can you look at this change, thanks 🙇 .

#3 @davidbaumwald
4 weeks ago

  • Keywords reporter-feedback added

@vipulpatil In both Plugin_Upgrader and Theme_Upgrader, there exists a bulk_upgrade method, both of which eventually call upgrader_process_complete.

In fact, what you're seeing in WP_Upgrader->run() is what is being run for each plugin when Plugin|Theme_Upgrader->bulk_upgrade is run, but the is_multi prop is true to prevent upgrader_process_complete from being called on every individual update. Instead, the bulk_upgrade method calls it once after all individual updates are run.

Is there some other way that you've determined WP_Upgrader->run() is being run with 'is_multi' => true and upgrader_process_complete not being eventually called after successful upgrading of all packages?

Note: See TracTickets for help on using tickets.