plugin-update-checker icon indicating copy to clipboard operation
plugin-update-checker copied to clipboard

Issues upgrading PUC vom v4.8 to v4.9

Open ilueckel opened this issue 4 years ago • 1 comments

Hi, we use the PUC in one of our plugins and are currently deploying a plugin update where we changed PUC from v4.8 to v4.9.

We got feedback from multiple clients, that they receive a recovery mail from their wordpress during the update process. They all have the same stacktrace:

 An error of type E_ERROR in line 44 of file wp-content/plugins/e-recht24-share/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p8/Vcs/PluginUpdateChecker.php : Uncaught Error: Class 'Puc_v4p8_Plugin_Info' not found in wp-content/plugins/e-recht24-share/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p8/Vcs/PluginUpdateChecker.php:44
    Stack trace:
    #0 wp-content/plugins/e-recht24-share/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p8/Plugin/UpdateChecker.php(152): Puc_v4p8_Vcs_PluginUpdateChecker->requestInfo(Array)
    #1 wp-content/plugins/e-recht24-share/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p8/UpdateChecker.php(251): Puc_v4p8_Plugin_UpdateChecker->requestUpdate()
    #2 wp-content/plugins/e-recht24-share/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p8/Scheduler.php(163): Puc_v4p8_UpdateChecker->checkForUpdates()
    #3 wp-content/plugins/e-recht24-share/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p8/Scheduler.php(130): Puc_v4p8_Scheduler->maybeCheckFor

I already checked one wordpress and it hadn't had the cronjob updated (still pointing to Puc_v4p8_Scheduler->maybeCheckForUpdates()), but the files were updated to v4.9.

The error always seems to appear during the update process of the plugin. Do you have any idea?

ilueckel avatar May 08 '20 11:05 ilueckel

I think this could be related to a known bug that was fixed in e3cc1c03c9e7e795385fe2560e2dcbe27539e0d0. Up to and including release 4.9, PUC did not check if its current version still existed after installing an update. As a result, it could trigger a fatal error by trying to autoload a class from a file that had already been deleted during the update.

The bug has now been patched and the patch will be included in the next release. However, it doesn't look like there's a way to retroactively fix that problem for older versions. Fortunately, the error should only show up during an update and not after that.

As a workaround, maybe you could try including the /Puc/v4p8 subdirectory along with the /Puc/v4p9 subdirectory? Then you can remove the unused v4p8 subdirectory in the next update.

YahnisElsts avatar May 08 '20 14:05 YahnisElsts