-
Notifications
You must be signed in to change notification settings - Fork 138
Fix handling of image prioritization when only some viewport groups are populated #1404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix handling of image prioritization when only some viewport groups are populated #1404
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
…rt group is populated
|
Ugh. Spell Check is complaining about the lorem ipsum 😅 |
|
I deployed this change to my site and it fixed the problem. |
swissspidy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad you don't have tablet visitors, allowing you to find this bug! 😄
I discovered an issue on my blog in which the most recent blog post lacks a featured image but the second-most recent post does have a featured image. The featured image on the second post is getting
fetchpriority=highadded by server-side heuristics but Image Prioritizer was not removing this even though the image was not visible on the mobile viewport, although it is correctly the LCP element on desktop:My URL metrics were fully populated on the mobile and desktop viewport groups, but they are empty for phablet and tablet viewport groups. I don't get a lot of traffic on my site, and apparently nobody with a phablet or tablet visits my site. So I have no metrics for them:
URL Metrics Dump
{ "breakpoints": [ 480, 600, 782 ], "freshness_ttl": 86400, "sample_size": 3, "all_element_max_intersection_ratios": { "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[3][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]": 0.74560546875, "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[5][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]": 0, "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[7][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]": 0, "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[9][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]": 0, "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[13][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]": 0, "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[15][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]": 0, "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[17][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]": 0, "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[19][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]": 0 }, "common_lcp_element": null, "every_group_complete": false, "every_group_populated": false, "groups": [ { "minimum_viewport_width": 0, "maximum_viewport_width": 480, "lcp_element": null, "complete": false, "url_metrics": [ { "url": "https://weston.ruter.net/", "viewport": { "width": 361, "height": 640 }, "elements": [ { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[3][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 1070.46875, "width": 320.83331298828125, "height": 213.8802032470703, "top": 1070.46875, "right": 340.83331298828125, "bottom": 1284.3489532470703, "left": 20 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[5][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 1963.4765625, "width": 320.83331298828125, "height": 240.625, "top": 1963.4765625, "right": 340.83331298828125, "bottom": 2204.1015625, "left": 20 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[7][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 2917.734375, "width": 320.83331298828125, "height": 213.8802032470703, "top": 2917.734375, "right": 340.83331298828125, "bottom": 3131.6145782470703, "left": 20 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[9][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 3817.9296875, "width": 320.83331298828125, "height": 180.46875, "top": 3817.9296875, "right": 340.83331298828125, "bottom": 3998.3984375, "left": 20 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[13][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 5205.29931640625, "width": 320.83331298828125, "height": 241.6927032470703, "top": 5205.29931640625, "right": 340.83331298828125, "bottom": 5446.99201965332, "left": 20 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[15][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 6106.7705078125, "width": 320.83331298828125, "height": 180.46875, "top": 6106.7705078125, "right": 340.83331298828125, "bottom": 6287.2392578125, "left": 20 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[17][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 6942.6953125, "width": 320.83331298828125, "height": 180.46875, "top": 6942.6953125, "right": 340.83331298828125, "bottom": 7123.1640625, "left": 20 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[19][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 7817.48681640625, "width": 320.83331298828125, "height": 163.34634399414062, "top": 7817.48681640625, "right": 340.83331298828125, "bottom": 7980.833160400391, "left": 20 } } ], "timestamp": 1721949180.716173 }, { "url": "https://weston.ruter.net/?sd", "viewport": { "width": 360, "height": 640 }, "elements": [ { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[3][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 1071.337890625, "width": 320, "height": 213.330078125, "top": 1071.337890625, "right": 340, "bottom": 1284.66796875, "left": 20 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[5][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 1964.3359375, "width": 320, "height": 240, "top": 1964.3359375, "right": 340, "bottom": 2204.3359375, "left": 20 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[7][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 2918.505859375, "width": 320, "height": 213.330078125, "top": 2918.505859375, "right": 340, "bottom": 3131.8359375, "left": 20 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[9][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 3818.701171875, "width": 320, "height": 180, "top": 3818.701171875, "right": 340, "bottom": 3998.701171875, "left": 20 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[13][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 5206.650390625, "width": 320, "height": 241.064453125, "top": 5206.650390625, "right": 340, "bottom": 5447.71484375, "left": 20 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[15][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 6107.96875, "width": 320, "height": 180, "top": 6107.96875, "right": 340, "bottom": 6287.96875, "left": 20 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[17][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 6943.9453125, "width": 320, "height": 180, "top": 6943.9453125, "right": 340, "bottom": 7123.9453125, "left": 20 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[19][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20, "y": 7818.798828125, "width": 320, "height": 162.9296875, "top": 7818.798828125, "right": 340, "bottom": 7981.728515625, "left": 20 } } ], "timestamp": 1721359883.47075 }, { "url": "https://weston.ruter.net/", "viewport": { "width": 384, "height": 630 }, "elements": [ { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[3][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20.000001907348633, "y": 1004.9334106445312, "width": 344.0000305175781, "height": 229.49168395996094, "top": 1004.9334106445312, "right": 364.00003242492676, "bottom": 1234.4250946044922, "left": 20.000001907348633 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[5][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20.000001907348633, "y": 1895.9918212890625, "width": 344.0000305175781, "height": 258, "top": 1895.9918212890625, "right": 364.00003242492676, "bottom": 2153.9918212890625, "left": 20.000001907348633 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[7][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20.000001907348633, "y": 2842.8583984375, "width": 344.0000305175781, "height": 229.49168395996094, "top": 2842.8583984375, "right": 364.00003242492676, "bottom": 3072.350082397461, "left": 20.000001907348633 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[9][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20.000001907348633, "y": 3733.916748046875, "width": 344.0000305175781, "height": 193.61668395996094, "top": 3733.916748046875, "right": 364.00003242492676, "bottom": 3927.533432006836, "left": 20.000001907348633 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[13][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20.000001907348633, "y": 5092.06689453125, "width": 344.0000305175781, "height": 258.98333740234375, "top": 5092.06689453125, "right": 364.00003242492676, "bottom": 5351.050231933594, "left": 20.000001907348633 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[15][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20.000001907348633, "y": 5970.216796875, "width": 344.0000305175781, "height": 193.61668395996094, "top": 5970.216796875, "right": 364.00003242492676, "bottom": 6163.833480834961, "left": 20.000001907348633 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[17][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20.000001907348633, "y": 6819.7001953125, "width": 344.0000305175781, "height": 193.61668395996094, "top": 6819.7001953125, "right": 364.00003242492676, "bottom": 7013.316879272461, "left": 20.000001907348633 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[19][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 20.000001907348633, "y": 7682.8837890625, "width": 344.0000305175781, "height": 174.94168090820312, "top": 7682.8837890625, "right": 364.00003242492676, "bottom": 7857.825469970703, "left": 20.000001907348633 } } ], "timestamp": 1721207778.98811 } ] }, { "minimum_viewport_width": 481, "maximum_viewport_width": 600, "lcp_element": null, "complete": false, "url_metrics": [] }, { "minimum_viewport_width": 601, "maximum_viewport_width": 782, "lcp_element": null, "complete": false, "url_metrics": [] }, { "minimum_viewport_width": 783, "maximum_viewport_width": 9223372036854776000, "lcp_element": { "isLCP": true, "isLCPCandidate": true, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[3][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0.74560546875, "intersectionRect": { "x": 1100.4166259765625, "y": 1134.5963134765625, "width": 1000, "height": 497.0703125, "top": 1134.5963134765625, "right": 2100.4166259765625, "bottom": 1631.6666259765625, "left": 1100.4166259765625 }, "boundingClientRect": { "x": 1100.4166259765625, "y": 1134.5963134765625, "width": 1000, "height": 666.6666259765625, "top": 1134.5963134765625, "right": 2100.4166259765625, "bottom": 1801.262939453125, "left": 1100.4166259765625 } }, "complete": false, "url_metrics": [ { "url": "https://weston.ruter.net/", "viewport": { "width": 1366, "height": 607 }, "elements": [ { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[3][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 174.5, "y": 1103.9375, "width": 1000, "height": 666.65625, "top": 1103.9375, "right": 1174.5, "bottom": 1770.59375, "left": 174.5 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[5][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 174.5, "y": 2410.15625, "width": 1000, "height": 750, "top": 2410.15625, "right": 1174.5, "bottom": 3160.15625, "left": 174.5 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[7][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 174.5, "y": 3863.71875, "width": 1000, "height": 666.65625, "top": 3863.71875, "right": 1174.5, "bottom": 4530.375, "left": 174.5 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[9][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 174.5, "y": 5169.9375, "width": 1000, "height": 562.5, "top": 5169.9375, "right": 1174.5, "bottom": 5732.4375, "left": 174.5 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[13][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 174.5, "y": 6955.453125, "width": 1000, "height": 753.328125, "top": 6955.453125, "right": 1174.5, "bottom": 7708.78125, "left": 174.5 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[15][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 174.5, "y": 8352.234375, "width": 1000, "height": 562.5, "top": 8352.234375, "right": 1174.5, "bottom": 8914.734375, "left": 174.5 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[17][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 174.5, "y": 9580.296875, "width": 1000, "height": 562.5, "top": 9580.296875, "right": 1174.5, "bottom": 10142.796875, "left": 174.5 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[19][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 174.5, "y": 10817.234375, "width": 1000, "height": 509.15625, "top": 10817.234375, "right": 1174.5, "bottom": 11326.390625, "left": 174.5 } } ], "timestamp": 1721901005.746241 }, { "url": "https://weston.ruter.net/", "viewport": { "width": 3201, "height": 1632 }, "elements": [ { "isLCP": true, "isLCPCandidate": true, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[3][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0.74560546875, "intersectionRect": { "x": 1100.4166259765625, "y": 1134.5963134765625, "width": 1000, "height": 497.0703125, "top": 1134.5963134765625, "right": 2100.4166259765625, "bottom": 1631.6666259765625, "left": 1100.4166259765625 }, "boundingClientRect": { "x": 1100.4166259765625, "y": 1134.5963134765625, "width": 1000, "height": 666.6666259765625, "top": 1134.5963134765625, "right": 2100.4166259765625, "bottom": 1801.262939453125, "left": 1100.4166259765625 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[5][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 1100.4166259765625, "y": 2471.653564453125, "width": 1000, "height": 750, "top": 2471.653564453125, "right": 2100.4166259765625, "bottom": 3221.653564453125, "left": 1100.4166259765625 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[7][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 1100.4166259765625, "y": 3956.04150390625, "width": 1000, "height": 666.6666259765625, "top": 3956.04150390625, "right": 2100.4166259765625, "bottom": 4622.7081298828125, "left": 1100.4166259765625 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[9][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 1100.4166259765625, "y": 5293.0986328125, "width": 1000, "height": 562.5, "top": 5293.0986328125, "right": 2100.4166259765625, "bottom": 5855.5986328125, "left": 1100.4166259765625 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[13][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 1100.4166259765625, "y": 7109.28369140625, "width": 1000, "height": 753.2551879882812, "top": 7109.28369140625, "right": 2100.4166259765625, "bottom": 7862.538879394531, "left": 1100.4166259765625 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[15][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 1100.4166259765625, "y": 8536.822265625, "width": 1000, "height": 562.5, "top": 8536.822265625, "right": 2100.4166259765625, "bottom": 9099.322265625, "left": 1100.4166259765625 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[17][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 1100.4166259765625, "y": 9764.7265625, "width": 1000, "height": 562.5, "top": 9764.7265625, "right": 2100.4166259765625, "bottom": 10327.2265625, "left": 1100.4166259765625 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[19][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 1100.4166259765625, "y": 11032.5, "width": 1000, "height": 509.11456298828125, "top": 11032.5, "right": 2100.4166259765625, "bottom": 11541.614562988281, "left": 1100.4166259765625 } } ], "timestamp": 1721859256.030331 }, { "url": "https://weston.ruter.net/", "viewport": { "width": 1920, "height": 1080 }, "elements": [ { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[3][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 460, "y": 1103.9375, "width": 1000, "height": 666.65625, "top": 1103.9375, "right": 1460, "bottom": 1770.59375, "left": 460 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[5][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 460, "y": 2410.15625, "width": 1000, "height": 750, "top": 2410.15625, "right": 1460, "bottom": 3160.15625, "left": 460 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[7][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 460, "y": 3863.71875, "width": 1000, "height": 666.65625, "top": 3863.71875, "right": 1460, "bottom": 4530.375, "left": 460 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[9][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 460, "y": 5200.921875, "width": 1000, "height": 562.5, "top": 5200.921875, "right": 1460, "bottom": 5763.421875, "left": 460 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[13][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 460, "y": 7017.421875, "width": 1000, "height": 753.328125, "top": 7017.421875, "right": 1460, "bottom": 7770.75, "left": 460 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[15][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 460, "y": 8445.1875, "width": 1000, "height": 562.5, "top": 8445.1875, "right": 1460, "bottom": 9007.6875, "left": 460 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[17][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 460, "y": 9673.25, "width": 1000, "height": 562.5, "top": 9673.25, "right": 1460, "bottom": 10235.75, "left": 460 } }, { "isLCP": false, "isLCPCandidate": false, "xpath": "/*[1][self::HTML]/*[2][self::BODY]/*[4][self::MAIN]/*[19][self::ARTICLE]/*[2][self::FIGURE]/*[1][self::DIV]/*[1][self::IMG]", "intersectionRatio": 0, "intersectionRect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "right": 0, "bottom": 0, "left": 0 }, "boundingClientRect": { "x": 460, "y": 10941.171875, "width": 1000, "height": 509.15625, "top": 10941.171875, "right": 1460, "bottom": 11450.328125, "left": 460 } } ], "timestamp": 1721840631.530671 } ] } ] }Note in particular:
{ "minimum_viewport_width": 481, "maximum_viewport_width": 600, "lcp_element": null, "complete": false, "url_metrics": [] }, { "minimum_viewport_width": 601, "maximum_viewport_width": 782, "lcp_element": null, "complete": false, "url_metrics": [] },The logic here is incorrect:
performance/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php
Lines 55 to 67 in 3364bd9
Instead of removing
fetchprority=highwhen all viewport groups are populated (which may never happen, as in the case of my blog), it should be removed when any of the viewport groups are populated. If none are populated, then the attribute should be left alone to let the server-side heuristics apply as a fallback behavior.