Migration, Backup, Staging – WPvivid - Version 0.9.40

Version Description

  • Fixed: Backup schedules failed in some cases.
  • Excluded the session_mm_cgi-fcgi file when creating a backup.
  • Fixed some bugs in the plugin code.
Download this release

Release Info

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

Code changes from version 0.9.39 to 0.9.40

includes/class-wpvivid-backup.php CHANGED
@@ -437,6 +437,7 @@ class WPvivid_Backup_Task
437
  $include_regex[]='#^'.preg_quote($this->transfer_path(ABSPATH.DIRECTORY_SEPARATOR.'wp-includes'), '/').'#';
438
  $exclude_regex[]='#^'.preg_quote($this->transfer_path(ABSPATH.DIRECTORY_SEPARATOR.'wp-admin'.DIRECTORY_SEPARATOR), '/').'pclzip-.*\.tmp#';
439
  $exclude_regex[]='#^'.preg_quote($this->transfer_path(ABSPATH.DIRECTORY_SEPARATOR.'wp-admin'.DIRECTORY_SEPARATOR), '/').'pclzip-.*\.gz#';
 
440
  $exclude_regex=apply_filters('wpvivid_get_backup_exclude_regex',$exclude_regex,WPVIVID_BACKUP_TYPE_CORE);
441
  $backup_data['exclude_regex']=$exclude_regex;
442
  $backup_data['include_regex']=$include_regex;
437
  $include_regex[]='#^'.preg_quote($this->transfer_path(ABSPATH.DIRECTORY_SEPARATOR.'wp-includes'), '/').'#';
438
  $exclude_regex[]='#^'.preg_quote($this->transfer_path(ABSPATH.DIRECTORY_SEPARATOR.'wp-admin'.DIRECTORY_SEPARATOR), '/').'pclzip-.*\.tmp#';
439
  $exclude_regex[]='#^'.preg_quote($this->transfer_path(ABSPATH.DIRECTORY_SEPARATOR.'wp-admin'.DIRECTORY_SEPARATOR), '/').'pclzip-.*\.gz#';
440
+ $exclude_regex[]='#session_mm_cgi-fcgi#';
441
  $exclude_regex=apply_filters('wpvivid_get_backup_exclude_regex',$exclude_regex,WPVIVID_BACKUP_TYPE_CORE);
442
  $backup_data['exclude_regex']=$exclude_regex;
443
  $backup_data['include_regex']=$include_regex;
includes/class-wpvivid-setting.php CHANGED
@@ -661,6 +661,8 @@ class WPvivid_Setting
661
  $data['menu_capability'] = apply_filters('wpvivid_get_menu_capability_mainwp', array());
662
 
663
  $data['white_label_setting'] = apply_filters('wpvivid_get_white_label_mainwp', array());
 
 
664
  return $data;
665
  }
666
  }
661
  $data['menu_capability'] = apply_filters('wpvivid_get_menu_capability_mainwp', array());
662
 
663
  $data['white_label_setting'] = apply_filters('wpvivid_get_white_label_mainwp', array());
664
+
665
+ $data['incremental_backup_setting'] = apply_filters('wpvivid_get_incremental_backup_mainwp', array());
666
  return $data;
667
  }
668
  }
includes/class-wpvivid-zipclass.php CHANGED
@@ -56,7 +56,10 @@ class WPvivid_ZipClass extends Wpvivid_Compress_Default
56
  }
57
  }
58
  }
59
- $package['json']['root_flag'] = $data['root_flag'];
 
 
 
60
  $package['json']['file']=basename($path);
61
  $package['path'] = $path;
62
  $package['files'] = $files[$i];
@@ -88,8 +91,10 @@ class WPvivid_ZipClass extends Wpvivid_Compress_Default
88
  $remove_path_size = strlen( $this -> transfer_path(get_home_path()));
89
  $package['json']['root'] = substr($data['root_path'], $remove_path_size);
90
  */
91
-
92
- $package['json']['root_flag'] = $data['root_flag'];
 
 
93
  $package['json']['file']=basename($path);
94
  $package['path'] = $path;
95
  $package['files'] = $files[0];
@@ -134,7 +139,10 @@ class WPvivid_ZipClass extends Wpvivid_Compress_Default
134
  $remove_path_size = strlen( $this -> transfer_path(get_home_path()));
135
  $package['json']['root'] = substr($data['root_path'], $remove_path_size);
136
  */
137
- $package['json']['root_flag'] = $data['root_flag'];
 
 
 
138
  $package['json']['file']=basename($path);
139
  $package['path'] = $path;
140
  $package['files'] = $files[$i];
@@ -152,7 +160,10 @@ class WPvivid_ZipClass extends Wpvivid_Compress_Default
152
  $remove_path_size = strlen( $this -> transfer_path(get_home_path()));
153
  $package['json']['root'] = substr($data['root_path'], $remove_path_size);
154
  */
155
- $package['json']['root_flag'] = $data['root_flag'];
 
 
 
156
  $package['json']['file']=basename($path);
157
  $package['path'] = $path;
158
  $package['files'] = $files[0];
@@ -198,7 +209,10 @@ class WPvivid_ZipClass extends Wpvivid_Compress_Default
198
  $remove_path_size = strlen( $this -> transfer_path(get_home_path()));
199
  $package['json']['root'] = substr($data['root_path'], $remove_path_size);
200
  */
201
- $package['json']['root_flag'] = $data['root_flag'];
 
 
 
202
  $package['json']['file']=basename($path);
203
  $package['path'] = $path;
204
  $package['files'] = $file;
@@ -216,7 +230,10 @@ class WPvivid_ZipClass extends Wpvivid_Compress_Default
216
  $remove_path_size = strlen( $this -> transfer_path(get_home_path()));
217
  $package['json']['root'] = substr($data['root_path'], $remove_path_size);
218
  */
219
- $package['json']['root_flag'] = $data['root_flag'];
 
 
 
220
  $package['json']['file']=basename($path);
221
  $package['path'] = $path;
222
  $package['files'] = $files[0];
@@ -256,7 +273,10 @@ class WPvivid_ZipClass extends Wpvivid_Compress_Default
256
  }
257
  }
258
  }
259
- $package_file['json']['root_flag'] = $data['root_flag'];
 
 
 
260
  $package_file['json']['file']=basename($path);
261
  $package_file['path'] = $path;
262
  $package_file['files'] = $file;
@@ -303,7 +323,10 @@ class WPvivid_ZipClass extends Wpvivid_Compress_Default
303
  $remove_path_size = strlen( $this -> transfer_path(get_home_path()));
304
  $package['json']['root'] = substr($data['root_path'], $remove_path_size);
305
  */
306
- $package['json']['root_flag'] = $data['root_flag'];
 
 
 
307
  $package['json']['file']=basename($path);
308
  $package['path'] = $path;
309
  $package['files'] = $files[$i];
@@ -320,7 +343,11 @@ class WPvivid_ZipClass extends Wpvivid_Compress_Default
320
  $remove_path_size = strlen( $this -> transfer_path(get_home_path()));
321
  $package['json']['root'] = substr($data['root_path'], $remove_path_size);
322
  */
323
- $package['json']['root_flag'] = $data['root_flag'];
 
 
 
 
324
  $package['json']['file']=basename($path);
325
  $package['path'] = $path;
326
  $package['files'] = $files[0];
56
  }
57
  }
58
  }
59
+ if(isset($data['root_flag']))
60
+ $package['json']['root_flag'] = $data['root_flag'];
61
+ if(isset($data['root_path']))
62
+ $package['json']['root_path'] = $data['root_path'];
63
  $package['json']['file']=basename($path);
64
  $package['path'] = $path;
65
  $package['files'] = $files[$i];
91
  $remove_path_size = strlen( $this -> transfer_path(get_home_path()));
92
  $package['json']['root'] = substr($data['root_path'], $remove_path_size);
93
  */
94
+ if(isset($data['root_flag']))
95
+ $package['json']['root_flag'] = $data['root_flag'];
96
+ if(isset($data['root_path']))
97
+ $package['json']['root_path'] = $data['root_path'];
98
  $package['json']['file']=basename($path);
99
  $package['path'] = $path;
100
  $package['files'] = $files[0];
139
  $remove_path_size = strlen( $this -> transfer_path(get_home_path()));
140
  $package['json']['root'] = substr($data['root_path'], $remove_path_size);
141
  */
142
+ if(isset($data['root_flag']))
143
+ $package['json']['root_flag'] = $data['root_flag'];
144
+ if(isset($data['root_path']))
145
+ $package['json']['root_path'] = $data['root_path'];
146
  $package['json']['file']=basename($path);
147
  $package['path'] = $path;
148
  $package['files'] = $files[$i];
160
  $remove_path_size = strlen( $this -> transfer_path(get_home_path()));
161
  $package['json']['root'] = substr($data['root_path'], $remove_path_size);
162
  */
163
+ if(isset($data['root_flag']))
164
+ $package['json']['root_flag'] = $data['root_flag'];
165
+ if(isset($data['root_path']))
166
+ $package['json']['root_path'] = $data['root_path'];
167
  $package['json']['file']=basename($path);
168
  $package['path'] = $path;
169
  $package['files'] = $files[0];
209
  $remove_path_size = strlen( $this -> transfer_path(get_home_path()));
210
  $package['json']['root'] = substr($data['root_path'], $remove_path_size);
211
  */
212
+ if(isset($data['root_flag']))
213
+ $package['json']['root_flag'] = $data['root_flag'];
214
+ if(isset($data['root_path']))
215
+ $package['json']['root_path'] = $data['root_path'];
216
  $package['json']['file']=basename($path);
217
  $package['path'] = $path;
218
  $package['files'] = $file;
230
  $remove_path_size = strlen( $this -> transfer_path(get_home_path()));
231
  $package['json']['root'] = substr($data['root_path'], $remove_path_size);
232
  */
233
+ if(isset($data['root_flag']))
234
+ $package['json']['root_flag'] = $data['root_flag'];
235
+ if(isset($data['root_path']))
236
+ $package['json']['root_path'] = $data['root_path'];
237
  $package['json']['file']=basename($path);
238
  $package['path'] = $path;
239
  $package['files'] = $files[0];
273
  }
274
  }
275
  }
276
+ if(isset($data['root_path']))
277
+ $package['json']['root_path'] = $data['root_path'];
278
+ if(isset($data['root_flag']))
279
+ $package_file['json']['root_flag'] = $data['root_flag'];
280
  $package_file['json']['file']=basename($path);
281
  $package_file['path'] = $path;
282
  $package_file['files'] = $file;
323
  $remove_path_size = strlen( $this -> transfer_path(get_home_path()));
324
  $package['json']['root'] = substr($data['root_path'], $remove_path_size);
325
  */
326
+ if(isset($data['root_flag']))
327
+ $package['json']['root_flag'] = $data['root_flag'];
328
+ if(isset($options['root_path']))
329
+ $package['json']['root_path'] = $data['root_path'];
330
  $package['json']['file']=basename($path);
331
  $package['path'] = $path;
332
  $package['files'] = $files[$i];
343
  $remove_path_size = strlen( $this -> transfer_path(get_home_path()));
344
  $package['json']['root'] = substr($data['root_path'], $remove_path_size);
345
  */
346
+ if(isset($data['root_flag']))
347
+ $package['json']['root_flag'] = $data['root_flag'];
348
+ if(isset($options['root_path']))
349
+ $package['json']['root_path'] = $data['root_path'];
350
+
351
  $package['json']['file']=basename($path);
352
  $package['path'] = $path;
353
  $package['files'] = $files[0];
includes/class-wpvivid.php CHANGED
@@ -370,6 +370,9 @@ class WPvivid {
370
  add_action('wp_ajax_wpvivid_hide_mainwp_tab_page', array($this, 'hide_mainwp_tab_page'));
371
  add_action('wp_ajax_wpvivid_hide_wp_cron_notice', array($this, 'hide_wp_cron_notice'));
372
  //wpvivid_task_monitor
 
 
 
373
  }
374
 
375
  public function get_plugin_name()
@@ -2380,6 +2383,7 @@ class WPvivid {
2380
  echo '<a href="'.$admin_url.'admin.php?page=WPvivid">file not found. please retry again.</a>';
2381
  die();
2382
  }
 
2383
  /**
2384
  * List backup record
2385
  *
@@ -5663,6 +5667,89 @@ class WPvivid {
5663
  die();
5664
  }
5665
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5666
  public function set_mail_subject($subject, $task){
5667
  $subject=WPvivid_mail_report::create_subject($task);
5668
  return $subject;
370
  add_action('wp_ajax_wpvivid_hide_mainwp_tab_page', array($this, 'hide_mainwp_tab_page'));
371
  add_action('wp_ajax_wpvivid_hide_wp_cron_notice', array($this, 'hide_wp_cron_notice'));
372
  //wpvivid_task_monitor
373
+
374
+ //download backup by mainwp
375
+ add_action('wp_ajax_wpvivid_download_backup_mainwp', array($this, 'download_backup_mainwp'));
376
  }
377
 
378
  public function get_plugin_name()
2383
  echo '<a href="'.$admin_url.'admin.php?page=WPvivid">file not found. please retry again.</a>';
2384
  die();
2385
  }
2386
+
2387
  /**
2388
  * List backup record
2389
  *
5667
  die();
5668
  }
5669
 
5670
+ public function download_backup_mainwp()
5671
+ {
5672
+ try {
5673
+ if (isset($_REQUEST['backup_id']) && isset($_REQUEST['file_name'])) {
5674
+ if (!empty($_REQUEST['backup_id']) && is_string($_REQUEST['backup_id'])) {
5675
+ $backup_id = sanitize_key($_REQUEST['backup_id']);
5676
+ } else {
5677
+ die();
5678
+ }
5679
+
5680
+ if (!empty($_REQUEST['file_name']) && is_string($_REQUEST['file_name'])) {
5681
+ //$file_name=sanitize_file_name($_REQUEST['file_name']);
5682
+ $file_name = $_REQUEST['file_name'];
5683
+ } else {
5684
+ die();
5685
+ }
5686
+
5687
+ $cache = WPvivid_taskmanager::get_download_cache($backup_id);
5688
+ if ($cache === false) {
5689
+ $this->init_download($backup_id);
5690
+ $cache = WPvivid_taskmanager::get_download_cache($backup_id);
5691
+ }
5692
+ $path = false;
5693
+ if (array_key_exists($file_name, $cache['files'])) {
5694
+ if ($cache['files'][$file_name]['status'] == 'completed') {
5695
+ $path = $cache['files'][$file_name]['download_path'];
5696
+ }
5697
+ }
5698
+ if ($path !== false) {
5699
+ if (file_exists($path)) {
5700
+ if (session_id())
5701
+ session_write_close();
5702
+
5703
+ $size = filesize($path);
5704
+ if (!headers_sent()) {
5705
+ header('Content-Description: File Transfer');
5706
+ header('Content-Type: application/zip');
5707
+ header('Content-Disposition: attachment; filename="' . basename($path) . '"');
5708
+ header('Cache-Control: must-revalidate');
5709
+ header('Content-Length: ' . $size);
5710
+ header('Content-Transfer-Encoding: binary');
5711
+ }
5712
+
5713
+ if ($size < 1024 * 1024 * 60) {
5714
+ ob_end_clean();
5715
+ readfile($path);
5716
+ exit;
5717
+ } else {
5718
+ ob_end_clean();
5719
+ $download_rate = 1024 * 10;
5720
+ $file = fopen($path, "r");
5721
+ while (!feof($file)) {
5722
+ @set_time_limit(20);
5723
+ // send the current file part to the browser
5724
+ print fread($file, round($download_rate * 1024));
5725
+ // flush the content to the browser
5726
+ flush();
5727
+
5728
+ if (ob_get_level())
5729
+ {
5730
+ ob_end_clean();
5731
+ }
5732
+ // sleep one second
5733
+ sleep(1);
5734
+ }
5735
+ fclose($file);
5736
+ exit;
5737
+ }
5738
+ }
5739
+ }
5740
+ }
5741
+ }
5742
+ catch (Exception $error) {
5743
+ $message = 'An exception has occurred. class: '.get_class($error).';msg: '.$error->getMessage().';code: '.$error->getCode().';line: '.$error->getLine().';in_file: '.$error->getFile().';';
5744
+ error_log($message);
5745
+ echo json_encode(array('result'=>'failed','error'=>$message));
5746
+ die();
5747
+ }
5748
+ $admin_url = admin_url();
5749
+ echo '<a href="'.$admin_url.'admin.php?page=WPvivid">file not found. please retry again.</a>';
5750
+ die();
5751
+ }
5752
+
5753
  public function set_mail_subject($subject, $task){
5754
  $subject=WPvivid_mail_report::create_subject($task);
5755
  return $subject;
readme.txt CHANGED
@@ -2,9 +2,9 @@
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.4
6
  Requires PHP: 5.3
7
- Stable tag: 0.9.39
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
10
 
@@ -177,6 +177,10 @@ Thank you for translating WPvivid Backup Plugin to your languages!
177
  * [Shohei OKADA](https://ja.gravatar.com/silversword0630)(Japanese)
178
 
179
  == Changelog ==
 
 
 
 
180
  = 0.9.39 =
181
  - Excluded the /wphb-cache directory when creating a backup.
182
  - Fixed: Root directory is now forbidden to set to '/' when connecting to a FTP server.
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.4.1
6
  Requires PHP: 5.3
7
+ Stable tag: 0.9.40
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
10
 
177
  * [Shohei OKADA](https://ja.gravatar.com/silversword0630)(Japanese)
178
 
179
  == Changelog ==
180
+ = 0.9.40 =
181
+ - Fixed: Backup schedules failed in some cases.
182
+ - Excluded the session_mm_cgi-fcgi file when creating a backup.
183
+ - Fixed some bugs in the plugin code.
184
  = 0.9.39 =
185
  - Excluded the /wphb-cache directory when creating a backup.
186
  - Fixed: Root directory is now forbidden to set to '/' when connecting to a FTP server.
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.39
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.39' );
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.40
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.40' );
25
  //
26
  define('WPVIVID_RESTORE_INIT','init');
27
  define('WPVIVID_RESTORE_READY','ready');