first of all, great work with this script, we use it a lot and it works very well.
said so, image_resize on line 74 can also return a WP_Error object instead of a string, when the value is passed to str_replace on next line, page execution halts due the following error.
Catchable fatal error: Object of class WP_Error could not be converted to string
It happens, for instance, if user doesn't have GD extension installed. You could detect the WP_Error and just return original image url in this case. User wouldn't get a resized image but, at least, page would be displayed.
Hey there,
first of all, great work with this script, we use it a lot and it works very well.
said so, image_resize on line 74 can also return a WP_Error object instead of a string, when the value is passed to str_replace on next line, page execution halts due the following error.
Catchable fatal error: Object of class WP_Error could not be converted to string
It happens, for instance, if user doesn't have GD extension installed. You could detect the WP_Error and just return original image url in this case. User wouldn't get a resized image but, at least, page would be displayed.