Database schema
WooFraudGuard creates five custom MySQL tables. All are prefixed with the WP table prefix (e.g. wp_wfg_*) and use InnoDB with utf8mb4_unicode_ci collation.
wfg_risk_scores
One row per scoring evaluation. Re-scoring an order adds a new row (the historical scores are kept).
| Column | Type | Notes |
|---|---|---|
| id | BIGINT UNSIGNED | PK |
| order_id | BIGINT UNSIGNED | WC order id (indexed) |
| total_score | TINYINT UNSIGNED | 0–100 |
| decision | VARCHAR(16) | approve / review / hold / cancel |
| created_at | DATETIME | UTC |
wfg_rule_hits
One row per rule per score. Stores the per-rule contribution and the metadata blob (which includes the reason tokens).
| Column | Type | Notes |
|---|---|---|
| id | BIGINT UNSIGNED | PK |
| score_id | BIGINT UNSIGNED | FK → wfg_risk_scores.id (indexed) |
| rule_key | VARCHAR(64) | e.g. blocklist, velocity |
| contribution | SMALLINT UNSIGNED | Final weighted score |
| metadata | LONGTEXT | JSON — includes reason tokens |
wfg_blocklist
| Column | Type | Notes |
|---|---|---|
| id | BIGINT UNSIGNED | PK |
| type | VARCHAR(16) | email / ip / phone / device / bin / username |
| value | VARCHAR(255) | The atom value (indexed alongside type) |
| source | VARCHAR(32) | manual / chargeback / fast_checkout |
| reason | TEXT | Free-text note |
| created_at | DATETIME | UTC |
| expires_at | DATETIME | NULL = permanent |
| attempts | INT UNSIGNED | Times this entry has fired the Blocklist rule |
wfg_linked_orders
Edge table for the order graph. Each row is an undirected edge between two orders sharing at least one atom.
wfg_chargebacks
One row per confirmed chargeback. Populated by the Stripe and PayPal webhook handlers.
Uninstall behaviour
By default, deactivating WooFraudGuard leaves all five tables intact. To remove them, enable Delete plugin data on uninstall under Settings → Privacy before deactivating.