Commit Graph

4 Commits

Author SHA1 Message Date
Yahnis Elsts 36efab0022 Minor: Fix method name in a comment 2024-02-02 15:59:22 +02:00
Yahnis Elsts 5f251be064 Add more sanity checks to prevent PUC from inadvertently triggering a fatal error if one of its hook callbacks is called while the containing plugin/theme is being deleted.
PUC already used `upgrader_process_complete` to remove hooks when  the plugin version it was part of was deleted during an update. However, that did not catch more obscure situations, such as apparently being called from an unrelated AJAX request while the host plugin version was being deleted (a user sent a stack trace where it seems that was what happened).
2023-11-15 18:49:00 +02:00
Yahnis Elsts 9c1bddcd46 Fix (probably) a conflict with the "WP Last Modified Info" plugin, version 1.8.8.
When a plugin update overwrites PUC with a different version of PUC, the hook callbacks registered by the old version can trigger fatal errors when they try to autoload now-deleted PHP files. Normally, PUC avoids this by using an `upgrader_process_complete` hook to check if one of its files still exists, and removing the hooks if the file is missing.  

However, it appears that WP Last Modified Info has its own `upgrader_process_complete` callback that runs earlier. That callback tries to download plugin metadata, which indirectly triggers some PUC hooks, and leads to the fatal error(s) mentioned earlier.

Fixed by extracting the relevant part of  `upgraderProcessComplete` to a separate method and registering that method as a callback for the same hook, but with an earlier priority (1 instead of 11). It appears that WP Last Modified Info uses the default priority: 10.
2023-11-14 11:52:30 +02:00
Yahnis Elsts 0b6bd7cd32 Bump version number to 5.3 2023-11-09 10:34:00 +02:00
Renamed from Puc/v5p2/Scheduler.php (Browse further)