Developers
WP-CLI and developer hooks
Every wp chargewarden command, the actions and filters ChargeWarden provides, wp-config constants, and the BankBridge integration point.
Last updated by the PluginLoom team
WP-CLI commands#
| Command | What it does |
|---|---|
wp chargewarden status | Protection status, attack mode, blocks, 24-hour counts, review queue, ledger and script counts |
wp chargewarden selftest | Runs the core logic against built-in fixtures and prints PASS or FAIL per check |
wp chargewarden attack-mode on --minutes=60 / off | Attack mode |
wp chargewarden block <ip|subnet|email> <value> [--hours=24] | Block by hand (0 hours = until removed) |
wp chargewarden unblock <ip|subnet|email> <value> | Remove matching blocks |
wp chargewarden allow <ip|email|user> <value> [--note=] | Add to the allowlist |
wp chargewarden score <order_id> [--apply] | Score an order and print the reasons |
wp chargewarden review <order_id> <approve|reject> [--blocklist] [--note=] | Decide a review |
wp chargewarden nacha rates | Rolling 60-day return rates |
wp chargewarden nacha sync | Read every ACH entry from BankBridge |
wp chargewarden nacha check | Run the daily return rate alert check now |
wp chargewarden nacha report --month=YYYY-MM --format=pdf|csv --output=file | Monthly evidence report |
wp chargewarden scripts scan|list|export | Script monitor |
wp chargewarden scripts authorize <id> --justification="..." [--mode=hash|url] | Authorize a script |
wp chargewarden lists refresh | Download the free IP lists now |
wp chargewarden purge | Run housekeeping now |
wp chargewarden simulator enable|disable|cleanup | Attack simulator support (see Testing) |
wp chargewarden demo seed|clear | Sample data for demos |
Actions#
| Action | Arguments |
|---|---|
chargewarden_loaded | Container |
chargewarden_blocked | Kind, masked label, reason, source |
chargewarden_attack_mode_on | Source, reason, minutes |
chargewarden_attack_mode_off | none |
chargewarden_order_scored | Order, result, action |
chargewarden_review_decided | Order, status |
chargewarden_settings_updated | Stored settings |
Filters#
| Filter | Use |
|---|---|
chargewarden_setting | Change any setting value |
chargewarden_gateway_risk | Add risk data for a gateway (label, risk_level, risk_score, review) |
chargewarden_order_card | Card BIN and last four for an order |
chargewarden_request_card | Card BIN and last four from the checkout request |
chargewarden_risk_result | Change a score, band or reasons before saving |
chargewarden_ip_country | Supply the IP country from your own source |
chargewarden_disposable_domains | Add disposable email domains |
chargewarden_self_updating_script_hosts | Hosts whose scripts default to address-only integrity |
chargewarden_send_alert | Return false to stop an alert email |
chargewarden_stripe_secret_key | Key for the optional Radar lookup |
chargewarden_license_api | License API base URL (staging stores) |
Constants#
Pin any setting in wp-config.php with CHARGEWARDEN_ and the setting name in capitals, for example define( 'CHARGEWARDEN_IP_SOURCE', 'cloudflare' );. Also: CHARGEWARDEN_HASH_KEY (shared hashing key) and CHARGEWARDEN_ENCRYPTION_KEY (key for stored secrets, kept outside the database).
Adding ACH entries from another source#
chargewarden()->ledger()->record( array( 'source' => 'myprocessor', 'ref' => 'abc', 'type' => 'debit', 'sec_code' => 'web', 'amount' => 25.00, 'status' => 'returned', 'return_code' => 'R10', 'returned_at' => '2026-10-20 12:00:00', 'entry_at' => '2026-10-15 09:00:00' ) );
The BankBridge integration point#
ChargeWarden reads BankBridge through its public hooks (bankbridge_transfer_created, bankbridge_transfer_status_changed, bankbridge_transfer_adopted), its container (bankbridge()->transfers()) and one filter, bankbridge_transfer_record_meta, which lets a companion plugin add data to the meta BankBridge saves on a new transfer. ChargeWarden uses it to keep the account validation snapshot with the entry.
Was this page helpful?