Profiled width candidates can deliver twice their advertised intrinsic width with Retina Quality
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript, php, wordpress
- 領域
- frontend, performance, web-dev
調査の方向性
assets/js/modules/srcset-detector.js の _generateResponsiveSizes() から始め、次に inc/tag_replacer.php の add_missing_srcset_attributes()、change_url_for_size()、filter_srcset_attr() をたどります。tests/test-srcset.php と assets/js/modules/tests/srcset-detector.test.js を実行し、その後 DPR 1 と 2 で再現します。プロファイルされた候補が、広告された幅と、2 倍になった配信済みの本来の幅を組み合わせなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
When Retina Quality is enabled, a page-profiler-generated srcset candidate can advertise a width such as 218w while delivering a resource with an intrinsic width of 436 pixels. The advertised width is expected to match the candidate resource's intrinsic width. The mismatch can cause browser DPR selection and Optimole DPR processing to compound, substantially increasing image dimensions, transfer size, and page-load time for affected images.
Customer context
Product / area: Optimole responsive images and Retina Quality
Version: Customer version not provided; inspected source is v4.2.10
Environment: WordPress frontend; Chrome DevTools and Lighthouse on a high-density display
Integration / third party: Optimole CDN image delivery
Reported error / symptom: A candidate advertised as 218w delivered a 436-pixel-wide resource; another URL requesting width 824 reportedly delivered 1648 pixels
Impact: The customer reported oversized payloads across a photography-heavy site and a PageSpeed lab LCP improvement from 9.4s to 5.8s when Retina Quality was disabled.
Reproduction notes
Reported and independently confirmed by support on the rendered page, but not reproduced locally during repository inspection.
- Enable Retina Quality on a page where Optimole's profiler generates missing responsive candidates.
- Load the page on a high-density display and let the browser select a generated
wcandidate. - Compare the selected candidate's
wdescriptor and URL width parameter with the delivered resource's intrinsic width. - The reported
218wcandidate delivered 436 intrinsic pixels; disabling Retina Quality stopped the doubling.
Diagnosis
Conclusion
The page-profiler path records a DPR-multiplied width as a w descriptor and also retains dpr:2 for URL generation. The resulting URL contains both the multiplied width and the DPR transform while the emitted descriptor remains the stored width. The transcript includes a staff-verified runtime example where a 218w candidate delivered 436 intrinsic pixels, confirming the failing CDN interaction for the reported path.
Where this likely occurs
assets/js/modules/srcset-detector.js—optmlSrcsetDetector._generateResponsiveSizes()lines 410–460 computestargetWidth = baseWidth * dprValue, stores that value inwand the width descriptor, and separately stores the DPR value.inc/tag_replacer.php—Optml_Tag_Replacer::add_missing_srcset_attributes()lines 487–515 passes the stored width and DPR to URL generation while emitting the stored descriptor unchanged.inc/tag_replacer.php—Optml_Tag_Replacer::change_url_for_size()lines 790–810 places bothw:<stored width>anddpr:2in the transformed URL.inc/tag_replacer.php—Optml_Tag_Replacer::filter_srcset_attr()lines 824–890 shows the older non-profiler path represents its Retina candidate with a2xdensity descriptor instead.- Commit
8ab74741721cintroduced profiler-based srcset handling; commit49a757f34fd1introduced the current breakpoint/DPR generation. Both are present from v4.1.0 through inspected v4.2.10.
Engineering notes
The defect is scoped to profiler-generated width candidates where Retina entries survive filtering and the CDN applies the supplied DPR. It is distinct from WordPress-generated srcsets handled by filter_srcset_attr(), which use a density descriptor for the added Retina candidate. The CDN implementation is not available in the workspace; its doubling behavior is supported here by the staff-verified runtime output in the transcript rather than local service-source inspection.
Test coverage status
tests/test-srcset.php lines 30–60 checks URL manipulation involving dpr:2, and assets/js/modules/__tests__/srcset-detector.test.js covers DPR variation selection. No test found during inspection validates a profiled DPR entry end to end against its emitted width descriptor and delivered intrinsic dimensions. Tests were not executed during this read-only investigation.
What to verify or explore next
- Reproduce on a local WordPress page requiring profiler-generated srcset candidates with Retina Quality enabled.
- Compare emitted width descriptors, transformed URL parameters, response intrinsic dimensions, and browser candidate selection at DPR 1 and DPR 2.
- Run the targeted PHP srcset suite and JavaScript
srcset-detectorsuite. - Confirm behavior against the current Optimole CDN contract for simultaneous width and DPR parameters.
Unknowns / follow-up
The exact customer plugin version and whether cached profile data changes the first affected response are unknown.
Confidence
Confidence: 98/100
Repository inspection confirms three independently verifiable defects in Optimole's page-profiler responsive-image path, and no matching GitHub issues were found. The reported Retina-disabled 1x behavior is intentional setting behavior covered by tests, so it is not included as a defect.
Source: HelpScout #3424946418
Generated by bug-report-triage (ID: bug-report-triage_6a87087cc5e402.90677248)
- 主要言語
- PHP
- スター
- 73
- フォーク
- 14
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Codeinwp/optimole-wp のほかの issue
-
bug-report bug-report-triage crash-report regression
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
Codeinwp/optimole-wp#1163 ·
メンテナーはふだん 1 日以内に返信
-
bug-report bug-report-triage crash-report
難易度 4/5 3〜5日 初心者へのやさしさ 65/100
Codeinwp/optimole-wp#1162 ·
メンテナーはふだん 1 日以内に返信
-
customer report feature-request-triage
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
Codeinwp/optimole-wp#1161 ·
メンテナーはふだん 1 日以内に返信
-
bug-report bug-report-triage customer report regression
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
Codeinwp/optimole-wp#1159 ·
メンテナーはふだん 1 日以内に返信
-
customer report feature-request-triage
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
Codeinwp/optimole-wp#1151 ·
メンテナーはふだん 1 日以内に返信
Codeinwp/optimole-wp の issue をすべて見る
似ている issue
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug Feature: Kiosk
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
Infrastructure: actions Module: zmscitizenapi Module: zmsentities php Type: Bug unit tests
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
it-at-m/eappointment#3480 ·
メンテナーはふだん 1 日以内に返信
-
HttpClient
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
CI: composer install fails — league/flysystem 1.x blocked by security advisory GHSA-cxf4-7mrp-vvprオープンdevops type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信