Support » Plugin: Lightbox with PhotoSwipe » filemtime(): stat failed Error

  • Resolved gazdog

    (@gazdog)


    Hi, I am getting this error in Query Monitor. Everything works still i just get the error in query monitor.

    I have the latest plugin and have searched high and Low/

    Thanks in advance
    Gaz

    Message:
    filemtime(): stat failed for https://media.mysite.com/images/news_images/2005/january/12112006_Smets_M.jpg

    Locations:

    wp-content/plugins/lightbox-photoswipe/lightbox-photoswipe.php:608
    filemtime()
    wp-content/plugins/lightbox-photoswipe/lightbox-photoswipe.php:608
    LightboxPhotoSwipe->outputCallbackProperties()
    Unknown location
    preg_replace_callback()
    wp-content/plugins/lightbox-photoswipe/lightbox-photoswipe.php:790
    LightboxPhotoSwipe->filterOutput()
    Unknown location
    ob_end_flush()
    wp-content/plugins/lightbox-photoswipe/lightbox-photoswipe.php:321
    LightboxPhotoSwipe->footer()
    wp-includes/class-wp-hook.php:303
    do_action('wp_footer')
    wp-includes/general-template.php:3031
    wp_footer()
    wp-content/themes/hello-elementor/footer.php:23
    load_template('wp-content/themes/hello-elementor/footer.php')
    wp-includes/template.php:716
    locate_template()
    wp-includes/general-template.php:92
    get_footer()
    wp-content/plugins/elementor/modules/page-templates/templates/header-footer.php:30
    • This topic was modified 2 years, 8 months ago by gazdog.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    Lightbox with PhotoSwipe tries to determine the modification time of the image which is needed for the meta data cache.

    However, this may fail, if the image is not local but a remote image. However – according to the documentation of PHP this is also allowed for remote files using http and not only locally: https://www.php.net/manual/en/function.filemtime.php

    Usually you should not see any warnings about this at all, since the command is used with an “@” prefix to suppress warnings and just return false if the modification time can not be determined:

    $imgMtime = @filemtime($file);

    I don’t know why you still get any warnings. Only doing this call when the file is a local file is not a good idea either since remote files can be changed too and thus the cache needs to be invalidated in this case – otherwise it may take up to 24 hours before the meta data (size, EXIF headers etc.) of the image in the lightbox will be up to date.

    Plugin Author Arno Welzel

    (@awelzel)

    Update: since checking modification times of remote images may cause other issues I will change this – modification time of remote images will never be checked in the future as it is very unlikely that a remote image changes without getting a new URL.

    Thread Starter gazdog

    (@gazdog)

    Sorry Arno I was away and missed your response. It seems to have gone away now, Thankyou for your answer,

    Plugin Author Arno Welzel

    (@awelzel)

    Version 3.1.16 was just released and should fix this issue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘filemtime(): stat failed Error’ is closed to new replies.