Migration, Backup, Staging – WPvivid - Version 0.9.39

Version Description

  • Excluded the /wphb-cache directory when creating a backup.
  • Fixed: Rootdirectoryisnow forbiddentosetto'/'whenconnectingtoa FTPserver.
  • Fixed the pagination issue in the process of exporting pages.
  • Fixed some bugs in the plugin code.
Download this release

Release Info

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

Code changes from version 0.9.38 to 0.9.39

admin/class-wpvivid-admin.php CHANGED
@@ -358,7 +358,7 @@ class WPvivid_Admin {
358
  if($need_review=='not')
359
  {
360
  WPvivid_Setting::update_option('wpvivid_need_review','show');
361
- $msg = apply_filters('wpvivid_custom_trademarks', __('Cheers! WPvivid Backup plugin has restored successfully your website. If you found WPvivid Backup plugin helpful, a 5-star rating would be highly appreciated, which motivates us to keep providing new features.', 'wpvivid'));
362
  WPvivid_Setting::update_option('wpvivid_review_msg',$msg);
363
  }
364
  else{
358
  if($need_review=='not')
359
  {
360
  WPvivid_Setting::update_option('wpvivid_need_review','show');
361
+ $msg = __('Cheers! WPvivid Backup plugin has restored successfully your website. If you found WPvivid Backup plugin helpful, a 5-star rating would be highly appreciated, which motivates us to keep providing new features.', 'wpvivid');
362
  WPvivid_Setting::update_option('wpvivid_review_msg',$msg);
363
  }
364
  else{
admin/js/wpvivid-admin.js CHANGED
@@ -568,7 +568,8 @@ function wpvivid_clear_notice(notice_id){
568
  jQuery('#'+notice_id).hide();
569
  }
570
 
571
- function wpvivid_click_switch_page(tab, type, scroll){
 
572
  jQuery('.'+tab+'-tab-content:not(.' + type + ')').hide();
573
  jQuery('.'+tab+'-tab-content.' + type).show();
574
  jQuery('.'+tab+'-nav-tab:not(#' + type + ')').removeClass('nav-tab-active');
568
  jQuery('#'+notice_id).hide();
569
  }
570
 
571
+ function wpvivid_click_switch_page(tab, type, scroll)
572
+ {
573
  jQuery('.'+tab+'-tab-content:not(.' + type + ')').hide();
574
  jQuery('.'+tab+'-tab-content.' + type).show();
575
  jQuery('.'+tab+'-nav-tab:not(#' + type + ')').removeClass('nav-tab-active');
includes/class-wpvivid-backup-database.php CHANGED
@@ -72,6 +72,7 @@ class WPvivid_Backup_Database
72
  $host = $sql_info['host'];
73
  $user = $sql_info['user'];
74
  $pass = $sql_info['pass'];
 
75
  $dump = new WPvivid_Mysqldump($host, $database_name, $user, $pass, $is_additional_db, array('exclude-tables'=>$exclude,'add-drop-table' => true,'extended-insert'=>false));
76
 
77
  if (file_exists($backup_file))
72
  $host = $sql_info['host'];
73
  $user = $sql_info['user'];
74
  $pass = $sql_info['pass'];
75
+
76
  $dump = new WPvivid_Mysqldump($host, $database_name, $user, $pass, $is_additional_db, array('exclude-tables'=>$exclude,'add-drop-table' => true,'extended-insert'=>false));
77
 
78
  if (file_exists($backup_file))
includes/class-wpvivid-backup-uploader.php CHANGED
@@ -149,17 +149,6 @@ class Wpvivid_BackupUploader
149
  die();
150
  }
151
 
152
- function wpvivid_write_upload_log($message, $id = ''){
153
- if($id === ''){
154
- $id=uniqid('wpvivid-');
155
- }
156
- global $wpvivid_plugin;
157
- $wpvivid_plugin->upload_log=new WPvivid_Log();
158
- $wpvivid_plugin->upload_log->CreateLogFile($id.'_upload','no_folder','upload');
159
- $wpvivid_plugin->upload_log->WriteLogHander();
160
- $wpvivid_plugin->upload_log->WriteLog($message,'notice');
161
- }
162
-
163
  function upload_files_finish()
164
  {
165
  global $wpvivid_plugin;
@@ -172,8 +161,6 @@ class Wpvivid_BackupUploader
172
  $files =json_decode($files,true);
173
  if(is_null($files))
174
  {
175
- $message = 'Failed to decode files.';
176
- $this->wpvivid_write_upload_log($message);
177
  die();
178
  }
179
 
@@ -219,12 +206,7 @@ class Wpvivid_BackupUploader
219
  }
220
  }
221
  if($check_result === true){
222
- global $wpvivid_plugin;
223
- $wpvivid_plugin->wpvivid_log=new WPvivid_Log();
224
- $wpvivid_plugin->wpvivid_log->CreateLogFile($id.'_upload','no_folder','upload');
225
- $wpvivid_plugin->wpvivid_log->WriteLogHander();
226
- $wpvivid_plugin->wpvivid_log->WriteLog('Upload finished.','notice');
227
- WPvivid_Backuplist::add_new_upload_backup($id,$backup_data,$time,$wpvivid_plugin->wpvivid_log->log_file);
228
  $html = '';
229
  $html = apply_filters('wpvivid_add_backup_list', $html);
230
  $ret['result']=WPVIVID_SUCCESS;
@@ -238,29 +220,21 @@ class Wpvivid_BackupUploader
238
  $ret['result']=WPVIVID_FAILED;
239
  $ret['error']='Upload file failed.';
240
  $ret['unlinked']=$unlinked_file;
241
- $message = $ret['error'] . $unlinked_file;
242
- $this->wpvivid_write_upload_log($message);
243
  }
244
  }
245
  else
246
  {
247
- $message = 'The backup is not created by WPvivid backup plugin.';
248
- $this->wpvivid_write_upload_log($message);
249
  $ret['result']=WPVIVID_FAILED;
250
  $ret['error']='The backup is not created by WPvivid backup plugin.';
251
  }
252
  }
253
  else
254
  {
255
- $message = 'The backup is not created by WPvivid backup plugin.';
256
- $this->wpvivid_write_upload_log($message);
257
  $ret['result']=WPVIVID_FAILED;
258
  $ret['error']='The backup is not created by WPvivid backup plugin.';
259
  }
260
  }
261
  else{
262
- $message = 'Failed to post file name.';
263
- $this->wpvivid_write_upload_log($message);
264
  $ret['result']=WPVIVID_FAILED;
265
  $ret['error']='Failed to post file name.';
266
  }
@@ -412,12 +386,6 @@ class Wpvivid_BackupUploader
412
  }
413
  }
414
  else{
415
- global $wpvivid_plugin;
416
- $wpvivid_plugin->wpvivid_log=new WPvivid_Log();
417
- $id=uniqid('wpvivid-');
418
- $wpvivid_plugin->wpvivid_log->CreateLogFile($id.'_scan','no_folder','scan');
419
- $wpvivid_plugin->wpvivid_log->WriteLogHander();
420
- $wpvivid_plugin->wpvivid_log->WriteLog('Failed to get local storage directory.','notice');
421
  $ret['result']=WPVIVID_FAILED;
422
  $ret['error']='Failed to get local storage directory.';
423
  }
@@ -455,12 +423,7 @@ class Wpvivid_BackupUploader
455
  $backup_data['files'][]=$add_file;
456
  }
457
 
458
- global $wpvivid_plugin;
459
- $wpvivid_plugin->wpvivid_log=new WPvivid_Log();
460
- $wpvivid_plugin->wpvivid_log->CreateLogFile($backup_id.'_scan','no_folder','scan');
461
- $wpvivid_plugin->wpvivid_log->WriteLogHander();
462
- $wpvivid_plugin->wpvivid_log->WriteLog('Upload finished.','notice');
463
- WPvivid_Backuplist::add_new_upload_backup($backup_id,$backup_data,$time,$wpvivid_plugin->wpvivid_log->log_file);
464
  }
465
  }
466
  $ret['result']=WPVIVID_SUCCESS;
149
  die();
150
  }
151
 
 
 
 
 
 
 
 
 
 
 
 
152
  function upload_files_finish()
153
  {
154
  global $wpvivid_plugin;
161
  $files =json_decode($files,true);
162
  if(is_null($files))
163
  {
 
 
164
  die();
165
  }
166
 
206
  }
207
  }
208
  if($check_result === true){
209
+ WPvivid_Backuplist::add_new_upload_backup($id,$backup_data,$time,'');
 
 
 
 
 
210
  $html = '';
211
  $html = apply_filters('wpvivid_add_backup_list', $html);
212
  $ret['result']=WPVIVID_SUCCESS;
220
  $ret['result']=WPVIVID_FAILED;
221
  $ret['error']='Upload file failed.';
222
  $ret['unlinked']=$unlinked_file;
 
 
223
  }
224
  }
225
  else
226
  {
 
 
227
  $ret['result']=WPVIVID_FAILED;
228
  $ret['error']='The backup is not created by WPvivid backup plugin.';
229
  }
230
  }
231
  else
232
  {
 
 
233
  $ret['result']=WPVIVID_FAILED;
234
  $ret['error']='The backup is not created by WPvivid backup plugin.';
235
  }
236
  }
237
  else{
 
 
238
  $ret['result']=WPVIVID_FAILED;
239
  $ret['error']='Failed to post file name.';
240
  }
386
  }
387
  }
388
  else{
 
 
 
 
 
 
389
  $ret['result']=WPVIVID_FAILED;
390
  $ret['error']='Failed to get local storage directory.';
391
  }
423
  $backup_data['files'][]=$add_file;
424
  }
425
 
426
+ WPvivid_Backuplist::add_new_upload_backup($backup_id,$backup_data,$time,'');
 
 
 
 
 
427
  }
428
  }
429
  $ret['result']=WPVIVID_SUCCESS;
includes/class-wpvivid-backup.php CHANGED
@@ -50,6 +50,67 @@ class WPvivid_Backup_Task
50
  $this->backup_type_collect[WPVIVID_BACKUP_TYPE_MERGE]=1;
51
 
52
  add_filter('wpvivid_set_backup', array($this, 'wpvivid_set_backup'),10);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  }
54
 
55
  public function get_id()
@@ -154,6 +215,8 @@ class WPvivid_Backup_Task
154
  else
155
  $this->task['options']['file_prefix'] = $backup_prefix . '_' . $this->task['id'] . '_' . date('Y-m-d-H-i', $this->task['status']['start_time']+$offset*60*60);
156
 
 
 
157
  if(isset($general_setting['options']['wpvivid_common_setting']['ismerge']))
158
  {
159
  if($general_setting['options']['wpvivid_common_setting']['ismerge']==1)
@@ -307,9 +370,7 @@ class WPvivid_Backup_Task
307
  }
308
  $backup_data['files_root']=$this->transfer_path(WP_PLUGIN_DIR);
309
 
310
- $exclude_plugins[]='wpvivid-backuprestore';
311
- $exclude_plugins[]='wp-cerber';
312
- $exclude_plugins[]='.';
313
  $exclude_plugins=apply_filters('wpvivid_exclude_plugins',$exclude_plugins);
314
  $exclude_regex=array();
315
  foreach ($exclude_plugins as $exclude_plugin)
@@ -328,9 +389,9 @@ class WPvivid_Backup_Task
328
  $backup_data['prefix']=$this->get_prefix().'_backup_uploads';
329
  $upload_dir = wp_upload_dir();
330
  $backup_data['files_root']=$this -> transfer_path($upload_dir['basedir']);
331
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'backwpup', '/').'#'; // BackWPup backup directory
332
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'backup-guard', '/').'#'; // Wordpress Backup and Migrate Plugin backup directory
333
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'ShortpixelBackups', '/').'#';//ShortpixelBackups
334
  $backup_data['exclude_regex']=$exclude_regex;
335
  $backup_data['include_regex']=array();
336
  $backup_data['json_info']['file_type']='upload';
@@ -343,49 +404,21 @@ class WPvivid_Backup_Task
343
  $backup_data['uploads_subpackage']=1;
344
  $upload_dir = wp_upload_dir();
345
  $backup_data['files_root']=$this -> transfer_path($upload_dir['basedir']);
346
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'backwpup', '/').'#'; // BackWPup backup directory
347
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'backup-guard', '/').'#'; // Wordpress Backup and Migrate Plugin backup directory
348
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'ShortpixelBackups', '/').'#';
349
- $backup_data['exclude_regex']=$exclude_regex;
350
  $backup_data['include_regex']=array();
 
351
  //$backup_data['include_regex'][]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR, '/').'[0-9]{4}#';
352
  $backup_data['json_info']['file_type']='upload';
353
  }
354
- /*
355
- else if($backup==WPVIVID_BACKUP_TYPE_UPLOADS_FILES_OTHER)
356
- {
357
- //$backup_data['root_path']=WP_CONTENT_DIR;
358
- $backup_data['root_flag']=WPVIVID_BACKUP_ROOT_WP_CONTENT;
359
- $backup_data['prefix']=$this->get_prefix().'_backup_uploads_other';
360
- $upload_dir = wp_upload_dir();
361
- $backup_data['files_root']=$this -> transfer_path($upload_dir['basedir']);
362
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'backwpup', '/').'#'; // BackWPup backup directory
363
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'backup-guard', '/').'#'; // Wordpress Backup and Migrate Plugin backup directory
364
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'ShortpixelBackups', '/').'#';
365
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR, '/').'[0-9]{4}#';
366
- $backup_data['exclude_regex']=$exclude_regex;
367
- $backup_data['include_regex']=array();
368
- $backup_data['json_info']['file_type']='upload';
369
- }*/
370
  else if($backup==WPVIVID_BACKUP_TYPE_CONTENT)
371
  {
372
  //$backup_data['root_path']=get_home_path();
373
  $backup_data['root_flag']=WPVIVID_BACKUP_ROOT_WP_ROOT;
374
  $backup_data['prefix']=$this->get_prefix().'_backup_content';
375
  $backup_data['files_root']=$this -> transfer_path(WP_CONTENT_DIR);
376
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'updraft', '/').'#'; // Updraft Plus backup directory
377
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'ai1wm-backups', '/').'#'; // All-in-one WP migration backup directory
378
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'backups', '/').'#'; // Xcloner backup directory
379
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'upgrade', '/').'#';
380
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'wpvivid', '/').'#';
381
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.WPvivid_Setting::get_backupdir(), '/').'#';
382
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'plugins', '/').'#';
383
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'cache', '/').'#';
384
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'Dropbox_Backup', '/').'#';
385
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'mysql.sql', '/').'#';//mysql
386
- $upload_dir = wp_upload_dir();
387
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']), '/').'#';
388
- $exclude_regex[]='#^'.preg_quote($this->transfer_path(get_theme_root()), '/').'#';
389
  $backup_data['exclude_regex']=$exclude_regex;
390
  $backup_data['include_regex']=array();
391
  $backup_data['json_info']['file_type']='wp-content';
@@ -404,6 +437,7 @@ class WPvivid_Backup_Task
404
  $include_regex[]='#^'.preg_quote($this->transfer_path(ABSPATH.DIRECTORY_SEPARATOR.'wp-includes'), '/').'#';
405
  $exclude_regex[]='#^'.preg_quote($this->transfer_path(ABSPATH.DIRECTORY_SEPARATOR.'wp-admin'.DIRECTORY_SEPARATOR), '/').'pclzip-.*\.tmp#';
406
  $exclude_regex[]='#^'.preg_quote($this->transfer_path(ABSPATH.DIRECTORY_SEPARATOR.'wp-admin'.DIRECTORY_SEPARATOR), '/').'pclzip-.*\.gz#';
 
407
  $backup_data['exclude_regex']=$exclude_regex;
408
  $backup_data['include_regex']=$include_regex;
409
  $backup_data['json_info']['file_type']='wp-core';
@@ -1940,7 +1974,8 @@ class WPvivid_Backup_Item
1940
  {
1941
  $zip=new WPvivid_ZipClass();
1942
  $ret=$zip->get_json_data($file_name);
1943
- if($ret['result'] === WPVIVID_SUCCESS) {
 
1944
  $json=$ret['json_data'];
1945
  $json = json_decode($json, 1);
1946
  if (is_null($json)) {
50
  $this->backup_type_collect[WPVIVID_BACKUP_TYPE_MERGE]=1;
51
 
52
  add_filter('wpvivid_set_backup', array($this, 'wpvivid_set_backup'),10);
53
+ add_filter('wpvivid_exclude_plugins',array($this,'exclude_plugins'),20);
54
+ add_filter('wpvivid_get_backup_exclude_regex',array($this, 'get_backup_exclude_regex'),10,2);
55
+ }
56
+
57
+ public function get_backup_exclude_regex($exclude_regex,$backup_type)
58
+ {
59
+ if($backup_type==WPVIVID_BACKUP_TYPE_UPLOADS||$backup_type==WPVIVID_BACKUP_TYPE_UPLOADS_FILES)
60
+ {
61
+ $upload_dir = wp_upload_dir();
62
+ $backup_data['files_root']=$this -> transfer_path($upload_dir['basedir']);
63
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'backwpup', '/').'#'; // BackWPup backup directory
64
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'ShortpixelBackups', '/').'#';//ShortpixelBackups
65
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'backup', '/').'#';
66
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'backwpup', '/').'#'; // BackWPup backup directory
67
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR.'backup-guard', '/').'#'; // Wordpress Backup and Migrate Plugin backup directory
68
+ }
69
+ else if($backup_type==WPVIVID_BACKUP_TYPE_CONTENT)
70
+ {
71
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'updraft', '/').'#'; // Updraft Plus backup directory
72
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'ai1wm-backups', '/').'#'; // All-in-one WP migration backup directory
73
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'backups', '/').'#'; // Xcloner backup directory
74
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'upgrade', '/').'#';
75
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'wpvivid', '/').'#';
76
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.WPvivid_Setting::get_backupdir(), '/').'#';
77
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'plugins', '/').'#';
78
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'cache', '/').'#';
79
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'wphb-cache', '/').'#';
80
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'backup', '/').'#';
81
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'Dropbox_Backup', '/').'#';
82
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.'mysql.sql', '/').'#';//mysql
83
+ $upload_dir = wp_upload_dir();
84
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']), '/').'#';
85
+ $exclude_regex[]='#^'.preg_quote($this->transfer_path(get_theme_root()), '/').'#';
86
+ }
87
+
88
+ return $exclude_regex;
89
+ }
90
+
91
+ public function exclude_plugins($exclude_plugins)
92
+ {
93
+ if(in_array('wpvivid-backuprestore',$exclude_plugins))
94
+ {
95
+ $exclude_plugins[]='wpvivid-backuprestore';
96
+ }
97
+
98
+ if(in_array('wp-cerber',$exclude_plugins))
99
+ {
100
+ $exclude_plugins[]='wp-cerber';
101
+ }
102
+
103
+ if(in_array('.',$exclude_plugins))
104
+ {
105
+ $exclude_plugins[]='.';
106
+ }
107
+
108
+ if(in_array('wpvivid-backup-pro',$exclude_plugins))
109
+ {
110
+ $exclude_plugins[]='wpvivid-backup-pro';
111
+ }
112
+
113
+ return $exclude_plugins;
114
  }
115
 
116
  public function get_id()
215
  else
216
  $this->task['options']['file_prefix'] = $backup_prefix . '_' . $this->task['id'] . '_' . date('Y-m-d-H-i', $this->task['status']['start_time']+$offset*60*60);
217
 
218
+ $this->task['options']['file_prefix'] = apply_filters('wpvivid_backup_file_prefix',$this->task['options']['file_prefix'],$backup_prefix,$this->task['id'],$this->task['status']['start_time']);
219
+
220
  if(isset($general_setting['options']['wpvivid_common_setting']['ismerge']))
221
  {
222
  if($general_setting['options']['wpvivid_common_setting']['ismerge']==1)
370
  }
371
  $backup_data['files_root']=$this->transfer_path(WP_PLUGIN_DIR);
372
 
373
+ $exclude_plugins=array();
 
 
374
  $exclude_plugins=apply_filters('wpvivid_exclude_plugins',$exclude_plugins);
375
  $exclude_regex=array();
376
  foreach ($exclude_plugins as $exclude_plugin)
389
  $backup_data['prefix']=$this->get_prefix().'_backup_uploads';
390
  $upload_dir = wp_upload_dir();
391
  $backup_data['files_root']=$this -> transfer_path($upload_dir['basedir']);
392
+
393
+ $exclude_regex=array();
394
+ $exclude_regex=apply_filters('wpvivid_get_backup_exclude_regex',$exclude_regex,WPVIVID_BACKUP_TYPE_UPLOADS);
395
  $backup_data['exclude_regex']=$exclude_regex;
396
  $backup_data['include_regex']=array();
397
  $backup_data['json_info']['file_type']='upload';
404
  $backup_data['uploads_subpackage']=1;
405
  $upload_dir = wp_upload_dir();
406
  $backup_data['files_root']=$this -> transfer_path($upload_dir['basedir']);
407
+ $exclude_regex=array();
408
+ $exclude_regex=apply_filters('wpvivid_get_backup_exclude_regex',$exclude_regex,WPVIVID_BACKUP_TYPE_UPLOADS_FILES);
 
 
409
  $backup_data['include_regex']=array();
410
+ $backup_data['exclude_regex']=$exclude_regex;
411
  //$backup_data['include_regex'][]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']).DIRECTORY_SEPARATOR, '/').'[0-9]{4}#';
412
  $backup_data['json_info']['file_type']='upload';
413
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  else if($backup==WPVIVID_BACKUP_TYPE_CONTENT)
415
  {
416
  //$backup_data['root_path']=get_home_path();
417
  $backup_data['root_flag']=WPVIVID_BACKUP_ROOT_WP_ROOT;
418
  $backup_data['prefix']=$this->get_prefix().'_backup_content';
419
  $backup_data['files_root']=$this -> transfer_path(WP_CONTENT_DIR);
420
+ $exclude_regex=array();
421
+ $exclude_regex=apply_filters('wpvivid_get_backup_exclude_regex',$exclude_regex,WPVIVID_BACKUP_TYPE_CONTENT);
 
 
 
 
 
 
 
 
 
 
 
422
  $backup_data['exclude_regex']=$exclude_regex;
423
  $backup_data['include_regex']=array();
424
  $backup_data['json_info']['file_type']='wp-content';
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;
443
  $backup_data['json_info']['file_type']='wp-core';
1974
  {
1975
  $zip=new WPvivid_ZipClass();
1976
  $ret=$zip->get_json_data($file_name);
1977
+ if($ret['result'] === WPVIVID_SUCCESS)
1978
+ {
1979
  $json=$ret['json_data'];
1980
  $json = json_decode($json, 1);
1981
  if (is_null($json)) {
includes/class-wpvivid-downloader.php CHANGED
@@ -139,10 +139,11 @@ class WPvivid_downloader
139
  {
140
  $progress=0;
141
  $message=$ret['error'];
142
- if($wpvivid_plugin->wpvivid_download_log){
 
143
  $wpvivid_plugin->wpvivid_download_log->WriteLog('Download failed, ' . $message ,'error');
144
- WPvivid_error_log::create_error_log($wpvivid_plugin->wpvivid_download_log->log_file);
145
  $wpvivid_plugin->wpvivid_download_log->CloseFile();
 
146
  }
147
  else {
148
  $id = uniqid('wpvivid-');
@@ -150,8 +151,8 @@ class WPvivid_downloader
150
  $log = new WPvivid_Log();
151
  $log->CreateLogFile($log_file_name, 'no_folder', 'download');
152
  $log->WriteLog($message, 'notice');
153
- WPvivid_error_log::create_error_log($log->log_file);
154
  $log->CloseFile();
 
155
  }
156
  WPvivid_taskmanager::update_download_task_v2($task,$progress,'error',$message);
157
  return $ret;
139
  {
140
  $progress=0;
141
  $message=$ret['error'];
142
+ if($wpvivid_plugin->wpvivid_download_log)
143
+ {
144
  $wpvivid_plugin->wpvivid_download_log->WriteLog('Download failed, ' . $message ,'error');
 
145
  $wpvivid_plugin->wpvivid_download_log->CloseFile();
146
+ WPvivid_error_log::create_error_log($wpvivid_plugin->wpvivid_download_log->log_file);
147
  }
148
  else {
149
  $id = uniqid('wpvivid-');
151
  $log = new WPvivid_Log();
152
  $log->CreateLogFile($log_file_name, 'no_folder', 'download');
153
  $log->WriteLog($message, 'notice');
 
154
  $log->CloseFile();
155
+ WPvivid_error_log::create_error_log($log->log_file);
156
  }
157
  WPvivid_taskmanager::update_download_task_v2($task,$progress,'error',$message);
158
  return $ret;
includes/class-wpvivid-error-log.php CHANGED
@@ -21,6 +21,12 @@ class WPvivid_error_log
21
  @fclose($tempfile);
22
  }
23
  }
 
 
 
 
 
 
24
  if(file_exists($dir.DIRECTORY_SEPARATOR.'error'.DIRECTORY_SEPARATOR.$file))
25
  {
26
  @unlink($dir.DIRECTORY_SEPARATOR.'error'.DIRECTORY_SEPARATOR.$file);
21
  @fclose($tempfile);
22
  }
23
  }
24
+
25
+ if(!file_exists($log_file_name))
26
+ {
27
+ return ;
28
+ }
29
+
30
  if(file_exists($dir.DIRECTORY_SEPARATOR.'error'.DIRECTORY_SEPARATOR.$file))
31
  {
32
  @unlink($dir.DIRECTORY_SEPARATOR.'error'.DIRECTORY_SEPARATOR.$file);
includes/class-wpvivid-export-import.php CHANGED
@@ -1374,10 +1374,10 @@ class WPvivid_Export_Import
1374
  //time out
1375
  $message=__('Task time out.', 'wpvivid');
1376
  WPvivid_Exporter_taskmanager::update_backup_task_status($task_id,false,'error',false,$status['resume_count'],$message);
1377
- WPvivid_error_log::create_error_log($wpvivid_plugin->wpvivid_log->log_file);
1378
-
1379
  if($wpvivid_plugin->wpvivid_log)
1380
  $wpvivid_plugin->wpvivid_log->WriteLog($message,'error');
 
 
1381
  }
1382
  else {
1383
  $time_spend=time()-$status['run_time'];
@@ -2591,8 +2591,8 @@ class WPvivid_Export_Import
2591
  $log = new WPvivid_Log();
2592
  $log->CreateLogFile($log_file_name, 'no_folder', 'import');
2593
  $log->WriteLog($ret['error'], 'notice');
2594
- WPvivid_error_log::create_error_log($log->log_file);
2595
  $log->CloseFile();
 
2596
  echo json_encode($ret);
2597
  die();
2598
  }
1374
  //time out
1375
  $message=__('Task time out.', 'wpvivid');
1376
  WPvivid_Exporter_taskmanager::update_backup_task_status($task_id,false,'error',false,$status['resume_count'],$message);
 
 
1377
  if($wpvivid_plugin->wpvivid_log)
1378
  $wpvivid_plugin->wpvivid_log->WriteLog($message,'error');
1379
+ $wpvivid_plugin->wpvivid_log->CloseFile();
1380
+ WPvivid_error_log::create_error_log($wpvivid_plugin->wpvivid_log->log_file);
1381
  }
1382
  else {
1383
  $time_spend=time()-$status['run_time'];
2591
  $log = new WPvivid_Log();
2592
  $log->CreateLogFile($log_file_name, 'no_folder', 'import');
2593
  $log->WriteLog($ret['error'], 'notice');
 
2594
  $log->CloseFile();
2595
+ WPvivid_error_log::create_error_log($log->log_file);
2596
  echo json_encode($ret);
2597
  die();
2598
  }
includes/class-wpvivid-exporter.php CHANGED
@@ -192,7 +192,7 @@ class WPvivid_Post_List extends WP_List_Table
192
  $this->set_pagination_args(
193
  array(
194
  'total_items' => $total_items,
195
- 'per_page' => 1,
196
  )
197
  );
198
  }
@@ -464,7 +464,7 @@ class WPvivid_Post_List extends WP_List_Table
464
  $count=0;
465
  while ( $count<$page )
466
  {
467
- $page_post_ids = array_splice( $post_ids, 0, 1);
468
  $count++;
469
  }
470
  foreach ( $page_post_ids as $post_id)
192
  $this->set_pagination_args(
193
  array(
194
  'total_items' => $total_items,
195
+ 'per_page' => 30,
196
  )
197
  );
198
  }
464
  $count=0;
465
  while ( $count<$page )
466
  {
467
+ $page_post_ids = array_splice( $post_ids, 0, 30);
468
  $count++;
469
  }
470
  foreach ( $page_post_ids as $post_id)
includes/class-wpvivid-mysqldump-method.php CHANGED
@@ -485,7 +485,11 @@ class TypeAdapterMysql extends TypeAdapterFactory
485
 
486
  public function connect($host,$dbname,$user,$pass,$init_commands=array())
487
  {
488
- $res = explode(':',DB_HOST);
 
 
 
 
489
  $db_host = $res[0];
490
  $db_port = empty($res[1])?'':$res[1];
491
  if(!empty($db_port)) {
485
 
486
  public function connect($host,$dbname,$user,$pass,$init_commands=array())
487
  {
488
+ if(empty($host))
489
+ {
490
+ $host=DB_HOST;
491
+ }
492
+ $res = explode(':',$host);
493
  $db_host = $res[0];
494
  $db_port = empty($res[1])?'':$res[1];
495
  if(!empty($db_port)) {
includes/class-wpvivid-remote-collection.php CHANGED
@@ -74,7 +74,7 @@ class WPvivid_Remote_collection
74
  }
75
  $ret['result']=WPVIVID_SUCCESS;
76
  }
77
- else{
78
  $id = uniqid('wpvivid-');
79
  $log_file_name = $id . '_add_remote';
80
  $log = new WPvivid_Log();
@@ -83,8 +83,8 @@ class WPvivid_Remote_collection
83
  if(isset($ret['error'])) {
84
  $log->WriteLog($ret['error'], 'notice');
85
  }
86
- WPvivid_error_log::create_error_log($log->log_file);
87
  $log->CloseFile();
 
88
  }
89
  }
90
 
74
  }
75
  $ret['result']=WPVIVID_SUCCESS;
76
  }
77
+ else {
78
  $id = uniqid('wpvivid-');
79
  $log_file_name = $id . '_add_remote';
80
  $log = new WPvivid_Log();
83
  if(isset($ret['error'])) {
84
  $log->WriteLog($ret['error'], 'notice');
85
  }
 
86
  $log->CloseFile();
87
+ WPvivid_error_log::create_error_log($log->log_file);
88
  }
89
  }
90
 
includes/class-wpvivid-restore-database.php CHANGED
@@ -1504,6 +1504,10 @@ class WPvivid_RestoreDB
1504
  $skip_tables[]='duplicator_packages';
1505
  $skip_tables[]='wsal_metadata';
1506
  $skip_tables[]='wsal_occurrences';
 
 
 
 
1507
  if(in_array(substr($table_name, strlen($this->new_prefix)),$skip_tables))
1508
  {
1509
  $skip_table=true;
1504
  $skip_tables[]='duplicator_packages';
1505
  $skip_tables[]='wsal_metadata';
1506
  $skip_tables[]='wsal_occurrences';
1507
+ $skip_tables[]='simple_history_contexts';
1508
+ $skip_tables[]='simple_history';
1509
+ $skip_tables[]='wffilemods';
1510
+ //
1511
  if(in_array(substr($table_name, strlen($this->new_prefix)),$skip_tables))
1512
  {
1513
  $skip_table=true;
includes/class-wpvivid-setting.php CHANGED
@@ -657,6 +657,10 @@ class WPvivid_Setting
657
  $data['backup_custom_setting']=apply_filters('wpvivid_get_backup_custom_setting_mainwp', array());
658
 
659
  $data['report_addon'] = apply_filters('wpvivid_archieve_report_addon_mainwp', array());
 
 
 
 
660
  return $data;
661
  }
662
  }
657
  $data['backup_custom_setting']=apply_filters('wpvivid_get_backup_custom_setting_mainwp', array());
658
 
659
  $data['report_addon'] = apply_filters('wpvivid_archieve_report_addon_mainwp', array());
660
+
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
  }
includes/class-wpvivid-tools.php CHANGED
@@ -118,19 +118,22 @@ class WPvivid_tools
118
  $contents=file_get_contents($file);
119
  if($contents==false)
120
  {
121
- $wpvivid_plugin->restore_data->write_log('file_get_contents failed.', 'notice');
 
122
  }
123
  $get_file_ret = json_decode($contents,true);
124
  if(empty($get_file_ret))
125
  {
126
- $wpvivid_plugin->restore_data->write_log('Failed to decode restore data file.', 'notice');
 
127
  }
128
 
129
  return $get_file_ret;
130
  }
131
  return $get_file_ret;
132
  }else{
133
- $wpvivid_plugin->restore_data->write_log('Failed to open restore data file, the file may not exist.', 'notice');
 
134
  return array();
135
  }
136
  }
118
  $contents=file_get_contents($file);
119
  if($contents==false)
120
  {
121
+ if( $wpvivid_plugin->restore_data)
122
+ $wpvivid_plugin->restore_data->write_log('file_get_contents failed.', 'notice');
123
  }
124
  $get_file_ret = json_decode($contents,true);
125
  if(empty($get_file_ret))
126
  {
127
+ if( $wpvivid_plugin->restore_data)
128
+ $wpvivid_plugin->restore_data->write_log('Failed to decode restore data file.', 'notice');
129
  }
130
 
131
  return $get_file_ret;
132
  }
133
  return $get_file_ret;
134
  }else{
135
+ if( $wpvivid_plugin->restore_data)
136
+ $wpvivid_plugin->restore_data->write_log('Failed to open restore data file, the file may not exist.', 'notice');
137
  return array();
138
  }
139
  }
includes/class-wpvivid.php CHANGED
@@ -455,8 +455,8 @@ class WPvivid {
455
  $log=new WPvivid_Log();
456
  $log->CreateLogFile($log_file_name,'no_folder','backup');
457
  $log->WriteLog($message,'notice');
458
- WPvivid_error_log::create_error_log($log->log_file);
459
  $log->CloseFile();
 
460
  error_log($message);
461
  echo json_encode($ret);
462
  die();
@@ -465,7 +465,8 @@ class WPvivid {
465
 
466
  public function deal_prepare_shutdown_error()
467
  {
468
- if($this->end_shutdown_function==false) {
 
469
  $last_error = error_get_last();
470
  if (!empty($last_error) && !in_array($last_error['type'], array(E_NOTICE,E_WARNING,E_USER_NOTICE,E_USER_WARNING,E_DEPRECATED), true)) {
471
  $error = $last_error;
@@ -484,8 +485,8 @@ class WPvivid {
484
  $log = new WPvivid_Log();
485
  $log->CreateLogFile($log_file_name, 'no_folder', 'backup');
486
  $log->WriteLog($ret['error'], 'notice');
487
- WPvivid_error_log::create_error_log($log->log_file);
488
  $log->CloseFile();
 
489
  echo json_encode($ret);
490
  die();
491
  }
@@ -870,8 +871,8 @@ class WPvivid {
870
  $log=new WPvivid_Log();
871
  $log->CreateLogFile($log_file_name,'no_folder','backup');
872
  $log->WriteLog($message,'notice');
873
- WPvivid_error_log::create_error_log($log->log_file);
874
  $log->CloseFile();
 
875
  error_log($message);
876
  echo json_encode($ret);
877
  die();
@@ -1347,8 +1348,8 @@ class WPvivid {
1347
  $this->update_last_backup_task($task_msg);
1348
  }
1349
  $this->wpvivid_log->WriteLog($task['status']['error'],'error');
1350
- WPvivid_error_log::create_error_log($this->wpvivid_log->log_file);
1351
  $this->wpvivid_log->CloseFile();
 
1352
  WPvivid_Schedule::clear_monitor_schedule($task['id']);
1353
  $this->add_clean_backing_up_data_event($task['id']);
1354
  WPvivid_mail_report::send_report_mail($task);
@@ -1580,7 +1581,7 @@ class WPvivid {
1580
  {
1581
  $message=__('Too many resumption attempts.', 'wpvivid');
1582
  $task=WPvivid_taskmanager::update_backup_task_status($task_id,false,'error',false,$status['resume_count'],$message);
1583
- WPvivid_error_log::create_error_log($this->wpvivid_log->log_file);
1584
  do_action('wpvivid_handle_backup_failed',$task, true);
1585
  }
1586
  else
@@ -1700,7 +1701,7 @@ class WPvivid {
1700
  {
1701
  $message=__('Too many resumption attempts.', 'wpvivid');
1702
  $task=WPvivid_taskmanager::update_backup_task_status($task_id,false,'error',false,$status['resume_count'],$message);
1703
- WPvivid_error_log::create_error_log($this->wpvivid_log->log_file);
1704
  do_action('wpvivid_handle_backup_failed',$task, true);
1705
  }
1706
  else
@@ -2207,8 +2208,8 @@ class WPvivid {
2207
  $message = 'An exception has occurred. class: '.get_class($error).';msg: '.$error->getMessage().';code: '.$error->getCode().';line: '.$error->getLine().';in_file: '.$error->getFile().';';
2208
  if($this->wpvivid_download_log){
2209
  $this->wpvivid_download_log->WriteLog($message ,'error');
2210
- WPvivid_error_log::create_error_log($this->wpvivid_download_log->log_file);
2211
  $this->wpvivid_download_log->CloseFile();
 
2212
  }
2213
  else {
2214
  $id = uniqid('wpvivid-');
@@ -2216,8 +2217,8 @@ class WPvivid {
2216
  $log = new WPvivid_Log();
2217
  $log->CreateLogFile($log_file_name, 'no_folder', 'download');
2218
  $log->WriteLog($message, 'error');
2219
- WPvivid_error_log::create_error_log($log->log_file);
2220
  $log->CloseFile();
 
2221
  }
2222
  error_log($message);
2223
  $this->end_shutdown_function=true;
@@ -2247,8 +2248,8 @@ class WPvivid {
2247
  }
2248
  if($this->wpvivid_download_log){
2249
  $this->wpvivid_download_log->WriteLog($ret['error'] ,'error');
2250
- WPvivid_error_log::create_error_log($this->wpvivid_download_log->log_file);
2251
  $this->wpvivid_download_log->CloseFile();
 
2252
  }
2253
  else {
2254
  $id = uniqid('wpvivid-');
@@ -2256,8 +2257,8 @@ class WPvivid {
2256
  $log = new WPvivid_Log();
2257
  $log->CreateLogFile($log_file_name, 'no_folder', 'download');
2258
  $log->WriteLog($ret['error'], 'notice');
2259
- WPvivid_error_log::create_error_log($log->log_file);
2260
  $log->CloseFile();
 
2261
  }
2262
  echo json_encode($ret);
2263
  die();
@@ -3221,8 +3222,8 @@ class WPvivid {
3221
  if(isset($ret['error'])) {
3222
  $log->WriteLog($error_message, 'notice');
3223
  }
3224
- WPvivid_error_log::create_error_log($log->log_file);
3225
  $log->CloseFile();
 
3226
  }
3227
 
3228
  /**
455
  $log=new WPvivid_Log();
456
  $log->CreateLogFile($log_file_name,'no_folder','backup');
457
  $log->WriteLog($message,'notice');
 
458
  $log->CloseFile();
459
+ WPvivid_error_log::create_error_log($log->log_file);
460
  error_log($message);
461
  echo json_encode($ret);
462
  die();
465
 
466
  public function deal_prepare_shutdown_error()
467
  {
468
+ if($this->end_shutdown_function==false)
469
+ {
470
  $last_error = error_get_last();
471
  if (!empty($last_error) && !in_array($last_error['type'], array(E_NOTICE,E_WARNING,E_USER_NOTICE,E_USER_WARNING,E_DEPRECATED), true)) {
472
  $error = $last_error;
485
  $log = new WPvivid_Log();
486
  $log->CreateLogFile($log_file_name, 'no_folder', 'backup');
487
  $log->WriteLog($ret['error'], 'notice');
 
488
  $log->CloseFile();
489
+ WPvivid_error_log::create_error_log($log->log_file);
490
  echo json_encode($ret);
491
  die();
492
  }
871
  $log=new WPvivid_Log();
872
  $log->CreateLogFile($log_file_name,'no_folder','backup');
873
  $log->WriteLog($message,'notice');
 
874
  $log->CloseFile();
875
+ WPvivid_error_log::create_error_log($log->log_file);
876
  error_log($message);
877
  echo json_encode($ret);
878
  die();
1348
  $this->update_last_backup_task($task_msg);
1349
  }
1350
  $this->wpvivid_log->WriteLog($task['status']['error'],'error');
 
1351
  $this->wpvivid_log->CloseFile();
1352
+ WPvivid_error_log::create_error_log($this->wpvivid_log->log_file);
1353
  WPvivid_Schedule::clear_monitor_schedule($task['id']);
1354
  $this->add_clean_backing_up_data_event($task['id']);
1355
  WPvivid_mail_report::send_report_mail($task);
1581
  {
1582
  $message=__('Too many resumption attempts.', 'wpvivid');
1583
  $task=WPvivid_taskmanager::update_backup_task_status($task_id,false,'error',false,$status['resume_count'],$message);
1584
+ //WPvivid_error_log::create_error_log($this->wpvivid_log->log_file);
1585
  do_action('wpvivid_handle_backup_failed',$task, true);
1586
  }
1587
  else
1701
  {
1702
  $message=__('Too many resumption attempts.', 'wpvivid');
1703
  $task=WPvivid_taskmanager::update_backup_task_status($task_id,false,'error',false,$status['resume_count'],$message);
1704
+ //WPvivid_error_log::create_error_log($this->wpvivid_log->log_file);
1705
  do_action('wpvivid_handle_backup_failed',$task, true);
1706
  }
1707
  else
2208
  $message = 'An exception has occurred. class: '.get_class($error).';msg: '.$error->getMessage().';code: '.$error->getCode().';line: '.$error->getLine().';in_file: '.$error->getFile().';';
2209
  if($this->wpvivid_download_log){
2210
  $this->wpvivid_download_log->WriteLog($message ,'error');
 
2211
  $this->wpvivid_download_log->CloseFile();
2212
+ WPvivid_error_log::create_error_log($this->wpvivid_download_log->log_file);
2213
  }
2214
  else {
2215
  $id = uniqid('wpvivid-');
2217
  $log = new WPvivid_Log();
2218
  $log->CreateLogFile($log_file_name, 'no_folder', 'download');
2219
  $log->WriteLog($message, 'error');
 
2220
  $log->CloseFile();
2221
+ WPvivid_error_log::create_error_log($log->log_file);
2222
  }
2223
  error_log($message);
2224
  $this->end_shutdown_function=true;
2248
  }
2249
  if($this->wpvivid_download_log){
2250
  $this->wpvivid_download_log->WriteLog($ret['error'] ,'error');
 
2251
  $this->wpvivid_download_log->CloseFile();
2252
+ WPvivid_error_log::create_error_log($this->wpvivid_download_log->log_file);
2253
  }
2254
  else {
2255
  $id = uniqid('wpvivid-');
2257
  $log = new WPvivid_Log();
2258
  $log->CreateLogFile($log_file_name, 'no_folder', 'download');
2259
  $log->WriteLog($ret['error'], 'notice');
 
2260
  $log->CloseFile();
2261
+ WPvivid_error_log::create_error_log($log->log_file);
2262
  }
2263
  echo json_encode($ret);
2264
  die();
3222
  if(isset($ret['error'])) {
3223
  $log->WriteLog($error_message, 'notice');
3224
  }
 
3225
  $log->CloseFile();
3226
+ WPvivid_error_log::create_error_log($log->log_file);
3227
  }
3228
 
3229
  /**
includes/customclass/class-wpvivid-ftpclass.php CHANGED
@@ -378,6 +378,12 @@ class WPvivid_FTPClass extends WPvivid_Remote{
378
  return $ret;
379
  }
380
 
 
 
 
 
 
 
381
  $ret['result']=WPVIVID_SUCCESS;
382
  $ret['options']=$this->options;
383
  return $ret;
378
  return $ret;
379
  }
380
 
381
+ if($this->options['path']=='/')
382
+ {
383
+ $ret['error']="Warning: Root directory is forbidden to set to '/'.";
384
+ return $ret;
385
+ }
386
+
387
  $ret['result']=WPVIVID_SUCCESS;
388
  $ret['options']=$this->options;
389
  return $ret;
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.38
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
10
 
@@ -177,6 +177,11 @@ 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.38 =
181
  - Successfully tested with WordPress 5.4.
182
  - Added a new language template for translators.
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
  * [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.
183
+ - Fixed the pagination issue in the process of exporting pages.
184
+ - Fixed some bugs in the plugin code.
185
  = 0.9.38 =
186
  - Successfully tested with WordPress 5.4.
187
  - Added a new language template for translators.
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.38
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.38' );
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.39
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.39' );
25
  //
26
  define('WPVIVID_RESTORE_INIT','init');
27
  define('WPVIVID_RESTORE_READY','ready');