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
280 stars 82 forks source link

Add decoding=async to thumbnails #359

Closed cabrerahector closed 1 year ago

cabrerahector commented 1 year ago

The decoding HTML property allows to control how the browser "parallelizes" loading images.

In our case, assuming that for most cases out there popular posts lists usually are outside the viewport it might be a good idea to ask the browser to async decode WPP's thumbnails (eg. decoding="async" loading="lazy") to help improve performance, even if just a bit.

It might be necessary to introduce a new admin setting so users can control this. Default should be async though.