no longer works in wordpress 5.9
-
It seems that it no longer works in wordpress 5.9
- This topic was modified 2 years, 9 months ago by donpi73.
-
I tested this plugin on WP 5.9 and it continues to work perfectly, according to latest core features. If not working in any particular case, best advice is to do some basic troubleshooting of your plugins and theme.
Also just FYI: in WordPress 5.9, there was a change so that the first image is not lazy loaded. Only subsequent images are lazy loaded on single and archive views. This may be affecting any test results.
That in mind, the plugin literally is only one line of code:
add_filter( 'wp_lazy_loading_enabled', '__return_false' );
That is the method provided by WordPress to disable all lazy loading.
SO.. if the plugin is not working, then that line of code is not working. And if that line of code is not working, then the issue is with WordPress core (not the plugin). So in this case, the best advice would to ask for help in the general WP support forum.
I know the issue is with WordPress.
But you claim that your plugin is also compatible with the new version of WordPress 5.9, and this is no longer true, because it is proven that the filter
add_filter ('wp_lazy_loading_enabled', '__return_false');
it no longer has any effect in the new version, that is, the loading=”lazy” attribute is applied to all other images that are not the first (and also to those that appear first but are not inserted in the normal WP Query loop).By the way, thank you for your answer.
I think the issue is with WordPress 5.9 as well – and specifically with the front/homepage.
Read more here:
https://www.ads-software.com/support/topic/lazy-loading-not-omitting-on-homepage/And the code provided here doesn’t seem to work either:
Thank you for the information, will keep an eye on it. Currently sounds like a bug with WordPress. Anyone with more details please chime in, thanks.
@donpi73 I am trying to repeat the issue you describe; can you let me know specifically where the plugin is *not* disabling lazy load? For example, is it on the home page, single page, and so on. Also need to know which image(s), etc. That way I can replicate what you’re looking at and try to resolve asap. Currently I am not finding any page-view/image where the plugin is *not* working.
Another update: I did find one case where the plugin is not removing the lazy loading attribute: featured images. Featured images for some reason will continue to include the lazy attribute even if lazy loading is disabled via this plugin (i.e., the
wp_lazy_loading_enabled
hook). As far as I can tell, this is a bug with WordPress, and not the plugin.So as a temporary fix, I wrote a function that removes the lazy attribute from all featured images. This is a beta feature that’s not yet added to the main plugin hosted here at www.ads-software.com. Anyone who wants to test and leave feedback can download the beta version (3KB ZIP file). Let me know if this works and I’ll add it to the main plugin asap. Thank you.
- This reply was modified 2 years, 9 months ago by Jeff Starr.
Thanks.
Presonally, I solved the issue adding the attribute
loading="eager"
to the code of featured image, as suggested in WordPress core documentation.Thanks for the tip. I have updated the beta version of the plugin using the
loading="eager"
method for featured images. It is available for download here. Any feedback is appreciated. Thank you.- This reply was modified 2 years, 9 months ago by Jeff Starr.
- This reply was modified 2 years, 9 months ago by Jeff Starr.
Version 1.6 now available, with implemented fix. Thanks all for reporting and providing infos.
@donpi73 Please consider updating your rating/review, thank you.
Ok, thanks for your work.
- This reply was modified 2 years, 6 months ago by donpi73.
I tested the beta plugin, it did append eager but as shown in documentation all this does is force featured to load as soon is page load is done. In most cases this doesn’t change page speed score.
The other recommended implementation has a bug and doesn’t strip lazy loading out from featured images. This is pretty aggravating core bug to wordpress.
@culturalistpress So is there something specific that is/is not working for you? Or do you have some recommendation for the plugin? Just trying to understand if there is anything I can do to help. So far my tests and the feedback of users basically shows the plugin working as expected. Btw the beta plugin changes now are implemented in DLL version 1.6.
I mean the plugin may work on older versions of WordPress, basically, I am saying neither the workarounds specified in core that you implemented work for newer versions of wordpress. I am running and testing on WP 6.0.
What doesn’t work:
You cannot remove lazy load from above the fold content which is kind of crazy. I filed a ticket here:
https://core.trac.www.ads-software.com/ticket/56043
- This reply was modified 2 years, 5 months ago by Lucas.
Are you sure it’s not a theme-related issue, or conflict with some other plugin? I just re-tested the plugin on Twenty Seventeen theme and it definitely removed the lazy attribute from featured images above the fold.
- The topic ‘no longer works in wordpress 5.9’ is closed to new replies.