Opened 8 months ago
Last modified 8 months ago
#63596 new defect (bug)
The upgrader_process_complete hook doesn't fire during bulk updates
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 6.9 |
| 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.
8 months ago
#1
- Keywords has-patch added
@vipulpatil commented on PR #9013:
8 months ago
#2
@SergeyBiryukov Can you look at this change, thanks 🙇 .
#3
@
8 months 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?
## Summary
The
upgrader_process_completehook currently only fires for individual plugin updates but is skipped during bulk operations due to anis_multicondition check. This inconsistency breaks plugins that rely on post-upgrade actions like cache clearing, security scans, and configuration updates.### Changes Made
upgrader_process_completehook from theis_multicondition in WP_Upgrader::run()Trac ticket: [](https://core.trac.wordpress.org/ticket/63596)