From 5ca0573b4983122594fb4b6eba2e113d96efd513 Mon Sep 17 00:00:00 2001
From: Marcello Cerruti <2autunni@users.noreply.github.com>
Date: Thu, 22 Oct 2015 20:11:42 +0200
Subject: [PATCH 01/19] error in help

--phpRedisAdmin is for phpRedisAdmin
---
 ee/cli/plugins/stack.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py
index 64da1941..8a2b0198 100644
--- a/ee/cli/plugins/stack.py
+++ b/ee/cli/plugins/stack.py
@@ -77,7 +77,7 @@ class EEStackController(CementBaseController):
             (['--redis'],
                 dict(help='Install Redis', action='store_true')),
             (['--phpredisadmin'],
-                dict(help='Install Redis', action='store_true')),
+                dict(help='Install phpRedisAdmin', action='store_true')),
             ]
         usage = "ee stack (command) [options]"
 

From 8823af867975e2f0cc5e8f259cf2fafd048f8cfa Mon Sep 17 00:00:00 2001
From: harshadyeola <harshad.yeola@rtcamp.com>
Date: Mon, 2 Nov 2015 11:24:59 +0530
Subject: [PATCH 02/19] correted EE-Admin Port Number

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 711a23fd..630a26c5 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ EasyEngine (ee) is a python tool, which makes it easy to manage your wordpress s
 |SSH    |22           | ✓       |✓          |
 |HTTP    |80           | ✓       |✓          |
 |HTTPS/SSL    |443           | ✓       |✓          |
-|EE Admin    |2222           | ✓       |          |
+|EE Admin    |22222           | ✓       |          |
 |GPG Key Server    |11371           |        |✓          |
 
 ## Quick Start

From 4ea46a928b7b2d97a1cda94ec448bb0017a000ca Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Mon, 2 Nov 2015 15:02:58 +0530
Subject: [PATCH 03/19] Fix #637

---
 ee/cli/plugins/site_functions.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py
index 2e6a65d3..1186444b 100644
--- a/ee/cli/plugins/site_functions.py
+++ b/ee/cli/plugins/site_functions.py
@@ -618,9 +618,14 @@ def sitebackup(self, data):
                          .format(data['site_name']), backup_path)
 
     if data['currsitetype'] in ['html', 'php', 'proxy', 'mysql']:
-        Log.info(self, "Backing up Webroot \t\t", end='')
-        EEFileUtils.mvfile(self, ee_site_webroot + '/htdocs', backup_path)
-        Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
+        if data['pagespeed'] is True:
+            Log.info(self, "Backing up Webroot \t\t", end='')
+            EEFileUtils.copyfile(self, ee_site_webroot + '/htdocs', backup_path)
+            Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
+        else:
+            Log.info(self, "Backing up Webroot \t\t", end='')
+            EEFileUtils.mvfile(self, ee_site_webroot + '/htdocs', backup_path)
+            Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
 
     configfiles = glob.glob(ee_site_webroot + '/*-config.php')
     if not configfiles:

From 3597223bf7f6e66b1daab1fc2a34d9770c249af6 Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Mon, 2 Nov 2015 15:16:31 +0530
Subject: [PATCH 04/19] Fix #637

---
 ee/cli/plugins/site_functions.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py
index 1186444b..bd6e500a 100644
--- a/ee/cli/plugins/site_functions.py
+++ b/ee/cli/plugins/site_functions.py
@@ -658,7 +658,10 @@ def sitebackup(self, data):
         Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
         # move wp-config.php/ee-config.php to backup
         if data['currsitetype'] in ['mysql', 'proxy']:
-            EEFileUtils.mvfile(self, configfiles[0], backup_path)
+            if data['pagespeed'] is True:
+                EEFileUtils.copyfile(self, configfiles[0], backup_path)
+            else:
+                EEFileUtils.mvfile(self, configfiles[0], backup_path)
         else:
             EEFileUtils.copyfile(self, configfiles[0], backup_path)
 

From b5f9f0539a79eaa0ffa8bcc648f2418bee5c13a5 Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Mon, 2 Nov 2015 16:04:23 +0530
Subject: [PATCH 05/19] Fix exception error logging

---
 ee/core/fileutils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ee/core/fileutils.py b/ee/core/fileutils.py
index 496e1672..8a4f5d83 100644
--- a/ee/core/fileutils.py
+++ b/ee/core/fileutils.py
@@ -77,7 +77,7 @@ class EEFileUtils():
             Log.error(self, 'Unable to copy file from {0} to {1}'
                       .format(src, dest))
         except IOError as e:
-            Log.debug(self, "{e}".format(e.strerror))
+            Log.debug(self, "{0}".format(e.strerror))
             Log.error(self, "Unable to copy file from {0} to {1}"
                       .format(src, dest))
 

From c7843df04e6f07e6293bfc7460ddd7fbe2bc701e Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Mon, 2 Nov 2015 16:18:50 +0530
Subject: [PATCH 06/19] recursively copy files function implemented

---
 ee/core/fileutils.py | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/ee/core/fileutils.py b/ee/core/fileutils.py
index 8a4f5d83..b5369050 100644
--- a/ee/core/fileutils.py
+++ b/ee/core/fileutils.py
@@ -62,11 +62,34 @@ class EEFileUtils():
             Log.debug(self, "{0}".format(e))
             Log.error(self, "Unable to reomove symbolic link ...\n")
 
-    def copyfile(self, src, dest):
+    def copyfiles(self, src, dest):
         """
         Copies files:
             src : source path
             dest : destination path
+
+            Recursively copy an entire directory tree rooted at src.
+            The destination directory, named by dst, must not already exist;
+            it will be created as well as missing parent directories.
+        """
+        try:
+            Log.debug(self, "Copying files, Source:{0}, Dest:{1}"
+                      .format(src, dest))
+            shutil.copytree(src, dest)
+        except shutil.Error as e:
+            Log.debug(self, "{0}".format(e))
+            Log.error(self, 'Unable to copy files from {0} to {1}'
+                      .format(src, dest))
+        except IOError as e:
+            Log.debug(self, "{0}".format(e.strerror))
+            Log.error(self, "Unable to copy files from {0} to {1}"
+                      .format(src, dest))
+
+    def copyfile(self, src, dest):
+        """
+        Copy file:
+            src : source path
+            dest : destination path
         """
         try:
             Log.debug(self, "Copying file, Source:{0}, Dest:{1}"

From 67f5ef69be250637e826981105195d7cbbf17d19 Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Mon, 2 Nov 2015 16:21:42 +0530
Subject: [PATCH 07/19] recursively copies htdocs

---
 ee/cli/plugins/site_functions.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py
index bd6e500a..cd494b70 100644
--- a/ee/cli/plugins/site_functions.py
+++ b/ee/cli/plugins/site_functions.py
@@ -620,7 +620,7 @@ def sitebackup(self, data):
     if data['currsitetype'] in ['html', 'php', 'proxy', 'mysql']:
         if data['pagespeed'] is True:
             Log.info(self, "Backing up Webroot \t\t", end='')
-            EEFileUtils.copyfile(self, ee_site_webroot + '/htdocs', backup_path)
+            EEFileUtils.copyfiles(self, ee_site_webroot + '/htdocs', backup_path)
             Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
         else:
             Log.info(self, "Backing up Webroot \t\t", end='')

From ccbe4253987e1f2a4c02b54ff1ef7272ba7423fe Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Mon, 2 Nov 2015 17:01:05 +0530
Subject: [PATCH 08/19] Fix directory structure

---
 ee/cli/plugins/site_functions.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py
index cd494b70..5a8f6f99 100644
--- a/ee/cli/plugins/site_functions.py
+++ b/ee/cli/plugins/site_functions.py
@@ -620,7 +620,7 @@ def sitebackup(self, data):
     if data['currsitetype'] in ['html', 'php', 'proxy', 'mysql']:
         if data['pagespeed'] is True:
             Log.info(self, "Backing up Webroot \t\t", end='')
-            EEFileUtils.copyfiles(self, ee_site_webroot + '/htdocs', backup_path)
+            EEFileUtils.copyfiles(self, ee_site_webroot + '/htdocs', backup_path + '/htdocs')
             Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
         else:
             Log.info(self, "Backing up Webroot \t\t", end='')

From 28101725dfd58d1eec1c267d13a37adff6a7aa93 Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Mon, 2 Nov 2015 17:01:53 +0530
Subject: [PATCH 09/19] fix typo

---
 ee/cli/plugins/site_functions.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py
index 5a8f6f99..131f2364 100644
--- a/ee/cli/plugins/site_functions.py
+++ b/ee/cli/plugins/site_functions.py
@@ -605,7 +605,7 @@ def setwebrootpermissions(self, webroot):
                           EEVariables.ee_php_user, recursive=True)
     except Exception as e:
         Log.debug(self, str(e))
-        raise SiteError("problem occured while settingup webroot permissions")
+        raise SiteError("problem occured while setting up webroot permissions")
 
 
 def sitebackup(self, data):

From 54c04c68d3fb214d348b01b060f171b0073bee91 Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Mon, 2 Nov 2015 17:15:29 +0530
Subject: [PATCH 10/19] --wp exception for Fix #637

---
 ee/cli/plugins/site_functions.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py
index 131f2364..5061344f 100644
--- a/ee/cli/plugins/site_functions.py
+++ b/ee/cli/plugins/site_functions.py
@@ -618,7 +618,7 @@ def sitebackup(self, data):
                          .format(data['site_name']), backup_path)
 
     if data['currsitetype'] in ['html', 'php', 'proxy', 'mysql']:
-        if data['pagespeed'] is True:
+        if data['pagespeed'] is True and not data['wp']:
             Log.info(self, "Backing up Webroot \t\t", end='')
             EEFileUtils.copyfiles(self, ee_site_webroot + '/htdocs', backup_path + '/htdocs')
             Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
@@ -658,7 +658,7 @@ def sitebackup(self, data):
         Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
         # move wp-config.php/ee-config.php to backup
         if data['currsitetype'] in ['mysql', 'proxy']:
-            if data['pagespeed'] is True:
+            if data['pagespeed'] is True and not data['wp']:
                 EEFileUtils.copyfile(self, configfiles[0], backup_path)
             else:
                 EEFileUtils.mvfile(self, configfiles[0], backup_path)

From 78d8463c35bbf2d7726573f26b1a06ee51bc2b1a Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Mon, 2 Nov 2015 17:16:41 +0530
Subject: [PATCH 11/19] Updated wp-cli version

---
 ee/core/variables.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ee/core/variables.py b/ee/core/variables.py
index 8ffa4c41..6e146a20 100644
--- a/ee/core/variables.py
+++ b/ee/core/variables.py
@@ -16,7 +16,7 @@ class EEVariables():
 
 
     # EasyEngine packages versions
-    ee_wp_cli = "0.20.2"
+    ee_wp_cli = "0.20.3"
     ee_adminer = "4.2.1"
     ee_roundcube = "1.1.3"
     ee_vimbadmin = "3.0.12"

From ee2b3a405ece2a47b63edf7da19941342063e01f Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Mon, 2 Nov 2015 17:19:41 +0530
Subject: [PATCH 12/19] Updated version

---
 ee/core/variables.py | 2 +-
 install              | 2 +-
 setup.py             | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ee/core/variables.py b/ee/core/variables.py
index 6e146a20..9fc00085 100644
--- a/ee/core/variables.py
+++ b/ee/core/variables.py
@@ -12,7 +12,7 @@ class EEVariables():
     """Intialization of core variables"""
 
     # EasyEngine version
-    ee_version = "3.3.11"
+    ee_version = "3.3.12"
 
 
     # EasyEngine packages versions
diff --git a/install b/install
index 9ea5aa54..1def9d51 100644
--- a/install
+++ b/install
@@ -48,7 +48,7 @@ fi
 # Define variables for later use
 ee_branch=$1
 readonly ee_version_old="2.2.3"
-readonly ee_version_new="3.3.11"
+readonly ee_version_new="3.3.12"
 readonly ee_log_dir=/var/log/ee/
 readonly ee_install_log=/var/log/ee/install.log
 readonly ee_linux_distro=$(lsb_release -i | awk '{print $3}')
diff --git a/setup.py b/setup.py
index 932a94b7..ab5ac2cd 100644
--- a/setup.py
+++ b/setup.py
@@ -54,7 +54,7 @@ except Exception as e:
     os.system("git config --global user.email {0}".format(ee_email))
 
 setup(name='ee',
-      version='3.3.11',
+      version='3.3.12',
       description=long_description,
       long_description=long_description,
       classifiers=[],

From 84f3b0a8a8cdfcfb97bcba5972716a32cd704fc0 Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Mon, 2 Nov 2015 17:56:34 +0530
Subject: [PATCH 13/19] Update CHANGELOG.txt

---
 CHANGELOG.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index f7d03a31..fa07c123 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,3 +1,7 @@
+v 3.3.12 - Nov 2, 2015
+- Fix #637
+- Updated wp-cli version
+
 v 3.3.11 - Oct 26, 2015
 - Updated MySql version
 - Added new repository for MySql

From 92a0b587d99c0248e97a37307a90050360c85dd5 Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Mon, 2 Nov 2015 18:44:23 +0530
Subject: [PATCH 14/19] Fix for disable pagespeed

---
 ee/cli/plugins/site.py           | 6 ++++++
 ee/cli/plugins/site_functions.py | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py
index 78ae6e77..b7e8d6c3 100644
--- a/ee/cli/plugins/site.py
+++ b/ee/cli/plugins/site.py
@@ -855,6 +855,12 @@ class EESiteUpdateController(CementBaseController):
             old_hhvm = check_site.is_hhvm
             old_pagespeed = check_site.is_pagespeed
 
+        if pagespeed is old_pagespeed:
+            if pagespeed is False:
+                data['old_pagespeed'] = False
+            elif pagespeed is True:
+                data['old_pagespeed'] = True
+
         if (pargs.password and not (pargs.html or
             pargs.php or pargs.mysql or pargs.wp or
             pargs.w3tc or pargs.wpfc or pargs.wpsc
diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py
index 5061344f..d86ff5c0 100644
--- a/ee/cli/plugins/site_functions.py
+++ b/ee/cli/plugins/site_functions.py
@@ -618,7 +618,7 @@ def sitebackup(self, data):
                          .format(data['site_name']), backup_path)
 
     if data['currsitetype'] in ['html', 'php', 'proxy', 'mysql']:
-        if data['pagespeed'] is True and not data['wp']:
+        if data['pagespeed'] is True or data['old_pagespeed'] is True and not data['wp']:
             Log.info(self, "Backing up Webroot \t\t", end='')
             EEFileUtils.copyfiles(self, ee_site_webroot + '/htdocs', backup_path + '/htdocs')
             Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
@@ -658,7 +658,7 @@ def sitebackup(self, data):
         Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
         # move wp-config.php/ee-config.php to backup
         if data['currsitetype'] in ['mysql', 'proxy']:
-            if data['pagespeed'] is True and not data['wp']:
+            if data['pagespeed'] is True or data['old_pagespeed'] is True and not data['wp']:
                 EEFileUtils.copyfile(self, configfiles[0], backup_path)
             else:
                 EEFileUtils.mvfile(self, configfiles[0], backup_path)

From f567686a8246fd20ead85a6a75b5adfa350e1f49 Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Tue, 3 Nov 2015 13:10:33 +0530
Subject: [PATCH 15/19] Fix pagespeed backup restore

---
 ee/cli/plugins/site.py           | 8 ++------
 ee/cli/plugins/site_functions.py | 2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py
index b7e8d6c3..da58e6c0 100644
--- a/ee/cli/plugins/site.py
+++ b/ee/cli/plugins/site.py
@@ -855,12 +855,6 @@ class EESiteUpdateController(CementBaseController):
             old_hhvm = check_site.is_hhvm
             old_pagespeed = check_site.is_pagespeed
 
-        if pagespeed is old_pagespeed:
-            if pagespeed is False:
-                data['old_pagespeed'] = False
-            elif pagespeed is True:
-                data['old_pagespeed'] = True
-
         if (pargs.password and not (pargs.html or
             pargs.php or pargs.mysql or pargs.wp or
             pargs.w3tc or pargs.wpfc or pargs.wpsc
@@ -1126,6 +1120,8 @@ class EESiteUpdateController(CementBaseController):
             Log.debug(self, str(e))
             Log.error(self, "NGINX configuration check failed.")
 
+        data['old_pagespeed_status'] = check_site.is_pagespeed
+
         try:
             sitebackup(self, data)
         except Exception as e:
diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py
index d86ff5c0..a14729ad 100644
--- a/ee/cli/plugins/site_functions.py
+++ b/ee/cli/plugins/site_functions.py
@@ -618,7 +618,7 @@ def sitebackup(self, data):
                          .format(data['site_name']), backup_path)
 
     if data['currsitetype'] in ['html', 'php', 'proxy', 'mysql']:
-        if data['pagespeed'] is True or data['old_pagespeed'] is True and not data['wp']:
+        if data['pagespeed'] is True or data['old_pagespeed_status'] is True and not data['wp']:
             Log.info(self, "Backing up Webroot \t\t", end='')
             EEFileUtils.copyfiles(self, ee_site_webroot + '/htdocs', backup_path + '/htdocs')
             Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")

From b2bbc253dd333935d7f62615abff6a5799520640 Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Tue, 3 Nov 2015 13:12:11 +0530
Subject: [PATCH 16/19] Corrected typo

---
 ee/cli/plugins/site.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py
index da58e6c0..45c8709c 100644
--- a/ee/cli/plugins/site.py
+++ b/ee/cli/plugins/site.py
@@ -1013,7 +1013,7 @@ class EESiteUpdateController(CementBaseController):
                     Log.info(self, "Pagespeed is already disabled for given "
                              "site")
                 elif pagespeed is True:
-                    Log.info(self, "Pagespeed is allready enabled for given "
+                    Log.info(self, "Pagespeed is already enabled for given "
                              "site")
                 pargs.pagespeed = False
 

From 44e0767ae2e3d80f38059e01d463b417294cab05 Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Tue, 3 Nov 2015 13:54:21 +0530
Subject: [PATCH 17/19] Updated CHANGELOG

---
 CHANGELOG.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index fa07c123..018ce4d3 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,4 +1,4 @@
-v 3.3.12 - Nov 2, 2015
+v 3.3.12 - Nov 3, 2015
 - Fix #637
 - Updated wp-cli version
 

From bb6bad0bb00542844fd6667acb2ab04b6b49a9f8 Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Tue, 3 Nov 2015 13:55:20 +0530
Subject: [PATCH 18/19] fix err 'old_pagespeed'

---
 ee/cli/plugins/site_functions.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py
index a14729ad..5abcd63b 100644
--- a/ee/cli/plugins/site_functions.py
+++ b/ee/cli/plugins/site_functions.py
@@ -658,7 +658,7 @@ def sitebackup(self, data):
         Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
         # move wp-config.php/ee-config.php to backup
         if data['currsitetype'] in ['mysql', 'proxy']:
-            if data['pagespeed'] is True or data['old_pagespeed'] is True and not data['wp']:
+            if data['pagespeed'] is True or data['old_pagespeed_status'] is True and not data['wp']:
                 EEFileUtils.copyfile(self, configfiles[0], backup_path)
             else:
                 EEFileUtils.mvfile(self, configfiles[0], backup_path)

From 90a84e3d325bf37978eb7c4d829072fc6a60380a Mon Sep 17 00:00:00 2001
From: Prabuddha Chakraborty <prabuddha.chakraborty@rtcamp.com>
Date: Tue, 3 Nov 2015 14:37:19 +0530
Subject: [PATCH 19/19] refactor if statement

---
 ee/cli/plugins/site_functions.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py
index 5abcd63b..8ce33970 100644
--- a/ee/cli/plugins/site_functions.py
+++ b/ee/cli/plugins/site_functions.py
@@ -618,7 +618,7 @@ def sitebackup(self, data):
                          .format(data['site_name']), backup_path)
 
     if data['currsitetype'] in ['html', 'php', 'proxy', 'mysql']:
-        if data['pagespeed'] is True or data['old_pagespeed_status'] is True and not data['wp']:
+        if (data['pagespeed'] is True or data['old_pagespeed_status'] is True) and not data['wp']:
             Log.info(self, "Backing up Webroot \t\t", end='')
             EEFileUtils.copyfiles(self, ee_site_webroot + '/htdocs', backup_path + '/htdocs')
             Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
@@ -658,7 +658,7 @@ def sitebackup(self, data):
         Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]")
         # move wp-config.php/ee-config.php to backup
         if data['currsitetype'] in ['mysql', 'proxy']:
-            if data['pagespeed'] is True or data['old_pagespeed_status'] is True and not data['wp']:
+            if (data['pagespeed'] is True or data['old_pagespeed_status'] is True) and not data['wp']:
                 EEFileUtils.copyfile(self, configfiles[0], backup_path)
             else:
                 EEFileUtils.mvfile(self, configfiles[0], backup_path)
