Closed wordpressfan closed 1 month ago
https://secure.helpscout.net/conversation/2611409187/494381/ https://secure.helpscout.net/conversation/2596568595/491337/ https://secure.helpscout.net/conversation/2606649666/493399/ https://secure.helpscout.net/conversation/2588163786/489827/ https://secure.helpscout.net/conversation/2586375548/489522/ https://secure.helpscout.net/conversation/2536803121/480046/
imagify.2.2.2.zip A patched version that resolved the issue on some user sites.
Another relevant ticket with proposed solution https://secure.helpscout.net/conversation/2680413623/507765?folderId=676697
My hosting support was able to determine the issue. It seems that the Imagify plugin is not fully compatible with your version of the WordPress core and/or PHP 8.2. The Wordpress error dump identified line 1641 in /home/cypresspainting/www/www/wp-content/plugins/imagify/classes/Optimization/Process/AbstractProcess.php. They did come up with a fix for this problem Replaced
return
strpos( $key, $this->format ) === false; with this:return
is_string($key) && strpos( $key, $this->format ) === false;
Before submitting an issue please check that you’ve completed the following steps:
Describe the bug
In a customer's site we face the following error:
and this happens exactly here:
https://github.com/wp-media/imagify-plugin/blob/a5b782019155e99326c7fddf1b031750b0c50c82/classes/Optimization/Process/AbstractProcess.php#L1641
In the PR (#877) we fixed similar issue when the image size name is not integer, but we once the image is optimized we save the sizes in the attachment metas to be grabbed later on the mentioned line (as far as I understand) but in php if the array has numeric keys even if u added them as strings, this will be cast to be integer then it throws the previously mentioned fatal error.
To Reproduce Steps to reproduce the behavior:
Expected behavior Images should load without a problem.
I fixed this by casting the $key variable here:
https://github.com/wp-media/imagify-plugin/blob/a5b782019155e99326c7fddf1b031750b0c50c82/classes/Optimization/Process/AbstractProcess.php#L1641
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
Acceptance Criteria (for WP Media team use only) Clear instructions for developers, to be added before the grooming