Infinite scroll functions often use requests to admin-ajax.php to load additional content. Unfortunately, WordPress considers that part of the WP Admin, and the plugin won’t run JS WebP parsing on admin requests…
Of course, there are other plugins that do infinite scroll, and we can add exclusions for those particular admin-ajax.php requests.
Let me know what page it is happening on, and I’ll check to see what info we need to add an exclusion for it.
So the page in question is: https://willstocks.co.uk
Scroll to the bottom and click “Load More”
Same as when you visit that page, head to the menu and click on one of the categories – the same happens there.
I’m away from my computer so can’t check if it’s admin-ajax being called or not (off of the top of my head, I feel like it’s not… but I can’t be sure 😂)
So, it’s actually making an XHR request for the requested page (I’ve just managed to get back infront of my computer), not via admin-ajax.
My site uses the packaged implementation, not the WP Plugin version.
Hmm, that’s odd JS WebP isn’t kicking in then, I’ll take a closer look at that tomorrow.
So it appears that JS WebP is parsing the page, but for some reason the “unveilhook” for WebP to connect with lazysizes isn’t firing correctly. That much would make sense if you’re still using your custom lazysizes script.
But then the “arrive” listener for JS WebP doesn’t seem to be making a connection there either.
So that I can try to replicate it, did you create a plugin yourself for infinite scroll, or did you just integrate it within your theme?
In either case, if you can zip up the theme/plugin folder so that I can drop it into my dev site, I’ll give it a shot and see where the break-down is happening.
Forgot to say, you can send the zip (or a link) via the contact form https://ewww.io/contact-us/
-
This reply was modified 6 years, 9 months ago by
Shane Bishop.
Very interesting… the lazysizes script implementation is fairly standard and I include unveilhooks: https://willstocks.co.uk/wp-content/themes/linx-child/js/ws-lazysizes.js
I will zip up and send over my theme for you to review as the metafizzy infinite scroll is tied in with the theme (nothing too bespoke as far as I’m aware).
Theme zipped and just sent over (the contact page confused me for a sec, before I realised it was the “chat” bubble in the bottom right, lol!)
Shout if you need any other info. You should have my email now as well, so feel free to ping an email if required
I’ve fixed the lazy + webp + infinite scroll issue, per the email I just sent.
Just had a chance to deploy – can confirm resolved 😀