WP-CLI commands
Polski for WooCommerce adds WP-CLI commands under wp polski: run database migrations, flush caches, import or prune Omnibus price history, show plugin status, and manage consumer withdrawal requests (list, show, confirm, reject, complete, export to CSV). They are available whenever the plugin is active and WP-CLI is installed.
Requirements
Section titled "Requirements"- WordPress with active Polski for WooCommerce plugin
- WP-CLI
- SSH access to the server or a local development environment
Command overview
Section titled "Command overview"| Command | What it does |
|---|---|
wp polski migrate |
Runs pending database migrations |
wp polski import-iworks |
Imports the price history of the iworks "Omnibus" plugin |
wp polski cache-flush |
Flushes page caches and WooCommerce product transients |
wp polski omnibus-prune [--days=<days>] |
Deletes Omnibus price records older than the given number of days |
wp polski status |
Shows plugin version, wizard state, open security incidents, PHP and WooCommerce versions |
wp polski withdrawal list |
Lists withdrawal requests |
wp polski withdrawal show <id> |
Shows one withdrawal request |
wp polski withdrawal confirm <id> |
Confirms a request |
wp polski withdrawal reject <id> [--reason=<reason>] |
Rejects a request |
wp polski withdrawal complete <id> |
Marks a confirmed request as completed |
wp polski withdrawal export-csv |
Writes withdrawal records as CSV to standard output |
wp polski migrate
Section titled "wp polski migrate"Runs every database migration that has not run on this site yet. It takes no arguments or options.
wp polski migrate# Running Polski migrations...# Success: Migrations complete.wp polski import-iworks
Section titled "wp polski import-iworks"Imports price history rows from the iworks "Omnibus" plugin into Polski's own price history. The import also runs by itself on upgrade, and repeating it is safe: it only adds what is missing and removes what is wrong.
wp polski import-iworks# Success: Imported 120 price history rows, removed 0.wp polski cache-flush
Section titled "wp polski cache-flush"Flushes the caches of W3 Total Cache, WP Super Cache, LiteSpeed Cache and WP Fastest Cache when they are active, then the WordPress object cache and WooCommerce product transients. It fires the polski/cache/flushed action at the end.
wp polski cache-flush# Success: All caches flushed.wp polski omnibus-prune
Section titled "wp polski omnibus-prune"Deletes Omnibus price records older than --days (default 90).
wp polski omnibus-prunewp polski omnibus-prune --days=60# Success: Pruned 340 records older than 60 days.Keep at least 30 days of history: the lowest-price notice reads the last 30 days.
wp polski status
Section titled "wp polski status"Prints a table with these rows:
| Row | Source |
|---|---|
| Plugin version | The running plugin code |
| Installed version | The polski_version option |
| Setup wizard complete | The polski_wizard_complete option (yes / no) |
| Open security incidents | Incidents with status open, investigating or monitoring |
| PHP version | PHP_VERSION |
| WooCommerce version | WC_VERSION, or not loaded |
wp polski withdrawal
Section titled "wp polski withdrawal"Manages the consumer withdrawal requests recorded by the withdrawal module. Request statuses are requested, confirmed, completed and rejected.
| Option | Default | Description |
|---|---|---|
--status=<status> |
all | requested, confirmed, completed or rejected |
--limit=<limit> |
50 | Maximum number of rows |
--offset=<offset> |
0 | Pagination offset |
--format=<format> |
table |
table, csv, json, count or ids |
wp polski withdrawal list --status=requested --format=jsonwp polski withdrawal show 17 --format=json--format accepts table (default) or json.
confirm, reject, complete
Section titled "confirm, reject, complete"wp polski withdrawal confirm 17wp polski withdrawal reject 17 --reason="Past 14-day window"wp polski withdrawal complete 17The --reason text of reject is saved to the request's audit trail.
export-csv
Section titled "export-csv"wp polski withdrawal export-csv --status=completed > export.csvWithout --limit the export includes all matching records, up to a safety cap of 10,000 rows.
How do I flush caches after changing Polski settings?
Section titled "How do I flush caches after changing Polski settings?"Run wp polski cache-flush. It clears the supported page cache plugins, the object cache and WooCommerce product transients in one step.
How long should I keep Omnibus price history?
Section titled "How long should I keep Omnibus price history?"At least 30 days, because the lowest-price notice looks back 30 days. The omnibus-prune default of 90 days keeps a margin.
Can I process withdrawal requests from the command line?
Section titled "Can I process withdrawal requests from the command line?"Yes. wp polski withdrawal list --status=requested shows the open ones, and confirm, reject and complete change their status by ID.
Report issues: github.com/wppoland/polski/issues