wordpress-plugin
wordpress-plugin copied to clipboard
Optimize WP-CLI update_option
https://github.com/charlyie/resmushit-wordpress/blob/01872a597fa336ef2b2c76e9fa77532cd1c86768/classes/resmushitWPCLI.class.php#L126-L130
As you can see here this means that if you have like 48000~ images for any image process there is a db query this is not good for performances...
My suggestions is to do that line before the foreach and after that in this way it is happening just twice.
PS: maybe a parameter to change the value about the maximum file number in this way I don't have to wait that finishes every 1000 but maybe every 10000.