The Stills theme supports lazy-loading of images, which is great. However this requires the Jetpack WordPress plugin to be installed, which may not be desired in some cases (WordPress.com account is required and the site needs to be connected to Automattic, etc.).
I extracted the lazy-images module from Jetpack to provide its features (using the same implementation) without needing to install Jetpack.
I just saw that the current “Lazy Images Without Jetpack” implementation seems to have problems with WordPress 5.6, sometimes images are not loaded at all when navigating between pages.
As Chromium browsers already support loading=lazy, I guess it would be acceptable to disable these hacks completely – but PhotoSwipe does not seem to add loading=lazy to the img tags. Any chance this will be added, or is this not as easy because the dimensions are not clear upon rendering?
I have been testing this for some time and I believe this is dealt with Jetpack. I have experienced issues with Jetpack 9.5 under WP 5.7 where the images would not load in Firefox. I believe the problem is dealt with Jetpack not dispatching the event on lazy images load. I have installed Jetpack 9.3 and the issue is gone. Having an up-to-date version of the theme also helps as WP 5.6 has swapped jQuery 1 for jQuery 3 and older version of the theme may have issues with jQuery 3.
The theme demo is currently running:
WP 5.7, Jetpack 9.3, Stills 1.4.5 with no issues as far as I can see.