ClassicPress icon indicating copy to clipboard operation
ClassicPress copied to clipboard

Add/lazy loading

Open mattyrob opened this issue 4 years ago • 4 comments

Description

This is a collection of backports to add image lazy loading from upstream. Included are: https://core.trac.wordpress.org/changeset/47554 https://core.trac.wordpress.org/changeset/48170 https://core.trac.wordpress.org/changeset/48237 https://core.trac.wordpress.org/changeset/48239 (in addition to existing Issue) https://core.trac.wordpress.org/changeset/48272 https://core.trac.wordpress.org/changeset/48648 https://core.trac.wordpress.org/changeset/48649

48239 was included as it introduced additional checks for lazy loading and the commit was not captured in upstream tickets. It was noted in the backport of 48272 where a unit test broke, this test was contingent on the changes made in 48239

Motivation and context

Closes #538 and will enable lazy loading of images including filter for sites to opt out if needed

For further consideration are the backports for iframe lazy loading and the performance improvements in change 52065

How has this been tested?

This PR includes unit tests for new functionality.

Screenshots

N/A

Types of changes

  • New feature

mattyrob avatar Dec 30 '21 12:12 mattyrob

There is some work on going to see that lazy loading is a little more performant. https://make.wordpress.org/core/2021/12/29/enhanced-lazy-loading-performance-in-5-9/ As this gets close to a fully ready PR, we might need to revisit.

bahiirwa avatar Dec 30 '21 15:12 bahiirwa

PR updated and tests now passing with merge of develop changes.

We need to decide if we include: https://core.trac.wordpress.org/changeset/52065

mattyrob avatar Jan 19 '22 13:01 mattyrob

We need to decide if we include: https://core.trac.wordpress.org/changeset/52065

This was worked upon as an improvement to reduce the drag of loading the images/iframes coming up first on page load.. I think it is a good one.

bahiirwa avatar Jan 20 '22 05:01 bahiirwa

This pull request has been mentioned on ClassicPress Forums. There might be relevant details there:

https://forums.classicpress.net/t/add-lazy-loading-by-default-to-cp-core/2907/7

ClassyBot avatar Mar 01 '22 17:03 ClassyBot

Two review on comment thread above, merging.

mattyrob avatar Nov 10 '22 18:11 mattyrob