wp-rocket icon indicating copy to clipboard operation
wp-rocket copied to clipboard

LCP image isnot preloaded nor excluded from LL with certain markup

Open Mai-Saad opened this issue 11 months ago • 2 comments

Describe the bug Using this page template, LCP isnot excluded from LL nor preloaded https://new.rocketlabsqa.ovh/lcp_picture_new2/

To Reproduce Steps to reproduce the behavior:

  1. install and activate wpr 1.18.1.4
  2. activate ll image
  3. visit the page template
  4. clear cache
  5. revisit the page template => lcp image isnot excluded from ll nor preloaded

Expected behavior lcp image is preloaded and excluded from ll

Additional context

  • Related discussion https://wp-media.slack.com/archives/CUT7FLHF1/p1738762804801999
  • for test: check the fix if the source was removed from page template (no regression happened with other picture templates) , check this page too https://new.rocketlabsqa.ovh/lcp_piccture_new/
  • add the template to e2e

Mai-Saad avatar Feb 06 '25 09:02 Mai-Saad

Slack link is : https://group-onecom.slack.com/archives/C08EFCYRQ2X/p1738762804801999

Issue is related to picture tags without sources

in lcp here: https://github.com/wp-media/wp-rocket/blob/a1bdab03c889b965cc55e7f8eb4d1cbaff5e83ff/inc/Engine/Media/AboveTheFold/Frontend/Controller.php#L359-L399 we add the img src into sources only if max-width is found in any source but without having sources at all, src will not be added.

@Mai-Saad Would it be possible to update the title of this issue to make it more descriptive of the problem, for better findablilty? Also The template links are not available so adding the relevant markup directly to the issue would also be really helpful for Support! Thanks!!

webtrainingwheels avatar Oct 24 '25 17:10 webtrainingwheels

Related Ticket: https://secure.helpscout.net/conversation/3116736414/594688?viewId=377611

webtrainingwheels avatar Oct 24 '25 17:10 webtrainingwheels