keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

fix function definition for on_upgrade_hook #87

Closed ChrisOrlando closed 4 years ago

ChrisOrlando commented 4 years ago

It appears that #84 accidentally broke the post-upgrade hook, causing a critical error. The upgrader_process_complete action accepts two arguments: the WP_Upgrader instance and an array of extra data. In the refactoring, the WP_Upgrader instance was removed, resulting in errors like:

Uncaught Error: Cannot use object of type SomePlugin as array in /path/to/wp-content/plugins/cache-enabler/inc/cache_enabler.class.php:420

This PR reverts that part of the refactoring, ensuring the proper arguments are passed to on_upgrade_hook.

coreykn commented 4 years ago

You're right and this was my mistake. I actually noticed this shortly after my pull request and had the fix in my local repository, however, let's get this fixed in this pull request instead. Can you please make the requested change?

ChrisOrlando commented 4 years ago

done! thanks for the quick response

ChrisOrlando commented 4 years ago

squashed!

coreykn commented 4 years ago

Thanks @ChrisOrlando! Your contribution is much appreciated.