Add test-data CLI commands from the pmpro-cli POC - #73
Open
flintfromthebasement wants to merge 1 commit into
Open
Add test-data CLI commands from the pmpro-cli POC#73flintfromthebasement wants to merge 1 commit into
flintfromthebasement wants to merge 1 commit into
Conversation
Ports bulk-add-users, bulk-checkout-users, expire-memberships, payment-reminders, and cleanup-actions into the Toolkit CLI, registered as pmpro-toolkit subcommands behind the existing enable_cli_commands setting. Fixes the stale tk/v1 endpoint default to toolkit/v1. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Ports the dev/test-data commands from the
strangerstudios/pmpro-cliPOC repo into Toolkit's CLI, where dev-only tooling belongs. The general-purpose commands from that POC are landing in core via strangerstudios/paid-memberships-pro#3740 and #3748; with this PR merged, the POC repo can be archived.New subcommands, registered under the existing
wp pmpro-toolkitnamespace and gated behind the same Enable CLI Commands Toolkit setting:wp pmpro-toolkit bulk-add-users— generate test users, optionally with memberships/subscriptions, random past start dates, and a Siege login file (--for-siege).wp pmpro-toolkit bulk-checkout-users— generate users and simulate checkouts through Toolkit'stoolkit/v1/test-checkoutREST endpoint (requires the Performance Endpoints setting at Read and Write).wp pmpro-toolkit expire-memberships— rewrite expiration/next-payment dates to test expiry flows;--with_astriggers the Action Scheduler emails.wp pmpro-toolkit payment-reminders— adjustnext_payment_dateand clear reminder meta to test recurring payment reminders.wp pmpro-toolkit cleanup-actions— delete PMPro scheduled actions by hook/group/status/args.Changes from the POC versions
pmpro_cli\core→PMPro_Toolkit, text domain →pmpro-toolkit, examples updated to thepmpro-toolkitcommand namespace.bulk-checkout-users' default endpoint from the staletk/v1/test-checkouttotoolkit/v1/test-checkout(Toolkit's actual REST namespace).WP_CLI::add_command()in the bulk-checkout file; all five register centrally inpmpro-toolkit.phpbehind the existing WP_CLI gate.cli/commands/, loaded only when CLI commands are enabled.How to test
wp pmpro-toolkit bulk-add-users --count=3 --with-membershipwp pmpro-toolkit expire-memberships --user_ids=<ids> --days=-1wp pmpro-toolkit payment-reminders --user_ids=<ids> --days=3wp pmpro-toolkit cleanup-actionswp pmpro-toolkit bulk-checkout-users --count=2All five verified on a local seeded site (test data cleaned up after).
🤖 Generated with Claude Code