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 ( adacc0...e65d67 )
by Liuta
02:45
created
uninstall.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,6 +26,6 @@
 block discarded – undo
26 26
  */
27 27
 
28 28
 // If uninstall not called from WordPress, then exit.
29
-if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
29
+if (!defined('WP_UNINSTALL_PLUGIN')) {
30 30
 	exit;
31 31
 }
Please login to merge, or discard this patch.
includes/class-xcloner-i18n.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 		load_plugin_textdomain(
38 38
 			'xcloner-backup-and-restore',
39 39
 			false,
40
-			dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
40
+			dirname(dirname(plugin_basename(__FILE__))).'/languages/'
41 41
 		);
42 42
 
43 43
 	}
Please login to merge, or discard this patch.
includes/class-xcloner-file-transfer.php 1 patch
Spacing   +15 added lines, -15 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_File_Transfer extends Xcloner_File_System{
3
+class Xcloner_File_Transfer extends Xcloner_File_System {
4 4
 	
5 5
 	private $target_url;
6 6
 	private $transfer_limit = 1048576; //bytes 1MB= 1048576 300KB = 358400
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 	
9 9
 	public function set_target($target_url)
10 10
 	{
11
-		return $this->target_url= $target_url;
11
+		return $this->target_url = $target_url;
12 12
 	}
13 13
 	
14 14
 	public function get_target()
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	
20 20
 	public function transfer_file($file, $start = 0, $hash = "")
21 21
 	{
22
-		if(!$this->target_url)
22
+		if (!$this->target_url)
23 23
 			throw new Exception("Please setup a target url for upload");
24 24
 
25 25
 		
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		
28 28
 		fseek($fp, $start, SEEK_SET);
29 29
 		
30
-		$binary_data =  fread($fp, $this->transfer_limit);
30
+		$binary_data = fread($fp, $this->transfer_limit);
31 31
 		
32 32
 		$tmp_filename = "xcloner_upload_".substr(md5(time()), 0, 5);
33 33
 		
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
 		$send_array = array();
39 39
 		
40 40
 		$send_array['file'] 	= $file;
41
-		$send_array['start'] 	= $start;
42
-		$send_array['action'] 	= "write_file";
41
+		$send_array['start'] = $start;
42
+		$send_array['action'] = "write_file";
43 43
 		$send_array['hash'] 	= $hash;
44 44
 		#$send_array['blob'] 	= $binary_data;
45
-		$send_array['blob'] 	= $this->curl_file_create($tmp_file_path,'application/x-binary',$tmp_filename);
45
+		$send_array['blob'] 	= $this->curl_file_create($tmp_file_path, 'application/x-binary', $tmp_filename);
46 46
 		
47 47
 		//$data = http_build_query($send_array);
48 48
 		
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		
51 51
 		
52 52
 		$ch = curl_init();
53
-		curl_setopt($ch, CURLOPT_URL,$this->target_url);
53
+		curl_setopt($ch, CURLOPT_URL, $this->target_url);
54 54
 		
55 55
 		curl_setopt($ch, CURLOPT_POST, 1);
56 56
 		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 
@@ -59,24 +59,24 @@  discard block
 block discarded – undo
59 59
         curl_setopt($ch, CURLOPT_TIMEOUT, 1200);
60 60
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
61 61
         
62
-		curl_setopt($ch, CURLOPT_POSTFIELDS, $send_array );
62
+		curl_setopt($ch, CURLOPT_POSTFIELDS, $send_array);
63 63
 		curl_setopt($ch, CURLOPT_VERBOSE, true);
64 64
 		
65
-		$original_result = curl_exec ($ch);
65
+		$original_result = curl_exec($ch);
66 66
 		
67 67
 		$this->get_tmp_filesystem()->delete($tmp_filename);
68 68
 		
69 69
 		$result = json_decode($original_result);
70 70
 				
71
-		if(!$result)
72
-			throw new Exception("We have received no valid response from the remote host, original message: ". $original_result);
71
+		if (!$result)
72
+			throw new Exception("We have received no valid response from the remote host, original message: ".$original_result);
73 73
 			
74
-		if($result->status != 200)
74
+		if ($result->status != 200)
75 75
 		{
76 76
 			throw new Exception($result->response);
77 77
 		}
78 78
 		
79
-		if(ftell($fp) >= $this->get_storage_filesystem()->getSize($file))
79
+		if (ftell($fp) >= $this->get_storage_filesystem()->getSize($file))
80 80
 		{
81 81
 			$this->get_logger()->info(sprintf("Upload done for file %s to target url %s, transferred a total of %s bytes", $file, $this->target_url, ftell($fp)));
82 82
 			$this->remove_tmp_filesystem();
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	            . ($postname ?: basename($filename))
94 94
 	            . ($mimetype ? ";type=$mimetype" : '');
95 95
 		
96
-		}else{
96
+		} else {
97 97
 			
98 98
 			return curl_file_create($filename, $mimetype, $postname);	
99 99
 				
Please login to merge, or discard this patch.
admin/partials/xcloner_console_page.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-$xcloner_settings 	= $this->get_xcloner_container()->get_xcloner_settings();
4
-$logger				= $this->get_xcloner_container()->get_xcloner_logger();
5
-$logger_content 	= $logger->getLastDebugLines();
3
+$xcloner_settings = $this->get_xcloner_container()->get_xcloner_settings();
4
+$logger = $this->get_xcloner_container()->get_xcloner_logger();
5
+$logger_content = $logger->getLastDebugLines();
6 6
 ?>
7 7
 <div class="col s12 ">
8 8
 	<div>
@@ -10,12 +10,12 @@  discard block
 block discarded – undo
10 10
 				<?php echo __('XCloner Debugger Dashboard', 'xcloner-backup-and-restore') ?>
11 11
 		</h5>
12 12
 		
13
-		<?php if($xcloner_settings->get_xcloner_option('xcloner_enable_log')) :?>
13
+		<?php if ($xcloner_settings->get_xcloner_option('xcloner_enable_log')) :?>
14 14
 		<ul class="collapsible xcloner-debugger" data-collapsible="accordion">
15 15
 			<li class="active">
16 16
 				<div class="collapsible-header active"><i class="material-icons">bug_report</i>XCloner Debugger</div>
17 17
 				<div class="collapsible-body">
18
-					<div class="console" id="xcloner-console"><?php if(isset($logger_content)) echo implode("<br />\n", $logger_content); ?></div>
18
+					<div class="console" id="xcloner-console"><?php if (isset($logger_content)) echo implode("<br />\n", $logger_content); ?></div>
19 19
 				</div>
20 20
 			</li>
21 21
 		</ul>
@@ -28,6 +28,6 @@  discard block
 block discarded – undo
28 28
 				}, 2000);*/
29 29
 			})
30 30
 		</script>
31
-		<?php endif;?>
31
+		<?php endif; ?>
32 32
 	</div>
33 33
 </div>
Please login to merge, or discard this patch.
admin/partials/xcloner_init_page.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -12,20 +12,20 @@  discard block
 block discarded – undo
12 12
  * @subpackage Xcloner/admin/partials
13 13
  */
14 14
 
15
-$requirements	 		= $this->get_xcloner_container()->get_xcloner_requirements();
16
-$xcloner_settings 		= $this->get_xcloner_container()->get_xcloner_settings();
17
-$xcloner_file_system 	= $this->get_xcloner_container()->get_xcloner_filesystem();
18
-$logger					= $this->get_xcloner_container()->get_xcloner_logger();
19
-$xcloner_scheduler 		= $this->get_xcloner_container()->get_xcloner_scheduler();
15
+$requirements = $this->get_xcloner_container()->get_xcloner_requirements();
16
+$xcloner_settings = $this->get_xcloner_container()->get_xcloner_settings();
17
+$xcloner_file_system = $this->get_xcloner_container()->get_xcloner_filesystem();
18
+$logger = $this->get_xcloner_container()->get_xcloner_logger();
19
+$xcloner_scheduler = $this->get_xcloner_container()->get_xcloner_scheduler();
20 20
 
21 21
 $logger_content = $logger->getLastDebugLines();
22 22
 
23
-$date_format = get_option( 'date_format' );
24
-$time_format = get_option( 'time_format' );
23
+$date_format = get_option('date_format');
24
+$time_format = get_option('time_format');
25 25
 
26
-if($requirements->check_backup_ready_status())
26
+if ($requirements->check_backup_ready_status())
27 27
 {
28
-	$latest_backup =  $xcloner_file_system->get_latest_backup();
28
+	$latest_backup = $xcloner_file_system->get_latest_backup();
29 29
 	$xcloner_file_system->backup_storage_cleanup();
30 30
 }
31 31
 ?>
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	</div>
39 39
 </div>
40 40
 
41
-<?php if(isset($latest_backup['timestamp']) and $latest_backup['timestamp'] < strtotime("-1 day")): ?>
41
+<?php if (isset($latest_backup['timestamp']) and $latest_backup['timestamp'] < strtotime("-1 day")): ?>
42 42
 	<div id="setting-error-" class="error settings-error notice is-dismissible"> 
43 43
 		<p><strong>
44 44
 			<?php echo __('Your latest backup is older than 24 hours, please create a new backup to keep your site protected.', 'xcloner-backup-and-restore') ?>
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	</div>
48 48
 <?php endif?>
49 49
 
50
-<?php if(!isset($latest_backup['timestamp']) ): ?>
50
+<?php if (!isset($latest_backup['timestamp'])): ?>
51 51
 	<div id="setting-error-" class="error settings-error notice is-dismissible"> 
52 52
 		<p><strong>
53 53
 			<?php echo __('You have no backup that I could find, please generate a new backup to keep your site protected.', 'xcloner-backup-and-restore') ?>
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	</div>
57 57
 <?php endif?>
58 58
 
59
-<?php if(!$requirements->check_backup_ready_status()):?>
59
+<?php if (!$requirements->check_backup_ready_status()):?>
60 60
 	<div id="setting-error-" class="error settings-error notice is-dismissible"> 
61 61
 		<p><strong>
62 62
 			<?php echo __('Backup system not ready, please check and fix the issues marked in red', 'xcloner-backup-and-restore') ?>
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 							<div class="row">
84 84
 								<h5><?php echo __("Latest Backup", 'xcloner-backup-and-restore')?></h5>
85 85
 								<blockquote>
86
-								<?php if($latest_backup):?>
86
+								<?php if ($latest_backup):?>
87 87
 									<div class="item">
88 88
 										<div class="title"><?php echo __("Backup Name", 'xcloner-backup-and-restore')?>:</div>
89 89
 										<?php echo $latest_backup['basename']?>
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 									<div class="item">
98 98
 										<div class="title"><?php echo __("Backup Date", 'xcloner-backup-and-restore')?>:</div>
99 99
 										<?php 
100
-										echo date($date_format." ".$time_format, $latest_backup['timestamp']+(get_option( 'gmt_offset' ) * HOUR_IN_SECONDS))
100
+										echo date($date_format." ".$time_format, $latest_backup['timestamp'] + (get_option('gmt_offset') * HOUR_IN_SECONDS))
101 101
 										?>
102 102
 									</div> 
103 103
 								<?php else:?>
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 								<blockquote>
112 112
 								<div class="item">
113 113
 									<div class="title"><?php echo __("Total Size", 'xcloner-backup-and-restore')?>:</div>
114
-									<?php echo size_format($xcloner_file_system->get_storage_usage());?>
114
+									<?php echo size_format($xcloner_file_system->get_storage_usage()); ?>
115 115
 								</div>
116 116
 								</blockquote>
117 117
 							<h5><?php echo __("Next Scheduled Backup", 'xcloner-backup-and-restore')?></h5>
@@ -120,25 +120,25 @@  discard block
 block discarded – undo
120 120
 									<?php
121 121
 									$list = ($xcloner_scheduler->get_next_run_schedule());
122 122
 										
123
-										if(is_array($list))
123
+										if (is_array($list))
124 124
 										{
125
-											$xcloner_file_system->sort_by($list, "next_run_time","asc");
125
+											$xcloner_file_system->sort_by($list, "next_run_time", "asc");
126 126
 										}
127 127
 										
128
-										if(isset($list[0]))
128
+										if (isset($list[0]))
129 129
 											$latest_schedule = $list[0];
130 130
 									?>
131
-									<?php if(isset($latest_schedule->name)):?>
131
+									<?php if (isset($latest_schedule->name)):?>
132 132
 									<div class="title"><?php echo __("Schedule Name", 'xcloner-backup-and-restore')?>:</div>
133
-										<?php	echo $latest_schedule->name;?>
134
-									<?php endif;?>	
133
+										<?php	echo $latest_schedule->name; ?>
134
+									<?php endif; ?>	
135 135
 								</div>
136 136
 								<div class="item">
137 137
 									<div class="title"><?php echo __("Next Call", 'xcloner-backup-and-restore')?>:</div>
138
-									<?php if(isset($latest_schedule->next_run_time))	
138
+									<?php if (isset($latest_schedule->next_run_time))	
139 139
 											echo date($date_format." ".$time_format, $latest_schedule->next_run_time);
140 140
 										  else
141
-											echo __("Unscheduled",'xcloner-backup-and-restore');
141
+											echo __("Unscheduled", 'xcloner-backup-and-restore');
142 142
 									?>
143 143
 								</div>
144 144
 								</blockquote>
@@ -146,14 +146,14 @@  discard block
 block discarded – undo
146 146
 					</div>
147 147
 				</li>
148 148
 				
149
-				<?php if($xcloner_settings->get_xcloner_option('xcloner_enable_log')) :?>
149
+				<?php if ($xcloner_settings->get_xcloner_option('xcloner_enable_log')) :?>
150 150
 				<li class="active">
151 151
 					<div class="collapsible-header active">
152 152
 						<i class="material-icons">bug_report</i><?php echo __('XCloner Debugger', 'xcloner-backup-and-restore')?>
153 153
 						<span class="right"><a href="#<?php echo $logger_basename = basename($logger->get_main_logger_url())?>" class="download-logger"><?php echo $logger_basename?></a></span>
154 154
 					</div>
155 155
 					<div class="collapsible-body">
156
-						<div class="console" id="xcloner-console"><?php if($logger_content) echo implode("<br />\n", array_reverse($logger_content)); ?></div>
156
+						<div class="console" id="xcloner-console"><?php if ($logger_content) echo implode("<br />\n", array_reverse($logger_content)); ?></div>
157 157
 					</div>
158 158
 				</li>
159 159
 				<script>
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 					}, 2000);*/
166 166
 				})
167 167
 				</script>
168
-				<?php endif;?>
168
+				<?php endif; ?>
169 169
 			
170 170
 			</ul>
171 171
 			
@@ -177,59 +177,59 @@  discard block
 block discarded – undo
177 177
 	  
178 178
 	  <div class="card blue-grey darken-1 z-depth-4 backup-ready">
179 179
 		<div class="card-content white-text">
180
-		  <span class="card-title"><?php echo __("System Check",'xcloner-backup-and-restore')?></span>
180
+		  <span class="card-title"><?php echo __("System Check", 'xcloner-backup-and-restore')?></span>
181 181
 		  <ul>
182
-				<li class="card-panel <?php echo ($requirements->check_xcloner_start_path(1)?"teal":"red")?> lighten-2" >
183
-					<?php echo __('Backup Start Location','xcloner-backup-and-restore')?>: <span class="shorten_string "><?php echo $requirements->check_xcloner_start_path();?></span>
182
+				<li class="card-panel <?php echo ($requirements->check_xcloner_start_path(1) ? "teal" : "red")?> lighten-2" >
183
+					<?php echo __('Backup Start Location', 'xcloner-backup-and-restore')?>: <span class="shorten_string "><?php echo $requirements->check_xcloner_start_path(); ?></span>
184 184
 				</li>
185
-				<li class="card-panel <?php echo ($requirements->check_xcloner_store_path(1)?"teal":"red")?> lighten-2" >
186
-					<?php echo __('Backup Storage Location','xcloner-backup-and-restore')?>: <span class="shorten_string"><?php echo $requirements->check_xcloner_store_path();?></span>
185
+				<li class="card-panel <?php echo ($requirements->check_xcloner_store_path(1) ? "teal" : "red")?> lighten-2" >
186
+					<?php echo __('Backup Storage Location', 'xcloner-backup-and-restore')?>: <span class="shorten_string"><?php echo $requirements->check_xcloner_store_path(); ?></span>
187 187
 				</li>
188
-				<li class="card-panel <?php echo ($requirements->check_xcloner_tmp_path(1)?"teal":"red")?> lighten-2" >
189
-					<?php echo __('Temporary Location','xcloner-backup-and-restore')?>: <span class="shorten_string"><?php echo $requirements->check_xcloner_tmp_path();?></span>
188
+				<li class="card-panel <?php echo ($requirements->check_xcloner_tmp_path(1) ? "teal" : "red")?> lighten-2" >
189
+					<?php echo __('Temporary Location', 'xcloner-backup-and-restore')?>: <span class="shorten_string"><?php echo $requirements->check_xcloner_tmp_path(); ?></span>
190 190
 				</li>
191 191
 				
192
-				<li class="card-panel <?php echo ($requirements->check_min_php_version(1)?"teal":"red")?> lighten-2" >
193
-					<?php echo __('PHP Version Check','xcloner-backup-and-restore')?>: <?php echo $requirements->check_min_php_version();?>
192
+				<li class="card-panel <?php echo ($requirements->check_min_php_version(1) ? "teal" : "red")?> lighten-2" >
193
+					<?php echo __('PHP Version Check', 'xcloner-backup-and-restore')?>: <?php echo $requirements->check_min_php_version(); ?>
194 194
 					( >= <?php echo $requirements->get_constant('min_php_version')?>)
195 195
 				</li>
196
-				<li class="card-panel <?php echo ($requirements->check_safe_mode(1)?"teal":"orange")?> lighten-2" >
197
-					<?php echo __('PHP Safe Mode','xcloner-backup-and-restore')?>: <?php echo $requirements->check_safe_mode();?>
196
+				<li class="card-panel <?php echo ($requirements->check_safe_mode(1) ? "teal" : "orange")?> lighten-2" >
197
+					<?php echo __('PHP Safe Mode', 'xcloner-backup-and-restore')?>: <?php echo $requirements->check_safe_mode(); ?>
198 198
 					( <?php echo $requirements->get_constant('safe_mode')?>)
199 199
 				</li>
200
-				<li class="card-panel <?php echo ($requirements->check_backup_ready_status()?"teal":"red")?> lighten-2">
201
-					<?php echo ($requirements->check_backup_ready_status()?__('BACKUP READY','xcloner-backup-and-restore'):__('Backup not ready, please check above requirements','xcloner-backup-and-restore'))?>
202
-					<i class="material-icons right tiny"><?php echo ($requirements->check_backup_ready_status()?'thumb_up':'thumb_down')?></i>
200
+				<li class="card-panel <?php echo ($requirements->check_backup_ready_status() ? "teal" : "red")?> lighten-2">
201
+					<?php echo ($requirements->check_backup_ready_status() ? __('BACKUP READY', 'xcloner-backup-and-restore') : __('Backup not ready, please check above requirements', 'xcloner-backup-and-restore'))?>
202
+					<i class="material-icons right tiny"><?php echo ($requirements->check_backup_ready_status() ? 'thumb_up' : 'thumb_down')?></i>
203 203
 				</li>
204 204
 		  </ul>
205 205
 		  <ul class="additional_system_info">
206 206
 				<li class="card-panel grey darken-1" >
207
-					<?php echo __('PHP max_execution_time','xcloner-backup-and-restore')?>: <?php echo $requirements->get_max_execution_time();?>
207
+					<?php echo __('PHP max_execution_time', 'xcloner-backup-and-restore')?>: <?php echo $requirements->get_max_execution_time(); ?>
208 208
 				</li>
209 209
 				<li class="card-panel grey darken-1" >
210
-					<?php echo __('PHP memory_limit','xcloner-backup-and-restore')?>: <?php echo $requirements->get_memory_limit();?>
210
+					<?php echo __('PHP memory_limit', 'xcloner-backup-and-restore')?>: <?php echo $requirements->get_memory_limit(); ?>
211 211
 				</li>
212 212
 				<li class="card-panel grey darken-1" >
213
-					<?php echo __('PHP open_basedir','xcloner-backup-and-restore')?>: <?php echo $requirements->get_open_basedir();?>
213
+					<?php echo __('PHP open_basedir', 'xcloner-backup-and-restore')?>: <?php echo $requirements->get_open_basedir(); ?>
214 214
 				</li>
215 215
 				<?php 
216 216
 				$data = array();
217
-				if($requirements->check_backup_ready_status())
217
+				if ($requirements->check_backup_ready_status())
218 218
 					$data = $xcloner_file_system->estimate_read_write_time();
219 219
 				?>
220 220
 				<li class="card-panel grey darken-1" >
221
-					<?php echo __('Reading Time 1MB Block','xcloner-backup-and-restore')?>: <?php echo (isset($data['reading_time'])?$data['reading_time']:__("unknown"));?>
221
+					<?php echo __('Reading Time 1MB Block', 'xcloner-backup-and-restore')?>: <?php echo (isset($data['reading_time']) ? $data['reading_time'] : __("unknown")); ?>
222 222
 				</li>
223 223
 				<li class="card-panel grey darken-1" >
224
-					<?php echo __('Writing Time 1MB Block','xcloner-backup-and-restore')?>: <?php echo (isset($data['writing_time'])?$data['writing_time']:__("unknown"));?>
224
+					<?php echo __('Writing Time 1MB Block', 'xcloner-backup-and-restore')?>: <?php echo (isset($data['writing_time']) ? $data['writing_time'] : __("unknown")); ?>
225 225
 				</li>
226 226
 				<li class="card-panel grey darken-1" >
227
-					<?php echo __('Free Disk Space','xcloner-backup-and-restore')?>: <?php echo $requirements->get_free_disk_space();;?>
227
+					<?php echo __('Free Disk Space', 'xcloner-backup-and-restore')?>: <?php echo $requirements->get_free_disk_space(); ;?>
228 228
 				</li>
229 229
 		  </ul>
230 230
 		</div>
231 231
 		<div class="card-action">
232
-		  <a class="waves-effect waves-light btn system_info_toggle blue darken-1"><i class="material-icons left">list</i><?php echo __('Toggle Additional System Info','xcloner-backup-and-restore')?></a>
232
+		  <a class="waves-effect waves-light btn system_info_toggle blue darken-1"><i class="material-icons left">list</i><?php echo __('Toggle Additional System Info', 'xcloner-backup-and-restore')?></a>
233 233
 		</div>
234 234
 	  </div>
235 235
 
Please login to merge, or discard this patch.
admin/partials/xcloner_restore_page.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-$xcloner_settings 		= $this->get_xcloner_container()->get_xcloner_settings();
4
-$logger					= $this->get_xcloner_container()->get_xcloner_logger();
5
-$xcloner_file_system 	= $this->get_xcloner_container()->get_xcloner_filesystem();
6
-$xcloner_file_transfer 	= $this->get_xcloner_container()->get_xcloner_file_transfer();
3
+$xcloner_settings = $this->get_xcloner_container()->get_xcloner_settings();
4
+$logger = $this->get_xcloner_container()->get_xcloner_logger();
5
+$xcloner_file_system = $this->get_xcloner_container()->get_xcloner_filesystem();
6
+$xcloner_file_transfer = $this->get_xcloner_container()->get_xcloner_file_transfer();
7 7
 
8
-$start = 0 ;
8
+$start = 0;
9 9
 
10 10
 $backup_list = $xcloner_file_system->get_latest_backups();
11 11
 
@@ -21,22 +21,22 @@  discard block
 block discarded – undo
21 21
 	<div class="col s12">
22 22
 		<ul class="collapsible xcloner-restore " data-collapsible="accordion">
23 23
 			<li data-step="1" class="restore-script-upload-step steps active show">
24
-				<div class="collapsible-header active"><i class="material-icons">settings_remote</i><?php echo __("Restore Script Upload",'xcloner-backup-and-restore')?></div>
24
+				<div class="collapsible-header active"><i class="material-icons">settings_remote</i><?php echo __("Restore Script Upload", 'xcloner-backup-and-restore')?></div>
25 25
 				<div class="collapsible-body row">
26 26
 						
27 27
 						<ul class="text-steps">
28
-							<li><?php echo __("Please download the restore script from",'xcloner-backup-and-restore')?> <a href='#' onclick="window.location=ajaxurl+'?action=download_restore_script&phar=true'"><strong><?php echo __("here",'xcloner-backup-and-restore')?></strong></a>
28
+							<li><?php echo __("Please download the restore script from", 'xcloner-backup-and-restore')?> <a href='#' onclick="window.location=ajaxurl+'?action=download_restore_script&phar=true'"><strong><?php echo __("here", 'xcloner-backup-and-restore')?></strong></a>
29 29
 							</li>	
30 30
 							<li>
31
-							<?php echo __("Extract the files on your new host",'xcloner-backup-and-restore')?>
31
+							<?php echo __("Extract the files on your new host", 'xcloner-backup-and-restore')?>
32 32
 							</li>
33 33
 							<li>
34
-							<?php echo __("Provide url below to the <u>xcloner_restore.php</u> restore script, like http://my_restore_site.com/xcloner_restore.php",'xcloner-backup-and-restore')?>
34
+							<?php echo __("Provide url below to the <u>xcloner_restore.php</u> restore script, like http://my_restore_site.com/xcloner_restore.php", 'xcloner-backup-and-restore')?>
35 35
 							</li>
36 36
 							<li>
37
-							<?php echo __("If your server is not web accessible, like a localhost computer, you can use a DynDNS service or install a blank copy of Wordpress with XCloner in the same environment and start the restore from there.",'xcloner-backup-and-restore')?>
37
+							<?php echo __("If your server is not web accessible, like a localhost computer, you can use a DynDNS service or install a blank copy of Wordpress with XCloner in the same environment and start the restore from there.", 'xcloner-backup-and-restore')?>
38 38
 							</li>
39
-							<?php if(is_ssl()):?>
39
+							<?php if (is_ssl()):?>
40 40
 							<li>
41 41
 								<?php echo __("We have detected your connection to the site as being secure, so your restore script address must start with https://.")?>
42 42
 							</li>
@@ -45,12 +45,12 @@  discard block
 block discarded – undo
45 45
 						</ul>	
46 46
 						
47 47
 						<div class="input-field col l9 s12">
48
-							<input value="<?php echo (is_ssl())?"https://":"http://"?>" id="restore_script_url" type="text" class="validate" placeholder="Url to XCloner Restore Script, example http://myddns.com/xcloner/xcloner_restore.php" >
48
+							<input value="<?php echo (is_ssl()) ? "https://" : "http://"?>" id="restore_script_url" type="text" class="validate" placeholder="Url to XCloner Restore Script, example http://myddns.com/xcloner/xcloner_restore.php" >
49 49
 							<label for="restore_script_url"></label>
50 50
 							<div id="url_validation_status" class="status"></div>
51 51
 				        </div>
52 52
 				        <div class="col l3 s12 right-align">
53
-							<button class="btn waves-effect waves-light" type="submit" id="validate_url" name="action"><?php echo __("Check",'xcloner-backup-and-restore')?>
53
+							<button class="btn waves-effect waves-light" type="submit" id="validate_url" name="action"><?php echo __("Check", 'xcloner-backup-and-restore')?>
54 54
 							    <i class="material-icons right">send</i>
55 55
 							</button>
56 56
 				        </div>
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
 			</li>
59 59
 			
60 60
 			<li data-step="2" class="backup-upload-step steps">
61
-				<div class="collapsible-header active"><i class="material-icons">file_upload</i><?php echo __("Upload Local Backup Archive To Remote Host",'xcloner-backup-and-restore')?>
61
+				<div class="collapsible-header active"><i class="material-icons">file_upload</i><?php echo __("Upload Local Backup Archive To Remote Host", 'xcloner-backup-and-restore')?>
62 62
 				</div>
63 63
 				<div class="collapsible-body row">
64
-					<p><?php echo __("You can skip this step if you want to transfer the archive in some other way, make sure you upload it in the same directory as the restore script from the previous step.",'xcloner-backup-and-restore')?></p>
64
+					<p><?php echo __("You can skip this step if you want to transfer the archive in some other way, make sure you upload it in the same directory as the restore script from the previous step.", 'xcloner-backup-and-restore')?></p>
65 65
 					<div class="input-field col s12 l7">
66 66
 						<select id="backup_file" name="backup_file" class="browser-default">
67
-					      <option value="" disabled selected><?php echo __("Please select a local backup archive to upload to remote host",'xcloner-backup-and-restore')?></option>
68
-					      <?php if(is_array($backup_list)):?>
69
-							<?php foreach($backup_list as $file):?>
67
+					      <option value="" disabled selected><?php echo __("Please select a local backup archive to upload to remote host", 'xcloner-backup-and-restore')?></option>
68
+					      <?php if (is_array($backup_list)):?>
69
+							<?php foreach ($backup_list as $file):?>
70 70
 								<option value="<?php echo $file['basename']?>">
71 71
 								<?php echo $file['basename']?> (<?php echo size_format($file['size'])?>)
72 72
 								</option>
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
 					</div>
83 83
 					<div class="col s12 l5 right-align">
84 84
 						<div class="toggler">
85
-							<button class="btn waves-effect waves-light upload-backup normal" type="submit" id="" name="action"><?php echo __("Upload",'xcloner-backup-and-restore')?>
85
+							<button class="btn waves-effect waves-light upload-backup normal" type="submit" id="" name="action"><?php echo __("Upload", 'xcloner-backup-and-restore')?>
86 86
 							    <i class="material-icons right">send</i>
87 87
 							</button>
88
-							<button class="btn waves-effect waves-light red upload-backup cancel" type="submit" id="" name="action"><?php echo __("Cancel",'xcloner-backup-and-restore')?>
88
+							<button class="btn waves-effect waves-light red upload-backup cancel" type="submit" id="" name="action"><?php echo __("Cancel", 'xcloner-backup-and-restore')?>
89 89
 							    <i class="material-icons right">close</i>
90 90
 							</button>
91 91
 						</div>
92
-						<button class="btn waves-effect waves-light grey" type="submit" title="<?php echo __("Skip Next",'xcloner-backup-and-restore')?>" id="skip_upload_backup" name="action"><?php echo __("Next",'xcloner-backup-and-restore')?>
92
+						<button class="btn waves-effect waves-light grey" type="submit" title="<?php echo __("Skip Next", 'xcloner-backup-and-restore')?>" id="skip_upload_backup" name="action"><?php echo __("Next", 'xcloner-backup-and-restore')?>
93 93
 						    <i class="material-icons right">navigate_next</i>
94 94
 						</button>
95 95
 					</div>
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 			</li>	
98 98
 			
99 99
 			<li data-step="3" class="restore-remote-backup-step steps active">
100
-				<div class="collapsible-header"><i class="material-icons">folder_open</i><?php echo __("Restore Files Backup Available On Remote Host",'xcloner-backup-and-restore')?>
100
+				<div class="collapsible-header"><i class="material-icons">folder_open</i><?php echo __("Restore Files Backup Available On Remote Host", 'xcloner-backup-and-restore')?>
101 101
 						<i class="material-icons right" title="Refresh Remote Backup Files List" id="refresh_remote_backup_file">cached</i>
102 102
 
103 103
 						<div class="switch right">
@@ -114,12 +114,12 @@  discard block
 block discarded – undo
114 114
 						<div class=" col s12 l7">
115 115
 							<div class="input-field row">
116 116
 								<input type="text" name="remote_restore_path" id="remote_restore_path" class="validate" placeholder="Restore Target Path">
117
-								<label><?php echo __("Remote Restore Target Path",'xcloner-backup-and-restore')?></label>
117
+								<label><?php echo __("Remote Restore Target Path", 'xcloner-backup-and-restore')?></label>
118 118
 							</div>
119 119
 							
120 120
 							<div class="input-field row">
121 121
 								<select id="remote_backup_file" name="remote_backup_file" class="browser-default">
122
-									<option value="" disabled selected><?php echo __("Please select the remote backup file to restore",'xcloner-backup-and-restore')?></option>
122
+									<option value="" disabled selected><?php echo __("Please select the remote backup file to restore", 'xcloner-backup-and-restore')?></option>
123 123
 							    </select>
124 124
 							    <label></label>
125 125
 							</div>
@@ -134,14 +134,14 @@  discard block
 block discarded – undo
134 134
 				       
135 135
 				        <div class="col s12 l5 right-align">
136 136
 							<div class="toggler">
137
-								<button class="btn waves-effect waves-light restore_remote_backup normal " type="submit" id="" name="action"><?php echo __("Restore",'xcloner-backup-and-restore')?>
137
+								<button class="btn waves-effect waves-light restore_remote_backup normal " type="submit" id="" name="action"><?php echo __("Restore", 'xcloner-backup-and-restore')?>
138 138
 								    <i class="material-icons right">send</i>
139 139
 								</button>
140
-								<button class="btn waves-effect waves-light red restore_remote_backup cancel" type="submit" id="" name="action"><?php echo __("Cancel",'xcloner-backup-and-restore')?>
140
+								<button class="btn waves-effect waves-light red restore_remote_backup cancel" type="submit" id="" name="action"><?php echo __("Cancel", 'xcloner-backup-and-restore')?>
141 141
 								    <i class="material-icons right">close</i>
142 142
 								</button>
143 143
 							</div>
144
-							<button class="btn waves-effect waves-light grey" type="submit" title="<?php echo __("Skip Next",'xcloner-backup-and-restore')?>" id="skip_remote_backup_step" name="action"><?php echo __("Next",'xcloner-backup-and-restore')?>
144
+							<button class="btn waves-effect waves-light grey" type="submit" title="<?php echo __("Skip Next", 'xcloner-backup-and-restore')?>" id="skip_remote_backup_step" name="action"><?php echo __("Next", 'xcloner-backup-and-restore')?>
145 145
 								<i class="material-icons right">navigate_next</i>
146 146
 							</button>
147 147
 				        </div>
@@ -149,71 +149,71 @@  discard block
 block discarded – undo
149 149
 			</li>
150 150
 			
151 151
 			<li data-step="4" class="restore-remote-database-step steps active">
152
-				<div class="collapsible-header"><i class="material-icons">list</i><?php echo __("Restore Remote Database - Search and Replace",'xcloner-backup-and-restore')?>
152
+				<div class="collapsible-header"><i class="material-icons">list</i><?php echo __("Restore Remote Database - Search and Replace", 'xcloner-backup-and-restore')?>
153 153
 					<i class="material-icons right" title="Refresh Database Backup Files List" id="refresh_database_file">cached</i>
154 154
 				</div>
155 155
 				<div class="collapsible-body row">
156 156
 						
157 157
 						<div class="col s12">
158
-							<a class="btn-floating tooltipped btn-small right" data-position="left" data-delay="50" data-tooltip="<?php echo __('Please provide below the mysql connection details for the remote host database.','xcloner-backup-and-restore')?>" data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a>	
159
-							<h5><?php echo __('Remote Mysql Details','xcloner-backup-and-restore')?></h5>
158
+							<a class="btn-floating tooltipped btn-small right" data-position="left" data-delay="50" data-tooltip="<?php echo __('Please provide below the mysql connection details for the remote host database.', 'xcloner-backup-and-restore')?>" data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a>	
159
+							<h5><?php echo __('Remote Mysql Details', 'xcloner-backup-and-restore')?></h5>
160 160
 						</div>						
161 161
 						<div class=" col s12">
162 162
 							<div class="input-field col s12 m6">
163 163
 								<input type="text" name="remote_mysql_host" id="remote_mysql_host" class="validate" placeholder="Remote Mysql Hostname" value="localhost">
164
-								<label><?php echo __("Remote Mysql Hostname",'xcloner-backup-and-restore')?></label>
164
+								<label><?php echo __("Remote Mysql Hostname", 'xcloner-backup-and-restore')?></label>
165 165
 							</div>
166 166
 							
167 167
 							<div class="input-field  col s12 m6">
168 168
 								<input type="text" name="remote_mysql_db" id="remote_mysql_db" class="validate" placeholder="Remote Mysql Database">
169
-								<label><?php echo __("Remote Mysql Database",'xcloner-backup-and-restore')?></label>
169
+								<label><?php echo __("Remote Mysql Database", 'xcloner-backup-and-restore')?></label>
170 170
 							</div>
171 171
 							
172 172
 							<div class="input-field  col s12 m6">
173 173
 								<input type="text" name="remote_mysql_user" id="remote_mysql_user" class="validate" placeholder="Remote Mysql Username">
174
-								<label><?php echo __("Remote Mysql Username",'xcloner-backup-and-restore')?></label>
174
+								<label><?php echo __("Remote Mysql Username", 'xcloner-backup-and-restore')?></label>
175 175
 							</div>
176 176
 							
177 177
 							
178 178
 							<div class="input-field  col s12 m6">
179 179
 								<input type="text" name="remote_mysql_pass" id="remote_mysql_pass" class="validate" placeholder="Remote Mysql Password">
180
-								<label><?php echo __("Remote Mysql Password",'xcloner-backup-and-restore')?></label>
180
+								<label><?php echo __("Remote Mysql Password", 'xcloner-backup-and-restore')?></label>
181 181
 							</div>
182 182
 							
183 183
 						</div>	
184 184
 						<div class="col s12">
185
-						<a class="btn-floating tooltipped btn-small right" data-position="left" data-delay="50" data-html="true" data-tooltip="<?php echo __('I will attempt to replace all mysql backup records matching the provided Source Url with the provided Target Url. <br />Leave blank the Target Url if you would like to skip this option. <br />As a bonus, I will also replace all matching serialized data and fix it\'s parsing.','xcloner-backup-and-restore')?>" data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a>	
186
-							<h5><?php echo __('Remote Mysql Search and Replace','xcloner-backup-and-restore')?></h5>
185
+						<a class="btn-floating tooltipped btn-small right" data-position="left" data-delay="50" data-html="true" data-tooltip="<?php echo __('I will attempt to replace all mysql backup records matching the provided Source Url with the provided Target Url. <br />Leave blank the Target Url if you would like to skip this option. <br />As a bonus, I will also replace all matching serialized data and fix it\'s parsing.', 'xcloner-backup-and-restore')?>" data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a>	
186
+							<h5><?php echo __('Remote Mysql Search and Replace', 'xcloner-backup-and-restore')?></h5>
187 187
 						</div>
188 188
 						<div class="col s12">  
189 189
 							<div class="input-field col s12 m6 ">
190
-									<input type="text" name="wp_home_url" id="wp_home_url" class="validate" placeholder="WP Home Url" value="<?php echo home_url();?>">
191
-									<label><?php echo __("Source Home Url",'xcloner-backup-and-restore')?></label>
190
+									<input type="text" name="wp_home_url" id="wp_home_url" class="validate" placeholder="WP Home Url" value="<?php echo home_url(); ?>">
191
+									<label><?php echo __("Source Home Url", 'xcloner-backup-and-restore')?></label>
192 192
 							</div>	
193 193
 							
194 194
 							<div class="input-field col s12 m6 ">
195 195
 									<input type="text" name="remote_restore_url" id="remote_restore_url" class="validate" placeholder="Restore Target Url">
196
-									<label><?php echo __("With Target Home Url",'xcloner-backup-and-restore')?></label>
196
+									<label><?php echo __("With Target Home Url", 'xcloner-backup-and-restore')?></label>
197 197
 							</div>
198 198
 						
199
-						<?php if( site_url() != home_url()) : ?>
199
+						<?php if (site_url() != home_url()) : ?>
200 200
 							<div class="input-field col s12 m6 ">
201
-									<input type="text" name="wp_site_url" id="wp_site_url" class="validate" placeholder="WP Site Url" value="<?php echo site_url();?>">
202
-									<label><?php echo __("Source Site Url",'xcloner-backup-and-restore')?></label>
201
+									<input type="text" name="wp_site_url" id="wp_site_url" class="validate" placeholder="WP Site Url" value="<?php echo site_url(); ?>">
202
+									<label><?php echo __("Source Site Url", 'xcloner-backup-and-restore')?></label>
203 203
 							</div>	
204 204
 							
205 205
 							<div class="input-field col s12 m6 ">
206 206
 									<input type="text" name="remote_restore_site_url" id="remote_restore_site_url" class="validate" placeholder="Restore Target Url">
207
-									<label><?php echo __("With Target Site Url",'xcloner-backup-and-restore')?></label>
207
+									<label><?php echo __("With Target Site Url", 'xcloner-backup-and-restore')?></label>
208 208
 							</div>
209 209
 						
210
-						<?php endif;?>
210
+						<?php endif; ?>
211 211
 						</div>
212 212
 						
213 213
 						<div class=" col s12 l7">
214 214
 							<div class="input-field row">
215 215
 								<select id="remote_database_file" name="remote_database_file" class="browser-default">
216
-									<option value="" disabled selected><?php echo __("Please select the remote database backup file to restore",'xcloner-backup-and-restore')?></option>
216
+									<option value="" disabled selected><?php echo __("Please select the remote database backup file to restore", 'xcloner-backup-and-restore')?></option>
217 217
 							    </select>
218 218
 							    
219 219
 							    <label></label>
@@ -232,15 +232,15 @@  discard block
 block discarded – undo
232 232
 				      
233 233
 				        <div class="col s12 l5 right-align">
234 234
 							<div class="toggler">
235
-								<button class="btn waves-effect waves-light restore_remote_mysqldump normal " type="submit" id="" name="action"><?php echo __("Restore",'xcloner-backup-and-restore')?>
235
+								<button class="btn waves-effect waves-light restore_remote_mysqldump normal " type="submit" id="" name="action"><?php echo __("Restore", 'xcloner-backup-and-restore')?>
236 236
 								    <i class="material-icons right">send</i>
237 237
 								</button>
238
-								<button class="btn waves-effect waves-light red restore_remote_mysqldump cancel" type="submit" id="" name="action"><?php echo __("Cancel",'xcloner-backup-and-restore')?>
238
+								<button class="btn waves-effect waves-light red restore_remote_mysqldump cancel" type="submit" id="" name="action"><?php echo __("Cancel", 'xcloner-backup-and-restore')?>
239 239
 								    <i class="material-icons right">close</i>
240 240
 								</button>
241 241
 							</div>
242 242
 							
243
-							<button class="btn waves-effect waves-light grey" type="submit" title="<?php echo __("Skip Next",'xcloner-backup-and-restore')?>" id="skip_restore_remote_database_step" name="action"><?php echo __("Next",'xcloner-backup-and-restore')?>
243
+							<button class="btn waves-effect waves-light grey" type="submit" title="<?php echo __("Skip Next", 'xcloner-backup-and-restore')?>" id="skip_restore_remote_database_step" name="action"><?php echo __("Next", 'xcloner-backup-and-restore')?>
244 244
 								<i class="material-icons right">navigate_next</i>
245 245
 							</button>
246 246
 							
@@ -250,13 +250,13 @@  discard block
 block discarded – undo
250 250
 			</li>
251 251
 			
252 252
 			<li data-step="5" class="restore-finish-step steps active">
253
-				<div class="collapsible-header"><i class="material-icons">folder_open</i><?php echo __("Finishing up...",'xcloner-backup-and-restore')?>
253
+				<div class="collapsible-header"><i class="material-icons">folder_open</i><?php echo __("Finishing up...", 'xcloner-backup-and-restore')?>
254 254
 				</div>
255 255
 				<div class="collapsible-body row">
256 256
 						
257 257
 						<div class="row">
258 258
 							<div class="col s4">
259
-								<label><?php echo __("Update wp-config.php mysql details and update the restored site Url",'xcloner-backup-and-restore')?></label>
259
+								<label><?php echo __("Update wp-config.php mysql details and update the restored site Url", 'xcloner-backup-and-restore')?></label>
260 260
 							</div>
261 261
 							
262 262
 							<div class="col s8">
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 						
274 274
 						<div class="row">
275 275
 							<div class="col s4">
276
-								<label><?php echo __("Delete Restored Backup Temporary Folder",'xcloner-backup-and-restore')?></label>
276
+								<label><?php echo __("Delete Restored Backup Temporary Folder", 'xcloner-backup-and-restore')?></label>
277 277
 							</div>
278 278
 							<div class="col s8">
279 279
 								<div class="switch">
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 						
290 290
 						<div class="row">
291 291
 							<div class="col s4">
292
-								<label><?php echo __("Delete Restore Script",'xcloner-backup-and-restore')?></label>
292
+								<label><?php echo __("Delete Restore Script", 'xcloner-backup-and-restore')?></label>
293 293
 							</div>
294 294
 							<div class="col s8">
295 295
 								<div class="switch">
@@ -308,15 +308,15 @@  discard block
 block discarded – undo
308 308
 				        </div>
309 309
 				        
310 310
 						<div class=" row col s12 center-align" id="xcloner_restore_finish">
311
-							<h5><?php echo __("Thank you for using XCloner.",'xcloner-backup-and-restore')?></h5>
312
-							<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" target="_blank">Wordpress XCloner forums</a>') ?></h6>
311
+							<h5><?php echo __("Thank you for using XCloner.", 'xcloner-backup-and-restore')?></h5>
312
+							<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" target="_blank">Wordpress XCloner forums</a>') ?></h6>
313 313
 							<a class="twitter-follow-button" href="https://twitter.com/thinkovi" data-show-count="false">Follow @thinkovi</a>
314 314
 							<script src="//platform.twitter.com/widgets.js" async="" charset="utf-8"></script>
315 315
 				        </div>
316 316
 				        
317 317
 				        <div class="col s12 center-align">
318 318
 
319
-							<button class="btn waves-effect waves-light teal" type="submit" id="restore_finish" name="action"><?php echo __("Finish",'xcloner-backup-and-restore')?>
319
+							<button class="btn waves-effect waves-light teal" type="submit" id="restore_finish" name="action"><?php echo __("Finish", 'xcloner-backup-and-restore')?>
320 320
 								<i class="material-icons right">navigate_next</i>
321 321
 							</button>
322 322
 				        </div>
Please login to merge, or discard this patch.
admin/class-xcloner-admin.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
 	 * @param      string    $plugin_name       The name of this plugin.
49 49
 	 * @param      string    $version    The version of this plugin.
50 50
 	 */
51
-	public function __construct( Xcloner $xcloner_container) {
51
+	public function __construct(Xcloner $xcloner_container) {
52 52
 
53
-		$this->plugin_name 			= $xcloner_container->get_plugin_name();
54
-		$this->version				= $xcloner_container->get_version();
55
-		$this->xcloner_container 	= $xcloner_container;
53
+		$this->plugin_name = $xcloner_container->get_plugin_name();
54
+		$this->version = $xcloner_container->get_version();
55
+		$this->xcloner_container = $xcloner_container;
56 56
 	}
57 57
 	
58 58
 	public function get_xcloner_container()
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 */
68 68
 	public function enqueue_styles($hook) {
69 69
 		
70
-		if(!stristr($hook, "page_".$this->plugin_name) || (isset($_GET['option']) and $_GET['option']=="com_cloner"))
70
+		if (!stristr($hook, "page_".$this->plugin_name) || (isset($_GET['option']) and $_GET['option'] == "com_cloner"))
71 71
 			return;
72 72
 
73 73
 		/**
@@ -82,13 +82,13 @@  discard block
 block discarded – undo
82 82
 		 * class.
83 83
 		 */
84 84
 
85
-		wp_enqueue_style( $this->plugin_name."_materialize", plugin_dir_url( __FILE__ ) . 'css/materialize.min.css', array(), $this->version, 'all' );
86
-		wp_enqueue_style( $this->plugin_name."_materialize.clockpicker", plugin_dir_url( __FILE__ ) . 'css/materialize.clockpicker.css', array(), $this->version, 'all' );
87
-		wp_enqueue_style( $this->plugin_name."_materialize.icons", '//fonts.googleapis.com/icon?family=Material+Icons', array(), $this->version, 'all' );
88
-		wp_enqueue_style( $this->plugin_name."_jquery.datatables", plugin_dir_url( __FILE__ ) . 'css/jquery.dataTables.min.css', array(), $this->version, 'all' );
89
-		wp_enqueue_style( $this->plugin_name."_jquery.datatables.responsive", plugin_dir_url( __FILE__ ) . 'css/responsive.dataTables.css', array(), $this->version, 'all' );
90
-		wp_enqueue_style( $this->plugin_name."_jstree", dirname(plugin_dir_url( __FILE__ )) . '/vendor/vakata/jstree/dist/themes/default/style.min.css', array(), '3.3', 'all' );
91
-		wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/xcloner-admin.css', array(), $this->version, 'all' );
85
+		wp_enqueue_style($this->plugin_name."_materialize", plugin_dir_url(__FILE__).'css/materialize.min.css', array(), $this->version, 'all');
86
+		wp_enqueue_style($this->plugin_name."_materialize.clockpicker", plugin_dir_url(__FILE__).'css/materialize.clockpicker.css', array(), $this->version, 'all');
87
+		wp_enqueue_style($this->plugin_name."_materialize.icons", '//fonts.googleapis.com/icon?family=Material+Icons', array(), $this->version, 'all');
88
+		wp_enqueue_style($this->plugin_name."_jquery.datatables", plugin_dir_url(__FILE__).'css/jquery.dataTables.min.css', array(), $this->version, 'all');
89
+		wp_enqueue_style($this->plugin_name."_jquery.datatables.responsive", plugin_dir_url(__FILE__).'css/responsive.dataTables.css', array(), $this->version, 'all');
90
+		wp_enqueue_style($this->plugin_name."_jstree", dirname(plugin_dir_url(__FILE__)).'/vendor/vakata/jstree/dist/themes/default/style.min.css', array(), '3.3', 'all');
91
+		wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__).'css/xcloner-admin.css', array(), $this->version, 'all');
92 92
 
93 93
 	}
94 94
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 */
100 100
 	public function enqueue_scripts($hook) {
101 101
 
102
-		if(!stristr($hook, "page_".$this->plugin_name))
102
+		if (!stristr($hook, "page_".$this->plugin_name))
103 103
 			return;
104 104
 			
105 105
 		/**
@@ -117,17 +117,17 @@  discard block
 block discarded – undo
117 117
 		add_thickbox();
118 118
 		wp_enqueue_script('plugin-install');
119 119
 		wp_enqueue_script('updates');
120
-		wp_enqueue_script( $this->plugin_name."_materialize", plugin_dir_url( __FILE__ ) . 'js/materialize.min.js', array( 'jquery' ), $this->version, false );
121
-		wp_enqueue_script( $this->plugin_name."_materialize.clockpicker", plugin_dir_url( __FILE__ ) . 'js/materialize.clockpicker.js', array( 'jquery' ), $this->version, false );
122
-		wp_enqueue_script( $this->plugin_name."_jquery.datatables", plugin_dir_url( __FILE__ ) . 'js/jquery.dataTables.min.js', array( 'jquery' ), $this->version, false );
123
-		wp_enqueue_script( $this->plugin_name."_jquery.datatables.respnsive", plugin_dir_url( __FILE__ ) . 'js/dataTables.responsive.js', array( 'jquery' ), $this->version, false );
124
-		wp_enqueue_script( $this->plugin_name."_vakata", dirname(plugin_dir_url( __FILE__ )) . '/vendor/vakata/jstree/dist/jstree.min.js', array( 'jquery' ), '3.3', false );
125
-		wp_enqueue_script( $this->plugin_name."_xcloner-backup-class", plugin_dir_url( __FILE__ ) . 'js/xcloner-backup-class.js', array( 'jquery' ), $this->version, false );
126
-		wp_enqueue_script( $this->plugin_name."_xcloner-scheduler-class", plugin_dir_url( __FILE__ ) . 'js/xcloner-scheduler-class.js', array( 'jquery' ), $this->version, false );
127
-		wp_enqueue_script( $this->plugin_name."_xcloner-restore-class", plugin_dir_url( __FILE__ ) . 'js/xcloner-restore-class.js', array( 'jquery' ), $this->version, false );
128
-		wp_enqueue_script( $this->plugin_name."_xcloner-manage-backups-class", plugin_dir_url( __FILE__ ) . 'js/xcloner-manage-backups-class.js', array( 'jquery' ), $this->version, false );
129
-		wp_enqueue_script( $this->plugin_name."_xcloner-remote-storage-class", plugin_dir_url( __FILE__ ) . 'js/xcloner-remote-storage-class.js', array( 'jquery' ), $this->version, false );
130
-		wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/xcloner-admin.js', array( 'jquery' ), $this->version, false );
120
+		wp_enqueue_script($this->plugin_name."_materialize", plugin_dir_url(__FILE__).'js/materialize.min.js', array('jquery'), $this->version, false);
121
+		wp_enqueue_script($this->plugin_name."_materialize.clockpicker", plugin_dir_url(__FILE__).'js/materialize.clockpicker.js', array('jquery'), $this->version, false);
122
+		wp_enqueue_script($this->plugin_name."_jquery.datatables", plugin_dir_url(__FILE__).'js/jquery.dataTables.min.js', array('jquery'), $this->version, false);
123
+		wp_enqueue_script($this->plugin_name."_jquery.datatables.respnsive", plugin_dir_url(__FILE__).'js/dataTables.responsive.js', array('jquery'), $this->version, false);
124
+		wp_enqueue_script($this->plugin_name."_vakata", dirname(plugin_dir_url(__FILE__)).'/vendor/vakata/jstree/dist/jstree.min.js', array('jquery'), '3.3', false);
125
+		wp_enqueue_script($this->plugin_name."_xcloner-backup-class", plugin_dir_url(__FILE__).'js/xcloner-backup-class.js', array('jquery'), $this->version, false);
126
+		wp_enqueue_script($this->plugin_name."_xcloner-scheduler-class", plugin_dir_url(__FILE__).'js/xcloner-scheduler-class.js', array('jquery'), $this->version, false);
127
+		wp_enqueue_script($this->plugin_name."_xcloner-restore-class", plugin_dir_url(__FILE__).'js/xcloner-restore-class.js', array('jquery'), $this->version, false);
128
+		wp_enqueue_script($this->plugin_name."_xcloner-manage-backups-class", plugin_dir_url(__FILE__).'js/xcloner-manage-backups-class.js', array('jquery'), $this->version, false);
129
+		wp_enqueue_script($this->plugin_name."_xcloner-remote-storage-class", plugin_dir_url(__FILE__).'js/xcloner-remote-storage-class.js', array('jquery'), $this->version, false);
130
+		wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__).'js/xcloner-admin.js', array('jquery'), $this->version, false);
131 131
 		
132 132
 
133 133
 	}
@@ -145,19 +145,19 @@  discard block
 block discarded – undo
145 145
 		
146 146
 		$_POST['action'] = $xcloner_sanitization->sanitize_input_as_string($_POST['action']);
147 147
 		
148
-		if(isset($_POST['action']))
148
+		if (isset($_POST['action']))
149 149
 		{
150 150
 			$remote_storage->save($_POST['action']);
151 151
 		}
152 152
 		
153
-		if(isset($_POST['authentification_code']) && $_POST['authentification_code'] != "")
153
+		if (isset($_POST['authentification_code']) && $_POST['authentification_code'] != "")
154 154
 		{
155 155
 			$_POST['authentification_code'] = $xcloner_sanitization->sanitize_input_as_string($_POST['authentification_code']);
156 156
 			
157 157
 			$remote_storage->set_access_token($_POST['authentification_code']);
158 158
 		}
159 159
 			
160
-		if(isset($_POST['connection_check']) && $_POST['connection_check'])
160
+		if (isset($_POST['connection_check']) && $_POST['connection_check'])
161 161
 		{
162 162
 			$remote_storage->check($_POST['action']);
163 163
 		}
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 	{
171 171
 		$requirements = $this->xcloner_container->get_xcloner_requirements();
172 172
 		
173
-		if(!$requirements->check_backup_ready_status())
173
+		if (!$requirements->check_backup_ready_status())
174 174
 		{
175 175
 			require_once("partials/xcloner_init_page.php");
176 176
 			return false;
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 	{
203 203
 		$requirements = $this->xcloner_container->get_xcloner_requirements();
204 204
 		
205
-		if(!$requirements->check_backup_ready_status())
205
+		if (!$requirements->check_backup_ready_status())
206 206
 		{
207 207
 			require_once("partials/xcloner_init_page.php");
208 208
 			return false;
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
 	    <?php
236 236
 			$xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization();
237 237
 			
238
-            if( isset( $_GET[ 'tab' ] ) ) {
239
-                $active_tab = $xcloner_sanitization->sanitize_input_as_string($_GET[ 'tab' ]);
238
+            if (isset($_GET['tab'])) {
239
+                $active_tab = $xcloner_sanitization->sanitize_input_as_string($_GET['tab']);
240 240
             } // end if
241
-            else{
241
+            else {
242 242
 				$active_tab = "general_options";
243 243
 			}
244 244
             
@@ -257,20 +257,20 @@  discard block
 block discarded – undo
257 257
 	        <form action="options.php" method="post">
258 258
 	            <?php
259 259
 				
260
-				if( $active_tab == 'general_options' ) {
260
+				if ($active_tab == 'general_options') {
261 261
 					
262 262
 					settings_fields('xcloner_general_settings_group');
263 263
 					do_settings_sections('xcloner_settings_page');
264 264
 					
265
-				}elseif( $active_tab == 'mysql_options' ) {
265
+				}elseif ($active_tab == 'mysql_options') {
266 266
 					
267 267
 					settings_fields('xcloner_mysql_settings_group');
268 268
 					do_settings_sections('xcloner_mysql_settings_page');
269
-				}elseif( $active_tab == 'system_options' ) {
269
+				}elseif ($active_tab == 'system_options') {
270 270
 					
271 271
 					settings_fields('xcloner_system_settings_group');
272 272
 					do_settings_sections('xcloner_system_settings_page');
273
-				}elseif( $active_tab == 'cleanup_options' ) {
273
+				}elseif ($active_tab == 'cleanup_options') {
274 274
 					
275 275
 					settings_fields('xcloner_cleanup_settings_group');
276 276
 					do_settings_sections('xcloner_cleanup_settings_page');
Please login to merge, or discard this patch.
includes/class-xcloner-remote-storage.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 use Sabre\DAV\Client as SabreClient;
22 22
 use League\Flysystem\WebDAV\WebDAVAdapter;
23 23
 
24
-class Xcloner_Remote_Storage{
24
+class Xcloner_Remote_Storage {
25 25
 	
26
-	private $gdrive_app_name 		= "XCloner Backup and Restore";
26
+	private $gdrive_app_name = "XCloner Backup and Restore";
27 27
 	
28 28
 	private $storage_fields = array(
29 29
 					"option_prefix" => "xcloner_",
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 	{
134 134
 		$this->xcloner_sanitization 	= $xcloner_container->get_xcloner_sanitization();
135 135
 		$this->xcloner_file_system 		= $xcloner_container->get_xcloner_filesystem();
136
-		$this->logger 					= $xcloner_container->get_xcloner_logger()->withName("xcloner_remote_storage");
137
-		$this->xcloner 					= $xcloner_container;
136
+		$this->logger = $xcloner_container->get_xcloner_logger()->withName("xcloner_remote_storage");
137
+		$this->xcloner = $xcloner_container;
138 138
 	}
139 139
 	
140 140
 	private function get_xcloner_container()
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 	public function get_available_storages()
146 146
 	{
147 147
 		$return = array();
148
-		foreach($this->storage_fields as $storage=>$data)
148
+		foreach ($this->storage_fields as $storage=>$data)
149 149
 		{
150 150
 			$check_field = $this->storage_fields["option_prefix"].$storage."_enable";
151
-			if(get_option($check_field))
151
+			if (get_option($check_field))
152 152
 				$return[$storage] = $data['text'];
153 153
 		}
154 154
 		
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	
158 158
 	public function save($action = "ftp")
159 159
 	{
160
-		if(!$action)
160
+		if (!$action)
161 161
 		{
162 162
 			return false;
163 163
 		}
@@ -165,17 +165,17 @@  discard block
 block discarded – undo
165 165
 		$storage = $this->xcloner_sanitization->sanitize_input_as_string($action);
166 166
 		$this->logger->debug(sprintf("Saving the remote storage %s options", strtoupper($action)));	
167 167
 		
168
-		if(is_array($this->storage_fields[$storage]))
168
+		if (is_array($this->storage_fields[$storage]))
169 169
 		{
170
-			foreach($this->storage_fields[$storage] as $field=>$validation)
170
+			foreach ($this->storage_fields[$storage] as $field=>$validation)
171 171
 			{
172 172
 				$check_field = $this->storage_fields["option_prefix"].$field;
173 173
 				$sanitize_method = "sanitize_input_as_".$validation;
174 174
 				
175
-				if(!isset($_POST[$check_field]))
175
+				if (!isset($_POST[$check_field]))
176 176
 					$_POST[$check_field] = 0;
177 177
 				
178
-				if(!method_exists($this->xcloner_sanitization, $sanitize_method))
178
+				if (!method_exists($this->xcloner_sanitization, $sanitize_method))
179 179
 					$sanitize_method = "sanitize_input_as_string";
180 180
 					
181 181
 				$sanitized_value = $this->xcloner_sanitization->$sanitize_method($_POST[$check_field]);
@@ -189,11 +189,11 @@  discard block
 block discarded – undo
189 189
 	
190 190
 	public function check($action = "ftp")
191 191
 	{
192
-		try{
192
+		try {
193 193
 			$this->verify_filesystem($action);
194 194
 			$this->xcloner->trigger_message(__("%s connection is valid.", 'xcloner-backup-and-restore'), "success", ucfirst($action));
195 195
 			$this->logger->debug(sprintf("Connection to remote storage %s is valid", strtoupper($action)));	
196
-		}catch(Exception $e){
196
+		}catch (Exception $e) {
197 197
 			$this->xcloner->trigger_message("%s connection error: ".$e->getMessage(), "error", ucfirst($action));
198 198
 		}
199 199
 	}
@@ -204,35 +204,35 @@  discard block
 block discarded – undo
204 204
 		
205 205
 		$this->logger->info(sprintf("Checking validity of the remote storage %s filesystem", strtoupper($storage_type)));	
206 206
 		
207
-		if(!method_exists($this, $method))
207
+		if (!method_exists($this, $method))
208 208
 			return false;
209 209
 		
210 210
 		list($adapter, $filesystem) = $this->$method();
211 211
 		
212 212
 		$test_file = substr(".xcloner_".md5(time()), 0, 15);
213 213
 		
214
-		if($storage_type == "gdrive")
214
+		if ($storage_type == "gdrive")
215 215
 		{
216
-			if(!is_array($filesystem->listContents()))
217
-				throw new Exception(__("Could not read data",'xcloner-backup-and-restore'));
216
+			if (!is_array($filesystem->listContents()))
217
+				throw new Exception(__("Could not read data", 'xcloner-backup-and-restore'));
218 218
 			$this->logger->debug(sprintf("I can list data from remote storage %s", strtoupper($storage_type)));	
219 219
 			
220 220
 			return true;
221 221
 		}
222 222
 			
223 223
 		//testing write access
224
-		if(!$filesystem->write($test_file, "data"))
225
-			throw new Exception(__("Could not write data",'xcloner-backup-and-restore'));
224
+		if (!$filesystem->write($test_file, "data"))
225
+			throw new Exception(__("Could not write data", 'xcloner-backup-and-restore'));
226 226
 		$this->logger->debug(sprintf("I can write data to remote storage %s", strtoupper($storage_type)));	
227 227
 		
228 228
 		//testing read access
229
-		if(!$filesystem->read($test_file))
230
-			throw new Exception(__("Could not read data",'xcloner-backup-and-restore'));
229
+		if (!$filesystem->read($test_file))
230
+			throw new Exception(__("Could not read data", 'xcloner-backup-and-restore'));
231 231
 		$this->logger->debug(sprintf("I can read data to remote storage %s", strtoupper($storage_type)));		
232 232
 		
233 233
 		//delete test file
234
-		if(!$filesystem->delete($test_file))
235
-			throw new Exception(__("Could not delete data",'xcloner-backup-and-restore'));
234
+		if (!$filesystem->delete($test_file))
235
+			throw new Exception(__("Could not delete data", 'xcloner-backup-and-restore'));
236 236
 		$this->logger->debug(sprintf("I can delete data to remote storage %s", strtoupper($storage_type)));		
237 237
 		
238 238
 		return true;
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	
241 241
 	public function upload_backup_to_storage($file, $storage)
242 242
 	{
243
-		if(!$this->xcloner_file_system->get_storage_filesystem()->has($file))
243
+		if (!$this->xcloner_file_system->get_storage_filesystem()->has($file))
244 244
 		{
245 245
 			$this->logger->info(sprintf("File not found %s in local storage", $file));
246 246
 			return false;
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 			
249 249
 		$method = "get_".$storage."_filesystem";	
250 250
 		
251
-		if(!method_exists($this, $method))
251
+		if (!method_exists($this, $method))
252 252
 			return false;
253 253
 			
254 254
 		list($remote_storage_adapter, $remote_storage_filesystem) = $this->$method();
@@ -266,22 +266,22 @@  discard block
 block discarded – undo
266 266
 		
267 267
 		$backup_file_stream = $this->xcloner_file_system->get_storage_filesystem()->readStream($file);
268 268
 
269
-		if(!$remote_storage_filesystem->writeStream($file, $backup_file_stream))
269
+		if (!$remote_storage_filesystem->writeStream($file, $backup_file_stream))
270 270
 		{
271 271
 			$this->logger->info(sprintf("Could not transfer file %s", $file));
272 272
 			return false;
273 273
 		}
274 274
 		
275
-		if($this->xcloner_file_system->is_multipart($file))
275
+		if ($this->xcloner_file_system->is_multipart($file))
276 276
 		{
277 277
 			$parts = $this->xcloner_file_system->get_multipart_files($file);
278
-			if(is_array($parts))
279
-				foreach($parts as $part_file)
278
+			if (is_array($parts))
279
+				foreach ($parts as $part_file)
280 280
 				{
281 281
 					$this->logger->info(sprintf("Transferring backup %s to remote storage %s", $part_file, strtoupper($storage)), array(""));
282 282
 					
283 283
 					$backup_file_stream = $this->xcloner_file_system->get_storage_filesystem()->readStream($part_file);
284
-					if(!$remote_storage_filesystem->writeStream($part_file, $backup_file_stream))
284
+					if (!$remote_storage_filesystem->writeStream($part_file, $backup_file_stream))
285 285
 						return false;
286 286
 				}
287 287
 		}
@@ -298,18 +298,18 @@  discard block
 block discarded – undo
298 298
 		
299 299
 		$target_filename = $file;
300 300
 		
301
-		if(!method_exists($this, $method))
301
+		if (!method_exists($this, $method))
302 302
 			return false;
303 303
 			
304 304
 		list($remote_storage_adapter, $remote_storage_filesystem) = $this->$method();
305 305
 		
306
-		if(!$remote_storage_filesystem->has($file))
306
+		if (!$remote_storage_filesystem->has($file))
307 307
 		{
308 308
 			$this->logger->info(sprintf("File not found %s in remote storage %s", $file, strtoupper($storage)));
309 309
 			return false;
310 310
 		}
311 311
 		
312
-		if($storage == "gdrive")
312
+		if ($storage == "gdrive")
313 313
 		{
314 314
 			$metadata = $remote_storage_filesystem->getMetadata($file);
315 315
 			$target_filename = $metadata['filename'].".".$metadata['extension'];
@@ -319,22 +319,22 @@  discard block
 block discarded – undo
319 319
 		
320 320
 		$backup_file_stream = $remote_storage_filesystem->readStream($file);
321 321
 
322
-		if(!$this->xcloner_file_system->get_storage_filesystem()->writeStream($target_filename, $backup_file_stream))
322
+		if (!$this->xcloner_file_system->get_storage_filesystem()->writeStream($target_filename, $backup_file_stream))
323 323
 		{
324 324
 			$this->logger->info(sprintf("Could not transfer file %s", $file));
325 325
 			return false;
326 326
 		}
327 327
 		
328
-		if($this->xcloner_file_system->is_multipart($target_filename))
328
+		if ($this->xcloner_file_system->is_multipart($target_filename))
329 329
 		{
330 330
 			$parts = $this->xcloner_file_system->get_multipart_files($file, $storage);
331
-			if(is_array($parts))
332
-				foreach($parts as $part_file)
331
+			if (is_array($parts))
332
+				foreach ($parts as $part_file)
333 333
 				{
334 334
 					$this->logger->info(sprintf("Transferring backup %s to local storage from %s storage", $part_file, strtoupper($storage)), array(""));
335 335
 					
336 336
 					$backup_file_stream = $remote_storage_filesystem->readStream($part_file);
337
-					if(!$this->xcloner_file_system->get_storage_filesystem()->writeStream($part_file, $backup_file_stream))
337
+					if (!$this->xcloner_file_system->get_storage_filesystem()->writeStream($part_file, $backup_file_stream))
338 338
 						return false;
339 339
 				}
340 340
 		}
@@ -348,19 +348,19 @@  discard block
 block discarded – undo
348 348
 	public function clean_remote_storage($storage, $remote_storage_filesystem)
349 349
 	{
350 350
 		$check_field = $this->storage_fields["option_prefix"].$storage."_cleanup_days";
351
-		if($expire_days = get_option($check_field))
351
+		if ($expire_days = get_option($check_field))
352 352
 		{
353 353
 			$this->logger->info(sprintf("Doing %s remote storage cleanup for %s days limit", strtoupper($storage), $expire_days));
354 354
 			$files = $remote_storage_filesystem->listContents();
355 355
 			
356 356
 			$current_timestamp = strtotime("-".$expire_days." days");
357 357
 			
358
-			if(is_array($files))
359
-			foreach($files as $file)
358
+			if (is_array($files))
359
+			foreach ($files as $file)
360 360
 			{
361 361
 				$file['timestamp'] = $remote_storage_filesystem->getTimestamp($file['path']);
362 362
 				
363
-				if($current_timestamp >= $file['timestamp'])
363
+				if ($current_timestamp >= $file['timestamp'])
364 364
 				{
365 365
 					$remote_storage_filesystem->delete($file['path']);
366 366
 					$this->logger->info("Deleting remote file ".$file['path']." matching rule", array("RETENTION LIMIT TIMESTAMP", $file['timestamp']." =< ".$expire_days));
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 	{
499 499
 
500 500
 		//if((function_exists("is_plugin_active") && !is_plugin_active("xcloner-google-drive/xcloner-google-drive.php")) || !file_exists(__DIR__ . "/../../xcloner-google-drive/vendor/autoload.php"))
501
-		if(!class_exists('Google_Client'))
501
+		if (!class_exists('Google_Client'))
502 502
 		{
503 503
 			return false;
504 504
 		}
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 	{
525 525
 		$client = $this->gdrive_construct();
526 526
 		
527
-		if(!$client)
527
+		if (!$client)
528 528
 			return false;
529 529
 			
530 530
 		return $authUrl = $client->createAuthUrl();
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 	{
535 535
 		$client = $this->gdrive_construct();
536 536
 		
537
-		if(!$client)
537
+		if (!$client)
538 538
 		{
539 539
 			$error_msg = "Could not initialize the Google Drive Class, please check that the xcloner-google-drive plugin is enabled...";
540 540
 			$this->logger->error($error_msg);
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 		update_option("xcloner_gdrive_access_token", $token['access_token']);
548 548
 		update_option("xcloner_gdrive_refresh_token", $token['refresh_token']);
549 549
 		
550
-		$redirect_url = ('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']."?page=xcloner_remote_storage_page#gdrive");
550
+		$redirect_url = ('http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?page=xcloner_remote_storage_page#gdrive");
551 551
 		
552 552
 		?>
553 553
 		<script>
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
 		
573 573
 		$client = $this->gdrive_construct();
574 574
 		
575
-		if(!$client)
575
+		if (!$client)
576 576
 		{
577 577
 			$error_msg = "Could not initialize the Google Drive Class, please check that the xcloner-google-drive plugin is enabled...";
578 578
 			$this->logger->error($error_msg);
@@ -584,18 +584,18 @@  discard block
 block discarded – undo
584 584
 		$service = new \Google_Service_Drive($client);
585 585
 		
586 586
 		$parent = 'root';
587
-		$dir = basename( get_option("xcloner_gdrive_target_folder"));
587
+		$dir = basename(get_option("xcloner_gdrive_target_folder"));
588 588
 		
589 589
 		$folderID = get_option("xcloner_gdrive_target_folder");
590 590
 		
591 591
 		$tmp = parse_url($folderID);
592 592
 		
593
-		if(isset($tmp['query']))
593
+		if (isset($tmp['query']))
594 594
 		{
595 595
 			$folderID = str_replace("id=", "", $tmp['query']);
596 596
 		}
597 597
 		
598
-		if(stristr($folderID, "/"))
598
+		if (stristr($folderID, "/"))
599 599
 		{
600 600
 			$query = sprintf('mimeType = \'application/vnd.google-apps.folder\' and \'%s\' in parents and name contains \'%s\'', $parent, $dir);
601 601
 			$response = $service->files->listFiles([
@@ -603,12 +603,12 @@  discard block
 block discarded – undo
603 603
 	                'q' => $query
604 604
 	            ]);
605 605
 			
606
-			if(sizeof($response))
606
+			if (sizeof($response))
607 607
 			{
608 608
 				foreach ($response as $obj) {
609
-					$folderID =  $obj->getId();
609
+					$folderID = $obj->getId();
610 610
 				}
611
-			}else{
611
+			} else {
612 612
 				$this->xcloner->trigger_message(sprintf(__("Could not find folder ID by name %s", 'xcloner-backup-and-restore'), $folderID), "error");
613 613
 			}
614 614
 		}
Please login to merge, or discard this patch.
includes/class-xcloner.php 1 patch
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -148,15 +148,15 @@  discard block
 block discarded – undo
148 148
 		return $this->xcloner_file_transfer;
149 149
 	}
150 150
 	
151
-	public function check_dependencies(){
151
+	public function check_dependencies() {
152 152
 		
153 153
 		$backup_storage_path = realpath(__DIR__.DS."..".DS."..".DS."..").DS."backups".DS;
154 154
 		
155 155
 		define("XCLONER_STORAGE_PATH", realpath($backup_storage_path));
156 156
 
157
-		if(!is_dir($backup_storage_path))
157
+		if (!is_dir($backup_storage_path))
158 158
 		{
159
-			if(!@mkdir($backup_storage_path))
159
+			if (!@mkdir($backup_storage_path))
160 160
 			{
161 161
 				$status = "error";
162 162
 				$message = sprintf(__("Unable to create the Backup Storage Location Folder %s . Please fix this before starting the backup process."), $backup_storage_path);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 				return;
165 165
 			}
166 166
 		}	
167
-		if(!is_writable($backup_storage_path))
167
+		if (!is_writable($backup_storage_path))
168 168
 		{
169 169
 			$status = "error";
170 170
 			$message = sprintf(__("Unable to write to the Backup Storage Location Folder %s . Please fix this before starting the backup process."), $backup_storage_path);
@@ -178,15 +178,15 @@  discard block
 block discarded – undo
178 178
 	public function trigger_message($message, $status = "error", $message_param1 = "", $message_param2 = "", $message_param3 = "")
179 179
 	{
180 180
 			$message = sprintf(__($message), $message_param1, $message_param2, $message_param3);
181
-			add_action( 'xcloner_admin_notices', array($this,"trigger_message_notice"), 10, 2);
182
-			do_action( 'xcloner_admin_notices', $message, $status);
181
+			add_action('xcloner_admin_notices', array($this, "trigger_message_notice"), 10, 2);
182
+			do_action('xcloner_admin_notices', $message, $status);
183 183
 	}
184 184
 	
185 185
 	public function trigger_message_notice($message, $status = "success")
186 186
 	{
187 187
 		?>
188 188
 		<div class="notice notice-<?php echo $status?> is-dismissible">
189
-	        <p><?php _e( $message, 'xcloner-backup-and-restore' ); ?></p>
189
+	        <p><?php _e($message, 'xcloner-backup-and-restore'); ?></p>
190 190
 	    </div>
191 191
 		<?php
192 192
 	}
@@ -213,79 +213,79 @@  discard block
 block discarded – undo
213 213
 		 * The class responsible for orchestrating the actions and filters of the
214 214
 		 * core plugin.
215 215
 		 */
216
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-loader.php';
216
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-loader.php';
217 217
 
218 218
 		/**
219 219
 		 * The class responsible for defining internationalization functionality
220 220
 		 * of the plugin.
221 221
 		 */
222
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-i18n.php';
222
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-i18n.php';
223 223
 
224 224
 		/**
225 225
 		 * The class responsible for defining all actions that occur in the admin area.
226 226
 		 */
227
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-xcloner-admin.php';
227
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-xcloner-admin.php';
228 228
 		
229 229
 		/**
230 230
 		 * The class responsible for debugging XCloner.
231 231
 		 */
232
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-logger.php';
232
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-logger.php';
233 233
 		
234 234
 		/**
235 235
 		 * The class responsible for defining the admin settings area.
236 236
 		 */
237
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-settings.php';
237
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-settings.php';
238 238
 		
239 239
 		/**
240 240
 		 * The class responsible for defining the Remote Storage settings area.
241 241
 		 */
242
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-remote-storage.php';
242
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-remote-storage.php';
243 243
 		
244 244
 		/**
245 245
 		 * The class responsible for implementing the database backup methods.
246 246
 		 */
247
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-database.php';
247
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-database.php';
248 248
 		
249 249
 		/**
250 250
 		 * The class responsible for sanitization of users input.
251 251
 		 */
252
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-sanitization.php';
252
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-sanitization.php';
253 253
 		
254 254
 		/**
255 255
 		 * The class responsible for XCloner system requirements validation.
256 256
 		 */
257
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-requirements.php';
257
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-requirements.php';
258 258
 		
259 259
 		/**
260 260
 		 * The class responsible for XCloner backup archive creation.
261 261
 		 */
262
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-archive.php';
262
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-archive.php';
263 263
 		
264 264
 		/**
265 265
 		 * The class responsible for XCloner API requests.
266 266
 		 */
267
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-api.php';
267
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-api.php';
268 268
 		
269 269
 		/**
270 270
 		 * The class responsible for the XCloner File System methods.
271 271
 		 */
272
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-file-system.php';
272
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-file-system.php';
273 273
 		
274 274
 		/**
275 275
 		 * The class responsible for the XCloner File Transfer methods.
276 276
 		 */
277
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-file-transfer.php';
277
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-file-transfer.php';
278 278
 		
279 279
 		/**
280 280
 		 * The class responsible for the XCloner Scheduler methods.
281 281
 		 */
282
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-scheduler.php';
282
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-scheduler.php';
283 283
 
284 284
 		/**
285 285
 		 * The class responsible for defining all actions that occur in the public-facing
286 286
 		 * side of the site.
287 287
 		 */
288
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-xcloner-public.php';
288
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-xcloner-public.php';
289 289
 		
290 290
 		$this->loader = new Xcloner_Loader($this);
291 291
 
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 
305 305
 		$plugin_i18n = new Xcloner_i18n();
306 306
 
307
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
307
+		$this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');
308 308
 		
309 309
 		//wp_localize_script( 'ajax-script', 'my_ajax_object',
310 310
         //   array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
@@ -320,11 +320,11 @@  discard block
 block discarded – undo
320 320
 	 */
321 321
 	private function define_admin_hooks() {
322 322
 	
323
-		$plugin_admin = new Xcloner_Admin( $this );
323
+		$plugin_admin = new Xcloner_Admin($this);
324 324
 		$this->plugin_admin = $plugin_admin;
325 325
 
326
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
327
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
326
+		$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
327
+		$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts');
328 328
 		
329 329
 	}
330 330
 	
@@ -333,24 +333,24 @@  discard block
 block discarded – undo
333 333
 	 * 
334 334
 	 * @access 	private
335 335
 	 */
336
-	private function define_admin_menu(){
336
+	private function define_admin_menu() {
337 337
 		
338 338
 		add_action('admin_menu', array($this->loader, 'xcloner_backup_add_admin_menu'));
339 339
 		
340 340
 	}
341 341
 	
342
-	private function define_plugin_settings(){
342
+	private function define_plugin_settings() {
343 343
 		/**
344 344
 		* register wporg_settings_init to the admin_init action hook
345 345
 		*/
346 346
 
347 347
 		$this->xcloner_settings = new XCloner_Settings($this);
348 348
 		
349
-		if(defined('DOING_CRON') || isset($_POST['hash'])){
349
+		if (defined('DOING_CRON') || isset($_POST['hash'])) {
350 350
 			
351
-			if(defined('DOING_CRON') || $_POST['hash'] == "generate_hash"){
351
+			if (defined('DOING_CRON') || $_POST['hash'] == "generate_hash") {
352 352
 				$this->xcloner_settings->generate_new_hash();
353
-			}else{
353
+			} else {
354 354
 				$this->xcloner_settings->set_hash($_POST['hash']);
355 355
 			}
356 356
 		}
@@ -373,10 +373,10 @@  discard block
 block discarded – undo
373 373
 	 */
374 374
 	private function define_public_hooks() {
375 375
 
376
-		$plugin_public = new Xcloner_Public( $this );
376
+		$plugin_public = new Xcloner_Public($this);
377 377
 
378
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
379
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
378
+		$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
379
+		$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
380 380
 
381 381
 	}
382 382
 	
@@ -385,20 +385,20 @@  discard block
 block discarded – undo
385 385
 		$logger = new XCloner_Logger($this, "php_system");
386 386
 		$error = error_get_last();
387 387
 		
388
-		if($error['type'] and $logger)
388
+		if ($error['type'] and $logger)
389 389
 		{
390
-			$logger->info($this->friendly_error_type ($error['type']).": ".var_export($error, true));
390
+			$logger->info($this->friendly_error_type($error['type']).": ".var_export($error, true));
391 391
 		}
392 392
 	
393 393
 	}
394 394
 	
395 395
 	function friendly_error_type($type) {
396
-	    static $levels=null;
397
-	    if ($levels===null) {
398
-	        $levels=[];
396
+	    static $levels = null;
397
+	    if ($levels === null) {
398
+	        $levels = [];
399 399
 	        foreach (get_defined_constants() as $key=>$value) {
400
-	            if (strpos($key,'E_')!==0) {continue;}
401
-					$levels[$value]= $key; //substr($key,2);
400
+	            if (strpos($key, 'E_') !== 0) {continue; }
401
+					$levels[$value] = $key; //substr($key,2);
402 402
 	        }
403 403
 	    }
404 404
 	    return (isset($levels[$type]) ? $levels[$type] : "Error #{$type}");
@@ -406,43 +406,43 @@  discard block
 block discarded – undo
406 406
 		
407 407
 	private function define_ajax_hooks()
408 408
 	{
409
-		if(is_admin() || defined('DOING_CRON'))
409
+		if (is_admin() || defined('DOING_CRON'))
410 410
 		{
411 411
 			$this->xcloner_logger 			= new XCloner_Logger($this, "xcloner_api");
412
-			$this->xcloner_filesystem 		= new Xcloner_File_System($this);
412
+			$this->xcloner_filesystem = new Xcloner_File_System($this);
413 413
 			$this->archive_system 			= new Xcloner_Archive($this);
414
-			$this->xcloner_database 		= new Xcloner_Database($this);
415
-			$this->xcloner_scheduler 		= new Xcloner_Scheduler($this);
416
-			$this->xcloner_remote_storage 	= new Xcloner_Remote_Storage($this);
417
-			$this->xcloner_file_transfer 	= new Xcloner_File_Transfer($this);
414
+			$this->xcloner_database = new Xcloner_Database($this);
415
+			$this->xcloner_scheduler = new Xcloner_Scheduler($this);
416
+			$this->xcloner_remote_storage = new Xcloner_Remote_Storage($this);
417
+			$this->xcloner_file_transfer = new Xcloner_File_Transfer($this);
418 418
 			
419
-			$xcloner_api 					= new Xcloner_Api($this);
419
+			$xcloner_api = new Xcloner_Api($this);
420 420
 
421
-			add_action( 'wp_ajax_get_database_tables_action', 	array($xcloner_api,'get_database_tables_action')  );
422
-			add_action( 'wp_ajax_get_file_system_action', 		array($xcloner_api,'get_file_system_action')  );
423
-			add_action( 'wp_ajax_scan_filesystem', 				array($xcloner_api,'scan_filesystem')  );
424
-			add_action( 'wp_ajax_backup_database', 				array($xcloner_api,'backup_database')  );
425
-			add_action( 'wp_ajax_backup_files'	, 				array($xcloner_api,'backup_files')  );
426
-			add_action( 'wp_ajax_save_schedule'	, 				array($xcloner_api,'save_schedule')  );
427
-			add_action( 'wp_ajax_get_schedule_by_id',	 		array($xcloner_api,'get_schedule_by_id')  );
428
-			add_action( 'wp_ajax_get_scheduler_list',	 		array($xcloner_api,'get_scheduler_list')  );
429
-			add_action( 'wp_ajax_delete_schedule_by_id'	, 		array($xcloner_api,'delete_schedule_by_id')  );
430
-			add_action( 'wp_ajax_delete_backup_by_name'	, 		array($xcloner_api,'delete_backup_by_name')  );
431
-			add_action( 'wp_ajax_download_backup_by_name', 		array($xcloner_api,'download_backup_by_name')  );
432
-			add_action( 'wp_ajax_remote_storage_save_status', 	array($xcloner_api,'remote_storage_save_status')  );
433
-			add_action( 'wp_ajax_upload_backup_to_remote', 		array($xcloner_api,'upload_backup_to_remote')  );
434
-			add_action( 'wp_ajax_list_backup_files'	,			array($xcloner_api,'list_backup_files')  );
435
-			add_action( 'wp_ajax_restore_upload_backup'	, 		array($xcloner_api,'restore_upload_backup')  );
436
-			add_action( 'wp_ajax_download_restore_script', 		array($xcloner_api,'download_restore_script')  );
437
-			add_action( 'wp_ajax_copy_backup_remote_to_local', 	array($xcloner_api,'copy_backup_remote_to_local')  );
438
-			add_action( 'admin_notices', 						array($this, 'xcloner_error_admin_notices' ));
421
+			add_action('wp_ajax_get_database_tables_action', array($xcloner_api, 'get_database_tables_action'));
422
+			add_action('wp_ajax_get_file_system_action', array($xcloner_api, 'get_file_system_action'));
423
+			add_action('wp_ajax_scan_filesystem', array($xcloner_api, 'scan_filesystem'));
424
+			add_action('wp_ajax_backup_database', array($xcloner_api, 'backup_database'));
425
+			add_action('wp_ajax_backup_files', array($xcloner_api, 'backup_files'));
426
+			add_action('wp_ajax_save_schedule', array($xcloner_api, 'save_schedule'));
427
+			add_action('wp_ajax_get_schedule_by_id', array($xcloner_api, 'get_schedule_by_id'));
428
+			add_action('wp_ajax_get_scheduler_list', array($xcloner_api, 'get_scheduler_list'));
429
+			add_action('wp_ajax_delete_schedule_by_id', array($xcloner_api, 'delete_schedule_by_id'));
430
+			add_action('wp_ajax_delete_backup_by_name', array($xcloner_api, 'delete_backup_by_name'));
431
+			add_action('wp_ajax_download_backup_by_name', array($xcloner_api, 'download_backup_by_name'));
432
+			add_action('wp_ajax_remote_storage_save_status', array($xcloner_api, 'remote_storage_save_status'));
433
+			add_action('wp_ajax_upload_backup_to_remote', array($xcloner_api, 'upload_backup_to_remote'));
434
+			add_action('wp_ajax_list_backup_files', array($xcloner_api, 'list_backup_files'));
435
+			add_action('wp_ajax_restore_upload_backup', array($xcloner_api, 'restore_upload_backup'));
436
+			add_action('wp_ajax_download_restore_script', array($xcloner_api, 'download_restore_script'));
437
+			add_action('wp_ajax_copy_backup_remote_to_local', array($xcloner_api, 'copy_backup_remote_to_local'));
438
+			add_action('admin_notices', array($this, 'xcloner_error_admin_notices'));
439 439
             
440 440
         }
441 441
 		
442 442
 	}
443 443
 	
444 444
 	function add_plugin_action_links($links, $file) {
445
-        if ($file == plugin_basename(dirname(dirname(__FILE__)) . '/xcloner.php'))
445
+        if ($file == plugin_basename(dirname(dirname(__FILE__)).'/xcloner.php'))
446 446
 		{	
447 447
 			$links[] = '<a href="admin.php?page=xcloner_settings_page">'.__('Settings', 'xcloner-backup-and-restore').'</a>';
448 448
 			$links[] = '<a href="admin.php?page=xcloner_generate_backups_page">'.__('Generate Backup', 'xcloner-backup-and-restore').'</a>';
@@ -452,13 +452,13 @@  discard block
 block discarded – undo
452 452
     }
453 453
 	
454 454
 	public function xcloner_error_admin_notices() {
455
-			settings_errors( 'xcloner_error_message' );
455
+			settings_errors('xcloner_error_message');
456 456
 		}
457 457
 	
458 458
 	public function define_cron_hooks()
459 459
 	{
460 460
 		//registering new schedule intervals
461
-		add_filter( 'cron_schedules', array($this, 'add_new_intervals'));
461
+		add_filter('cron_schedules', array($this, 'add_new_intervals'));
462 462
 			
463 463
 		
464 464
 		$xcloner_scheduler = $this->get_xcloner_scheduler();
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 	
533 533
 		$page = sanitize_key($_GET['page']);
534 534
 
535
-		if($page)
535
+		if ($page)
536 536
 		{
537 537
 			$this->display($page);
538 538
 		}
Please login to merge, or discard this patch.