GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 395c84...91cc88 )
by Liuta
02:32
created
includes/class-xcloner-loader.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -58,19 +58,19 @@  discard block
 block discarded – undo
58 58
 	
59 59
 	public function xcloner_backup_add_admin_menu()
60 60
 	{
61
-		if ( function_exists('add_menu_page') )
62
-			add_menu_page( __('Site Backup','xcloner-backup-and-restore'), __('Site Backup','xcloner-backup-and-restore'), 'manage_options', 'xcloner_init_page', array($this->xcloner_container, 'xcloner_display'), 'dashicons-backup');
61
+		if (function_exists('add_menu_page'))
62
+			add_menu_page(__('Site Backup', 'xcloner-backup-and-restore'), __('Site Backup', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_init_page', array($this->xcloner_container, 'xcloner_display'), 'dashicons-backup');
63 63
 
64
-		if ( function_exists('add_submenu_page') )
64
+		if (function_exists('add_submenu_page'))
65 65
 		{
66 66
 			
67
-			add_submenu_page( 'xcloner_init_page', __('XCloner Dashboard','xcloner-backup-and-restore'), __('Dashboard','xcloner-backup-and-restore'), 'manage_options', 'xcloner_init_page', array($this->xcloner_container, 'xcloner_display'));
68
-			add_submenu_page( 'xcloner_init_page', __('XCloner Backup Settings','xcloner-backup-and-restore'), __('Settings','xcloner-backup-and-restore'), 'manage_options', 'xcloner_settings_page', array($this->xcloner_container, 'xcloner_display'));
69
-			add_submenu_page( 'xcloner_init_page', __('Remote Storage Settings','xcloner-backup-and-restore'), __('Remote Storage','xcloner-backup-and-restore'), 'manage_options', 'xcloner_remote_storage_page', array($this->xcloner_container, 'xcloner_display'));
70
-			add_submenu_page( 'xcloner_init_page', __('Manage Backups','xcloner-backup-and-restore'), __('Manage Backups','xcloner-backup-and-restore'), 'manage_options', 'xcloner_manage_backups_page', array($this->xcloner_container, 'xcloner_display'));
71
-			add_submenu_page( 'xcloner_init_page', __('Scheduled Backups','xcloner-backup-and-restore'), __('Scheduled Backups','xcloner-backup-and-restore'), 'manage_options', 'xcloner_scheduled_backups_page', array($this->xcloner_container, 'xcloner_display'));
72
-			add_submenu_page( 'xcloner_init_page', __('Generate Backups','xcloner-backup-and-restore'), __('Generate Backups','xcloner-backup-and-restore'), 'manage_options', 'xcloner_generate_backups_page', array($this->xcloner_container, 'xcloner_display'));
73
-			add_submenu_page( 'xcloner_init_page', __('Restore Backups','xcloner-backup-and-restore'), __('Restore Backups','xcloner-backup-and-restore'), 'manage_options', 'xcloner_restore_page', array($this->xcloner_container, 'xcloner_display'));
67
+			add_submenu_page('xcloner_init_page', __('XCloner Dashboard', 'xcloner-backup-and-restore'), __('Dashboard', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_init_page', array($this->xcloner_container, 'xcloner_display'));
68
+			add_submenu_page('xcloner_init_page', __('XCloner Backup Settings', 'xcloner-backup-and-restore'), __('Settings', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_settings_page', array($this->xcloner_container, 'xcloner_display'));
69
+			add_submenu_page('xcloner_init_page', __('Remote Storage Settings', 'xcloner-backup-and-restore'), __('Remote Storage', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_remote_storage_page', array($this->xcloner_container, 'xcloner_display'));
70
+			add_submenu_page('xcloner_init_page', __('Manage Backups', 'xcloner-backup-and-restore'), __('Manage Backups', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_manage_backups_page', array($this->xcloner_container, 'xcloner_display'));
71
+			add_submenu_page('xcloner_init_page', __('Scheduled Backups', 'xcloner-backup-and-restore'), __('Scheduled Backups', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_scheduled_backups_page', array($this->xcloner_container, 'xcloner_display'));
72
+			add_submenu_page('xcloner_init_page', __('Generate Backups', 'xcloner-backup-and-restore'), __('Generate Backups', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_generate_backups_page', array($this->xcloner_container, 'xcloner_display'));
73
+			add_submenu_page('xcloner_init_page', __('Restore Backups', 'xcloner-backup-and-restore'), __('Restore Backups', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_restore_page', array($this->xcloner_container, 'xcloner_display'));
74 74
 		}
75 75
 	
76 76
 	}
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 	 * @param    int                  $priority         Optional. he priority at which the function should be fired. Default is 10.
87 87
 	 * @param    int                  $accepted_args    Optional. The number of arguments that should be passed to the $callback. Default is 1.
88 88
 	 */
89
-	public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
90
-		$this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
89
+	public function add_action($hook, $component, $callback, $priority = 10, $accepted_args = 1) {
90
+		$this->actions = $this->add($this->actions, $hook, $component, $callback, $priority, $accepted_args);
91 91
 	}
92 92
 
93 93
 	/**
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 	 * @param    int                  $priority         Optional. he priority at which the function should be fired. Default is 10.
101 101
 	 * @param    int                  $accepted_args    Optional. The number of arguments that should be passed to the $callback. Default is 1
102 102
 	 */
103
-	public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
104
-		$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
103
+	public function add_filter($hook, $component, $callback, $priority = 10, $accepted_args = 1) {
104
+		$this->filters = $this->add($this->filters, $hook, $component, $callback, $priority, $accepted_args);
105 105
 	}
106 106
 
107 107
 	/**
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	 * @param    int                  $accepted_args    The number of arguments that should be passed to the $callback.
119 119
 	 * @return   array                                  The collection of actions and filters registered with WordPress.
120 120
 	 */
121
-	private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
121
+	private function add($hooks, $hook, $component, $callback, $priority, $accepted_args) {
122 122
 
123 123
 		$hooks[] = array(
124 124
 			'hook'          => $hook,
@@ -139,12 +139,12 @@  discard block
 block discarded – undo
139 139
 	 */
140 140
 	public function run() {
141 141
 
142
-		foreach ( $this->filters as $hook ) {
143
-			add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
142
+		foreach ($this->filters as $hook) {
143
+			add_filter($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']);
144 144
 		}
145 145
 
146
-		foreach ( $this->actions as $hook ) {
147
-			add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
146
+		foreach ($this->actions as $hook) {
147
+			add_action($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']);
148 148
 		}
149 149
 
150 150
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,9 @@
 block discarded – undo
58 58
 	
59 59
 	public function xcloner_backup_add_admin_menu()
60 60
 	{
61
-		if ( function_exists('add_menu_page') )
62
-			add_menu_page( __('Site Backup','xcloner-backup-and-restore'), __('Site Backup','xcloner-backup-and-restore'), 'manage_options', 'xcloner_init_page', array($this->xcloner_container, 'xcloner_display'), 'dashicons-backup');
61
+		if ( function_exists('add_menu_page') ) {
62
+					add_menu_page( __('Site Backup','xcloner-backup-and-restore'), __('Site Backup','xcloner-backup-and-restore'), 'manage_options', 'xcloner_init_page', array($this->xcloner_container, 'xcloner_display'), 'dashicons-backup');
63
+		}
63 64
 
64 65
 		if ( function_exists('add_submenu_page') )
65 66
 		{
Please login to merge, or discard this patch.
includes/class-xcloner-deactivator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 		
34 34
 		global $xcloner_plugin;
35 35
 		
36
-		if(is_a($xcloner_plugin, 'Xcloner'))
36
+		if (is_a($xcloner_plugin, 'Xcloner'))
37 37
 		{
38 38
 			$xcloner_scheduler = $xcloner_plugin->get_xcloner_scheduler();
39 39
 			$xcloner_scheduler->deactivate_wp_cron_hooks();
Please login to merge, or discard this patch.
includes/class-xcloner-logger.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -4,44 +4,44 @@  discard block
 block discarded – undo
4 4
 use Monolog\Handler\StreamHandler;
5 5
 use Monolog\Handler\RotatingFileHandler;
6 6
 
7
-class Xcloner_Logger extends Logger{
7
+class Xcloner_Logger extends Logger {
8 8
 	
9
-	private $logger_path ;
9
+	private $logger_path;
10 10
 	private $max_logger_files = 7;
11 11
 	private $main_logger_url;
12 12
 	
13 13
 	public function __construct(Xcloner $xcloner_container, $logger_name = "xcloner_logger")
14 14
 	{
15
-		if(!$xcloner_container->get_xcloner_settings())
15
+		if (!$xcloner_container->get_xcloner_settings())
16 16
 		{
17 17
 			$xcloner_settings 	= new Xcloner_Settings($xcloner_container);
18
-		}else{
18
+		} else {
19 19
 			$xcloner_settings 	= $xcloner_container->get_xcloner_settings();
20 20
 		}
21 21
 		
22 22
 		$hash = $xcloner_settings->get_hash();
23
-		if($hash == "-".$xcloner_settings->get_server_unique_hash(5))
23
+		if ($hash == "-".$xcloner_settings->get_server_unique_hash(5))
24 24
 		{
25 25
 			$hash = "";
26 26
 		}
27 27
 		
28
-		$logger_path 		= $xcloner_settings->get_xcloner_store_path().DS.$xcloner_settings->get_logger_filename();
29
-		$logger_path_tmp 	= "";
28
+		$logger_path = $xcloner_settings->get_xcloner_store_path().DS.$xcloner_settings->get_logger_filename();
29
+		$logger_path_tmp = "";
30 30
 		
31
-		if($hash)
31
+		if ($hash)
32 32
 		{
33 33
 			$logger_path_tmp = $xcloner_settings->get_xcloner_tmp_path().DS.$xcloner_settings->get_logger_filename(1);
34 34
 		}
35 35
 		
36 36
 		$this->logger_path = $logger_path;
37 37
 		
38
-		if(!is_dir($xcloner_settings->get_xcloner_store_path()) or !is_writable($xcloner_settings->get_xcloner_store_path()))
38
+		if (!is_dir($xcloner_settings->get_xcloner_store_path()) or !is_writable($xcloner_settings->get_xcloner_store_path()))
39 39
 		{
40 40
 			$logger_path = "php://stderr";
41 41
 			$logger_path_tmp = "";
42 42
 		}
43 43
 		
44
-		if(!$xcloner_settings->get_xcloner_option('xcloner_enable_log'))
44
+		if (!$xcloner_settings->get_xcloner_option('xcloner_enable_log'))
45 45
 		{
46 46
 			$logger_path = "php://stderr";
47 47
 			$logger_path_tmp = "";
@@ -52,21 +52,21 @@  discard block
 block discarded – undo
52 52
 		
53 53
 		$debug_level = Logger::INFO;
54 54
 		
55
-		if(WP_DEBUG)
55
+		if (WP_DEBUG)
56 56
 		{
57 57
 			$debug_level = Logger::DEBUG;
58 58
 		}
59 59
 
60 60
 	
61
-		if($logger_path)
61
+		if ($logger_path)
62 62
 		{
63 63
 			$stream = new RotatingFileHandler($logger_path, $this->max_logger_files, $debug_level);
64 64
 			$this->pushHandler($stream);
65 65
 			
66
-			$this->main_logger_url =  $stream->getUrl();
66
+			$this->main_logger_url = $stream->getUrl();
67 67
 		}
68 68
 			
69
-		if($hash and $logger_path_tmp)
69
+		if ($hash and $logger_path_tmp)
70 70
 		{
71 71
 			$this->pushHandler(new StreamHandler($logger_path_tmp, $debug_level));
72 72
 		}
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	{
84 84
 		$lines = array();
85 85
 		
86
-		if(!file_exists($this->main_logger_url) or !is_readable($this->main_logger_url))
86
+		if (!file_exists($this->main_logger_url) or !is_readable($this->main_logger_url))
87 87
 			return false;
88 88
 		
89 89
 		$fp = fopen($this->main_logger_url, 'r');
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
 		$lastLine = "";
93 93
 		
94 94
 		// Loop backword until we have our lines or we reach the start
95
-		while($pos > 0 && count($lines) < $totalLines) {
95
+		while ($pos > 0 && count($lines) < $totalLines) {
96 96
 		
97 97
 		$C = fgetc($fp);
98
-		if($C == "\n") {
98
+		if ($C == "\n") {
99 99
 		  // skip empty lines
100
-		  if(trim($lastLine) != "") {
100
+		  if (trim($lastLine) != "") {
101 101
 			$lines[] = $lastLine;
102 102
 		  }
103 103
 		  $lastLine = '';
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 		if(!$xcloner_container->get_xcloner_settings())
16 16
 		{
17 17
 			$xcloner_settings 	= new Xcloner_Settings($xcloner_container);
18
-		}else{
18
+		} else{
19 19
 			$xcloner_settings 	= $xcloner_container->get_xcloner_settings();
20 20
 		}
21 21
 		
@@ -83,8 +83,9 @@  discard block
 block discarded – undo
83 83
 	{
84 84
 		$lines = array();
85 85
 		
86
-		if(!file_exists($this->main_logger_url) or !is_readable($this->main_logger_url))
87
-			return false;
86
+		if(!file_exists($this->main_logger_url) or !is_readable($this->main_logger_url)) {
87
+					return false;
88
+		}
88 89
 		
89 90
 		$fp = fopen($this->main_logger_url, 'r');
90 91
 		fseek($fp, -1, SEEK_END);
Please login to merge, or discard this patch.
admin/partials/xcloner_generate_backups_page.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 <h1><?= esc_html(get_admin_page_title()); ?></h1>
11 11
          
12 12
 <ul class="nav-tab-wrapper content row">
13
-	<li><a href="#backup_options" class="nav-tab col s12 m3 l2 nav-tab-active"><?php echo $tab.". ".__('Backup Options','xcloner-backup-and-restore')?></a></li>
14
-	<?php if($xcloner_settings->get_enable_mysql_backup()):?>
15
-		<li><a href="#database_options" class="nav-tab col s12 m3 l2 "><?php echo ++$tab.". ".__('Database Options','xcloner-backup-and-restore')?></a></li>
13
+	<li><a href="#backup_options" class="nav-tab col s12 m3 l2 nav-tab-active"><?php echo $tab.". ".__('Backup Options', 'xcloner-backup-and-restore')?></a></li>
14
+	<?php if ($xcloner_settings->get_enable_mysql_backup()):?>
15
+		<li><a href="#database_options" class="nav-tab col s12 m3 l2 "><?php echo ++$tab.". ".__('Database Options', 'xcloner-backup-and-restore')?></a></li>
16 16
 	<?php endif?>
17
-	<li><a href="#files_options" class="nav-tab col s12 m3 l2 "><?php echo ++$tab.". ".__('Files Options','xcloner-backup-and-restore')?></a></li>
18
-	<li><a href="#generate_backup" class="nav-tab col s12 m3 l2 "><?php echo ++$tab.". ".__('Generate Backup','xcloner-backup-and-restore')?></a></li>
19
-	<li><a href="#schedule_backup" class="nav-tab col s12 m3 l2 "><?php echo ++$tab.". ".__('Schedule Backup','xcloner-backup-and-restore')?></a></li>
17
+	<li><a href="#files_options" class="nav-tab col s12 m3 l2 "><?php echo ++$tab.". ".__('Files Options', 'xcloner-backup-and-restore')?></a></li>
18
+	<li><a href="#generate_backup" class="nav-tab col s12 m3 l2 "><?php echo ++$tab.". ".__('Generate Backup', 'xcloner-backup-and-restore')?></a></li>
19
+	<li><a href="#schedule_backup" class="nav-tab col s12 m3 l2 "><?php echo ++$tab.". ".__('Schedule Backup', 'xcloner-backup-and-restore')?></a></li>
20 20
 </ul>
21 21
 
22 22
 <form action="" method="POST" id="generate_backup_form">
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
 		        <div class="input-field inline col s12 m10 l6">
28 28
 					<i class="material-icons prefix">input</i>
29 29
 					<input name="backup_name" id="backup_name" type="text" value=<?php echo $xcloner_settings->get_default_backup_name() ?> >
30
-					<label for="backup_name"><?php echo __('Backup Name','xcloner-backup-and-restore')?></label>
30
+					<label for="backup_name"><?php echo __('Backup Name', 'xcloner-backup-and-restore')?></label>
31 31
 				</div>
32 32
 				<div class="hide-on-small-only m2">
33
-					<a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" data-tooltip="<?php echo __('The default backup name, supported tags [time], [hostname], [domain]','xcloner-backup-and-restore')?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a>
33
+					<a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" data-tooltip="<?php echo __('The default backup name, supported tags [time], [hostname], [domain]', 'xcloner-backup-and-restore')?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a>
34 34
 				</div>
35 35
 		     </div>
36 36
 		     
37 37
 		     <div class="row">
38 38
 		        <div class="input-field inline col s12 m10 l6">
39 39
 					<i class="material-icons prefix">input</i>
40
-					<input name="email_notification" id="email_notification" type="text" value="<?php echo get_option('admin_email');?>" >
41
-					<label for="email_notification"><?php echo __('Send Email Notification To','xcloner-backup-and-restore')?></label>
40
+					<input name="email_notification" id="email_notification" type="text" value="<?php echo get_option('admin_email'); ?>" >
41
+					<label for="email_notification"><?php echo __('Send Email Notification To', 'xcloner-backup-and-restore')?></label>
42 42
 				</div>
43 43
 				<div class="hide-on-small-only m2">
44
-					<a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" data-tooltip="<?php echo __('If left blank, no notification will be sent','xcloner-backup-and-restore')?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a>
44
+					<a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" data-tooltip="<?php echo __('If left blank, no notification will be sent', 'xcloner-backup-and-restore')?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a>
45 45
 				</div>
46 46
 		     </div>
47 47
 		     
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
 				<div class="input-field col s12 m10 l6">
50 50
 					<i class="material-icons prefix">input</i>
51 51
 					<textarea name="backup_comments" id="backup_comments" class="materialize-textarea"></textarea>
52
-					<label for="backup_comments"><?php echo __('Backup Comments','xcloner-backup-and-restore')?></label>
52
+					<label for="backup_comments"><?php echo __('Backup Comments', 'xcloner-backup-and-restore')?></label>
53 53
 				</div>
54 54
 				<div class="hide-on-small-only m2">
55
-					<a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" data-tooltip="<?php echo __('Some default backup comments that will be stored inside the backup archive','xcloner-backup-and-restore')?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a>
55
+					<a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" data-tooltip="<?php echo __('Some default backup comments that will be stored inside the backup archive', 'xcloner-backup-and-restore')?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a>
56 56
 				</div>
57 57
 		     </div>
58 58
 		     
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
 			 </div>
64 64
 		</div>
65 65
 		
66
-		<?php if($xcloner_settings->get_enable_mysql_backup()):?>
66
+		<?php if ($xcloner_settings->get_enable_mysql_backup()):?>
67 67
 		<div id="database_options" class="tab-content">
68 68
 			<h2><?php echo __('Select database data to include in the backup', 'xcloner-backup-and-restore')?>:
69
-				<a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" data-tooltip="<?php echo __('Enable the \'Backup only WP tables\' setting if you don\'t want to show all other databases and tables not related to this Wordpress install','xcloner-backup-and-restore');?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a>
69
+				<a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" data-tooltip="<?php echo __('Enable the \'Backup only WP tables\' setting if you don\'t want to show all other databases and tables not related to this Wordpress install', 'xcloner-backup-and-restore'); ?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a>
70 70
 			</h2>
71 71
 			
72 72
 			<!-- database/tables tree -->
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 		<?php endif ?>
87 87
 		
88 88
 		<div id="files_options" class="tab-content">
89
-			<h2><?php echo __('Select from below the files/folders you want to exclude from your Backup Archive','xcloner-backup-and-restore')?>:
90
-				<a class="btn-floating tooltipped btn-small" data-position="bottom" data-delay="50" data-html="true" data-tooltip="<?php echo __('You can navigate below through all your site structure(Backup Start Location) to exclude any file/folder you need by clicking the checkbox near it. <br />If the checkobx is disabled, then it matches a Regex Exclude File option and it can\'t be unchecked','xcloner-backup-and-restore');?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a>
89
+			<h2><?php echo __('Select from below the files/folders you want to exclude from your Backup Archive', 'xcloner-backup-and-restore')?>:
90
+				<a class="btn-floating tooltipped btn-small" data-position="bottom" data-delay="50" data-html="true" data-tooltip="<?php echo __('You can navigate below through all your site structure(Backup Start Location) to exclude any file/folder you need by clicking the checkbox near it. <br />If the checkobx is disabled, then it matches a Regex Exclude File option and it can\'t be unchecked', 'xcloner-backup-and-restore'); ?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a>
91 91
 			</h2>
92 92
 			
93 93
 			<!-- Files System Container -->
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 					<ul class="backup-status collapsible" data-collapsible="accordion">
116 116
 					    <li class="file-system">
117 117
 						      <div class="collapsible-header">
118
-									<i class="material-icons">folder</i><?php echo __('Scanning The File System...','xcloner-backup-and-restore')?>
118
+									<i class="material-icons">folder</i><?php echo __('Scanning The File System...', 'xcloner-backup-and-restore')?>
119 119
 									
120 120
 									<p class="right"><?php echo sprintf(__('Found %s files (%s)', 'xcloner-backup-and-restore'), '<span class="file-counter">0</span>', '<span  class="file-size-total">0</span>MB')?></p>
121 121
 
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
 								</div>	
130 130
 						      <div class="collapsible-body status-body"></div>
131 131
 					    </li>
132
-					    <?php if($xcloner_settings->get_enable_mysql_backup()):?>
132
+					    <?php if ($xcloner_settings->get_enable_mysql_backup()):?>
133 133
 					    <li class="database-backup">
134 134
 						      <div class="collapsible-header">
135
-									<i class="material-icons">storage</i><?php echo __('Generating the Mysql Backup...','xcloner-backup-and-restore')?>
135
+									<i class="material-icons">storage</i><?php echo __('Generating the Mysql Backup...', 'xcloner-backup-and-restore')?>
136 136
 									
137
-									<p class="right"><?php echo sprintf(__('Found %s tables in %s databases (%s)', 'xcloner-backup-and-restore'), '<span class="table-counter">0</span>', '<span class="database-counter">0</span>', '<span data-processed="0" class="total-records">0</span> records','xcloner-backup-and-restore')?></p>
137
+									<p class="right"><?php echo sprintf(__('Found %s tables in %s databases (%s)', 'xcloner-backup-and-restore'), '<span class="table-counter">0</span>', '<span class="database-counter">0</span>', '<span data-processed="0" class="total-records">0</span> records', 'xcloner-backup-and-restore')?></p>
138 138
 									
139 139
 									<div>
140 140
 										<p class="right"><span class="last-logged-table"></span></p>
@@ -158,9 +158,9 @@  discard block
 block discarded – undo
158 158
 					    <?php endif?>
159 159
 					    <li class="files-backup">
160 160
 						      <div class="collapsible-header">
161
-									<i class="material-icons">archive</i><?php echo __('Adding Files to Archive...','xcloner-backup-and-restore')?>
161
+									<i class="material-icons">archive</i><?php echo __('Adding Files to Archive...', 'xcloner-backup-and-restore')?>
162 162
 									
163
-									<p class="right"><?php echo sprintf(__('Adding %s files (%s)','xcloner-backup-and-restore'), '<span class="file-counter">0</span>', '<span  data-processed="0" class="file-size-total">0</span>MB')?></p>
163
+									<p class="right"><?php echo sprintf(__('Adding %s files (%s)', 'xcloner-backup-and-restore'), '<span class="file-counter">0</span>', '<span  data-processed="0" class="file-size-total">0</span>MB')?></p>
164 164
 
165 165
 									<div>
166 166
 										<p class="right"><span class="last-logged-file"></span></p>
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 						      <div class="collapsible-body status-body">
174 174
 									<div class="row">
175 175
 										<div class="col l3 s12">
176
-											<h2><?php echo __("Backup Parts",'xcloner-backup-and-restore')?>: </h2>
176
+											<h2><?php echo __("Backup Parts", 'xcloner-backup-and-restore')?>: </h2>
177 177
 										</div>	
178 178
 										<div class="col l9 s12">
179 179
 											<ul class="backup-name"></ul>
@@ -183,14 +183,14 @@  discard block
 block discarded – undo
183 183
 					    </li>
184 184
 					    <li class="backup-done">
185 185
 						      <div class="collapsible-header">
186
-									<i class="material-icons">done</i><?php echo __('Backup Done','xcloner-backup-and-restore')?>
186
+									<i class="material-icons">done</i><?php echo __('Backup Done', 'xcloner-backup-and-restore')?>
187 187
 									
188 188
 									<p class="right">
189
-										 <?php if(sizeof($available_storages)):?>
190
-											<a href="#" class="cloud-upload" title="<?php echo __("Send Backup To Remote Storage",'xcloner-backup-and-restore')?>"><i class="material-icons">cloud_upload</i></a>
189
+										 <?php if (sizeof($available_storages)):?>
190
+											<a href="#" class="cloud-upload" title="<?php echo __("Send Backup To Remote Storage", 'xcloner-backup-and-restore')?>"><i class="material-icons">cloud_upload</i></a>
191 191
 										 <?php endif?>
192
-										 <a href="#" class="download" title="<?php echo __("Download Backup",'xcloner-backup-and-restore')?>"><i class="material-icons">file_download</i></a>
193
-										 <a href="#" class="list-backup-content" title="<?php echo __("List Backup Content",'xcloner-backup-and-restore')?>"><i class="material-icons">folder_open</i></a>
192
+										 <a href="#" class="download" title="<?php echo __("Download Backup", 'xcloner-backup-and-restore')?>"><i class="material-icons">file_download</i></a>
193
+										 <a href="#" class="list-backup-content" title="<?php echo __("List Backup Content", 'xcloner-backup-and-restore')?>"><i class="material-icons">folder_open</i></a>
194 194
 									</p>
195 195
 									
196 196
 									<div class="progress">
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
 								</div>	
201 201
 						      <div class="collapsible-body center-align">
202 202
 									<div class="row">
203
-										<h5><?php echo __("Thank you for using XCloner.",'xcloner-backup-and-restore')?></h5>
204
-										<h6><?php echo sprintf(__("We would love to hear about your experience in the %s.", 'xcloner-backup-and-restore'),'<a href="https://wordpress.org/support/plugin/xcloner-backup-and-restore/reviews/" target="_blank">Wordpress XCloner Reviews Section</a>') ?></h6>
203
+										<h5><?php echo __("Thank you for using XCloner.", 'xcloner-backup-and-restore')?></h5>
204
+										<h6><?php echo sprintf(__("We would love to hear about your experience in the %s.", 'xcloner-backup-and-restore'), '<a href="https://wordpress.org/support/plugin/xcloner-backup-and-restore/reviews/" target="_blank">Wordpress XCloner Reviews Section</a>') ?></h6>
205 205
 										<a class="twitter-follow-button" href="https://twitter.com/thinkovi" data-show-count="false">Follow @thinkovi</a>
206 206
 										<script src="//platform.twitter.com/widgets.js" async="" charset="utf-8"></script>
207 207
 									</div>
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 			<div class="row">
219 219
 				<div id="schedule_backup_success" class="col s12 l6 updated settings-error notice is-dismissible"> 
220 220
 					<p><strong><?php echo __('Schedule Saved', 'xcloner-backup-and-restore')?></strong></p>
221
-					<button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php echo __('(Dismiss this notice.','xcloner-backup-and-restore')?></span></button>
221
+					<button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php echo __('(Dismiss this notice.', 'xcloner-backup-and-restore')?></span></button>
222 222
 				</div>
223 223
 			</div>
224 224
 			
@@ -238,11 +238,11 @@  discard block
 block discarded – undo
238 238
 			<div class="row">
239 239
 				 <div class="input-field inline col s12 m8 l4">
240 240
 					  <input type="datetime-local" id="datepicker" class="datepicker" name="schedule_start_date" >
241
-					  <label for="datepicker"><?php echo __('Schedule Backup To Start On:','xcloner-backup-and-restore')?></label>
241
+					  <label for="datepicker"><?php echo __('Schedule Backup To Start On:', 'xcloner-backup-and-restore')?></label>
242 242
 				</div>
243 243
 				 <div class="input-field inline col s12 m4 l3">
244 244
 					  <input id="timepicker_ampm_dark" class="timepicker" type="time" name="schedule_start_time">
245
-					  <label for="timepicker_ampm_dark"><?php echo __('At:','xcloner-backup-and-restore')?></label>
245
+					  <label for="timepicker_ampm_dark"><?php echo __('At:', 'xcloner-backup-and-restore')?></label>
246 246
 				</div>
247 247
 			</div>
248 248
 			
@@ -250,22 +250,22 @@  discard block
 block discarded – undo
250 250
 				<div class="input-field col s12 l7">
251 251
 					<select name="schedule_frequency" id="schedule_frequency" class="validate" required>
252 252
 						<option value="" disabled selected><?php echo __('please select', 'xcloner-backup-and-restore') ?></option>
253
-						<option value="single"><?php echo __("Don't Repeat",'xcloner-backup-and-restore')?></option>
254
-						<option value="hourly"><?php echo __("Hourly",'xcloner-backup-and-restore')?></option>
255
-						<option value="daily"><?php echo __("Daily",'xcloner-backup-and-restore')?></option>
256
-						<option value="weekly"><?php echo __("Weekly",'xcloner-backup-and-restore')?></option>
257
-						<option value="monthly"><?php echo __("Monthly",'xcloner-backup-and-restore')?></option>
253
+						<option value="single"><?php echo __("Don't Repeat", 'xcloner-backup-and-restore')?></option>
254
+						<option value="hourly"><?php echo __("Hourly", 'xcloner-backup-and-restore')?></option>
255
+						<option value="daily"><?php echo __("Daily", 'xcloner-backup-and-restore')?></option>
256
+						<option value="weekly"><?php echo __("Weekly", 'xcloner-backup-and-restore')?></option>
257
+						<option value="monthly"><?php echo __("Monthly", 'xcloner-backup-and-restore')?></option>
258 258
 						</select>
259 259
 						<label><?php echo __('Please Select Frequency to run', 'xcloner-backup-and-restore') ?></label>
260 260
 				</div>
261 261
 			</div>	
262 262
 
263
-			<?php if(sizeof($available_storages)):?>
263
+			<?php if (sizeof($available_storages)):?>
264 264
 			<div class="row">
265 265
 				<div class="input-field col s12 m12 l7">
266 266
 					<select name="schedule_storage" id="schedule_storage" class="validate">
267 267
 						<option value="" selected><?php echo __('none', 'xcloner-backup-and-restore') ?></option>
268
-						<?php foreach($available_storages as $storage=>$text):?>
268
+						<?php foreach ($available_storages as $storage=>$text):?>
269 269
 							<option value="<?php echo $storage?>"><?php echo $text?></option>
270 270
 						<?php endforeach?>
271 271
 						</select>
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 			<?php endif?>
276 276
 			<div class="row">
277 277
 				<div class="col s12 l7">
278
-					<button class="right btn waves-effect waves-light submit_schedule" type="submit" name="action"><?php echo __("Submit" ,'xcloner-backup-and-restore')?>
278
+					<button class="right btn waves-effect waves-light submit_schedule" type="submit" name="action"><?php echo __("Submit", 'xcloner-backup-and-restore')?>
279 279
 						<i class="material-icons right">send</i>
280 280
 					</button>
281 281
 				</div>
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 		<textarea  class="body" rows="5"></textarea>
295 295
 	</div>
296 296
 	<div class="modal-footer">
297
-		<a class=" modal-action modal-close waves-effect waves-green btn-flat  red darken-2"><?php echo __('Close','xcloner-backup-and-restore')?></a>
297
+		<a class=" modal-action modal-close waves-effect waves-green btn-flat  red darken-2"><?php echo __('Close', 'xcloner-backup-and-restore')?></a>
298 298
 	</div>
299 299
 </div>
300 300
 
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 
303 303
 <div id="backup_cotent_modal" class="modal">
304 304
 	<div class="modal-content">
305
-		<h4><?php echo sprintf(__("Listing Backup Content ",'xcloner-backup-and-restore'), "")?></h4>
305
+		<h4><?php echo sprintf(__("Listing Backup Content ", 'xcloner-backup-and-restore'), "")?></h4>
306 306
 		<h5 class="backup-name"></h5>
307 307
 		
308 308
 		<div class="progress">
@@ -317,9 +317,9 @@  discard block
 block discarded – undo
317 317
 	<form method="POST" class="remote-storage-form">
318 318
 	<input type="hidden" name="file" class="backup_name">	  
319 319
 	<div class="modal-content">
320
-	  <h4><?php echo __("Remote Storage Transfer",'xcloner-backup-and-restore')?></h4>
320
+	  <h4><?php echo __("Remote Storage Transfer", 'xcloner-backup-and-restore')?></h4>
321 321
 	  <p>
322
-	  <?php if(sizeof($available_storages)):?>
322
+	  <?php if (sizeof($available_storages)):?>
323 323
 			<div class="row">
324 324
 				<div class="col s12 label">
325 325
 					<label><?php echo __(sprintf('Send %s to remote storage', "<span class='backup_name'></span>"), 'xcloner-backup-and-restore') ?></label>
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 				<div class="input-field col s8 m10">
328 328
 					<select name="transfer_storage" id="transfer_storage" class="validate" required >
329 329
 						<option value="" selected><?php echo __('please select...', 'xcloner-backup-and-restore') ?></option>
330
-						<?php foreach($available_storages as $storage=>$text):?>
330
+						<?php foreach ($available_storages as $storage=>$text):?>
331 331
 							<option value="<?php echo $storage?>"><?php echo $text?></option>
332 332
 						<?php endforeach?>
333 333
 						</select>
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 				</div>
339 339
 			</div>
340 340
 			<div class="row status">
341
-				<?php echo __("Uploading backup to the selected remote storage...",'xcloner-backup-and-restore')?> <span class="status-text"></span>
341
+				<?php echo __("Uploading backup to the selected remote storage...", 'xcloner-backup-and-restore')?> <span class="status-text"></span>
342 342
 				<div class="progress">
343 343
 					<div class="indeterminate"></div>
344 344
 				</div>
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 		}
412 412
 	});
413 413
 	
414
-	<?php if($xcloner_settings->get_enable_mysql_backup()):?>
414
+	<?php if ($xcloner_settings->get_enable_mysql_backup()):?>
415 415
 	jQuery('#jstree_database_container').jstree({
416 416
 			'core' : {
417 417
 				'check_callback' : true,
Please login to merge, or discard this patch.
admin/partials/xcloner_scheduled_backups_page.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 $xcloner_remote_storage = $this->get_xcloner_container()->get_xcloner_remote_storage();
5 5
 $available_storages = $xcloner_remote_storage->get_available_storages();
6 6
 ?>
7
-<?php if(!defined("DISABLE_WP_CRON") || !DISABLE_WP_CRON): ?>
7
+<?php if (!defined("DISABLE_WP_CRON") || !DISABLE_WP_CRON): ?>
8 8
 	<div id="setting-error-" class="error settings-error notice is-dismissible"> 
9 9
 		<p><strong>
10 10
 			<?php echo sprintf(__('We have noticed that DISABLE_WP_CRON is disabled, we recommend enabling that and setting up wp-cron.php to run manually through your hosting account scheduler as explained <a href="%s" target="_blank">here</a>', 'xcloner-backup-and-restore'), "http://www.inmotionhosting.com/support/website/wordpress/disabling-the-wp-cronphp-in-wordpress") ?>
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
 <div class="row">
50 50
 	<div class="col s12 m6 offset-m6 teal lighten-1" id="server_time">
51
-		<h2><?php echo __('Current Server Time', 'xcloner-backup-and-restore')?>: <span class="right"><?php echo current_time('mysql');?></span></h2>
51
+		<h2><?php echo __('Current Server Time', 'xcloner-backup-and-restore')?>: <span class="right"><?php echo current_time('mysql'); ?></span></h2>
52 52
 	</div>
53 53
 </div>
54 54
 
@@ -103,21 +103,21 @@  discard block
 block discarded – undo
103 103
 					<div class="input-field col s12 l6">
104 104
 						<select name="schedule_frequency" id="schedule_frequency" class="validate" required>
105 105
 							<option value="" disabled selected><?php echo __('Schedule Recurrence', 'xcloner-backup-and-restore') ?></option>
106
-							<option value="single"><?php echo __("Don't Repeat",'xcloner-backup-and-restore')?></option>
107
-							<option value="hourly"><?php echo __("Hourly",'xcloner-backup-and-restore')?></option>
108
-							<option value="daily"><?php echo __("Daily",'xcloner-backup-and-restore')?></option>
109
-							<option value="weekly"><?php echo __("Weekly",'xcloner-backup-and-restore')?></option>
110
-							<option value="monthly"><?php echo __("Monthly",'xcloner-backup-and-restore')?></option>
106
+							<option value="single"><?php echo __("Don't Repeat", 'xcloner-backup-and-restore')?></option>
107
+							<option value="hourly"><?php echo __("Hourly", 'xcloner-backup-and-restore')?></option>
108
+							<option value="daily"><?php echo __("Daily", 'xcloner-backup-and-restore')?></option>
109
+							<option value="weekly"><?php echo __("Weekly", 'xcloner-backup-and-restore')?></option>
110
+							<option value="monthly"><?php echo __("Monthly", 'xcloner-backup-and-restore')?></option>
111 111
 						</select>
112 112
 					</div>
113 113
 				</div>
114 114
 				
115
-				<?php if(sizeof($available_storages)):?>
115
+				<?php if (sizeof($available_storages)):?>
116 116
 				<div class="row">
117 117
 					<div class="input-field col s12 l12">
118 118
 						<select name="schedule_storage" id="schedule_storage" class="validate" >
119 119
 							<option value="" selected><?php echo __('none', 'xcloner-backup-and-restore') ?></option>
120
-							<?php foreach($available_storages as $storage=>$text):?>
120
+							<?php foreach ($available_storages as $storage=>$text):?>
121 121
 								<option value="<?php echo $storage?>"><?php echo $text?></option>
122 122
 							<?php endforeach?>
123 123
 						</select>
Please login to merge, or discard this patch.
includes/class-xcloner-scheduler.php 2 patches
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-class Xcloner_Scheduler{
3
+class Xcloner_Scheduler {
4 4
 	
5 5
 	private $db;
6 6
 	private $scheduler_table = "xcloner_scheduler";
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 	{
21 21
 		global $wpdb;
22 22
 		
23
-		$this->db 					= $wpdb;
24
-		$wpdb->show_errors			= false;
23
+		$this->db = $wpdb;
24
+		$wpdb->show_errors = false;
25 25
 		
26 26
 		$this->xcloner_container	= $xcloner_container;
27 27
 		$this->xcloner_settings 	= $xcloner_container->get_xcloner_settings();
@@ -34,18 +34,18 @@  discard block
 block discarded – undo
34 34
 		return $this->xcloner_container;
35 35
 	}
36 36
 	
37
-	public function get_scheduler_list($return_only_enabled = 0 )
37
+	public function get_scheduler_list($return_only_enabled = 0)
38 38
 	{
39 39
 		$list = $this->db->get_results("SELECT * FROM ".$this->scheduler_table);
40 40
 		
41
-		if($return_only_enabled)
41
+		if ($return_only_enabled)
42 42
 		{
43
-			$new_list= array();
43
+			$new_list = array();
44 44
 			
45
-			foreach($list as $res)
46
-				if($res->status)
45
+			foreach ($list as $res)
46
+				if ($res->status)
47 47
 				{
48
-					$res->next_run_time = wp_next_scheduled('xcloner_scheduler_'.$res->id, array($res->id))+(get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
48
+					$res->next_run_time = wp_next_scheduled('xcloner_scheduler_'.$res->id, array($res->id)) + (get_option('gmt_offset') * HOUR_IN_SECONDS);
49 49
 					$new_list[] = $res;
50 50
 				}
51 51
 			$list = $new_list;	
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	{
72 72
 		$data = $this->db->get_row("SELECT * FROM ".$this->scheduler_table." WHERE id=".$id, ARRAY_A);
73 73
 		
74
-		if(!$data)
74
+		if (!$data)
75 75
 			return false;
76 76
 		
77 77
 		$params = json_decode($data['params']);
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
 	
89 89
 	public function delete_schedule_by_id($id)
90 90
 	{
91
-		$hook =  'xcloner_scheduler_'.$id;
92
-		wp_clear_scheduled_hook( $hook, array($id) );
91
+		$hook = 'xcloner_scheduler_'.$id;
92
+		wp_clear_scheduled_hook($hook, array($id));
93 93
 		
94
-		$data = $this->db->delete( $this->scheduler_table , array( 'id' => $id ) );
94
+		$data = $this->db->delete($this->scheduler_table, array('id' => $id));
95 95
 		
96 96
 		return $data;
97 97
 	}
@@ -100,12 +100,12 @@  discard block
 block discarded – undo
100 100
 	{
101 101
 		$list = $this->get_scheduler_list();
102 102
 		
103
-		foreach($list as $schedule)
103
+		foreach ($list as $schedule)
104 104
 		{
105
-			$hook =  'xcloner_scheduler_'.$schedule->id;
105
+			$hook = 'xcloner_scheduler_'.$schedule->id;
106 106
 			
107
-			$timestamp = wp_next_scheduled( $hook , array($schedule->id) );
108
-			wp_unschedule_event( $timestamp, $hook, array($schedule->id) );
107
+			$timestamp = wp_next_scheduled($hook, array($schedule->id));
108
+			wp_unschedule_event($timestamp, $hook, array($schedule->id));
109 109
 		}
110 110
 	}
111 111
 	
@@ -113,24 +113,24 @@  discard block
 block discarded – undo
113 113
 	{
114 114
 		$list = $this->get_scheduler_list();
115 115
 		
116
-		foreach($list as $schedule)
116
+		foreach ($list as $schedule)
117 117
 		{
118
-			$hook =  'xcloner_scheduler_'.$schedule->id;
118
+			$hook = 'xcloner_scheduler_'.$schedule->id;
119 119
 			
120 120
 			//adding the xcloner_scheduler hook with xcloner_scheduler_callback callback
121
-			add_action( $hook, array($this, 'xcloner_scheduler_callback'), 10,  1 );
121
+			add_action($hook, array($this, 'xcloner_scheduler_callback'), 10, 1);
122 122
 			
123
-			if ( ! wp_next_scheduled( $hook, array($schedule->id) ) and $schedule->status) {
123
+			if (!wp_next_scheduled($hook, array($schedule->id)) and $schedule->status) {
124 124
 				
125
-				if($schedule->recurrence == "single")
126
-					wp_schedule_single_event( strtotime($schedule->start_at), $hook, array($schedule->id));
125
+				if ($schedule->recurrence == "single")
126
+					wp_schedule_single_event(strtotime($schedule->start_at), $hook, array($schedule->id));
127 127
 				else	
128
-					wp_schedule_event( strtotime($schedule->start_at), $schedule->recurrence, $hook, array($schedule->id) );
128
+					wp_schedule_event(strtotime($schedule->start_at), $schedule->recurrence, $hook, array($schedule->id));
129 129
 					
130
-			}elseif(!$schedule->status)
130
+			}elseif (!$schedule->status)
131 131
 			{
132
-				$timestamp = wp_next_scheduled( $hook , array($schedule->id) );
133
-				wp_unschedule_event( $timestamp, $hook, array($schedule->id) );
132
+				$timestamp = wp_next_scheduled($hook, array($schedule->id));
133
+				wp_unschedule_event($timestamp, $hook, array($schedule->id));
134 134
 			}
135 135
 		}
136 136
 	
@@ -139,17 +139,17 @@  discard block
 block discarded – undo
139 139
 	public function update_cron_hook($id)
140 140
 	{
141 141
 		$schedule = $this->get_schedule_by_id_object($id);
142
-		$hook =  'xcloner_scheduler_'.$schedule->id;
142
+		$hook = 'xcloner_scheduler_'.$schedule->id;
143 143
 		
144
-		$timestamp = wp_next_scheduled( $hook , array($schedule->id) );
145
-		wp_unschedule_event( $timestamp, $hook, array($schedule->id) );
144
+		$timestamp = wp_next_scheduled($hook, array($schedule->id));
145
+		wp_unschedule_event($timestamp, $hook, array($schedule->id));
146 146
 		
147 147
 		if ($schedule->status) {
148 148
 			
149
-			if($schedule->recurrence == "single")
150
-				wp_schedule_single_event( strtotime($schedule->start_at), $hook, array($schedule->id));
151
-			else{	
152
-				wp_schedule_event( strtotime($schedule->start_at), $schedule->recurrence, $hook, array($schedule->id) );
149
+			if ($schedule->recurrence == "single")
150
+				wp_schedule_single_event(strtotime($schedule->start_at), $hook, array($schedule->id));
151
+			else {	
152
+				wp_schedule_event(strtotime($schedule->start_at), $schedule->recurrence, $hook, array($schedule->id));
153 153
 			}
154 154
 				
155 155
 		}
@@ -157,16 +157,16 @@  discard block
 block discarded – undo
157 157
 	
158 158
 	public function disable_single_cron($schedule_id)
159 159
 	{
160
-		$hook =  'xcloner_scheduler_'.$schedule_id;
161
-		$timestamp = wp_next_scheduled( $hook , array($schedule_id) );
162
-		wp_unschedule_event( $timestamp, $hook, array($schedule_id) );
160
+		$hook = 'xcloner_scheduler_'.$schedule_id;
161
+		$timestamp = wp_next_scheduled($hook, array($schedule_id));
162
+		wp_unschedule_event($timestamp, $hook, array($schedule_id));
163 163
 		
164 164
 		$schedule['status'] = 0;
165 165
 		
166 166
 		$update = $this->db->update( 
167 167
 				$this->scheduler_table, 
168 168
 				$schedule, 
169
-				array( 'id' => $schedule_id ), 
169
+				array('id' => $schedule_id), 
170 170
 				array( 
171 171
 					'%s', 
172 172
 					'%s' 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 		$update = $this->db->update( 
183 183
 				$this->scheduler_table, 
184 184
 				$schedule, 
185
-				array( 'id' => $schedule_id ), 
185
+				array('id' => $schedule_id), 
186 186
 				array( 
187 187
 					'%s', 
188 188
 					'%s' 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 		$update = $this->db->update( 
199 199
 				$this->scheduler_table, 
200 200
 				$schedule, 
201
-				array( 'id' => $schedule_id ), 
201
+				array('id' => $schedule_id), 
202 202
 				array( 
203 203
 					'%s', 
204 204
 					'%s' 
@@ -211,18 +211,18 @@  discard block
 block discarded – undo
211 211
 	{
212 212
 		set_time_limit(0);
213 213
 		
214
-		$this->xcloner_file_system 		= $this->get_xcloner_container()->get_xcloner_filesystem();
215
-		$this->xcloner_database 		= $this->get_xcloner_container()->get_xcloner_database();
216
-		$this->archive_system 			= $this->get_xcloner_container()->get_archive_system();
217
-		$this->logger 					= $this->get_xcloner_container()->get_xcloner_logger()->withName("xcloner_scheduler");
218
-		$this->xcloner_remote_storage 	= $this->get_xcloner_container()->get_xcloner_remote_storage();
214
+		$this->xcloner_file_system = $this->get_xcloner_container()->get_xcloner_filesystem();
215
+		$this->xcloner_database = $this->get_xcloner_container()->get_xcloner_database();
216
+		$this->archive_system = $this->get_xcloner_container()->get_archive_system();
217
+		$this->logger = $this->get_xcloner_container()->get_xcloner_logger()->withName("xcloner_scheduler");
218
+		$this->xcloner_remote_storage = $this->get_xcloner_container()->get_xcloner_remote_storage();
219 219
 				
220
-		if($schedule['recurrence'] == "single")
220
+		if ($schedule['recurrence'] == "single")
221 221
 		{
222 222
 			$this->disable_single_cron($schedule['id']);
223 223
 		}
224 224
 		
225
-		if(!$schedule)
225
+		if (!$schedule)
226 226
 		{
227 227
 			$this->logger->info(sprintf("Could not load schedule with id'%s'", $id), array("CRON"));
228 228
 			return;
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 		$init = 1;
238 238
 		$continue = 1;
239 239
 
240
-		while($continue)
240
+		while ($continue)
241 241
 		{
242 242
 			$continue = $this->xcloner_file_system->start_file_recursion($init);
243 243
 			
@@ -251,9 +251,9 @@  discard block
 block discarded – undo
251 251
 		$init = 1;
252 252
 		$return['finished'] = 0;
253 253
 		
254
-		while(!$return['finished'])
254
+		while (!$return['finished'])
255 255
 		{
256
-			$return  = $this->xcloner_database->start_database_recursion((array)json_decode($schedule['table_params']), $return, $init);
256
+			$return = $this->xcloner_database->start_database_recursion((array)json_decode($schedule['table_params']), $return, $init);
257 257
 			$init = 0;
258 258
 		}
259 259
 		
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 		$return['finished'] = 0;
266 266
 		$return['extra'] = array();
267 267
 		
268
-		while(!$return['finished'])
268
+		while (!$return['finished'])
269 269
 		{
270 270
 			$return = $this->archive_system->start_incremental_backup((array)$schedule['backup_params'], $return['extra'], $init);
271 271
 			$init = 0;
@@ -274,29 +274,29 @@  discard block
 block discarded – undo
274 274
 		
275 275
 		//getting the last backup archive file
276 276
 		$return['extra']['backup_parent'] = $this->archive_system->get_archive_name_with_extension();
277
-		if($this->xcloner_file_system->is_part($this->archive_system->get_archive_name_with_extension()))
277
+		if ($this->xcloner_file_system->is_part($this->archive_system->get_archive_name_with_extension()))
278 278
 				$return['extra']['backup_parent'] = $this->archive_system->get_archive_name_multipart();
279 279
 		
280 280
 		$this->update_last_backup($schedule['id'], $return['extra']['backup_parent']);
281 281
 		
282
-		if($schedule['remote_storage'] and array_key_exists($schedule['remote_storage'], $this->xcloner_remote_storage->get_available_storages()))
282
+		if ($schedule['remote_storage'] and array_key_exists($schedule['remote_storage'], $this->xcloner_remote_storage->get_available_storages()))
283 283
 		{
284 284
 			$backup_file = $return['extra']['backup_parent'];
285 285
 			
286 286
 			$this->logger->info(sprintf("Transferring backup to remote storage %s", strtoupper($schedule['remote_storage'])), array("CRON"));
287 287
 			
288
-			if(method_exists($this->xcloner_remote_storage, "upload_backup_to_storage"))
288
+			if (method_exists($this->xcloner_remote_storage, "upload_backup_to_storage"))
289 289
 				call_user_func_array(array($this->xcloner_remote_storage, "upload_backup_to_storage"), array($backup_file, $schedule['remote_storage']));
290 290
 		}
291 291
 		
292 292
 		
293
-		if(isset($schedule['backup_params']->email_notification) and $to=$schedule['backup_params']->email_notification)
293
+		if (isset($schedule['backup_params']->email_notification) and $to = $schedule['backup_params']->email_notification)
294 294
 		{	
295
-			try{
295
+			try {
296 296
 				$from = "XCloner Schedule - ".$schedule['name'];
297 297
 				$additional['lines_total'] = $return['extra']['lines_total'];
298 298
 				$this->archive_system->send_notification($to, $from, "", $return['extra']['backup_parent'], $schedule, "", $additional);
299
-			}catch(Exception $e)
299
+			}catch (Exception $e)
300 300
 			{
301 301
 				$this->logger->error($e->getMessage());
302 302
 			}
@@ -311,22 +311,22 @@  discard block
 block discarded – undo
311 311
 	{
312 312
 		$schedule = $this->get_schedule_by_id($id);
313 313
 		
314
-		try{
314
+		try {
315 315
 
316 316
 			$this->__xcloner_scheduler_callback($id, $schedule);
317 317
 			
318
-		}catch(Exception $e){
318
+		}catch (Exception $e) {
319 319
 			
320 320
 			//send email to site admin if email notification is not set in the scheduler
321
-			if(!isset($schedule['backup_params']->email_notification) || !$schedule['backup_params']->email_notification)
321
+			if (!isset($schedule['backup_params']->email_notification) || !$schedule['backup_params']->email_notification)
322 322
 			{
323 323
 				$schedule['backup_params']->email_notification = get_option('admin_email');
324 324
 			}
325 325
 				
326
-			if(isset($schedule['backup_params']->email_notification) && $to=$schedule['backup_params']->email_notification)
326
+			if (isset($schedule['backup_params']->email_notification) && $to = $schedule['backup_params']->email_notification)
327 327
 			{
328 328
 				$from = "XCloner Schedule - ".$schedule['name'];
329
-				$this->archive_system->send_notification($to, $from, "Scheduled backup error","", "", $e->getMessage());
329
+				$this->archive_system->send_notification($to, $from, "Scheduled backup error", "", "", $e->getMessage());
330 330
 			}
331 331
 			
332 332
 		}
Please login to merge, or discard this patch.
Braces   +23 added lines, -18 removed lines patch added patch discarded remove patch
@@ -42,10 +42,11 @@  discard block
 block discarded – undo
42 42
 		{
43 43
 			$new_list= array();
44 44
 			
45
-			foreach($list as $res)
46
-				if($res->status)
45
+			foreach($list as $res) {
46
+							if($res->status)
47 47
 				{
48 48
 					$res->next_run_time = wp_next_scheduled('xcloner_scheduler_'.$res->id, array($res->id))+(get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
49
+			}
49 50
 					$new_list[] = $res;
50 51
 				}
51 52
 			$list = $new_list;	
@@ -71,8 +72,9 @@  discard block
 block discarded – undo
71 72
 	{
72 73
 		$data = $this->db->get_row("SELECT * FROM ".$this->scheduler_table." WHERE id=".$id, ARRAY_A);
73 74
 		
74
-		if(!$data)
75
-			return false;
75
+		if(!$data) {
76
+					return false;
77
+		}
76 78
 		
77 79
 		$params = json_decode($data['params']);
78 80
 		
@@ -122,12 +124,13 @@  discard block
 block discarded – undo
122 124
 			
123 125
 			if ( ! wp_next_scheduled( $hook, array($schedule->id) ) and $schedule->status) {
124 126
 				
125
-				if($schedule->recurrence == "single")
126
-					wp_schedule_single_event( strtotime($schedule->start_at), $hook, array($schedule->id));
127
-				else	
128
-					wp_schedule_event( strtotime($schedule->start_at), $schedule->recurrence, $hook, array($schedule->id) );
127
+				if($schedule->recurrence == "single") {
128
+									wp_schedule_single_event( strtotime($schedule->start_at), $hook, array($schedule->id));
129
+				} else {
130
+									wp_schedule_event( strtotime($schedule->start_at), $schedule->recurrence, $hook, array($schedule->id) );
131
+				}
129 132
 					
130
-			}elseif(!$schedule->status)
133
+			} elseif(!$schedule->status)
131 134
 			{
132 135
 				$timestamp = wp_next_scheduled( $hook , array($schedule->id) );
133 136
 				wp_unschedule_event( $timestamp, $hook, array($schedule->id) );
@@ -146,9 +149,9 @@  discard block
 block discarded – undo
146 149
 		
147 150
 		if ($schedule->status) {
148 151
 			
149
-			if($schedule->recurrence == "single")
150
-				wp_schedule_single_event( strtotime($schedule->start_at), $hook, array($schedule->id));
151
-			else{	
152
+			if($schedule->recurrence == "single") {
153
+							wp_schedule_single_event( strtotime($schedule->start_at), $hook, array($schedule->id));
154
+			} else{	
152 155
 				wp_schedule_event( strtotime($schedule->start_at), $schedule->recurrence, $hook, array($schedule->id) );
153 156
 			}
154 157
 				
@@ -274,8 +277,9 @@  discard block
 block discarded – undo
274 277
 		
275 278
 		//getting the last backup archive file
276 279
 		$return['extra']['backup_parent'] = $this->archive_system->get_archive_name_with_extension();
277
-		if($this->xcloner_file_system->is_part($this->archive_system->get_archive_name_with_extension()))
278
-				$return['extra']['backup_parent'] = $this->archive_system->get_archive_name_multipart();
280
+		if($this->xcloner_file_system->is_part($this->archive_system->get_archive_name_with_extension())) {
281
+						$return['extra']['backup_parent'] = $this->archive_system->get_archive_name_multipart();
282
+		}
279 283
 		
280 284
 		$this->update_last_backup($schedule['id'], $return['extra']['backup_parent']);
281 285
 		
@@ -285,8 +289,9 @@  discard block
 block discarded – undo
285 289
 			
286 290
 			$this->logger->info(sprintf("Transferring backup to remote storage %s", strtoupper($schedule['remote_storage'])), array("CRON"));
287 291
 			
288
-			if(method_exists($this->xcloner_remote_storage, "upload_backup_to_storage"))
289
-				call_user_func_array(array($this->xcloner_remote_storage, "upload_backup_to_storage"), array($backup_file, $schedule['remote_storage']));
292
+			if(method_exists($this->xcloner_remote_storage, "upload_backup_to_storage")) {
293
+							call_user_func_array(array($this->xcloner_remote_storage, "upload_backup_to_storage"), array($backup_file, $schedule['remote_storage']));
294
+			}
290 295
 		}
291 296
 		
292 297
 		
@@ -296,7 +301,7 @@  discard block
 block discarded – undo
296 301
 				$from = "XCloner Schedule - ".$schedule['name'];
297 302
 				$additional['lines_total'] = $return['extra']['lines_total'];
298 303
 				$this->archive_system->send_notification($to, $from, "", $return['extra']['backup_parent'], $schedule, "", $additional);
299
-			}catch(Exception $e)
304
+			} catch(Exception $e)
300 305
 			{
301 306
 				$this->logger->error($e->getMessage());
302 307
 			}
@@ -315,7 +320,7 @@  discard block
 block discarded – undo
315 320
 
316 321
 			$this->__xcloner_scheduler_callback($id, $schedule);
317 322
 			
318
-		}catch(Exception $e){
323
+		} catch(Exception $e){
319 324
 			
320 325
 			//send email to site admin if email notification is not set in the scheduler
321 326
 			if(!isset($schedule['backup_params']->email_notification) || !$schedule['backup_params']->email_notification)
Please login to merge, or discard this patch.
admin/partials/xcloner_manage_backups_page.php 2 patches
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-$xcloner_file_system 		= $this->get_xcloner_container()->get_xcloner_filesystem();
4
-$xcloner_sanitization 		= $this->get_xcloner_container()->get_xcloner_sanitization();
5
-$xcloner_remote_storage 	= $this->get_xcloner_container()->get_xcloner_remote_storage();
6
-$storage_selection 			= "";
3
+$xcloner_file_system = $this->get_xcloner_container()->get_xcloner_filesystem();
4
+$xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization();
5
+$xcloner_remote_storage = $this->get_xcloner_container()->get_xcloner_remote_storage();
6
+$storage_selection = "";
7 7
 
8
-if(isset($_GET['storage_selection']) and $_GET['storage_selection'])
8
+if (isset($_GET['storage_selection']) and $_GET['storage_selection'])
9 9
 {
10 10
 	$storage_selection = $xcloner_sanitization->sanitize_input_as_string($_GET['storage_selection']);
11 11
 }
@@ -21,18 +21,18 @@  discard block
 block discarded – undo
21 21
 	<div class="col s12 m6 l9">
22 22
 		<h1><?= esc_html(get_admin_page_title()); ?></h1>
23 23
 	</div>	
24
-	<?php if(sizeof($available_storages)):?>
24
+	<?php if (sizeof($available_storages)):?>
25 25
 		<div class="col s12 m6 l3 remote-storage-selection">
26 26
 				<select name="storage_selection" id="storage_selection" class="validate" required >
27 27
 					
28
-					<?php if($storage_selection):?>
28
+					<?php if ($storage_selection):?>
29 29
 						<option value="" selected><?php echo __('Change To Local Storage...', 'xcloner-backup-and-restore') ?></option>
30 30
 					<?php else: ?>
31 31
 						<option value="" selected><?php echo __('Change To Remote Storage...', 'xcloner-backup-and-restore') ?></option>
32
-					<?php endif;?>
32
+					<?php endif; ?>
33 33
 						
34
-					<?php foreach($available_storages as $storage=>$text):?>
35
-						<option value="<?php echo $storage?>"<?php if($storage == $storage_selection) echo "selected"?>><?php echo $text?></option>
34
+					<?php foreach ($available_storages as $storage=>$text):?>
35
+						<option value="<?php echo $storage?>"<?php if ($storage == $storage_selection) echo "selected"?>><?php echo $text?></option>
36 36
 					<?php endforeach?>
37 37
 				</select>
38 38
 	<?php endif?>
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
 				  <label for="select_all">&nbsp;</label>
48 48
 				</p> 
49 49
 		  </th>
50
-		  <th data-field="id"><?php echo __("Backup Name",'xcloner-backup-and-restore')?></th>
51
-		  <th data-field="name"><?php echo __("Created Time",'xcloner-backup-and-restore')?></th>
52
-		  <th data-field="name"><?php echo __("Size",'xcloner-backup-and-restore')?></th>
53
-		  <th class="no-sort" data-field="price"><?php echo __("Action",'xcloner-backup-and-restore')?></th>
50
+		  <th data-field="id"><?php echo __("Backup Name", 'xcloner-backup-and-restore')?></th>
51
+		  <th data-field="name"><?php echo __("Created Time", 'xcloner-backup-and-restore')?></th>
52
+		  <th data-field="name"><?php echo __("Size", 'xcloner-backup-and-restore')?></th>
53
+		  <th class="no-sort" data-field="price"><?php echo __("Action", 'xcloner-backup-and-restore')?></th>
54 54
 		  
55 55
 	  </tr>
56 56
 	</thead>
@@ -60,20 +60,20 @@  discard block
 block discarded – undo
60 60
       
61 61
 <?php 
62 62
 $i = 0;
63
-foreach($backup_list as $file_info):?>
63
+foreach ($backup_list as $file_info):?>
64 64
 <?php 
65
-	if($storage_selection == "gdrive")
65
+	if ($storage_selection == "gdrive")
66 66
 		$file_info['path'] = $file_info['filename'].".".$file_info['extension'];
67 67
 	$file_exists_on_local_storage = true;
68 68
 	
69
-	if($storage_selection)
69
+	if ($storage_selection)
70 70
 	{
71
-		if(!$xcloner_file_system->get_storage_filesystem()->has($file_info['path']))
71
+		if (!$xcloner_file_system->get_storage_filesystem()->has($file_info['path']))
72 72
 			$file_exists_on_local_storage = false;
73 73
 	}
74 74
 
75 75
 ?>
76
-<?php if(!isset($file_info['parent'])):?>	
76
+<?php if (!isset($file_info['parent'])):?>	
77 77
 	
78 78
 	<tr>
79 79
 		<td class="checkbox">
@@ -84,55 +84,55 @@  discard block
 block discarded – undo
84 84
 		</td>
85 85
 		<td>
86 86
 			<span class=""><?php echo $file_info['path']?></span>
87
-			<?php if(!$file_exists_on_local_storage): ?>
88
-				<a href="#" title="<?php echo __("File does not exists on local storage","xcloner-backup-and-restore")?>"><i class="material-icons backup_warning">warning</i></a>
87
+			<?php if (!$file_exists_on_local_storage): ?>
88
+				<a href="#" title="<?php echo __("File does not exists on local storage", "xcloner-backup-and-restore")?>"><i class="material-icons backup_warning">warning</i></a>
89 89
 			<?php endif?>
90 90
 			<?php 
91
-			if(isset($file_info['childs']) and is_array($file_info['childs'])):
91
+			if (isset($file_info['childs']) and is_array($file_info['childs'])):
92 92
 			?>
93 93
 			<a href="#" title="expand" class="expand-multipart add"><i class="material-icons">add</i></a>
94 94
 			<a href="#" title="collapse" class="expand-multipart remove"><i class="material-icons">remove</i></a>
95 95
 			<ul class="multipart">
96
-			<?php foreach($file_info['childs'] as $child):?>
96
+			<?php foreach ($file_info['childs'] as $child):?>
97 97
 				<li>
98 98
 					<?php echo $child[0]?> (<?php echo size_format($child[2])?>) 
99 99
 					<?php
100 100
 					$child_exists_on_local_storage = true;
101
-					if($storage_selection)
101
+					if ($storage_selection)
102 102
 					{
103
-						if(!$xcloner_file_system->get_storage_filesystem()->has($child[0]))
103
+						if (!$xcloner_file_system->get_storage_filesystem()->has($child[0]))
104 104
 							$child_exists_on_local_storage = false;
105 105
 					}
106 106
 					?>
107
-					<?php if(!$child_exists_on_local_storage): ?>
108
-						<a href="#" title="<?php echo __("File does not exists on local storage","xcloner-backup-and-restore")?>"><i class="material-icons backup_warning">warning</i></a>
107
+					<?php if (!$child_exists_on_local_storage): ?>
108
+						<a href="#" title="<?php echo __("File does not exists on local storage", "xcloner-backup-and-restore")?>"><i class="material-icons backup_warning">warning</i></a>
109 109
 					<?php endif?>
110
-					<?php if(!$storage_selection) :?>
111
-						<a href="#<?php echo $child[0];?>" class="download" title="Download Backup"><i class="material-icons">file_download</i></a>
112
-						<a href="#<?php echo $child[0]?>" class="list-backup-content" title="<?php echo __('List Backup Content','xcloner-backup-and-restore')?>"><i class="material-icons">folder_open</i></a> 
113
-					<?php elseif($storage_selection != "gdrive" && !$xcloner_file_system->get_storage_filesystem()->has($child[0])): ?>
114
-						<a href="#<?php echo $child[0]?>" class="copy-remote-to-local" title="<?php echo __('Push Backup To Local Storage','xcloner-backup-and-restore')?>"><i class="material-icons">file_upload</i></a>
110
+					<?php if (!$storage_selection) :?>
111
+						<a href="#<?php echo $child[0]; ?>" class="download" title="Download Backup"><i class="material-icons">file_download</i></a>
112
+						<a href="#<?php echo $child[0]?>" class="list-backup-content" title="<?php echo __('List Backup Content', 'xcloner-backup-and-restore')?>"><i class="material-icons">folder_open</i></a> 
113
+					<?php elseif ($storage_selection != "gdrive" && !$xcloner_file_system->get_storage_filesystem()->has($child[0])): ?>
114
+						<a href="#<?php echo $child[0]?>" class="copy-remote-to-local" title="<?php echo __('Push Backup To Local Storage', 'xcloner-backup-and-restore')?>"><i class="material-icons">file_upload</i></a>
115 115
 					<?php endif?>
116 116
 				</li>
117
-				<?php endforeach;?>
117
+				<?php endforeach; ?>
118 118
 			</ul>
119
-			<?php endif;?>
119
+			<?php endif; ?>
120 120
 		</td>
121
-		<td><?php if(isset($file_info['timestamp'])) echo date("d M, Y H:i", $file_info['timestamp'])?></td>
121
+		<td><?php if (isset($file_info['timestamp'])) echo date("d M, Y H:i", $file_info['timestamp'])?></td>
122 122
 		<td><?php echo size_format($file_info['size'])?></td>
123 123
 		<td>
124
-			<?php if(!$storage_selection):?>
125
-				<a href="#<?php echo $file_info['basename'];?>" class="download" title="<?php echo __('Download Backup','xcloner-backup-and-restore')?>"><i class="material-icons">file_download</i></a>
124
+			<?php if (!$storage_selection):?>
125
+				<a href="#<?php echo $file_info['basename']; ?>" class="download" title="<?php echo __('Download Backup', 'xcloner-backup-and-restore')?>"><i class="material-icons">file_download</i></a>
126 126
 
127
-				<?php if(sizeof($available_storages)):?>
128
-					<a href="#<?php echo $file_info['basename']?>" class="cloud-upload" title="<?php echo __('Send Backup To Remote Storage','xcloner-backup-and-restore')?>"><i class="material-icons">cloud_upload</i></a>
127
+				<?php if (sizeof($available_storages)):?>
128
+					<a href="#<?php echo $file_info['basename']?>" class="cloud-upload" title="<?php echo __('Send Backup To Remote Storage', 'xcloner-backup-and-restore')?>"><i class="material-icons">cloud_upload</i></a>
129 129
 				<?php endif?>
130
-				<a href="#<?php echo $file_info['basename']?>" class="list-backup-content" title="<?php echo __('List Backup Content','xcloner-backup-and-restore')?>"><i class="material-icons">folder_open</i></a>
131
-			 <?php endif;?>
130
+				<a href="#<?php echo $file_info['basename']?>" class="list-backup-content" title="<?php echo __('List Backup Content', 'xcloner-backup-and-restore')?>"><i class="material-icons">folder_open</i></a>
131
+			 <?php endif; ?>
132 132
 			 	
133
-			<a href="#<?php echo $file_info['basename']?>" class="delete" title="<?php echo __('Delete Backup','xcloner-backup-and-restore')?>"><i class="material-icons">delete</i></a>
134
-			<?php if($storage_selection and !$file_exists_on_local_storage):?>
135
-				<a href="#<?php echo $file_info['basename'];?>" class="copy-remote-to-local" title="<?php echo __('Push Backup To Local Storage','xcloner-backup-and-restore')?>"><i class="material-icons">file_upload</i></a>
133
+			<a href="#<?php echo $file_info['basename']?>" class="delete" title="<?php echo __('Delete Backup', 'xcloner-backup-and-restore')?>"><i class="material-icons">delete</i></a>
134
+			<?php if ($storage_selection and !$file_exists_on_local_storage):?>
135
+				<a href="#<?php echo $file_info['basename']; ?>" class="copy-remote-to-local" title="<?php echo __('Push Backup To Local Storage', 'xcloner-backup-and-restore')?>"><i class="material-icons">file_upload</i></a>
136 136
 			<?php endif?>	
137 137
 			
138 138
 		</td>
@@ -145,12 +145,12 @@  discard block
 block discarded – undo
145 145
 	</tbody>
146 146
 </table>
147 147
 
148
-<a class="waves-effect waves-light btn delete-all"><i class="material-icons left">delete</i><?php echo __("Delete",'xcloner-backup-and-restore')?></a>
148
+<a class="waves-effect waves-light btn delete-all"><i class="material-icons left">delete</i><?php echo __("Delete", 'xcloner-backup-and-restore')?></a>
149 149
 
150 150
 <!-- List Backup Content Modal-->
151 151
 <div id="backup_cotent_modal" class="modal">
152 152
 	<div class="modal-content">
153
-		<h4><?php echo sprintf(__("Listing Backup Content ",'xcloner-backup-and-restore'), "")?></h4>
153
+		<h4><?php echo sprintf(__("Listing Backup Content ", 'xcloner-backup-and-restore'), "")?></h4>
154 154
 		<h5 class="backup-name"></h5>
155 155
 		
156 156
 		<div class="progress">
@@ -163,14 +163,14 @@  discard block
 block discarded – undo
163 163
 <!-- Local Transfer Modal-->
164 164
 <div id="local_storage_upload_modal" class="modal">
165 165
 	<div class="modal-content">
166
-		<h4><?php echo sprintf(__("Transfer Remote Backup To Local Storage",'xcloner-backup-and-restore'), "")?></h4>
166
+		<h4><?php echo sprintf(__("Transfer Remote Backup To Local Storage", 'xcloner-backup-and-restore'), "")?></h4>
167 167
 		<h5 class="backup-name"></h5>
168 168
 		
169 169
 		<div class="row status">
170 170
 			<div class="progress">
171 171
 				<div class="indeterminate"></div>
172 172
 			</div>
173
-			<?php echo __("Uploading backup to the local storage filesystem...",'xcloner-backup-and-restore')?> <span class="status-text"></span>
173
+			<?php echo __("Uploading backup to the local storage filesystem...", 'xcloner-backup-and-restore')?> <span class="status-text"></span>
174 174
 		</div>
175 175
 	</div>	
176 176
 </div>
@@ -180,17 +180,17 @@  discard block
 block discarded – undo
180 180
 	<form method="POST" class="remote-storage-form">
181 181
 	<input type="hidden" name="file" class="backup_name">	  
182 182
 	<div class="modal-content">
183
-	  <h4><?php echo __("Remote Storage Transfer",'xcloner-backup-and-restore')?></h4>
183
+	  <h4><?php echo __("Remote Storage Transfer", 'xcloner-backup-and-restore')?></h4>
184 184
 	  <p>
185
-	  <?php if(sizeof($available_storages)):?>
185
+	  <?php if (sizeof($available_storages)):?>
186 186
 			<div class="row">
187 187
 				<div class="col s12 label">
188
-					<label><?php echo sprintf(__('Send %s to remote storage','xcloner-backup-and-restore'), "<span class='backup_name'></span>") ?></label>
188
+					<label><?php echo sprintf(__('Send %s to remote storage', 'xcloner-backup-and-restore'), "<span class='backup_name'></span>") ?></label>
189 189
 				</div>
190 190
 				<div class="input-field col s8 m10">
191 191
 					<select name="transfer_storage" id="transfer_storage" class="validate" required >
192 192
 						<option value="" selected><?php echo __('please select...', 'xcloner-backup-and-restore') ?></option>
193
-						<?php foreach($available_storages as $storage=>$text):?>
193
+						<?php foreach ($available_storages as $storage=>$text):?>
194 194
 							<option value="<?php echo $storage?>"><?php echo $text?></option>
195 195
 						<?php endforeach?>
196 196
 						</select>
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 				</div>
202 202
 			</div>
203 203
 			<div class="row status">
204
-				<?php echo __("Uploading backup to the selected remote storage...",'xcloner-backup-and-restore')?> <span class="status-text"></span>
204
+				<?php echo __("Uploading backup to the selected remote storage...", 'xcloner-backup-and-restore')?> <span class="status-text"></span>
205 205
 				<div class="progress">
206 206
 					<div class="indeterminate"></div>
207 207
 				</div>
Please login to merge, or discard this patch.
Braces   +22 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,12 +27,16 @@  discard block
 block discarded – undo
27 27
 					
28 28
 					<?php if($storage_selection):?>
29 29
 						<option value="" selected><?php echo __('Change To Local Storage...', 'xcloner-backup-and-restore') ?></option>
30
-					<?php else: ?>
30
+					<?php else {
31
+	: ?>
31 32
 						<option value="" selected><?php echo __('Change To Remote Storage...', 'xcloner-backup-and-restore') ?></option>
32
-					<?php endif;?>
33
+					<?php endif;
34
+}
35
+?>
33 36
 						
34 37
 					<?php foreach($available_storages as $storage=>$text):?>
35
-						<option value="<?php echo $storage?>"<?php if($storage == $storage_selection) echo "selected"?>><?php echo $text?></option>
38
+						<option value="<?php echo $storage?>"<?php if($storage == $storage_selection) {
39
+	echo "selected"?>><?php echo $text?></option>
36 40
 					<?php endforeach?>
37 41
 				</select>
38 42
 	<?php endif?>
@@ -60,16 +64,19 @@  discard block
 block discarded – undo
60 64
       
61 65
 <?php 
62 66
 $i = 0;
67
+}
63 68
 foreach($backup_list as $file_info):?>
64 69
 <?php 
65
-	if($storage_selection == "gdrive")
66
-		$file_info['path'] = $file_info['filename'].".".$file_info['extension'];
70
+	if($storage_selection == "gdrive") {
71
+			$file_info['path'] = $file_info['filename'].".".$file_info['extension'];
72
+	}
67 73
 	$file_exists_on_local_storage = true;
68 74
 	
69 75
 	if($storage_selection)
70 76
 	{
71
-		if(!$xcloner_file_system->get_storage_filesystem()->has($file_info['path']))
72
-			$file_exists_on_local_storage = false;
77
+		if(!$xcloner_file_system->get_storage_filesystem()->has($file_info['path'])) {
78
+					$file_exists_on_local_storage = false;
79
+		}
73 80
 	}
74 81
 
75 82
 ?>
@@ -100,8 +107,9 @@  discard block
 block discarded – undo
100 107
 					$child_exists_on_local_storage = true;
101 108
 					if($storage_selection)
102 109
 					{
103
-						if(!$xcloner_file_system->get_storage_filesystem()->has($child[0]))
104
-							$child_exists_on_local_storage = false;
110
+						if(!$xcloner_file_system->get_storage_filesystem()->has($child[0])) {
111
+													$child_exists_on_local_storage = false;
112
+						}
105 113
 					}
106 114
 					?>
107 115
 					<?php if(!$child_exists_on_local_storage): ?>
@@ -118,11 +126,14 @@  discard block
 block discarded – undo
118 126
 			</ul>
119 127
 			<?php endif;?>
120 128
 		</td>
121
-		<td><?php if(isset($file_info['timestamp'])) echo date("d M, Y H:i", $file_info['timestamp'])?></td>
129
+		<td><?php if(isset($file_info['timestamp'])) {
130
+	echo date("d M, Y H:i", $file_info['timestamp'])?></td>
122 131
 		<td><?php echo size_format($file_info['size'])?></td>
123 132
 		<td>
124 133
 			<?php if(!$storage_selection):?>
125
-				<a href="#<?php echo $file_info['basename'];?>" class="download" title="<?php echo __('Download Backup','xcloner-backup-and-restore')?>"><i class="material-icons">file_download</i></a>
134
+				<a href="#<?php echo $file_info['basename'];
135
+}
136
+?>" class="download" title="<?php echo __('Download Backup','xcloner-backup-and-restore')?>"><i class="material-icons">file_download</i></a>
126 137
 
127 138
 				<?php if(sizeof($available_storages)):?>
128 139
 					<a href="#<?php echo $file_info['basename']?>" class="cloud-upload" title="<?php echo __('Send Backup To Remote Storage','xcloner-backup-and-restore')?>"><i class="material-icons">cloud_upload</i></a>
Please login to merge, or discard this patch.