Skip to content

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.

  • WordPress with active Polski for WooCommerce plugin
  • WP-CLI
  • SSH access to the server or a local development environment
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

Runs every database migration that has not run on this site yet. It takes no arguments or options.

Terminal window
wp polski migrate
# Running Polski migrations...
# Success: Migrations complete.

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.

Terminal window
wp polski import-iworks
# Success: Imported 120 price history rows, removed 0.

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.

Terminal window
wp polski cache-flush
# Success: All caches flushed.

Deletes Omnibus price records older than --days (default 90).

Terminal window
wp polski omnibus-prune
wp 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.

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

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
Terminal window
wp polski withdrawal list --status=requested --format=json
Terminal window
wp polski withdrawal show 17 --format=json

--format accepts table (default) or json.

Terminal window
wp polski withdrawal confirm 17
wp polski withdrawal reject 17 --reason="Past 14-day window"
wp polski withdrawal complete 17

The --reason text of reject is saved to the request's audit trail.

Terminal window
wp polski withdrawal export-csv --status=completed > export.csv

Without --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

This page is for informational purposes only and does not constitute legal advice. Consult a lawyer before implementation. Polski for WooCommerce is open source software (GPLv2) provided without warranty.