WordPress Backup and Migrate Plugin – Backup Guard - Version 1.5.2

Version Description

  • Added new option ' Upload to cloud chunk size '
  • Bug fixed related to backup import issue
  • Bug fixed related to button disabled issue
Download this release

Release Info

Developer BackupGuard
Plugin Icon 128x128 WordPress Backup and Migrate Plugin – Backup Guard
Version 1.5.2
Comparing to
See all releases

Code changes from version 1.5.1.1 to 1.5.2

BackupGuard.php CHANGED
@@ -909,12 +909,6 @@ function backupGuardloadTextDomain()
909
 
910
  if (backupGuardShouldShowDiscountNotice() && checkDueDateDiscount()) {
911
  add_action('admin_notices', 'backup_guard_discount_notice');
912
- add_action('admin_enqueue_scripts', 'sgBlackFridayCSS');
913
- }
914
-
915
- function sgBlackFridayCSS($hook)
916
- {
917
- wp_enqueue_style('backup-guard-less', plugin_dir_url(__FILE__).'public/css/bgstyle.less.css');
918
  }
919
 
920
  function backup_guard_discount_notice()
@@ -922,275 +916,148 @@ function backup_guard_discount_notice()
922
  $capabilities = backupGuardGetCapabilities();
923
  $upgradeUrl = BG_UPGRADE_URL;
924
  ?>
925
- <div style="visibility: hidden;height: 0;">
926
- <div id="sg-black-friday-popup-content-wrapper">
927
- <div class="sgbg-black-friday-close-popup"></div>
928
- <div class="sg-black-friday-text-image"></div>
929
- <p class="sg-black-friday-p">Don’t miss your chance, get <b>50%</b>off!</p>
930
- <div class="sg-black-friday-btn-wrapper">
931
- <a href="<?php echo BG_UPGRADE_URL; ?>" target="_blank">
932
- <button class="sg-black-friday-button">Click Here</button>
933
- </a>
934
- </div>
935
- </div>
936
- </div>
937
- <div class="sg-wrapper-less">
938
- <div class="backup-guard-discount-notice updated notice is-dismissible sg-wrapper-less">
939
- <div class="col-lg-3 col-md-4 col-sm-4">
940
- <a href="<?php echo BG_UPGRADE_URL; ?>" target="_blank">
941
- <div class="sg-black-friday-logo"></div>
942
- </a>
943
- </div>
944
- <div class="col-lg-3 col-md-4 col-sm-4">
945
- <div class="sg-black-friday-text-image"></div>
946
- </div>
947
- <div class="col-lg-3 col-md-4 col-sm-4">
948
- <div class="sg-black-friday-txt">
949
- <p>Don’t miss your chance, get</p>
950
- <div class="sg-black-friday-percent"><p>50% OFF!</p></div>
951
- <a href="<?php echo BG_UPGRADE_URL; ?>" target="_blank">
952
- <button class="sg-black-friday-button">Click Here</button>
953
- </a>
954
- </div>
955
- </div>
956
- <div class="col-lg-3 col-md-0"></div>
957
- <!-- <a href="--><?php //echo SG_BACKUP_SITE_PRICING_URL; ?><!--" target="_blank">-->
958
- <!-- <div class="sgbg-banner-content">-->
959
- <!-- </div>-->
960
- <!-- </a>-->
961
- <!-- <div class="sgbg-col sgbg-col1"></div>-->
962
- <!-- <div class="sgbg-col sgbg-col2"></div>-->
963
- <!-- <div class="sgbg-col sgbg-col3">-->
964
- <!-- <div class="sgbg-text-col-1">-->
965
- <!-- -50%-->
966
- <!-- </div>-->
967
- <!-- <div class="sgbg-text-col-2">-->
968
- <!-- <div class="sgbg-discount-text-1">Discount</div>-->
969
- <!-- <div class="sgbg-discount-text-2">All Backup Guard Solutions</div>-->
970
- <!-- </div>-->
971
- <!-- </div>-->
972
- <!-- <div class="sgbg-col sgbg-col4">-->
973
- <!-- <a href="https://backup-guard.com/products/backup-wordpress" target="_blank"><button class="sgbg-button">Click Here</button></a>-->
974
- <!-- </div>-->
975
- </div>
976
- </div>
977
- <style>
978
- .sg-black-friday-txt {
979
- color: #0095FE;
980
- font-size: 25px;
981
- margin-top: 10px;
982
- }
983
- .sg-black-friday-button {
984
- width: 167px;
985
- height: 37px;
986
- background-color: #0095FE;
987
- border-radius: 12px;
988
- border: 2px solid #0095FE;
989
- color: #070D2D !important;
990
- font-size: 17px !important;
991
- cursor: pointer;
992
- }
993
- .sg-black-friday-button:focus {
994
- border: 2px solid #0095FE !important;
995
- outline: none;
996
- }
997
- .sg-black-friday-button:hover {
998
- color: rgba(0, 149, 254, 1) !important;
999
- background-color: rgba(7, 13, 45, 1);
1000
- }
1001
- .sg-black-friday-logo {
1002
- height: 125px;
1003
- background-image: url("<?php echo SG_IMAGE_URL ?>blackFridayLogo.png");
1004
- background-size: contain;
1005
- background-repeat: no-repeat;
1006
- background-position: center;
1007
- margin-top: 11px;
1008
- }
1009
- .sg-black-friday-text-image {
1010
- height: 145px;
1011
- background-image: url("<?php echo SG_IMAGE_URL ?>blackFridayText.png");
1012
- background-size: contain;
1013
- background-repeat: no-repeat;
1014
- background-position: center;
1015
- }
1016
- .sg-black-friday-percent {
1017
- margin: 15px 0;
1018
- }
1019
- .sg-black-friday-percent p {
1020
- font-size: 38px;
1021
- }
1022
- .sg-black-friday-txt p {
1023
- margin: 0 !important;
1024
- padding: 0 !important;
1025
- line-height: 1 !important;
1026
- }
1027
- #sg-black-friday-popup-content-wrapper {
1028
- position: relative;
1029
- width: 640px;
1030
- height: 538px;
1031
- max-width: 100%;
1032
- max-height: 100%;
1033
- background-image: url("<?php echo SG_IMAGE_URL ?>blackFridayPopup.png");
1034
- background-repeat: no-repeat;
1035
- background-size: 100% 100%;
1036
- background-position: top center;
1037
- box-sizing: border-box;
1038
- padding-top: 183px;
1039
- }
1040
- .sg-black-friday-p {
1041
- text-align: center;
1042
- color: #0095FE;
1043
- font-size: 25px;
1044
- margin-top: 0;
1045
- margin-bottom: 40px;
1046
- }
1047
- .sg-black-friday-btn-wrapper {
1048
- text-align: center;
1049
- }
1050
- .sgbg-banner-content {
1051
- height: 160px;
1052
- background-image: url("<?php echo SG_IMAGE_URL ?>halloween.png");
1053
- background-size: cover;
1054
- background-repeat: no-repeat;
1055
- }
1056
- .sgbg-black-friday-close-popup {
1057
- position: absolute;
1058
- top: 87px;
1059
- right: 16px;
1060
- background-size: contain;
1061
- width: 20px;
1062
- height: 21px;
1063
- background-repeat: no-repeat;
1064
- background-image: url("<?php echo SG_IMAGE_URL ?>blackFridayClose.png");
1065
- cursor: pointer;
1066
- }
1067
- .backup-guard-discount-notice.updated.notice.is-dismissible {
1068
- border-left-color: #FFFFFF !important;
1069
- background-color: #000000;
1070
- height: 160px;
1071
- padding: 5px 0;
1072
- background-image: url("<?php echo SG_IMAGE_URL ?>blackFridayBG.jpg");
1073
- background-size: contain;
1074
- }
1075
- .backup-guard-discount-notice button:before {
1076
- color: #ffffff !important;
1077
- }
1078
- .sgbg-col {
1079
- display: inline-block;
1080
- width: 25%;
1081
- height: 100%;
1082
- padding: 0 25px;
1083
- box-sizing: border-box;
1084
- }
1085
- .sgbg-col1 {
1086
- width: 10%;
1087
- background-color: #FFFFFF;
1088
- background-image: url("<?php echo SG_IMAGE_URL ?>BgBFLogo.jpg");
1089
- background-size: 80%;
1090
- background-repeat: no-repeat;
1091
- background-position: center;
1092
- }
1093
- .sgbg-col2 {
1094
- width: 20%;
1095
- background-image: url("<?php echo SG_IMAGE_URL ?>BF.png");
1096
- background-size: contain;
1097
- margin-left: 70px;
1098
- background-position: center;
1099
- background-repeat: no-repeat;
1100
- }
1101
- .sgbg-col3 {
1102
- vertical-align: top;
1103
- width: 45%;
1104
- margin-top: 55px;
1105
- }
1106
- .sgbg-col4 {
1107
- width: 10%;
1108
- }
1109
- .sgbg-text-col-1,
1110
- .sgbg-text-col-2 {
1111
- width: 49%;
1112
- display: inline-block;
1113
- color: #FFFFFF;
1114
- }
1115
- .sgbg-text-col-1 {
1116
- font-size: 100px;
1117
- line-height: 0;
1118
- font-weight: bold;
1119
- text-align: right;
1120
- padding-right: 26px;
1121
- box-sizing: border-box;
1122
- }
1123
- .sgbg-discount-text-2 {
1124
- font-size: 19px;
1125
- }
1126
- .sgbg-discount-text-1 {
1127
- font-size: 60px;
1128
- padding-bottom: 27px;
1129
- font-weight: bold;
1130
- }
1131
- .sgbg-col4 {
1132
- vertical-align: top;
1133
- }
1134
- .sgbg-button {
1135
- width: 183px;
1136
- height: 67px;
1137
- font-size: 20px;
1138
- border: #ffffff;
1139
- border-radius: 10px;
1140
- margin-top: 48px;
1141
- background-color: #FFFFFF;
1142
- color: #000000;
1143
- cursor: pointer !important;
1144
- }
1145
- .sgbg-button:hover {
1146
- background-color: #000000;
1147
- border: 1px solid #FFFFFF;
1148
- color: #FFFFFF;
1149
- }
1150
- .backup-guard-discount-notice .notice-dismiss::before {
1151
- content: "x";
1152
- font-weight: 300;
1153
- font-family: Arial, sans-serif;
1154
- }
1155
 
1156
- @media (max-width: 1810px) {
1157
- .sgbg-text-col-1 {
1158
- font-size: 80px;
1159
- }
1160
- .sgbg-discount-text-1 {
1161
- font-size: 43px;
1162
- }
1163
- .sgbg-discount-text-2 {
1164
- font-size: 15px;
1165
- }
1166
- .sgbg-discount-text-1 {
1167
- padding-bottom: 18px;
1168
- }
1169
- .sgbg-col3 {
1170
- margin-top: 60px;
1171
- }
1172
- }
1173
- @media (max-width: 1477px) {
1174
- .sgbg-discount-text-2 {
1175
- font-size: 12px;
1176
- }
1177
- .sgbg-discount-text-1 {
1178
- font-size: 35px;
1179
- }
1180
- .sgbg-discount-text-1 {
1181
- padding-bottom: 13px;
1182
- }
1183
- .sgbg-col {
1184
- padding: 0;
1185
- }
1186
- .sgbg-col2 {
1187
- margin-left: 40px;
1188
- }
1189
- .sgbg-col2 {
1190
- margin-left: 0;
1191
- }
1192
- }
1193
- </style>
1194
  <?php
1195
  }
1196
 
909
 
910
  if (backupGuardShouldShowDiscountNotice() && checkDueDateDiscount()) {
911
  add_action('admin_notices', 'backup_guard_discount_notice');
 
 
 
 
 
 
912
  }
913
 
914
  function backup_guard_discount_notice()
916
  $capabilities = backupGuardGetCapabilities();
917
  $upgradeUrl = BG_UPGRADE_URL;
918
  ?>
919
+ <div class="backup-guard-discount-notice updated notice is-dismissible">
920
+ <div class="sgbg-col sgbg-col1"></div>
921
+ <div class="sgbg-col sgbg-col2"></div>
922
+ <div class="sgbg-col sgbg-col3">
923
+ <div class="sgbg-text-col-1">
924
+ -50%
925
+ </div>
926
+ <div class="sgbg-text-col-2">
927
+ <div class="sgbg-discount-text-1">Discount</div>
928
+ <div class="sgbg-discount-text-2">All Backup Guard Solutions</div>
929
+ </div>
930
+ </div>
931
+ <div class="sgbg-col sgbg-col4">
932
+ <a href="https://backup-guard.com/products/backup-wordpress" target="_blank"><button class="sgbg-button">Click Here</button></a>
933
+ </div>
934
+ </div>
935
+ <style>
936
+ .backup-guard-discount-notice.updated.notice.is-dismissible {
937
+ padding: 0;
938
+ border-left-color: #FFFFFF !important;
939
+ background-color: #000000;
940
+ height: 160px;
941
+ }
942
+ .backup-guard-discount-notice button:before {
943
+ color: #ffffff !important;
944
+ }
945
+ .sgbg-col {
946
+ display: inline-block;
947
+ width: 25%;
948
+ height: 100%;
949
+ padding: 0 25px;
950
+ box-sizing: border-box;
951
+ }
952
+ .sgbg-col1 {
953
+ width: 10%;
954
+ background-color: #FFFFFF;
955
+ background-image: url("<?php echo SG_IMAGE_URL ?>BgBFLogo.jpg");
956
+ background-size: 80%;
957
+ background-repeat: no-repeat;
958
+ background-position: center;
959
+ }
960
+ .sgbg-col2 {
961
+ width: 20%;
962
+ background-image: url("<?php echo SG_IMAGE_URL ?>BF.png");
963
+ background-size: contain;
964
+ margin-left: 70px;
965
+ background-position: center;
966
+ background-repeat: no-repeat;
967
+ }
968
+ .sgbg-col3 {
969
+ vertical-align: top;
970
+ width: 45%;
971
+ margin-top: 55px;
972
+ }
973
+ .sgbg-col4 {
974
+ width: 10%;
975
+ }
976
+ .sgbg-text-col-1,
977
+ .sgbg-text-col-2 {
978
+ width: 49%;
979
+ display: inline-block;
980
+ color: #FFFFFF;
981
+ }
982
+ .sgbg-text-col-1 {
983
+ font-size: 100px;
984
+ line-height: 0;
985
+ font-weight: bold;
986
+ text-align: right;
987
+ padding-right: 26px;
988
+ box-sizing: border-box;
989
+ }
990
+ .sgbg-discount-text-2 {
991
+ font-size: 19px;
992
+ }
993
+ .sgbg-discount-text-1 {
994
+ font-size: 60px;
995
+ padding-bottom: 27px;
996
+ font-weight: bold;
997
+ }
998
+ .sgbg-col4 {
999
+ vertical-align: top;
1000
+ }
1001
+ .sgbg-button {
1002
+ width: 183px;
1003
+ height: 67px;
1004
+ font-size: 20px;
1005
+ border: #ffffff;
1006
+ border-radius: 10px;
1007
+ margin-top: 48px;
1008
+ background-color: #FFFFFF;
1009
+ color: #000000;
1010
+ cursor: pointer !important;
1011
+ }
1012
+ .sgbg-button:hover {
1013
+ background-color: #000000;
1014
+ border: 1px solid #FFFFFF;
1015
+ color: #FFFFFF;
1016
+ }
1017
+ .backup-guard-discount-notice .notice-dismiss::before {
1018
+ content: "x";
1019
+ font-weight: 300;
1020
+ font-family: Arial, sans-serif;
1021
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1022
 
1023
+ @media (max-width: 1810px) {
1024
+ .sgbg-text-col-1 {
1025
+ font-size: 80px;
1026
+ }
1027
+ .sgbg-discount-text-1 {
1028
+ font-size: 43px;
1029
+ }
1030
+ .sgbg-discount-text-2 {
1031
+ font-size: 15px;
1032
+ }
1033
+ .sgbg-discount-text-1 {
1034
+ padding-bottom: 18px;
1035
+ }
1036
+ .sgbg-col3 {
1037
+ margin-top: 60px;
1038
+ }
1039
+ }
1040
+ @media (max-width: 1477px) {
1041
+ .sgbg-discount-text-2 {
1042
+ font-size: 12px;
1043
+ }
1044
+ .sgbg-discount-text-1 {
1045
+ font-size: 35px;
1046
+ }
1047
+ .sgbg-discount-text-1 {
1048
+ padding-bottom: 13px;
1049
+ }
1050
+ .sgbg-col {
1051
+ padding: 0;
1052
+ }
1053
+ .sgbg-col2 {
1054
+ margin-left: 40px;
1055
+ }
1056
+ .sgbg-col2 {
1057
+ margin-left: 0;
1058
+ }
1059
+ }
1060
+ </style>
1061
  <?php
1062
  }
1063
 
README.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://backup-guard.com/products/backup-wordpress
6
  Tags: backup, wordpress backup plugin, backup plugin, database backup, migrate, back up
7
  Requires at least: 3.8
8
  Tested up to: 5.6
9
- Stable tag: 1.5.1.1
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -167,8 +167,10 @@ When you are facing an issue of any kind with any of our products, the first thi
167
  6. Site backup customization
168
 
169
  == Changelog ==
170
- = 1.5.1.1 =
171
- * Improvement of Admin Panel
 
 
172
 
173
  = 1.5.1 =
174
  * Improvement of menu section, video tutorials are added in the admin panel
6
  Tags: backup, wordpress backup plugin, backup plugin, database backup, migrate, back up
7
  Requires at least: 3.8
8
  Tested up to: 5.6
9
+ Stable tag: 1.5.2
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
167
  6. Site backup customization
168
 
169
  == Changelog ==
170
+ = 1.5.2 =
171
+ * Added new option ' Upload to cloud chunk size '
172
+ * Bug fixed related to backup import issue
173
+ * Bug fixed related to button disabled issue
174
 
175
  = 1.5.1 =
176
  * Improvement of menu section, video tutorials are added in the admin panel
backup.php CHANGED
@@ -4,20 +4,19 @@
4
  * Plugin Name: Backup
5
  * Plugin URI: https://backup-guard.com/products/backup-wordpress
6
  * Description: Backup Guard is the most complete site backup and restore plugin. We offer the easiest way to backup, restore or migrate your site. You can backup your files, database or both.
7
- * Version: 1.5.1.1
8
  * Author: BackupGuard
9
  * Author URI: https://backup-guard.com/products/backup-wordpress
10
  * License: GPL-2.0+
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
12
  */
13
 
14
-
15
  if (function_exists('activate_backup_guard')) {
16
  die('Please deactivate any other BackupGuard version before activating this one.');
17
  }
18
 
19
  if (!defined('SG_BACKUP_GUARD_VERSION')) {
20
- define('SG_BACKUP_GUARD_VERSION', '1.5.1.1');
21
  }
22
 
23
  if (!defined('SG_BACKUP_GUARD_MAIN_FILE')) {
4
  * Plugin Name: Backup
5
  * Plugin URI: https://backup-guard.com/products/backup-wordpress
6
  * Description: Backup Guard is the most complete site backup and restore plugin. We offer the easiest way to backup, restore or migrate your site. You can backup your files, database or both.
7
+ * Version: 1.5.2
8
  * Author: BackupGuard
9
  * Author URI: https://backup-guard.com/products/backup-wordpress
10
  * License: GPL-2.0+
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
12
  */
13
 
 
14
  if (function_exists('activate_backup_guard')) {
15
  die('Please deactivate any other BackupGuard version before activating this one.');
16
  }
17
 
18
  if (!defined('SG_BACKUP_GUARD_VERSION')) {
19
+ define('SG_BACKUP_GUARD_VERSION', '1.5.2');
20
  }
21
 
22
  if (!defined('SG_BACKUP_GUARD_MAIN_FILE')) {
com/core/backup/SGBackup.php CHANGED
@@ -1146,7 +1146,7 @@ class SGBackup implements SGIBackupDelegate
1146
  if (empty($action)) {
1147
  continue;
1148
  }
1149
- if ($action['status'] == SG_ACTION_STATUS_IN_PROGRESS_FILES) {
1150
  $id = $action['id'];
1151
  SGBackup::deleteActionById($id);
1152
  }
1146
  if (empty($action)) {
1147
  continue;
1148
  }
1149
+ if ($action['status'] == SG_ACTION_STATUS_IN_PROGRESS_FILES || $action['status'] == SG_ACTION_STATUS_IN_PROGRESS_DB) {
1150
  $id = $action['id'];
1151
  SGBackup::deleteActionById($id);
1152
  }
com/core/functions.php CHANGED
@@ -765,3 +765,32 @@ function backupGuardIncludeFile($filePath)
765
  include_once($filePath);
766
  }
767
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
765
  include_once($filePath);
766
  }
767
  }
768
+
769
+ function getCloudUploadDefaultMaxChunkSize()
770
+ {
771
+ $memory = (int)SGBoot::$memoryLimit;
772
+ $uploadSize = 1;
773
+
774
+ if ($memory <= 128) {
775
+ $uploadSize = 4;
776
+ }
777
+ else if ($memory > 128 && $memory <= 256) {
778
+ $uploadSize = 8;
779
+ }
780
+ else if ($memory > 256 && $memory <= 512) {
781
+ $uploadSize = 16;
782
+ }
783
+ else if ($memory > 512) {
784
+ $uploadSize = 32;
785
+ }
786
+
787
+ return $uploadSize;
788
+ }
789
+
790
+ function getCloudUploadChunkSize()
791
+ {
792
+ $cloudUploadDefaultChunkSize = (int)getCloudUploadDefaultMaxChunkSize();
793
+ $savedCloudUploadChunkSize = (int)SGConfig::get('SG_BACKUP_CLOUD_UPLOAD_CHUNK_SIZE');
794
+
795
+ return ($savedCloudUploadChunkSize ? $savedCloudUploadChunkSize:$cloudUploadDefaultChunkSize);
796
+ }
com/core/storage/BackupGuardStorage.php CHANGED
@@ -227,7 +227,8 @@ class Storage extends \SGStorage
227
  throw new \SGExceptionNotFound('File does not exist or is not readable: '.$filePath);
228
  }
229
 
230
- $chunkSizeBytes = 2000000;
 
231
  $fileSize = backupGuardRealFilesize($filePath);
232
  $backupFileName = $this->state->getBackupFileName().'.sgbp';
233
 
227
  throw new \SGExceptionNotFound('File does not exist or is not readable: '.$filePath);
228
  }
229
 
230
+ //$chunkSizeBytes = 2000000;
231
+ $chunkSizeBytes = (int)getCloudUploadChunkSize() * 1024 * 1024;
232
  $fileSize = backupGuardRealFilesize($filePath);
233
  $backupFileName = $this->state->getBackupFileName().'.sgbp';
234
 
com/core/storage/SGDropboxStorage.php CHANGED
@@ -202,7 +202,8 @@ class SGDropboxStorage extends SGStorage
202
  }
203
 
204
  $client = $this->getClient();
205
- $chunkSizeBytes = 2.0 * 1024 * 1024;
 
206
 
207
  //Note: Because PHP's integer type is signed and many platforms use 32bit integers,
208
  //some filesystem functions may return unexpected results for files which are larger than 2GB.
202
  }
203
 
204
  $client = $this->getClient();
205
+ //$chunkSizeBytes = 2.0 * 1024 * 1024;
206
+ $chunkSizeBytes = (int)getCloudUploadChunkSize()* 1024 * 1024;
207
 
208
  //Note: Because PHP's integer type is signed and many platforms use 32bit integers,
209
  //some filesystem functions may return unexpected results for files which are larger than 2GB.
public/ajax/checkBackupCreation.php CHANGED
@@ -1,31 +1,34 @@
1
  <?php
2
  require_once(dirname(__FILE__).'/../boot.php');
3
  require_once(SG_BACKUP_PATH.'SGBackup.php');
4
- if(backupGuardIsAjax()) {
5
- $runningActions = array();
6
-
7
  $timeout = 10; //in sec
8
  while ($timeout != 0) {
9
  sleep(1);
10
  $timeout--;
11
-
12
  $created = SGConfig::get('SG_RUNNING_ACTION', true);
13
  if ($created) {
14
  die((1));
15
  }
 
16
  $runningActions = SGBackup::getRunningActions();
17
 
18
  if (empty($runningActions)) {
19
- break;
20
  }
21
  }
22
-
 
23
  if (!empty($runningActions)) {
24
- SGBackup::cleanRunningActions($runningActions);
25
- die(json_encode(array(
26
- 'status' => 'cleaned'
27
- )));
 
 
 
28
  }
29
-
30
- die('2');
31
  }
1
  <?php
2
  require_once(dirname(__FILE__).'/../boot.php');
3
  require_once(SG_BACKUP_PATH.'SGBackup.php');
4
+ if (backupGuardIsAjax()) {
 
 
5
  $timeout = 10; //in sec
6
  while ($timeout != 0) {
7
  sleep(1);
8
  $timeout--;
9
+
10
  $created = SGConfig::get('SG_RUNNING_ACTION', true);
11
  if ($created) {
12
  die((1));
13
  }
14
+
15
  $runningActions = SGBackup::getRunningActions();
16
 
17
  if (empty($runningActions)) {
18
+ die('{"status":1}');
19
  }
20
  }
21
+
22
+ $runningActions = SGBackup::getRunningActions();
23
  if (!empty($runningActions)) {
24
+ // when there are multiple uncompleted actions
25
+ if ($runningActions && count($runningActions) == 1 && $runningActions[0]['progress'] == 0) {
26
+ SGBackup::cleanRunningActions($runningActions);
27
+ die(json_encode(array(
28
+ 'status' => 'cleaned'
29
+ )));
30
+ }
31
  }
32
+
33
+ die('{"status":1}');
34
  }
public/ajax/dismissDiscountNotice.php CHANGED
@@ -2,4 +2,4 @@
2
 
3
  require_once(dirname(__FILE__).'/../boot.php');
4
 
5
- SGConfig::set('SG_HIDE_BLACK_FRIDAY_NOTICE', 1);
2
 
3
  require_once(dirname(__FILE__).'/../boot.php');
4
 
5
+ SGConfig::set('SG_HIDE_DISCOUNT_NOTICE', 1);
public/ajax/settings.php CHANGED
@@ -133,6 +133,13 @@ if (backupGuardIsAjax() && count($_POST)) {
133
  SGConfig::set('SG_TABLES_TO_EXCLUDE', '');
134
  }
135
 
 
 
 
 
 
 
 
136
  SGConfig::set('SG_BACKUP_WITH_RELOADINGS', $isReloadingsEnabled);
137
  SGConfig::set('SG_BACKUP_FILE_NAME_PREFIX', $backupFileName);
138
  SGConfig::set('SG_AJAX_REQUEST_FREQUENCY', $ajaxInterval);
133
  SGConfig::set('SG_TABLES_TO_EXCLUDE', '');
134
  }
135
 
136
+ if (isset($_POST['sg-upload-cloud-chunk-size'])) {
137
+ SGConfig::set('SG_BACKUP_CLOUD_UPLOAD_CHUNK_SIZE', $_POST['sg-upload-cloud-chunk-size']);
138
+ }
139
+ else {
140
+ SGConfig::set('SG_BACKUP_CLOUD_UPLOAD_CHUNK_SIZE', '');
141
+ }
142
+
143
  SGConfig::set('SG_BACKUP_WITH_RELOADINGS', $isReloadingsEnabled);
144
  SGConfig::set('SG_BACKUP_FILE_NAME_PREFIX', $backupFileName);
145
  SGConfig::set('SG_AJAX_REQUEST_FREQUENCY', $ajaxInterval);
public/img/blackFridayBG.jpg DELETED
Binary file
public/img/blackFridayClose.png DELETED
Binary file
public/img/blackFridayLogo.png DELETED
Binary file
public/img/blackFridayPopup.png DELETED
Binary file
public/img/blackFridayText.png DELETED
Binary file
public/include/functions.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  function backupGuardShouldShowDiscountNotice()
4
  {
5
- if (SGConfig::get("SG_HIDE_BLACK_FRIDAY_NOTICE")) {
6
  return false;
7
  }
8
 
@@ -12,7 +12,7 @@ function backupGuardShouldShowDiscountNotice()
12
  function checkDueDateDiscount()
13
  {
14
  $startDate = '2019-11-27';
15
- $endDate = '2020-11-30';
16
 
17
  $timezone = 'Asia/Yerevan';
18
  $timeDate = new DateTime('now', new DateTimeZone($timezone));
@@ -224,7 +224,7 @@ function backupGuardShouldUpdate()
224
 
225
  if ($currentVersion !== $oldVersion) {
226
  SGConfig::set('SG_BACKUP_GUARD_VERSION', $currentVersion, true);
227
- SGConfig::set('SG_HIDE_BLACK_FRIDAY_NOTICE', '0', true);
228
  SGBoot::didUpdatePluginVersion();
229
  return SG_FORCE_DB_TABLES_RESET;
230
  }
2
 
3
  function backupGuardShouldShowDiscountNotice()
4
  {
5
+ if (SGConfig::get("SG_HIDE_DISCOUNT_NOTICE")) {
6
  return false;
7
  }
8
 
12
  function checkDueDateDiscount()
13
  {
14
  $startDate = '2019-11-27';
15
+ $endDate = '2019-12-02';
16
 
17
  $timezone = 'Asia/Yerevan';
18
  $timeDate = new DateTime('now', new DateTimeZone($timezone));
224
 
225
  if ($currentVersion !== $oldVersion) {
226
  SGConfig::set('SG_BACKUP_GUARD_VERSION', $currentVersion, true);
227
+ SGConfig::set('SG_HIDE_DISCOUNT_NOTICE', '0', true);
228
  SGBoot::didUpdatePluginVersion();
229
  return SG_FORCE_DB_TABLES_RESET;
230
  }
public/js/popup.js CHANGED
@@ -1492,41 +1492,27 @@ SGPopup.openSGPopup = function() {
1492
  }
1493
  };
1494
 
1495
- jQuery(document).ready(function () {
1496
- var hiddenDivId = 'sg-black-friday-popup-content-wrapper';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1497
  if (!jQuery('#'+hiddenDivId).length) {
1498
  return false;
1499
  }
1500
-
1501
- var popupConfigObj = new PopupConfig();
1502
- popupConfigObj.magicCall('setContentPadding', 0);
1503
- popupConfigObj.magicCall('setContentBorderRadius', 4);
1504
- popupConfigObj.magicCall('setContentBorderRadiusType', 'px');
1505
- popupConfigObj.magicCall('setContentBorderWidth', 0);
1506
- popupConfigObj.magicCall('setOverlayColor', 'white');
1507
- popupConfigObj.magicCall('setContentBorderColor', '#506274');
1508
- popupConfigObj.magicCall('setShadowSpread', 1);
1509
- popupConfigObj.magicCall('setContentShadowBlur', 4);
1510
- popupConfigObj.magicCall('setContentBackgroundColor', 'rgba(1,1,1,0)');
1511
- popupConfigObj.magicCall('setContentShadowColor', '');
1512
- popupConfigObj.magicCall('setMinWidth', 400);
1513
- popupConfigObj.magicCall('setSrcElement', hiddenDivId);
1514
- popupConfigObj.magicCall('setOverlayColor', 'black');
1515
- popupConfigObj.magicCall('setOverlayOpacity', 40);
1516
- var config = popupConfigObj.combineConfigObj();
1517
-
1518
  var popup = new SGPopup(config);
1519
- window.backupGuardHalloweenPopup = popup;
1520
  popup.open();
1521
-
1522
- jQuery('.sgbg-black-friday-close-popup').bind('click', function () {
1523
- window.backupGuardHalloweenPopup.close();
1524
- jQuery('.backup-guard-discount-notice').remove();
1525
- var sgNoticeClosedHandler = new sgRequestHandler('dismiss_discount_notice', {token: BG_BACKUP_STRINGS.nonce});
1526
- sgNoticeClosedHandler.run();
1527
- });
1528
-
1529
- jQuery('#sg-halloween-popup-content-wrapper').bind('click', function () {
1530
- window.open('https://backup-guard.com/products/backup-wordpress#pricing')
1531
- });
1532
  });
1492
  }
1493
  };
1494
 
1495
+ var hiddenDivId = 'sg-backup-review-wrapper';
1496
+ var popupConfigObj = new PopupConfig();
1497
+ popupConfigObj.magicCall('setContentPadding', 0);
1498
+ popupConfigObj.magicCall('setContentBorderRadius', 4);
1499
+ popupConfigObj.magicCall('setContentBorderRadiusType', 'px');
1500
+ popupConfigObj.magicCall('setContentBorderWidth', 5);
1501
+ popupConfigObj.magicCall('setContentBorderColor', '#506274');
1502
+ popupConfigObj.magicCall('setShadowSpread', 1);
1503
+ popupConfigObj.magicCall('setContentShadowBlur', 4);
1504
+ popupConfigObj.magicCall('setContentShadowColor', '#cccccc');
1505
+ popupConfigObj.magicCall('setMinWidth', 400);
1506
+ popupConfigObj.magicCall('setSrcElement', hiddenDivId);
1507
+ popupConfigObj.magicCall('setOverlayColor', 'black');
1508
+ popupConfigObj.magicCall('setOverlayOpacity', 40);
1509
+ var config = popupConfigObj.combineConfigObj();
1510
+
1511
+ jQuery(document).ready(function() {
1512
  if (!jQuery('#'+hiddenDivId).length) {
1513
  return false;
1514
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1515
  var popup = new SGPopup(config);
1516
+ window.backupGuardReviewPopup = popup;
1517
  popup.open();
 
 
 
 
 
 
 
 
 
 
 
1518
  });
public/js/sgbackup.js CHANGED
@@ -185,7 +185,7 @@ sgBackup.deleteMultiBackups = function(backupNames){
185
  };
186
 
187
  //SGManual Backup AJAX callback
188
- sgBackup.manualBackup = function(){
189
  var error = [];
190
  //Validation
191
  jQuery('.alert').remove();
@@ -213,6 +213,10 @@ sgBackup.manualBackup = function(){
213
  return false;
214
  }
215
 
 
 
 
 
216
  //Before all disable buttons...
217
  jQuery('.alert').remove();
218
  jQuery('.modal-footer .btn-primary').attr('disabled','disabled');
@@ -236,12 +240,19 @@ sgBackup.manualBackup = function(){
236
  sgBackup.restManualBackupModal();
237
  return false;
238
  }
 
 
 
239
  manualBackupHandler.run();
240
- sgBackup.checkBackupCreation();
241
  };
242
  resetStatusHandler.run();
243
  };
244
 
 
 
 
 
 
245
  sgBackup.restManualBackupModal = function() {
246
  jQuery('.modal-footer .btn-primary').removeAttr('disabled');
247
  jQuery('.modal-footer .btn-primary').html('Backup');
@@ -554,7 +565,7 @@ sgBackup.checkBackupCreation = function(){
554
  if (response.length) {
555
  var result = jQuery.parseJSON(response);
556
  if (result && result.status == 'cleaned') {
557
- sgBackup.manualBackup();
558
  }
559
  else {
560
  hideAndReload();
185
  };
186
 
187
  //SGManual Backup AJAX callback
188
+ sgBackup.manualBackup = function(checkedStatus){
189
  var error = [];
190
  //Validation
191
  jQuery('.alert').remove();
213
  return false;
214
  }
215
 
216
+ if (!checkedStatus) {
217
+ sgBackup.checkBackupCreation();
218
+ }
219
+
220
  //Before all disable buttons...
221
  jQuery('.alert').remove();
222
  jQuery('.modal-footer .btn-primary').attr('disabled','disabled');
240
  sgBackup.restManualBackupModal();
241
  return false;
242
  }
243
+ if (checkedStatus) {
244
+ sgBackup.hideAndReload();
245
+ }
246
  manualBackupHandler.run();
 
247
  };
248
  resetStatusHandler.run();
249
  };
250
 
251
+ sgBackup.hideAndReload = function () {
252
+ jQuery('#sg-modal').modal('hide');
253
+ location.reload();
254
+ };
255
+
256
  sgBackup.restManualBackupModal = function() {
257
  jQuery('.modal-footer .btn-primary').removeAttr('disabled');
258
  jQuery('.modal-footer .btn-primary').html('Backup');
565
  if (response.length) {
566
  var result = jQuery.parseJSON(response);
567
  if (result && result.status == 'cleaned') {
568
+ sgBackup.manualBackup('cleaned');
569
  }
570
  else {
571
  hideAndReload();
public/settings.php CHANGED
@@ -26,6 +26,7 @@ $infoIconHtml = '<span class="dashicons dashicons-editor-help sgbg-info-icon"></
26
  $sgBackgroundReloadMethod = SGConfig::get('SG_BACKGROUND_RELOAD_METHOD');
27
  $ftpPassiveMode = SGConfig::get('SG_FTP_PASSIVE_MODE');
28
  $contentClassName = getBackupPageContentClassName('settings');
 
29
  ?>
30
  <div id="sg-backup-page-content-settings" class="sg-backup-page-content <?php echo $contentClassName; ?>">
31
  <div class="row sg-settings-container">
@@ -204,6 +205,20 @@ $contentClassName = getBackupPageContentClassName('settings');
204
  <input class="form-control sg-backup-input" id='sg-number-of-rows-to-backup' name='sg-number-of-rows-to-backup' type="text" value="<?php echo (int)SGConfig::get('SG_BACKUP_DATABASE_INSERT_LIMIT')?(int)SGConfig::get('SG_BACKUP_DATABASE_INSERT_LIMIT'):SG_BACKUP_DATABASE_INSERT_LIMIT?>">
205
  </div>
206
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
 
208
  <div class="form-group">
209
  <label class="col-md-4 sg-control-label" for='sg-background-reload-method'>
26
  $sgBackgroundReloadMethod = SGConfig::get('SG_BACKGROUND_RELOAD_METHOD');
27
  $ftpPassiveMode = SGConfig::get('SG_FTP_PASSIVE_MODE');
28
  $contentClassName = getBackupPageContentClassName('settings');
29
+ $savedCloudUploadChunkSize = getCloudUploadChunkSize();
30
  ?>
31
  <div id="sg-backup-page-content-settings" class="sg-backup-page-content <?php echo $contentClassName; ?>">
32
  <div class="row sg-settings-container">
205
  <input class="form-control sg-backup-input" id='sg-number-of-rows-to-backup' name='sg-number-of-rows-to-backup' type="text" value="<?php echo (int)SGConfig::get('SG_BACKUP_DATABASE_INSERT_LIMIT')?(int)SGConfig::get('SG_BACKUP_DATABASE_INSERT_LIMIT'):SG_BACKUP_DATABASE_INSERT_LIMIT?>">
206
  </div>
207
  </div>
208
+ <div class="form-group">
209
+ <label class="col-md-4 sg-control-label" for='sg-number-of-rows-to-backup'>
210
+ <?php _backupGuardT("Upload to cloud chunk size")?><?php echo $infoIconHtml; ?>
211
+ <span class="infoSelectRepeat samefontStyle sgbg-info-text"><?php _backupGuardT('Change the size of the chunk upload during backup to cloud(s).')?></span>
212
+ </label>
213
+ <div class="col-md-5 text-left">
214
+ <select class="form-control" id='sg-upload-cloud-chunk-szie' name='sg-upload-cloud-chunk-size'>
215
+ <option value="4" <?php echo $savedCloudUploadChunkSize == 4 ? "selected" : "" ?> >4MB</option>
216
+ <option value="8" <?php echo $savedCloudUploadChunkSize == 8 ? "selected" : "" ?> >8MB</option>
217
+ <option value="16" <?php echo $savedCloudUploadChunkSize == 16 ? "selected" : "" ?> >16MB</option>
218
+ <option value="32" <?php echo $savedCloudUploadChunkSize == 32 ? "selected" : "" ?> >32MB</option>
219
+ </select>
220
+ </div>
221
+ </div>
222
 
223
  <div class="form-group">
224
  <label class="col-md-4 sg-control-label" for='sg-background-reload-method'>