Add option to preserve pre-existing HTML sizes attributes on images
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
Inizia individuando il flusso delle opzioni di Optimole e il parser dei tag HTML responsabile della sostituzione degli attributi sizes. Determina come debbano essere rappresentati l’impostazione o l’attributo dati supportato, quindi aggiungi una copertura di test unitari per preservare gli attributi sizes già esistenti. Il lavoro è completato quando una configurazione attiva lascia invariati tali attributi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Impact: 75 · Confidence: 95 · Complexity: 35
Description
Problem
When Optimole processes frontend images, its Page Profiler replaces existing HTML sizes attributes with automatically measured slot dimensions. Site developers who have crafted accurate sizes attributes (e.g. for hero images or complex responsive layouts) find their attributes overwritten. Currently, the only way to prevent Optimole from replacing a sizes attribute is using CSS function workarounds like calc(100vw).
Desired Behavior
Provide an official plugin configuration setting or supported attribute (e.g. data-optml-keep-sizes or a global setting 'Preserve existing sizes attributes') so site administrators can prevent Optimole from overwriting manually defined HTML sizes attributes.
Acceptance Criteria
- Add a setting in Optimole options or support a specific HTML data attribute to skip sizes attribute replacement.
- When active/present, Optimole's HTML tag parser leaves existing sizes attributes untouched.
- Include unit test coverage verifying pre-existing sizes attributes are preserved when the setting or attribute is present.
Customer Context
The customer has hand-crafted sizes attributes on photography listings and hero images. Optimole overwrites these with inaccurate profiler-generated slot measurements. The customer asks for an official setting or supported attribute to preserve existing sizes attributes without relying on calc() workarounds.
Root Cause Analysis
The customer manages an image-centric photography site and encountered multiple issues stemming from Optimole's automated HTML replacement and page profiler logic: 1) Optimole automatically overwrites HTML sizes attributes with measured slot widths unless explicit CSS functions like calc() are detected, leaving site authors who create custom responsive sizes attributes without a supported setting to preserve their HTML markup. 2) Profiled srcset candidate generation applies DPR transformations in a way that causes candidate descriptors to mismatch delivered image intrinsic widths when Retina Quality is active. 3) Page Profiler slot extrapolation calculates incorrect viewport slot widths on mobile layouts. 4) Duplicate max-width conditions are generated in sizes strings. 5) Database queries executed during the output buffer shutdown callback trigger MySQL 'Commands out of sync' errors. While issues #1111-#1114 address the specific bug regressions, an official setting/option to preserve existing sizes attributes fulfills an unaddressed gap in product configuration.
Reasoning
The customer conversation contains 5 distinct filable requests/reports: 1) Request for an official configuration option or mechanism to preserve pre-existing HTML sizes attributes on images rather than having Optimole overwrite them (new_feature_request). 2) Bug report that profiled srcset width descriptors mismatch delivered intrinsic image widths when Retina Quality is enabled, already tracked in GitHub issue #1111 (already_exists_github). 3) Bug report regarding inaccurate responsive slot widths extrapolated by Page Profiler, already tracked in issue #1112 (already_exists_github). 4) Bug report regarding duplicate max-width conditions in generated sizes attributes, already tracked in issue #1113 (already_exists_github). 5) Bug report regarding MySQL 'Commands out of sync' errors caused by PageProfiler transient reads during shutdown, already tracked in issue #1114 (already_exists_github). The top-level decision reflects the new, actionable feature request.
Source: HelpScout #3424946418
Generated by feature-request-triage workflow (ID: feature-request-triage_6a8821dfeacaf1.56068976)
- Lingua principale
- PHP
- Stelle
- 73
- Fork
- 14
- Merge medio
- 2g 13h
- PR unite (30g)
- 16
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Codeinwp/optimole-wp
-
bug-report bug-report-triage crash-report
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
Codeinwp/optimole-wp#1162 ·
I maintainer di solito rispondono entro 1 giorno
-
customer report feature-request-triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
Codeinwp/optimole-wp#1161 ·
I maintainer di solito rispondono entro 1 giorno
-
bug-report bug-report-triage customer report regression
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
Codeinwp/optimole-wp#1159 ·
I maintainer di solito rispondono entro 1 giorno
-
customer report feature-request-triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
Codeinwp/optimole-wp#1151 ·
I maintainer di solito rispondono entro 1 giorno
-
bug-report bug-report-triage crash-report
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
Codeinwp/optimole-wp#1139 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Codeinwp/optimole-wp
Issue simili
-
Update the one-click "GTM4WP" Delay JS exclusion so that it also works with a custom data layer nameAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Remove Kanboard Discourse forum link from README.md and CONTRIBUTING.md, or moderate itAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
bug Localization
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
solana-foundation/pay-kit#341 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cline/cline#14560 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno