Releases: CaptainCore/do
Releases · CaptainCore/do
v1.4
Changelog
[1.4] - 2025-09-19
🚀 New Features
- 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: Thedisembarkcommand now includes a--debugflag to run the browser automation in a visible (headed) mode, making it easy to troubleshoot login or installation issues.
✨ Improvements
- Selective Backups
backup --exclude: Thebackupcommand 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--quietflag to thebackupcommand to suppress all informational output and print only the final backup URL, perfect for scripting and automation. - Contextual Performance Testing
find slow-plugins: Thefind slow-pluginscommand 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.
v1.3
[1.3] - 2025-08-16
Added
- New
zipCommand: A utility to create a zip archive of any specified folder. If the command is run within a WordPress installation, it also provides a public URL for the generated archive, making it easy to share. - New
clean pluginsSubcommand: This new subcommand finds and deletes all inactive plugins. It is designed to work safely on both single-site and multisite WordPress installations, ensuring it only removes plugins that are not active on any site in a network.
Changed
convert-to-webpCommand Overhaul: The image conversion utility has been significantly enhanced:- It now accepts an optional folder path, allowing users to convert images in directories other than the default
wp-content/uploads. - Performance has been dramatically improved by processing multiple images in parallel, significantly reducing the time required for large batches of images.
- The script now provides clearer feedback to the user by indicating which image detection method (
identifyor a PHP fallback) is being used.
- It now accepts an optional folder path, allowing users to convert images in directories other than the default
dumpCommand Naming: The output file from thedumpcommand is now more intelligently named based on the source directory (e.g.,my-plugin.txt), rather than a generic filename.
Fixed
- Image Conversion Reliability: The
convert-to-webpcommand is now more robust. It verifies that an image file exists before attempting to process it, which prevents potential errors when encountering broken file paths.
v1.2
[1.2] - 2025-07-10
Added
- New
vaultCommand Suite: A comprehensive set of commands for managing secure, remote, full-site snapshots using Restic and Backblaze B2. This includes creating, listing, deleting, and Browse snapshots, as well as mounting the entire backup repository. - New
findCommand Suite: Centralizes several diagnostic tools under a single command:find recent-files: Finds files modified within a specified number of days.find slow-plugins: Relocated from a top-level command to identify plugins that may be slowing down WP-CLI.find hidden-plugins: Detects active plugins that may be hidden from the standard list.find malware: Scans for suspicious code patterns and verifies core and plugin file integrity.find php-tags: Scans for outdated PHP short tags.
- New
installCommand Suite: Simplifies the installation of helper and premium plugins:install kinsta-mu: Installs the Kinsta Must-Use plugin.install helper: Installs the CaptainCore Helper plugin.install events-calendar-pro: Installs The Events Calendar Pro after prompting for a license.
- New Standalone Commands:
httpsApplies HTTPS to all site URLs with an interactive prompt for 'www' preference.launch: A dedicated command to launch a site, updating the URL from a development to a live domain.upgrade: Allows the_doscript to upgrade itself to the latest version.email: Provides an interactive prompt to send an email usingwp_mailvia WP-CLI.
- New
dbSubcommand:db change-prefix: Safely changes the database table prefix after creating a backup.
- Advanced Dependency Sideloading:
- Introduced new
setup_restic,setup_imagemagick, andsetup_gitfunctions to automatically download and use these tools in a private directory if they are not installed system-wide. - The ImageMagick setup cleverly extracts the
identifybinary from an AppImage to avoid system-level installation and FUSE issues.
- Introduced new
- New Flags:
--allforconvert-to-webpto convert all images regardless of their file size.--domainforlaunchto specify the new domain non-interactively.--forceforinstall kinsta-muto bypass the Kinsta environment check.--outputforvault snapshotsto provide a non-interactive list.
Changed
- Command Refactoring:
- The
reset-wpcommand has been moved toreset wp. It now features a more user-friendly interactive selector for choosing the admin user, rather than requiring a command-line flag. - The
reset-permissionscommand has been moved toreset permissions. - The
slow-pluginscommand has been moved tofind slow-plugins.
- The
- Dependency Management Overhaul: The
setup_*functions (e.g.,setup_gum,setup_cwebp,setup_rclone) have been completely rewritten. They are now more robust, checking for existing local binaries, usingcurlfor downloads, and intelligently finding the executable within archives before extraction. - Private Directory Discovery: The
_get_private_dirhelper function is now significantly more intelligent. It checks WP-CLI configurations, WPEngine-specific paths, and common parent directory structures (../private,../tmp) before falling back to the user's home directory. - WebP Conversion: The
convert-to-webpcommand no longer relies on a system-installedidentifycommand. It now uses the sideloaded ImageMagick binary and includes a PHP-based fallback (_is_webp_php) to check if a file is already in WebP format. - Dump Command URL: The
dumpcommand will now generate and display a public URL for the created text file if the script is run within a WordPress installation. - Database Autoload Check: The query in
db check-autoloadwas updated to check forautoload IN ('yes', 'on')to be compatible with more database configurations.
Fixed
- PHP Tag Scanning Portability: The
php-tagscommand was rewritten to use a more portablegrepsyntax, removing the dependency on the-P(Perl-compatible regex) flag. This ensures the command works correctly on systems like macOS where this flag is not available by default.
v1.1
[1.1] - 2025-06-21
Features
- Checkpoint Management (
checkpoint): A comprehensive suite of commands has been added to create, list, show, and revert WordPress installation checkpoints. This feature allows users to capture the state of their site's core, themes, and plugins and revert to a previous state if needed.checkpoint create: Creates a new checkpoint.checkpoint list: Interactively lists all available checkpoints for inspection.checkpoint list-generate: Generates a detailed, cached list of checkpoints for faster access.checkpoint revert [<hash>]: Reverts the site's files to a specified checkpoint.checkpoint show <hash>: Shows the changes within a specific checkpoint, including file and manifest diffs.checkpoint latest: Displays the hash of the most recent checkpoint.
- Update Management (
update): This new command set streamlines the WordPress update process by integrating with the checkpoint system.update all: Automatically creates a 'before' checkpoint, runs all core, plugin, and theme updates, creates an 'after' checkpoint, and logs the changes.update list: Shows a list of past update events, allowing users to inspect the changes between the 'before' and 'after' states.update list-generate: Generates a detailed, cached list of all update events.
- Cron Job Management (
cron): Enables the scheduling of_docommands.cron enable: Configures a system cron job to run scheduled_dotasks.cron list: Lists all scheduled commands.cron add: Adds a new command to the schedule with a specified start time and frequency.cron delete: Removes a scheduled command by its ID.cron run: Executes any due commands.
- WP-CLI Health Checker (
wpcli): A new utility to diagnose issues with WP-CLI itself.wpcli check: Helps identify themes or plugins that are causing warnings or errors in WP-CLI.
- Site Reset (
reset-wp): A command to reset a WordPress installation to its default state. It reinstalls the latest WordPress core, removes all plugins and themes, and installs the latest default theme. - PHP Tag Checker (
php-tags): Scans a directory for outdated PHP short tags (<?) that can cause issues on modern servers. - Inactive Theme Cleaner (
clean themes): Deletes all inactive themes, but intelligently preserves the latest default WordPress theme as a fallback. - Interactive Disk Cleaner (
clean disk): Launches an interactive disk usage analyzer to help find and manage large files and directories. - Database Optimization (
db optimize): A new command to optimize the WordPress database by converting tables to InnoDB, cleaning transients, and reporting the largest tables.
Improvements
- Command Structure & Aliases: The script has been refactored for better organization. Commands like
backup-dbanddb-check-autoloadare now subcommands under thedbcommand (db backup,db check-autoload). - Dependency Management:
- The script now automatically checks for, downloads, and installs missing dependencies like
gum,cwebp, andrcloneinto a~/privatedirectory to avoid system-wide installations. gitis now a required dependency for the newcheckpointandupdatefeatures.
- The script now automatically checks for, downloads, and installs missing dependencies like
- Compilation and Development:
compile.sh: A new compilation script is introduced to combine the main script and individual command files from thecommandsdirectory into a single distributable file (_do.sh).watch.sh: A watcher script has been added to automatically re-compile the script when changes are detected in the source files, streamlining development.
- Monitor Command: The
monitorcommand is now a subcommand with more specific targets:traffic,errors,access.log, anderror.log. - Suspend Command: The
suspendcommand now uses a more specific filename (do-suspend.php) for the mu-plugin to avoid conflicts. - Migration (
migrate):- The
migratecommand now has a--update-urlsflag to control whether the site's URL should be updated after import. - It now intelligently finds a private directory for storing temporary files.
- The
- File Dumper (
dump): Thedumpcommand has been enhanced with an-xflag to allow for the exclusion of specific files or directories from the dump.
Fixes
- Migration File Handling: The
migrate_sitefunction was updated to handle cases wherewp-contentexists in the backup but contains no plugins or themes to move, preventing potential errors. - Dump Command Self-Exclusion: The
run_dumpfunction now explicitly excludes its own output file from the list of files to be dumped, preventing it from including itself in the generated text file.
v1.0
🎉 CaptainCore Do v1.0 Release Notes
This marks the initial public release of CaptainCore Do, a powerful and lightweight command-line toolkit designed to streamline common tasks for WordPress developers and server administrators.
✨ New Features & Commands
This first version is packed with a suite of commands to handle everything from backups to performance tuning.
- backup: Creates a full backup of a WordPress site, including the database and all files, into a single .zip archive. The backup is placed in the site's root and includes the URL for easy download.
- backup-db: Performs a database-only backup, storing the .sql file in a secure, private directory (_wpeprivate, ../private, or ../tmp).
- convert-to-webp: Finds and converts images larger than 1MB in the wp-content/uploads directory to the modern WebP format.
- db-check-autoload: Checks the total size of all autoloaded options in the database and lists the top 25 largest options to help diagnose performance issues.
- dump: Dumps the contents of files matching a specific pattern into a single .txt file for easy review and analysis.
- migrate: Automates site migrations from a backup URL or local file, including file migration, database import, and URL replacement. It intelligently handles special BackupBuddy and Dropbox URLs.
- monitor: Provides real-time server access log monitoring, displaying top IP addresses and status codes in a clean, readable table format.
- reset-permissions: Resets file and folder permissions to standard web server defaults (755 for directories, 644 for files).
- slow-plugins: Helps identify plugins that may be slowing down WP-CLI by measuring command execution time with and without each active plugin.
- suspend: Activates or deactivates a "Website Suspended" page for site visitors by adding or removing a must-use plugin.
- version: Displays the current script version, which is v1.0.
🛠️ Dependencies & Setup
- Automatic Dependency Installation: The script includes helper functions to automatically download and install gum (for glamorous shell scripts) and cwebp to a ~/private directory if they are not already installed.
- Prerequisites: For full functionality, the script relies on several common command-line utilities: wp-cli, wget, zip/unzip, tar, rsync, identify (from ImageMagick), and mysqldump or mariadb-dump.
🚀 Development & Installation
- A
compile.shscript is included to combine the main script and all command functions into a single distributable file (captaincore-do.sh). - For easier development, a
watch.shscript usesfswatchto automatically recompile the script when source files are changed. - Users can run the script without a permanent installation by using a temporary alias, making it easy to use on any server.