Files
peptide-news-plugin/admin/partials
peptiderepo 5c483fdc34 fix: PHP 8.3 TypeError in dashboard top-articles SUM casts + CHANGELOG (#32)
- admin/partials/dashboard.php lines 108-109: cast $article->total_clicks
  and $article->total_unique to (int) before number_format(). Both are
  SUM() aggregate columns from $wpdb->get_results() returned as strings;
  same PHP 8.3 TypeError vector as the articles-list fix.
- tests/unit/DashboardTopArticlesCastTest.php: two unit tests mirroring
  the ArticlesListTotalCastTest pattern (numeric string + null cases).
- CHANGELOG [2.5.1]: fix (# 31) typo -> (#32); add dashboard fix entry.
- $topic['total_clicks'] at line 137 is safe (already cast to int in
  Peptide_News_Analytics_Reports::get_popular_topics() at assignment).
- $total_clicks/$total_unique at lines 48/52 are safe (array_sum coerces).

Agent-Session: engineer-infra-dashboard-cast-fix-20260617
2026-06-17 06:09:49 +00:00
..