Open gagarine opened 9 years ago
register_activation_hook() is quite a pain but you should be able to hook on "pre_update_option_active_plugins", which will be updated when the active plugins list changes.
https://codex.wordpress.org/Plugin_API/Filter_Reference/pre_update_option_%28option_name%29
I think, you should fire the delete cache on activated_plugin
and deactivated_plugin
hook. So you are sure, that on the activation, deactivation you kill the cache and rebuild after this.
Are pull requests accepted?
Sounds like a good idea @bueltge
If PR not accepted, I will happily accept it in my fork -> https://github.com/khromov/wordpress-mo-cache
@khromov maybe you should send a pull request before, that new changes passed and I (also others) see the difference between this version and your maintained version?
Also we should fired the function to delete the cache on switching theme. Also themes have translation files. I see the hook switch_theme
as the right point.
But what is with the translation files with the core, should we also flush the cache after update translation files?
We have rewrite the plugin. The enhancement and changes for this older version was to much, the result was a refactoring. But I think a really good result, that's helps all. You find it here - https://github.com/inpsyde/translation-cache Feedback are really welcome.
Feedback are really welcome.
Very nice plugin. Has a bit more user friendliness in it which is not necessary in a controlled environment.
Here is my tiny approach on caching .mo files https://github.com/szepeviktor/wordpress-plugin-construction/blob/master/tiny-translation-cache.php I am working on automated purging right now...
We should do a wp_cache_delete when plugin changes.