I wonder if it’s getting an empty array when doing a scheduled optimize. Can you post your debug information from the settings page (turn on the debug option, and then look at the bottom of the page).
Try the dev version, and see if that eliminates the errors: https://downloads.wordpress.org/plugin/ewww-image-optimizer.zip
After install, you should see version 2.5.0.2
I think the errors may be caused with images that have weird filenames. Is it possible to track down which images those are so that I can rename them?
Pretty much any filename should be capable of being in the utf8 encoding, so that seems unlikely, but I guess it IS possible. I’ll have to dream up a way to track it down though, since nothing comes to mind right off hand.
When you turn on the debugging option, it dumps output to a file named debug.log in the ewww-image-optimizer plugin folder, but I don’t know quite how we would track down an invalid utf8 sequence from there. It ought to log all the files it scanned (and found), but there wouldn’t necessarily be anything to indicate a utf8 problem. But maybe just seeing the list of files would be enough for you, so I thought I’d mention it.
I’ve also implemented a fix for passing empty values to json_encode(). Are you still encountering the problem? If so try a fresh copy from the dev link, version 2.5.0.6
Nevermind the “fix”, it seems that some characters CAN trigger this error, even if they ARE proper utf8. Other than scanning the debug log, I don’t know how else you would find the problem image.
I’m doing a bit of a rebuild on the Scan & Optimize that should resolve this sort of issue. Be on the lookout for the fix in the next couple weeks.