Lazy Loading issue
-
Tried installing the plugin on a development site. Works great EXCEPT… lazy loaded images in a slider no longer load anything now. No JPG fallback even.
Ideas?
-
Additional info: Using Owl Carousel’s LazyLoading options detailed here: Link
Just checking in to see if there was an update. Spent most of the week trying to find a way to replicate this plugins functionality using manually generated webp files and htaccess rewrite rules but haven’t had any luck yet.
Looking into it…
Btw: There is also a thread going on here, regarding lazy loading: https://ww.wp.xz.cn/support/topic/lazy-loading-12/
I have tried out the Owl Carousel with lazy loading. It actually works fine for me. Owl carousel takes the value set in
data-srcattribute and uses it to set thesrcattribute. This means that the image is loaded with the same request headers, as if it had been placed directly in the HTML. So from the server side point of view, and WebP Express, there is no extra ordinary thing going on here.Does the carousel work when you disable WebP Express?
With Owl Carousel, remember to set class=”owl-lazy” on the images, otherwise they won’t load
Very strange. Tried it again a second time on the same site and this time it worked.
I did find a gotcha though that you may want to warn people about…
We found this in our wp-content folder’s .htaccess file. It was impeding the proper operation of WebP Express (eg: WebP conversion tests). Not sure what security plugin added that or if we added it manually at some point. BUT we typically use iThemes Security and Sucuri.
#<FilesMatch "\.(?i:php)$"> # <IfModule !mod_authz_core.c> # Order allow,deny # Deny from all # </IfModule> # <IfModule mod_authz_core.c> # Require all denied # </IfModule> #</FilesMatch>Whoops. Replied from wrong account.
Closed as resolved. 👍
Ah, so you two guys are the same…
Great that it works now and thanks for sharing your findings! Further down the roadmap, I could make WebP Express diagnose this. I have put that in the queue: https://github.com/rosell-dk/webp-express/issues/114
Solved it.
The security rules can be overridden by creating a .htaccess in the plugins/webp-express/wod folder containing the following rules:
<FilesMatch "webp-on-demand\.php$"> <IfModule !mod_authz_core.c> Order deny,allow Allow from all </IfModule> <IfModule mod_authz_core.c> Require all granted </IfModule> </FilesMatch>I have created such file. It will be there in the next release (0.9.0)
0.9.0 is now released, which contains the .htaccess above, which counterfights security rules that denies running php files directly in wp-content
The topic ‘Lazy Loading issue’ is closed to new replies.