[wp-trac] [WordPress Trac] #58089: Featured images within post content cause lazy-loading logic to apply incorrectly

WordPress Trac noreply at wordpress.org
Thu May 18 19:53:51 UTC 2023


#58089: Featured images within post content cause lazy-loading logic to apply
incorrectly
--------------------------------------+--------------------------
 Reporter:  flixos90                  |       Owner:  flixos90
     Type:  defect (bug)              |      Status:  closed
 Priority:  high                      |   Milestone:  6.3
Component:  Media                     |     Version:  5.9
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance
--------------------------------------+--------------------------
Changes (by flixos90):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"55825" 55825]:
 {{{
 #!CommitTicketReference repository="" revision="55825"
 Media: Prevent special images within post content to skew image counts and
 cause lazy-loading bugs.

 In order to skip lazy-loading the first few images on a page, as of
 WordPress 5.9 there has been logic to count images that are eligible based
 on certain criteria. One of those groups are images that appear within the
 content of a post.

 This changeset fixes a bug where images created via
 `get_the_post_thumbnail()` or `wp_get_attachment_image()` that are
 injected into the post content would skew the count and therefore result
 in all images to be lazy-loaded, potentially hurting load time
 performance. This is relevant for example when those functions are called
 in server-side rendered blocks, or any other filter callbacks hooked into
 `the_content`.

 Props flixos90, antpb, joedolson, spacedmonkey, mukesh27, thekt12,
 costdev, jrf.
 Fixes #58089.
 See #53675.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58089#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list