Migration, Backup, Staging – WPvivid - Version 0.9.75

Version Description

  • Fixed: Page styling got lost after importing the page in some cases.
  • Fixed: Some used images were falsely scanned as unused.
  • Fixed some UI bugs.
  • Fixed some bugs in the plugin code and optimized the plugin code.
Download this release

Release Info

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

Code changes from version 0.9.74 to 0.9.75

admin/class-wpvivid-admin.php CHANGED
@@ -377,7 +377,21 @@ class WPvivid_Admin {
377
 
378
  public function add_action_links( $links )
379
  {
380
- $active_plugins = get_option('active_plugins');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
381
  if(!function_exists('get_plugins'))
382
  require_once(ABSPATH . 'wp-admin/includes/plugin.php');
383
  $plugins=get_plugins();
@@ -396,15 +410,33 @@ class WPvivid_Admin {
396
 
397
  if($is_active_pro)
398
  {
399
- $settings_link = array(
400
- '<a href="' . admin_url( 'admin.php?page=' . strtolower(sprintf('%s-dashboard', apply_filters('wpvivid_white_label_slug', 'wpvivid'))) ) . '">' . __('Settings', 'wpvivid-backuprestore') . '</a>',
401
- );
 
 
 
 
 
 
 
 
 
402
  }
403
  else
404
  {
405
- $settings_link = array(
406
- '<a href="' . admin_url( 'admin.php?page=' . apply_filters('wpvivid_white_label_slug', $this->plugin_name) ) . '">' . __('Settings', 'wpvivid-backuprestore') . '</a>',
407
- );
 
 
 
 
 
 
 
 
 
408
  }
409
 
410
  return array_merge( $settings_link, $links );
377
 
378
  public function add_action_links( $links )
379
  {
380
+ if(!is_multisite())
381
+ {
382
+ $active_plugins = get_option('active_plugins');
383
+ }
384
+ else
385
+ {
386
+ $active_plugins = array();
387
+ //network active
388
+ $mu_active_plugins = get_site_option( 'active_sitewide_plugins', array() );
389
+ if(!empty($mu_active_plugins)){
390
+ foreach ($mu_active_plugins as $plugin_name => $data){
391
+ $active_plugins[] = $plugin_name;
392
+ }
393
+ }
394
+ }
395
  if(!function_exists('get_plugins'))
396
  require_once(ABSPATH . 'wp-admin/includes/plugin.php');
397
  $plugins=get_plugins();
410
 
411
  if($is_active_pro)
412
  {
413
+ if(!is_multisite())
414
+ {
415
+ $settings_link = array(
416
+ '<a href="' . admin_url( 'admin.php?page=' . strtolower(sprintf('%s-dashboard', apply_filters('wpvivid_white_label_slug', 'wpvivid'))) ) . '">' . __('Settings', 'wpvivid-backuprestore') . '</a>',
417
+ );
418
+ }
419
+ else
420
+ {
421
+ $settings_link = array(
422
+ '<a href="' . network_admin_url( 'admin.php?page=' . strtolower(sprintf('%s-dashboard', apply_filters('wpvivid_white_label_slug', 'wpvivid'))) ) . '">' . __('Settings', 'wpvivid-backuprestore') . '</a>',
423
+ );
424
+ }
425
  }
426
  else
427
  {
428
+ if(!is_multisite())
429
+ {
430
+ $settings_link = array(
431
+ '<a href="' . admin_url( 'admin.php?page=' . apply_filters('wpvivid_white_label_slug', $this->plugin_name) ) . '">' . __('Settings', 'wpvivid-backuprestore') . '</a>',
432
+ );
433
+ }
434
+ else
435
+ {
436
+ $settings_link = array(
437
+ '<a href="' . network_admin_url( 'admin.php?page=' . apply_filters('wpvivid_white_label_slug', $this->plugin_name) ) . '">' . __('Settings', 'wpvivid-backuprestore') . '</a>',
438
+ );
439
+ }
440
  }
441
 
442
  return array_merge( $settings_link, $links );
admin/partials/wpvivid-settings-page-display.php CHANGED
@@ -298,15 +298,17 @@ function wpvivid_email_report()
298
  function wpvivid_clean_junk()
299
  {
300
  global $wpvivid_plugin;
 
 
301
  //$junk_file=$wpvivid_plugin->_junk_files_info();
302
- $junk_file['sum_size']=0;
303
  $junk_file['log_dir_size']=0;
304
  $junk_file['backup_dir_size'] =0;
305
  $junk_file['log_path'] = $log_dir = $wpvivid_plugin->wpvivid_log->GetSaveLogFolder();
306
  $dir = WPvivid_Setting::get_backupdir();
307
  $junk_file['old_files_path'] = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . WPVIVID_DEFAULT_ROLLBACK_DIR;
308
  $dir = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $dir;
309
- $junk_file['junk_path'] = $dir;
310
  ?>
311
  <div class="postbox schedule-tab-block" id="wpvivid_clean_junk">
312
  <div>
@@ -315,34 +317,37 @@ function wpvivid_clean_junk()
315
  <div class="setting-tab-block">
316
  <div class="setting-tab-block">
317
  <span class="wpvivid-element-space-right"><?php _e('Total Size:', 'wpvivid-backuprestore'); ?></span>
318
- <span id="wpvivid_junk_sum_size"><?php _e($junk_file['sum_size'], 'wpvivid-backuprestore'); ?></span>
 
 
319
  <input class="button-secondary" id="wpvivid_calculate_size" style="margin-left:10px;" type="submit" name="Calculate-Sizes" value="<?php esc_attr_e( 'Calculate Sizes', 'wpvivid-backuprestore' ); ?>" />
320
  </div>
321
  <fieldset>
322
  <label for="wpvivid_junk_log">
323
  <input type="checkbox" id="wpvivid_junk_log" option="junk-files" name="log" value="junk-log" />
324
- <span class="wpvivid-element-space-right"><?php _e( 'logs', 'wpvivid-backuprestore' ); ?></span>
325
- <span style="margin-right: 2px;"><?php _e('Path:', 'wpvivid-backuprestore' ); ?></span><span id="wpvivid_junk_log_path"><?php _e($junk_file['log_path'], 'wpvivid-backuprestore'); ?></span>
326
  </label>
327
  </fieldset>
328
  <fieldset>
329
  <label for="wpvivid_junk_backup_cache">
330
  <input type="checkbox" id="wpvivid_junk_backup_cache" option="junk-files" name="backup_cache" value="junk-backup-cache" />
331
- <span class="wpvivid-element-space-right"><?php _e( 'Backup Cache', 'wpvivid-backuprestore' ); ?></span>
 
332
  </label>
 
 
333
  <label for="wpvivid_junk_file">
334
  <input type="checkbox" id="wpvivid_junk_file" option="junk-files" name="junk_files" value="junk-files" />
335
- <span class="wpvivid-element-space-right"><?php _e( 'Junk', 'wpvivid-backuprestore' ); ?></span>
336
- <span style="margin-right: 2px;"><?php _e('Path:', 'wpvivid-backuprestore' ); ?></span><span id="wpvivid_junk_file_path"><?php _e($junk_file['junk_path'], 'wpvivid-backuprestore'); ?></span>
337
  </label>
338
- </fieldset>
339
- <fieldset>
340
- <label for="wpvivid_junk_temporary_file">
341
  <input type="checkbox" id="wpvivid_junk_temporary_file" option="junk-files" name="old_files" value="junk-temporary-files" />
342
  <span class="wpvivid-element-space-right"><?php _e( 'Temporary Files', 'wpvivid-backuprestore' ); ?></span>
343
  <span style="margin-right: 2px;"><?php _e('Path:', 'wpvivid-backuprestore'); ?></span><span id="wpvivid_restore_temp_file_path"><?php _e($junk_file['old_files_path'], 'wpvivid-backuprestore'); ?></span>
344
  <p><?php echo __('Temporary Files are created by WPvivid when restoring a website.', 'wpvivid-backuprestore'); ?></p>
345
- </label>
346
  </fieldset>
347
  </div>
348
  <div><input class="button-primary" id="wpvivid_clean_junk_file" type="submit" name="Empty-all-files" value="<?php esc_attr_e( 'Empty', 'wpvivid-backuprestore' ); ?>" /></div>
@@ -367,7 +372,7 @@ function wpvivid_clean_junk()
367
  var current_size = jQuery('#wpvivid_junk_sum_size').html();
368
  jQuery('#wpvivid_calculate_size').css({'pointer-events': 'none', 'opacity': '0.4'});
369
  jQuery('#wpvivid_clean_junk_file').css({'pointer-events': 'none', 'opacity': '0.4'});
370
- jQuery('#wpvivid_junk_sum_size').html("calculating...");
371
  wpvivid_post_request(ajax_data, function(data){
372
  jQuery('#wpvivid_calculate_size').css({'pointer-events': 'auto', 'opacity': '1'});
373
  jQuery('#wpvivid_clean_junk_file').css({'pointer-events': 'auto', 'opacity': '1'});
@@ -375,9 +380,10 @@ function wpvivid_clean_junk()
375
  var jsonarray = jQuery.parseJSON(data);
376
  if (jsonarray.result === "success") {
377
  jQuery('#wpvivid_junk_sum_size').html(jsonarray.data.sum_size);
378
- jQuery('#wpvivid_junk_log_path').html(jsonarray.data.log_path);
379
- jQuery('#wpvivid_junk_file_path').html(jsonarray.data.junk_path);
380
- jQuery('#wpvivid_restore_temp_file_path').html(jsonarray.data.old_files_path);
 
381
  }
382
  }
383
  catch(err){
@@ -418,9 +424,10 @@ function wpvivid_clean_junk()
418
  alert(jsonarray.msg);
419
  if (jsonarray.result === "success") {
420
  jQuery('#wpvivid_junk_sum_size').html(jsonarray.data.sum_size);
421
- jQuery('#wpvivid_junk_log_path').html(jsonarray.data.log_path);
422
- jQuery('#wpvivid_junk_file_path').html(jsonarray.data.junk_path);
423
- jQuery('#wpvivid_restore_temp_file_path').html(jsonarray.data.old_files_path);
 
424
  jQuery('#wpvivid_loglist').html("");
425
  jQuery('#wpvivid_loglist').append(jsonarray.html);
426
  wpvivid_log_count = jsonarray.log_count;
298
  function wpvivid_clean_junk()
299
  {
300
  global $wpvivid_plugin;
301
+ $junk_file=$wpvivid_plugin->_junk_files_info_ex();
302
+ //echo json_encode($junk_file);
303
  //$junk_file=$wpvivid_plugin->_junk_files_info();
304
+ /*$junk_file['sum_size']=0;
305
  $junk_file['log_dir_size']=0;
306
  $junk_file['backup_dir_size'] =0;
307
  $junk_file['log_path'] = $log_dir = $wpvivid_plugin->wpvivid_log->GetSaveLogFolder();
308
  $dir = WPvivid_Setting::get_backupdir();
309
  $junk_file['old_files_path'] = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . WPVIVID_DEFAULT_ROLLBACK_DIR;
310
  $dir = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $dir;
311
+ $junk_file['junk_path'] = $dir;*/
312
  ?>
313
  <div class="postbox schedule-tab-block" id="wpvivid_clean_junk">
314
  <div>
317
  <div class="setting-tab-block">
318
  <div class="setting-tab-block">
319
  <span class="wpvivid-element-space-right"><?php _e('Total Size:', 'wpvivid-backuprestore'); ?></span>
320
+ <span class="wpvivid-size-calc wpvivid-element-space-right" id="wpvivid_junk_sum_size"><?php _e($junk_file['sum_size'], 'wpvivid-backuprestore'); ?></span>
321
+ <span class="wpvivid-element-space-right"><?php _e( 'Backup Size:', 'wpvivid-backuprestore' ); ?></span>
322
+ <span class="wpvivid-size-calc wpvivid-element-space-right" id="wpvivid_backup_size"><?php _e($junk_file['backup_size'], 'wpvivid-backuprestore'); ?></span>
323
  <input class="button-secondary" id="wpvivid_calculate_size" style="margin-left:10px;" type="submit" name="Calculate-Sizes" value="<?php esc_attr_e( 'Calculate Sizes', 'wpvivid-backuprestore' ); ?>" />
324
  </div>
325
  <fieldset>
326
  <label for="wpvivid_junk_log">
327
  <input type="checkbox" id="wpvivid_junk_log" option="junk-files" name="log" value="junk-log" />
328
+ <span class="wpvivid-element-space-right"><?php _e( 'Logs Size:', 'wpvivid-backuprestore' ); ?></span>
329
+ <span class="wpvivid-size-calc" id="wpvivid_log_size"><?php _e($junk_file['log_dir_size'], 'wpvivid-backuprestore'); ?></span>
330
  </label>
331
  </fieldset>
332
  <fieldset>
333
  <label for="wpvivid_junk_backup_cache">
334
  <input type="checkbox" id="wpvivid_junk_backup_cache" option="junk-files" name="backup_cache" value="junk-backup-cache" />
335
+ <span class="wpvivid-element-space-right"><?php _e( 'Backup Cache Size:', 'wpvivid-backuprestore' ); ?></span>
336
+ <span class="wpvivid-size-calc" id="wpvivid_backup_cache_size"><?php _e($junk_file['backup_cache_size'], 'wpvivid-backuprestore'); ?></span>
337
  </label>
338
+ </fieldset>
339
+ <fieldset>
340
  <label for="wpvivid_junk_file">
341
  <input type="checkbox" id="wpvivid_junk_file" option="junk-files" name="junk_files" value="junk-files" />
342
+ <span class="wpvivid-element-space-right"><?php _e( 'Junk Size:', 'wpvivid-backuprestore' ); ?></span>
343
+ <span class="wpvivid-size-calc" id="wpvivid_junk_size"><?php _e($junk_file['junk_size'], 'wpvivid-backuprestore'); ?></span>
344
  </label>
345
+ <!--<label for="wpvivid_junk_temporary_file">
 
 
346
  <input type="checkbox" id="wpvivid_junk_temporary_file" option="junk-files" name="old_files" value="junk-temporary-files" />
347
  <span class="wpvivid-element-space-right"><?php _e( 'Temporary Files', 'wpvivid-backuprestore' ); ?></span>
348
  <span style="margin-right: 2px;"><?php _e('Path:', 'wpvivid-backuprestore'); ?></span><span id="wpvivid_restore_temp_file_path"><?php _e($junk_file['old_files_path'], 'wpvivid-backuprestore'); ?></span>
349
  <p><?php echo __('Temporary Files are created by WPvivid when restoring a website.', 'wpvivid-backuprestore'); ?></p>
350
+ </label>-->
351
  </fieldset>
352
  </div>
353
  <div><input class="button-primary" id="wpvivid_clean_junk_file" type="submit" name="Empty-all-files" value="<?php esc_attr_e( 'Empty', 'wpvivid-backuprestore' ); ?>" /></div>
372
  var current_size = jQuery('#wpvivid_junk_sum_size').html();
373
  jQuery('#wpvivid_calculate_size').css({'pointer-events': 'none', 'opacity': '0.4'});
374
  jQuery('#wpvivid_clean_junk_file').css({'pointer-events': 'none', 'opacity': '0.4'});
375
+ jQuery('.wpvivid-size-calc').html("calculating...");
376
  wpvivid_post_request(ajax_data, function(data){
377
  jQuery('#wpvivid_calculate_size').css({'pointer-events': 'auto', 'opacity': '1'});
378
  jQuery('#wpvivid_clean_junk_file').css({'pointer-events': 'auto', 'opacity': '1'});
380
  var jsonarray = jQuery.parseJSON(data);
381
  if (jsonarray.result === "success") {
382
  jQuery('#wpvivid_junk_sum_size').html(jsonarray.data.sum_size);
383
+ jQuery('#wpvivid_log_size').html(jsonarray.data.log_dir_size);
384
+ jQuery('#wpvivid_backup_cache_size').html(jsonarray.data.backup_cache_size);
385
+ jQuery('#wpvivid_junk_size').html(jsonarray.data.junk_size);
386
+ jQuery('#wpvivid_backup_size').html(jsonarray.data.backup_size);
387
  }
388
  }
389
  catch(err){
424
  alert(jsonarray.msg);
425
  if (jsonarray.result === "success") {
426
  jQuery('#wpvivid_junk_sum_size').html(jsonarray.data.sum_size);
427
+ jQuery('#wpvivid_log_size').html(jsonarray.data.log_dir_size);
428
+ jQuery('#wpvivid_backup_cache_size').html(jsonarray.data.backup_cache_size);
429
+ jQuery('#wpvivid_junk_size').html(jsonarray.data.junk_size);
430
+ jQuery('#wpvivid_backup_size').html(jsonarray.data.backup_size);
431
  jQuery('#wpvivid_loglist').html("");
432
  jQuery('#wpvivid_loglist').append(jsonarray.html);
433
  wpvivid_log_count = jsonarray.log_count;
includes/class-wpvivid-importer.php CHANGED
@@ -1072,11 +1072,13 @@ class WPvivid_media_importer
1072
  $value = maybe_unserialize( $meta['value'] );
1073
  if(metadata_exists('post', $post_id, $key))
1074
  {
1075
- update_post_meta($post_id,$key,$value);
 
1076
  }
1077
  else
1078
  {
1079
- add_post_meta( $post_id, $key, $value );
 
1080
  }
1081
 
1082
 
@@ -1296,11 +1298,13 @@ class WPvivid_media_importer
1296
  $value = maybe_unserialize( $meta['value'] );
1297
  if(metadata_exists('post', $post_id, $key))
1298
  {
1299
- update_post_meta($post_id,$key,$value);
 
1300
  }
1301
  else
1302
  {
1303
- add_post_meta( $post_id, $key, $value );
 
1304
  }
1305
 
1306
 
1072
  $value = maybe_unserialize( $meta['value'] );
1073
  if(metadata_exists('post', $post_id, $key))
1074
  {
1075
+ //update_post_meta($post_id,$key,$value);
1076
+ update_post_meta($post_id, wp_slash( $key ), wp_slash_strings_only( $value ));
1077
  }
1078
  else
1079
  {
1080
+ //add_post_meta( $post_id, $key, $value );
1081
+ add_post_meta( $post_id, wp_slash( $key ), wp_slash_strings_only( $value ) );
1082
  }
1083
 
1084
 
1298
  $value = maybe_unserialize( $meta['value'] );
1299
  if(metadata_exists('post', $post_id, $key))
1300
  {
1301
+ //update_post_meta($post_id,$key,$value);
1302
+ update_post_meta($post_id, wp_slash( $key ), wp_slash_strings_only( $value ));
1303
  }
1304
  else
1305
  {
1306
+ //add_post_meta( $post_id, $key, $value );
1307
+ add_post_meta( $post_id, wp_slash( $key ), wp_slash_strings_only( $value ) );
1308
  }
1309
 
1310
 
includes/class-wpvivid-tools.php CHANGED
@@ -19,14 +19,14 @@ class WPvivid_tools
19
  }
20
  while(($filename=readdir($handler))!==false)
21
  {
22
- if(is_dir($path.DIRECTORY_SEPARATOR.$filename) && preg_match('#temp-'.$home_url_prefix.'_'.'#',$filename))
23
  {
24
  WPvivid_tools::deldir($path.DIRECTORY_SEPARATOR.$filename,'',true);
25
  }
26
  if(is_dir($path.DIRECTORY_SEPARATOR.$filename) && preg_match('#temp-'.'#',$filename))
27
  {
28
  WPvivid_tools::deldir($path.DIRECTORY_SEPARATOR.$filename,'',true);
29
- }
30
  if(preg_match('#pclzip-.*\.tmp#', $filename)){
31
  @unlink($path.DIRECTORY_SEPARATOR.$filename);
32
  }
19
  }
20
  while(($filename=readdir($handler))!==false)
21
  {
22
+ /*if(is_dir($path.DIRECTORY_SEPARATOR.$filename) && preg_match('#temp-'.$home_url_prefix.'_'.'#',$filename))
23
  {
24
  WPvivid_tools::deldir($path.DIRECTORY_SEPARATOR.$filename,'',true);
25
  }
26
  if(is_dir($path.DIRECTORY_SEPARATOR.$filename) && preg_match('#temp-'.'#',$filename))
27
  {
28
  WPvivid_tools::deldir($path.DIRECTORY_SEPARATOR.$filename,'',true);
29
+ }*/
30
  if(preg_match('#pclzip-.*\.tmp#', $filename)){
31
  @unlink($path.DIRECTORY_SEPARATOR.$filename);
32
  }
includes/class-wpvivid.php CHANGED
@@ -4282,7 +4282,7 @@ class WPvivid {
4282
  $this->ajax_check_security();
4283
  try {
4284
  $ret['result'] = 'success';
4285
- $ret['data'] = $this->_junk_files_info();
4286
  echo json_encode($ret);
4287
  }
4288
  catch (Exception $error) {
@@ -4294,6 +4294,225 @@ class WPvivid {
4294
  die();
4295
  }
4296
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4297
  public function _junk_files_info()
4298
  {
4299
  try {
@@ -4321,6 +4540,33 @@ class WPvivid {
4321
  $ret['junk_path'] = $dir;
4322
  $ret['sum_size'] = '0';
4323
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4324
  return $ret;
4325
  }
4326
 
@@ -4491,12 +4737,12 @@ class WPvivid {
4491
  foreach ($delete_folder as $folder)
4492
  {
4493
  if(file_exists($folder))
4494
- @rmdir($folder);
4495
  }
4496
 
4497
  $ret['result']='success';
4498
  $ret['msg']=__('The selected junk files have been deleted.', 'wpvivid-backuprestore');
4499
- $ret['data']=$this->_junk_files_info();
4500
  $html = '';
4501
  $html = apply_filters('wpvivid_get_log_list', $html);
4502
  $ret['html'] = $html['html'];
@@ -5720,7 +5966,10 @@ class WPvivid {
5720
  $ret['data']['max_input_vars'] = ini_get("max_input_vars");
5721
  $ret['data']['max_input_vars'] = ini_get("max_input_vars");
5722
  $ret['data']['timezone'] = $timezone;//date_default_timezone_get();
5723
- $ret['data']['OS'] = php_uname();
 
 
 
5724
  $ret['data']['memory_current'] = $this->formatBytes(memory_get_usage());
5725
  $ret['data']['memory_peak'] = $this->formatBytes(memory_get_peak_usage());
5726
  $ret['data']['memory_limit'] = ini_get('memory_limit');
4282
  $this->ajax_check_security();
4283
  try {
4284
  $ret['result'] = 'success';
4285
+ $ret['data'] = $this->_junk_files_info_ex();
4286
  echo json_encode($ret);
4287
  }
4288
  catch (Exception $error) {
4294
  die();
4295
  }
4296
 
4297
+ public function check_is_a_wpvivid_backup($file_name)
4298
+ {
4299
+ $ret=WPvivid_Backup_Item::get_backup_file_info($file_name);
4300
+ if($ret['result'] === WPVIVID_SUCCESS){
4301
+ return true;
4302
+ }
4303
+ elseif($ret['result'] === WPVIVID_FAILED){
4304
+ return $ret['error'];
4305
+ }
4306
+ }
4307
+
4308
+ public function check_file_is_a_wpvivid_backup($file_name,&$backup_id)
4309
+ {
4310
+ if(preg_match('/wpvivid-.*_.*_.*\.zip$/',$file_name))
4311
+ {
4312
+ if(preg_match('/wpvivid-(.*?)_/',$file_name,$matches))
4313
+ {
4314
+ $id= $matches[0];
4315
+ $id=substr($id,0,strlen($id)-1);
4316
+
4317
+ $backup_id_list=WPvivid_Backuplist::get_has_remote_backuplist();
4318
+ if(in_array($id, $backup_id_list))
4319
+ {
4320
+ return false;
4321
+ }
4322
+ return true;
4323
+ }
4324
+ else
4325
+ {
4326
+ return false;
4327
+ }
4328
+ }
4329
+ else
4330
+ {
4331
+ return false;
4332
+ }
4333
+ }
4334
+
4335
+ public function get_wpvivid_backup_size()
4336
+ {
4337
+ $path=WP_CONTENT_DIR.DIRECTORY_SEPARATOR.WPvivid_Setting::get_backupdir().DIRECTORY_SEPARATOR;
4338
+ $backups=array();
4339
+ $count = 0;
4340
+ $ret_size = 0;
4341
+ if(is_dir($path))
4342
+ {
4343
+ $handler = opendir($path);
4344
+ if($handler!==false)
4345
+ {
4346
+ while (($filename = readdir($handler)) !== false)
4347
+ {
4348
+ if ($filename != "." && $filename != "..")
4349
+ {
4350
+ $count++;
4351
+
4352
+ if (is_dir($path . $filename))
4353
+ {
4354
+ continue;
4355
+ } else {
4356
+ if($this->check_file_is_a_wpvivid_backup($filename,$backup_id))
4357
+ {
4358
+ if($this->check_is_a_wpvivid_backup($path.$filename) === true)
4359
+ {
4360
+ $backups[$backup_id]['files'][] = $filename;
4361
+ }
4362
+ }
4363
+ }
4364
+ }
4365
+ }
4366
+ if($handler)
4367
+ @closedir($handler);
4368
+ }
4369
+ if(!empty($backups))
4370
+ {
4371
+ foreach ($backups as $backup_id =>$backup)
4372
+ {
4373
+ $backup_data['result']='success';
4374
+ $backup_data['files']=array();
4375
+ if(empty($backup['files']))
4376
+ continue;
4377
+ foreach ($backup['files'] as $file)
4378
+ {
4379
+ $ret_size += filesize($path.$file);
4380
+ }
4381
+ }
4382
+ }
4383
+ }
4384
+ else{
4385
+ $ret_size = 0;
4386
+ }
4387
+ return $ret_size;
4388
+ }
4389
+
4390
+ public function _junk_files_info_ex()
4391
+ {
4392
+ try {
4393
+ $log_dir = $this->wpvivid_log->GetSaveLogFolder();
4394
+ $log_dir_byte = $this->GetDirectorySize($log_dir);
4395
+ $ret['log_dir_size'] = $this->formatBytes($log_dir_byte);
4396
+
4397
+
4398
+ $ret['backup_cache_size'] = 0;
4399
+ $path = WP_CONTENT_DIR.DIRECTORY_SEPARATOR.WPvivid_Setting::get_backupdir();
4400
+ $handler=opendir($path);
4401
+ if($handler===false)
4402
+ {
4403
+ $ret['backup_cache_size'] = 0;
4404
+ }
4405
+ while(($filename=readdir($handler))!==false)
4406
+ {
4407
+ if(preg_match('#pclzip-.*\.tmp#', $filename)){
4408
+ $ret['backup_cache_size'] += filesize($path.DIRECTORY_SEPARATOR.$filename);
4409
+ }
4410
+ if(preg_match('#pclzip-.*\.gz#', $filename)){
4411
+ $ret['backup_cache_size'] += filesize($path.DIRECTORY_SEPARATOR.$filename);
4412
+ }
4413
+ }
4414
+ @closedir($handler);
4415
+ $backup_id_list=WPvivid_Backuplist::get_has_remote_backuplist();
4416
+ foreach ($backup_id_list as $backup_id)
4417
+ {
4418
+ $backup=WPvivid_Backuplist::get_backup_by_id($backup_id);
4419
+ if(!$backup)
4420
+ {
4421
+ continue;
4422
+ }
4423
+
4424
+ if(array_key_exists('lock',$backup))
4425
+ {
4426
+ continue;
4427
+ }
4428
+
4429
+ $backup_item = new WPvivid_Backup_Item($backup);
4430
+ $file=$backup_item->get_files(false);
4431
+ foreach ($file as $filename)
4432
+ {
4433
+ if(file_exists($path.DIRECTORY_SEPARATOR.$filename))
4434
+ {
4435
+ $ret['backup_cache_size'] += filesize($path.DIRECTORY_SEPARATOR.$filename);
4436
+ }
4437
+ }
4438
+ }
4439
+ $ret['backup_cache_size'] = $this->formatBytes($ret['backup_cache_size']);
4440
+
4441
+
4442
+ $ret['junk_size'] = 0;
4443
+ $delete_files = array();
4444
+ $delete_folder = array();
4445
+ $list=WPvivid_Backuplist::get_backuplist();
4446
+ $files=array();
4447
+ foreach ($list as $backup_id => $backup_value)
4448
+ {
4449
+ $backup=WPvivid_Backuplist::get_backup_by_id($backup_id);
4450
+ if($backup===false)
4451
+ {
4452
+ continue;
4453
+ }
4454
+ $backup_item = new WPvivid_Backup_Item($backup);
4455
+ $file=$backup_item->get_files(false);
4456
+ foreach ($file as $filename){
4457
+ $files[]=$filename;
4458
+ }
4459
+ }
4460
+
4461
+ $dir=WPvivid_Setting::get_backupdir();
4462
+ $dir=WP_CONTENT_DIR.DIRECTORY_SEPARATOR. $dir;
4463
+ $path=str_replace('/',DIRECTORY_SEPARATOR,$this->wpvivid_log->GetSaveLogFolder());
4464
+ if(substr($path, -1) == DIRECTORY_SEPARATOR)
4465
+ {
4466
+ $path = substr($path, 0, -1);
4467
+ }
4468
+ $folder[]= $path;
4469
+ $except_regex['file'][]='&wpvivid-&';
4470
+ $except_regex['file'][]='&wpvivid_temp-&';
4471
+ //$except_regex['file'][]='&'.apply_filters('wpvivid_white_label_file_prefix', 'wpvivid').'-&';
4472
+ //$except_regex['file'][]='&'.apply_filters('wpvivid_white_label_file_prefix', 'wpvivid').'_temp-&';
4473
+ $this -> get_dir_files($delete_files,$delete_folder,$dir,$except_regex,$files,$folder,0,false);
4474
+
4475
+ foreach ($delete_files as $file)
4476
+ {
4477
+ if(file_exists($file))
4478
+ {
4479
+ $ret['junk_size'] += filesize($file);
4480
+ }
4481
+ }
4482
+
4483
+ foreach ($delete_folder as $folder)
4484
+ {
4485
+ if(file_exists($folder))
4486
+ {
4487
+ $ret['junk_size'] += $this->GetDirectorySize($folder);
4488
+ }
4489
+ }
4490
+ $ret['junk_size'] = $this->formatBytes($ret['junk_size']);
4491
+
4492
+
4493
+ $backup_dir_byte = $this->GetDirectorySize($dir);
4494
+
4495
+ $ret['backup_size'] = $this->get_wpvivid_backup_size();
4496
+ $ret['backup_size'] = $this->formatBytes($ret['backup_size']);
4497
+
4498
+ $ret['sum_size'] = $this->formatBytes($backup_dir_byte + $log_dir_byte);
4499
+ }
4500
+ catch (Exception $e)
4501
+ {
4502
+ $ret['log_path'] = $log_dir = $this->wpvivid_log->GetSaveLogFolder();
4503
+ $dir = WPvivid_Setting::get_backupdir();
4504
+ $ret['old_files_path'] = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . WPVIVID_DEFAULT_ROLLBACK_DIR;
4505
+ $dir = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $dir;
4506
+ $ret['junk_path'] = $dir;
4507
+ $ret['sum_size'] = '0';
4508
+ $ret['log_dir_size'] = '0';
4509
+ $ret['backup_cache_size'] = '0';
4510
+ $ret['junk_size'] = '0';
4511
+ $ret['backup_size'] = '0';
4512
+ }
4513
+ return $ret;
4514
+ }
4515
+
4516
  public function _junk_files_info()
4517
  {
4518
  try {
4540
  $ret['junk_path'] = $dir;
4541
  $ret['sum_size'] = '0';
4542
  }
4543
+ /*
4544
+ * try {
4545
+ $dir = WPvivid_Setting::get_backupdir();
4546
+
4547
+ $ret['log_path'] = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $dir .DIRECTORY_SEPARATOR . 'wpvivid_log';
4548
+ $log_dir_byte = $this->GetDirectorySize($ret['log_path']);
4549
+ $ret['log_dir_size'] = $this->formatBytes($log_dir_byte);
4550
+
4551
+ $ret['old_files_path'] = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . WPVIVID_DEFAULT_ROLLBACK_DIR;
4552
+ $dir = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $dir;
4553
+ $ret['junk_path'] = $dir;
4554
+
4555
+ $backup_dir_byte = $this->GetDirectorySize($dir);
4556
+ $ret['backup_dir_size'] = $this->formatBytes($backup_dir_byte);
4557
+
4558
+ $ret['sum_size'] = $this->formatBytes($backup_dir_byte + $log_dir_byte);
4559
+ }
4560
+ catch (Exception $e)
4561
+ {
4562
+ $dir = WPvivid_Setting::get_backupdir();
4563
+ $ret['log_path'] = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $dir .DIRECTORY_SEPARATOR . 'wpvivid_log';
4564
+ $ret['old_files_path'] = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . WPVIVID_DEFAULT_ROLLBACK_DIR;
4565
+ $dir = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $dir;
4566
+ $ret['junk_path'] = $dir;
4567
+ $ret['sum_size'] = '0';
4568
+ }
4569
+ */
4570
  return $ret;
4571
  }
4572
 
4737
  foreach ($delete_folder as $folder)
4738
  {
4739
  if(file_exists($folder))
4740
+ WPvivid_tools::deldir($folder,'',true);
4741
  }
4742
 
4743
  $ret['result']='success';
4744
  $ret['msg']=__('The selected junk files have been deleted.', 'wpvivid-backuprestore');
4745
+ $ret['data']=$this->_junk_files_info_ex();
4746
  $html = '';
4747
  $html = apply_filters('wpvivid_get_log_list', $html);
4748
  $ret['html'] = $html['html'];
5966
  $ret['data']['max_input_vars'] = ini_get("max_input_vars");
5967
  $ret['data']['max_input_vars'] = ini_get("max_input_vars");
5968
  $ret['data']['timezone'] = $timezone;//date_default_timezone_get();
5969
+ if(function_exists('php_uname'))
5970
+ {
5971
+ $ret['data']['OS'] = php_uname();
5972
+ }
5973
  $ret['data']['memory_current'] = $this->formatBytes(memory_get_usage());
5974
  $ret['data']['memory_peak'] = $this->formatBytes(memory_get_peak_usage());
5975
  $ret['data']['memory_limit'] = ini_get('memory_limit');
includes/customclass/class-wpvivid-dropbox.php CHANGED
@@ -626,7 +626,7 @@ class WPvivid_Dropbox extends WPvivid_Remote
626
  <?php _e('Please read <a target="_blank" href="https://wpvivid.com/privacy-policy" style="text-decoration: none;">this privacy policy</a> for use of our Dropbox authorization app (none of your backup data is sent to us).', 'wpvivid-backuprestore'); ?>
627
  </div>
628
  <div style="padding: 10px 10px 10px 0;">
629
- <strong><?php _e('Enter Your Dropbox Information', 'wpvivid-backuprestore'); ?></strong>
630
  </div>
631
  <table class="wp-list-table widefat plugins" style="width:100%;">
632
  <tbody>
@@ -644,6 +644,9 @@ class WPvivid_Dropbox extends WPvivid_Remote
644
  </tr>
645
  </tbody>
646
  </table>
 
 
 
647
  </div>
648
  <script>
649
  function wpvivid_dropbox_auth()
626
  <?php _e('Please read <a target="_blank" href="https://wpvivid.com/privacy-policy" style="text-decoration: none;">this privacy policy</a> for use of our Dropbox authorization app (none of your backup data is sent to us).', 'wpvivid-backuprestore'); ?>
627
  </div>
628
  <div style="padding: 10px 10px 10px 0;">
629
+ <strong><?php _e('To add Dropbox, please get Dropbox authentication first. Once authenticated, you will be redirected to this page, then you can add storage information and save it.', 'wpvivid-backuprestore'); ?></strong>
630
  </div>
631
  <table class="wp-list-table widefat plugins" style="width:100%;">
632
  <tbody>
644
  </tr>
645
  </tbody>
646
  </table>
647
+ <div style="padding: 10px 0 0 0;">
648
+ <span>Tip: Get a 404 or 403 error after authorization? Please read this <a href="https://docs.wpvivid.com/http-403-error-authorizing-cloud-storage.html">doc</a>.</span>
649
+ </div>
650
  </div>
651
  <script>
652
  function wpvivid_dropbox_auth()
includes/customclass/class-wpvivid-google-drive.php CHANGED
@@ -424,6 +424,9 @@ class Wpvivid_Google_drive extends WPvivid_Remote
424
  </tr>
425
  </tbody>
426
  </table>
 
 
 
427
  </div>
428
  <script>
429
  function wpvivid_google_drive_auth()
424
  </tr>
425
  </tbody>
426
  </table>
427
+ <div style="padding: 10px 0 0 0;">
428
+ <span>Tip: Get a 404 or 403 error after authorization? Please read this <a href="https://docs.wpvivid.com/http-403-error-authorizing-cloud-storage.html">doc</a>.</span>
429
+ </div>
430
  </div>
431
  <script>
432
  function wpvivid_google_drive_auth()
includes/customclass/class-wpvivid-one-drive.php CHANGED
@@ -408,6 +408,9 @@ class WPvivid_one_drive extends WPvivid_Remote
408
  </tr>
409
  </tbody>
410
  </table>
 
 
 
411
  </div>
412
  <script>
413
  function wpvivid_one_drive_auth()
408
  </tr>
409
  </tbody>
410
  </table>
411
+ <div style="padding: 10px 0 0 0;">
412
+ <span>Tip: Get a 404 or 403 error after authorization? Please read this <a href="https://docs.wpvivid.com/http-403-error-authorizing-cloud-storage.html">doc</a>.</span>
413
+ </div>
414
  </div>
415
  <script>
416
  function wpvivid_one_drive_auth()
includes/staging/class-wpvivid-staging.php CHANGED
@@ -1760,6 +1760,7 @@ class WPvivid_Staging_Free
1760
  }
1761
 
1762
  $path = sanitize_text_field($_POST['path']);
 
1763
 
1764
  if(!isset($_POST['table_prefix']) || empty($_POST['table_prefix']) || !is_string($_POST['table_prefix']))
1765
  {
@@ -1779,6 +1780,13 @@ class WPvivid_Staging_Free
1779
  {
1780
  $path = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $path;
1781
  }
 
 
 
 
 
 
 
1782
 
1783
  if (file_exists($path))
1784
  {
1760
  }
1761
 
1762
  $path = sanitize_text_field($_POST['path']);
1763
+ $path = sanitize_file_name($path);
1764
 
1765
  if(!isset($_POST['table_prefix']) || empty($_POST['table_prefix']) || !is_string($_POST['table_prefix']))
1766
  {
1780
  {
1781
  $path = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $path;
1782
  }
1783
+ else
1784
+ {
1785
+ $ret['result'] = 'failed';
1786
+ $ret['error'] = 'We are not able to authenticate the staging directory, please contact us.';
1787
+ echo json_encode($ret);
1788
+ die();
1789
+ }
1790
 
1791
  if (file_exists($path))
1792
  {
includes/upload-cleaner/class-wpvivid-uploads-scanner.php CHANGED
@@ -973,6 +973,18 @@ class WPvivid_Uploads_Scanner
973
  }
974
  }
975
 
 
 
 
 
 
 
 
 
 
 
 
 
976
  if(isset($settings['carousel']) && !empty($settings['carousel']))
977
  {
978
  foreach ($settings['carousel'] as $item)
973
  }
974
  }
975
 
976
+ if(isset($settings['background_a_image']))
977
+ {
978
+ if(isset($settings['background_a_image']['id']))
979
+ {
980
+ if(!in_array($settings['background_a_image']['id'],$attachment_added_ids))
981
+ {
982
+ $element_image[]=$settings['background_a_image']['id'];
983
+ $attachment_added_ids[]=$settings['background_a_image']['id'];
984
+ }
985
+ }
986
+ }
987
+
988
  if(isset($settings['carousel']) && !empty($settings['carousel']))
989
  {
990
  foreach ($settings['carousel'] as $item)
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: wpvivid
3
  Tags: move, clone, migrate, staging, backup, restore, auto backup, cloud backup
4
  Requires at least: 4.5
5
- Tested up to: 6.0
6
  Requires PHP: 5.3
7
- Stable tag: 0.9.74
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
10
 
@@ -170,7 +170,7 @@ Yes, absolutely. With no limits, no strings attached.
170
  = Will there be updates, will they be free and how can I update to the latest version? =
171
  Yes, we are dedicated to creating a secure and robust solution and will regularly update the plugin. These will be available totally free and can be easily applied through your WP admin area once they are available.
172
  = Do you provide support for the free version? Where? =
173
- Yes, absolutely. Whenever you need it, help can be found from the plugin [support forum](https://wordpress.org/support/plugin/wpvivid-backuprestore/) on WordPress.org, by [email](https://wpvivid.com/contact-us), on [Twitter](https://twitter.com/WPvividcom).
174
  = Will WPvivid Backup Plugin work on my host? =
175
  If your website is running on WordPress then yes it will.
176
 
@@ -179,7 +179,7 @@ The plugin has been extensively tested on the shared and dedicated hosting plans
179
  Yes, we do. Here are the guides for [migrating your site to a new host](https://wpvivid.com/get-started-transfer-site.html), [creating a manual backup](https://wpvivid.com/get-started-create-a-manual-backup.html), [restoring your site from a backup](https://wpvivid.com/get-started-restore-site.html), and more on [our docs page](https://wpvivid.com/documents).
180
 
181
  == Contact us ==
182
- Feel free to let us know how we can help using the [support forum](https://wordpress.org/support/plugin/wpvivid-backuprestore) for WPvivid Backup Plugin on WordPress.org or our [contact form](https://wpvivid.com/contact-us). You can also reach us with a direct message on [Twitter](https://twitter.com/WPvividcom).
183
 
184
  == Languages and Translators ==
185
  Thank you so much for translating WPvivid Backup Plugin to your languages!
@@ -198,6 +198,11 @@ Thank you so much for translating WPvivid Backup Plugin to your languages!
198
  * [Yordan Soares](https://profiles.wordpress.org/yordansoares/) (Spanish(all locales))
199
  * [Chun-Chih Cheng](https://www.facebook.com/groups/wordpresstwhant) (Chinese (Taiwan))
200
  == Changelog ==
 
 
 
 
 
201
  = 0.9.74 =
202
  - Fixed some i18n issues in the plugin code.
203
  - Updated: Last backup time will be updated once the backup schedule is triggered.
2
  Contributors: wpvivid
3
  Tags: move, clone, migrate, staging, backup, restore, auto backup, cloud backup
4
  Requires at least: 4.5
5
+ Tested up to: 6.0.1
6
  Requires PHP: 5.3
7
+ Stable tag: 0.9.75
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
10
 
170
  = Will there be updates, will they be free and how can I update to the latest version? =
171
  Yes, we are dedicated to creating a secure and robust solution and will regularly update the plugin. These will be available totally free and can be easily applied through your WP admin area once they are available.
172
  = Do you provide support for the free version? Where? =
173
+ Yes, absolutely. Whenever you need it, help can be found from the plugin [support forum](https://wordpress.org/support/plugin/wpvivid-backuprestore/) on WordPress.org, by [email](https://wpvivid.com/contact-us).
174
  = Will WPvivid Backup Plugin work on my host? =
175
  If your website is running on WordPress then yes it will.
176
 
179
  Yes, we do. Here are the guides for [migrating your site to a new host](https://wpvivid.com/get-started-transfer-site.html), [creating a manual backup](https://wpvivid.com/get-started-create-a-manual-backup.html), [restoring your site from a backup](https://wpvivid.com/get-started-restore-site.html), and more on [our docs page](https://wpvivid.com/documents).
180
 
181
  == Contact us ==
182
+ Feel free to let us know how we can help using the [support forum](https://wordpress.org/support/plugin/wpvivid-backuprestore) for WPvivid Backup Plugin on WordPress.org or our [contact form](https://wpvivid.com/contact-us).
183
 
184
  == Languages and Translators ==
185
  Thank you so much for translating WPvivid Backup Plugin to your languages!
198
  * [Yordan Soares](https://profiles.wordpress.org/yordansoares/) (Spanish(all locales))
199
  * [Chun-Chih Cheng](https://www.facebook.com/groups/wordpresstwhant) (Chinese (Taiwan))
200
  == Changelog ==
201
+ = 0.9.75 =
202
+ - Fixed: Page styling got lost after importing the page in some cases.
203
+ - Fixed: Some used images were falsely scanned as unused.
204
+ - Fixed some UI bugs.
205
+ - Fixed some bugs in the plugin code and optimized the plugin code.
206
  = 0.9.74 =
207
  - Fixed some i18n issues in the plugin code.
208
  - Updated: Last backup time will be updated once the backup schedule is triggered.
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.74
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.74' );
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.75
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.75' );
25
  //
26
  define('WPVIVID_RESTORE_INIT','init');
27
  define('WPVIVID_RESTORE_READY','ready');