Connects the Enable Media Replace and WPMU Dev (Smush Pro, Hummingbird) plugins together. When an image is replaced using Enable Media Replace, local WebP files created by Smush Pro will be regenerated, and Hummingbird cache will be cleared.
Regnerate Smush Pro Local WebP images programatically when the original image changes.
Tested and working with these versions:
- WordPress v6.0.1
- Enable Media Replace v3.6.3
- Smush Pro v3.10.3
- Hummingbird Pro v3.3.4
- WPMU Dev Dashboard v4.11.14
- Install and activate Enable Media Replace, Smush Pro and Hummingbird plugins
- Download the plugin code and place it in a separate file within the
/wp-content/mu-plugins/
directory - The plugin will be loaded automatically, no need to activate it
- When you use Enable Media Replace to update an image, the WebP images will be updated as well
The code has not been tested on every version of the software and may not work as intended with future releases. Please see the version information above for which plugin versions this has been tested up to.
At the moment, there are no checks that the plugins are installed and active. The code may produce an error if used without them. I will try to add this soon and then remove this notice.
The functions this plugin calls, within Smush Pro, may not have been intended to be called publicly in this way. This may cause unintended behaviour, although none have been observed while testing.
If you have any questions or changes, please send them to me on Twitter @IAmAdamTaylor. DMs are open.