WP-Stateless integration causes php warnings
-
Hi team,
I’m using WP Smush with WP-Stateless and for the most part its great.
I did notice however that WP Smush is generating warnings when WP-STateless is in stateless mode (meaning that the image files aren’t stored on the server they’re stored remotely).
[29-May-2020 01:43:30 UTC] PHP Warning: filesize(): stat failed for /var/www/html/wp-content/uploads/2020/05/2130fa51-joshheadshotblue300300.jpg in /var/www/html/wp-content/plugins/wp-smushit/core/modules/class-resize.php on line 227
I believe the fix would be to check if the file exists before using filesize()
if (file_exists($file_path)) $original_file_size = filesize($file_path); else $original_file_size = 0;
This is probably good practice anyway just to confirm if the file exists before finding it’s size.
Hope this helps and would be great if this could be included in a future release.
- The topic ‘WP-Stateless integration causes php warnings’ is closed to new replies.