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.
Architecture fit. This is not a Laravel package — it is a WP-CLI command package that registers wp plugin * and wp theme * subcommands. It assumes a bootstrapped WordPress runtime (WP_CLI, $wpdb, WP_CONTENT_DIR) and extends the WP-CLI command base classes. Dropping it into a composer require inside a Laravel app yields a package that cannot execute without a WordPress install on the same filesystem and a WP-CLI entrypoint. Its real architectural fit is as an external CLI surface that a Laravel application orchestrates — via Symfony\Component\Process, SSH, or CI jobs — not as an in-process library. For teams running Bedrock/Sage or headless WordPress alongside Laravel, that fit is strong and idiomatic. For a pure Laravel service with no WordPress footprint, the fit is effectively zero.
Integration feasibility. High where WordPress already exists and is managed operationally, because WP-CLI is the canonical tooling and this package ships as part of wp-cli/wp-cli-bundle (which is why the "0 dependents" signal is misleading — it is bundled, not independently depended upon). The machine-readable surfaces are the practical integration points: wp plugin list --format=json, wp plugin get --format=json, and the is-active / is-installed commands that return exit code 0/1. That is enough to build a genuine inventory-and-remediation loop. Feasibility drops sharply for anything requiring structured errors: the write commands communicate failure through human-readable STDOUT/STDERR plus a coarse exit code, so a Laravel consumer must parse prose or treat any non-zero as opaque failure.
Technical risk. Concentrated in the mutating commands. wp plugin install accepts arbitrary remote zip and PHP URLs and will fetch and unpack them; --insecure disables TLS validation by design; --force silently overwrites installed versions; --activate and --with-dependencies can pull in transitive code you did not vet. Batched operations are partially atomic — a batch of five can leave two installed and three failed while returning exit 1. Filesystem writes assume the web user's ownership and permissions on the target host. Also flag two dataset anomalies before anyone plans against them: the release date 2026-08-04 is in the future, and dependents: 0 conflicts with the package being a WP-CLI bundle member. Treat both as metadata defects, not as signals about the package.
Key questions.
wp plugin install? These two models conflict and must not be mixed on one site.--network semantics change activation and rollback behavior.--version pinning to make updates reproducible?Stack fit. The clean pattern is a Laravel "WordPress operations" service: an Artisan command or queued job that shells out to wp on a target host and consumes --format=json output. Read operations (list, get, is-active, is-installed) are safe to embed early and give immediate value — a plugin inventory dashboard, drift detection, update-availability reporting. Write operations should sit behind an explicit allowlist and an approval step, because the CLI has no dry-run mode for most writes and no transactional rollback.
Migration path. Start read-only. Stand up a scheduled job that runs wp plugin list --format=json --skip-update-check against each environment and persists the result; this proves connectivity, credentials, path assumptions, and parsing without any mutation risk. Then add --fields-limited queries to a second pass. Only after inventory is stable and trusted should you introduce install/activate behind a staging-only flag.
Compatibility. Requires a WP-CLI runtime and a matching PHP version on the target host — the Laravel host's PHP is irrelevant if you are executing remotely. Pin the WP-CLI version explicitly; do not float. Note that install and update semantics diverge from Composer-managed plugin workflows, so declare one model per environment and enforce it. Cache directory (~/.wp-cli/cache) must be writable and ideally shared across runs to avoid repeated downloads.
Sequencing.
install --activate for a single known plugin, with manual verification.update with --version pinned; verify update_version field behavior.update inside a change window with snapshot/backup preceding the call.deactivate permitted with allowlist; delete and --uninstall gated behind a second approval and never in an automated job.Maintenance. The package is mature and actively released, with coverage badges, PHPStan, PHPCS, and a Behat acceptance suite — but it is a bundle member, so its lifecycle tracks WP-CLI core rather than an independent roadmap. Your real maintenance surface is therefore WP-CLI upgrades and their PHP/WordPress compatibility matrix, not this package alone. Budget for periodic re-pinning and a staging smoke test on each WP-CLI bump.
Support. Community-only: GitHub issues, no vendor SLA, no paid support tier. Internal ownership must be explicit — one team accountable for the WP-CLI version and the allowlist of permitted plugin operations. The README is generated from source annotations, so behavior changes surface in code before they surface in docs; treat the feature files as the more reliable specification.
Scaling. Invocation is per-site and per-process; there is no batching API. Scale comes from parallelizing at the orchestrator (queue workers, concurrency caps per host), and it is bounded by WordPress.org API rate limits on update checks and by download throughput. Use --skip-update-check for inventory where freshness is not needed. Expect runtime dominated by network and unzip, not PHP.
Failure modes.
wp-content writes when the CLI runs as a different user than the web server.--insecure; treat any use of that flag as a security exception requiring sign-off.--with-dependencies) pulling unvetted third-party code.wp plugin install, producing state that neither tool understands.Ramp-up. Low for read-only usage — an engineer familiar with WP-CLI can integrate list/get JSON in under a day. Moderate for write automation: expect one to two weeks to build the allowlist, approval gate, snapshot step, and post-state verification, plus a staging cycle per target environment. Requiring contributors to touch this package itself is a different bar — Behat scenarios, WP_CLI_CS style, and multi-minute full test runs mean plan on days, not hours.
How can I help you explore Laravel packages today?