Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to Sync Your Plugins with a Staging Server Using WP-CLI
* This script allows you to sync plugins from development machine with staging/live servers.
* Author: Svetoslav Marinov (SLAVI) |
* (c) All Rights Reserved.
* (c) Dec 2014
* License: LGPL
* zzz_sync.php
$pwd = 'qsandbox';
if (empty($_REQUEST['sync_pwd']) || $_REQUEST['sync_pwd'] != $pwd) {
echo "<pre>";
$plugin_urls = array(
'your-plugin-slug' => '',
foreach ($plugin_urls as $plugin_name => $dl_url) {
echo "Installing [<strong>$plugin_name</strong>] from: [$dl_url]\n";
$dl_url_esc = escapeshellarg($dl_url);
// This will delete the previous plugin!!!
$cmd = "wp plugin install --force $dl_url_esc --activate";
echo `$cmd 2>&1`;
echo "\n";
echo "</pre>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.