Add WordPress filter hook to customize or disable Permissions-Policy client hint headers
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- backend, documentation
Línea de trabajo
Empieza en inc/admin.php en get_permissions_policy() y add_permission_policy(), las dos funciones nombradas en el issue, y rastrea dónde se pasa el valor de Permissions-Policy a header(). Envuelve el array de clave/valor en apply_filters() con un nombre de hook documentado, y corta el flujo antes de enviar cuando el resultado filtrado sea false, una cadena vacía o un array vacío. Hecho significa que la cabecera se puede suprimir o alterar desde un tema o plugin, y que el hook está documentado en la documentación para desarrolladores.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Impact: 60 · Confidence: 95 · Complexity: 20
Description
Problem
The Optimole WordPress plugin automatically emits a Permissions-Policy: ch-viewport-width=(self ...) header in inc/admin.php to enable Client Hints / Smart Image Scaling. However, there is currently no WordPress filter hook wrapping this response header. Site administrators who want to remove or customize the header (for example, to prevent low-resolution image selection on cached pages or mobile viewports where text density is critical) must write custom code to strip headers late in execution, which is fragile and prone to breaking during plugin updates.
Desired Behavior
Expose a WordPress filter hook (e.g. optimole_permissions_policy_header or optml_permissions_policy) allowing developers to filter the header key/value array or disable the Permissions-Policy header completely before it is sent via header().
Acceptance Criteria
- Introduce a WordPress filter hook surrounding the generation/output of the
Permissions-Policyheader ininc/admin.php. - Returning
false, an empty string, or an empty array from the filter suppresses the header from being sent. - Document the filter hook for site developers in technical/developer docs.
Customer Context
John Green (Founder & CEO at Fighting Arts Health Lab, starter-2 paid subscriber) observed that client hints were sending smaller 414px images to mobile viewports, which rendered text inside card images visibly soft/blurry on high-density mobile screens. To fix this, his team decided to strip the ch-viewport-width Permissions-Policy header. Because Optimole currently has no filter hook on get_permissions_policy() / add_permission_policy() in inc/admin.php, they were forced to strip the header with custom code after Optimole sends it. He requested a supported filter or setting so custom header modifications won't break on plugin updates.
Root Cause Analysis
The customer's underlying goal is to control whether Optimole sends the Permissions-Policy Client Hint header without having to write fragile post-header removal scripts. Optimole's inc/admin.php sends hardcoded header directives without passing them through WordPress apply_filters(). Providing a developer filter hook directly addresses this capability gap in a standard WordPress-idiomatic way.
Source: HelpScout #3513913699
Generated by feature-request-triage workflow (ID: feature-request-triage_6af9bb9d556245.38695477)
- Lenguaje dominante
- PHP
- Estrellas
- 74
- Forks
- 14
- Merge medio
- 1 d 20 h
- PR fusionados (30 d)
- 39
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Codeinwp/optimole-wp
-
Page profiler never stores above-the-fold background images: `b` is always sent with empty selector mapsPosiblemente ocupada @girishpanchal30 la tomó hace 9 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Codeinwp/optimole-wp#1216 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
customer report feature-request-triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Codeinwp/optimole-wp#1231 ·
Los mantenedores suelen responder en 1 día
-
bug-report customer report
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
Codeinwp/optimole-wp#1211 ·
Los mantenedores suelen responder en 1 día
-
customer report feature-request-triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Codeinwp/optimole-wp#1179 ·
Los mantenedores suelen responder en 1 día
-
Add setting to disable Optimole URL rewriting for social meta tags (og:image / twitter:image)Abiertocustomer report feature-request-triage
Dificultad 4/5 3-5 días Aptitud para principiantes 54/100
Codeinwp/optimole-wp#1178 ·
Los mantenedores suelen responder en 1 día
Todos los issues de Codeinwp/optimole-wp
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
claude
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
sprain/sprainocchio#38 ·
Los mantenedores suelen responder en 1 día
-
sync-en
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
sync-en
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Перевод устарел
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día