WP-CLI commands
Every admin action is also available via WP-CLI. Useful for cron jobs, server scripts, bulk operations.
Install
WP-CLI ships with most managed WordPress hosts. Verify:
wp --versionAsteris commands are auto-registered when the plugin is active. List them:
wp asteris-aff --helpAffiliate management
# Listwp asteris-aff list --status=pendingwp asteris-aff list --status=active --format=csv > affiliates.csv
# Approve / reject / suspendwp asteris-aff approve 123wp asteris-aff reject 123 --reason="duplicate signup"wp asteris-aff suspend 123 --reason="self-referral"wp asteris-aff reinstate 123
# Singlewp asteris-aff get 123 --field=lifetime_earningsCommissions
# Approve / rejectwp asteris-aff commissions approve 456wp asteris-aff commissions revoke 456 --reason="manual review"
# Bulk approve all eligiblewp asteris-aff run-approvalsPayouts
# Run scheduled batcheswp asteris-aff run-payoutswp asteris-aff run-payouts --method=paypal --dry-run
# Manual mark-paid from CSVwp asteris-aff payouts mark-paid --csv=/path/to/paid.csv
# Export pendingwp asteris-aff payouts export --status=pending > pending.csvStats + aggregates
# Recompute denormalised aggregates (use after data migration)wp asteris-aff recompute-aggregates
# Stats for a single affiliatewp asteris-aff stats 123
# Top performerswp asteris-aff stats top --period=30d --limit=10Imports
wp asteris-aff import --source=affiliatewpwp asteris-aff import --source=slicewpwp asteris-aff import --source=tapfiliate --csv=/path/to/tapfiliate-export.csvScheduled exports
wp asteris-aff schedule-export --type=commissions --frequency=weekly --to=accounting@example.comThrottle cleanup
wp asteris-aff throttle-cleanupRemoves throttle records older than the retention window (default 7 days).
Cron alternative
Most stores let WP-Cron handle scheduled batches. For reliability, replace WP-Cron with a system cron pointing at WP-CLI:
0 * * * * cd /var/www/yoursite.com && wp asteris-aff run-approvals --quiet0 2 * * 1 cd /var/www/yoursite.com && wp asteris-aff run-payouts --quiet