• Resolved mathieu

    (@mathieu)


    Hi Frank,

    I didn’t really check my websites in the past few months and I am kind of wakeup’ing to a few changes in WordPress. Some of them are breaking.

    I guess the question is the subject. With WordPress doing lazyloading natively right now, does it still makes senses to enable AO lazyloading?

    Because it does seem to add it’s fair share of code and <noscript> code.

    Maybe it does something really better? or is it really a blast from the past? Or it is still usefull for some themes that doesn’t play along?

    Best regards.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Well, native lazyload indeed is in WordPress now. It does typically load more images immediately when compared to JS-based lazyload though. Additionally if you’re using image optimization in AO, then to be able to serve webp/ avif images you need AO lazyload to be active.

    Conclusion: I would test with and without on webpagetest.org and on pagespeed insights and choose what gets you the best performance? ??

    frank

    Thread Starter mathieu

    (@mathieu)

    Honestly Frank, I do trust you because you’ve helped me so much but I just don’t get this one. It’s been two weeks, I am trying to figure this out and I can’t wrap my head around it.

    In the summer… or the spring maybe… AO + ShortPixel would show a <picture> tag and my webp images would be served. Google page insight was happy.

    But right now, when AO lazyload is activated, there’s no picture tag… when I go to Chrome network console, this is all jpeg, png, etc but no webp. However, Google says I am serving next-generation images like everything is alright.

    I did try with WordPress native lazyload and Google does bitch about not serving next-generation images and score was indeed lower.

    So OK, your lazyloading solution win, but what’s the sorcery with my next-gen images? Am I serving them and why it’s not showing up anywhere?

    Best regards,

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    hmmm, AO does not add (or remove) <picture tags (but it can work with them to optimize). The Shortpixel plugin can do so though, so maybe you disabled that option (or the SP plugin)? AO’s image optimization (which I assume you have active) indeed uses lazyload to switch to webp or avif images if the browser supports those.

    Thread Starter mathieu

    (@mathieu)

    Oh well, I fixed it… It was some bug with multisite and shortpixel. I had to dig deep into the code and filter some stuff.

    What set me off was that since you add an SVG in the src attribute of the image, it is enough to make Page Insights shut up about next-gen images even if that is not the case.

    Well, all is good and if somebody stumbles upon that thread and wonders how I fixed it, here it is.

    add_filter('shortpixel_webp_image_base', 'correctBaseShortPixelWebP', 1, 1);
    if (!function_exists("correctBaseShortPixelWebP")) {
        function correctBaseShortPixelWebP($base)
        {
            return str_replace(ABSPATH, ABSPATH."wp-content/blogs.dir/".get_current_blog_id()."/", $base);
        }
    }

    Have a nice day.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    that’s some deep digging, great work mathieu ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Does it still makes sense to activate AO lazyload?’ is closed to new replies.