Engagement Boost misreads smart-link views that have a thousands separator
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- php, typescript, wordpress
調査の方向性
src/content-helper/dashboard-page/components/posts-table/components/single-post-row.tsx:106から始め、smart-linkのビューが合計ビューとどのように解析されるかを比較してください。src/rest-api/stats/trait-post-data.php:129から返される書式設定済みの件数を確認し、ロケールごとの区切り文字を考慮してください。大きな件数でも、行にsmart-linkのビューとブーストされた割合がすべてのロケールで正しく表示されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- PHP
- スター
- 67
- フォーク
- 38
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 79
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Parsely/wp-parsely のほかの issue
-
Bug Feature: Engagement Boost wp-parsely
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Parsely/wp-parsely#4855 ·
メンテナーはふだん 1 日以内に返信
-
Bug Feature: Engagement Boost wp-parsely
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Parsely/wp-parsely#4854 ·
メンテナーはふだん 1 日以内に返信
-
wp-parsely
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Parsely/wp-parsely#4753 ·
メンテナーはふだん 1 日以内に返信
-
Bug wp-parsely
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
Parsely/wp-parsely#4663 ·
メンテナーはふだん 1 日以内に返信
-
Documentation wp-parsely
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
Parsely/wp-parsely#4559 ·
メンテナーはふだん 1 日以内に返信
Parsely/wp-parsely の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
-
area/import type/enhancement when/later
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
parime/glpi-iso27001-management#1165 ·
メンテナーはふだん 1 日以内に返信
-
15.0
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
opnsense/plugins#5976 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信