XCloner – Backup and Restore - Version 4.0.7

Version Description

  • added log fixes for Wordpress cron
  • remove storage fixes
Download this release

Release Info

Developer xcloner
Plugin Icon 128x128 XCloner – Backup and Restore
Version 4.0.7
Comparing to
See all releases

Code changes from version 4.0.6 to 4.0.7

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: backup plugin, restore plugin, database backup, duplicate, full site backup, website cloner, wordpress backup, database restore, webdav, azure, ftp, sftp, amazon s3, dropbox, google drive, differential backup
5
  Requires at least: 3.0.1
6
  Tested up to: 4.9
7
- Stable tag: 4.0.5
8
 
9
  Backup your site, restore to any web location, send your backups to Dropbox, Amazon S3, Azure, FTP, SFTP, WebDAV, Google Drive with XCloner plugin.
10
 
@@ -106,8 +106,16 @@ Of course, schedules can be adjusted accordingly to how often you update your si
106
  10. Generate Backup Process
107
  11. Generate Backup Screen
108
 
 
 
 
 
109
  == Changelog ==
110
 
 
 
 
 
111
  = 4.0.6 =
112
  * S3 prefix addon for defining folders
113
  * S3 custom endpoint addon to support minio.io
4
  Tags: backup plugin, restore plugin, database backup, duplicate, full site backup, website cloner, wordpress backup, database restore, webdav, azure, ftp, sftp, amazon s3, dropbox, google drive, differential backup
5
  Requires at least: 3.0.1
6
  Tested up to: 4.9
7
+ Stable tag: 4.0.7
8
 
9
  Backup your site, restore to any web location, send your backups to Dropbox, Amazon S3, Azure, FTP, SFTP, WebDAV, Google Drive with XCloner plugin.
10
 
106
  10. Generate Backup Process
107
  11. Generate Backup Screen
108
 
109
+ == DONORS ==
110
+
111
+ Immigration Attorney Montana <a href="https://www.immigrationlawofmt.com" target='_blank'>https://www.immigrationlawofmt.com</a>
112
+
113
  == Changelog ==
114
 
115
+ = 4.0.7 =
116
+ * added log fixes for Wordpress cron
117
+ * remove storage fixes
118
+
119
  = 4.0.6 =
120
  * S3 prefix addon for defining folders
121
  * S3 custom endpoint addon to support minio.io
admin/partials/xcloner_init_page.php CHANGED
@@ -23,6 +23,8 @@ $logger_content = $logger->getLastDebugLines();
23
  $date_format = get_option( 'date_format' );
24
  $time_format = get_option( 'time_format' );
25
 
 
 
26
  if($requirements->check_backup_ready_status())
27
  {
28
  $latest_backup = $xcloner_file_system->get_latest_backup();
23
  $date_format = get_option( 'date_format' );
24
  $time_format = get_option( 'time_format' );
25
 
26
+ //$xcloner_file_system->cleanup_tmp_directories();
27
+
28
  if($requirements->check_backup_ready_status())
29
  {
30
  $latest_backup = $xcloner_file_system->get_latest_backup();
admin/partials/xcloner_remote_storage_page.php CHANGED
@@ -750,6 +750,19 @@ $gdrive_construct = $remote_storage->gdrive_construct();
750
  </div>
751
  </div>
752
 
 
 
 
 
 
 
 
 
 
 
 
 
 
753
  <div class="row">
754
  <div class="col s6 m4">
755
  <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="gdrive"><?php echo __("Save Settings",'xcloner-backup-and-restore')?>
750
  </div>
751
  </div>
752
 
753
+ <div class="row">
754
+ <div class="col s12 m3 label">
755
+ <label for="gdrive_empty_trash"><?php echo __("Keeps Deleted Backups in Trash",'xcloner-backup-and-restore')?></label>
756
+ </div>
757
+ <div class=" col s12 m6 input-field inline">
758
+ <input name="xcloner_gdrive_empty_trash" type="radio" value="0" id="gdrive_empty_trash_off" <?php if(!get_option("xcloner_gdrive_empty_trash",0)) echo "checked"?> />
759
+ <label for="gdrive_empty_trash_off"><?php echo __("Enabled",'xcloner-backup-and-restore')?></label>
760
+
761
+ <input name="xcloner_gdrive_empty_trash" type="radio" value="1" id="gdrive_empty_trash_on" <?php if(get_option("xcloner_gdrive_empty_trash",0)) echo "checked"?> />
762
+ <label for="gdrive_empty_trash_on"><?php echo __("Disabled",'xcloner-backup-and-restore')?></label>
763
+ </div>
764
+ </div>
765
+
766
  <div class="row">
767
  <div class="col s6 m4">
768
  <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="gdrive"><?php echo __("Save Settings",'xcloner-backup-and-restore')?>
includes/class-xcloner-file-system.php CHANGED
@@ -450,7 +450,7 @@ class Xcloner_File_System{
450
  public function remove_tmp_filesystem()
451
  {
452
  //delete the temporary folder
453
- $this->logger->info(sprintf("Deleting the temporary storage folder %s", $this->xcloner_settings->get_xcloner_tmp_path()));
454
 
455
  $contents = $this->get_tmp_filesystem()->listContents();
456
 
@@ -474,10 +474,14 @@ class Xcloner_File_System{
474
 
475
  foreach($contents as $file)
476
  {
 
477
  if(preg_match("/.xcloner-(.*)/",$file['path']))
478
  {
479
- $tmp_filesystem->deleteDir($file['path']);
480
- $this->logger->info(sprintf("Delete temporary directory %s", $file['path']));
 
 
 
481
  }
482
  }
483
 
450
  public function remove_tmp_filesystem()
451
  {
452
  //delete the temporary folder
453
+ $this->logger->debug(sprintf("Deleting the temporary storage folder %s", $this->xcloner_settings->get_xcloner_tmp_path()));
454
 
455
  $contents = $this->get_tmp_filesystem()->listContents();
456
 
474
 
475
  foreach($contents as $file)
476
  {
477
+
478
  if(preg_match("/.xcloner-(.*)/",$file['path']))
479
  {
480
+ if($file['timestamp'] < strtotime("-1days"))
481
+ {
482
+ $tmp_filesystem->deleteDir($file['path']);
483
+ $this->logger->debug(sprintf("Delete temporary directory %s", $file['path']));
484
+ }
485
  }
486
  }
487
 
includes/class-xcloner-remote-storage.php CHANGED
@@ -108,6 +108,7 @@ class Xcloner_Remote_Storage{
108
  "gdrive_client_secret" => "string",
109
  "gdrive_target_folder" => "string",
110
  "gdrive_cleanup_days" => "float",
 
111
  ),
112
  );
113
 
@@ -584,6 +585,7 @@ class Xcloner_Remote_Storage{
584
  */
585
  public function get_gdrive_filesystem()
586
  {
 
587
  if (version_compare(phpversion(), '5.5.0', '<'))
588
  {
589
  throw new Exception("Google Drive API requires PHP 5.5 to be installed!");
@@ -604,6 +606,11 @@ class Xcloner_Remote_Storage{
604
 
605
  $service = new \Google_Service_Drive($client);
606
 
 
 
 
 
 
607
  $parent = 'root';
608
  $dir = basename( get_option("xcloner_gdrive_target_folder"));
609
 
@@ -636,7 +643,11 @@ class Xcloner_Remote_Storage{
636
 
637
  $this->logger->info(sprintf("Using target folder with ID %s on the remote storage", $folderID));
638
 
639
- $adapter = new \Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter($service, $folderID);
 
 
 
 
640
 
641
  $filesystem = new \League\Flysystem\Filesystem($adapter, new Config([
642
  'disable_asserts' => true,
108
  "gdrive_client_secret" => "string",
109
  "gdrive_target_folder" => "string",
110
  "gdrive_cleanup_days" => "float",
111
+ "gdrive_empty_trash" => "int",
112
  ),
113
  );
114
 
585
  */
586
  public function get_gdrive_filesystem()
587
  {
588
+
589
  if (version_compare(phpversion(), '5.5.0', '<'))
590
  {
591
  throw new Exception("Google Drive API requires PHP 5.5 to be installed!");
606
 
607
  $service = new \Google_Service_Drive($client);
608
 
609
+ /*if( get_option("xcloner_gdrive_empty_trash",0) ){
610
+ $this->logger->info(sprintf("Doing a Google Drive emptyTrash call"), array(""));
611
+ $service->files->emptyTrash();
612
+ }*/
613
+
614
  $parent = 'root';
615
  $dir = basename( get_option("xcloner_gdrive_target_folder"));
616
 
643
 
644
  $this->logger->info(sprintf("Using target folder with ID %s on the remote storage", $folderID));
645
 
646
+ if(class_exists('XCloner_Google_Drive_Adapter')){
647
+ $adapter = new XCloner_Google_Drive_Adapter($service, $folderID);
648
+ }else{
649
+ $adapter = new \Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter($service, $folderID);
650
+ }
651
 
652
  $filesystem = new \League\Flysystem\Filesystem($adapter, new Config([
653
  'disable_asserts' => true,
includes/class-xcloner-scheduler.php CHANGED
@@ -341,6 +341,9 @@ class Xcloner_Scheduler{
341
  $this->xcloner_file_system->remove_tmp_filesystem();
342
 
343
  $this->xcloner_file_system->backup_storage_cleanup();
 
 
 
344
  }
345
 
346
  public function xcloner_scheduler_callback($id, $schedule = "")
341
  $this->xcloner_file_system->remove_tmp_filesystem();
342
 
343
  $this->xcloner_file_system->backup_storage_cleanup();
344
+
345
+ //DO TMP FILESYSTEM CLEANUP
346
+ $this->xcloner_file_system->cleanup_tmp_directories();
347
  }
348
 
349
  public function xcloner_scheduler_callback($id, $schedule = "")
includes/class-xcloner-settings.php CHANGED
@@ -65,16 +65,22 @@ class Xcloner_Settings
65
 
66
  public function get_xcloner_tmp_path($suffix = true)
67
  {
68
- $path = sys_get_temp_dir();
69
- if(!is_dir($path))
70
- {
71
- @mkdir($path);
72
- @chmod($path, 0777);
73
- }
74
-
75
- if(!is_dir($path) or !is_writeable($path) or get_option('xcloner_force_tmp_path_site_root'))
76
  {
77
  $path = $this->get_xcloner_store_path();
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  }
79
 
80
  if($suffix)
65
 
66
  public function get_xcloner_tmp_path($suffix = true)
67
  {
68
+ if(get_option('xcloner_force_tmp_path_site_root'))
 
 
 
 
 
 
 
69
  {
70
  $path = $this->get_xcloner_store_path();
71
+ }else{
72
+
73
+ $path = sys_get_temp_dir();
74
+ if(!is_dir($path))
75
+ {
76
+ @mkdir($path);
77
+ @chmod($path, 0777);
78
+ }
79
+
80
+ if(!is_dir($path) or !is_writeable($path))
81
+ {
82
+ $path = $this->get_xcloner_store_path();
83
+ }
84
  }
85
 
86
  if($suffix)
includes/class-xcloner.php CHANGED
@@ -355,6 +355,14 @@ class Xcloner {
355
  }
356
  }
357
 
 
 
 
 
 
 
 
 
358
  $this->xcloner_sanitization = new Xcloner_Sanitization();
359
  $this->xcloner_requirements = new Xcloner_Requirements($this);
360
 
@@ -363,6 +371,8 @@ class Xcloner {
363
  //adding links to the Manage Plugins Wordpress page for XCloner
364
  add_filter('plugin_action_links', array($this, 'add_plugin_action_links'), 10, 2);
365
 
 
 
366
  }
367
 
368
  /*
355
  }
356
  }
357
 
358
+ if(defined('DOING_CRON') || !isset($_POST['hash']))
359
+ {
360
+ add_action( 'shutdown', function(){
361
+ $this->xcloner_file_system = new Xcloner_File_System($this);
362
+ $this->xcloner_file_system->remove_tmp_filesystem();
363
+ });
364
+ }
365
+
366
  $this->xcloner_sanitization = new Xcloner_Sanitization();
367
  $this->xcloner_requirements = new Xcloner_Requirements($this);
368
 
371
  //adding links to the Manage Plugins Wordpress page for XCloner
372
  add_filter('plugin_action_links', array($this, 'add_plugin_action_links'), 10, 2);
373
 
374
+
375
+
376
  }
377
 
378
  /*
xcloner.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: XCloner - Site Backup and Restore
16
  * Plugin URI: http://www.xcloner.com
17
  * Description: XCloner is a tool that will help you manage your website backups, generate/restore/move so your website will be always secured! With XCloner you will be able to clone your site to any other location with just a few clicks, as well as transfer the backup archives to remote FTP, SFTP, DropBox, Amazon S3, Google Drive, WebDAV, Backblaze, Azure accounts.
18
- * Version: 4.0.6
19
  * Author: Liuta Ovidiu
20
  * Author URI: http://www.thinkovi.com
21
  * License: GPL-2.0+
15
  * Plugin Name: XCloner - Site Backup and Restore
16
  * Plugin URI: http://www.xcloner.com
17
  * Description: XCloner is a tool that will help you manage your website backups, generate/restore/move so your website will be always secured! With XCloner you will be able to clone your site to any other location with just a few clicks, as well as transfer the backup archives to remote FTP, SFTP, DropBox, Amazon S3, Google Drive, WebDAV, Backblaze, Azure accounts.
18
+ * Version: 4.0.7
19
  * Author: Liuta Ovidiu
20
  * Author URI: http://www.thinkovi.com
21
  * License: GPL-2.0+