Skip to content

v1.2.4 — Session learnings: wp-plugin-testing + wp-database

Choose a tag to compare

@mralaminahamed mralaminahamed released this 23 Jun 06:11
· 18 commits to trunk since this release
39d5c5d

Changes

docs(wp-plugin-testing): never put ABSPATH-guarded files in Composer files autoload

  • Added Common Mistakes entry: files containing defined('ABSPATH') || exit must not be in files autoload — Composer loads them before WP bootstraps, silently killing PHPUnit with no output
  • Fix: use --prepend tests/php/prepend.php in 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_error upstream; return null/WP_Error on failure

Both learnings captured from Paystack payment gateway debugging session (issue #2927).