• Resolved Josh Kohlbach

    (@jkohlbach)


    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @jkohlbach ,

    Thank you for reaching out to us. I will check this with the developer and they will see what can be done in this case.

    kind regards,
    Kasia

    Hello @jkohlbach

    I trust you’re doing well!

    Thank you for letting us know about this conflict and glad to know that you have found a fix for it.

    I’ve forwarded this issue to our developers so they could investigate it further.

    Have a good day!

    Kind regards,
    Nastia

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP-Stateless integration causes php warnings’ is closed to new replies.