Support / Royal MCP Pro / Royal Affiliate Pro Tools

Royal Affiliate Pro Tools

Complete reference for the 25 Royal Affiliate Pro workflow tools in Royal MCP Pro. Full-lifecycle affiliate program management from Claude Desktop, ChatGPT, Cursor, or any MCP client: read affiliate performance, campaigns, creatives, payouts, landing pages, and audit log; create campaigns and challenges, assign landing pages, bulk-tag affiliates, update category and product commission rates, generate payouts and coupons, grant store credit, broadcast to segmented affiliate groups, force-fire monthly reports, and run fraud scans against historical visits and referrals. Every reversible write ships with two-step preview + commit and a 168-hour undo token.

Royal Affiliate Pro plugin required

These tools wrap the Royal Affiliate Pro plugin's own admin surface via MCP — they don't reimplement any affiliate logic. Royal Affiliate Pro must be installed and active on the site. Tools that call primitives added in RAFP 2.6.15 (the twelve workflow tools added in Royal MCP Pro 1.0.11) return a specific royal_affiliate_<class>_unavailable error envelope when the sibling method is missing — upgrade Royal Affiliate Pro to 2.6.15 or later to resolve.

Prerequisites

  • Royal Affiliate Pro installed and active (2.6.15 or later for the full 25-tool surface; older versions get the 13-tool baseline and clean error envelopes on the twelve newer tools)
  • Royal MCP Pro installed and licensed (see Getting Started)
  • MCP client connected to your site (Claude Desktop, ChatGPT connector, Cursor, or any MCP-compatible client)
  • Your MCP-connecting WordPress user has the correct Royal Affiliate Pro capability (see the capability model section below)

Every tool checks its cap requirement first and returns insufficient_caps with the required capability name if the caller doesn't have it — no partial writes happen when a cap check fails.

Capability model

Royal Affiliate Pro registers four custom capabilities that scope who can do what. Each tool requires one of these, or falls back to manage_options (site administrator). If your MCP-connecting user is an administrator this is all transparent — the caps are for shops that delegate parts of the affiliate program to non-admin staff.

  • rafp_manage_campaigns — campaign, challenge, creative, landing page, and commission rate tools
  • rafp_manage_affiliates — affiliate approval, tagging, broadcasts, monthly reports, fraud scans, fraud incident reads
  • rafp_manage_referrals — referral record reads + status updates
  • rafp_manage_payouts — payout generation, coupon generation, store credit grants, payout reads

Tools that require none of the four scoped caps (mostly reads and administrative diagnostics) gate on manage_options only.

Shared safety layer

Every Royal Affiliate Pro write tool runs through the same safety layer used across Royal MCP Pro's write surface, with a couple of RAFP-specific patterns:

  • Two-step commit on reversible writes. Every reversible write is a two-call flow: call 1 returns a five-minute commit_token plus a preview of what will change (row counts, resolved recipient IDs, rate differences, etc.); call 2 passes that token back and commits. Preview is side-effect-free where practical — e.g. rafp_scan_fraud's preview runs the fraud rules against a 25-row sample using the sibling's read-only check_visit() / check_referral() methods so no rows land in rafp_fraud_log until commit.
  • 168-hour undo tokens on reversible writes. Every reversible write returns a token good for seven days. Undo restores the exact prior state per row (e.g. affiliate status, referral status, commission rate values, tag assignments) — drift is detected and surfaced in the response envelope; not silently overwritten.
  • Irreversible tools return NO_UNDO_SCOPE. Broadcasts, monthly report sends, and fraud scans return undo_token: "NO_UNDO_SCOPE" instead of a real token — emails already left the box, incidents are already in rafp_fraud_log, and there's nothing to reverse. Preview machinery still runs on step 1 so the caller knows exactly what would send before committing.
  • Per-call caps on bulk operations. Every bulk tool caps its per-call size (100 recipients on rafp_grant_store_credit, 500 recipients on broadcasts + monthly reports, 5000 rows per scan type on fraud scans, etc.). Beyond the cap the tool errors with batch_too_large and instructions to narrow the filter.
  • Sibling-version detection. Tools that wrap RAFP 2.6.15 primitives return a royal_affiliate_<class>_unavailable or royal_affiliate_<class>_api_incomplete envelope with the exact class + method name and the required RAFP version when the sibling method is missing.
  • Audit Log row on every call. Success, error, and undone states all produce audit rows.

The 25 tools

Grouped by write shape. Read tools return data; reversible writes issue a 168-hour undo token after commit; irreversible sends dispatch emails or log rows that can't be recalled — preview machinery on step 1 lets you eyeball what will happen before committing.

Read tools (10)

All reads are side-effect-free and don't require a commit token. Every list-style tool supports the same paginate: {page, per_page} shape with a 500-per-page max and standard orderby / order filters.

rafp_get_affiliate_performance

Performance snapshot for one Royal Affiliate Pro affiliate — earnings breakdown (paid / unpaid / pending / total), referral counts by status, visit count, and conversion rate.

Cap

rafp_manage_affiliates (falls back to manage_options)

Arguments

NameTypeDescription
affiliate_id requiredintegerThe Royal Affiliate Pro affiliate ID.

Example prompt

Show me the performance snapshot for affiliate 42 in Royal Affiliate Pro.

Read-only.

rafp_get_referral_records

Query the referral log with filter + pagination. Filters: affiliate_id, status, campaign_id, date range, search on reference / reference_type.

Cap

rafp_manage_referrals (falls back to manage_options)

Arguments

NameTypeDescription
affiliate_idintegerOptional. Restrict to one affiliate.
statusstringOptional. One of pending / approved / rejected / paid.
campaign_idintegerOptional. Restrict to one campaign.
date_fromstringOptional. ISO 8601 date lower bound.
date_tostringOptional. ISO 8601 date upper bound.
orderbystringOne of referral_id, affiliate_id, status, commission_amount, date_created.
orderstringASC or DESC.
paginateobject{page, per_page}. Defaults page 1, per_page 100, max 500.

Example prompt

List all referrals from affiliate 42 in the last 30 days that are approved but unpaid.

Read-only.

rafp_get_fraud_incidents

Query the Royal Affiliate Pro fraud log with severity filter + pagination.

Cap

rafp_manage_affiliates (falls back to manage_options)

Arguments

NameTypeDescription
severitystringOne of low / medium / high. Omit for all.
orderbystringOne of log_id, affiliate_id, severity, fraud_type, date_created.
orderstringASC or DESC.
paginateobject{page, per_page}. Defaults page 1, per_page 100, max 500.

Example prompt

Show the last 20 high-severity fraud incidents in Royal Affiliate Pro.

Read-only.

Note: affiliate_id and date range filters are not supported by the sibling's get_incidents() in this release — deferred pending an upstream extension.

rafp_list_campaigns

List Royal Affiliate Pro campaigns with filter + pagination. Filters: status (typical: active / inactive / ended), search (LIKE on name / description / slug), sort order.

Cap

rafp_manage_campaigns (falls back to manage_options)

Arguments

NameTypeDescription
statusstringCampaign status filter (typical: active, inactive, ended).
searchstringLIKE match against name, description, and slug.
orderbystringOne of campaign_id, name, slug, commission_rate, status, start_date, end_date, date_created.
orderstringASC or DESC. Default DESC.
paginateobject{page, per_page}. Defaults page 1, per_page 100, max 500.

Example prompt

List every active Royal Affiliate Pro campaign ordered by commission rate descending.

Read-only.

rafp_get_campaign

Fetch a single Royal Affiliate Pro campaign by ID. Companion to rafp_list_campaigns.

Cap

rafp_manage_campaigns (falls back to manage_options)

Arguments

NameTypeDescription
campaign_id requiredintegerThe Royal Affiliate Pro campaign ID.

Example prompt

Show campaign 7 in full detail.

Read-only.

rafp_get_campaign_performance

Performance stats for one Royal Affiliate Pro campaign — visit count, referral totals (total + approved), total commission, conversion rate.

Cap

rafp_manage_campaigns (falls back to manage_options)

Arguments

NameTypeDescription
campaign_id requiredintegerThe Royal Affiliate Pro campaign ID.

Example prompt

Compare performance of campaigns 7 and 12 in Royal Affiliate Pro.

Read-only.

rafp_list_creatives

List Royal Affiliate Pro creative assets (banners, emails, text ads, videos) with filter + pagination. Filters: type, status, campaign_id, sort order.

Cap

rafp_manage_campaigns (falls back to manage_options)

Arguments

NameTypeDescription
typestringCreative type filter (typical: banner, email, text, video, html).
statusstringOne of active / inactive. Omit for all.
campaign_idintegerFilter to creatives attached to one campaign. 0 or omit for across-campaigns.
orderbystringOne of creative_id, name, type, status, campaign_id, clicks, conversions, date_created.
orderstringASC or DESC.
paginateobject{page, per_page}. Defaults page 1, per_page 100, max 500.

Example prompt

List every active banner creative attached to campaign 7.

Read-only.

rafp_list_payouts

List Royal Affiliate Pro payout rows with filter + pagination. Filters: affiliate_id, status, date range, sort order.

Cap

rafp_manage_payouts (falls back to manage_options)

Arguments

NameTypeDescription
affiliate_idintegerRestrict to one affiliate.
statusstringOne of pending / paid / failed / rejected.
orderbystringOne of payout_id, affiliate_id, amount, status, date_created, date_paid.
orderstringASC or DESC.
paginateobject{page, per_page}. Defaults page 1, per_page 100, max 500.

Example prompt

List every pending payout larger than $100.

Read-only.

rafp_get_activity_log

Query the Royal Affiliate Pro activity log with action, user_id, date-range, and search filters plus pagination. Requires Royal Affiliate Pro 2.6.15 or later for the full filter set; older versions fall back to a limit-only path with graceful legacy behavior.

Cap

manage_options (activity log has no scoped RAFP cap) (falls back to manage_options)

Arguments

NameTypeDescription
actionstringRestrict to one action label (e.g. affiliate_approved, referral_updated).
user_idintegerRestrict to actions performed by one WordPress user.
date_fromstringISO 8601 date lower bound.
date_tostringISO 8601 date upper bound.
searchstringLIKE match against the meta JSON blob.
orderbystringOne of date_created, id, action, user_id. Ignored on the legacy path.
orderstringASC or DESC.
paginateobject{page, per_page}. Defaults page 1, per_page 100, max 500.
limitintegerLegacy shorthand for paginate.per_page. Accepted on both paths.

Example prompt

Show every affiliate approval event in the last 7 days.

Read-only.

rafp_list_landing_pages

List every Royal Affiliate Pro landing page assignment across affiliates. Filters: affiliate_id, page_status (publish / draft / any), search on page title, sort order. Requires Royal Affiliate Pro 2.6.15 or later.

Cap

rafp_manage_campaigns (falls back to manage_options)

Arguments

NameTypeDescription
affiliate_idintegerRestrict to one affiliate's landing pages.
page_statusstringOne of publish / draft / any. Default publish.
searchstringLIKE match against page title.
orderbystringOne of date_assigned, date_modified, title, page_id, affiliate_id.
orderstringASC or DESC.
paginateobject{page, per_page}. Defaults page 1, per_page 100, max 500.

Example prompt

List every landing page assigned to affiliate 42, most recently assigned first.

Read-only.

Reversible writes with 168-hour undo (12)

Every reversible write is a two-step commit: call once without commit_token to preview and receive a five-minute token; call again with the token to persist. Undo tokens live for 168 hours and restore the exact prior state per row.

rafp_bulk_approve_affiliates

Bulk-approve affiliates that are currently pending. Two-step commit; undo restores each affiliate's prior status.

Cap

rafp_manage_affiliates (falls back to manage_options)

Arguments

NameTypeDescription
affiliate_ids requiredinteger[]Explicit list of affiliate IDs to approve. Cap 100 per call.
commit_tokenstringRequired for step 2.
dry_runbooleanForce step-1 preview.

Example prompt

Approve pending affiliates 12, 15, 18, and 21 in Royal Affiliate Pro.

Undo: 168h token — restores each affiliate to its prior status.

rafp_update_referral_status

Bulk-update referral status across a set of referral IDs. Two-step commit; undo restores each referral's prior status.

Cap

rafp_manage_referrals (falls back to manage_options)

Arguments

NameTypeDescription
referral_ids requiredinteger[]Explicit list of referral IDs. Cap 100 per call.
new_status requiredstringOne of pending / approved / rejected / paid.
commit_tokenstringRequired for step 2.
dry_runbooleanForce step-1 preview.

Example prompt

Approve referrals 501, 502, 503, and 504 in Royal Affiliate Pro.

Undo: 168h token — restores each referral to its prior status.

rafp_bulk_generate_payouts

Generate payout rows for a list of affiliates. Generate-only — creates rows in rafp_payouts with status=pending and links each affiliate's approved unpaid referrals. Does not dispatch actual Stripe / PayPal payment — gateway dispatch remains a human-driven step via the sibling admin UI.

Cap

rafp_manage_payouts (falls back to manage_options)

Arguments

NameTypeDescription
affiliate_ids requiredinteger[]Affiliate IDs to generate payouts for. Cap 100 per call.
notesstringOptional. Applied to each generated payout row.
commit_tokenstringRequired for step 2.
dry_runbooleanForce step-1 preview.

Example prompt

Generate this month's payouts for affiliates with approved unpaid referrals above $50.

Undo: 168h token — deletes each generated payout row and resets each linked referral's payout_id to NULL so referrals are re-eligible for a future payout run. Does not touch any gateway dispatch (this tool never fires the gateway).

rafp_bulk_generate_coupons

Bulk-generate WooCommerce coupons per affiliate or by tag. Each coupon carries the affiliate's referral code as an attribution stamp.

Cap

rafp_manage_payouts (falls back to manage_options)

Arguments

NameTypeDescription
affiliate_idsinteger[]Affiliate IDs to generate coupons for. Mutually exclusive with tag_id. Cap 100 per call.
tag_idintegerAlternative to explicit IDs — generate coupons for every affiliate carrying this tag.
discount_type requiredstringOne of percent / fixed_cart / fixed_product.
amount requirednumberDiscount amount in the type's unit.
code_prefixstringOptional prefix for the generated coupon codes.
commit_tokenstringRequired for step 2.
dry_runbooleanForce step-1 preview.

Example prompt

Give every affiliate tagged as "high-performer" a 15% WooCommerce coupon prefixed HP24.

Undo: 168h token — deletes each generated WooCommerce coupon.

rafp_create_campaign

Create a Royal Affiliate Pro campaign via two-step commit + 168h undo. Wraps Royal_Affiliate_Campaign::create().

Cap

rafp_manage_campaigns (falls back to manage_options)

Arguments

NameTypeDescription
name requiredstringCampaign display name.
slugstringURL slug. Auto-generated from name if omitted.
descriptionstringCampaign description.
commission_typestringOne of percentage / flat.
commission_ratenumberThe rate value. Percentage type is capped at 100; flat type has no ceiling.
statusstringOne of active (default) / inactive / ended.
start_datestringISO 8601 date. Optional.
end_datestringISO 8601 date. Must be >= start_date.
commit_tokenstringRequired for step 2.
dry_runbooleanForce step-1 preview.

Example prompt

Create a new "Q4 Holiday Push" campaign with 15% commission running Nov 1 through Dec 31.

Undo: 168h token — deletes the created campaign row via Royal_Affiliate_Campaign::delete(). Coupon association is out of scope for this tool.

rafp_create_challenge

Create a Royal Affiliate Pro challenge (gamification) via two-step commit + 168h undo. Wraps Royal_Affiliate_Challenge::create().

Cap

rafp_manage_campaigns (falls back to manage_options)

Arguments

NameTypeDescription
name requiredstringChallenge display name.
goal requirednumberNumeric goal value. Must be > 0.
metric requiredstringOne of referral_count / earnings / revenue.
reward_type requiredstringOne of commission_rate / commission_bonus / flat_bonus / tier_upgrade / custom.
reward_valuestringJSON-encoded reward value payload. Shape depends on reward_type.
scopestringOne of all (every affiliate) / tag (one tag_id) / tier (one tier_id).
scope_valueintegerRequired when scope is tag or tier.
commit_tokenstringRequired for step 2.
dry_runbooleanForce step-1 preview.

Example prompt

Create a "Q4 Sprint" challenge: goal 50 referrals in November, reward is a flat $200 bonus, scoped to affiliates tagged "top-tier".

Undo: 168h token — deletes the created challenge row.

rafp_bulk_upload_creatives

Bulk-create Royal Affiliate Pro creative assets in one call via two-step commit + 168h undo. Wraps Royal_Affiliate_Creative::bulk_create(). Requires Royal Affiliate Pro 2.6.15 or later.

Cap

rafp_manage_campaigns (falls back to manage_options)

Arguments

NameTypeDescription
items requiredobject[]Array of creative payloads. Each item requires name; optional type, status, campaign_id, content, image_url, target_url. Cap 100 items per call.
commit_tokenstringRequired for step 2.
dry_runbooleanForce step-1 preview.

Example prompt

Upload three new banner creatives for campaign 12: sizes 728x90, 300x250, and 160x600, all pointing at the same landing page.

Undo: 168h token — deletes every creative row that was inserted in the batch.

rafp_assign_landing_page

Assign an existing WordPress page as an affiliate's dedicated landing page via two-step commit + 168h undo. Wraps Royal_Affiliate_Landing_Page::assign(). Preserves prior-assignment state so undo can restore a replacement scenario correctly. Requires Royal Affiliate Pro 2.6.15 or later.

Cap

rafp_manage_campaigns (falls back to manage_options)

Arguments

NameTypeDescription
page_id requiredintegerThe WordPress page ID to assign.
affiliate_id requiredintegerThe Royal Affiliate Pro affiliate ID.
commit_tokenstringRequired for step 2.
dry_runbooleanForce step-1 preview.

Example prompt

Assign page 512 as affiliate 42's dedicated landing page.

Undo: 168h token — restores the page's prior assignment. If the page was previously unassigned, undo unassigns; if it was assigned to another affiliate, undo restores that prior assignment plus the prior date_assigned postmeta.

rafp_bulk_tag_affiliates

Bulk-tag Royal Affiliate Pro affiliates in a single call via two-step commit + 168h undo. Wraps RAFP 2.6.15's Royal_Affiliate_Tag::add_tags_bulk() which returns a per-(affiliate, tag) results map so the undo is surgical — only pairs that actually landed get removed on undo, dupes that were skipped never touched.

Cap

rafp_manage_affiliates (falls back to manage_options)

Arguments

NameTypeDescription
affiliate_ids requiredinteger[]Affiliate IDs to tag. Cap 100 per call.
tag_ids requiredinteger[]Tag IDs to apply. Cap 20 per call. Result is affiliate_ids × tag_ids pairs; each pair is either inserted or skipped as duplicate.
commit_tokenstringRequired for step 2.
dry_runbooleanForce step-1 preview.

Example prompt

Tag affiliates 12, 15, 18, and 21 with tags "black-friday-2026" and "high-value".

Undo: 168h token — removes only the (affiliate, tag) pairs that were actually inserted in the batch. Pairs that were skipped as duplicates aren't touched.

rafp_bulk_update_category_rates

Bulk-update Royal Affiliate Pro category commission rates. Two-step commit + 168h undo. Wraps RAFP 2.6.15's Royal_Affiliate_Category_Rates::bulk_update(). Preview captures the prior state per row so undo restores exact values.

Cap

rafp_manage_campaigns (falls back to manage_options)

Arguments

NameTypeDescription
updates requiredobject[]Array of update items. Each item requires id (row ID); optional rate, rate_type (percentage / flat), status (active / inactive), and priority (integer — category-rates only). Cap 100 items per call.
commit_tokenstringRequired for step 2.
dry_runbooleanForce step-1 preview.

Example prompt

Increase the "Apparel" category commission rate from 10% to 15% and drop "Electronics" from 8% to 6%.

Undo: 168h token — restores each row's prior rate, rate_type, status, and priority.

rafp_bulk_update_product_rates

Bulk-update Royal Affiliate Pro product commission rates. Same shape as rafp_bulk_update_category_rates but without the priority field (product rates don't use priority). Two-step commit + 168h undo. Wraps RAFP 2.6.15's Royal_Affiliate_Product_Rates::bulk_update().

Cap

rafp_manage_campaigns (falls back to manage_options)

Arguments

NameTypeDescription
updates requiredobject[]Array of update items. Each item requires id; optional rate, rate_type (percentage / flat), status. priority field is NOT supported here. Cap 100 items per call.
commit_tokenstringRequired for step 2.
dry_runbooleanForce step-1 preview.

Example prompt

Set the commission rate on product 512 to 20% and disable the rate override on product 615.

Undo: 168h token — restores each row's prior rate, rate_type, and status.

rafp_grant_store_credit

Grant store credit to a batch of affiliates via a two-step commit + 168h undo. Requires an active wallet plugin (WooCommerce Wallet, TeraWallet, or similar) — without one the tool returns a wallet_plugin_unavailable error envelope at both preview and commit.

Cap

rafp_manage_payouts (falls back to manage_options)

Arguments

NameTypeDescription
affiliate_ids requiredinteger[]Affiliate IDs to credit. Cap 100 per call.
amount requirednumberCredit amount per affiliate. Must be > 0.
descriptionstringGrant description shown to affiliates (default "Store credit grant from admin").
commit_tokenstringRequired for step 2.
dry_runbooleanForce step-1 preview.

Example prompt

Grant $25 store credit to affiliates 12, 15, and 18 with description "Q4 loyalty bonus".

Undo: 168h token — reverses each granted credit via the wallet plugin's deduct method. Skips grants that were already spent (surfaced in the response as reverse_failed).

Irreversible sends (3)

These three tools dispatch emails or write to the fraud log — once committed, there's nothing to reverse. Preview machinery on step 1 (side-effect-free) lets you eyeball the exact recipient set, sample report content, or sample fraud incidents before committing. Response envelopes carry undo_token: "NO_UNDO_SCOPE" instead of a real token to make the semantics explicit.

rafp_broadcast_to_affiliates

Send a broadcast email to a filtered or explicit set of Royal Affiliate Pro affiliates. Two-step commit; step 1 resolves the recipient set and returns a five-recipient sample so you can eyeball who gets the message before committing. Wraps Royal_Affiliate_Communication::send_bulk_email(). Requires Royal Affiliate Pro 2.6.15 or later. No undo — emails can't be recalled.

Cap

rafp_manage_affiliates (falls back to manage_options)

Arguments

NameTypeDescription
subject requiredstringEmail subject. 1-200 chars.
message requiredstringEmail body. Sanitized with wp_kses_post. Supports RAFP placeholders: {affiliate_name}, {affiliate_email}, {referral_code}, {referral_link}, {total_earnings}, {unpaid_earnings}, {total_referrals}, {total_visits}, {conversion_rate}, {dashboard_url}, {site_name}, {site_url}.
affiliate_idsinteger[]Explicit recipient list. Mutually exclusive with filters. Cap 500 recipients per call.
filtersobjectFilter-based recipient resolution: {status, tier_id, min_earnings, min_referrals, tag_id}. Resolved via sibling's filter_recipients().
commit_tokenstringRequired for step 2. One-shot — consumed on commit to prevent double-sends.
dry_runbooleanForce step-1 preview.

Example prompt

Send every active affiliate who earned over $500 this month a subject "Bonus reward for Q4 performance" with a custom body using {affiliate_name} and {unpaid_earnings} placeholders.

NO UNDO. Emails already left the box.

rafp_send_monthly_report

Force-fire monthly performance reports to affiliates on demand. Two-step commit; step 1 resolves recipients and returns a sample generated report so you can eyeball the shape before committing. Bypasses the scheduled monthly cron cadence — useful for backfilling reports to affiliates who missed the auto-send. Wraps Royal_Affiliate_Monthly_Reports::generate_report() + send_report(). No undo — emails can't be recalled.

Cap

rafp_manage_affiliates (falls back to manage_options)

Arguments

NameTypeDescription
affiliate_idsinteger[]Explicit recipient list. Mutually exclusive with filters. Cap 500 recipients per call.
filtersobjectFilter-based recipient resolution: same shape as broadcast.
monthintegerReport period month (1..12). Defaults to the last completed month.
yearintegerReport period year. Defaults to the year of the last completed month.
commit_tokenstringRequired for step 2.
dry_runbooleanForce step-1 preview.

Example prompt

Send the September 2026 monthly report to affiliates 12, 15, and 18 (who missed the scheduled auto-send).

NO UNDO. Emails already left the box. Per-recipient outcome is legible in the response: sent / generate_failed (sibling had no data for the period) / send_failed (wp_mail returned false; check the affiliate's user_email + SMTP config).

rafp_scan_fraud

Force-fire a fraud sweep against recent visits and referrals via two-step commit. Step 1 runs a read-only 25-row sample per scan type so you see the shape of incidents that would land before committing to a full sweep — the sample never writes to rafp_fraud_log. Step 2 runs the full Royal_Affiliate_Fraud_Detector::scan_history() with caller-supplied bounds. Useful after tightening detection rules — real-time hooks only fire at insert time, so historical rows stay unclassified until a scan revisits them. No undo — logged incidents persist in the fraud log (clear manually via the sibling admin page).

Cap

rafp_manage_affiliates (falls back to manage_options)

Arguments

NameTypeDescription
days_backintegerLook-back window in days. Default 30, max 365.
scan_typesstring[]Subset of ["visits", "referrals"]. Default = both.
batch_sizeintegerMax rows to inspect per scan type on commit. Default 500, max 5000.
commit_tokenstringRequired for step 2.
dry_runbooleanForce step-1 preview.

Example prompt

Scan the last 30 days for fraud incidents across both visits and referrals.

NO UNDO. Logged incidents persist in rafp_fraud_log. Use the Royal Affiliate Pro admin fraud page to review and clear.

Still Stuck? Two-Step Support Path

If a Royal Affiliate Pro tool isn't behaving the way you expected, work through these two steps in order — most tool-level failures resolve at Step 1 because they're actually MCP-connection, host-layer, or sibling-version issues, not RAFP-specific.

Step 1: Start with the Royal MCP Troubleshooting Guide

Royal MCP Troubleshooting — Start Here covers MCP-layer issues. If Claude can't reach your site at all, the tool call never fires — that guide is where to start.

For Pro-specific patterns:

For RAFP-specific patterns:

  • Sibling method unavailable errors. If a response envelope carries royal_affiliate_<class>_unavailable or royal_affiliate_<class>_api_incomplete, upgrade Royal Affiliate Pro to 2.6.15 or later — the twelve workflow tools added in Royal MCP Pro 1.0.11 wrap primitives that shipped in that RAFP version.
  • wallet_plugin_unavailable on rafp_grant_store_credit. The store credit tool requires an active wallet plugin (WooCommerce Wallet, TeraWallet, or similar). Without one it returns a clean error at both preview and commit — no rows written.
  • batch_too_large on bulk tools. Every bulk tool caps per-call size. Narrow the filter or split the batch and re-call.
  • commit_token_invalid on the second call of a two-step tool. Tokens are one-shot with a 5-minute TTL. If the token expired or was already consumed, re-run step 1 (preview) to get a fresh token, then commit.

Step 2: Email priority support

If you've worked through Start Here and the relevant Pro-specific doc and the issue still isn't resolved, email priority support from your purchase email address at support@royalplugins.com. Priority email support is included with your license — typical response within 24 hours. Never include your license key in email; we look it up from your purchase address.

What to include in your email
  • Your hosting provider (SiteGround, Cloudways, Hostinger, Kinsta, WP Engine, Liquid Web, self-hosted VPS, etc.)
  • Royal MCP Pro version from WP Admin → Plugins
  • Royal Affiliate Pro version from WP Admin → Plugins (2.6.15+ is required for the twelve workflow tools added in Royal MCP Pro 1.0.11)
  • Active caching plugins (LiteSpeed Cache, WP Rocket, W3 Total Cache, SpeedyCache, Hummingbird, none)
  • Active security plugins (Wordfence, Defender Pro, Solid Security, NinjaFirewall, none)
  • Cloudflare or CDN in front of the site? If yes, is “Manage AI Bots” or “Bot Fight Mode” on?
  • Which MCP client — claude.ai web custom connector, Claude Desktop with mcp-remote, ChatGPT MCP, Cursor, or another MCP-compatible client
  • The exact RAFP tool name and args you called (e.g. rafp_bulk_tag_affiliates with affiliate_ids: [12, 15, 18], tag_ids: [3, 7])
  • Whether the failure hit preview (step 1) or commit (step 2) for two-step tools — the two-step flow narrows triage significantly
  • The exact error message returned (from the MCP client's chat surface), plus any ofid_xxxxx reference code if claude.ai shows one
  • Screenshot of the most recent Pro tool row in Audit Log with View Details expanded — or confirmation that the log is empty after a reproduced failure
  • Screenshot of the corresponding row in the Royal Affiliate Pro Activity Log (WP Admin → Royal Affiliate → Activity Log) — RAFP maintains its own audit trail for affiliate program events