I notice something else – when I click Optimize Again, after a few seconds sometimes this error displays:
Warning: array_shift() expects parameter 1 to be array, string given in …./public_html/wp-content/plugins/ewww-image-optimizer/bulk.php on line 411
I would delete the plugin and reinstall. That sounds like there is a stale .js file being used.
The section of code it refers to appears to be:
// update the 'bulk resume' option to show that an operation is in progress
update_option('ewww_image_optimizer_bulk_resume', 'true');
$attachments = get_option( 'ewww_image_optimizer_bulk_attachments' );
$attachment = array_shift( $attachments );
I’ll try delete and reinstall.
Still having the same issue after Deactivate – Delete, then reinstall.
Ok, in your WordPress database, look for an option in the wp_options table with this name: ewww_image_optimizer_bulk_attachments
Remove whatever value is in there, and try again.
I checked the table, found the option name specified. No value is there – it’s just blank for the value. (And still the same error when trying to optimize)
hmm, so that means the new query mechanism isn’t working right. I’ll have to dig into that and see how we can troubleshoot it.
Is this also empty: ewww_image_optimizer_bulk_resume
Yes, that is empty as well.
If you visit the Bulk Optimize page without pressing Start Optimize, please check those two options again and see if there is anything in them.
UPDATE: if there is nothing in either of those values, try searching the wp_posts table for post_type LIKE attachment and post_mime_type LIKE %image%
If you’re using phpmyadmin, you can use the search function and change LIKE to %LIKE% via the drop down and just put attachment and image in those two search fields.
Values show up after visiting the Bulk Optimize page for:
ewww_image_optimizer_bulk_attachments
I would paste the values, but lets just say there is a LOT of data in there like:
a:34908:{i:0;s:6:"114959";i:1;s:6:"114705";i:2;s:6:"114704";i:3;s:6:"114698";i:4;s:6:"114697";i:5;
so just empty all that out and try again?
edit: For testing, I decided to empty it out and save it. Then I revisited Bulk Optimize and the values get populated again just from doing that. I take it I need to clear it out, then while still on the Bulk Optimize page try to run it from there.
Still the same error after doing that.
Hah, we posted at the same time, so the query is working, but now to figure out why the array_shift() function isn’t getting the proper information.
if there is nothing in either of those values, try searching the wp_posts table for post_type LIKE attachment and post_mime_type LIKE %image%
A lot of information is returned from this (34908 rows)
That’s exactly what should happen for that search, and your previous post confirms that the query matches. Note the first number in the ewww_image_optimizer_bulk_attachments = 34908. So, my next best guess is that maybe_unserialize is not running properly.
Can you copy the ewww_image_optimizer_bulk_attachments into a text file, and send it to me via https://ewww.io/contact-us/
If it won’t accept a txt file, just send me a note, and I’ll reply back so that you can send me the attachment via email directly.
Sure, sent it. It seems to have allowed me to attach the txt file