cabrerahector / wordpress-popular-posts

WordPress Popular Posts - A highly customizable WordPress widget that displays your most popular posts.
https://wordpress.org/plugins/wordpress-popular-posts/
GNU General Public License v2.0
279 stars 83 forks source link

Replace JS lazy loading with native lazy loading #257

Closed cabrerahector closed 4 years ago

cabrerahector commented 4 years ago

As of April 7th, 2020, most major browsers have adopted the new native lazy loading feature introduced by Google. Let's have WordPress Popular Posts use that to lazy load thumbnails instead of the current JS based implementation.

Wendihihi commented 4 years ago

When you change it to the native lazy loading feature please add an option enable/disable lazy load via the plugin. 97% of my website visitors use a mobile device and it would affect 17% of the visitors.

cabrerahector commented 4 years ago

... please add an option enable/disable lazy load via the plugin.

There is already an option for this in Settings > WordPress Popular Posts > Tools under Thumbnails.

The native Lazy Load feature shouldn't cause issues for browsers that don't support it though (eg. Safari, Internet Explorer, etc.) In such cases I believe the browser will just ignore the loading attribute as it doesn't know what that is and continue to load the thumbnails normally. (So the option to enable/disable lazy loading might not even be needed anymore after all but I'll leave it there for at least one or two more releases just to be sure.)