In the media library I have about 700 images. And the plugin optimizes them without problems.
The Media Library is a totally different scenario than the Scan & Optimize. All EWWW has to do is query the database for a list of attachment IDs, takes less than a second on most sites.
The Scan & Optimize has to recursively scan each folder you’ve configured in Folders to Optimize, and check each image in the ewwwio_images table to see if it has been optimized already. Did it work with a folder that just had 1 image?
No. I get this message “Allowed memory size of 268435456 bytes exhausted (tried to allocate 4294916270 bytes) in /…./wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php” for folder with 1 image.
Ok, we’re going to need to disable all plugins and try it again. If it works, re-enable plugins one at a time until you get the error again. I’m having a hard time believing that EWWW is trying to use 4 GB of memory all by itself.
disabled all plugins – the same result
What if you switch to the default theme (either twenty fifteen or twenty fourteen)?
Worked!
Problem in my theme.
What should look for in the first place?
Good question, I’m not quite sure without seeing it. Is it a free theme, paid theme, or a custom-built theme?
I use this theme https://wordpress.org/themes/mantra/.
I make some modifications to the theme. Therefore, for test I deleted my modification and downloaded the latest version of the theme. The problem remained.
Something is wrong in the theme itself
Good to know, I’ll try to take a look at it this weekend, keep me posted if you find anything else in the meantime.
Apparently some of the mimetype functions have trouble with .po files (or at least some of the ones in the Mantra theme. I’m going to add-in a pre-emptive check for .po files so it doesn’t even check the mimetype on them.
The culprits were these:
/var/www/wordpress/wp-content/themes/mantra/languages/da_DK.po
/var/www/wordpress/wp-content/themes/mantra/languages/nl_NL.po
/var/www/wordpress/wp-content/themes/mantra/languages/de_DE.po
You can just delete them, as the .po files aren’t used by WordPress when a .mo file is available.
Delete.
Now “scan and optimize” working!
THANK YOU VERY MUCH!
Also thank you for amazing plugin!