- 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
1.9 KiB
1.9 KiB
Changelog
All notable changes to Peptide News Plugin are documented here. Format: Keep a Changelog. Versioning: Semantic Versioning.
[2.5.1] - 2026-06-17
Fixed
- PHP 8.3
TypeErroron Articles admin page:number_format()rejects the numeric string returned by$wpdb->get_var(). Cast$totalto(int)at point of assignment inadmin/partials/articles-list.php(#32). - PHP 8.3
TypeErroron Analytics Dashboard page:number_format()rejects SUM aggregate strings returned by$wpdb->get_results(). Cast$article->total_clicksand$article->total_uniqueto(int)inline inadmin/partials/dashboard.php(same-class fix, no PR number — follow-on to #32).
[2.5.0] — 2026-06-16
Changed
- CI standardization (estate wave 2): Replace per-repo CI jobs in
ci.ymlwith a thin caller ofpeptiderepo/peptide-e2e/.github/workflows/ci.yml@main(tests: stubs,has_js: true). Addsworkflow_calltrigger sodeploy.ymlgate remains valid. - Extract
security-auditjob fromci.ymlinto standalone.github/workflows/security-audit.yml(kept as-is, unique to this repo). deploy.yml: elevate permissions tocontents: writeso the nested phpcbf commit-back step in the reusable workflow receives the correct token scope.composer.json: pintestscript tovendor/bin/phpunit --configuration phpunit.xml.distfor explicit path resolution in CI; pinlint/lint:fixtovendor/bin/.phpunit.xml.dist: add XSD reference for PHPUnit 9.6; drop deprecatedconvertErrorsToExceptions,convertNoticesToExceptions,convertWarningsToExceptionsattributes.
Notes
rollback.ymlandcto-review.ymlandmain-push-audit.ymlunchanged — unique / estate-separate.- No functional code changes in this commit.
Prior history
Versions prior to 2.5.0 were not tracked in a CHANGELOG. See git log for details.