wp-cli/extension-command
WP-CLI extension-command provides wp plugin and wp theme commands for managing WordPress extensions from the command line. Install from wordpress.org, activate or deactivate, update, delete, and handle multisite network activation, with bulk actions, exclusions, and force reactivation.
wp plugin is-active / is-installed return meaningful exit codes (0/1) and wp plugin list --status=... filters by state, so health checks, "is the security plugin actually running?" monitors, and config-drift alerts can be built on a stable contract rather than screen-scraping.--format=json|csv|yaml|count and --field= let us pipe output straight into our own reporting, billing/usage metering, or compliance evidence — a real build-vs-buy win versus writing WP-internals PHP.update, update_version, auto_update, auto_update_indicated, tested_up_to, wporg_last_updated fields make it feasible to define SLA-driven patch windows, flag stale/vulnerable plugins, and report on auto-update coverage per site.requires, requires_php, requires_wp, and requires_plugins (plus --ignore-requirements) let us decide whether to block, warn, or proceed on an update — a product decision about how aggressive our patching default should be.--all, --exclude=<slugs>, and --network support onboarding/offboarding workflows, staging-to-production promotion, and per-plan feature gating (e.g., "exclude our bundled plugins from customer-initiated bulk actions").--version=<version>, --force, --slug, and --with-dependencies (dependency resolution from the Requires Plugins header) enable pinned installs and deterministic provisioning — useful for deciding whether we promise one-click rollback or only forward-fix.Adopt when:
wp-load.php, calling activate_plugin(), handling multisite edge cases ourselves).--network, --activate-network).Look elsewhere or add a wrapper when:
require into a Laravel app. There is no service provider, no PHP API, no typed objects. Integration means Process::run('wp plugin install ...') — which means we own escaping, timeouts, concurrency, idempotency, and output parsing. Budget for that wrapper explicitly; it is the real cost of adoption.exec, no writable filesystem) or can't guarantee the wp binary version on target hosts — pin the WP-CLI version in our images or the contract is unstable.--insecure exists (TLS validation bypass), and everything runs with the privileges of the PHP process. Treat it as a privileged tool: allow-list slugs and versions, block arbitrary URLs, and never surface raw user input to the command line.One-line summary: This is the official WordPress command-line component that installs, activates, updates, and removes plugins and themes. It is not a library we embed — it is a tool we call — and it lets us offer plugin management as a product feature without writing WordPress internals ourselves.
For executives:
For engineering:
Process (or Laravel's Process facade) that builds argument arrays — never string concatenation — enforces timeouts, sets --format=json and --field= for machine consumption, and maps exit codes to typed results. Never parse the default table output.Requires Plugins) that we would otherwise get subtly wrong.--insecure or arbitrary remote URLs through the product surface.How can I help you explore Laravel packages today?