Migration, Backup, Staging – WPvivid - Version 0.9.34

Version Description

  • Fixed the PHP 7.4 compatibility issue.
  • Fixed: Backing up upload directory failed in some cases.
  • Fixed: Backup filenames did not match the downloads part numbers.
  • Updated the API for WPvivid Backup for MainWP extension.
  • Fixed some bugs in the plugin code.
Download this release

Release Info

Developer wpvivid
Plugin Icon 128x128 Migration, Backup, Staging – WPvivid
Version 0.9.34
Comparing to
See all releases

Code changes from version 0.9.33 to 0.9.34

admin/class-wpvivid-admin.php CHANGED
@@ -617,9 +617,9 @@ class WPvivid_Admin {
617
  $page_array['website_info'] = array('index' => '6', 'tab_func' => array($this, 'wpvivid_add_tab_website_info'), 'page_func' => array($this, 'wpvivid_add_page_website_info'));
618
  $page_array['log'] = array('index' => '7', 'tab_func' => array($this, 'wpvivid_add_tab_log'), 'page_func' => array($this, 'wpvivid_add_page_log'));
619
  $page_array['read_log'] = array('index' => '9', 'tab_func' => array($this, 'wpvivid_add_tab_read_log'), 'page_func' => array($this, 'wpvivid_add_page_read_log'));
620
- $hide_mwp_tab_page = get_option('wpvivid_hide_mwp_tab_page', false);
621
  if($hide_mwp_tab_page === false) {
622
- //$page_array['mwp'] = array('index' => '30', 'tab_func' => array($this, 'wpvivid_add_tab_mwp'), 'page_func' => array($this, 'wpvivid_add_page_mwp'));
623
  }
624
  return $page_array;
625
  }
@@ -1104,13 +1104,44 @@ class WPvivid_Admin {
1104
  <div id="mwp-page" class="wrap-tab-content wpvivid_tab_mainwp" name="tab-mwp" style="display:none;">
1105
  <div style="padding: 10px; background-color: #fff;">
1106
  <div style="margin-bottom: 10px;">
1107
- WPvivid Backup Plugin can be managed from MainWP dashboard now. <a target="_blank" href="https://wordpress.org/plugins/wpvivid-backup-mainwp/" style="text-decoration: none;">Download WPvivid Backup for MainWP extension from wordpress.org.</a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1108
  </div>
1109
  <div>
1110
- <strong>Note: </strong>This extension currently only works with the community version of WPvivid Backup Plugin.
1111
  </div>
1112
  </div>
1113
  </div>
 
 
 
 
 
 
 
 
 
 
1114
  <?php
1115
  }
1116
  }
617
  $page_array['website_info'] = array('index' => '6', 'tab_func' => array($this, 'wpvivid_add_tab_website_info'), 'page_func' => array($this, 'wpvivid_add_page_website_info'));
618
  $page_array['log'] = array('index' => '7', 'tab_func' => array($this, 'wpvivid_add_tab_log'), 'page_func' => array($this, 'wpvivid_add_page_log'));
619
  $page_array['read_log'] = array('index' => '9', 'tab_func' => array($this, 'wpvivid_add_tab_read_log'), 'page_func' => array($this, 'wpvivid_add_page_read_log'));
620
+ $hide_mwp_tab_page = get_option('wpvivid_hide_mwp_tab_page_v1', false);
621
  if($hide_mwp_tab_page === false) {
622
+ $page_array['mwp'] = array('index' => '30', 'tab_func' => array($this, 'wpvivid_add_tab_mwp'), 'page_func' => array($this, 'wpvivid_add_page_mwp'));
623
  }
624
  return $page_array;
625
  }
1104
  <div id="mwp-page" class="wrap-tab-content wpvivid_tab_mainwp" name="tab-mwp" style="display:none;">
1105
  <div style="padding: 10px; background-color: #fff;">
1106
  <div style="margin-bottom: 10px;">
1107
+ If you are a MainWP user, you can set up and control WPvivid Backup Free and Pro for every child site directly from your MainWP dashboard, using our WPvivid Backup for MainWP extension.
1108
+ </div>
1109
+ <div style="margin-bottom: 10px;">
1110
+ <input type="button" class="button-primary" id="wpvivid_download_mainwp_extension" value="<?php esc_attr_e('Download WPvivid Backup for MainWP', 'wpvivid'); ?>" />
1111
+ </div>
1112
+ <div style="margin-bottom: 10px;">
1113
+ l. Create and download backups for a specific child site
1114
+ </div>
1115
+ <div style="margin-bottom: 10px;">
1116
+ 2. Set backup schedules for all child sites
1117
+ </div>
1118
+ <div style="margin-bottom: 10px;">
1119
+ 3. Set WPvivid Backup Free and Pro settings for all child sites
1120
+ </div>
1121
+ <div style="margin-bottom: 10px;">
1122
+ 4. Install, claim and update WPvivid Backup Pro for child sites in bulk
1123
+ </div>
1124
+ <div style="margin-bottom: 10px;">
1125
+ 5. Set up remote storage for child sites in bulk (for WPvivid Backup Pro only)
1126
+ </div>
1127
+ <div style="margin-bottom: 10px;">
1128
+ We also offer a 40% off discount on WPvivid Backup Pro for MainWP users.
1129
  </div>
1130
  <div>
1131
+ <input type="button" class="button-primary" id="wpvivid_ask_for_discount" value="<?php esc_attr_e('Ask For A 40% OFF Discount', 'wpvivid'); ?>" />
1132
  </div>
1133
  </div>
1134
  </div>
1135
+ <script>
1136
+ jQuery('#wpvivid_download_mainwp_extension').click(function(){
1137
+ var tempwindow=window.open('_blank');
1138
+ tempwindow.location='https://wordpress.org/plugins/wpvivid-backup-mainwp';
1139
+ });
1140
+ jQuery('#wpvivid_ask_for_discount').click(function(){
1141
+ var tempwindow=window.open('_blank');
1142
+ tempwindow.location='https://wpvivid.com/wpvivid-backup-for-mainwp';
1143
+ });
1144
+ </script>
1145
  <?php
1146
  }
1147
  }
includes/class-wpvivid-backup.php CHANGED
@@ -10,7 +10,7 @@ define('WPVIVID_BACKUP_TYPE_THEMES','backup_themes');
10
  define('WPVIVID_BACKUP_TYPE_PLUGIN','backup_plugin');
11
  define('WPVIVID_BACKUP_TYPE_UPLOADS','backup_uploads');
12
  define('WPVIVID_BACKUP_TYPE_UPLOADS_FILES','backup_uploads_files');
13
- define('WPVIVID_BACKUP_TYPE_UPLOADS_FILES_OTHER','backup_uploads_files_other');
14
  define('WPVIVID_BACKUP_TYPE_CONTENT','backup_content');
15
  define('WPVIVID_BACKUP_TYPE_CORE','backup_core');
16
  define('WPVIVID_BACKUP_TYPE_OTHERS','backup_others');
@@ -43,7 +43,7 @@ class WPvivid_Backup_Task
43
  $this->backup_type_collect[WPVIVID_BACKUP_TYPE_PLUGIN]=1;
44
  $this->backup_type_collect[WPVIVID_BACKUP_TYPE_UPLOADS]=1;
45
  $this->backup_type_collect[WPVIVID_BACKUP_TYPE_UPLOADS_FILES]=1;
46
- $this->backup_type_collect[WPVIVID_BACKUP_TYPE_UPLOADS_FILES_OTHER]=1;
47
  $this->backup_type_collect[WPVIVID_BACKUP_TYPE_CONTENT]=1;
48
  $this->backup_type_collect[WPVIVID_BACKUP_TYPE_CORE]=1;
49
  $this->backup_type_collect[WPVIVID_BACKUP_TYPE_OTHERS]=1;
@@ -188,7 +188,7 @@ class WPvivid_Backup_Task
188
  if(isset($general_setting['options']['wpvivid_compress_setting']['subpackage_plugin_upload']) && !empty($general_setting['options']['wpvivid_compress_setting']['subpackage_plugin_upload'])){
189
  if($general_setting['options']['wpvivid_compress_setting']['subpackage_plugin_upload']){
190
  $this->set_backup(WPVIVID_BACKUP_TYPE_UPLOADS_FILES);
191
- $this->set_backup(WPVIVID_BACKUP_TYPE_UPLOADS_FILES_OTHER);
192
  }
193
  else{
194
  $this->set_backup(WPVIVID_BACKUP_TYPE_UPLOADS);
@@ -208,7 +208,7 @@ class WPvivid_Backup_Task
208
  if(isset($general_setting['options']['wpvivid_compress_setting']['subpackage_plugin_upload']) && !empty($general_setting['options']['wpvivid_compress_setting']['subpackage_plugin_upload'])){
209
  if($general_setting['options']['wpvivid_compress_setting']['subpackage_plugin_upload']){
210
  $this->set_backup(WPVIVID_BACKUP_TYPE_UPLOADS_FILES);
211
- $this->set_backup(WPVIVID_BACKUP_TYPE_UPLOADS_FILES_OTHER);
212
  }
213
  else{
214
  $this->set_backup(WPVIVID_BACKUP_TYPE_UPLOADS);
@@ -342,9 +342,11 @@ class WPvivid_Backup_Task
342
  $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'backup-guard', '/').'#'; // Wordpress Backup and Migrate Plugin backup directory
343
  $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'ShortpixelBackups', '/').'#';
344
  $backup_data['exclude_regex']=$exclude_regex;
345
- $backup_data['include_regex'][]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR, '/').'[0-9]{4}#';
 
346
  $backup_data['json_info']['file_type']='upload';
347
  }
 
348
  else if($backup==WPVIVID_BACKUP_TYPE_UPLOADS_FILES_OTHER)
349
  {
350
  //$backup_data['root_path']=WP_CONTENT_DIR;
@@ -359,7 +361,7 @@ class WPvivid_Backup_Task
359
  $backup_data['exclude_regex']=$exclude_regex;
360
  $backup_data['include_regex']=array();
361
  $backup_data['json_info']['file_type']='upload';
362
- }
363
  else if($backup==WPVIVID_BACKUP_TYPE_CONTENT)
364
  {
365
  //$backup_data['root_path']=get_home_path();
@@ -1324,11 +1326,12 @@ class WPvivid_Backup_Task
1324
  public function get_uploads_folder_list($root,$exclude_regex,$include_regex,$exclude_file_size)
1325
  {
1326
  $files=array();
 
1327
  $this->getUploadsFolder($files,$root,$exclude_regex,$include_regex,$exclude_file_size);
1328
  return $files;
1329
  }
1330
 
1331
- public function getUploadsFolder(&$files,$path,$exclude_regex=array(),$include_regex=array(),$exclude_file_size=array(),$include_dir = true,$subdir=false)
1332
  {
1333
  $count = 0;
1334
  if(is_dir($path))
@@ -1346,14 +1349,9 @@ class WPvivid_Backup_Task
1346
  {
1347
  if ($this->regex_match($include_regex, $path . DIRECTORY_SEPARATOR . $filename, 1))
1348
  {
1349
- if($subdir)
1350
- $files[] = $path . DIRECTORY_SEPARATOR . $filename;
1351
- else
1352
- $this->getUploadsFolder($files,$path . DIRECTORY_SEPARATOR . $filename,$exclude_regex,$include_regex,$exclude_file_size,$include_dir,true);
1353
  }
1354
  }
1355
- } else {
1356
-
1357
  }
1358
  }
1359
  }
@@ -1362,8 +1360,7 @@ class WPvivid_Backup_Task
1362
  }
1363
  if($include_dir && $count == 0)
1364
  {
1365
- if($subdir)
1366
- $files[] = $path;
1367
  }
1368
  }
1369
 
@@ -1960,6 +1957,33 @@ class WPvivid_Backup_Item
1960
  }
1961
  }
1962
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1963
  return $files;
1964
  }
1965
 
10
  define('WPVIVID_BACKUP_TYPE_PLUGIN','backup_plugin');
11
  define('WPVIVID_BACKUP_TYPE_UPLOADS','backup_uploads');
12
  define('WPVIVID_BACKUP_TYPE_UPLOADS_FILES','backup_uploads_files');
13
+ //define('WPVIVID_BACKUP_TYPE_UPLOADS_FILES_OTHER','backup_uploads_files_other');
14
  define('WPVIVID_BACKUP_TYPE_CONTENT','backup_content');
15
  define('WPVIVID_BACKUP_TYPE_CORE','backup_core');
16
  define('WPVIVID_BACKUP_TYPE_OTHERS','backup_others');
43
  $this->backup_type_collect[WPVIVID_BACKUP_TYPE_PLUGIN]=1;
44
  $this->backup_type_collect[WPVIVID_BACKUP_TYPE_UPLOADS]=1;
45
  $this->backup_type_collect[WPVIVID_BACKUP_TYPE_UPLOADS_FILES]=1;
46
+ //$this->backup_type_collect[WPVIVID_BACKUP_TYPE_UPLOADS_FILES_OTHER]=1;
47
  $this->backup_type_collect[WPVIVID_BACKUP_TYPE_CONTENT]=1;
48
  $this->backup_type_collect[WPVIVID_BACKUP_TYPE_CORE]=1;
49
  $this->backup_type_collect[WPVIVID_BACKUP_TYPE_OTHERS]=1;
188
  if(isset($general_setting['options']['wpvivid_compress_setting']['subpackage_plugin_upload']) && !empty($general_setting['options']['wpvivid_compress_setting']['subpackage_plugin_upload'])){
189
  if($general_setting['options']['wpvivid_compress_setting']['subpackage_plugin_upload']){
190
  $this->set_backup(WPVIVID_BACKUP_TYPE_UPLOADS_FILES);
191
+ //$this->set_backup(WPVIVID_BACKUP_TYPE_UPLOADS_FILES_OTHER);
192
  }
193
  else{
194
  $this->set_backup(WPVIVID_BACKUP_TYPE_UPLOADS);
208
  if(isset($general_setting['options']['wpvivid_compress_setting']['subpackage_plugin_upload']) && !empty($general_setting['options']['wpvivid_compress_setting']['subpackage_plugin_upload'])){
209
  if($general_setting['options']['wpvivid_compress_setting']['subpackage_plugin_upload']){
210
  $this->set_backup(WPVIVID_BACKUP_TYPE_UPLOADS_FILES);
211
+ //$this->set_backup(WPVIVID_BACKUP_TYPE_UPLOADS_FILES_OTHER);
212
  }
213
  else{
214
  $this->set_backup(WPVIVID_BACKUP_TYPE_UPLOADS);
342
  $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'backup-guard', '/').'#'; // Wordpress Backup and Migrate Plugin backup directory
343
  $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'ShortpixelBackups', '/').'#';
344
  $backup_data['exclude_regex']=$exclude_regex;
345
+ $backup_data['include_regex']=array();
346
+ //$backup_data['include_regex'][]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR, '/').'[0-9]{4}#';
347
  $backup_data['json_info']['file_type']='upload';
348
  }
349
+ /*
350
  else if($backup==WPVIVID_BACKUP_TYPE_UPLOADS_FILES_OTHER)
351
  {
352
  //$backup_data['root_path']=WP_CONTENT_DIR;
361
  $backup_data['exclude_regex']=$exclude_regex;
362
  $backup_data['include_regex']=array();
363
  $backup_data['json_info']['file_type']='upload';
364
+ }*/
365
  else if($backup==WPVIVID_BACKUP_TYPE_CONTENT)
366
  {
367
  //$backup_data['root_path']=get_home_path();
1326
  public function get_uploads_folder_list($root,$exclude_regex,$include_regex,$exclude_file_size)
1327
  {
1328
  $files=array();
1329
+ $files[] = $root;
1330
  $this->getUploadsFolder($files,$root,$exclude_regex,$include_regex,$exclude_file_size);
1331
  return $files;
1332
  }
1333
 
1334
+ public function getUploadsFolder(&$files,$path,$exclude_regex=array(),$include_regex=array(),$exclude_file_size=array(),$include_dir = true)
1335
  {
1336
  $count = 0;
1337
  if(is_dir($path))
1349
  {
1350
  if ($this->regex_match($include_regex, $path . DIRECTORY_SEPARATOR . $filename, 1))
1351
  {
1352
+ $this->getUploadsFolder($files,$path . DIRECTORY_SEPARATOR . $filename,$exclude_regex,$include_regex,$exclude_file_size,$include_dir);
 
 
 
1353
  }
1354
  }
 
 
1355
  }
1356
  }
1357
  }
1360
  }
1361
  if($include_dir && $count == 0)
1362
  {
1363
+ $files[] = $path;
 
1364
  }
1365
  }
1366
 
1957
  }
1958
  }
1959
  }
1960
+ asort($files);
1961
+ uasort($files, function ($a, $b) {
1962
+ $file_name_1 = $a['file_name'];
1963
+ $file_name_2 = $b['file_name'];
1964
+ $index_1 = 0;
1965
+ if(preg_match('/wpvivid-.*_.*_.*\.part.*\.zip$/', $file_name_1)) {
1966
+ if (preg_match('/part.*$/', $file_name_1, $matches)) {
1967
+ $index_1 = $matches[0];
1968
+ $index_1 = preg_replace("/part/","", $index_1);
1969
+ $index_1 = preg_replace("/.zip/","", $index_1);
1970
+ }
1971
+ }
1972
+ $index_2 = 0;
1973
+ if(preg_match('/wpvivid-.*_.*_.*\.part.*\.zip$/', $file_name_2)) {
1974
+ if (preg_match('/part.*$/', $file_name_2, $matches)) {
1975
+ $index_2 = $matches[0];
1976
+ $index_2 = preg_replace("/part/", "", $index_2);
1977
+ $index_2 = preg_replace("/.zip/", "", $index_2);
1978
+ }
1979
+ }
1980
+ if($index_1 !== 0 && $index_2 === 0){
1981
+ return -1;
1982
+ }
1983
+ if($index_1 === 0 && $index_2 !== 0){
1984
+ return 1;
1985
+ }
1986
+ });
1987
  return $files;
1988
  }
1989
 
includes/class-wpvivid-interface-mainwp.php CHANGED
@@ -139,22 +139,28 @@ class WPvivid_Interface_MainWP
139
  return $ret;
140
  }
141
  $task_id=sanitize_key($task_id);
142
- $ret['result']='success';
143
  $txt = '<mainwp>' . base64_encode( serialize( $ret ) ) . '</mainwp>';
144
  // Close browser connection so that it can resume AJAX polling
145
- header( 'Content-Length: ' . ( ( ! empty( $txt ) ) ? strlen( $txt ) : '0' ) );
146
- header( 'Connection: close' );
147
- header( 'Content-Encoding: none' );
 
 
148
  if ( session_id() ) {
149
  session_write_close();
150
  }
151
  echo $txt;
152
  // These two added - 19-Feb-15 - started being required on local dev machine, for unknown reason (probably some plugin that started an output buffer).
153
- if ( ob_get_level() ) {
 
154
  ob_end_flush();
 
155
  }
156
  flush();
 
157
 
 
158
  //Start backup site
159
  $wpvivid_plugin->backup($task_id);
160
  $ret['result']='success';
139
  return $ret;
140
  }
141
  $task_id=sanitize_key($task_id);
142
+ /*$ret['result']='success';
143
  $txt = '<mainwp>' . base64_encode( serialize( $ret ) ) . '</mainwp>';
144
  // Close browser connection so that it can resume AJAX polling
145
+ if(!headers_sent()) {
146
+ header('Content-Length: ' . ((!empty($txt)) ? strlen($txt) : '0'));
147
+ header('Connection: close');
148
+ header('Content-Encoding: none');
149
+ }
150
  if ( session_id() ) {
151
  session_write_close();
152
  }
153
  echo $txt;
154
  // These two added - 19-Feb-15 - started being required on local dev machine, for unknown reason (probably some plugin that started an output buffer).
155
+ $ob_level = ob_get_level();
156
+ while ($ob_level > 0) {
157
  ob_end_flush();
158
+ $ob_level--;
159
  }
160
  flush();
161
+ if (function_exists('fastcgi_finish_request')) fastcgi_finish_request();*/
162
 
163
+ $wpvivid_plugin->flush($task_id, true);
164
  //Start backup site
165
  $wpvivid_plugin->backup($task_id);
166
  $ret['result']='success';
includes/class-wpvivid-migrate.php CHANGED
@@ -705,6 +705,8 @@ class WPvivid_Migrate
705
 
706
  //Start backup site
707
  global $wpvivid_plugin;
 
 
708
  $wpvivid_plugin->backup($task_id);
709
  die();
710
  }
@@ -732,6 +734,7 @@ class WPvivid_Migrate
732
  global $wpvivid_plugin;
733
  //add_action('wpvivid_handle_upload_succeed',array($this,'wpvivid_deal_upload_succeed'),11);
734
  $wpvivid_plugin->check_backup($task_id,$backup['backup_files']);
 
735
  $wpvivid_plugin->backup($task_id);
736
  //}
737
  die();
705
 
706
  //Start backup site
707
  global $wpvivid_plugin;
708
+ //flush buffer
709
+ $wpvivid_plugin->flush($task_id);
710
  $wpvivid_plugin->backup($task_id);
711
  die();
712
  }
734
  global $wpvivid_plugin;
735
  //add_action('wpvivid_handle_upload_succeed',array($this,'wpvivid_deal_upload_succeed'),11);
736
  $wpvivid_plugin->check_backup($task_id,$backup['backup_files']);
737
+ $wpvivid_plugin->flush($task_id);
738
  $wpvivid_plugin->backup($task_id);
739
  //}
740
  die();
includes/class-wpvivid-public-interface.php CHANGED
@@ -77,6 +77,7 @@ class WPvivid_Public_Interface
77
  }
78
  flush();
79
 
 
80
  //Start backup site
81
  $wpvivid_plugin->backup($task_id);
82
  $ret['result']='success';
77
  }
78
  flush();
79
 
80
+ $wpvivid_plugin->flush($task_id);
81
  //Start backup site
82
  $wpvivid_plugin->backup($task_id);
83
  $ret['result']='success';
includes/class-wpvivid-restore-database.php CHANGED
@@ -878,7 +878,7 @@ class WPvivid_RestoreDB
878
  else
879
  {
880
  $update_query=$temp_query;
881
- $wpvivid_plugin->restore_data->write_log('update replace rows', 'notice');
882
  $this->execute_sql($update_query);
883
  $update_query='';
884
  }
878
  else
879
  {
880
  $update_query=$temp_query;
881
+ //$wpvivid_plugin->restore_data->write_log('update replace rows', 'notice');
882
  $this->execute_sql($update_query);
883
  $update_query='';
884
  }
includes/class-wpvivid-setting.php CHANGED
@@ -628,10 +628,14 @@ class WPvivid_Setting
628
  $check_ret=apply_filters('wpvivid_check_is_pro_mainwp', false);
629
  if(!$check_ret){
630
  $data['is_pro']=false;
 
 
631
  $data['latest_version']='';
632
  }
633
  else{
634
  $data['is_pro']=$check_ret['check_pro'];
 
 
635
  $data['latest_version']=$check_ret['latest_version'];
636
  }
637
  $data['time_zone']=apply_filters('wpvivid_get_time_zone_addon_mainwp', false);
628
  $check_ret=apply_filters('wpvivid_check_is_pro_mainwp', false);
629
  if(!$check_ret){
630
  $data['is_pro']=false;
631
+ $data['is_install']=false;
632
+ $data['is_login']=false;
633
  $data['latest_version']='';
634
  }
635
  else{
636
  $data['is_pro']=$check_ret['check_pro'];
637
+ $data['is_install']=isset($check_ret['check_install']) ? $check_ret['check_install'] : false;
638
+ $data['is_login']=isset($check_ret['check_login']) ? $check_ret['check_login'] : false;
639
  $data['latest_version']=$check_ret['latest_version'];
640
  }
641
  $data['time_zone']=apply_filters('wpvivid_get_time_zone_addon_mainwp', false);
includes/class-wpvivid.php CHANGED
@@ -594,6 +594,8 @@ class WPvivid {
594
  echo json_encode($ret);
595
  die();
596
  }
 
 
597
  $this->backup($task_id);
598
  }
599
  catch (Exception $error) {
@@ -849,6 +851,8 @@ class WPvivid {
849
  if ($ret['result'] == 'success') {
850
  //Check the website data to be backed up.
851
  $this->check_backup($ret['task_id'], $schedule_options['backup']);
 
 
852
  //start backup task.
853
  $this->backup($ret['task_id']);
854
  }
@@ -907,10 +911,14 @@ class WPvivid {
907
  $doing=WPvivid_taskmanager::get_backup_main_task_progress($task_id);
908
  if($doing=='backup')
909
  {
 
 
910
  $this->backup($task_id);
911
  }
912
  else if($doing=='upload')
913
  {
 
 
914
  $this->upload($task_id);
915
  }
916
  //resume backup
@@ -1077,7 +1085,7 @@ class WPvivid {
1077
  //start a watch task event
1078
  $this->add_monitor_event($task_id);
1079
  //flush buffer
1080
- $this->flush($task_id);
1081
  $this->wpvivid_log->OpenLogFile(WPvivid_taskmanager::get_task_options($task_id,'log_file_name'));
1082
  $this->wpvivid_log->WriteLog('Start backing up.','notice');
1083
  $this->wpvivid_log->WriteLogHander();
@@ -1202,7 +1210,7 @@ class WPvivid {
1202
  //start a watch task event
1203
  $this->add_monitor_event($task_id);
1204
  //flush buffer
1205
- $this->flush($task_id);
1206
  $this->wpvivid_log->OpenLogFile(WPvivid_taskmanager::get_task_options($task_id,'log_file_name'));
1207
  $this->wpvivid_log->WriteLog('Start upload.','notice');
1208
 
@@ -2071,7 +2079,37 @@ class WPvivid {
2071
  }
2072
  }
2073
  }
2074
- private function flush($task_id)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2075
  {
2076
  $ret['result']='success';
2077
  $ret['task_id']=$task_id;
@@ -2098,7 +2136,7 @@ class WPvivid {
2098
  ob_flush();
2099
  flush();
2100
  }
2101
- }
2102
  /**
2103
  * return initialization download page data
2104
  *
@@ -2248,7 +2286,6 @@ class WPvivid {
2248
  $ret=$backup_item->get_download_progress($backup_id, $ret['files']);
2249
  WPvivid_taskmanager::update_download_cache($backup_id,$ret);
2250
  }
2251
-
2252
  return $ret;
2253
  }
2254
 
@@ -5234,7 +5271,8 @@ class WPvivid {
5234
  } else {
5235
  $pic = $value['default_pic'];
5236
  }
5237
- $html .= '<img src="' . esc_url(WPVIVID_PLUGIN_URL . $pic) . '" style="vertical-align:middle; " title="' . $title . '"/>';
 
5238
  }
5239
  $html.='<img onclick="wpvivid_click_switch_page(\'wrap\', \'wpvivid_tab_remote_storage\', true);" src="'.esc_url(WPVIVID_PLUGIN_URL.'/admin/partials/images/add-storages.png').'" style="vertical-align:middle;" title="Add a storage"/>';
5240
  }
@@ -5509,7 +5547,7 @@ class WPvivid {
5509
  }
5510
 
5511
  public function hide_mainwp_tab_page(){
5512
- WPvivid_Setting::update_option('wpvivid_hide_mwp_tab_page', true);
5513
  $ret['result']=WPVIVID_SUCCESS;
5514
  echo json_encode($ret);
5515
  die();
594
  echo json_encode($ret);
595
  die();
596
  }
597
+ //flush buffer
598
+ $this->flush($task_id);
599
  $this->backup($task_id);
600
  }
601
  catch (Exception $error) {
851
  if ($ret['result'] == 'success') {
852
  //Check the website data to be backed up.
853
  $this->check_backup($ret['task_id'], $schedule_options['backup']);
854
+ //flush buffer
855
+ $this->flush($ret['task_id']);
856
  //start backup task.
857
  $this->backup($ret['task_id']);
858
  }
911
  $doing=WPvivid_taskmanager::get_backup_main_task_progress($task_id);
912
  if($doing=='backup')
913
  {
914
+ //flush buffer
915
+ $this->flush($task_id);
916
  $this->backup($task_id);
917
  }
918
  else if($doing=='upload')
919
  {
920
+ //flush buffer
921
+ $this->flush($task_id);
922
  $this->upload($task_id);
923
  }
924
  //resume backup
1085
  //start a watch task event
1086
  $this->add_monitor_event($task_id);
1087
  //flush buffer
1088
+ //$this->flush($task_id);
1089
  $this->wpvivid_log->OpenLogFile(WPvivid_taskmanager::get_task_options($task_id,'log_file_name'));
1090
  $this->wpvivid_log->WriteLog('Start backing up.','notice');
1091
  $this->wpvivid_log->WriteLogHander();
1210
  //start a watch task event
1211
  $this->add_monitor_event($task_id);
1212
  //flush buffer
1213
+ //$this->flush($task_id);
1214
  $this->wpvivid_log->OpenLogFile(WPvivid_taskmanager::get_task_options($task_id,'log_file_name'));
1215
  $this->wpvivid_log->WriteLog('Start upload.','notice');
1216
 
2079
  }
2080
  }
2081
  }
2082
+ public function flush($txt, $from_mainwp=false) {
2083
+ if(!$from_mainwp) {
2084
+ $ret['result'] = 'success';
2085
+ $ret['task_id'] = $txt;
2086
+ $txt = json_encode($ret);
2087
+ }
2088
+ else{
2089
+ $ret['result']='success';
2090
+ $txt = '<mainwp>' . base64_encode( serialize( $ret ) ) . '</mainwp>';
2091
+ }
2092
+ if(!headers_sent()){
2093
+ header('Content-Length: '.( ( ! empty( $txt ) ) ? strlen( $txt ) : '0' ));
2094
+ header('Connection: close');
2095
+ header('Content-Encoding: none');
2096
+ }
2097
+ if (session_id())
2098
+ session_write_close();
2099
+ echo $txt;
2100
+
2101
+ if(function_exists('fastcgi_finish_request'))
2102
+ {
2103
+ fastcgi_finish_request();
2104
+ }
2105
+ else
2106
+ {
2107
+ if(ob_get_level()>0)
2108
+ ob_flush();
2109
+ flush();
2110
+ }
2111
+ }
2112
+ /*private function flush($task_id)
2113
  {
2114
  $ret['result']='success';
2115
  $ret['task_id']=$task_id;
2136
  ob_flush();
2137
  flush();
2138
  }
2139
+ }*/
2140
  /**
2141
  * return initialization download page data
2142
  *
2286
  $ret=$backup_item->get_download_progress($backup_id, $ret['files']);
2287
  WPvivid_taskmanager::update_download_cache($backup_id,$ret);
2288
  }
 
2289
  return $ret;
2290
  }
2291
 
5271
  } else {
5272
  $pic = $value['default_pic'];
5273
  }
5274
+ $url = apply_filters('wpvivid_get_wpvivid_pro_url', WPVIVID_PLUGIN_URL, $key);
5275
+ $html .= '<img src="' . esc_url($url . $pic) . '" style="vertical-align:middle; " title="' . $title . '"/>';
5276
  }
5277
  $html.='<img onclick="wpvivid_click_switch_page(\'wrap\', \'wpvivid_tab_remote_storage\', true);" src="'.esc_url(WPVIVID_PLUGIN_URL.'/admin/partials/images/add-storages.png').'" style="vertical-align:middle;" title="Add a storage"/>';
5278
  }
5547
  }
5548
 
5549
  public function hide_mainwp_tab_page(){
5550
+ WPvivid_Setting::update_option('wpvivid_hide_mwp_tab_page_v1', true);
5551
  $ret['result']=WPVIVID_SUCCESS;
5552
  echo json_encode($ret);
5553
  die();
includes/customclass/class-wpvivid-s3.php CHANGED
@@ -2476,7 +2476,7 @@ final class WPvivid_S3Request
2476
  elseif ($header == 'Content-Type')
2477
  $this->response->headers['type'] = $value;
2478
  elseif ($header == 'ETag')
2479
- $this->response->headers['hash'] = $value{0} == '"' ? substr($value, 1, -1) : $value;
2480
  elseif (preg_match('/^x-amz-meta-.*$/', $header))
2481
  $this->response->headers[$header] = $value;
2482
  }
2476
  elseif ($header == 'Content-Type')
2477
  $this->response->headers['type'] = $value;
2478
  elseif ($header == 'ETag')
2479
+ $this->response->headers['hash'] = $value[0] == '"' ? substr($value, 1, -1) : $value;
2480
  elseif (preg_match('/^x-amz-meta-.*$/', $header))
2481
  $this->response->headers[$header] = $value;
2482
  }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === Migrate & Backup WordPress - WPvivid Backup Plugin ===
2
  Contributors: wpvivid
3
  Tags: move, clone, migrate, copy, backup, restore, auto backup, cloud backup
4
  Requires at least: 4.5
5
  Tested up to: 5.3.2
6
  Requires PHP: 5.3
7
- Stable tag: 0.9.33
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
10
 
@@ -16,8 +16,10 @@ WPvivid Backup Plugin is the only free all-in-one backup, restore and migration
16
  Migrate a copy of WP site to a new host (a new domain),schedule backups,send backups to leading remote storage. All in one backup&migration plugin.
17
 
18
  == WPvivid Backup for MainWP ==
19
- [WPvivid Backup for MainWP](https://wordpress.org/plugins/wpvivid-backup-mainwp/) is now available to download.
20
- This extension allows you to set up and control WPvivid Backup Plugin for all child sites directly from your MainWP dashboard.
 
 
21
 
22
  == WPvivid Backup Pro is Now Available ==
23
  * Customize everything to backup
@@ -169,6 +171,12 @@ Thank you for translating WPvivid Backup Plugin to your languages!
169
  * [Shohei OKADA](https://ja.gravatar.com/silversword0630)(Japanese)
170
 
171
  == Changelog ==
 
 
 
 
 
 
172
  = 0.9.33 =
173
  - Fixed:Replacing domain failed after migrating on servers using innodb database engine.
174
  - Fixed: Compressed packages were lost in some cases.
1
+ === Migrate & Backup WordPress - WPvivid Backup Plugin ===
2
  Contributors: wpvivid
3
  Tags: move, clone, migrate, copy, backup, restore, auto backup, cloud backup
4
  Requires at least: 4.5
5
  Tested up to: 5.3.2
6
  Requires PHP: 5.3
7
+ Stable tag: 0.9.34
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
10
 
16
  Migrate a copy of WP site to a new host (a new domain),schedule backups,send backups to leading remote storage. All in one backup&migration plugin.
17
 
18
  == WPvivid Backup for MainWP ==
19
+ [WPvivid Backup for MainWP](https://wpvivid.com/wpvivid-backup-for-mainwp) is now available to download.
20
+ This extension allows you to set up and control WPvivid Backup Free and Pro for all child sites directly from your MainWP dashboard.
21
+
22
+ Click to download [WPvivid Backup for MainWP](https://wordpress.org/plugins/wpvivid-backup-mainwp/)
23
 
24
  == WPvivid Backup Pro is Now Available ==
25
  * Customize everything to backup
171
  * [Shohei OKADA](https://ja.gravatar.com/silversword0630)(Japanese)
172
 
173
  == Changelog ==
174
+ = 0.9.34 =
175
+ - Fixed the PHP 7.4 compatibility issue.
176
+ - Fixed: Backing up upload directory failed in some cases.
177
+ - Fixed: Backup filenames did not match the downloads part numbers.
178
+ - Updated the API for WPvivid Backup for MainWP extension.
179
+ - Fixed some bugs in the plugin code.
180
  = 0.9.33 =
181
  - Fixed:Replacing domain failed after migrating on servers using innodb database engine.
182
  - Fixed: Compressed packages were lost in some cases.
uninstall.php CHANGED
@@ -32,7 +32,7 @@ delete_option('cron_backup_count');
32
  delete_option('wpvivid_backup_success_count');
33
  delete_option('wpvivid_backup_error_array');
34
  delete_option('wpvivid_amazons3_notice');
35
- delete_option('wpvivid_hide_mwp_tab_page');
36
  delete_option('wpvivid_hide_wp_cron_notice');
37
  delete_option('wpvivid_transfer_error_array');
38
  delete_option('wpvivid_transfer_success_count');
32
  delete_option('wpvivid_backup_success_count');
33
  delete_option('wpvivid_backup_error_array');
34
  delete_option('wpvivid_amazons3_notice');
35
+ delete_option('wpvivid_hide_mwp_tab_page_v1');
36
  delete_option('wpvivid_hide_wp_cron_notice');
37
  delete_option('wpvivid_transfer_error_array');
38
  delete_option('wpvivid_transfer_success_count');
wpvivid-backuprestore.php CHANGED
@@ -7,7 +7,7 @@
7
  * @wordpress-plugin
8
  * Plugin Name: WPvivid Backup Plugin
9
  * Description: Clone or copy WP sites then move or migrate them to new host (new domain), schedule backups, transfer backups to leading remote storage. All in one.
10
- * Version: 0.9.33
11
  * Author: WPvivid Team
12
  * Author URI: https://wpvivid.com
13
  * License: GPL-3.0+
@@ -21,7 +21,7 @@ if ( ! defined( 'WPINC' ) ) {
21
  die;
22
  }
23
 
24
- define( 'WPVIVID_PLUGIN_VERSION', '0.9.33' );
25
  //
26
  define('WPVIVID_RESTORE_INIT','init');
27
  define('WPVIVID_RESTORE_READY','ready');
7
  * @wordpress-plugin
8
  * Plugin Name: WPvivid Backup Plugin
9
  * Description: Clone or copy WP sites then move or migrate them to new host (new domain), schedule backups, transfer backups to leading remote storage. All in one.
10
+ * Version: 0.9.34
11
  * Author: WPvivid Team
12
  * Author URI: https://wpvivid.com
13
  * License: GPL-3.0+
21
  die;
22
  }
23
 
24
+ define( 'WPVIVID_PLUGIN_VERSION', '0.9.34' );
25
  //
26
  define('WPVIVID_RESTORE_INIT','init');
27
  define('WPVIVID_RESTORE_READY','ready');