WP Rocket
Forum Replies Created
-
Hi,
We released a new version to fix the issues in 2.3, it should be working now.
Forum: Plugins
In reply to: [LazyLoad Plugin – Lazy Load Images, Videos, and Iframes] plugin update errorHi,
We released a new version to fix the issues caused by 2.3, it should be working now.
The above answer is correct. It’s not passing the validator because the attribute is still new, but it’s valid for the browsers.
Forum: Plugins
In reply to: [LazyLoad Plugin – Lazy Load Images, Videos, and Iframes] lazy load mobileI can see that the lazyload itself is working correctly. The issue on PageSpeed might be coming from the default threshold set to 300 pixels, which could be too early for the tool.
It’s possible to increase the threshold to see if it helps, for example:
function rocket_lazyload_custom_threshold( $threshold ) { return 1000; } add_filter( 'rocket_lazyload_threshold', 'rocket_lazyload_custom_threshold' );The script is already loaded in the footer, with an async attribute too.
For the combination, we have seen cases where it worked, and others where it didn’t, so it really depends on the tool used to do it.
The dynamic sizing of the images in Javascript will not work correctly with lazyload. The best thing to do would be to exclude them from lazyload.
You can use this pattern for exclusion:
data-type="image"You will need to enable the option to create a different cache file for mobile if the plugin you use has this (WP Rocket for example). Else it might not work indeed.
Do you have any error showing up in the browser console?
Did you clear the cache of your website after doing it? Can you disable file minification to see if it is a conflict with it?
No it’s not something we can change currently.
It can be added to your
functions.phpfile, or a mu-plugin for example.You can use the filters
rocket_lazyload_excluded_attributesorrocket_lazyload_excluded_srcto exclude specific patterns from lazyload.The HTML markup generated by your gallery is incorrect:
<img data-original="https://galenherz.com/wp-content/uploads/2019/06/Switzerland2019-0024-400x116.jpg" data-original-set="https://galenherz.com/wp-content/uploads/2019/06/Switzerland2019-0024-500x145.jpg 500w, https://galenherz.com/wp-content/uploads/2019/06/Switzerland2019-0024-1000x290.jpg 1000w, https://galenherz.com/wp-content/uploads/2019/06/Switzerland2019-0024-400x116.jpg 400w, https://galenherz.com/wp-content/uploads/2019/06/Switzerland2019-0024.jpg 2200w" srcset="https://galenherz.com/wp-content/uploads/2019/06/Switzerland2019-0024-500x145.jpg 500w, https://galenherz.com/wp-content/uploads/2019/06/Switzerland2019-0024-1000x290.jpg 1000w, https://galenherz.com/wp-content/uploads/2019/06/Switzerland2019-0024-400x116.jpg 400w, https://galenherz.com/wp-content/uploads/2019/06/Switzerland2019-0024.jpg 2200w" sizes="(min-width: 300px) 90vw, (min-width: 1024px) 70vw, (min-width: 1500px) 80vw, 100vw" class="">There is no
srcattribute, which is a mandatory one for images, and also the expected attribute for the plugin to apply lazyload on an image.Currently all your images are ignored because they don’t have a
srcattribute. This needs to be fixed for lazyload to work.Make sure you have the latest version of WP Rocket & Lazyload by WP Rocket on your client website.
Try to add the following code, and see if it solves the issue:
add_filter( 'rocket_lazyload_polyfill', '__return_true' );