Lazy Load affecting images in a gallery

With Lazy Load enabled, images in the gallery not loading. The gallery is created with the Visual Portfolio. After adding page URL and gallery CSS class in the exception fields, the issue persists.

  • Nithin Ramdas
    • Support Wizard

    Hi Justin,

    Hope you are doing good today. :slight_smile:

    I could notice the issue when tested and tried further to see whether excluding the Visual Portfolio classes would help or not. But the issue still remains, I’m afraid this is more of a compatibility issue, and I’m are bringing this into our developer’s attention to see whether there is anything that could be done in the plugin side to help get this sorted asap.

    Have a great day ahead. :slight_smile:

    Regards,

    Nithin

  • Justin
    • New Recruit

    Thank you for the reply. I tried to do set LazyLoad to every page, except for the gallery page, but that did not work. Even if that could be accomplished, that would help out immensely since the sites I am currently building will be image heavy.

    Justin

  • Nithin Ramdas
    • Support Wizard

    Hi Justin,

    Sorry for the delay in getting back to you. I’m afraid, this is more of a compatibility issue, and this is something which our team is still going through.

    I’m pinging our developer regarding this and will get back to you once I get further feedback regarding this status of the issue asap.

    Regards,

    Nithin

  • Nithin Ramdas
    • Support Wizard

    Hi Justin,

    I got further updates from the developer regarding this, the Visual Portfolio plugin is using the same library as Smush and hence causing conflict when Lazyload in Smush was enabled.

    Excluding Lazyload would be the way, but we could notice excluding the page wasn’t working, and this will be fixed in the next plugin release. In the meanwhile, please try the following patch, by going to the mentioned path in Smush Pro plugin:

    /wp-content/plugins/wp-smush-pro/core/modules/class-wp-smush-lazy-load.php

    And change the line 293:

    $request_uri = filter_input( INPUT_ENV, 'REQUEST_URI', FILTER_SANITIZE_URL );

    To the following one:

    $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';

    I gave a quick test in my system, the page excludes were working fine once the patch was applied. Please do the test, and let us know how that goes.

    The above patch will be released in the next plugin update, so you don’t have to worry about it getting overwritten. I hope this helps. Have a good day ahead. :slight_smile:

    Regards,

    Nithin