• Resolved rockyourblog

    (@rockyourblog)


    Hey there,

    great plugin! Just one small issue..

    I’m running your plugin to display an Instagram feed in the footer of a clients website. The site uses WP Rockets lazy loading method and unfortunately, it doesn’t seem to work with the feed images.

    With “Disable JS image loading” OFF the feed loads normally, just not lazy loaded. If I set this option to ON (like suggested here) the images are getting lazy loaded, but if I scroll down to the feed the placeholder image gets loaded instead of the actual feed images.

    Any idea how to fix this?

    Cheers
    Philipp

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter rockyourblog

    (@rockyourblog)

    Hey again,

    I think I found the culprit. I have GDPR settings enabled and the “prefer local images” option ticked. If I disable the GDPR setting so that the plugin loads the images directly from instagram it works with WP Rockets lazyload when “Disable JS image loading” is enabled.

    The problem is that I don’t want to load the images directly from instagram. In fact I did choose your plugin because you can local host the images with it. Is there a way to disable the placeholder image? I don’t need it anyway because the images are pulled from Instagram via cron job and basically available every time and it confuses WP Rockets lazy loading method.

    These are my current settings: https://postimg.cc/CnZH411K

    Cheers
    Philipp

    Plugin Support Smash Balloon Joel

    (@joelsmashballoon)

    Hey @rockyourblog,

    Thank you for reaching out to us for assistance. This seems to be a combination issue. You seem to be loading image assets from a different URL which may be part of the issue as well. Try adding the following to your child theme’s functions.php:

    
    function sb_change_for_cdn() {
    	?>
        <script>
            if (typeof window.sb_instagram_js_options !== 'undefined') {
                window.sb_instagram_js_options.resized_url = 'https://assets.foodnphoto.de/wp-content/uploads/sb-instagram-feed-images/';
            }
        </script>
    	<?php
    }
    add_action( 'wp_footer', 'sb_change_for_cdn', 99 );
    

    Then clear all website cache and go to Instagram Feed > Customize and click Reset Resized Images, then load the page again. Keep the JS Image Loading disabled. If the issue persists, try adding an exception to the image wrapper following this for the class .sbi_photo

    Finally, our JavaScript is currently being deferred and does not seem to load correctly which is likely also part of the issue. You can test running sbi_init(); in the browser’s developer console to manually initialize our plugin to see whether this helps after any changes. If it does make the feed work, you will need to look over these optimization rules as well and possibly add an exception for our plugin.

    Let me know should you require further assistance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Possible conflict with WP Rocket lazy loading’ is closed to new replies.