fix: PHP 8.3 TypeError in articles-list total count (int cast)

number_format() in PHP 8.3 strictly requires int|float; $wpdb->get_var()
returns string|null. Cast $total to (int) at point of assignment in
admin/partials/articles-list.php to fix HTTP 500 on Articles admin page.

Also add PHPUnit test covering the string->int cast contract.

Fixes #31. Version bump 2.5.0 -> 2.5.1.

Agent-Session: fix-articles-500-20260617
This commit is contained in:
peptiderepo
2026-06-17 05:50:50 +00:00
parent f1c5a295a4
commit bf87c82f69
4 changed files with 40 additions and 3 deletions

View File

@@ -4,6 +4,11 @@ All notable changes to Peptide News Plugin are documented here.
Format: [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
Versioning: [Semantic Versioning](https://semver.org/).
## [2.5.1] - 2026-06-17
### Fixed
- PHP 8.3 `TypeError` on Articles admin page: `number_format()` rejects the numeric string returned by `$wpdb->get_var()`. Cast `$total` to `(int)` at point of assignment in `admin/partials/articles-list.php` (#31).
## [2.5.0] — 2026-06-16
### Changed