This project adheres to Semantic Versioning.
- Reworked from procedural scripts into PHP classes in the
WP_CLI_Syncnamespace, withcore/andtasks/replaced byincludes/.Commandregisterswp sync,Configreads the settings and detects the project layout,Syncruns the tasks and handles maintenance mode, andOutputandShellhandle the terminal and the commands - Each task is a class under
includes/tasks/:Connection_Check,Database_Sync,URL_Replace,Uploads_Sync,Plugins_SyncandPlugins_Management. The uploads and plugins syncs share aFolder_Syncbase instead of duplicating their rsync handling - Every SSH connection in a sync shares one, rather than each doing its own handshake. The connection is kept in
~/.sshand closed when the sync ends. If~/.sshdoesn't exist, each connection is made separately as before - The two connection checks are combined into one
- The database export is gzipped on the live server and decompressed as it streams in, sending around a fifth of the data. The result shows both sizes, e.g.
Imported 5.2 MB (1.0 MB transferred). If the live server has no gzip, or PHP has no zlib, the export is sent uncompressed as before - The site URL options and the four search-replace passes run in one WP-CLI process instead of six
- Classes are loaded by a small autoloader in
wp-cli-sync.php, so installs without composer keep working - Settings are read when
wp syncruns, rather than being copied into$_ENVwhen the plugin loads - With
DEV_TASK_DEBUGset, the connection checks and maintenance mode commands are shown along with the rest - The code follows the WordPress Coding Standards. Run
composer install && vendor/bin/phpcsto check, with the ruleset inphpcs.xml.dist, which also checks compatibility with PHP 7.4 and above - CI runs PHPCS on every push and pull request
- The plugin header is now a docblock. The release workflow and
install.shread the version from either header style, so updating an older install still reports its version
- The welcome banner is shown in the project's colour, falling back to cyan on terminals without true colour support, and includes the version number
- Pushing a tag publishes a GitHub release, with notes taken from its CHANGELOG.md entry
- Same code as 1.5.1. The tag was pushed on the wrong commit, and Packagist doesn't allow a published version to change
- Tidier output: each task gets a heading and a one-line result with its duration, and the sync ends with a total time
- rsync no longer lists every file. A single live progress line is shown instead, followed by a count and size of the files updated
- Database imports show live progress, and
pvis no longer used - The URL replacement reports how many replacements were made
- Output from WP-CLI and rsync is only shown when something goes wrong
- Colours and progress lines are skipped when the output isn't a terminal
wp syncnow exits with code 1 when a check or task fails, so scripts can detect it
--databaseand--mediaflags to sync just the database or just the uploads (and vanilla plugins) folder, plus--no-database/--no-mediato skip either. Media-only syncs skip maintenance mode (thanks @paintface)- Failed database exports, rsync transfers and remote WP-CLI checks are now reported as errors instead of finishing green (thanks @paintface)
- Post-sync queries are skipped when the database import fails (thanks @paintface)
- rsync paths and exclude patterns are shell-escaped (thanks @paintface)
- Backtick operators replaced with
shell_exec()for PHP 8.5 compatibility (thanks @paintface) - Added
wp-cli/entity-commandto the composer requires, fixing the site URL update on composer-managed installs (thanks @paintface)
- The plugins folder is now synced from the live server on vanilla projects, where composer isn't managing it
- Configurable plugins folder (
PLUGIN_DIR)
- Vanilla WordPress support alongside bedrock, with automatic layout detection
- Configurable local and remote WP-CLI binaries (
LOCAL_WP_CLI,REMOTE_WP_CLI) - Configurable project root (
LOCAL_PROJECT_LOCATION) UPLOAD_DIRnow defaults to the right path for the detected layout- Settings can be defined as
wp-config.phpconstants, so vanilla projects need no.envfile - Site URLs are rewritten after a sync via
LIVE_DOMAIN/DEV_DOMAIN, covering every http, https, www and non-www variant - Failed connection checks no longer leave the site in maintenance mode
- Maintanence mode commands to prevent the site being accessed during sync
- ENV Optimisations (merci @gmutschler)
- Custom uploads folder directory support (thanks @paintface)
- Composer stable stability + updated WP-CLI packages
- New folder structure ✨
- Added welcome and connection success messages
- Added hints to checks
- Added connection checks
- Improved
.envvariable checks - Added 'First Sync' instructions to README
- Fixed compatiblity with
oscarotero/env2.0
- Added
--single-transactionMySQL flag for non-blocking DB sync - Added support for rsync excluded directories
- Added support for post-sync database queries to update site settings and such
- Added debug option to show details of commands executed
- Restored local
wpcommand requirement due to incompatibilities with some terminal emulators.
- DB Sync directory change fix (#1)
- DB Sync now requires
bash
- Require Fixes
- Removed local
wpcommand requirement - Removed typo message
- Composer author details
- Started using Releases
- Initial Release