Duplicate-purchase enforcement: inspect ownership, flush the cache, revoke ownership and purge a customer.
Namespacewp ias single-purchase
Slugias-single-purchase
Version 1.1.13
Tier Free (no licence required)
Commands 7
Conventions on this page
Every command accepts --format=<json|table|csv|yaml>. Commands marked Write accept --dry-run (resolve, audit, write nothing) and --yes (skip the prompt). Commands marked Irreversible additionally prompt unless --yes is passed, and any bulk delete refuses to run without an explicit scope argument rather than defaulting to delete-all.
For a single customer it clears the in-memory cache AND issues targeted object-cache deletes for every product the customer currently owns (mirroring the per-item deletes the order-status hooks use), so cached "owned" verdicts are cleared on a persistent object cache (Redis/Memcache) too — a plain clear_cache() cannot reach those from a cold CLI process, whose in-memory cache starts empty. A stale verdict for a product the customer no longer owns is not enumerable and expires on its 1-hour TTL; use --all for a full group flush, and the command warns when a persistent object cache is in use. With --all it walks every registered user in batches of 100 and then flushes the whole ias_spe_ownership object-cache group via ias_spe_flush_ownership_cache() as a backstop.
Options
Argument
Required
Type
Description
[<customer>]
no
positional
Customer reference — numeric WP user ID, login, or email. Omit and pass --all to flush the entire site.
[--all]
no
flag
Flush the ownership cache for every customer (and the whole cache group).
[--dry-run]
no
flag
Report what would be flushed without clearing anything.
[--yes]
no
flag
Skip the confirmation prompt (only used for --all).
Reflects the plugin's own ownership resolution: it honours the check_owned setting and the ias_spe_ownership_order_statuses filter, so an install with ownership checking disabled reports nothing. For a resolved account it matches the storefront identity clause — customer_id AND the account's login/billing email(s) — so prior guest purchases under the same email are listed, matching the re-purchase block they explain.
Options
Argument
Required
Type
Description
<customer>
yes
positional
Customer reference — numeric WP user ID, login, or email. A bare email with no matching account is treated as a guest (only resolves when the guest_mode setting is 'email').
Scans owned-status orders (per the ias_spe_ownership_order_statuses filter) for the product. On large stores use --max-orders to bound the scan; a capped scan emits a warning and may be incomplete.
This command permanently destroys data or applies a terminal state that cannot be undone from the CLI. Preview the exact effect with --dry-run, then re-run with --yes once you are certain.
GDPR hard-purge: drop ALL ownership-related records and cache for a customer.
The destructive counterpart to revoke-ownership. Removes the customer's entry from the ias_spe_revoked_ownership store and flushes their ownership cache. Because the WordPress account may already be deleted, the customer is resolved best-effort — a bare numeric ID or email is accepted even when no account exists — and the customer EMAIL is recorded in the audit context (not just the user ID) so the action stays traceable.
The guest-email rate-limit transients are intentionally NOT purged: their keys fold in the client IP (md5( identifier . client_ip )) and so cannot be reconstructed from the email alone; they carry no PII and self-expire on a short TTL. The response reports this honestly under rate_limit_transients rather than issuing no-op deletes.
Note: ownership is derived live from WooCommerce orders, which are NOT touched here (deleting order history is WooCommerce/GDPR-eraser territory). This clears the plugin's own per-customer state and caches only.
Options
Argument
Required
Type
Description
<customer>
yes
positional
Customer reference — numeric WP user ID or email. Accepted even when the underlying account has already been deleted.
[--reason=<text>]
no
flag (value)
Optional free-text reason, recorded in the audit context.
[--dry-run]
no
flag
Report what would be purged without changing anything.
Removes the (customer, product) pair from the ias_spe_revoked_ownership store that revoke-ownership wrote, so the plugin's live order-derived ownership is honoured again and the duplicate-purchase block re-arms for that pair. This is the surgical inverse of revoke-ownership — it touches only the named pair, unlike purge-customer which drops ALL of a customer's revocations. The customer's ownership cache is invalidated after the write — including a targeted object-cache delete of this (customer, product) verdict and the account's email-keyed guest verdict — so the restore takes effect on the next check even on sites with a persistent object cache.
A legitimate re-purchase already clears the revocation automatically (the runtime prunes the pair when an order enters an owned status), so this command is primarily for an operator reversing a revoke without a new order — e.g. an erroneous chargeback revocation.
Options
Argument
Required
Type
Description
<customer>
yes
positional
Customer reference — numeric WP user ID, login, or email.
<product>
yes
positional
Product reference — numeric ID or SKU.
[--reason=<text>]
no
flag (value)
Optional free-text reason, recorded in the audit context.
[--dry-run]
no
flag
Report what would be restored without changing anything.
Ownership is computed live from WooCommerce orders, so there is no stored record to delete. This writes the (customer, product) pair into the ias_spe_revoked_ownership option; the plugin's filter_revoked_ownership filter (hooked on ias_spe_customer_owns_product at priority 99) then reads that store back on every request and forces the pair to read as NOT owned, without touching order history. The customer's ownership cache is invalidated after the write — including a targeted object-cache delete of this (customer, product) verdict and the account's email-keyed guest verdict — so the revocation takes effect on the next check even on sites with a persistent object cache.
Options
Argument
Required
Type
Description
<customer>
yes
positional
Customer reference — numeric WP user ID, login, or email.
<product>
yes
positional
Product reference — numeric ID or SKU.
[--reason=<text>]
no
flag (value)
Optional free-text reason, recorded in the audit context.
[--dry-run]
no
flag
Report what would be revoked without changing anything.