* **Automated Remote Site Snapshots `disembark`:** A powerful new command that uses browser automation (Playwright) to remotely log into a WordPress site, install and activate the Disembark Connector plugin, retrieve a connection token, and initiate a backup. It's a complete, hands-off solution for snapshotting a remote site without prior access.
* **Debug Mode for Browser Automation `--debug`:** The `disembark` command now includes a `--debug` flag to run the browser automation in a visible (headed) mode, making it easy to troubleshoot login or installation issues.
### ✨ Improvements
* **Selective Backups `backup --exclude`:** The `backup` command now accepts multiple `--exclude="<pattern>"` flags, allowing you to easily omit specific files or directories (like large cache folders) from the backup archive.
* **Script-Friendly Backups `backup --quiet`:** Added a `--quiet` flag to the `backup` command to suppress all informational output and print only the final backup URL, perfect for scripting and automation.
* **Contextual Performance Testing `find slow-plugins`:** The `find slow-plugins` command can now test performance against a specific front-end page render (e.g., `_do find slow-plugins /about-us`) instead of just the WP-CLI bootstrap, providing more relevant and accurate results for front-end slowdowns.
* **Quick Archiving `zip`:** A new utility to create a zip archive of any specified folder. When run within a WordPress site, it provides a public URL for the generated archive, making it easy to share.
* **Plugin Cleanup `clean plugins`:** A new subcommand to find and delete all inactive plugins. It works safely on both single-site and multisite installations, only removing plugins that are not active anywhere in a network.
* **⚡️ High-Speed Image Conversion `convert-to-webp`:** The image conversion utility has been massively overhauled for performance and flexibility.
* It now accepts an optional folder path to convert images outside the default `wp-content/uploads` directory.
* Performance is dramatically improved by processing multiple images in parallel.
* The script now provides clearer feedback by indicating which image detection method (`identify` or a PHP fallback) is being used.
* **Smarter Naming `dump`:** The output file from the `dump` command is now intelligently named based on the source directory (e.g., `my-plugin-dump.txt`) for better organization.
* **Robust Image Handling `convert-to-webp`:** The command is now more reliable, as it verifies that an image file exists before attempting to process it, preventing errors from broken file paths.
* **🏦 Secure Snapshot Vault `vault`:** A comprehensive suite of commands for managing secure, remote, full-site snapshots using Restic and Backblaze B2. Includes creating, listing, deleting, and browsing snapshots, as well as mounting the entire backup repository.
* **🔍 Advanced Diagnostics `find`:** Centralizes several diagnostic tools under a single powerful command.
* **🛠️ Advanced Dependency Sideloading:** `_do` can now automatically download and use tools like `restic`, `git`, and `imagemagick` in a private directory if they aren't installed system-wide. The ImageMagick setup cleverly extracts the `identify` binary from an AppImage to avoid system installation and FUSE issues.
* **Reliable WebP Detection:** The `convert-to-webp` command no longer requires a system-installed `identify` command. It now uses the automatically sideloaded ImageMagick binary and includes a PHP fallback to reliably check if an image is already a WebP file.
* **Command Organization:** Refactored several commands into logical groups for better usability (e.g., `reset-wp` is now `reset wp`, `slow-plugins` is now `find slow-plugins`).
* **Private Directory Discovery:** The script is now much smarter at finding a writable private directory, checking WP-CLI configs, WPEngine paths, and common parent structures (`../private`) before falling back to the home directory.
* **Public Dump URL:** The `dump` command now generates a public URL for the created text file if run within a WordPress site.
* **Cross-Platform PHP Tag Scanning `php-tags`:** Rewrote the command to use a more portable `grep` syntax, ensuring it works correctly on systems like macOS where the `-P` flag is not available by default.
* **💾 Checkpoint Management `checkpoint`:** A full suite to create, list, show, and revert WordPress installation checkpoints. Capture the state of your site's core, themes, and plugins and easily roll back changes.
* **🔄 Integrated Update Management `update`:** Streamlines the WordPress update process. `update all` automatically creates 'before' and 'after' checkpoints around the updates, logging all changes for easy review.
* **⏰ Cron Job Management `cron`:** Schedule any `_do` command to run at specific intervals. Includes commands to `enable`, `list`, `add`, `delete`, and `run` scheduled tasks.
* **🩺 WP-CLI Health Checker `wpcli`:** A new utility to diagnose issues with WP-CLI itself by identifying themes or plugins that cause warnings.
* **💥 Site Reset `reset-wp`:** A powerful command to reset a WordPress installation to its default state, reinstalling core and the latest default theme.
* **🧹 Advanced Cleaning `clean`:**
*`clean themes`: Deletes all inactive themes while preserving the latest default WordPress theme.
*`clean disk`: Launches an interactive disk usage analyzer to find and manage large files.
* **⚙️ Database Optimization `db optimize`:** A new command to convert tables to InnoDB, clean transients, and report the largest tables.
### ✨ Improvements
* **Command Structure:** Refactored commands for better organization. `backup-db` is now `db backup`, and `monitor` is now a subcommand with specific targets (`traffic`, `errors`, etc.).
* **🛠️ Automated Dependency Handling:** The script now automatically checks for, downloads, and installs missing dependencies like `gum`, `cwebp`, and `rclone` into a `~/private` directory.
* **🏗️ Development Workflow:** Added `compile.sh` and `watch.sh` scripts to streamline development by combining source files into a single distributable script automatically.
* **Flexible Migrations `migrate`:** Added an `--update-urls` flag to control URL replacement and improved temporary file handling.
* **File Exclusion `dump`:** The `dump` command was enhanced with an `-x` flag to exclude specific files or directories.
* **Migration File Handling:** The `migrate` function now handles cases where `wp-content` exists but contains no plugins or themes, preventing errors.
* **Dump Self-Exclusion:** The `dump` command now explicitly excludes its own output file to prevent it from being included in the dump.