v1.2.4 — Session learnings: wp-plugin-testing + wp-database
Changes
docs(wp-plugin-testing): never put ABSPATH-guarded files in Composer files autoload
- Added Common Mistakes entry: files containing
defined('ABSPATH') || exitmust not be infilesautoload — Composer loads them before WP bootstraps, silently killing PHPUnit with no output - Fix: use
--prepend tests/php/prepend.phpin the test script to define ABSPATH first
docs(wp-database): propagate wpdb->last_error — never swallow silent insert failures
- Added Common Mistakes entry: wrapper methods that discard
$wpdb->insert()return value cause silent failures — callers cannot diagnose a failure the wrapper swallowed - Fix: always check return value and propagate
$wpdb->last_errorupstream; returnnull/WP_Erroron failure
Both learnings captured from Paystack payment gateway debugging session (issue #2927).