Engagement Boost misreads smart-link views that have a thousands separator
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
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- php, typescript, wordpress
Línea de trabajo
Empieza en src/content-helper/dashboard-page/components/posts-table/components/single-post-row.tsx:106 y compara cómo se analizan las visualizaciones de smart links con las visualizaciones totales. Comprueba el recuento formateado que devuelve src/rest-api/stats/trait-post-data.php:129 y ten en cuenta los separadores de cada configuración regional. La tarea estará terminada cuando la fila muestre correctamente las visualizaciones de smart links y el porcentaje de contenido impulsado para recuentos grandes en todas las configuraciones regionales.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
The Engagement Boost dashboard reads a post's smart-link views with Number( stats?.campaign?.views ?? 0 ) (src/content-helper/dashboard-page/components/posts-table/components/single-post-row.tsx:106). The REST API formats that value with number_format_i18n() (src/rest-api/stats/trait-post-data.php:129), so from 1,000 views on it contains the locale's thousands separator, which Number() doesn't parse:
"1,234"becomesNaN, as does a value with a space-like separator, as in French. The "+N" smart-link views and the "X% BOOSTED" percentage then both disappear, since their> 0checks fail.- With
.as the separator, as in German,"1.234"becomes1.234. The dashboard then shows a wrong "+N" and a near-zero boost percentage.
Total views, on the line above, are parsed with .replace( /\D/g, '' ), which handles any separator.
To Reproduce
- Open the Engagement Boost dashboard for a post with 1,000 or more smart-link views in the selected period.
- The post's row shows its total views, without the "+N" smart-link views or the "BOOSTED" percentage.
Expected behavior
The dashboard shows the post's smart-link views and boost percentage, whatever their size and the site's locale.
Environment
wp-parsely 3.26.1 and current develop, any browser.
Additional context
Possible fixes: parse the value the same way as the total views, or have the REST API also return raw counts, so the client doesn't parse formatted strings.
Related: #4854 and #4855, which affect the same campaign data.
- Lenguaje dominante
- PHP
- Estrellas
- 67
- Forks
- 38
- Merge medio
- 1 d 5 h
- PR fusionados (30 d)
- 79
Preparar el entorno
- Sin Dockerfile ni 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 Parsely/wp-parsely
-
Bug Feature: Engagement Boost wp-parsely
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Parsely/wp-parsely#4855 ·
Los mantenedores suelen responder en 1 día
-
Bug Feature: Engagement Boost wp-parsely
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Parsely/wp-parsely#4854 ·
Los mantenedores suelen responder en 1 día
-
wp-parsely
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Parsely/wp-parsely#4753 ·
Los mantenedores suelen responder en 1 día
-
Bug wp-parsely
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
Parsely/wp-parsely#4663 ·
Los mantenedores suelen responder en 1 día
-
Documentation wp-parsely
Dificultad 3/5 1-2 días Aptitud para principiantes 74/100
Parsely/wp-parsely#4559 ·
Los mantenedores suelen responder en 1 día
Todos los issues de Parsely/wp-parsely
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
parime/glpi-iso27001-management#1165 ·
Los mantenedores suelen responder en 1 día
-
15.0
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
opnsense/plugins#5976 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
open-telemetry/opentelemetry-php-distro#176 ·
Los mantenedores suelen responder en 2 días