WordPress Maintenance

Pinpoint rollback — building per-plugin revert with WP-CLI

You batch-update 20 plugins, and one breaks the site. Most WordPress maintenance tools play it safe and roll back all 20 updates (variations on “Safe Updates” or “Atomic Updates”). It’s a reasonable default. But running in production, you start running into cases where you want only the broken one reverted, and the other 19 to keep their updates. Here’s how that design is built on top of WP-CLI. The command that makes it possible — wp plugin install –version=X –force WP-CLI has a powerful command for “install a plugin at a specific version, overwriting whatever’s currently there”: wp plugin install <plugin-slug> –version=1.2.3 –force –skip-plugins –skip-themes What each flag does: –version=1.2.3 …

Read more
WordPress Maintenance

After a core rollback, halt the rest — a safety design we arrived at the hard way

In WordPress maintenance automation, you inevitably run into points where you have to decide: keep going, or stop right here? One that took us a long time to get right was this: when a WordPress core update goes wrong and gets rolled back, should the remaining plugin updates continue, or stop? We eventually switched to the “stop” design, but we started with “keep going” — and several traps surfaced only after running it in production. Here’s how the redesign happened. Three cases to separate The outcome of a core update, viewed through a rollback lens, falls into three patterns: Case 1: Core rollback succeeded, site recovered — the site is …

Read more
WordPress Maintenance

When WP-CLI fatals on the plugin you came to rescue

A WordPress plugin update breaks the site. You SSH in to roll back the bad plugin with WP-CLI, and you get this: Fatal error: Uncaught Error: … in /path/to/broken-plugin/main.php:42 The plugin you came to fix has now stopped the tool you came to fix it with. It looks contradictory, but it makes sense once you know how WP-CLI starts up — and there’s a flag pair that gets you out. Why WP-CLI itself crashes When you run a rollback command like wp plugin install <name> –version=X –force, WP-CLI internally boots WordPress before doing anything else. Plugin registration and option loading all happen during WordPress’s startup, so a broken plugin gets …

Read more