[wp-trac] [WordPress Trac] #59577: Images in block templates or patterns do not have loading optimization attributes

WordPress Trac noreply at wordpress.org
Wed Jan 17 21:07:07 UTC 2024


#59577: Images in block templates or patterns do not have loading optimization
attributes
--------------------------+--------------------------
 Reporter:  flixos90      |       Owner:  flixos90
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  6.5
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  performance
--------------------------+--------------------------
Changes (by flixos90):

 * keywords:  needs-patch reporter-feedback => needs-patch


Comment:

 @joemcgill Correct. The other ticket is about missing `width` and
 `height`, while this ticket is about any image optimization attributes not
 being applied to certain images even when they do have `width` and
 `height`.

 The problem in this ticket should be relatively straightforward to
 reproduce:
 * Use a block theme.
 * Use a block template (regardless of whether it originates from a file or
 database content) which contains images as follows:
     * They either need to have `width` and `height` on them, or they need
 to be in the Media Library and have the `wp-image-{id}` CSS class so that
 WordPress can add these attributes automatically.
     * At least 4 images need to be directly in the template, or in a
 pattern that is referenced from the template. In other words, not within a
 template part, and not within a post.
 * Note how any of those images that are directly in the template or in a
 pattern referenced from the template have neither `loading="lazy"` nor
 `fetchpriority="high"` nor `decoding="async". This is the problem that
 needs to be addressed here.

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


More information about the wp-trac mailing list