@@ -1,30 +1,30 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined('AUTH_KEY')) |
|
3 | +if (!defined('AUTH_KEY')) |
|
4 | 4 | { |
5 | 5 | define('AUTH_KEY', ''); |
6 | 6 | } |
7 | 7 | |
8 | -if(!defined("DS")) |
|
8 | +if (!defined("DS")) |
|
9 | 9 | { |
10 | 10 | define("DS", DIRECTORY_SEPARATOR); |
11 | 11 | } |
12 | 12 | |
13 | -if(!defined('XCLONER_PLUGIN_ACCESS') || XCLONER_PLUGIN_ACCESS != 1) |
|
13 | +if (!defined('XCLONER_PLUGIN_ACCESS') || XCLONER_PLUGIN_ACCESS != 1) |
|
14 | 14 | { |
15 | - if(!AUTH_KEY) |
|
15 | + if (!AUTH_KEY) |
|
16 | 16 | { |
17 | 17 | Xcloner_Restore::send_response("404", "Could not run restore script, AUTH_KEY not set!"); |
18 | 18 | exit; |
19 | 19 | } |
20 | 20 | |
21 | - if(!isset($_REQUEST['hash'])) |
|
21 | + if (!isset($_REQUEST['hash'])) |
|
22 | 22 | { |
23 | 23 | Xcloner_Restore::send_response("404", "Could not run restore script, sent HASH is empty!"); |
24 | 24 | exit; |
25 | 25 | } |
26 | 26 | |
27 | - if($_REQUEST['hash'] != AUTH_KEY) |
|
27 | + if ($_REQUEST['hash'] != AUTH_KEY) |
|
28 | 28 | { |
29 | 29 | Xcloner_Restore::send_response("404", "Could not run restore script, AUTH_KEY doesn't match the sent HASH!"); |
30 | 30 | exit; |
@@ -32,28 +32,28 @@ discard block |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | //check minimum PHP version |
35 | -if(version_compare(phpversion(), Xcloner_Restore::xcloner_minimum_version, '<')) |
|
35 | +if (version_compare(phpversion(), Xcloner_Restore::xcloner_minimum_version, '<')) |
|
36 | 36 | { |
37 | - Xcloner_Restore::send_response(500, sprintf(("XCloner requires minimum PHP version %s in order to run correctly. We have detected your version as %s"),Xcloner_Restore::xcloner_minimum_version, phpversion()) ); |
|
37 | + Xcloner_Restore::send_response(500, sprintf(("XCloner requires minimum PHP version %s in order to run correctly. We have detected your version as %s"), Xcloner_Restore::xcloner_minimum_version, phpversion())); |
|
38 | 38 | exit; |
39 | 39 | |
40 | 40 | } |
41 | 41 | |
42 | -$file = dirname( __DIR__ ) . DS.'vendor'.DS.'autoload.php'; |
|
42 | +$file = dirname(__DIR__).DS.'vendor'.DS.'autoload.php'; |
|
43 | 43 | |
44 | -if(file_exists($file)) |
|
44 | +if (file_exists($file)) |
|
45 | 45 | { |
46 | 46 | |
47 | 47 | require_once($file); |
48 | 48 | } |
49 | -elseif(file_exists("vendor.phar") and extension_loaded('phar')) |
|
49 | +elseif (file_exists("vendor.phar") and extension_loaded('phar')) |
|
50 | 50 | { |
51 | 51 | require_once(__DIR__.DS."vendor.phar"); |
52 | -}else{ |
|
52 | +} else { |
|
53 | 53 | |
54 | - $file = dirname( __FILE__ ) . DS.'vendor'.DS.'autoload.php'; |
|
54 | + $file = dirname(__FILE__).DS.'vendor'.DS.'autoload.php'; |
|
55 | 55 | |
56 | - if(!file_exists($file)) |
|
56 | + if (!file_exists($file)) |
|
57 | 57 | { |
58 | 58 | Xcloner_Restore::send_response("404", "File $file does not exists, please extract the vendor.tgz archive on the server or enable PHP Phar module!"); |
59 | 59 | exit; |
@@ -78,16 +78,16 @@ discard block |
||
78 | 78 | |
79 | 79 | //do not modify below |
80 | 80 | $that = ""; |
81 | -if(defined('XCLONER_PLUGIN_ACCESS') && XCLONER_PLUGIN_ACCESS) |
|
81 | +if (defined('XCLONER_PLUGIN_ACCESS') && XCLONER_PLUGIN_ACCESS) |
|
82 | 82 | { |
83 | 83 | $that = $this; |
84 | 84 | } |
85 | 85 | $xcloner_restore = new Xcloner_Restore($that); |
86 | 86 | |
87 | -try{ |
|
87 | +try { |
|
88 | 88 | $return = $xcloner_restore->init(); |
89 | 89 | $xcloner_restore->send_response(200, $return); |
90 | -}catch(Exception $e){ |
|
90 | +}catch (Exception $e) { |
|
91 | 91 | $xcloner_restore->send_response(417, $e->getMessage()); |
92 | 92 | } |
93 | 93 | |
@@ -96,10 +96,10 @@ discard block |
||
96 | 96 | |
97 | 97 | const xcloner_minimum_version = "5.4.0"; |
98 | 98 | |
99 | - private $backup_archive_extensions = array("zip", "tar", "tgz", "tar.gz", "gz", "csv"); |
|
100 | - private $process_files_limit = 150; |
|
101 | - private $process_files_limit_list = 350; |
|
102 | - private $process_mysql_records_limit = 250; |
|
99 | + private $backup_archive_extensions = array("zip", "tar", "tgz", "tar.gz", "gz", "csv"); |
|
100 | + private $process_files_limit = 150; |
|
101 | + private $process_files_limit_list = 350; |
|
102 | + private $process_mysql_records_limit = 250; |
|
103 | 103 | private $adapter; |
104 | 104 | private $filesystem; |
105 | 105 | private $logger; |
@@ -115,12 +115,12 @@ discard block |
||
115 | 115 | { |
116 | 116 | register_shutdown_function(array($this, 'exception_handler')); |
117 | 117 | |
118 | - if(defined('XCLONER_PLUGIN_ACCESS') && XCLONER_PLUGIN_ACCESS) |
|
118 | + if (defined('XCLONER_PLUGIN_ACCESS') && XCLONER_PLUGIN_ACCESS) |
|
119 | 119 | { |
120 | 120 | $dir = $parent_api->get_xcloner_container()->get_xcloner_settings()->get_xcloner_store_path(); |
121 | 121 | } |
122 | 122 | |
123 | - if(!isset($dir) || !$dir){ |
|
123 | + if (!isset($dir) || !$dir) { |
|
124 | 124 | $dir = dirname(__FILE__); |
125 | 125 | } |
126 | 126 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | $this->backup_storage_dir = $dir; |
130 | 130 | |
131 | - $this->adapter = new Local($dir ,LOCK_EX, 'SKIP_LINKS'); |
|
131 | + $this->adapter = new Local($dir, LOCK_EX, 'SKIP_LINKS'); |
|
132 | 132 | $this->filesystem = new Filesystem($this->adapter, new Config([ |
133 | 133 | 'disable_asserts' => true, |
134 | 134 | ])); |
@@ -137,15 +137,15 @@ discard block |
||
137 | 137 | |
138 | 138 | $logger_path = $this->get_logger_filename(); |
139 | 139 | |
140 | - if(!is_writeable($logger_path) and !touch($logger_path)) |
|
140 | + if (!is_writeable($logger_path) and !touch($logger_path)) |
|
141 | 141 | { |
142 | 142 | $logger_path = "php://stderr"; |
143 | 143 | } |
144 | 144 | |
145 | 145 | $this->logger->pushHandler(new StreamHandler($logger_path, Logger::DEBUG)); |
146 | 146 | |
147 | - if(isset($_POST['API_ID'])){ |
|
148 | - $this->logger->info("Processing ajax request ID ".substr(filter_input(INPUT_POST, 'API_ID', FILTER_SANITIZE_STRING), 0 , 15)); |
|
147 | + if (isset($_POST['API_ID'])) { |
|
148 | + $this->logger->info("Processing ajax request ID ".substr(filter_input(INPUT_POST, 'API_ID', FILTER_SANITIZE_STRING), 0, 15)); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | } |
@@ -157,9 +157,9 @@ discard block |
||
157 | 157 | |
158 | 158 | $error = error_get_last(); |
159 | 159 | |
160 | - if($error['type'] and $this->logger) |
|
160 | + if ($error['type'] and $this->logger) |
|
161 | 161 | { |
162 | - $this->logger->info($this->friendly_error_type ($error['type']).": ".var_export($error, true)); |
|
162 | + $this->logger->info($this->friendly_error_type($error['type']).": ".var_export($error, true)); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | } |
@@ -169,12 +169,12 @@ discard block |
||
169 | 169 | * @return mixed|string |
170 | 170 | */ |
171 | 171 | private function friendly_error_type($type) { |
172 | - static $levels=null; |
|
173 | - if ($levels===null) { |
|
174 | - $levels=[]; |
|
172 | + static $levels = null; |
|
173 | + if ($levels === null) { |
|
174 | + $levels = []; |
|
175 | 175 | foreach (get_defined_constants() as $key=>$value) { |
176 | - if (strpos($key,'E_')!==0) {continue;} |
|
177 | - $levels[$value]= $key; //substr($key,2); |
|
176 | + if (strpos($key, 'E_') !== 0) {continue; } |
|
177 | + $levels[$value] = $key; //substr($key,2); |
|
178 | 178 | } |
179 | 179 | } |
180 | 180 | return (isset($levels[$type]) ? $levels[$type] : "Error #{$type}"); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | public function get_logger_filename() |
184 | 184 | { |
185 | - $filename = $this->backup_storage_dir .DS. "xcloner_restore.log"; |
|
185 | + $filename = $this->backup_storage_dir.DS."xcloner_restore.log"; |
|
186 | 186 | |
187 | 187 | return $filename; |
188 | 188 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function init() |
197 | 197 | { |
198 | - if(isset($_POST['xcloner_action']) and $_POST['xcloner_action']) |
|
198 | + if (isset($_POST['xcloner_action']) and $_POST['xcloner_action']) |
|
199 | 199 | { |
200 | 200 | $method = filter_input(INPUT_POST, 'xcloner_action', FILTER_SANITIZE_STRING); |
201 | 201 | |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | |
204 | 204 | $method .= "_action"; |
205 | 205 | |
206 | - if(method_exists($this, $method)) |
|
206 | + if (method_exists($this, $method)) |
|
207 | 207 | { |
208 | 208 | $this->logger->debug(sprintf('Starting action %s', $method)); |
209 | 209 | return call_user_func(array($this, $method)); |
210 | 210 | |
211 | - }else{ |
|
212 | - throw new Exception($method ." does not exists"); |
|
211 | + } else { |
|
212 | + throw new Exception($method." does not exists"); |
|
213 | 213 | } |
214 | 214 | } |
215 | 215 | |
@@ -224,38 +224,38 @@ discard block |
||
224 | 224 | */ |
225 | 225 | public function write_file_action() |
226 | 226 | { |
227 | - if(isset($_POST['file'])) |
|
227 | + if (isset($_POST['file'])) |
|
228 | 228 | { |
229 | 229 | $target_file = filter_input(INPUT_POST, 'file', FILTER_SANITIZE_STRING); |
230 | 230 | |
231 | - if(!$_POST['start']) |
|
231 | + if (!$_POST['start']) |
|
232 | 232 | $fp = fopen($target_file, "wb+"); |
233 | 233 | else |
234 | 234 | $fp = fopen($target_file, "ab+"); |
235 | 235 | |
236 | - if(!$fp) |
|
236 | + if (!$fp) |
|
237 | 237 | throw new Exception("Unable to open $target_file file for writing"); |
238 | 238 | |
239 | 239 | fseek($fp, $_POST['start']); |
240 | 240 | |
241 | - if(isset($_FILES['blob'])) |
|
241 | + if (isset($_FILES['blob'])) |
|
242 | 242 | { |
243 | 243 | $this->logger->debug(sprintf('Writing %s bytes to file %s starting position %s using FILES blob', filesize($_FILES['blob']['tmp_name']), $target_file, $_POST['start'])); |
244 | 244 | |
245 | 245 | $blob = file_get_contents($_FILES['blob']['tmp_name']); |
246 | 246 | |
247 | - if(!$bytes_written = fwrite($fp, $blob)) |
|
247 | + if (!$bytes_written = fwrite($fp, $blob)) |
|
248 | 248 | throw new Exception("Unable to write data to file $target_file"); |
249 | 249 | |
250 | 250 | @unlink($_FILES['blob']['tmp_name']); |
251 | - }elseif(isset($_POST['blob'])){ |
|
251 | + }elseif (isset($_POST['blob'])) { |
|
252 | 252 | $this->logger->debug(sprintf('Writing %s bytes to file %s starting position %s using POST blob', strlen($_POST['blob']), $target_file, $_POST['start'])); |
253 | 253 | |
254 | 254 | $blob = $_POST['blob']; |
255 | 255 | |
256 | - if(!$bytes_written = fwrite($fp, $blob)) |
|
256 | + if (!$bytes_written = fwrite($fp, $blob)) |
|
257 | 257 | throw new Exception("Unable to write data to file $target_file"); |
258 | - }else{ |
|
258 | + } else { |
|
259 | 259 | throw new Exception("Upload failed, did not receive any binary data"); |
260 | 260 | } |
261 | 261 | |
@@ -276,20 +276,20 @@ discard block |
||
276 | 276 | * @return mysqli |
277 | 277 | * @throws Exception |
278 | 278 | */ |
279 | - public function mysql_connect($remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db ) |
|
279 | + public function mysql_connect($remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db) |
|
280 | 280 | { |
281 | 281 | $this->logger->info(sprintf('Connecting to mysql database %s with %s@%s', $remote_mysql_db, $remote_mysql_user, $remote_mysql_host)); |
282 | 282 | |
283 | 283 | $mysqli = new mysqli($remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db); |
284 | 284 | |
285 | 285 | if ($mysqli->connect_error) { |
286 | - throw new Exception('Connect Error (' . $mysqli->connect_errno . ') ' |
|
286 | + throw new Exception('Connect Error ('.$mysqli->connect_errno.') ' |
|
287 | 287 | . $mysqli->connect_error); |
288 | 288 | } |
289 | 289 | |
290 | 290 | $mysqli->query("SET sql_mode='';"); |
291 | 291 | $mysqli->query("SET foreign_key_checks = 0;"); |
292 | - if(isset($_REQUEST['charset_of_file']) and $_REQUEST['charset_of_file']) |
|
292 | + if (isset($_REQUEST['charset_of_file']) and $_REQUEST['charset_of_file']) |
|
293 | 293 | $mysqli->query("SET NAMES ".$_REQUEST['charset_of_file'].""); |
294 | 294 | else |
295 | 295 | $mysqli->query("SET NAMES utf8;"); |
@@ -304,15 +304,15 @@ discard block |
||
304 | 304 | */ |
305 | 305 | public function restore_mysql_backup_action() |
306 | 306 | { |
307 | - $mysqldump_file = filter_input(INPUT_POST, 'mysqldump_file', FILTER_SANITIZE_STRING); |
|
308 | - $remote_path = filter_input(INPUT_POST, 'remote_path', FILTER_SANITIZE_STRING); |
|
307 | + $mysqldump_file = filter_input(INPUT_POST, 'mysqldump_file', FILTER_SANITIZE_STRING); |
|
308 | + $remote_path = filter_input(INPUT_POST, 'remote_path', FILTER_SANITIZE_STRING); |
|
309 | 309 | $remote_mysql_user = filter_input(INPUT_POST, 'remote_mysql_user', FILTER_SANITIZE_STRING); |
310 | 310 | $remote_mysql_pass = filter_input(INPUT_POST, 'remote_mysql_pass', FILTER_SANITIZE_STRING); |
311 | - $remote_mysql_db = filter_input(INPUT_POST, 'remote_mysql_db', FILTER_SANITIZE_STRING); |
|
311 | + $remote_mysql_db = filter_input(INPUT_POST, 'remote_mysql_db', FILTER_SANITIZE_STRING); |
|
312 | 312 | $remote_mysql_host = filter_input(INPUT_POST, 'remote_mysql_host', FILTER_SANITIZE_STRING); |
313 | - $execute_query = trim(stripslashes($_POST['query'])); |
|
314 | - $error_line = filter_input(INPUT_POST, 'error_line', FILTER_SANITIZE_NUMBER_INT); |
|
315 | - $start = filter_input(INPUT_POST, 'start', FILTER_SANITIZE_NUMBER_INT); |
|
313 | + $execute_query = trim(stripslashes($_POST['query'])); |
|
314 | + $error_line = filter_input(INPUT_POST, 'error_line', FILTER_SANITIZE_NUMBER_INT); |
|
315 | + $start = filter_input(INPUT_POST, 'start', FILTER_SANITIZE_NUMBER_INT); |
|
316 | 316 | |
317 | 317 | $wp_home_url = filter_input(INPUT_POST, 'wp_home_url', FILTER_SANITIZE_STRING); |
318 | 318 | $remote_restore_url = filter_input(INPUT_POST, 'remote_restore_url', FILTER_SANITIZE_STRING); |
@@ -322,8 +322,8 @@ discard block |
||
322 | 322 | |
323 | 323 | $mysql_backup_file = $remote_path.DS.$mysqldump_file; |
324 | 324 | |
325 | - if(!file_exists($mysql_backup_file)) |
|
326 | - throw new Exception(sprintf("Mysql backup file %s does not exists",$mysql_backup_file)); |
|
325 | + if (!file_exists($mysql_backup_file)) |
|
326 | + throw new Exception(sprintf("Mysql backup file %s does not exists", $mysql_backup_file)); |
|
327 | 327 | |
328 | 328 | |
329 | 329 | /*if(defined('XCLONER_PLUGIN_ACCESS') && XCLONER_PLUGIN_ACCESS) |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | }*/ |
338 | 338 | |
339 | 339 | { |
340 | - $mysqli = $this->mysql_connect($remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db ); |
|
340 | + $mysqli = $this->mysql_connect($remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db); |
|
341 | 341 | } |
342 | 342 | |
343 | 343 | $line_count = 0; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | $return['backup_size'] = filesize($mysql_backup_file); |
348 | 348 | |
349 | 349 | $fp = fopen($mysql_backup_file, "r"); |
350 | - if($fp) |
|
350 | + if ($fp) |
|
351 | 351 | { |
352 | 352 | $this->logger->info(sprintf("Opening mysql dump file %s at position %s.", $mysql_backup_file, $start)); |
353 | 353 | fseek($fp, $start); |
@@ -355,49 +355,49 @@ discard block |
||
355 | 355 | // process the line read. |
356 | 356 | |
357 | 357 | //check if line is comment |
358 | - if(substr($line, 0, 1) == "#") |
|
358 | + if (substr($line, 0, 1) == "#") |
|
359 | 359 | continue; |
360 | 360 | |
361 | 361 | //check if line is empty |
362 | - if($line == "\n" or trim($line) == "") |
|
362 | + if ($line == "\n" or trim($line) == "") |
|
363 | 363 | continue; |
364 | 364 | |
365 | - if(substr($line, strlen($line)-2, strlen($line)) == ";\n") |
|
365 | + if (substr($line, strlen($line) - 2, strlen($line)) == ";\n") |
|
366 | 366 | $query .= $line; |
367 | - else{ |
|
367 | + else { |
|
368 | 368 | $query .= $line; |
369 | 369 | continue; |
370 | 370 | } |
371 | 371 | |
372 | - if($execute_query) |
|
372 | + if ($execute_query) |
|
373 | 373 | { |
374 | - $query = (($execute_query)); |
|
374 | + $query = (($execute_query)); |
|
375 | 375 | $execute_query = ""; |
376 | 376 | } |
377 | 377 | |
378 | 378 | //Doing serialized url replace here |
379 | 379 | |
380 | - if($wp_site_url and $wp_home_url and strlen($wp_home_url) < strlen($wp_site_url)) |
|
380 | + if ($wp_site_url and $wp_home_url and strlen($wp_home_url) < strlen($wp_site_url)) |
|
381 | 381 | { |
382 | - list($wp_home_url,$wp_site_url) = array($wp_site_url,$wp_home_url); |
|
383 | - list($remote_restore_url,$restore_site_url) = array($restore_site_url,$remote_restore_url); |
|
382 | + list($wp_home_url, $wp_site_url) = array($wp_site_url, $wp_home_url); |
|
383 | + list($remote_restore_url, $restore_site_url) = array($restore_site_url, $remote_restore_url); |
|
384 | 384 | |
385 | 385 | } |
386 | 386 | |
387 | - if($wp_home_url and $remote_restore_url and strpos($query, $wp_home_url) !== false) |
|
387 | + if ($wp_home_url and $remote_restore_url and strpos($query, $wp_home_url) !== false) |
|
388 | 388 | { |
389 | 389 | $query = $this->url_replace($wp_home_url, $remote_restore_url, $query); |
390 | 390 | } |
391 | 391 | |
392 | - if($wp_site_url and $restore_site_url and strpos($query, $wp_site_url) !== false) |
|
392 | + if ($wp_site_url and $restore_site_url and strpos($query, $wp_site_url) !== false) |
|
393 | 393 | { |
394 | 394 | $query = $this->url_replace($wp_site_url, $restore_site_url, $query); |
395 | 395 | } |
396 | 396 | |
397 | - if(!$mysqli->query($query) && !stristr($mysqli->error,"Duplicate entry")) |
|
397 | + if (!$mysqli->query($query) && !stristr($mysqli->error, "Duplicate entry")) |
|
398 | 398 | { |
399 | 399 | //$return['error_line'] = $line_count; |
400 | - $return['start'] = ftell($fp)-strlen($line); |
|
400 | + $return['start'] = ftell($fp) - strlen($line); |
|
401 | 401 | $return['query_error'] = true; |
402 | 402 | $return['query'] = $query; |
403 | 403 | $return['message'] = sprintf("Mysql Error: %s\n", $mysqli->error); |
@@ -418,12 +418,12 @@ discard block |
||
418 | 418 | |
419 | 419 | $return['start'] = ftell($fp); |
420 | 420 | |
421 | - $this->logger->info(sprintf("Executed %s queries of size %s bytes", $line_count, ($return['start']-$start))); |
|
421 | + $this->logger->info(sprintf("Executed %s queries of size %s bytes", $line_count, ($return['start'] - $start))); |
|
422 | 422 | |
423 | - if(!feof($fp)) |
|
423 | + if (!feof($fp)) |
|
424 | 424 | { |
425 | 425 | $return['finished'] = 0; |
426 | - }else{ |
|
426 | + } else { |
|
427 | 427 | $this->logger->info(sprintf("Mysql Import Done.")); |
428 | 428 | } |
429 | 429 | |
@@ -446,12 +446,12 @@ discard block |
||
446 | 446 | $query = str_replace($search, $replace, $query); |
447 | 447 | $original_query = $query; |
448 | 448 | |
449 | - if($this->has_serialized($query)) |
|
449 | + if ($this->has_serialized($query)) |
|
450 | 450 | { |
451 | 451 | $this->logger->info(sprintf("Query contains serialized data, doing serialized size fix"), array("QUERY_REPLACE")); |
452 | 452 | $query = $this->do_serialized_fix($query); |
453 | 453 | |
454 | - if(!$query) |
|
454 | + if (!$query) |
|
455 | 455 | { |
456 | 456 | $this->logger->info(sprintf("Serialization probably failed here..."), array("QUERY_REPLACE")); |
457 | 457 | $query = $original_query; |
@@ -472,37 +472,37 @@ discard block |
||
472 | 472 | $backup_parts = array(); |
473 | 473 | |
474 | 474 | $source_backup_file = filter_input(INPUT_POST, 'file', FILTER_SANITIZE_STRING); |
475 | - $start = (int)filter_input(INPUT_POST, 'start', FILTER_SANITIZE_STRING); |
|
476 | - $return['part'] = (int)filter_input(INPUT_POST, 'part', FILTER_SANITIZE_STRING); |
|
475 | + $start = (int)filter_input(INPUT_POST, 'start', FILTER_SANITIZE_STRING); |
|
476 | + $return['part'] = (int)filter_input(INPUT_POST, 'part', FILTER_SANITIZE_STRING); |
|
477 | 477 | |
478 | 478 | $backup_file = $source_backup_file; |
479 | 479 | |
480 | - if($this->is_multipart($backup_file)) |
|
480 | + if ($this->is_multipart($backup_file)) |
|
481 | 481 | { |
482 | 482 | $backup_parts = $this->get_multipart_files($backup_file); |
483 | 483 | $backup_file = $backup_parts[$return['part']]; |
484 | 484 | } |
485 | 485 | |
486 | - try{ |
|
486 | + try { |
|
487 | 487 | $tar = new Tar(); |
488 | 488 | $tar->open($this->backup_storage_dir.DS.$backup_file, $start); |
489 | 489 | |
490 | 490 | $data = $tar->contents($this->process_files_limit_list); |
491 | - }catch(Exception $e) |
|
491 | + }catch (Exception $e) |
|
492 | 492 | { |
493 | 493 | $return['error'] = true; |
494 | 494 | $return['message'] = $e->getMessage(); |
495 | 495 | $this->send_response(200, $return); |
496 | 496 | } |
497 | 497 | |
498 | - $return['files'] = array(); |
|
499 | - $return['finished'] = 1; |
|
500 | - $return['total_size'] = filesize($this->backup_storage_dir.DS.$backup_file); |
|
498 | + $return['files'] = array(); |
|
499 | + $return['finished'] = 1; |
|
500 | + $return['total_size'] = filesize($this->backup_storage_dir.DS.$backup_file); |
|
501 | 501 | $i = 0; |
502 | 502 | |
503 | - if(isset($data['extracted_files']) and is_array($data['extracted_files'])) |
|
503 | + if (isset($data['extracted_files']) and is_array($data['extracted_files'])) |
|
504 | 504 | { |
505 | - foreach($data['extracted_files'] as $file) |
|
505 | + foreach ($data['extracted_files'] as $file) |
|
506 | 506 | { |
507 | 507 | $return['files'][$i]['path'] = $file->getPath(); |
508 | 508 | $return['files'][$i]['size'] = $file->getSize(); |
@@ -512,18 +512,18 @@ discard block |
||
512 | 512 | } |
513 | 513 | } |
514 | 514 | |
515 | - if(isset($data['start'])) |
|
515 | + if (isset($data['start'])) |
|
516 | 516 | { |
517 | 517 | $return['start'] = $data['start']; |
518 | 518 | $return['finished'] = 0; |
519 | - }else{ |
|
520 | - if($this->is_multipart($source_backup_file)) |
|
519 | + } else { |
|
520 | + if ($this->is_multipart($source_backup_file)) |
|
521 | 521 | { |
522 | 522 | $return['start'] = 0; |
523 | 523 | |
524 | 524 | ++$return['part']; |
525 | 525 | |
526 | - if($return['part'] < sizeof($backup_parts)) |
|
526 | + if ($return['part'] < sizeof($backup_parts)) |
|
527 | 527 | $return['finished'] = 0; |
528 | 528 | |
529 | 529 | } |
@@ -546,28 +546,28 @@ discard block |
||
546 | 546 | |
547 | 547 | $remote_mysql_user = filter_input(INPUT_POST, 'remote_mysql_user', FILTER_SANITIZE_STRING); |
548 | 548 | $remote_mysql_pass = filter_input(INPUT_POST, 'remote_mysql_pass', FILTER_SANITIZE_STRING); |
549 | - $remote_mysql_db = filter_input(INPUT_POST, 'remote_mysql_db', FILTER_SANITIZE_STRING); |
|
549 | + $remote_mysql_db = filter_input(INPUT_POST, 'remote_mysql_db', FILTER_SANITIZE_STRING); |
|
550 | 550 | $remote_mysql_host = filter_input(INPUT_POST, 'remote_mysql_host', FILTER_SANITIZE_STRING); |
551 | 551 | |
552 | - $update_remote_site_url = filter_input(INPUT_POST, 'update_remote_site_url', FILTER_SANITIZE_NUMBER_INT); |
|
553 | - $delete_restore_script = filter_input(INPUT_POST, 'delete_restore_script', FILTER_SANITIZE_NUMBER_INT); |
|
554 | - $delete_backup_temporary_folder = filter_input(INPUT_POST, 'delete_backup_temporary_folder', FILTER_SANITIZE_NUMBER_INT); |
|
552 | + $update_remote_site_url = filter_input(INPUT_POST, 'update_remote_site_url', FILTER_SANITIZE_NUMBER_INT); |
|
553 | + $delete_restore_script = filter_input(INPUT_POST, 'delete_restore_script', FILTER_SANITIZE_NUMBER_INT); |
|
554 | + $delete_backup_temporary_folder = filter_input(INPUT_POST, 'delete_backup_temporary_folder', FILTER_SANITIZE_NUMBER_INT); |
|
555 | 555 | |
556 | - if($update_remote_site_url) |
|
556 | + if ($update_remote_site_url) |
|
557 | 557 | { |
558 | - $mysqli = $this->mysql_connect($remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db ); |
|
558 | + $mysqli = $this->mysql_connect($remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db); |
|
559 | 559 | $this->update_wp_config($remote_path, $remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db); |
560 | 560 | $this->update_wp_url($remote_path, $remote_restore_url, $mysqli); |
561 | 561 | } |
562 | 562 | |
563 | - if($delete_backup_temporary_folder) |
|
563 | + if ($delete_backup_temporary_folder) |
|
564 | 564 | { |
565 | 565 | $this->delete_backup_temporary_folder($remote_path); |
566 | 566 | } |
567 | 567 | |
568 | - if(!defined('XCLONER_PLUGIN_ACCESS') || XCLONER_PLUGIN_ACCESS != 1) |
|
568 | + if (!defined('XCLONER_PLUGIN_ACCESS') || XCLONER_PLUGIN_ACCESS != 1) |
|
569 | 569 | { |
570 | - if($delete_restore_script) |
|
570 | + if ($delete_restore_script) |
|
571 | 571 | { |
572 | 572 | $this->delete_self(); |
573 | 573 | } |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | */ |
586 | 586 | private function delete_backup_temporary_folder($remote_path) |
587 | 587 | { |
588 | - $this->target_adapter = new Local($remote_path ,LOCK_EX, 'SKIP_LINKS'); |
|
588 | + $this->target_adapter = new Local($remote_path, LOCK_EX, 'SKIP_LINKS'); |
|
589 | 589 | $this->target_filesystem = new Filesystem($this->target_adapter, new Config([ |
590 | 590 | 'disable_asserts' => true, |
591 | 591 | ])); |
@@ -593,13 +593,13 @@ discard block |
||
593 | 593 | $mysqldump_list = array(); |
594 | 594 | $list = $this->target_filesystem->listContents(); |
595 | 595 | |
596 | - foreach($list as $file) |
|
596 | + foreach ($list as $file) |
|
597 | 597 | { |
598 | 598 | $matches = array(); |
599 | 599 | |
600 | - if($file['type'] == "dir") |
|
600 | + if ($file['type'] == "dir") |
|
601 | 601 | { |
602 | - if(preg_match("/xcloner-(\w*)/", $file['basename'], $matches)){ |
|
602 | + if (preg_match("/xcloner-(\w*)/", $file['basename'], $matches)) { |
|
603 | 603 | $this->logger->info(sprintf('Deleting temporary folder %s', $file['path'])); |
604 | 604 | $this->target_filesystem->deleteDir($file['path']); |
605 | 605 | } |
@@ -617,29 +617,29 @@ discard block |
||
617 | 617 | */ |
618 | 618 | private function delete_self() |
619 | 619 | { |
620 | - if($this->filesystem->has("vendor.phar")) |
|
620 | + if ($this->filesystem->has("vendor.phar")) |
|
621 | 621 | { |
622 | 622 | $this->logger->info(sprintf('Deleting vendor.phar')); |
623 | 623 | $this->filesystem->delete("vendor.phar"); |
624 | 624 | } |
625 | - if($this->filesystem->has("vendor")) |
|
625 | + if ($this->filesystem->has("vendor")) |
|
626 | 626 | { |
627 | 627 | $this->logger->info(sprintf('Deleting vendor folder')); |
628 | 628 | $this->filesystem->deleteDir("vendor"); |
629 | 629 | } |
630 | - if($this->filesystem->has("xcloner_restore.php")) |
|
630 | + if ($this->filesystem->has("xcloner_restore.php")) |
|
631 | 631 | { |
632 | 632 | $this->logger->info(sprintf('Deleting xcloner_restore.php')); |
633 | 633 | $this->filesystem->delete("xcloner_restore.php"); |
634 | 634 | } |
635 | 635 | |
636 | - if($this->filesystem->has("xcloner_restore.log")) |
|
636 | + if ($this->filesystem->has("xcloner_restore.log")) |
|
637 | 637 | { |
638 | 638 | $this->logger->info(sprintf('Deleting xcloner_restore.log')); |
639 | 639 | $this->filesystem->delete("xcloner_restore.log"); |
640 | 640 | } |
641 | 641 | |
642 | - if($this->filesystem->has($this->get_logger_filename())) |
|
642 | + if ($this->filesystem->has($this->get_logger_filename())) |
|
643 | 643 | { |
644 | 644 | $this->logger->info(sprintf('Deleting logger file %s', $this->get_logger_filename())); |
645 | 645 | $this->filesystem->delete($this->get_logger_filename()); |
@@ -661,11 +661,11 @@ discard block |
||
661 | 661 | |
662 | 662 | $this->logger->info(sprintf('Updating site url to %s', $url)); |
663 | 663 | |
664 | - if(file_exists($wp_config)) |
|
664 | + if (file_exists($wp_config)) |
|
665 | 665 | { |
666 | 666 | $config = file_get_contents($wp_config); |
667 | 667 | preg_match("/.*table_prefix.*=.*'(.*)'/i", $config, $matches); |
668 | - if(isset($matches[1])) |
|
668 | + if (isset($matches[1])) |
|
669 | 669 | $table_prefix = $matches[1]; |
670 | 670 | else |
671 | 671 | throw new Exception("Could not load wordpress table prefix from wp-config.php file."); |
@@ -673,10 +673,10 @@ discard block |
||
673 | 673 | else |
674 | 674 | throw new Exception("Could not update the SITEURL and HOME, wp-config.php file not found"); |
675 | 675 | |
676 | - if(!$mysqli->query("update ".$table_prefix."options set option_value='".($url)."' where option_name='home'")) |
|
676 | + if (!$mysqli->query("update ".$table_prefix."options set option_value='".($url)."' where option_name='home'")) |
|
677 | 677 | throw new Exception(sprintf("Could not update the HOME option, error: %s\n", $mysqli->error)); |
678 | 678 | |
679 | - if(!$mysqli->query("update ".$table_prefix."options set option_value='".($url)."' where option_name='siteurl'")) |
|
679 | + if (!$mysqli->query("update ".$table_prefix."options set option_value='".($url)."' where option_name='siteurl'")) |
|
680 | 680 | throw new Exception(sprintf("Could not update the SITEURL option, error: %s\n", $mysqli->error)); |
681 | 681 | |
682 | 682 | return true; |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | { |
698 | 698 | $wp_config = $remote_path.DS."wp-config.php"; |
699 | 699 | |
700 | - if(!file_exists($wp_config)) |
|
700 | + if (!file_exists($wp_config)) |
|
701 | 701 | { |
702 | 702 | throw new Exception("Could not find the wp-config.php in ".$remote_path); |
703 | 703 | } |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | |
716 | 716 | $this->logger->info(sprintf('Updating wp-config.php file with the new mysql details')); |
717 | 717 | |
718 | - if(!file_put_contents($wp_config, $content)) |
|
718 | + if (!file_put_contents($wp_config, $content)) |
|
719 | 719 | throw new Exception("Could not write updated config data to ".$wp_config); |
720 | 720 | |
721 | 721 | chmod($wp_config, $file_perms); |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | |
736 | 736 | $hash = $this->get_hash_from_backup($source_backup_file); |
737 | 737 | |
738 | - $this->target_adapter = new Local($remote_path ,LOCK_EX, 'SKIP_LINKS'); |
|
738 | + $this->target_adapter = new Local($remote_path, LOCK_EX, 'SKIP_LINKS'); |
|
739 | 739 | $this->target_filesystem = new Filesystem($this->target_adapter, new Config([ |
740 | 740 | 'disable_asserts' => true, |
741 | 741 | ])); |
@@ -743,25 +743,25 @@ discard block |
||
743 | 743 | $mysqldump_list = array(); |
744 | 744 | $list = $this->target_filesystem->listContents(); |
745 | 745 | |
746 | - foreach($list as $file) |
|
746 | + foreach ($list as $file) |
|
747 | 747 | { |
748 | 748 | $matches = array(); |
749 | 749 | |
750 | - if($file['type'] == "dir") |
|
750 | + if ($file['type'] == "dir") |
|
751 | 751 | { |
752 | - if(preg_match("/xcloner-(\w*)/", $file['basename'], $matches)) |
|
752 | + if (preg_match("/xcloner-(\w*)/", $file['basename'], $matches)) |
|
753 | 753 | { |
754 | 754 | $files = $this->target_filesystem->listContents($file['basename']); |
755 | - foreach($files as $file) |
|
755 | + foreach ($files as $file) |
|
756 | 756 | { |
757 | - if($file['extension'] == "sql") |
|
757 | + if ($file['extension'] == "sql") |
|
758 | 758 | { |
759 | 759 | $this->logger->info(sprintf('Found %s mysql backup file', $file['path'])); |
760 | 760 | $mysqldump_list[$file['path']]['path'] = $file['path']; |
761 | 761 | $mysqldump_list[$file['path']]['size'] = $file['size']; |
762 | - $mysqldump_list[$file['path']]['timestamp'] = date("d M,Y H:i",$file['timestamp']); |
|
762 | + $mysqldump_list[$file['path']]['timestamp'] = date("d M,Y H:i", $file['timestamp']); |
|
763 | 763 | |
764 | - if($hash and $hash == $matches[1]) |
|
764 | + if ($hash and $hash == $matches[1]) |
|
765 | 765 | $mysqldump_list[$file['path']]['selected'] = "selected"; |
766 | 766 | else |
767 | 767 | $mysqldump_list[$file['path']]['selected'] = ""; |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | } |
772 | 772 | } |
773 | 773 | |
774 | - $this->sort_by($mysqldump_list, 'timestamp','desc'); |
|
774 | + $this->sort_by($mysqldump_list, 'timestamp', 'desc'); |
|
775 | 775 | $return['files'] = $mysqldump_list; |
776 | 776 | |
777 | 777 | $this->send_response(200, $return); |
@@ -785,12 +785,12 @@ discard block |
||
785 | 785 | */ |
786 | 786 | private function get_hash_from_backup($backup_file) |
787 | 787 | { |
788 | - if(!$backup_file) |
|
788 | + if (!$backup_file) |
|
789 | 789 | return false; |
790 | 790 | |
791 | - $result = preg_match("/-(\w*)./", substr($backup_file, strlen($backup_file)-10, strlen($backup_file)), $matches) ; |
|
791 | + $result = preg_match("/-(\w*)./", substr($backup_file, strlen($backup_file) - 10, strlen($backup_file)), $matches); |
|
792 | 792 | |
793 | - if($result and isset($matches[1])) |
|
793 | + if ($result and isset($matches[1])) |
|
794 | 794 | return ($matches[1]); |
795 | 795 | |
796 | 796 | return false; |
@@ -809,18 +809,18 @@ discard block |
||
809 | 809 | $backup_files = array(); |
810 | 810 | $parents = array(); |
811 | 811 | |
812 | - foreach($list as $file_info) |
|
812 | + foreach ($list as $file_info) |
|
813 | 813 | { |
814 | 814 | $data = array(); |
815 | 815 | |
816 | - if(isset($file_info['extension']) and $file_info['extension'] == "csv") |
|
816 | + if (isset($file_info['extension']) and $file_info['extension'] == "csv") |
|
817 | 817 | { |
818 | 818 | $lines = explode(PHP_EOL, $this->filesystem->read($file_info['path'])); |
819 | - foreach($lines as $line) |
|
820 | - if($line) |
|
819 | + foreach ($lines as $line) |
|
820 | + if ($line) |
|
821 | 821 | { |
822 | 822 | $data = str_getcsv($line); |
823 | - if(is_array($data)){ |
|
823 | + if (is_array($data)) { |
|
824 | 824 | $parents[$data[0]] = $file_info['path']; |
825 | 825 | $file_info['childs'][] = $data; |
826 | 826 | $file_info['size'] += $data[2]; |
@@ -829,19 +829,19 @@ discard block |
||
829 | 829 | |
830 | 830 | } |
831 | 831 | |
832 | - if($file_info['type'] == 'file' and isset($file_info['extension']) and in_array($file_info['extension'], $this->backup_archive_extensions)) |
|
832 | + if ($file_info['type'] == 'file' and isset($file_info['extension']) and in_array($file_info['extension'], $this->backup_archive_extensions)) |
|
833 | 833 | $backup_files[$file_info['path']] = $file_info; |
834 | 834 | } |
835 | 835 | |
836 | 836 | $new_list = array(); |
837 | 837 | |
838 | - foreach($backup_files as $key=>$file_info) |
|
838 | + foreach ($backup_files as $key=>$file_info) |
|
839 | 839 | { |
840 | - if(isset($parents[$file_info['path']])) |
|
840 | + if (isset($parents[$file_info['path']])) |
|
841 | 841 | $backup_files[$key]['parent'] = $parents[$file_info['path']]; |
842 | - else{ |
|
842 | + else { |
|
843 | 843 | |
844 | - if($local_backup_file and ($file_info['basename'] == $local_backup_file)) |
|
844 | + if ($local_backup_file and ($file_info['basename'] == $local_backup_file)) |
|
845 | 845 | $file_info['selected'] = 'selected'; |
846 | 846 | |
847 | 847 | $this->logger->info(sprintf('Found %s backup file', $file_info['path'])); |
@@ -851,7 +851,7 @@ discard block |
||
851 | 851 | |
852 | 852 | } |
853 | 853 | |
854 | - $this->sort_by($new_list, "timestamp","desc"); |
|
854 | + $this->sort_by($new_list, "timestamp", "desc"); |
|
855 | 855 | |
856 | 856 | $return['files'] = $new_list; |
857 | 857 | |
@@ -867,15 +867,15 @@ discard block |
||
867 | 867 | */ |
868 | 868 | public function restore_backup_to_path_action() |
869 | 869 | { |
870 | - $source_backup_file = filter_input(INPUT_POST, 'backup_file', FILTER_SANITIZE_STRING); |
|
871 | - $remote_path = filter_input(INPUT_POST, 'remote_path', FILTER_SANITIZE_STRING); |
|
870 | + $source_backup_file = filter_input(INPUT_POST, 'backup_file', FILTER_SANITIZE_STRING); |
|
871 | + $remote_path = filter_input(INPUT_POST, 'remote_path', FILTER_SANITIZE_STRING); |
|
872 | 872 | $include_filter_files = filter_input(INPUT_POST, 'filter_files', FILTER_SANITIZE_STRING); |
873 | 873 | $exclude_filter_files = ""; |
874 | - $start = filter_input(INPUT_POST, 'start', FILTER_SANITIZE_NUMBER_INT); |
|
875 | - $return['part'] = (int)filter_input(INPUT_POST, 'part', FILTER_SANITIZE_NUMBER_INT); |
|
874 | + $start = filter_input(INPUT_POST, 'start', FILTER_SANITIZE_NUMBER_INT); |
|
875 | + $return['part'] = (int)filter_input(INPUT_POST, 'part', FILTER_SANITIZE_NUMBER_INT); |
|
876 | 876 | $return['processed'] = (int)filter_input(INPUT_POST, 'processed', FILTER_SANITIZE_NUMBER_INT); |
877 | 877 | |
878 | - $this->target_adapter = new Local($remote_path ,LOCK_EX, 'SKIP_LINKS'); |
|
878 | + $this->target_adapter = new Local($remote_path, LOCK_EX, 'SKIP_LINKS'); |
|
879 | 879 | $this->target_filesystem = new Filesystem($this->target_adapter, new Config([ |
880 | 880 | 'disable_asserts' => true, |
881 | 881 | ])); |
@@ -887,9 +887,9 @@ discard block |
||
887 | 887 | $return['total_size'] = $this->get_backup_size($backup_file); |
888 | 888 | |
889 | 889 | $backup_archive = new Tar(); |
890 | - if($this->is_multipart($backup_file)) |
|
890 | + if ($this->is_multipart($backup_file)) |
|
891 | 891 | { |
892 | - if(!$return['part']) |
|
892 | + if (!$return['part']) |
|
893 | 893 | $return['processed'] += $this->filesystem->getSize($backup_file); |
894 | 894 | |
895 | 895 | $backup_parts = $this->get_multipart_files($backup_file); |
@@ -897,41 +897,41 @@ discard block |
||
897 | 897 | } |
898 | 898 | |
899 | 899 | $this->logger->info(sprintf('Opening backup archive %s at position %s', $backup_file, $start)); |
900 | - $backup_archive->open($this->backup_storage_dir .DS. $backup_file, $start); |
|
900 | + $backup_archive->open($this->backup_storage_dir.DS.$backup_file, $start); |
|
901 | 901 | |
902 | - $data = $backup_archive->extract($remote_path, '',$exclude_filter_files,$include_filter_files, $this->process_files_limit); |
|
902 | + $data = $backup_archive->extract($remote_path, '', $exclude_filter_files, $include_filter_files, $this->process_files_limit); |
|
903 | 903 | |
904 | - if(isset($data['extracted_files'])) |
|
904 | + if (isset($data['extracted_files'])) |
|
905 | 905 | { |
906 | - foreach($data['extracted_files'] as $spl_fileinfo) |
|
906 | + foreach ($data['extracted_files'] as $spl_fileinfo) |
|
907 | 907 | { |
908 | 908 | $this->logger->info(sprintf('Extracted %s file', $spl_fileinfo->getPath())); |
909 | 909 | $return['extracted_files'][] = $spl_fileinfo->getPath()." (".$spl_fileinfo->getSize()." bytes)"; |
910 | 910 | } |
911 | 911 | } |
912 | 912 | |
913 | - if(isset($data['start'])) |
|
913 | + if (isset($data['start'])) |
|
914 | 914 | //if(isset($data['start']) and $data['start'] <= $this->filesystem->getSize($backup_file)) |
915 | 915 | { |
916 | 916 | $return['finished'] = 0; |
917 | 917 | $return['start'] = $data['start']; |
918 | - }else{ |
|
918 | + } else { |
|
919 | 919 | |
920 | 920 | $return['processed'] += $start; |
921 | 921 | |
922 | - if($this->is_multipart($source_backup_file)) |
|
922 | + if ($this->is_multipart($source_backup_file)) |
|
923 | 923 | { |
924 | 924 | $return['start'] = 0; |
925 | 925 | |
926 | 926 | ++$return['part']; |
927 | 927 | |
928 | - if($return['part'] < sizeof($backup_parts)) |
|
928 | + if ($return['part'] < sizeof($backup_parts)) |
|
929 | 929 | $return['finished'] = 0; |
930 | 930 | |
931 | 931 | } |
932 | 932 | } |
933 | 933 | |
934 | - if($return['finished']) |
|
934 | + if ($return['finished']) |
|
935 | 935 | $this->logger->info(sprintf('Done extracting %s', $source_backup_file)); |
936 | 936 | |
937 | 937 | $return['backup_file'] = $backup_file; |
@@ -948,24 +948,24 @@ discard block |
||
948 | 948 | |
949 | 949 | $restore_script_url = filter_input(INPUT_POST, 'restore_script_url', FILTER_SANITIZE_STRING); |
950 | 950 | |
951 | - $pathinfo = pathinfo( __FILE__); |
|
951 | + $pathinfo = pathinfo(__FILE__); |
|
952 | 952 | |
953 | 953 | $suffix = ""; |
954 | 954 | $return['remote_mysql_host'] = "localhost"; |
955 | 955 | $return['remote_mysql_user'] = ""; |
956 | 956 | $return['remote_mysql_pass'] = ""; |
957 | - $return['remote_mysql_db'] = ""; |
|
957 | + $return['remote_mysql_db'] = ""; |
|
958 | 958 | |
959 | - if(defined('XCLONER_PLUGIN_ACCESS') && XCLONER_PLUGIN_ACCESS) |
|
959 | + if (defined('XCLONER_PLUGIN_ACCESS') && XCLONER_PLUGIN_ACCESS) |
|
960 | 960 | { |
961 | 961 | $return['dir'] = realpath(get_home_path().DS.$suffix); |
962 | - $return['restore_script_url'] = get_site_url(); |
|
962 | + $return['restore_script_url'] = get_site_url(); |
|
963 | 963 | $return['remote_mysql_host'] = $wpdb->dbhost; |
964 | 964 | $return['remote_mysql_user'] = $wpdb->dbuser; |
965 | 965 | $return['remote_mysql_pass'] = $wpdb->dbpassword; |
966 | - $return['remote_mysql_db'] = $wpdb->dbname; |
|
966 | + $return['remote_mysql_db'] = $wpdb->dbname; |
|
967 | 967 | } |
968 | - else{ |
|
968 | + else { |
|
969 | 969 | $return['dir'] = ($pathinfo['dirname']).DS.$suffix; |
970 | 970 | $return['restore_script_url'] = str_replace($pathinfo['basename'], "", $restore_script_url).$suffix; |
971 | 971 | } |
@@ -984,17 +984,17 @@ discard block |
||
984 | 984 | { |
985 | 985 | //check if i can write |
986 | 986 | $tmp_file = md5(time()); |
987 | - if(!file_put_contents($tmp_file, "++")) |
|
987 | + if (!file_put_contents($tmp_file, "++")) |
|
988 | 988 | throw new Exception("Could not write to new host"); |
989 | 989 | |
990 | - if(!unlink($tmp_file)) |
|
990 | + if (!unlink($tmp_file)) |
|
991 | 991 | throw new Exception("Could not delete temporary file from new host"); |
992 | 992 | |
993 | 993 | $max_upload = $this->return_bytes((ini_get('upload_max_filesize'))); |
994 | 994 | $max_post = $this->return_bytes((ini_get('post_max_size'))); |
995 | 995 | |
996 | 996 | $return['max_upload_size'] = min($max_upload, $max_post); // bytes |
997 | - $return['status'] = true; |
|
997 | + $return['status'] = true; |
|
998 | 998 | |
999 | 999 | $this->logger->info(sprintf('Current filesystem max upload size is %s bytes', $return['max_upload_size'])); |
1000 | 1000 | |
@@ -1010,8 +1010,8 @@ discard block |
||
1010 | 1010 | */ |
1011 | 1011 | private function return_bytes($val) { |
1012 | 1012 | $numeric_val = (int)trim($val); |
1013 | - $last = strtolower($val[strlen($val)-1]); |
|
1014 | - switch($last) { |
|
1013 | + $last = strtolower($val[strlen($val) - 1]); |
|
1014 | + switch ($last) { |
|
1015 | 1015 | // The 'G' modifier is available since PHP 5.1.0 |
1016 | 1016 | case 'g': |
1017 | 1017 | $numeric_val *= 1024; |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | */ |
1033 | 1033 | public function is_multipart($backup_name) |
1034 | 1034 | { |
1035 | - if(stristr($backup_name, "-multipart")) |
|
1035 | + if (stristr($backup_name, "-multipart")) |
|
1036 | 1036 | return true; |
1037 | 1037 | |
1038 | 1038 | return false; |
@@ -1048,10 +1048,10 @@ discard block |
||
1048 | 1048 | public function get_backup_size($backup_name) |
1049 | 1049 | { |
1050 | 1050 | $backup_size = $this->filesystem->getSize($backup_name); |
1051 | - if($this->is_multipart($backup_name)) |
|
1051 | + if ($this->is_multipart($backup_name)) |
|
1052 | 1052 | { |
1053 | 1053 | $backup_parts = $this->get_multipart_files($backup_name); |
1054 | - foreach($backup_parts as $part_file) |
|
1054 | + foreach ($backup_parts as $part_file) |
|
1055 | 1055 | $backup_size += $this->filesystem->getSize($part_file); |
1056 | 1056 | } |
1057 | 1057 | |
@@ -1068,12 +1068,12 @@ discard block |
||
1068 | 1068 | { |
1069 | 1069 | $files = array(); |
1070 | 1070 | |
1071 | - if($this->is_multipart($backup_name)) |
|
1071 | + if ($this->is_multipart($backup_name)) |
|
1072 | 1072 | { |
1073 | 1073 | $lines = explode(PHP_EOL, $this->filesystem->read($backup_name)); |
1074 | - foreach($lines as $line) |
|
1074 | + foreach ($lines as $line) |
|
1075 | 1075 | { |
1076 | - if($line) |
|
1076 | + if ($line) |
|
1077 | 1077 | { |
1078 | 1078 | $data = str_getcsv($line); |
1079 | 1079 | $files[] = $data[0]; |
@@ -1092,7 +1092,7 @@ discard block |
||
1092 | 1092 | * @param string $direction |
1093 | 1093 | * @return bool |
1094 | 1094 | */ |
1095 | - private function sort_by( &$array, $field, $direction = 'asc') |
|
1095 | + private function sort_by(&$array, $field, $direction = 'asc') |
|
1096 | 1096 | { |
1097 | 1097 | $direction = strtolower($direction); |
1098 | 1098 | |
@@ -1107,18 +1107,18 @@ discard block |
||
1107 | 1107 | return 0; |
1108 | 1108 | } |
1109 | 1109 | |
1110 | - if($direction == 'desc') { |
|
1111 | - if($a > $b) { |
|
1110 | + if ($direction == 'desc') { |
|
1111 | + if ($a > $b) { |
|
1112 | 1112 | return -1; |
1113 | 1113 | } |
1114 | - else{ |
|
1114 | + else { |
|
1115 | 1115 | return 1; |
1116 | 1116 | } |
1117 | - }else { |
|
1118 | - if($a < $b) { |
|
1117 | + } else { |
|
1118 | + if ($a < $b) { |
|
1119 | 1119 | return -1; |
1120 | 1120 | } |
1121 | - else{ |
|
1121 | + else { |
|
1122 | 1122 | return 1; |
1123 | 1123 | } |
1124 | 1124 | } |
@@ -1144,11 +1144,11 @@ discard block |
||
1144 | 1144 | $return['status'] = $status; |
1145 | 1145 | $return['statusText'] = $response; |
1146 | 1146 | |
1147 | - if(isset($response['error']) && $response['error']) |
|
1147 | + if (isset($response['error']) && $response['error']) |
|
1148 | 1148 | { |
1149 | 1149 | $return['statusText'] = $response['message']; |
1150 | 1150 | $return['error'] = true; |
1151 | - }elseif($status != 200 and $status != 418) |
|
1151 | + }elseif ($status != 200 and $status != 418) |
|
1152 | 1152 | { |
1153 | 1153 | $return['error'] = true; |
1154 | 1154 | $return['message'] = $response; |
@@ -1167,12 +1167,12 @@ discard block |
||
1167 | 1167 | |
1168 | 1168 | function do_serialized_fix($query) |
1169 | 1169 | { |
1170 | - $query = str_replace(array("\\n","\\r","\\'"), array("","","\""), ($query)); |
|
1170 | + $query = str_replace(array("\\n", "\\r", "\\'"), array("", "", "\""), ($query)); |
|
1171 | 1171 | |
1172 | - return preg_replace_callback('!s:(\d+):([\\\\]?"[\\\\]?"|[\\\\]?"((.*?)[^\\\\])[\\\\]?");!', function ($m) { |
|
1172 | + return preg_replace_callback('!s:(\d+):([\\\\]?"[\\\\]?"|[\\\\]?"((.*?)[^\\\\])[\\\\]?");!', function($m) { |
|
1173 | 1173 | $data = ""; |
1174 | 1174 | |
1175 | - if(!isset($m[3])) |
|
1175 | + if (!isset($m[3])) |
|
1176 | 1176 | $m[3] = ""; |
1177 | 1177 | |
1178 | 1178 | $data = 's:'.strlen(($m[3])).':\"'.($m[3]).'\";'; |
@@ -1199,8 +1199,8 @@ discard block |
||
1199 | 1199 | * @return mixed |
1200 | 1200 | */ |
1201 | 1201 | private function unescape_mysql($value) { |
1202 | - return str_replace(array("\\\\", "\\0", "\\n", "\\r", "\Z", "\'", '\"'), |
|
1203 | - array("\\", "\0", "\n", "\r", "\x1a", "'", '"'), |
|
1202 | + return str_replace(array("\\\\", "\\0", "\\n", "\\r", "\Z", "\'", '\"'), |
|
1203 | + array("\\", "\0", "\n", "\r", "\x1a", "'", '"'), |
|
1204 | 1204 | $value); |
1205 | 1205 | } |
1206 | 1206 | |
@@ -1212,14 +1212,14 @@ discard block |
||
1212 | 1212 | */ |
1213 | 1213 | private function has_serialized($s) |
1214 | 1214 | { |
1215 | - if( |
|
1216 | - stristr($s, '{' ) != false && |
|
1217 | - stristr($s, '}' ) != false && |
|
1218 | - stristr($s, ';' ) != false && |
|
1219 | - stristr($s, ':' ) != false |
|
1220 | - ){ |
|
1215 | + if ( |
|
1216 | + stristr($s, '{') != false && |
|
1217 | + stristr($s, '}') != false && |
|
1218 | + stristr($s, ';') != false && |
|
1219 | + stristr($s, ':') != false |
|
1220 | + ) { |
|
1221 | 1221 | return true; |
1222 | - }else{ |
|
1222 | + } else { |
|
1223 | 1223 | return false; |
1224 | 1224 | } |
1225 | 1225 |
@@ -20,12 +20,12 @@ discard block |
||
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 | 26 | //$xcloner_file_system->cleanup_tmp_directories(); |
27 | 27 | |
28 | -if ( $requirements->check_backup_ready_status() ) { |
|
28 | +if ($requirements->check_backup_ready_status()) { |
|
29 | 29 | $latest_backup = $xcloner_file_system->get_latest_backup(); |
30 | 30 | $xcloner_file_system->backup_storage_cleanup(); |
31 | 31 | } |
@@ -34,15 +34,15 @@ discard block |
||
34 | 34 | <div class="row"> |
35 | 35 | <div class="col s12"> |
36 | 36 | <h5 class="left-align"> |
37 | - <?php echo __( 'Backup Dashboard', 'xcloner-backup-and-restore' ) ?> |
|
37 | + <?php echo __('Backup Dashboard', 'xcloner-backup-and-restore') ?> |
|
38 | 38 | </h5> |
39 | 39 | </div> |
40 | 40 | </div> |
41 | 41 | |
42 | -<?php if ( isset( $latest_backup['timestamp'] ) and $latest_backup['timestamp'] < strtotime( "-1 day" ) ): ?> |
|
42 | +<?php if (isset($latest_backup['timestamp']) and $latest_backup['timestamp'] < strtotime("-1 day")): ?> |
|
43 | 43 | <div id="setting-error-" class="error settings-error notice is-dismissible"> |
44 | 44 | <p><strong> |
45 | - <?php echo __( 'Your latest backup is older than 24 hours, please create a new backup to keep your site protected.', 'xcloner-backup-and-restore' ) ?> |
|
45 | + <?php echo __('Your latest backup is older than 24 hours, please create a new backup to keep your site protected.', 'xcloner-backup-and-restore') ?> |
|
46 | 46 | </strong> |
47 | 47 | </p> |
48 | 48 | <button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span> |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | </div> |
51 | 51 | <?php endif ?> |
52 | 52 | |
53 | -<?php if ( ! isset( $latest_backup['timestamp'] ) ): ?> |
|
53 | +<?php if (!isset($latest_backup['timestamp'])): ?> |
|
54 | 54 | <div id="setting-error-" class="error settings-error notice is-dismissible"> |
55 | 55 | <p><strong> |
56 | - <?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 | + <?php echo __('You have no backup that I could find, please generate a new backup to keep your site protected.', 'xcloner-backup-and-restore') ?> |
|
57 | 57 | </strong> |
58 | 58 | </p> |
59 | 59 | <button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span> |
@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | </div> |
62 | 62 | <?php endif ?> |
63 | 63 | |
64 | -<?php if ( ! $requirements->check_backup_ready_status() ): ?> |
|
64 | +<?php if (!$requirements->check_backup_ready_status()): ?> |
|
65 | 65 | <div id="setting-error-" class="error settings-error notice is-dismissible"> |
66 | 66 | <p><strong> |
67 | - <?php echo __( 'Backup system not ready, please check and fix the issues marked in red', 'xcloner-backup-and-restore' ) ?> |
|
67 | + <?php echo __('Backup system not ready, please check and fix the issues marked in red', 'xcloner-backup-and-restore') ?> |
|
68 | 68 | </strong> |
69 | 69 | </p> |
70 | 70 | <button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span> |
@@ -87,74 +87,74 @@ discard block |
||
87 | 87 | <div class="collapsible-body"> |
88 | 88 | <div class="" id="backup-status"> |
89 | 89 | <div class="row"> |
90 | - <h5><?php echo __( "Latest Backup", 'xcloner-backup-and-restore' ) ?></h5> |
|
90 | + <h5><?php echo __("Latest Backup", 'xcloner-backup-and-restore') ?></h5> |
|
91 | 91 | <blockquote> |
92 | - <?php if ( isset($latest_backup) ): ?> |
|
92 | + <?php if (isset($latest_backup)): ?> |
|
93 | 93 | <div class="item"> |
94 | - <div class="title"><?php echo __( "Backup Name", 'xcloner-backup-and-restore' ) ?> |
|
94 | + <div class="title"><?php echo __("Backup Name", 'xcloner-backup-and-restore') ?> |
|
95 | 95 | : |
96 | 96 | </div> |
97 | 97 | <?php echo $latest_backup['basename'] ?> |
98 | 98 | </div> |
99 | 99 | <div class="item"> |
100 | 100 | <div class="title"> |
101 | - <?php echo __( "Backup Size", 'xcloner-backup-and-restore' ) ?>: |
|
101 | + <?php echo __("Backup Size", 'xcloner-backup-and-restore') ?>: |
|
102 | 102 | </div> |
103 | - <?php echo size_format( $latest_backup['size'] ) ?> |
|
103 | + <?php echo size_format($latest_backup['size']) ?> |
|
104 | 104 | </div> |
105 | 105 | <div class="item"> |
106 | - <div class="title"><?php echo __( "Backup Date", 'xcloner-backup-and-restore' ) ?> |
|
106 | + <div class="title"><?php echo __("Backup Date", 'xcloner-backup-and-restore') ?> |
|
107 | 107 | : |
108 | 108 | </div> |
109 | 109 | <?php |
110 | - echo date( $date_format . " " . $time_format, $latest_backup['timestamp'] + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) |
|
110 | + echo date($date_format." ".$time_format, $latest_backup['timestamp'] + (get_option('gmt_offset') * HOUR_IN_SECONDS)) |
|
111 | 111 | ?> |
112 | 112 | </div> |
113 | 113 | <?php else: ?> |
114 | 114 | <div class="item"> |
115 | - <div class="title"><?php echo __( "No Backup Yet", 'xcloner-backup-and-restore' ) ?></div> |
|
115 | + <div class="title"><?php echo __("No Backup Yet", 'xcloner-backup-and-restore') ?></div> |
|
116 | 116 | </div> |
117 | 117 | <?php endif ?> |
118 | 118 | </blockquote> |
119 | 119 | <div> |
120 | - <h5><?php echo __( "Backup Storage Usage", 'xcloner-backup-and-restore' ) ?></h5> |
|
120 | + <h5><?php echo __("Backup Storage Usage", 'xcloner-backup-and-restore') ?></h5> |
|
121 | 121 | <blockquote> |
122 | 122 | <div class="item"> |
123 | - <div class="title"><?php echo __( "Total Size", 'xcloner-backup-and-restore' ) ?> |
|
123 | + <div class="title"><?php echo __("Total Size", 'xcloner-backup-and-restore') ?> |
|
124 | 124 | : |
125 | 125 | </div> |
126 | - <?php echo size_format( $xcloner_file_system->get_storage_usage() ); ?> |
|
126 | + <?php echo size_format($xcloner_file_system->get_storage_usage()); ?> |
|
127 | 127 | </div> |
128 | 128 | </blockquote> |
129 | - <h5><?php echo __( "Next Scheduled Backup", 'xcloner-backup-and-restore' ) ?></h5> |
|
129 | + <h5><?php echo __("Next Scheduled Backup", 'xcloner-backup-and-restore') ?></h5> |
|
130 | 130 | <blockquote> |
131 | 131 | <div class="item"> |
132 | 132 | <?php |
133 | - $list = ( $xcloner_scheduler->get_next_run_schedule() ); |
|
133 | + $list = ($xcloner_scheduler->get_next_run_schedule()); |
|
134 | 134 | |
135 | - if ( is_array( $list ) ) { |
|
136 | - $xcloner_file_system->sort_by( $list, "next_run_time", "asc" ); |
|
135 | + if (is_array($list)) { |
|
136 | + $xcloner_file_system->sort_by($list, "next_run_time", "asc"); |
|
137 | 137 | } |
138 | 138 | |
139 | - if ( isset( $list[0] ) ) { |
|
139 | + if (isset($list[0])) { |
|
140 | 140 | $latest_schedule = $list[0]; |
141 | 141 | } |
142 | 142 | ?> |
143 | - <?php if ( isset( $latest_schedule->name ) ): ?> |
|
144 | - <div class="title"><?php echo __( "Schedule Name", 'xcloner-backup-and-restore' ) ?> |
|
143 | + <?php if (isset($latest_schedule->name)): ?> |
|
144 | + <div class="title"><?php echo __("Schedule Name", 'xcloner-backup-and-restore') ?> |
|
145 | 145 | : |
146 | 146 | </div> |
147 | 147 | <?php echo $latest_schedule->name; ?> |
148 | 148 | <?php endif; ?> |
149 | 149 | </div> |
150 | 150 | <div class="item"> |
151 | - <div class="title"><?php echo __( "Next Call", 'xcloner-backup-and-restore' ) ?> |
|
151 | + <div class="title"><?php echo __("Next Call", 'xcloner-backup-and-restore') ?> |
|
152 | 152 | : |
153 | 153 | </div> |
154 | - <?php if ( isset( $latest_schedule->next_run_time ) ) { |
|
155 | - echo date( $date_format . " " . $time_format, $latest_schedule->next_run_time ); |
|
154 | + <?php if (isset($latest_schedule->next_run_time)) { |
|
155 | + echo date($date_format." ".$time_format, $latest_schedule->next_run_time); |
|
156 | 156 | } else { |
157 | - echo __( "Unscheduled", 'xcloner-backup-and-restore' ); |
|
157 | + echo __("Unscheduled", 'xcloner-backup-and-restore'); |
|
158 | 158 | } |
159 | 159 | ?> |
160 | 160 | </div> |
@@ -163,20 +163,20 @@ discard block |
||
163 | 163 | </div> |
164 | 164 | </li> |
165 | 165 | |
166 | - <?php if ( $xcloner_settings->get_xcloner_option( 'xcloner_enable_log' ) ) : ?> |
|
166 | + <?php if ($xcloner_settings->get_xcloner_option('xcloner_enable_log')) : ?> |
|
167 | 167 | <li class="active"> |
168 | 168 | <div class="collapsible-header active"> |
169 | - <i class="material-icons">bug_report</i><?php echo __( 'XCloner Debugger', 'xcloner-backup-and-restore' ) ?> |
|
169 | + <i class="material-icons">bug_report</i><?php echo __('XCloner Debugger', 'xcloner-backup-and-restore') ?> |
|
170 | 170 | <div class="right"> |
171 | - <a href="#<?php echo $logger_basename = basename( $logger->get_main_logger_url() ) ?>" |
|
171 | + <a href="#<?php echo $logger_basename = basename($logger->get_main_logger_url()) ?>" |
|
172 | 172 | class="download-logger" title="<?php echo $logger_basename ?>"> |
173 | 173 | <span class="shorten_string"><?php echo $logger_basename ?> </span> |
174 | 174 | </a> |
175 | 175 | </div> |
176 | 176 | </div> |
177 | 177 | <div class="collapsible-body"> |
178 | - <div class="console" id="xcloner-console"><?php if ( $logger_content ) { |
|
179 | - echo implode( "<br />\n", array_reverse( $logger_content ) ); |
|
178 | + <div class="console" id="xcloner-console"><?php if ($logger_content) { |
|
179 | + echo implode("<br />\n", array_reverse($logger_content)); |
|
180 | 180 | } ?></div> |
181 | 181 | </div> |
182 | 182 | </li> |
@@ -201,71 +201,71 @@ discard block |
||
201 | 201 | |
202 | 202 | <div class="card blue-grey darken-1 z-depth-4 backup-ready"> |
203 | 203 | <div class="card-content white-text"> |
204 | - <span class="card-title"><?php echo __( "System Check", 'xcloner-backup-and-restore' ) ?></span> |
|
204 | + <span class="card-title"><?php echo __("System Check", 'xcloner-backup-and-restore') ?></span> |
|
205 | 205 | <ul> |
206 | - <li class="card-panel <?php echo( $requirements->check_xcloner_start_path( 1 ) ? "teal" : "red" ) ?> lighten-2"> |
|
207 | - <?php echo __( 'Backup Start Location', 'xcloner-backup-and-restore' ) ?>: <span |
|
206 | + <li class="card-panel <?php echo($requirements->check_xcloner_start_path(1) ? "teal" : "red") ?> lighten-2"> |
|
207 | + <?php echo __('Backup Start Location', 'xcloner-backup-and-restore') ?>: <span |
|
208 | 208 | class="shorten_string "><?php echo $requirements->check_xcloner_start_path(); ?></span> |
209 | 209 | </li> |
210 | - <li class="card-panel <?php echo( $requirements->check_xcloner_store_path( 1 ) ? "teal" : "red" ) ?> lighten-2"> |
|
211 | - <?php echo __( 'Backup Storage Location', 'xcloner-backup-and-restore' ) ?>: <span |
|
210 | + <li class="card-panel <?php echo($requirements->check_xcloner_store_path(1) ? "teal" : "red") ?> lighten-2"> |
|
211 | + <?php echo __('Backup Storage Location', 'xcloner-backup-and-restore') ?>: <span |
|
212 | 212 | class="shorten_string"><?php echo $requirements->check_xcloner_store_path(); ?></span> |
213 | 213 | </li> |
214 | - <li class="card-panel <?php echo( $requirements->check_xcloner_tmp_path( 1 ) ? "teal" : "red" ) ?> lighten-2"> |
|
215 | - <?php echo __( 'Temporary Location', 'xcloner-backup-and-restore' ) ?>: <span |
|
214 | + <li class="card-panel <?php echo($requirements->check_xcloner_tmp_path(1) ? "teal" : "red") ?> lighten-2"> |
|
215 | + <?php echo __('Temporary Location', 'xcloner-backup-and-restore') ?>: <span |
|
216 | 216 | class="shorten_string"><?php echo $requirements->check_xcloner_tmp_path(); ?></span> |
217 | 217 | </li> |
218 | 218 | |
219 | - <li class="card-panel <?php echo( $requirements->check_min_php_version( 1 ) ? "teal" : "red" ) ?> lighten-2"> |
|
220 | - <?php echo __( 'PHP Version Check', 'xcloner-backup-and-restore' ) ?> |
|
219 | + <li class="card-panel <?php echo($requirements->check_min_php_version(1) ? "teal" : "red") ?> lighten-2"> |
|
220 | + <?php echo __('PHP Version Check', 'xcloner-backup-and-restore') ?> |
|
221 | 221 | : <?php echo $requirements->check_min_php_version(); ?> |
222 | - ( >= <?php echo $requirements->get_constant( 'min_php_version' ) ?>) |
|
222 | + ( >= <?php echo $requirements->get_constant('min_php_version') ?>) |
|
223 | 223 | </li> |
224 | - <li class="card-panel <?php echo( $requirements->check_safe_mode( 1 ) ? "teal" : "orange" ) ?> lighten-2"> |
|
225 | - <?php echo __( 'PHP Safe Mode', 'xcloner-backup-and-restore' ) ?> |
|
224 | + <li class="card-panel <?php echo($requirements->check_safe_mode(1) ? "teal" : "orange") ?> lighten-2"> |
|
225 | + <?php echo __('PHP Safe Mode', 'xcloner-backup-and-restore') ?> |
|
226 | 226 | : <?php echo $requirements->check_safe_mode(); ?> |
227 | - ( <?php echo $requirements->get_constant( 'safe_mode' ) ?>) |
|
227 | + ( <?php echo $requirements->get_constant('safe_mode') ?>) |
|
228 | 228 | </li> |
229 | - <li class="card-panel <?php echo( $requirements->check_backup_ready_status() ? "teal" : "red" ) ?> lighten-2"> |
|
230 | - <?php echo( $requirements->check_backup_ready_status() ? __( 'BACKUP READY', 'xcloner-backup-and-restore' ) : __( 'Backup not ready, please check above requirements', 'xcloner-backup-and-restore' ) ) ?> |
|
231 | - <i class="material-icons right tiny"><?php echo( $requirements->check_backup_ready_status() ? 'thumb_up' : 'thumb_down' ) ?></i> |
|
229 | + <li class="card-panel <?php echo($requirements->check_backup_ready_status() ? "teal" : "red") ?> lighten-2"> |
|
230 | + <?php echo($requirements->check_backup_ready_status() ? __('BACKUP READY', 'xcloner-backup-and-restore') : __('Backup not ready, please check above requirements', 'xcloner-backup-and-restore')) ?> |
|
231 | + <i class="material-icons right tiny"><?php echo($requirements->check_backup_ready_status() ? 'thumb_up' : 'thumb_down') ?></i> |
|
232 | 232 | </li> |
233 | 233 | </ul> |
234 | 234 | <ul class="additional_system_info"> |
235 | 235 | <li class="card-panel grey darken-1"> |
236 | - <?php echo __( 'PHP max_execution_time', 'xcloner-backup-and-restore' ) ?> |
|
236 | + <?php echo __('PHP max_execution_time', 'xcloner-backup-and-restore') ?> |
|
237 | 237 | : <?php echo $requirements->get_max_execution_time(); ?> |
238 | 238 | </li> |
239 | 239 | <li class="card-panel grey darken-1"> |
240 | - <?php echo __( 'PHP memory_limit', 'xcloner-backup-and-restore' ) ?> |
|
240 | + <?php echo __('PHP memory_limit', 'xcloner-backup-and-restore') ?> |
|
241 | 241 | : <?php echo $requirements->get_memory_limit(); ?> |
242 | 242 | </li> |
243 | 243 | <li class="card-panel grey darken-1"> |
244 | - <?php echo __( 'PHP open_basedir', 'xcloner-backup-and-restore' ) ?> |
|
244 | + <?php echo __('PHP open_basedir', 'xcloner-backup-and-restore') ?> |
|
245 | 245 | : <?php echo $requirements->get_open_basedir(); ?> |
246 | 246 | </li> |
247 | 247 | <?php |
248 | 248 | $data = array(); |
249 | - if ( $requirements->check_backup_ready_status() ) { |
|
249 | + if ($requirements->check_backup_ready_status()) { |
|
250 | 250 | $data = $xcloner_file_system->estimate_read_write_time(); |
251 | 251 | } |
252 | 252 | ?> |
253 | 253 | <li class="card-panel grey darken-1"> |
254 | - <?php echo __( 'Reading Time 1MB Block', 'xcloner-backup-and-restore' ) ?> |
|
255 | - : <?php echo( isset( $data['reading_time'] ) ? $data['reading_time'] : __( "unknown" ) ); ?> |
|
254 | + <?php echo __('Reading Time 1MB Block', 'xcloner-backup-and-restore') ?> |
|
255 | + : <?php echo(isset($data['reading_time']) ? $data['reading_time'] : __("unknown")); ?> |
|
256 | 256 | </li> |
257 | 257 | <li class="card-panel grey darken-1"> |
258 | - <?php echo __( 'Writing Time 1MB Block', 'xcloner-backup-and-restore' ) ?> |
|
259 | - : <?php echo( isset( $data['writing_time'] ) ? $data['writing_time'] : __( "unknown" ) ); ?> |
|
258 | + <?php echo __('Writing Time 1MB Block', 'xcloner-backup-and-restore') ?> |
|
259 | + : <?php echo(isset($data['writing_time']) ? $data['writing_time'] : __("unknown")); ?> |
|
260 | 260 | </li> |
261 | 261 | <li class="card-panel grey darken-1"> |
262 | - <?php echo __( 'Free Disk Space', 'xcloner-backup-and-restore' ) ?> |
|
263 | - : <?php echo $requirements->get_free_disk_space();; ?> |
|
262 | + <?php echo __('Free Disk Space', 'xcloner-backup-and-restore') ?> |
|
263 | + : <?php echo $requirements->get_free_disk_space(); ; ?> |
|
264 | 264 | </li> |
265 | 265 | </ul> |
266 | 266 | </div> |
267 | 267 | <div class="card-action"> |
268 | - <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' ) ?> |
|
268 | + <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') ?> |
|
269 | 269 | </a> |
270 | 270 | </div> |
271 | 271 | </div> |
@@ -4,10 +4,10 @@ discard block |
||
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 | - <?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" ) ?> |
|
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") ?> |
|
11 | 11 | </strong> |
12 | 12 | </p> |
13 | 13 | <button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span> |
@@ -15,32 +15,32 @@ discard block |
||
15 | 15 | </div> |
16 | 16 | <?php endif ?> |
17 | 17 | |
18 | -<h1><?= esc_html( get_admin_page_title() ); ?></h1> |
|
18 | +<h1><?= esc_html(get_admin_page_title()); ?></h1> |
|
19 | 19 | |
20 | 20 | <div class="row"> |
21 | 21 | <table id="scheduled_backups" class="col s12" cellspacing="0" width="100%"> |
22 | 22 | <thead> |
23 | 23 | <tr class="grey lighten-2"> |
24 | - <th><?php echo __( 'ID', 'xcloner-backup-and-restore' ) ?></th> |
|
25 | - <th><?php echo __( 'Schedule Name', 'xcloner-backup-and-restore' ) ?></th> |
|
26 | - <th><?php echo __( 'Recurrence', 'xcloner-backup-and-restore' ) ?></th> |
|
27 | - <th class="hide-on-med-and-down"><?php echo __( 'Next Execution', 'xcloner-backup-and-restore' ) ?></th> |
|
28 | - <th><?php echo __( 'Remote Storage', 'xcloner-backup-and-restore' ) ?></th> |
|
29 | - <th class="hide-on-med-and-down"><?php echo __( 'Last Backup', 'xcloner-backup-and-restore' ) ?></th> |
|
30 | - <th><?php echo __( 'Status', 'xcloner-backup-and-restore' ) ?></th> |
|
31 | - <th class="no-sort"><?php echo __( 'Action', 'xcloner-backup-and-restore' ) ?></th> |
|
24 | + <th><?php echo __('ID', 'xcloner-backup-and-restore') ?></th> |
|
25 | + <th><?php echo __('Schedule Name', 'xcloner-backup-and-restore') ?></th> |
|
26 | + <th><?php echo __('Recurrence', 'xcloner-backup-and-restore') ?></th> |
|
27 | + <th class="hide-on-med-and-down"><?php echo __('Next Execution', 'xcloner-backup-and-restore') ?></th> |
|
28 | + <th><?php echo __('Remote Storage', 'xcloner-backup-and-restore') ?></th> |
|
29 | + <th class="hide-on-med-and-down"><?php echo __('Last Backup', 'xcloner-backup-and-restore') ?></th> |
|
30 | + <th><?php echo __('Status', 'xcloner-backup-and-restore') ?></th> |
|
31 | + <th class="no-sort"><?php echo __('Action', 'xcloner-backup-and-restore') ?></th> |
|
32 | 32 | </tr> |
33 | 33 | </thead> |
34 | 34 | <tfoot> |
35 | 35 | <tr> |
36 | - <th><?php echo __( 'ID', 'xcloner-backup-and-restore' ) ?></th> |
|
37 | - <th><?php echo __( 'Schedule Name', 'xcloner-backup-and-restore' ) ?></th> |
|
38 | - <th><?php echo __( 'Recurrence', 'xcloner-backup-and-restore' ) ?></th> |
|
39 | - <th class="hide-on-med-and-down"><?php echo __( 'Next Execution', 'xcloner-backup-and-restore' ) ?></th> |
|
40 | - <th><?php echo __( 'Remote Storage', 'xcloner-backup-and-restore' ) ?></th> |
|
41 | - <th class="hide-on-med-and-down"><?php echo __( 'Last Backup', 'xcloner-backup-and-restore' ) ?></th> |
|
42 | - <th><?php echo __( 'Status', 'xcloner-backup-and-restore' ) ?></th> |
|
43 | - <th><?php echo __( 'Action', 'xcloner-backup-and-restore' ) ?></th> |
|
36 | + <th><?php echo __('ID', 'xcloner-backup-and-restore') ?></th> |
|
37 | + <th><?php echo __('Schedule Name', 'xcloner-backup-and-restore') ?></th> |
|
38 | + <th><?php echo __('Recurrence', 'xcloner-backup-and-restore') ?></th> |
|
39 | + <th class="hide-on-med-and-down"><?php echo __('Next Execution', 'xcloner-backup-and-restore') ?></th> |
|
40 | + <th><?php echo __('Remote Storage', 'xcloner-backup-and-restore') ?></th> |
|
41 | + <th class="hide-on-med-and-down"><?php echo __('Last Backup', 'xcloner-backup-and-restore') ?></th> |
|
42 | + <th><?php echo __('Status', 'xcloner-backup-and-restore') ?></th> |
|
43 | + <th><?php echo __('Action', 'xcloner-backup-and-restore') ?></th> |
|
44 | 44 | </tr> |
45 | 45 | </tfoot> |
46 | 46 | <tbody> |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | |
51 | 51 | <div class="row"> |
52 | 52 | <div class="col s12 m6 offset-m6 teal lighten-1" id="server_time"> |
53 | - <h2><?php echo __( 'Current Server Time', 'xcloner-backup-and-restore' ) ?>: <span |
|
54 | - class="right"><?php echo current_time( 'mysql' ); ?></span></h2> |
|
53 | + <h2><?php echo __('Current Server Time', 'xcloner-backup-and-restore') ?>: <span |
|
54 | + class="right"><?php echo current_time('mysql'); ?></span></h2> |
|
55 | 55 | </div> |
56 | 56 | </div> |
57 | 57 | |
@@ -65,17 +65,17 @@ discard block |
||
65 | 65 | |
66 | 66 | <div class="row"> |
67 | 67 | <div class="col s12 m6"> |
68 | - <h4><?php echo __( 'Edit Schedule', 'xcloner-backup-and-restore' ) ?> #<span |
|
68 | + <h4><?php echo __('Edit Schedule', 'xcloner-backup-and-restore') ?> #<span |
|
69 | 69 | id="schedule_id"></span></h4> |
70 | 70 | </div> |
71 | 71 | |
72 | 72 | <div class="col s12 m6 right-align"> |
73 | 73 | <div class="switch"> |
74 | 74 | <label> |
75 | - <?php echo __( 'Off', 'xcloner-backup-and-restore' ) ?> |
|
75 | + <?php echo __('Off', 'xcloner-backup-and-restore') ?> |
|
76 | 76 | <input type="checkbox" id="status" name="status" value="1"> |
77 | 77 | <span class="lever"></span> |
78 | - <?php echo __( 'On', 'xcloner-backup-and-restore' ) ?> |
|
78 | + <?php echo __('On', 'xcloner-backup-and-restore') ?> |
|
79 | 79 | </label> |
80 | 80 | </div> |
81 | 81 | </div> |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | |
86 | 86 | <ul class="nav-tab-wrapper content row"> |
87 | 87 | <li><a href="#scheduler_settings" |
88 | - class="nav-tab col s12 m6 nav-tab-active"><?php echo __( 'Scheduler Settings', 'xcloner-backup-and-restore' ) ?></a> |
|
88 | + class="nav-tab col s12 m6 nav-tab-active"><?php echo __('Scheduler Settings', 'xcloner-backup-and-restore') ?></a> |
|
89 | 89 | </li> |
90 | 90 | <li><a href="#advanced_scheduler_settings" |
91 | - class="nav-tab col s12 m6"><?php echo __( 'Advanced', 'xcloner-backup-and-restore' ) ?></a></li> |
|
91 | + class="nav-tab col s12 m6"><?php echo __('Advanced', 'xcloner-backup-and-restore') ?></a></li> |
|
92 | 92 | </ul> |
93 | 93 | |
94 | 94 | <div class="nav-tab-wrapper-content"> |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | <div class="row"> |
98 | 98 | <div class="input-field col s12 l6"> |
99 | 99 | <input placeholder="" name="schedule_name" id="schedule_name" type="text" required value=""> |
100 | - <label for="schedule_name"><?php echo __( 'Schedule Name', 'xcloner-backup-and-restore' ) ?></label> |
|
100 | + <label for="schedule_name"><?php echo __('Schedule Name', 'xcloner-backup-and-restore') ?></label> |
|
101 | 101 | </div> |
102 | 102 | <div class="input-field col s12 l6"> |
103 | 103 | <div class="switch"> |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | </div> |
113 | 113 | <!--<div class="input-field inline col s12 l6"> |
114 | 114 | <select id="backup_type" class="" name="backup_type" id="backup_type"> |
115 | - <option value=""><?php echo __( "Full Backup", "xcloner-backup-and-restore" ); ?></option> |
|
116 | - <option value="diff"><?php echo __( "Differential Backups", "xcloner-backup-and-restore" ); ?></option> |
|
117 | - <option value="full_diff"><?php echo __( "Full Backup + Differential Backups", "xcloner-backup-and-restore" ); ?></option> |
|
115 | + <option value=""><?php echo __("Full Backup", "xcloner-backup-and-restore"); ?></option> |
|
116 | + <option value="diff"><?php echo __("Differential Backups", "xcloner-backup-and-restore"); ?></option> |
|
117 | + <option value="full_diff"><?php echo __("Full Backup + Differential Backups", "xcloner-backup-and-restore"); ?></option> |
|
118 | 118 | </select> |
119 | - <label for="backup_type"><?php echo __( 'Scheduled Backup Type', 'xcloner-backup-and-restore' ) ?></label> |
|
119 | + <label for="backup_type"><?php echo __('Scheduled Backup Type', 'xcloner-backup-and-restore') ?></label> |
|
120 | 120 | </div>--> |
121 | 121 | </div> |
122 | 122 | |
@@ -125,18 +125,18 @@ discard block |
||
125 | 125 | <input placeholder="" name="schedule_start_date" id="schedule_start_date" type="datetime" |
126 | 126 | value=""> |
127 | 127 | <label for="schedule_start_date" |
128 | - class="active"><?php echo __( 'Schedule Start At', 'xcloner-backup-and-restore' ) ?> |
|
128 | + class="active"><?php echo __('Schedule Start At', 'xcloner-backup-and-restore') ?> |
|
129 | 129 | :</label> |
130 | 130 | </div> |
131 | 131 | |
132 | 132 | <div class="input-field col s12 l6"> |
133 | 133 | <select name="schedule_frequency" id="schedule_frequency" class="validate" required> |
134 | 134 | <option value="" disabled |
135 | - selected><?php echo __( 'Schedule Recurrence', 'xcloner-backup-and-restore' ) ?></option> |
|
135 | + selected><?php echo __('Schedule Recurrence', 'xcloner-backup-and-restore') ?></option> |
|
136 | 136 | <?php |
137 | 137 | $schedules = $xcloner_scheduler->get_available_intervals(); |
138 | 138 | |
139 | - foreach ( $schedules as $key => $schedule ) { |
|
139 | + foreach ($schedules as $key => $schedule) { |
|
140 | 140 | ?> |
141 | 141 | <option value="<?php echo $key ?>"><?php echo $schedule['display'] ?></option> |
142 | 142 | <?php |
@@ -146,17 +146,17 @@ discard block |
||
146 | 146 | </div> |
147 | 147 | </div> |
148 | 148 | |
149 | - <?php if ( sizeof( $available_storages ) ): ?> |
|
149 | + <?php if (sizeof($available_storages)): ?> |
|
150 | 150 | <div class="row"> |
151 | 151 | <div class="input-field col s12 l12"> |
152 | 152 | <select name="schedule_storage" id="schedule_storage" class="validate"> |
153 | 153 | <option value="" |
154 | - selected><?php echo __( 'none', 'xcloner-backup-and-restore' ) ?></option> |
|
155 | - <?php foreach ( $available_storages as $storage => $text ): ?> |
|
154 | + selected><?php echo __('none', 'xcloner-backup-and-restore') ?></option> |
|
155 | + <?php foreach ($available_storages as $storage => $text): ?> |
|
156 | 156 | <option value="<?php echo $storage ?>"><?php echo $text ?></option> |
157 | 157 | <?php endforeach ?> |
158 | 158 | </select> |
159 | - <label><?php echo __( 'Send To Remote Storage ', 'xcloner-backup-and-restore' ) ?></label> |
|
159 | + <label><?php echo __('Send To Remote Storage ', 'xcloner-backup-and-restore') ?></label> |
|
160 | 160 | </div> |
161 | 161 | </div> |
162 | 162 | <?php endif ?> |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | <div class="input-field col s12 l12"> |
166 | 166 | <input placeholder="" name="email_notification" id="email_notification" type="text" |
167 | 167 | value=""> |
168 | - <label for="email_notification"><?php echo __( 'Email Notification Address', 'xcloner-backup-and-restore' ) ?></label> |
|
168 | + <label for="email_notification"><?php echo __('Email Notification Address', 'xcloner-backup-and-restore') ?></label> |
|
169 | 169 | </div> |
170 | 170 | </div> |
171 | 171 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | <div class="input-field col s12 l12"> |
174 | 174 | <input placeholder="" name="diff_start_date" id="diff_start_date" type="text" |
175 | 175 | class="datepicker_max_today" value=""> |
176 | - <label for="diff_start_date"><?php echo __( 'Backup Only Files Modified/Created After', 'xcloner-backup-and-restore' ) ?></label> |
|
176 | + <label for="diff_start_date"><?php echo __('Backup Only Files Modified/Created After', 'xcloner-backup-and-restore') ?></label> |
|
177 | 177 | </div> |
178 | 178 | </div> |
179 | 179 | </div> |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | <div class="row"> |
183 | 183 | <div class="input-field col s12 l12"> |
184 | 184 | <input placeholder="" name="backup_name" id="backup_name" type="text" required value=""> |
185 | - <label for="backup_name"><?php echo __( 'Backup Name', 'xcloner-backup-and-restore' ) ?></label> |
|
185 | + <label for="backup_name"><?php echo __('Backup Name', 'xcloner-backup-and-restore') ?></label> |
|
186 | 186 | </div> |
187 | 187 | </div> |
188 | 188 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | <textarea id="table_params" name="table_params" class="materialize-textarea" |
192 | 192 | rows="15"></textarea> |
193 | 193 | <label for="table_params" |
194 | - class="active"><?php echo __( 'Included Database Data', 'xcloner-backup-and-restore' ) ?></label> |
|
194 | + class="active"><?php echo __('Included Database Data', 'xcloner-backup-and-restore') ?></label> |
|
195 | 195 | </div> |
196 | 196 | </div> |
197 | 197 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | <textarea id="excluded_files" name="excluded_files" class="materialize-textarea" |
201 | 201 | rows="15"></textarea> |
202 | 202 | <label for="excluded_files" |
203 | - class="active"><?php echo __( 'Excluded Files', 'xcloner-backup-and-restore' ) ?></label> |
|
203 | + class="active"><?php echo __('Excluded Files', 'xcloner-backup-and-restore') ?></label> |
|
204 | 204 | </div> |
205 | 205 | </div> |
206 | 206 | </div> |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | <div class="input-field col s12 "> |
212 | 212 | <button class="right btn waves-effect waves-light" type="submit" |
213 | - name="action"><?php echo __( 'Save', 'xcloner-backup-and-restore' ) ?> |
|
213 | + name="action"><?php echo __('Save', 'xcloner-backup-and-restore') ?> |
|
214 | 214 | <i class="material-icons right">send</i> |
215 | 215 | </button> |
216 | 216 | </div> |
@@ -261,7 +261,7 @@ |
||
261 | 261 | <input type="text" |
262 | 262 | name="decryption_key" |
263 | 263 | id="decryption_key" |
264 | - placeholder="<?=__('Decryption Key', 'xcloner-backup-and-restore' )?>" /> |
|
264 | + placeholder="<?=__('Decryption Key', 'xcloner-backup-and-restore')?>" /> |
|
265 | 265 | </p> |
266 | 266 | <p class="center-align"> |
267 | 267 | <a class="waves-effect waves-light btn"><?php echo __("START DECRYPTION", 'xcloner-backup-and-restore') ?></a> |
@@ -8,25 +8,25 @@ discard block |
||
8 | 8 | |
9 | 9 | <script>var xcloner_backup = new Xcloner_Backup();</script> |
10 | 10 | |
11 | -<h1><?= esc_html( get_admin_page_title() ); ?></h1> |
|
11 | +<h1><?= esc_html(get_admin_page_title()); ?></h1> |
|
12 | 12 | |
13 | 13 | <ul class="nav-tab-wrapper content row"> |
14 | 14 | <li><a href="#backup_options" |
15 | - class="nav-tab col s12 m3 l2 nav-tab-active"><?php echo $tab . ". " . __( 'Backup Options', 'xcloner-backup-and-restore' ) ?></a> |
|
15 | + class="nav-tab col s12 m3 l2 nav-tab-active"><?php echo $tab.". ".__('Backup Options', 'xcloner-backup-and-restore') ?></a> |
|
16 | 16 | </li> |
17 | - <?php if ( $xcloner_settings->get_enable_mysql_backup() ): ?> |
|
17 | + <?php if ($xcloner_settings->get_enable_mysql_backup()): ?> |
|
18 | 18 | <li><a href="#database_options" |
19 | - class="nav-tab col s12 m3 l2 "><?php echo ++ $tab . ". " . __( 'Database Options', 'xcloner-backup-and-restore' ) ?></a> |
|
19 | + class="nav-tab col s12 m3 l2 "><?php echo ++$tab.". ".__('Database Options', 'xcloner-backup-and-restore') ?></a> |
|
20 | 20 | </li> |
21 | 21 | <?php endif ?> |
22 | 22 | <li><a href="#files_options" |
23 | - class="nav-tab col s12 m3 l2 "><?php echo ++ $tab . ". " . __( 'Files Options', 'xcloner-backup-and-restore' ) ?></a> |
|
23 | + class="nav-tab col s12 m3 l2 "><?php echo ++$tab.". ".__('Files Options', 'xcloner-backup-and-restore') ?></a> |
|
24 | 24 | </li> |
25 | 25 | <li><a href="#generate_backup" |
26 | - class="nav-tab col s12 m3 l2 "><?php echo ++ $tab . ". " . __( 'Generate Backup', 'xcloner-backup-and-restore' ) ?></a> |
|
26 | + class="nav-tab col s12 m3 l2 "><?php echo ++$tab.". ".__('Generate Backup', 'xcloner-backup-and-restore') ?></a> |
|
27 | 27 | </li> |
28 | 28 | <li><a href="#schedule_backup" |
29 | - class="nav-tab col s12 m3 l2 "><?php echo ++ $tab . ". " . __( 'Schedule Backup', 'xcloner-backup-and-restore' ) ?></a> |
|
29 | + class="nav-tab col s12 m3 l2 "><?php echo ++$tab.". ".__('Schedule Backup', 'xcloner-backup-and-restore') ?></a> |
|
30 | 30 | </li> |
31 | 31 | </ul> |
32 | 32 | |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | <i class="material-icons prefix">input</i> |
40 | 40 | <input name="backup_name" id="backup_name" type="text" |
41 | 41 | value=<?php echo $xcloner_settings->get_default_backup_name() ?>> |
42 | - <label for="backup_name"><?php echo __( 'Backup Name', 'xcloner-backup-and-restore' ) ?></label> |
|
42 | + <label for="backup_name"><?php echo __('Backup Name', 'xcloner-backup-and-restore') ?></label> |
|
43 | 43 | </div> |
44 | 44 | <div class="hide-on-small-only m2"> |
45 | 45 | <a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" |
46 | - data-tooltip="<?php echo __( 'The default backup name, supported tags [time], [hostname], [domain]', 'xcloner-backup-and-restore' ) ?>" |
|
46 | + data-tooltip="<?php echo __('The default backup name, supported tags [time], [hostname], [domain]', 'xcloner-backup-and-restore') ?>" |
|
47 | 47 | data-tooltip-id=""><i class="material-icons">help_outline</i></a> |
48 | 48 | </div> |
49 | 49 | </div> |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | <div class="input-field inline col s12 m10 l6"> |
53 | 53 | <i class="material-icons prefix">email</i> |
54 | 54 | <input name="email_notification" id="email_notification" type="text" |
55 | - value="<?php echo get_option( 'admin_email' ); ?>"> |
|
56 | - <label for="email_notification"><?php echo __( 'Send Email Notification To', 'xcloner-backup-and-restore' ) ?></label> |
|
55 | + value="<?php echo get_option('admin_email'); ?>"> |
|
56 | + <label for="email_notification"><?php echo __('Send Email Notification To', 'xcloner-backup-and-restore') ?></label> |
|
57 | 57 | </div> |
58 | 58 | <div class="hide-on-small-only m2"> |
59 | 59 | <a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" |
60 | - data-tooltip="<?php echo __( 'If left blank, no notification will be sent', 'xcloner-backup-and-restore' ) ?>" |
|
60 | + data-tooltip="<?php echo __('If left blank, no notification will be sent', 'xcloner-backup-and-restore') ?>" |
|
61 | 61 | data-tooltip-id=""><i class="material-icons">help_outline</i></a> |
62 | 62 | </div> |
63 | 63 | </div> |
@@ -67,11 +67,11 @@ discard block |
||
67 | 67 | <i class="material-icons prefix">access_time</i> |
68 | 68 | <input type="datetime-local" id="diff_start_date" class="datepicker_max_today" |
69 | 69 | name="diff_start_date"> |
70 | - <label for="diff_start_date"><?php echo __( 'Backup Only Files Modified/Created After', 'xcloner-backup-and-restore' ) ?></label> |
|
70 | + <label for="diff_start_date"><?php echo __('Backup Only Files Modified/Created After', 'xcloner-backup-and-restore') ?></label> |
|
71 | 71 | </div> |
72 | 72 | <div class="hide-on-small-only m2"> |
73 | 73 | <a class="btn-floating tooltipped btn-small" data-html="true" data-position="center" data-delay="50" |
74 | - data-tooltip="<?php echo __( "This option allows you to create a differential backup that will include only <br> changed files since the set date, leave blank to include all files", "xcloner-backup-and-restore" ) ?>"><i |
|
74 | + data-tooltip="<?php echo __("This option allows you to create a differential backup that will include only <br> changed files since the set date, leave blank to include all files", "xcloner-backup-and-restore") ?>"><i |
|
75 | 75 | class="material-icons">help_outline</i></a> |
76 | 76 | </div> |
77 | 77 | </div> |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | <div class="row"> |
80 | 80 | <div class="input-field col s6 m5 l4"> |
81 | 81 | <i class="material-icons prefix">enhanced_encryption</i> |
82 | - <label for="backup_comments"><?php echo __( 'Encrypt Backup', 'xcloner-backup-and-restore' ) ?></label> |
|
82 | + <label for="backup_comments"><?php echo __('Encrypt Backup', 'xcloner-backup-and-restore') ?></label> |
|
83 | 83 | |
84 | 84 | </div> |
85 | 85 | <div class="input-field col s6 m5 l2"> |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | <div class="hide-on-small-only s12 m2"> |
97 | 97 | <a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" |
98 | - data-tooltip="<?php echo __( 'Enable this option if you want to encrypt the final backup', 'xcloner-backup-and-restore' ) ?>" |
|
98 | + data-tooltip="<?php echo __('Enable this option if you want to encrypt the final backup', 'xcloner-backup-and-restore') ?>" |
|
99 | 99 | data-tooltip-id=""><i class="material-icons">help_outline</i></a> |
100 | 100 | </div> |
101 | 101 | </div> |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | <div class="input-field col s12 m10 l6"> |
105 | 105 | <i class="material-icons prefix">input</i> |
106 | 106 | <textarea name="backup_comments" id="backup_comments" class="materialize-textarea"></textarea> |
107 | - <label for="backup_comments"><?php echo __( 'Backup Comments', 'xcloner-backup-and-restore' ) ?></label> |
|
107 | + <label for="backup_comments"><?php echo __('Backup Comments', 'xcloner-backup-and-restore') ?></label> |
|
108 | 108 | </div> |
109 | 109 | <div class="hide-on-small-only m2"> |
110 | 110 | <a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" |
111 | - data-tooltip="<?php echo __( 'Some default backup comments that will be stored inside the backup archive', 'xcloner-backup-and-restore' ) ?>" |
|
111 | + data-tooltip="<?php echo __('Some default backup comments that will be stored inside the backup archive', 'xcloner-backup-and-restore') ?>" |
|
112 | 112 | data-tooltip-id=""><i class="material-icons">help_outline</i></a> |
113 | 113 | </div> |
114 | 114 | </div> |
@@ -121,11 +121,11 @@ discard block |
||
121 | 121 | </div> |
122 | 122 | </div> |
123 | 123 | |
124 | - <?php if ( $xcloner_settings->get_enable_mysql_backup() ): ?> |
|
124 | + <?php if ($xcloner_settings->get_enable_mysql_backup()): ?> |
|
125 | 125 | <div id="database_options" class="tab-content"> |
126 | - <h2><?php echo __( 'Select database data to include in the backup', 'xcloner-backup-and-restore' ) ?>: |
|
126 | + <h2><?php echo __('Select database data to include in the backup', 'xcloner-backup-and-restore') ?>: |
|
127 | 127 | <a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" |
128 | - 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' ); ?>" |
|
128 | + 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'); ?>" |
|
129 | 129 | data-tooltip-id=""><i class="material-icons">help_outline</i></a> |
130 | 130 | </h2> |
131 | 131 | |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | <?php endif ?> |
148 | 148 | |
149 | 149 | <div id="files_options" class="tab-content"> |
150 | - <h2><?php echo __( 'Select from below the files/folders you want to exclude from your Backup Archive', 'xcloner-backup-and-restore' ) ?> |
|
150 | + <h2><?php echo __('Select from below the files/folders you want to exclude from your Backup Archive', 'xcloner-backup-and-restore') ?> |
|
151 | 151 | : |
152 | 152 | <a class="btn-floating tooltipped btn-small" data-position="bottom" data-delay="50" data-html="true" |
153 | - 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' ); ?>" |
|
153 | + 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'); ?>" |
|
154 | 154 | data-tooltip-id=""><i class="material-icons">help_outline</i></a> |
155 | 155 | </h2> |
156 | 156 | |
@@ -185,9 +185,9 @@ discard block |
||
185 | 185 | <ul class="backup-status collapsible" data-collapsible="accordion"> |
186 | 186 | <li class="file-system"> |
187 | 187 | <div class="collapsible-header"> |
188 | - <i class="material-icons">folder</i><?php echo __( 'Scanning The File System...', 'xcloner-backup-and-restore' ) ?> |
|
188 | + <i class="material-icons">folder</i><?php echo __('Scanning The File System...', 'xcloner-backup-and-restore') ?> |
|
189 | 189 | |
190 | - <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> |
|
190 | + <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> |
|
191 | 191 | |
192 | 192 | <div> |
193 | 193 | <p class="right"><span class="last-logged-file"></span></p> |
@@ -199,12 +199,12 @@ discard block |
||
199 | 199 | </div> |
200 | 200 | <div class="collapsible-body status-body"></div> |
201 | 201 | </li> |
202 | - <?php if ( $xcloner_settings->get_enable_mysql_backup() ): ?> |
|
202 | + <?php if ($xcloner_settings->get_enable_mysql_backup()): ?> |
|
203 | 203 | <li class="database-backup"> |
204 | 204 | <div class="collapsible-header"> |
205 | - <i class="material-icons">storage</i><?php echo __( 'Generating the Mysql Backup...', 'xcloner-backup-and-restore' ) ?> |
|
205 | + <i class="material-icons">storage</i><?php echo __('Generating the Mysql Backup...', 'xcloner-backup-and-restore') ?> |
|
206 | 206 | |
207 | - <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> |
|
207 | + <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> |
|
208 | 208 | |
209 | 209 | <div> |
210 | 210 | <p class="right"><span class="last-logged-table"></span></p> |
@@ -228,9 +228,9 @@ discard block |
||
228 | 228 | <?php endif ?> |
229 | 229 | <li class="files-backup"> |
230 | 230 | <div class="collapsible-header"> |
231 | - <i class="material-icons">archive</i><?php echo __( 'Adding Files to Archive...', 'xcloner-backup-and-restore' ) ?> |
|
231 | + <i class="material-icons">archive</i><?php echo __('Adding Files to Archive...', 'xcloner-backup-and-restore') ?> |
|
232 | 232 | |
233 | - <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> |
|
233 | + <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> |
|
234 | 234 | |
235 | 235 | <div> |
236 | 236 | <p class="right"><span class="last-logged-file"></span></p> |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | <div class="collapsible-body status-body"> |
244 | 244 | <div class="row"> |
245 | 245 | <div class="col l3 s12"> |
246 | - <h2><?php echo __( "Backup Parts", 'xcloner-backup-and-restore' ) ?>: </h2> |
|
246 | + <h2><?php echo __("Backup Parts", 'xcloner-backup-and-restore') ?>: </h2> |
|
247 | 247 | </div> |
248 | 248 | <div class="col l9 s12"> |
249 | 249 | <ul class="backup-name"></ul> |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | </li> |
254 | 254 | <li class="backup-encryption"> |
255 | 255 | <div class="collapsible-header"> |
256 | - <i class="material-icons">enhanced_encryption</i><?php echo __( 'Encrypting Backup Data...', 'xcloner-backup-and-restore' ) ?> |
|
256 | + <i class="material-icons">enhanced_encryption</i><?php echo __('Encrypting Backup Data...', 'xcloner-backup-and-restore') ?> |
|
257 | 257 | |
258 | 258 | <p class="right"><span class="status"></span></p> |
259 | 259 | |
@@ -268,19 +268,19 @@ discard block |
||
268 | 268 | </li> |
269 | 269 | <li class="backup-done"> |
270 | 270 | <div class="collapsible-header"> |
271 | - <i class="material-icons">done</i><?php echo __( 'Backup Done', 'xcloner-backup-and-restore' ) ?> |
|
271 | + <i class="material-icons">done</i><?php echo __('Backup Done', 'xcloner-backup-and-restore') ?> |
|
272 | 272 | |
273 | 273 | <p class="right"> |
274 | - <?php if ( sizeof( $available_storages ) ): ?> |
|
274 | + <?php if (sizeof($available_storages)): ?> |
|
275 | 275 | <a href="#" class="cloud-upload" |
276 | - title="<?php echo __( "Send Backup To Remote Storage", 'xcloner-backup-and-restore' ) ?>"><i |
|
276 | + title="<?php echo __("Send Backup To Remote Storage", 'xcloner-backup-and-restore') ?>"><i |
|
277 | 277 | class="material-icons">cloud_upload</i></a> |
278 | 278 | <?php endif ?> |
279 | 279 | <a href="#" class="download" |
280 | - title="<?php echo __( "Download Backup", 'xcloner-backup-and-restore' ) ?>"><i |
|
280 | + title="<?php echo __("Download Backup", 'xcloner-backup-and-restore') ?>"><i |
|
281 | 281 | class="material-icons">file_download</i></a> |
282 | 282 | <a href="#" class="list-backup-content" |
283 | - title="<?php echo __( "List Backup Content", 'xcloner-backup-and-restore' ) ?>"><i |
|
283 | + title="<?php echo __("List Backup Content", 'xcloner-backup-and-restore') ?>"><i |
|
284 | 284 | class="material-icons">folder_open</i></a> |
285 | 285 | </p> |
286 | 286 | |
@@ -291,8 +291,8 @@ discard block |
||
291 | 291 | </div> |
292 | 292 | <div class="collapsible-body center-align"> |
293 | 293 | <div class="row"> |
294 | - <h5><?php echo __( "Thank you for using XCloner.", 'xcloner-backup-and-restore' ) ?></h5> |
|
295 | - <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> |
|
294 | + <h5><?php echo __("Thank you for using XCloner.", 'xcloner-backup-and-restore') ?></h5> |
|
295 | + <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> |
|
296 | 296 | <a class="twitter-follow-button" href="https://twitter.com/thinkovi" |
297 | 297 | data-show-count="false">Follow @thinkovi</a> |
298 | 298 | <script src="//platform.twitter.com/widgets.js" async="" charset="utf-8"></script> |
@@ -313,9 +313,9 @@ discard block |
||
313 | 313 | |
314 | 314 | <div class="row"> |
315 | 315 | <div id="schedule_backup_success" class="col s12 l6 updated settings-error notice is-dismissible"> |
316 | - <p><strong><?php echo __( 'Schedule Saved', 'xcloner-backup-and-restore' ) ?></strong></p> |
|
316 | + <p><strong><?php echo __('Schedule Saved', 'xcloner-backup-and-restore') ?></strong></p> |
|
317 | 317 | <button type="button" class="notice-dismiss"><span |
318 | - class="screen-reader-text"><?php echo __( '(Dismiss this notice.', 'xcloner-backup-and-restore' ) ?></span> |
|
318 | + class="screen-reader-text"><?php echo __('(Dismiss this notice.', 'xcloner-backup-and-restore') ?></span> |
|
319 | 319 | </button> |
320 | 320 | </div> |
321 | 321 | </div> |
@@ -323,18 +323,18 @@ discard block |
||
323 | 323 | <div class="row"> |
324 | 324 | <div class="input-field inline col s12 l7"> |
325 | 325 | <input type="text" id="schedule_name" class="" name="schedule_name" required> |
326 | - <label for="schedule_name"><?php echo __( 'Schedule Name', 'xcloner-backup-and-restore' ) ?></label> |
|
326 | + <label for="schedule_name"><?php echo __('Schedule Name', 'xcloner-backup-and-restore') ?></label> |
|
327 | 327 | </div> |
328 | 328 | </div> |
329 | 329 | |
330 | 330 | <div class="row"> |
331 | 331 | <div class="input-field inline col s12 m8 l4"> |
332 | 332 | <input type="datetime-local" id="datepicker" class="datepicker" name="schedule_start_date"> |
333 | - <label for="datepicker"><?php echo __( 'Schedule Backup To Start On:', 'xcloner-backup-and-restore' ) ?></label> |
|
333 | + <label for="datepicker"><?php echo __('Schedule Backup To Start On:', 'xcloner-backup-and-restore') ?></label> |
|
334 | 334 | </div> |
335 | 335 | <div class="input-field inline col s12 m4 l3"> |
336 | 336 | <input id="timepicker_ampm_dark" class="timepicker" type="time" name="schedule_start_time"> |
337 | - <label for="timepicker_ampm_dark"><?php echo __( 'At:', 'xcloner-backup-and-restore' ) ?></label> |
|
337 | + <label for="timepicker_ampm_dark"><?php echo __('At:', 'xcloner-backup-and-restore') ?></label> |
|
338 | 338 | </div> |
339 | 339 | </div> |
340 | 340 | |
@@ -342,17 +342,17 @@ discard block |
||
342 | 342 | <div class="row"> |
343 | 343 | <div class="input-field inline col s10 m11 l7"> |
344 | 344 | <select id="backup_type" class="" name="backup_type"> |
345 | - <option value=""><?php echo __( "Full Backup", "xcloner-backup-and-restore" ); ?></option> |
|
346 | - <option value="diff"><?php echo __( "Differential Backups", "xcloner-backup-and-restore" ); ?></option> |
|
347 | - <option value="full_diff"><?php echo __( "Full Backup + Differential Backups", "xcloner-backup-and-restore" ); ?></option> |
|
345 | + <option value=""><?php echo __("Full Backup", "xcloner-backup-and-restore"); ?></option> |
|
346 | + <option value="diff"><?php echo __("Differential Backups", "xcloner-backup-and-restore"); ?></option> |
|
347 | + <option value="full_diff"><?php echo __("Full Backup + Differential Backups", "xcloner-backup-and-restore"); ?></option> |
|
348 | 348 | </select> |
349 | - <label for="backup_type"><?php echo __( 'Scheduled Backup Type', 'xcloner-backup-and-restore' ) ?></label> |
|
349 | + <label for="backup_type"><?php echo __('Scheduled Backup Type', 'xcloner-backup-and-restore') ?></label> |
|
350 | 350 | </div> |
351 | 351 | <div class="col s2 m1"> |
352 | 352 | <a class="btn-floating tooltipped btn-small" data-html="true" data-position="center" data-delay="50" data-tooltip="<ul style='max-width:760px; text-align:left;'> |
353 | - <li><?php echo __( "Full Backup = it will generate a full backup of all included files each time schedule runs", "xcloner-backup-and-restore" ); ?></li> |
|
354 | - <li><?php echo __( "Differentials Backups = backups will include only changed files since the schedule started to run", "xcloner-backup-and-restore" ); ?></li> |
|
355 | - <li><?php echo __( "Full Backup + Differential Backups = the first time schedule runs, it will create a full backup and all next scheduled backups will include only files created/modified since that last full backup; a full backup is recreated when the number of changed files is bigger than the 'Differetial Backups Max Days' XCloner option.", "xcloner-backup-and-restore" ); ?></li> |
|
353 | + <li><?php echo __("Full Backup = it will generate a full backup of all included files each time schedule runs", "xcloner-backup-and-restore"); ?></li> |
|
354 | + <li><?php echo __("Differentials Backups = backups will include only changed files since the schedule started to run", "xcloner-backup-and-restore"); ?></li> |
|
355 | + <li><?php echo __("Full Backup + Differential Backups = the first time schedule runs, it will create a full backup and all next scheduled backups will include only files created/modified since that last full backup; a full backup is recreated when the number of changed files is bigger than the 'Differetial Backups Max Days' XCloner option.", "xcloner-backup-and-restore"); ?></li> |
|
356 | 356 | </ul>"><i class="material-icons">help_outline</i></a> |
357 | 357 | </div> |
358 | 358 | </div> |
@@ -361,38 +361,38 @@ discard block |
||
361 | 361 | <div class="input-field col s12 l7"> |
362 | 362 | <select name="schedule_frequency" id="schedule_frequency" class="validate" required> |
363 | 363 | <option value="" disabled |
364 | - selected><?php echo __( 'please select', 'xcloner-backup-and-restore' ) ?></option> |
|
364 | + selected><?php echo __('please select', 'xcloner-backup-and-restore') ?></option> |
|
365 | 365 | <?php |
366 | 366 | $schedules = $xcloner_scheduler->get_available_intervals(); |
367 | 367 | |
368 | - foreach ( $schedules as $key => $schedule ) { |
|
368 | + foreach ($schedules as $key => $schedule) { |
|
369 | 369 | ?> |
370 | 370 | <option value="<?php echo $key ?>"><?php echo $schedule['display'] ?></option> |
371 | 371 | <?php |
372 | 372 | } |
373 | 373 | ?> |
374 | 374 | </select> |
375 | - <label><?php echo __( 'Schedule Frequency', 'xcloner-backup-and-restore' ) ?></label> |
|
375 | + <label><?php echo __('Schedule Frequency', 'xcloner-backup-and-restore') ?></label> |
|
376 | 376 | </div> |
377 | 377 | </div> |
378 | 378 | |
379 | - <?php if ( sizeof( $available_storages ) ): ?> |
|
379 | + <?php if (sizeof($available_storages)): ?> |
|
380 | 380 | <div class="row"> |
381 | 381 | <div class="input-field col s12 m12 l7"> |
382 | 382 | <select name="schedule_storage" id="schedule_storage" class="validate"> |
383 | - <option value="" selected><?php echo __( 'none', 'xcloner-backup-and-restore' ) ?></option> |
|
384 | - <?php foreach ( $available_storages as $storage => $text ): ?> |
|
383 | + <option value="" selected><?php echo __('none', 'xcloner-backup-and-restore') ?></option> |
|
384 | + <?php foreach ($available_storages as $storage => $text): ?> |
|
385 | 385 | <option value="<?php echo $storage ?>"><?php echo $text ?></option> |
386 | 386 | <?php endforeach ?> |
387 | 387 | </select> |
388 | - <label><?php echo __( 'Send To Remote Storage', 'xcloner-backup-and-restore' ) ?></label> |
|
388 | + <label><?php echo __('Send To Remote Storage', 'xcloner-backup-and-restore') ?></label> |
|
389 | 389 | </div> |
390 | 390 | </div> |
391 | 391 | <?php endif ?> |
392 | 392 | <div class="row"> |
393 | 393 | <div class="col s12 l7"> |
394 | 394 | <button class="right btn waves-effect waves-light submit_schedule" type="submit" |
395 | - name="action"><?php echo __( "Submit", 'xcloner-backup-and-restore' ) ?> |
|
395 | + name="action"><?php echo __("Submit", 'xcloner-backup-and-restore') ?> |
|
396 | 396 | <i class="material-icons right">send</i> |
397 | 397 | </button> |
398 | 398 | </div> |
@@ -407,19 +407,19 @@ discard block |
||
407 | 407 | class="material-icons medium right">help</i></a> |
408 | 408 | <div class="modal-content"> |
409 | 409 | <h4 class="title_line"><span class="title"></span></h4> |
410 | - <!--<h5 class="title_line"><?php echo __( 'Message' ) ?>: <span class="msg.old"></span></h5>--> |
|
411 | - <h5><?php echo __( 'Response Code', 'xcloner-backup-and-restore' ) ?>: <span class="status"></span></h5> |
|
410 | + <!--<h5 class="title_line"><?php echo __('Message') ?>: <span class="msg.old"></span></h5>--> |
|
411 | + <h5><?php echo __('Response Code', 'xcloner-backup-and-restore') ?>: <span class="status"></span></h5> |
|
412 | 412 | <textarea class="body" rows="5"></textarea> |
413 | 413 | </div> |
414 | 414 | <div class="modal-footer"> |
415 | - <a class=" modal-action modal-close waves-effect waves-green btn-flat red darken-2"><?php echo __( 'Close', 'xcloner-backup-and-restore' ) ?></a> |
|
415 | + <a class=" modal-action modal-close waves-effect waves-green btn-flat red darken-2"><?php echo __('Close', 'xcloner-backup-and-restore') ?></a> |
|
416 | 416 | </div> |
417 | 417 | </div> |
418 | 418 | |
419 | 419 | <!-- List Backup Content Modal--> |
420 | 420 | <div id="backup_cotent_modal" class="modal"> |
421 | 421 | <div class="modal-content"> |
422 | - <h4><?php echo sprintf( __( "Listing Backup Content ", 'xcloner-backup-and-restore' ), "" ) ?></h4> |
|
422 | + <h4><?php echo sprintf(__("Listing Backup Content ", 'xcloner-backup-and-restore'), "") ?></h4> |
|
423 | 423 | <h5 class="backup-name"></h5> |
424 | 424 | |
425 | 425 | <div class="progress"> |
@@ -434,18 +434,18 @@ discard block |
||
434 | 434 | <form method="POST" class="remote-storage-form"> |
435 | 435 | <input type="hidden" name="file" class="backup_name"> |
436 | 436 | <div class="modal-content"> |
437 | - <h4><?php echo __( "Remote Storage Transfer", 'xcloner-backup-and-restore' ) ?></h4> |
|
437 | + <h4><?php echo __("Remote Storage Transfer", 'xcloner-backup-and-restore') ?></h4> |
|
438 | 438 | <p> |
439 | - <?php if ( sizeof( $available_storages ) ): ?> |
|
439 | + <?php if (sizeof($available_storages)): ?> |
|
440 | 440 | <div class="row"> |
441 | 441 | <div class="col s12 label"> |
442 | - <label><?php echo __( sprintf( 'Send %s to remote storage', "<span class='backup_name'></span>" ), 'xcloner-backup-and-restore' ) ?></label> |
|
442 | + <label><?php echo __(sprintf('Send %s to remote storage', "<span class='backup_name'></span>"), 'xcloner-backup-and-restore') ?></label> |
|
443 | 443 | </div> |
444 | 444 | <div class="input-field col s8 m10"> |
445 | 445 | <select name="transfer_storage" id="transfer_storage" class="validate" required> |
446 | 446 | <option value="" |
447 | - selected><?php echo __( 'please select...', 'xcloner-backup-and-restore' ) ?></option> |
|
448 | - <?php foreach ( $available_storages as $storage => $text ): ?> |
|
447 | + selected><?php echo __('please select...', 'xcloner-backup-and-restore') ?></option> |
|
448 | + <?php foreach ($available_storages as $storage => $text): ?> |
|
449 | 449 | <option value="<?php echo $storage ?>"><?php echo $text ?></option> |
450 | 450 | <?php endforeach ?> |
451 | 451 | </select> |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | </div> |
458 | 458 | </div> |
459 | 459 | <div class="row status"> |
460 | - <?php echo __( "Uploading backup to the selected remote storage...", 'xcloner-backup-and-restore' ) ?> |
|
460 | + <?php echo __("Uploading backup to the selected remote storage...", 'xcloner-backup-and-restore') ?> |
|
461 | 461 | <span class="status-text"></span> |
462 | 462 | <div class="progress"> |
463 | 463 | <div class="indeterminate"></div> |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | } |
542 | 542 | }); |
543 | 543 | |
544 | - <?php if($xcloner_settings->get_enable_mysql_backup()):?> |
|
544 | + <?php if ($xcloner_settings->get_enable_mysql_backup()):?> |
|
545 | 545 | jQuery('#jstree_database_container').jstree({ |
546 | 546 | 'core': { |
547 | 547 | 'check_callback': true, |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | |
4 | 4 | $gdrive_auth_url = ""; |
5 | 5 | |
6 | -if ( method_exists( $remote_storage, "get_gdrive_auth_url" ) ) { |
|
6 | +if (method_exists($remote_storage, "get_gdrive_auth_url")) { |
|
7 | 7 | $gdrive_auth_url = $remote_storage->get_gdrive_auth_url(); |
8 | 8 | } |
9 | 9 | |
10 | 10 | $gdrive_construct = $remote_storage->gdrive_construct(); |
11 | 11 | ?> |
12 | -<h1><?= esc_html( get_admin_page_title() ); ?></h1> |
|
12 | +<h1><?= esc_html(get_admin_page_title()); ?></h1> |
|
13 | 13 | |
14 | 14 | <form class="remote-storage-form" method="POST"> |
15 | 15 | |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | <!-- FTP STORAGE--> |
22 | 22 | <li id="ftp"> |
23 | 23 | <div class="collapsible-header"> |
24 | - <i class="material-icons">computer</i><?php echo __( "FTP Storage", 'xcloner-backup-and-restore' ) ?> |
|
24 | + <i class="material-icons">computer</i><?php echo __("FTP Storage", 'xcloner-backup-and-restore') ?> |
|
25 | 25 | <div class="switch right"> |
26 | 26 | <label> |
27 | 27 | Off |
28 | 28 | <input type="checkbox" name="xcloner_ftp_enable" class="status" |
29 | - value="1" <?php if ( get_option( "xcloner_ftp_enable" ) ) |
|
29 | + value="1" <?php if (get_option("xcloner_ftp_enable")) |
|
30 | 30 | echo "checked" ?> \> |
31 | 31 | <span class="lever"></span> |
32 | 32 | On |
@@ -36,121 +36,121 @@ discard block |
||
36 | 36 | <div class="collapsible-body"> |
37 | 37 | <div class="row"> |
38 | 38 | <div class="col s12 m3 label"> |
39 | - <label for="ftp_host"><?php echo __( "Ftp Hostname", 'xcloner-backup-and-restore' ) ?></label> |
|
39 | + <label for="ftp_host"><?php echo __("Ftp Hostname", 'xcloner-backup-and-restore') ?></label> |
|
40 | 40 | </div> |
41 | 41 | <div class="col s12 m6"> |
42 | - <input placeholder="<?php echo __( "Ftp Hostname", 'xcloner-backup-and-restore' ) ?>" |
|
42 | + <input placeholder="<?php echo __("Ftp Hostname", 'xcloner-backup-and-restore') ?>" |
|
43 | 43 | id="ftp_host" type="text" name="xcloner_ftp_hostname" class="validate" |
44 | - value="<?php echo get_option( "xcloner_ftp_hostname" ) ?>"> |
|
44 | + value="<?php echo get_option("xcloner_ftp_hostname") ?>"> |
|
45 | 45 | </div> |
46 | 46 | <div class=" col s12 m2"> |
47 | - <input placeholder="<?php echo __( "Ftp Port", 'xcloner-backup-and-restore' ) ?>" |
|
47 | + <input placeholder="<?php echo __("Ftp Port", 'xcloner-backup-and-restore') ?>" |
|
48 | 48 | id="ftp_port" type="text" name="xcloner_ftp_port" class="validate" |
49 | - value="<?php echo get_option( "xcloner_ftp_port", 21 ) ?>"> |
|
49 | + value="<?php echo get_option("xcloner_ftp_port", 21) ?>"> |
|
50 | 50 | </div> |
51 | 51 | </div> |
52 | 52 | |
53 | 53 | <div class="row"> |
54 | 54 | <div class="col s12 m3 label"> |
55 | - <label for="ftp_username"><?php echo __( "Ftp Username", 'xcloner-backup-and-restore' ) ?></label> |
|
55 | + <label for="ftp_username"><?php echo __("Ftp Username", 'xcloner-backup-and-restore') ?></label> |
|
56 | 56 | </div> |
57 | 57 | <div class=" col s12 m6"> |
58 | - <input placeholder="<?php echo __( "Ftp Username", 'xcloner-backup-and-restore' ) ?>" |
|
58 | + <input placeholder="<?php echo __("Ftp Username", 'xcloner-backup-and-restore') ?>" |
|
59 | 59 | id="ftp_username" type="text" name="xcloner_ftp_username" class="validate" |
60 | - value="<?php echo get_option( "xcloner_ftp_username" ) ?>" autocomplete="off"> |
|
60 | + value="<?php echo get_option("xcloner_ftp_username") ?>" autocomplete="off"> |
|
61 | 61 | </div> |
62 | 62 | </div> |
63 | 63 | |
64 | 64 | |
65 | 65 | <div class="row"> |
66 | 66 | <div class="col s12 m3 label"> |
67 | - <label for="ftp_password"><?php echo __( "Ftp Password", 'xcloner-backup-and-restore' ) ?></label> |
|
67 | + <label for="ftp_password"><?php echo __("Ftp Password", 'xcloner-backup-and-restore') ?></label> |
|
68 | 68 | </div> |
69 | 69 | <div class=" col s12 m6"> |
70 | - <input placeholder="<?php echo __( "Ftp Password", 'xcloner-backup-and-restore' ) ?>" |
|
70 | + <input placeholder="<?php echo __("Ftp Password", 'xcloner-backup-and-restore') ?>" |
|
71 | 71 | id="ftp_password" type="password" name="xcloner_ftp_password" class="validate" |
72 | - value="<?php echo get_option( "xcloner_ftp_password" ) ?>" autocomplete="off"> |
|
72 | + value="<?php echo get_option("xcloner_ftp_password") ?>" autocomplete="off"> |
|
73 | 73 | </div> |
74 | 74 | </div> |
75 | 75 | |
76 | 76 | <div class="row"> |
77 | 77 | <div class="col s12 m3 label"> |
78 | - <label for="ftp_root"><?php echo __( "Ftp Storage Folder", 'xcloner-backup-and-restore' ) ?></label> |
|
78 | + <label for="ftp_root"><?php echo __("Ftp Storage Folder", 'xcloner-backup-and-restore') ?></label> |
|
79 | 79 | </div> |
80 | 80 | <div class=" col s12 m6"> |
81 | - <input placeholder="<?php echo __( "Ftp Storage Folder", 'xcloner-backup-and-restore' ) ?>" |
|
81 | + <input placeholder="<?php echo __("Ftp Storage Folder", 'xcloner-backup-and-restore') ?>" |
|
82 | 82 | id="ftp_root" type="text" name="xcloner_ftp_path" class="validate" |
83 | - value="<?php echo get_option( "xcloner_ftp_path" ) ?>"> |
|
83 | + value="<?php echo get_option("xcloner_ftp_path") ?>"> |
|
84 | 84 | </div> |
85 | 85 | </div> |
86 | 86 | |
87 | 87 | <div class="row"> |
88 | 88 | <div class="col s12 m3 label"> |
89 | - <label for="ftp_root"><?php echo __( "Ftp Transfer Mode", 'xcloner-backup-and-restore' ) ?></label> |
|
89 | + <label for="ftp_root"><?php echo __("Ftp Transfer Mode", 'xcloner-backup-and-restore') ?></label> |
|
90 | 90 | </div> |
91 | 91 | <div class=" col s12 m6 input-field inline"> |
92 | 92 | <input name="xcloner_ftp_transfer_mode" type="radio" id="passive" |
93 | - value="1" <?php if ( get_option( "xcloner_ftp_transfer_mode", 1 ) ) |
|
93 | + value="1" <?php if (get_option("xcloner_ftp_transfer_mode", 1)) |
|
94 | 94 | echo "checked" ?> /> |
95 | - <label for="passive"><?php echo __( "Passive", 'xcloner-backup-and-restore' ) ?></label> |
|
95 | + <label for="passive"><?php echo __("Passive", 'xcloner-backup-and-restore') ?></label> |
|
96 | 96 | |
97 | 97 | <input name="xcloner_ftp_transfer_mode" type="radio" id="active" |
98 | - value="0" <?php if ( ! get_option( "xcloner_ftp_transfer_mode", 1 ) ) |
|
98 | + value="0" <?php if (!get_option("xcloner_ftp_transfer_mode", 1)) |
|
99 | 99 | echo "checked" ?> /> |
100 | - <label for="active"><?php echo __( "Active", 'xcloner-backup-and-restore' ) ?></label> |
|
100 | + <label for="active"><?php echo __("Active", 'xcloner-backup-and-restore') ?></label> |
|
101 | 101 | </div> |
102 | 102 | </div> |
103 | 103 | |
104 | 104 | <div class="row"> |
105 | 105 | <div class="col s12 m3 label"> |
106 | - <label for="ftp_ssl_mode"><?php echo __( "Ftp Secure Connection", 'xcloner-backup-and-restore' ) ?></label> |
|
106 | + <label for="ftp_ssl_mode"><?php echo __("Ftp Secure Connection", 'xcloner-backup-and-restore') ?></label> |
|
107 | 107 | </div> |
108 | 108 | <div class=" col s12 m6 input-field inline"> |
109 | 109 | <input name="xcloner_ftp_ssl_mode" type="radio" id="ftp_ssl_mode_inactive" |
110 | - value="0" <?php if ( ! get_option( "xcloner_ftp_ssl_mode" ) ) |
|
110 | + value="0" <?php if (!get_option("xcloner_ftp_ssl_mode")) |
|
111 | 111 | echo "checked" ?> /> |
112 | - <label for="ftp_ssl_mode_inactive"><?php echo __( "Disable", 'xcloner-backup-and-restore' ) ?></label> |
|
112 | + <label for="ftp_ssl_mode_inactive"><?php echo __("Disable", 'xcloner-backup-and-restore') ?></label> |
|
113 | 113 | |
114 | 114 | <input name="xcloner_ftp_ssl_mode" type="radio" id="ftp_ssl_mode_active" |
115 | - value="1" <?php if ( get_option( "xcloner_ftp_ssl_mode" ) ) |
|
115 | + value="1" <?php if (get_option("xcloner_ftp_ssl_mode")) |
|
116 | 116 | echo "checked" ?> /> |
117 | - <label for="ftp_ssl_mode_active"><?php echo __( "Enable", 'xcloner-backup-and-restore' ) ?></label> |
|
117 | + <label for="ftp_ssl_mode_active"><?php echo __("Enable", 'xcloner-backup-and-restore') ?></label> |
|
118 | 118 | </div> |
119 | 119 | </div> |
120 | 120 | |
121 | 121 | <div class="row"> |
122 | 122 | <div class="col s12 m3 label"> |
123 | - <label for="ftp_timeout"><?php echo __( "Ftp Timeout", 'xcloner-backup-and-restore' ) ?></label> |
|
123 | + <label for="ftp_timeout"><?php echo __("Ftp Timeout", 'xcloner-backup-and-restore') ?></label> |
|
124 | 124 | </div> |
125 | 125 | <div class=" col s12 m2"> |
126 | - <input placeholder="<?php echo __( "Ftp Timeout", 'xcloner-backup-and-restore' ) ?>" |
|
126 | + <input placeholder="<?php echo __("Ftp Timeout", 'xcloner-backup-and-restore') ?>" |
|
127 | 127 | id="ftp_timeout" type="text" name="xcloner_ftp_timeout" class="validate" |
128 | - value="<?php echo get_option( "xcloner_ftp_timeout", 30 ) ?>"> |
|
128 | + value="<?php echo get_option("xcloner_ftp_timeout", 30) ?>"> |
|
129 | 129 | </div> |
130 | 130 | </div> |
131 | 131 | |
132 | 132 | <div class="row"> |
133 | 133 | <div class="col s12 m3 label"> |
134 | - <label for="ftp_cleanup_days"><?php echo __( "Ftp Cleanup (days)", 'xcloner-backup-and-restore' ) ?></label> |
|
134 | + <label for="ftp_cleanup_days"><?php echo __("Ftp Cleanup (days)", 'xcloner-backup-and-restore') ?></label> |
|
135 | 135 | </div> |
136 | 136 | <div class=" col s12 m6"> |
137 | - <input placeholder="<?php echo __( "how many days to keep the backups for", 'xcloner-backup-and-restore' ) ?>" |
|
137 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore') ?>" |
|
138 | 138 | id="ftp_cleanup_days" type="text" name="xcloner_ftp_cleanup_days" |
139 | - class="validate" value="<?php echo get_option( "xcloner_ftp_cleanup_days" ) ?>"> |
|
139 | + class="validate" value="<?php echo get_option("xcloner_ftp_cleanup_days") ?>"> |
|
140 | 140 | </div> |
141 | 141 | </div> |
142 | 142 | |
143 | 143 | <div class="row"> |
144 | 144 | <div class="col s6 m4"> |
145 | 145 | <button class="btn waves-effect waves-light" type="submit" name="action" id="action" |
146 | - value="ftp"><?php echo __( "Save Settings", 'xcloner-backup-and-restore' ) ?> |
|
146 | + value="ftp"><?php echo __("Save Settings", 'xcloner-backup-and-restore') ?> |
|
147 | 147 | <i class="material-icons right">save</i> |
148 | 148 | </button> |
149 | 149 | </div> |
150 | 150 | <div class="col s6 m4"> |
151 | 151 | <button class="btn waves-effect waves-light orange" type="submit" name="action" |
152 | 152 | id="action" value="ftp" |
153 | - onclick="jQuery('#connection_check').val('1')"><?php echo __( "Verify", 'xcloner-backup-and-restore' ) ?> |
|
153 | + onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore') ?> |
|
154 | 154 | <i class="material-icons right">import_export</i> |
155 | 155 | </button> |
156 | 156 | </div> |
@@ -161,12 +161,12 @@ discard block |
||
161 | 161 | <!-- SFTP STORAGE--> |
162 | 162 | <li id="sftp"> |
163 | 163 | <div class="collapsible-header"> |
164 | - <i class="material-icons">computer</i><?php echo __( "SFTP Storage", 'xcloner-backup-and-restore' ) ?> |
|
164 | + <i class="material-icons">computer</i><?php echo __("SFTP Storage", 'xcloner-backup-and-restore') ?> |
|
165 | 165 | <div class="switch right"> |
166 | 166 | <label> |
167 | 167 | Off |
168 | 168 | <input type="checkbox" name="xcloner_sftp_enable" class="status" |
169 | - value="1" <?php if ( get_option( "xcloner_sftp_enable" ) ) |
|
169 | + value="1" <?php if (get_option("xcloner_sftp_enable")) |
|
170 | 170 | echo "checked" ?> \> |
171 | 171 | <span class="lever"></span> |
172 | 172 | On |
@@ -176,100 +176,100 @@ discard block |
||
176 | 176 | <div class="collapsible-body"> |
177 | 177 | <div class="row"> |
178 | 178 | <div class="col s12 m3 label"> |
179 | - <label for="sftp_host"><?php echo __( "SFTP Hostname", 'xcloner-backup-and-restore' ) ?></label> |
|
179 | + <label for="sftp_host"><?php echo __("SFTP Hostname", 'xcloner-backup-and-restore') ?></label> |
|
180 | 180 | </div> |
181 | 181 | <div class="col s12 m6"> |
182 | - <input placeholder="<?php echo __( "SFTP Hostname", 'xcloner-backup-and-restore' ) ?>" |
|
182 | + <input placeholder="<?php echo __("SFTP Hostname", 'xcloner-backup-and-restore') ?>" |
|
183 | 183 | id="sftp_host" type="text" name="xcloner_sftp_hostname" class="validate" |
184 | - value="<?php echo get_option( "xcloner_sftp_hostname" ) ?>"> |
|
184 | + value="<?php echo get_option("xcloner_sftp_hostname") ?>"> |
|
185 | 185 | </div> |
186 | 186 | <div class=" col s12 m2"> |
187 | - <input placeholder="<?php echo __( "SFTP Port", 'xcloner-backup-and-restore' ) ?>" |
|
187 | + <input placeholder="<?php echo __("SFTP Port", 'xcloner-backup-and-restore') ?>" |
|
188 | 188 | id="sftp_port" type="text" name="xcloner_sftp_port" class="validate" |
189 | - value="<?php echo get_option( "xcloner_sftp_port", 22 ) ?>"> |
|
189 | + value="<?php echo get_option("xcloner_sftp_port", 22) ?>"> |
|
190 | 190 | </div> |
191 | 191 | </div> |
192 | 192 | |
193 | 193 | <div class="row"> |
194 | 194 | <div class="col s12 m3 label"> |
195 | - <label for="sftp_username"><?php echo __( "SFTP Username", 'xcloner-backup-and-restore' ) ?></label> |
|
195 | + <label for="sftp_username"><?php echo __("SFTP Username", 'xcloner-backup-and-restore') ?></label> |
|
196 | 196 | </div> |
197 | 197 | <div class=" col s12 m6"> |
198 | - <input placeholder="<?php echo __( "SFTP Username", 'xcloner-backup-and-restore' ) ?>" |
|
198 | + <input placeholder="<?php echo __("SFTP Username", 'xcloner-backup-and-restore') ?>" |
|
199 | 199 | id="sftp_username" type="text" name="xcloner_sftp_username" class="validate" |
200 | - value="<?php echo get_option( "xcloner_sftp_username" ) ?>" autocomplete="off"> |
|
200 | + value="<?php echo get_option("xcloner_sftp_username") ?>" autocomplete="off"> |
|
201 | 201 | </div> |
202 | 202 | </div> |
203 | 203 | |
204 | 204 | |
205 | 205 | <div class="row"> |
206 | 206 | <div class="col s12 m3 label"> |
207 | - <label for="sftp_password"><?php echo __( "SFTP or Private Key Password", 'xcloner-backup-and-restore' ) ?></label> |
|
207 | + <label for="sftp_password"><?php echo __("SFTP or Private Key Password", 'xcloner-backup-and-restore') ?></label> |
|
208 | 208 | </div> |
209 | 209 | <div class=" col s12 m6"> |
210 | - <input placeholder="<?php echo __( "SFTP or Private Key Password", 'xcloner-backup-and-restore' ) ?>" |
|
210 | + <input placeholder="<?php echo __("SFTP or Private Key Password", 'xcloner-backup-and-restore') ?>" |
|
211 | 211 | id="ftp_spassword" type="password" name="xcloner_sftp_password" class="validate" |
212 | - value="<?php echo get_option( "xcloner_sftp_password" ) ?>" autocomplete="off"> |
|
212 | + value="<?php echo get_option("xcloner_sftp_password") ?>" autocomplete="off"> |
|
213 | 213 | </div> |
214 | 214 | </div> |
215 | 215 | |
216 | 216 | <div class="row"> |
217 | 217 | <div class="col s12 m3 label"> |
218 | - <label for="sftp_private_key"><?php echo __( "SFTP Private Key(RSA)", 'xcloner-backup-and-restore' ) ?></label> |
|
218 | + <label for="sftp_private_key"><?php echo __("SFTP Private Key(RSA)", 'xcloner-backup-and-restore') ?></label> |
|
219 | 219 | </div> |
220 | 220 | <div class=" col s12 m6"> |
221 | 221 | <textarea rows="5" |
222 | - placeholder="<?php echo __( "Local Server Path or Contents of the SFTP Private Key RSA File", 'xcloner-backup-and-restore' ) ?>" |
|
222 | + placeholder="<?php echo __("Local Server Path or Contents of the SFTP Private Key RSA File", 'xcloner-backup-and-restore') ?>" |
|
223 | 223 | id="sftp_private_key" type="text" name="xcloner_sftp_private_key" |
224 | 224 | class="validate" |
225 | - value=""><?php echo get_option( "xcloner_sftp_private_key" ) ?></textarea> |
|
225 | + value=""><?php echo get_option("xcloner_sftp_private_key") ?></textarea> |
|
226 | 226 | </div> |
227 | 227 | </div> |
228 | 228 | |
229 | 229 | <div class="row"> |
230 | 230 | <div class="col s12 m3 label"> |
231 | - <label for="sftp_root"><?php echo __( "SFTP Storage Folder", 'xcloner-backup-and-restore' ) ?></label> |
|
231 | + <label for="sftp_root"><?php echo __("SFTP Storage Folder", 'xcloner-backup-and-restore') ?></label> |
|
232 | 232 | </div> |
233 | 233 | <div class=" col s12 m6"> |
234 | - <input placeholder="<?php echo __( "SFTP Storage Folder", 'xcloner-backup-and-restore' ) ?>" |
|
234 | + <input placeholder="<?php echo __("SFTP Storage Folder", 'xcloner-backup-and-restore') ?>" |
|
235 | 235 | id="sftp_root" type="text" name="xcloner_sftp_path" class="validate" |
236 | - value="<?php echo get_option( "xcloner_sftp_path" ) ?>"> |
|
236 | + value="<?php echo get_option("xcloner_sftp_path") ?>"> |
|
237 | 237 | </div> |
238 | 238 | </div> |
239 | 239 | |
240 | 240 | <div class="row"> |
241 | 241 | <div class="col s12 m3 label"> |
242 | - <label for="sftp_timeout"><?php echo __( "SFTP Timeout", 'xcloner-backup-and-restore' ) ?></label> |
|
242 | + <label for="sftp_timeout"><?php echo __("SFTP Timeout", 'xcloner-backup-and-restore') ?></label> |
|
243 | 243 | </div> |
244 | 244 | <div class=" col s12 m2"> |
245 | - <input placeholder="<?php echo __( "SFTP Timeout", 'xcloner-backup-and-restore' ) ?>" |
|
245 | + <input placeholder="<?php echo __("SFTP Timeout", 'xcloner-backup-and-restore') ?>" |
|
246 | 246 | id="sftp_timeout" type="text" name="xcloner_sftp_timeout" class="validate" |
247 | - value="<?php echo get_option( "xcloner_sftp_timeout", 30 ) ?>"> |
|
247 | + value="<?php echo get_option("xcloner_sftp_timeout", 30) ?>"> |
|
248 | 248 | </div> |
249 | 249 | </div> |
250 | 250 | |
251 | 251 | <div class="row"> |
252 | 252 | <div class="col s12 m3 label"> |
253 | - <label for="sftp_cleanup_days"><?php echo __( "SFTP Cleanup (days)", 'xcloner-backup-and-restore' ) ?></label> |
|
253 | + <label for="sftp_cleanup_days"><?php echo __("SFTP Cleanup (days)", 'xcloner-backup-and-restore') ?></label> |
|
254 | 254 | </div> |
255 | 255 | <div class=" col s12 m6"> |
256 | - <input placeholder="<?php echo __( "how many days to keep the backups for", 'xcloner-backup-and-restore' ) ?>" |
|
256 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore') ?>" |
|
257 | 257 | id="sftp_cleanup_days" type="text" name="xcloner_sftp_cleanup_days" |
258 | - class="validate" value="<?php echo get_option( "xcloner_sftp_cleanup_days" ) ?>"> |
|
258 | + class="validate" value="<?php echo get_option("xcloner_sftp_cleanup_days") ?>"> |
|
259 | 259 | </div> |
260 | 260 | </div> |
261 | 261 | |
262 | 262 | <div class="row"> |
263 | 263 | <div class="col s6 m4"> |
264 | 264 | <button class="btn waves-effect waves-light" type="submit" name="action" id="action" |
265 | - value="sftp"><?php echo __( "Save Settings", 'xcloner-backup-and-restore' ) ?> |
|
265 | + value="sftp"><?php echo __("Save Settings", 'xcloner-backup-and-restore') ?> |
|
266 | 266 | <i class="material-icons right">save</i> |
267 | 267 | </button> |
268 | 268 | </div> |
269 | 269 | <div class="col s6 m4"> |
270 | 270 | <button class="btn waves-effect waves-light orange" type="submit" name="action" |
271 | 271 | id="action" value="sftp" |
272 | - onclick="jQuery('#connection_check').val('1')"><?php echo __( "Verify", 'xcloner-backup-and-restore' ) ?> |
|
272 | + onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore') ?> |
|
273 | 273 | <i class="material-icons right">import_export</i> |
274 | 274 | </button> |
275 | 275 | </div> |
@@ -281,12 +281,12 @@ discard block |
||
281 | 281 | <!-- AWS STORAGE--> |
282 | 282 | <li id="aws"> |
283 | 283 | <div class="collapsible-header"> |
284 | - <i class="material-icons">computer</i><?php echo __( "S3 Storage", 'xcloner-backup-and-restore' ) ?> |
|
284 | + <i class="material-icons">computer</i><?php echo __("S3 Storage", 'xcloner-backup-and-restore') ?> |
|
285 | 285 | <div class="switch right"> |
286 | 286 | <label> |
287 | 287 | Off |
288 | 288 | <input type="checkbox" name="xcloner_aws_enable" class="status" |
289 | - value="1" <?php if ( get_option( "xcloner_aws_enable" ) ) |
|
289 | + value="1" <?php if (get_option("xcloner_aws_enable")) |
|
290 | 290 | echo "checked" ?> \> |
291 | 291 | <span class="lever"></span> |
292 | 292 | On |
@@ -301,49 +301,49 @@ discard block |
||
301 | 301 | </div> |
302 | 302 | <div class=" col s12 m6"> |
303 | 303 | <p> |
304 | - <?php echo sprintf( __( 'Visit %s and get your "Key" and "Secret <br />Visit %s to install your own S3 like service.' ), "<a href='https://aws.amazon.com/s3/' target='_blank'>https://aws.amazon.com/s3/</a>", "<a href='https://minio.io/' target='_blank'>https://minio.io/</a>" ) ?> |
|
304 | + <?php echo sprintf(__('Visit %s and get your "Key" and "Secret <br />Visit %s to install your own S3 like service.'), "<a href='https://aws.amazon.com/s3/' target='_blank'>https://aws.amazon.com/s3/</a>", "<a href='https://minio.io/' target='_blank'>https://minio.io/</a>") ?> |
|
305 | 305 | </p> |
306 | 306 | </div> |
307 | 307 | </div> |
308 | 308 | |
309 | 309 | <div class="row"> |
310 | 310 | <div class="col s12 m3 label"> |
311 | - <label for="aws_key"><?php echo __( "S3 Key", 'xcloner-backup-and-restore' ) ?></label> |
|
311 | + <label for="aws_key"><?php echo __("S3 Key", 'xcloner-backup-and-restore') ?></label> |
|
312 | 312 | </div> |
313 | 313 | <div class=" col s12 m6"> |
314 | - <input placeholder="<?php echo __( "S3 Key", 'xcloner-backup-and-restore' ) ?>" |
|
314 | + <input placeholder="<?php echo __("S3 Key", 'xcloner-backup-and-restore') ?>" |
|
315 | 315 | id="aws_key" type="text" name="xcloner_aws_key" class="validate" |
316 | - value="<?php echo get_option( "xcloner_aws_key" ) ?>" autocomplete="off"> |
|
316 | + value="<?php echo get_option("xcloner_aws_key") ?>" autocomplete="off"> |
|
317 | 317 | </div> |
318 | 318 | </div> |
319 | 319 | |
320 | 320 | <div class="row"> |
321 | 321 | <div class="col s12 m3 label"> |
322 | - <label for="aws_secret"><?php echo __( "S3 Secret", 'xcloner-backup-and-restore' ) ?></label> |
|
322 | + <label for="aws_secret"><?php echo __("S3 Secret", 'xcloner-backup-and-restore') ?></label> |
|
323 | 323 | </div> |
324 | 324 | <div class=" col s12 m6"> |
325 | - <input placeholder="<?php echo __( "S3 Secret", 'xcloner-backup-and-restore' ) ?>" |
|
325 | + <input placeholder="<?php echo __("S3 Secret", 'xcloner-backup-and-restore') ?>" |
|
326 | 326 | id="aws_secret" type="text" name="xcloner_aws_secret" class="validate" |
327 | - value="<?php echo get_option( "xcloner_aws_secret" ) ?>" autocomplete="off"> |
|
327 | + value="<?php echo get_option("xcloner_aws_secret") ?>" autocomplete="off"> |
|
328 | 328 | </div> |
329 | 329 | </div> |
330 | 330 | |
331 | 331 | <div class="row"> |
332 | 332 | <div class="col s12 m3 label"> |
333 | - <label for="aws_region"><?php echo __( "S3 Region", 'xcloner-backup-and-restore' ) ?></label> |
|
333 | + <label for="aws_region"><?php echo __("S3 Region", 'xcloner-backup-and-restore') ?></label> |
|
334 | 334 | </div> |
335 | 335 | <div class=" col s12 m6"> |
336 | - <select placeholder="<?php echo __( "example: us-east-1", 'xcloner-backup-and-restore' ) ?>" |
|
336 | + <select placeholder="<?php echo __("example: us-east-1", 'xcloner-backup-and-restore') ?>" |
|
337 | 337 | id="aws_region" type="text" name="xcloner_aws_region" class="validate" |
338 | - value="<?php echo get_option( "xcloner_aws_region" ) ?>" autocomplete="off"> |
|
338 | + value="<?php echo get_option("xcloner_aws_region") ?>" autocomplete="off"> |
|
339 | 339 | <option readonly |
340 | - value=""><?php echo __( "Please Select AWS S3 Region or Leave Unselected for Custom Endpoint" ) ?></option> |
|
340 | + value=""><?php echo __("Please Select AWS S3 Region or Leave Unselected for Custom Endpoint") ?></option> |
|
341 | 341 | <?php |
342 | 342 | $aws_regions = $remote_storage->get_aws_regions(); |
343 | 343 | |
344 | - foreach ( $aws_regions as $key => $region ) { |
|
344 | + foreach ($aws_regions as $key => $region) { |
|
345 | 345 | ?> |
346 | - <option value="<?php echo $key ?>" <?php echo( $key == get_option( 'xcloner_aws_region' ) ? "selected" : "" ) ?>><?php echo $region ?> |
|
346 | + <option value="<?php echo $key ?>" <?php echo($key == get_option('xcloner_aws_region') ? "selected" : "") ?>><?php echo $region ?> |
|
347 | 347 | = <?php echo $key ?></option> |
348 | 348 | <?php |
349 | 349 | } |
@@ -354,59 +354,59 @@ discard block |
||
354 | 354 | |
355 | 355 | <div class="row"> |
356 | 356 | <div class="col s12 m3 label"> |
357 | - <label for="aws_endpoint"><?php echo __( "S3 EndPoint", 'xcloner-backup-and-restore' ) ?></label> |
|
357 | + <label for="aws_endpoint"><?php echo __("S3 EndPoint", 'xcloner-backup-and-restore') ?></label> |
|
358 | 358 | </div> |
359 | 359 | <div class=" col s12 m6"> |
360 | - <input placeholder="<?php echo __( "S3 EndPoint, leave blank if you want to use the default Amazon AWS Service", 'xcloner-backup-and-restore' ) ?>" |
|
360 | + <input placeholder="<?php echo __("S3 EndPoint, leave blank if you want to use the default Amazon AWS Service", 'xcloner-backup-and-restore') ?>" |
|
361 | 361 | id="aws_endpoint" type="text" name="xcloner_aws_endpoint" class="validate" |
362 | - value="<?php echo get_option( "xcloner_aws_endpoint" ) ?>" autocomplete="off"> |
|
362 | + value="<?php echo get_option("xcloner_aws_endpoint") ?>" autocomplete="off"> |
|
363 | 363 | </div> |
364 | 364 | </div> |
365 | 365 | |
366 | 366 | <div class="row"> |
367 | 367 | <div class="col s12 m3 label"> |
368 | - <label for="aws_bucket_name"><?php echo __( "S3 Bucket Name", 'xcloner-backup-and-restore' ) ?></label> |
|
368 | + <label for="aws_bucket_name"><?php echo __("S3 Bucket Name", 'xcloner-backup-and-restore') ?></label> |
|
369 | 369 | </div> |
370 | 370 | <div class=" col s12 m6"> |
371 | - <input placeholder="<?php echo __( "S3 Bucket Name", 'xcloner-backup-and-restore' ) ?>" |
|
371 | + <input placeholder="<?php echo __("S3 Bucket Name", 'xcloner-backup-and-restore') ?>" |
|
372 | 372 | id="aws_bucket_name" type="text" name="xcloner_aws_bucket_name" class="validate" |
373 | - value="<?php echo get_option( "xcloner_aws_bucket_name" ) ?>" autocomplete="off"> |
|
373 | + value="<?php echo get_option("xcloner_aws_bucket_name") ?>" autocomplete="off"> |
|
374 | 374 | </div> |
375 | 375 | </div> |
376 | 376 | |
377 | 377 | <div class="row"> |
378 | 378 | <div class="col s12 m3 label"> |
379 | - <label for="aws_prefix"><?php echo __( "S3 Prefix", 'xcloner-backup-and-restore' ) ?></label> |
|
379 | + <label for="aws_prefix"><?php echo __("S3 Prefix", 'xcloner-backup-and-restore') ?></label> |
|
380 | 380 | </div> |
381 | 381 | <div class=" col s12 m6"> |
382 | - <input placeholder="<?php echo __( "S3 Prefix, use / ending to define a folder", 'xcloner-backup-and-restore' ) ?>" |
|
382 | + <input placeholder="<?php echo __("S3 Prefix, use / ending to define a folder", 'xcloner-backup-and-restore') ?>" |
|
383 | 383 | id="aws_prefix" type="text" name="xcloner_aws_prefix" class="validate" |
384 | - value="<?php echo get_option( "xcloner_aws_prefix" ) ?>" autocomplete="off"> |
|
384 | + value="<?php echo get_option("xcloner_aws_prefix") ?>" autocomplete="off"> |
|
385 | 385 | </div> |
386 | 386 | </div> |
387 | 387 | |
388 | 388 | <div class="row"> |
389 | 389 | <div class="col s12 m3 label"> |
390 | - <label for="aws_cleanup_days"><?php echo __( "S3 Cleanup (days)", 'xcloner-backup-and-restore' ) ?></label> |
|
390 | + <label for="aws_cleanup_days"><?php echo __("S3 Cleanup (days)", 'xcloner-backup-and-restore') ?></label> |
|
391 | 391 | </div> |
392 | 392 | <div class=" col s12 m6"> |
393 | - <input placeholder="<?php echo __( "how many days to keep the backups for", 'xcloner-backup-and-restore' ) ?>" |
|
393 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore') ?>" |
|
394 | 394 | id="aws_cleanup_days" type="text" name="xcloner_aws_cleanup_days" |
395 | - class="validate" value="<?php echo get_option( "xcloner_aws_cleanup_days" ) ?>"> |
|
395 | + class="validate" value="<?php echo get_option("xcloner_aws_cleanup_days") ?>"> |
|
396 | 396 | </div> |
397 | 397 | </div> |
398 | 398 | |
399 | 399 | <div class="row"> |
400 | 400 | <div class="col s6 m4"> |
401 | 401 | <button class="btn waves-effect waves-light" type="submit" name="action" id="action" |
402 | - value="aws"><?php echo __( "Save Settings", 'xcloner-backup-and-restore' ) ?> |
|
402 | + value="aws"><?php echo __("Save Settings", 'xcloner-backup-and-restore') ?> |
|
403 | 403 | <i class="material-icons right">save</i> |
404 | 404 | </button> |
405 | 405 | </div> |
406 | 406 | <div class="col s6 m4"> |
407 | 407 | <button class="btn waves-effect waves-light orange" type="submit" name="action" |
408 | 408 | id="action" value="aws" |
409 | - onclick="jQuery('#connection_check').val('1')"><?php echo __( "Verify", 'xcloner-backup-and-restore' ) ?> |
|
409 | + onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore') ?> |
|
410 | 410 | <i class="material-icons right">import_export</i> |
411 | 411 | </button> |
412 | 412 | </div> |
@@ -418,12 +418,12 @@ discard block |
||
418 | 418 | <!-- DROPBOX STORAGE--> |
419 | 419 | <li id="dropbox"> |
420 | 420 | <div class="collapsible-header"> |
421 | - <i class="material-icons">computer</i><?php echo __( "Dropbox Storage", 'xcloner-backup-and-restore' ) ?> |
|
421 | + <i class="material-icons">computer</i><?php echo __("Dropbox Storage", 'xcloner-backup-and-restore') ?> |
|
422 | 422 | <div class="switch right"> |
423 | 423 | <label> |
424 | 424 | Off |
425 | 425 | <input type="checkbox" name="xcloner_dropbox_enable" class="status" |
426 | - value="1" <?php if ( get_option( "xcloner_dropbox_enable" ) ) |
|
426 | + value="1" <?php if (get_option("xcloner_dropbox_enable")) |
|
427 | 427 | echo "checked" ?> \> |
428 | 428 | <span class="lever"></span> |
429 | 429 | On |
@@ -438,20 +438,20 @@ discard block |
||
438 | 438 | </div> |
439 | 439 | <div class=" col s12 m6"> |
440 | 440 | <p> |
441 | - <?php echo sprintf( __( 'Visit %s and get your "App secret".' ), "<a href='https://www.dropbox.com/developers/apps' target='_blank'>https://www.dropbox.com/developers/apps</a>" ) ?> |
|
441 | + <?php echo sprintf(__('Visit %s and get your "App secret".'), "<a href='https://www.dropbox.com/developers/apps' target='_blank'>https://www.dropbox.com/developers/apps</a>") ?> |
|
442 | 442 | </p> |
443 | 443 | </div> |
444 | 444 | </div> |
445 | 445 | |
446 | 446 | <div class="row"> |
447 | 447 | <div class="col s12 m3 label"> |
448 | - <label for="dropbox_access_token"><?php echo __( "Dropbox Access Token", 'xcloner-backup-and-restore' ) ?></label> |
|
448 | + <label for="dropbox_access_token"><?php echo __("Dropbox Access Token", 'xcloner-backup-and-restore') ?></label> |
|
449 | 449 | </div> |
450 | 450 | <div class=" col s12 m6"> |
451 | - <input placeholder="<?php echo __( "Dropbox Access Token", 'xcloner-backup-and-restore' ) ?>" |
|
451 | + <input placeholder="<?php echo __("Dropbox Access Token", 'xcloner-backup-and-restore') ?>" |
|
452 | 452 | id="dropbox_access_token" type="text" name="xcloner_dropbox_access_token" |
453 | 453 | class="validate" |
454 | - value="<?php echo get_option( "xcloner_dropbox_access_token" ) ?>" |
|
454 | + value="<?php echo get_option("xcloner_dropbox_access_token") ?>" |
|
455 | 455 | autocomplete="off"> |
456 | 456 | </div> |
457 | 457 | </div> |
@@ -459,50 +459,50 @@ discard block |
||
459 | 459 | |
460 | 460 | <div class="row"> |
461 | 461 | <div class="col s12 m3 label"> |
462 | - <label for="dropbox_app_secret"><?php echo __( "Dropbox App Secret", 'xcloner-backup-and-restore' ) ?></label> |
|
462 | + <label for="dropbox_app_secret"><?php echo __("Dropbox App Secret", 'xcloner-backup-and-restore') ?></label> |
|
463 | 463 | </div> |
464 | 464 | <div class=" col s12 m6"> |
465 | - <input placeholder="<?php echo __( "Dropbox App Secret", 'xcloner-backup-and-restore' ) ?>" |
|
465 | + <input placeholder="<?php echo __("Dropbox App Secret", 'xcloner-backup-and-restore') ?>" |
|
466 | 466 | id="dropbox_app_secret" type="text" name="xcloner_dropbox_app_secret" |
467 | - class="validate" value="<?php echo get_option( "xcloner_dropbox_app_secret" ) ?>" |
|
467 | + class="validate" value="<?php echo get_option("xcloner_dropbox_app_secret") ?>" |
|
468 | 468 | autocomplete="off"> |
469 | 469 | </div> |
470 | 470 | </div> |
471 | 471 | |
472 | 472 | <div class="row"> |
473 | 473 | <div class="col s12 m3 label"> |
474 | - <label for="dropbox_prefix"><?php echo __( "Dropbox Prefix", 'xcloner-backup-and-restore' ) ?></label> |
|
474 | + <label for="dropbox_prefix"><?php echo __("Dropbox Prefix", 'xcloner-backup-and-restore') ?></label> |
|
475 | 475 | </div> |
476 | 476 | <div class=" col s12 m6"> |
477 | - <input placeholder="<?php echo __( "Dropbox Prefix", 'xcloner-backup-and-restore' ) ?>" |
|
477 | + <input placeholder="<?php echo __("Dropbox Prefix", 'xcloner-backup-and-restore') ?>" |
|
478 | 478 | id="dropbox_prefix" type="text" name="xcloner_dropbox_prefix" class="validate" |
479 | - value="<?php echo get_option( "xcloner_dropbox_prefix" ) ?>"> |
|
479 | + value="<?php echo get_option("xcloner_dropbox_prefix") ?>"> |
|
480 | 480 | </div> |
481 | 481 | </div> |
482 | 482 | |
483 | 483 | <div class="row"> |
484 | 484 | <div class="col s12 m3 label"> |
485 | - <label for="dropbox_cleanup_days"><?php echo __( "Dropbox Cleanup (days)", 'xcloner-backup-and-restore' ) ?></label> |
|
485 | + <label for="dropbox_cleanup_days"><?php echo __("Dropbox Cleanup (days)", 'xcloner-backup-and-restore') ?></label> |
|
486 | 486 | </div> |
487 | 487 | <div class=" col s12 m6"> |
488 | - <input placeholder="<?php echo __( "how many days to keep the backups for", 'xcloner-backup-and-restore' ) ?>" |
|
488 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore') ?>" |
|
489 | 489 | id="dropbox_cleanup_days" type="text" name="xcloner_dropbox_cleanup_days" |
490 | 490 | class="validate" |
491 | - value="<?php echo get_option( "xcloner_dropbox_cleanup_days" ) ?>"> |
|
491 | + value="<?php echo get_option("xcloner_dropbox_cleanup_days") ?>"> |
|
492 | 492 | </div> |
493 | 493 | </div> |
494 | 494 | |
495 | 495 | <div class="row"> |
496 | 496 | <div class="col s6 m4"> |
497 | 497 | <button class="btn waves-effect waves-light" type="submit" name="action" id="action" |
498 | - value="dropbox"><?php echo __( "Save Settings", 'xcloner-backup-and-restore' ) ?> |
|
498 | + value="dropbox"><?php echo __("Save Settings", 'xcloner-backup-and-restore') ?> |
|
499 | 499 | <i class="material-icons right">save</i> |
500 | 500 | </button> |
501 | 501 | </div> |
502 | 502 | <div class="col s6 m4"> |
503 | 503 | <button class="btn waves-effect waves-light orange" type="submit" name="action" |
504 | 504 | id="action" value="dropbox" |
505 | - onclick="jQuery('#connection_check').val('1')"><?php echo __( "Verify", 'xcloner-backup-and-restore' ) ?> |
|
505 | + onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore') ?> |
|
506 | 506 | <i class="material-icons right">import_export</i> |
507 | 507 | </button> |
508 | 508 | </div> |
@@ -514,12 +514,12 @@ discard block |
||
514 | 514 | <!-- AZURE STORAGE--> |
515 | 515 | <li id="azure"> |
516 | 516 | <div class="collapsible-header"> |
517 | - <i class="material-icons">computer</i><?php echo __( "Azure Blob Storage", 'xcloner-backup-and-restore' ) ?> |
|
517 | + <i class="material-icons">computer</i><?php echo __("Azure Blob Storage", 'xcloner-backup-and-restore') ?> |
|
518 | 518 | <div class="switch right"> |
519 | 519 | <label> |
520 | 520 | Off |
521 | 521 | <input type="checkbox" name="xcloner_azure_enable" class="status" |
522 | - value="1" <?php if ( get_option( "xcloner_azure_enable" ) ) |
|
522 | + value="1" <?php if (get_option("xcloner_azure_enable")) |
|
523 | 523 | echo "checked" ?> \> |
524 | 524 | <span class="lever"></span> |
525 | 525 | On |
@@ -534,19 +534,19 @@ discard block |
||
534 | 534 | </div> |
535 | 535 | <div class=" col s12 m6"> |
536 | 536 | <p> |
537 | - <?php echo sprintf( __( 'Visit %s and get your "Api Key".', 'xcloner-backup-and-restore' ), '<a href="https://azure.microsoft.com/en-us/services/storage/blobs/" target="_blank">https://azure.microsoft.com/en-us/services/storage/blobs/</a>' ) ?> |
|
537 | + <?php echo sprintf(__('Visit %s and get your "Api Key".', 'xcloner-backup-and-restore'), '<a href="https://azure.microsoft.com/en-us/services/storage/blobs/" target="_blank">https://azure.microsoft.com/en-us/services/storage/blobs/</a>') ?> |
|
538 | 538 | </p> |
539 | 539 | </div> |
540 | 540 | </div> |
541 | 541 | |
542 | 542 | <div class="row"> |
543 | 543 | <div class="col s12 m3 label"> |
544 | - <label for="azure_account_name"><?php echo __( "Azure Account Name", 'xcloner-backup-and-restore' ) ?></label> |
|
544 | + <label for="azure_account_name"><?php echo __("Azure Account Name", 'xcloner-backup-and-restore') ?></label> |
|
545 | 545 | </div> |
546 | 546 | <div class=" col s12 m6"> |
547 | - <input placeholder="<?php echo __( "Azure Account Name", 'xcloner-backup-and-restore' ) ?>" |
|
547 | + <input placeholder="<?php echo __("Azure Account Name", 'xcloner-backup-and-restore') ?>" |
|
548 | 548 | id="azure_account_name" type="text" name="xcloner_azure_account_name" |
549 | - class="validate" value="<?php echo get_option( "xcloner_azure_account_name" ) ?>" |
|
549 | + class="validate" value="<?php echo get_option("xcloner_azure_account_name") ?>" |
|
550 | 550 | autocomplete="off"> |
551 | 551 | </div> |
552 | 552 | </div> |
@@ -554,49 +554,49 @@ discard block |
||
554 | 554 | |
555 | 555 | <div class="row"> |
556 | 556 | <div class="col s12 m3 label"> |
557 | - <label for="azure_api_key"><?php echo __( "Azure Api Key", 'xcloner-backup-and-restore' ) ?></label> |
|
557 | + <label for="azure_api_key"><?php echo __("Azure Api Key", 'xcloner-backup-and-restore') ?></label> |
|
558 | 558 | </div> |
559 | 559 | <div class=" col s12 m6"> |
560 | - <input placeholder="<?php echo __( "Azure Api Key", 'xcloner-backup-and-restore' ) ?>" |
|
560 | + <input placeholder="<?php echo __("Azure Api Key", 'xcloner-backup-and-restore') ?>" |
|
561 | 561 | id="azure_api_key" type="text" name="xcloner_azure_api_key" class="validate" |
562 | - value="<?php echo get_option( "xcloner_azure_api_key" ) ?>" autocomplete="off"> |
|
562 | + value="<?php echo get_option("xcloner_azure_api_key") ?>" autocomplete="off"> |
|
563 | 563 | </div> |
564 | 564 | </div> |
565 | 565 | |
566 | 566 | <div class="row"> |
567 | 567 | <div class="col s12 m3 label"> |
568 | - <label for="azure_container"><?php echo __( "Azure Container", 'xcloner-backup-and-restore' ) ?></label> |
|
568 | + <label for="azure_container"><?php echo __("Azure Container", 'xcloner-backup-and-restore') ?></label> |
|
569 | 569 | </div> |
570 | 570 | <div class=" col s12 m6"> |
571 | - <input placeholder="<?php echo __( "Azure Container", 'xcloner-backup-and-restore' ) ?>" |
|
571 | + <input placeholder="<?php echo __("Azure Container", 'xcloner-backup-and-restore') ?>" |
|
572 | 572 | id="azure_container" type="text" name="xcloner_azure_container" class="validate" |
573 | - value="<?php echo get_option( "xcloner_azure_container" ) ?>"> |
|
573 | + value="<?php echo get_option("xcloner_azure_container") ?>"> |
|
574 | 574 | </div> |
575 | 575 | </div> |
576 | 576 | |
577 | 577 | <div class="row"> |
578 | 578 | <div class="col s12 m3 label"> |
579 | - <label for="azure_cleanup_days"><?php echo __( "Azure Cleanup (days)", 'xcloner-backup-and-restore' ) ?></label> |
|
579 | + <label for="azure_cleanup_days"><?php echo __("Azure Cleanup (days)", 'xcloner-backup-and-restore') ?></label> |
|
580 | 580 | </div> |
581 | 581 | <div class=" col s12 m6"> |
582 | - <input placeholder="<?php echo __( "how many days to keep the backups for", 'xcloner-backup-and-restore' ) ?>" |
|
582 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore') ?>" |
|
583 | 583 | id="azure_cleanup_days" type="text" name="xcloner_azure_cleanup_days" |
584 | 584 | class="validate" |
585 | - value="<?php echo get_option( "xcloner_azure_cleanup_days" ) ?>"> |
|
585 | + value="<?php echo get_option("xcloner_azure_cleanup_days") ?>"> |
|
586 | 586 | </div> |
587 | 587 | </div> |
588 | 588 | |
589 | 589 | <div class="row"> |
590 | 590 | <div class="col s6 m4"> |
591 | 591 | <button class="btn waves-effect waves-light" type="submit" name="action" id="action" |
592 | - value="azure"><?php echo __( "Save Settings", 'xcloner-backup-and-restore' ) ?> |
|
592 | + value="azure"><?php echo __("Save Settings", 'xcloner-backup-and-restore') ?> |
|
593 | 593 | <i class="material-icons right">save</i> |
594 | 594 | </button> |
595 | 595 | </div> |
596 | 596 | <div class="col s6 m4"> |
597 | 597 | <button class="btn waves-effect waves-light orange" type="submit" name="action" |
598 | 598 | id="action" value="azure" |
599 | - onclick="jQuery('#connection_check').val('1')"><?php echo __( "Verify", 'xcloner-backup-and-restore' ) ?> |
|
599 | + onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore') ?> |
|
600 | 600 | <i class="material-icons right">import_export</i> |
601 | 601 | </button> |
602 | 602 | </div> |
@@ -608,12 +608,12 @@ discard block |
||
608 | 608 | <!-- BACKBLAZE STORAGE--> |
609 | 609 | <li id="backblaze"> |
610 | 610 | <div class="collapsible-header"> |
611 | - <i class="material-icons">computer</i><?php echo __( "Backblaze Storage", 'xcloner-backup-and-restore' ) ?> |
|
611 | + <i class="material-icons">computer</i><?php echo __("Backblaze Storage", 'xcloner-backup-and-restore') ?> |
|
612 | 612 | <div class="switch right"> |
613 | 613 | <label> |
614 | 614 | Off |
615 | 615 | <input type="checkbox" name="xcloner_backblaze_enable" class="status" |
616 | - value="1" <?php if ( get_option( "xcloner_backblaze_enable" ) ) |
|
616 | + value="1" <?php if (get_option("xcloner_backblaze_enable")) |
|
617 | 617 | echo "checked" ?> \> |
618 | 618 | <span class="lever"></span> |
619 | 619 | On |
@@ -628,20 +628,20 @@ discard block |
||
628 | 628 | </div> |
629 | 629 | <div class=" col s12 m6"> |
630 | 630 | <p> |
631 | - <?php echo sprintf( __( 'Visit %s and get your Account Id and Application Key.', 'xcloner-backup-and-restore' ), '<a href="https://secure.backblaze.com/b2_buckets.htm" target="_blank">https://secure.backblaze.com/b2_buckets.htm</a>' ) ?> |
|
631 | + <?php echo sprintf(__('Visit %s and get your Account Id and Application Key.', 'xcloner-backup-and-restore'), '<a href="https://secure.backblaze.com/b2_buckets.htm" target="_blank">https://secure.backblaze.com/b2_buckets.htm</a>') ?> |
|
632 | 632 | </p> |
633 | 633 | </div> |
634 | 634 | </div> |
635 | 635 | |
636 | 636 | <div class="row"> |
637 | 637 | <div class="col s12 m3 label"> |
638 | - <label for="backblaze_account_id"><?php echo __( "Backblaze Account Id", 'xcloner-backup-and-restore' ) ?></label> |
|
638 | + <label for="backblaze_account_id"><?php echo __("Backblaze Account Id", 'xcloner-backup-and-restore') ?></label> |
|
639 | 639 | </div> |
640 | 640 | <div class=" col s12 m6"> |
641 | - <input placeholder="<?php echo __( "Backblaze Account Id", 'xcloner-backup-and-restore' ) ?>" |
|
641 | + <input placeholder="<?php echo __("Backblaze Account Id", 'xcloner-backup-and-restore') ?>" |
|
642 | 642 | id="backblaze_account_id" type="text" name="xcloner_backblaze_account_id" |
643 | 643 | class="validate" |
644 | - value="<?php echo get_option( "xcloner_backblaze_account_id" ) ?>" |
|
644 | + value="<?php echo get_option("xcloner_backblaze_account_id") ?>" |
|
645 | 645 | autocomplete="off"> |
646 | 646 | </div> |
647 | 647 | </div> |
@@ -649,53 +649,53 @@ discard block |
||
649 | 649 | |
650 | 650 | <div class="row"> |
651 | 651 | <div class="col s12 m3 label"> |
652 | - <label for="backblaze_application_key"><?php echo __( "Backblaze Application Key", 'xcloner-backup-and-restore' ) ?></label> |
|
652 | + <label for="backblaze_application_key"><?php echo __("Backblaze Application Key", 'xcloner-backup-and-restore') ?></label> |
|
653 | 653 | </div> |
654 | 654 | <div class=" col s12 m6"> |
655 | - <input placeholder="<?php echo __( "Backblaze Application Key", 'xcloner-backup-and-restore' ) ?>" |
|
655 | + <input placeholder="<?php echo __("Backblaze Application Key", 'xcloner-backup-and-restore') ?>" |
|
656 | 656 | id="backblaze_application_key" type="text" |
657 | 657 | name="xcloner_backblaze_application_key" class="validate" |
658 | - value="<?php echo get_option( "xcloner_backblaze_application_key" ) ?>" |
|
658 | + value="<?php echo get_option("xcloner_backblaze_application_key") ?>" |
|
659 | 659 | autocomplete="off"> |
660 | 660 | </div> |
661 | 661 | </div> |
662 | 662 | |
663 | 663 | <div class="row"> |
664 | 664 | <div class="col s12 m3 label"> |
665 | - <label for="backblaze_bucket_name"><?php echo __( "Backblaze Bucket Name", 'xcloner-backup-and-restore' ) ?></label> |
|
665 | + <label for="backblaze_bucket_name"><?php echo __("Backblaze Bucket Name", 'xcloner-backup-and-restore') ?></label> |
|
666 | 666 | </div> |
667 | 667 | <div class=" col s12 m6"> |
668 | - <input placeholder="<?php echo __( "Backblaze Bucket Name", 'xcloner-backup-and-restore' ) ?>" |
|
668 | + <input placeholder="<?php echo __("Backblaze Bucket Name", 'xcloner-backup-and-restore') ?>" |
|
669 | 669 | id="backblaze_bucket_name" type="text" name="xcloner_backblaze_bucket_name" |
670 | 670 | class="validate" |
671 | - value="<?php echo get_option( "xcloner_backblaze_bucket_name" ) ?>" |
|
671 | + value="<?php echo get_option("xcloner_backblaze_bucket_name") ?>" |
|
672 | 672 | autocomplete="off"> |
673 | 673 | </div> |
674 | 674 | </div> |
675 | 675 | |
676 | 676 | <div class="row"> |
677 | 677 | <div class="col s12 m3 label"> |
678 | - <label for="backblaze_cleanup_days"><?php echo __( "Backblaze Cleanup (days)", 'xcloner-backup-and-restore' ) ?></label> |
|
678 | + <label for="backblaze_cleanup_days"><?php echo __("Backblaze Cleanup (days)", 'xcloner-backup-and-restore') ?></label> |
|
679 | 679 | </div> |
680 | 680 | <div class=" col s12 m6"> |
681 | - <input placeholder="<?php echo __( "how many days to keep the backups for", 'xcloner-backup-and-restore' ) ?>" |
|
681 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore') ?>" |
|
682 | 682 | id="backblaze_cleanup_days" type="text" name="xcloner_backblaze_cleanup_days" |
683 | 683 | class="validate" |
684 | - value="<?php echo get_option( "xcloner_backblaze_cleanup_days" ) ?>"> |
|
684 | + value="<?php echo get_option("xcloner_backblaze_cleanup_days") ?>"> |
|
685 | 685 | </div> |
686 | 686 | </div> |
687 | 687 | |
688 | 688 | <div class="row"> |
689 | 689 | <div class="col s6 m4"> |
690 | 690 | <button class="btn waves-effect waves-light" type="submit" name="action" id="action" |
691 | - value="backblaze"><?php echo __( "Save Settings", 'xcloner-backup-and-restore' ) ?> |
|
691 | + value="backblaze"><?php echo __("Save Settings", 'xcloner-backup-and-restore') ?> |
|
692 | 692 | <i class="material-icons right">save</i> |
693 | 693 | </button> |
694 | 694 | </div> |
695 | 695 | <div class="col s6 m4"> |
696 | 696 | <button class="btn waves-effect waves-light orange" type="submit" name="action" |
697 | 697 | id="action" value="backblaze" |
698 | - onclick="jQuery('#connection_check').val('1')"><?php echo __( "Verify", 'xcloner-backup-and-restore' ) ?> |
|
698 | + onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore') ?> |
|
699 | 699 | <i class="material-icons right">import_export</i> |
700 | 700 | </button> |
701 | 701 | </div> |
@@ -707,12 +707,12 @@ discard block |
||
707 | 707 | <!-- WEBDAV STORAGE--> |
708 | 708 | <li id="webdav"> |
709 | 709 | <div class="collapsible-header"> |
710 | - <i class="material-icons">computer</i><?php echo __( "WebDAV Storage", 'xcloner-backup-and-restore' ) ?> |
|
710 | + <i class="material-icons">computer</i><?php echo __("WebDAV Storage", 'xcloner-backup-and-restore') ?> |
|
711 | 711 | <div class="switch right"> |
712 | 712 | <label> |
713 | 713 | Off |
714 | 714 | <input type="checkbox" name="xcloner_webdav_enable" class="status" |
715 | - value="1" <?php if ( get_option( "xcloner_webdav_enable" ) ) |
|
715 | + value="1" <?php if (get_option("xcloner_webdav_enable")) |
|
716 | 716 | echo "checked" ?> \> |
717 | 717 | <span class="lever"></span> |
718 | 718 | On |
@@ -734,74 +734,74 @@ discard block |
||
734 | 734 | |
735 | 735 | <div class="row"> |
736 | 736 | <div class="col s12 m3 label"> |
737 | - <label for="webdav_url"><?php echo __( "WebDAV Base Url", 'xcloner-backup-and-restore' ) ?></label> |
|
737 | + <label for="webdav_url"><?php echo __("WebDAV Base Url", 'xcloner-backup-and-restore') ?></label> |
|
738 | 738 | </div> |
739 | 739 | <div class=" col s12 m6"> |
740 | - <input placeholder="<?php echo __( "WebDAV Base Url", 'xcloner-backup-and-restore' ) ?>" |
|
740 | + <input placeholder="<?php echo __("WebDAV Base Url", 'xcloner-backup-and-restore') ?>" |
|
741 | 741 | id="webdav_url" type="text" name="xcloner_webdav_url" class="validate" |
742 | - value="<?php echo get_option( "xcloner_webdav_url" ) ?>" autocomplete="off"> |
|
742 | + value="<?php echo get_option("xcloner_webdav_url") ?>" autocomplete="off"> |
|
743 | 743 | </div> |
744 | 744 | </div> |
745 | 745 | |
746 | 746 | <div class="row"> |
747 | 747 | <div class="col s12 m3 label"> |
748 | - <label for="webdav_username"><?php echo __( "WebDAV Username", 'xcloner-backup-and-restore' ) ?></label> |
|
748 | + <label for="webdav_username"><?php echo __("WebDAV Username", 'xcloner-backup-and-restore') ?></label> |
|
749 | 749 | </div> |
750 | 750 | <div class=" col s12 m6"> |
751 | - <input placeholder="<?php echo __( "WebDAV Username", 'xcloner-backup-and-restore' ) ?>" |
|
751 | + <input placeholder="<?php echo __("WebDAV Username", 'xcloner-backup-and-restore') ?>" |
|
752 | 752 | id="webdav_username" type="text" name="xcloner_webdav_username" class="validate" |
753 | - value="<?php echo get_option( "xcloner_webdav_username" ) ?>" autocomplete="off"> |
|
753 | + value="<?php echo get_option("xcloner_webdav_username") ?>" autocomplete="off"> |
|
754 | 754 | </div> |
755 | 755 | </div> |
756 | 756 | |
757 | 757 | <div class="row"> |
758 | 758 | <div class="col s12 m3 label"> |
759 | - <label for="webdav_password"><?php echo __( "WebDAV Password", 'xcloner-backup-and-restore' ) ?></label> |
|
759 | + <label for="webdav_password"><?php echo __("WebDAV Password", 'xcloner-backup-and-restore') ?></label> |
|
760 | 760 | </div> |
761 | 761 | <div class=" col s12 m6"> |
762 | - <input placeholder="<?php echo __( "WebDAV Password", 'xcloner-backup-and-restore' ) ?>" |
|
762 | + <input placeholder="<?php echo __("WebDAV Password", 'xcloner-backup-and-restore') ?>" |
|
763 | 763 | id="webdav_password" type="password" name="xcloner_webdav_password" |
764 | - class="validate" value="<?php echo get_option( "xcloner_webdav_password" ) ?>" |
|
764 | + class="validate" value="<?php echo get_option("xcloner_webdav_password") ?>" |
|
765 | 765 | autocomplete="off"> |
766 | 766 | </div> |
767 | 767 | </div> |
768 | 768 | |
769 | 769 | <div class="row"> |
770 | 770 | <div class="col s12 m3 label"> |
771 | - <label for="webdav_target_folder"><?php echo __( "WebDAV Target Folder", 'xcloner-backup-and-restore' ) ?></label> |
|
771 | + <label for="webdav_target_folder"><?php echo __("WebDAV Target Folder", 'xcloner-backup-and-restore') ?></label> |
|
772 | 772 | </div> |
773 | 773 | <div class=" col s12 m6"> |
774 | - <input placeholder="<?php echo __( "WebDAV Target Folder", 'xcloner-backup-and-restore' ) ?>" |
|
774 | + <input placeholder="<?php echo __("WebDAV Target Folder", 'xcloner-backup-and-restore') ?>" |
|
775 | 775 | id="webdav_target_folder" type="text" name="xcloner_webdav_target_folder" |
776 | 776 | class="validate" |
777 | - value="<?php echo get_option( "xcloner_webdav_target_folder" ) ?>" |
|
777 | + value="<?php echo get_option("xcloner_webdav_target_folder") ?>" |
|
778 | 778 | autocomplete="off"> |
779 | 779 | </div> |
780 | 780 | </div> |
781 | 781 | |
782 | 782 | <div class="row"> |
783 | 783 | <div class="col s12 m3 label"> |
784 | - <label for="webdav_cleanup_days"><?php echo __( "WebDAV Cleanup (days)", 'xcloner-backup-and-restore' ) ?></label> |
|
784 | + <label for="webdav_cleanup_days"><?php echo __("WebDAV Cleanup (days)", 'xcloner-backup-and-restore') ?></label> |
|
785 | 785 | </div> |
786 | 786 | <div class=" col s12 m6"> |
787 | - <input placeholder="<?php echo __( "how many days to keep the backups for", 'xcloner-backup-and-restore' ) ?>" |
|
787 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore') ?>" |
|
788 | 788 | id="webdav_cleanup_days" type="text" name="xcloner_webdav_cleanup_days" |
789 | 789 | class="validate" |
790 | - value="<?php echo get_option( "xcloner_webdav_cleanup_days" ) ?>"> |
|
790 | + value="<?php echo get_option("xcloner_webdav_cleanup_days") ?>"> |
|
791 | 791 | </div> |
792 | 792 | </div> |
793 | 793 | |
794 | 794 | <div class="row"> |
795 | 795 | <div class="col s6 m4"> |
796 | 796 | <button class="btn waves-effect waves-light" type="submit" name="action" id="action" |
797 | - value="webdav"><?php echo __( "Save Settings", 'xcloner-backup-and-restore' ) ?> |
|
797 | + value="webdav"><?php echo __("Save Settings", 'xcloner-backup-and-restore') ?> |
|
798 | 798 | <i class="material-icons right">save</i> |
799 | 799 | </button> |
800 | 800 | </div> |
801 | 801 | <div class="col s6 m4"> |
802 | 802 | <button class="btn waves-effect waves-light orange" type="submit" name="action" |
803 | 803 | id="action" value="webdav" |
804 | - onclick="jQuery('#connection_check').val('1')"><?php echo __( "Verify", 'xcloner-backup-and-restore' ) ?> |
|
804 | + onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore') ?> |
|
805 | 805 | <i class="material-icons right">import_export</i> |
806 | 806 | </button> |
807 | 807 | </div> |
@@ -813,13 +813,13 @@ discard block |
||
813 | 813 | <!-- Google DRIVE STORAGE--> |
814 | 814 | <li id="gdrive"> |
815 | 815 | <div class="collapsible-header"> |
816 | - <i class="material-icons">computer</i><?php echo __( "Google Drive Storage", 'xcloner-backup-and-restore' ) ?> |
|
817 | - <?php if ( $gdrive_construct ): ?> |
|
816 | + <i class="material-icons">computer</i><?php echo __("Google Drive Storage", 'xcloner-backup-and-restore') ?> |
|
817 | + <?php if ($gdrive_construct): ?> |
|
818 | 818 | <div class="switch right"> |
819 | 819 | <label> |
820 | 820 | Off |
821 | 821 | <input type="checkbox" name="xcloner_gdrive_enable" class="status" |
822 | - value="1" <?php if ( get_option( "xcloner_gdrive_enable" ) ) |
|
822 | + value="1" <?php if (get_option("xcloner_gdrive_enable")) |
|
823 | 823 | echo "checked" ?> \> |
824 | 824 | <span class="lever"></span> |
825 | 825 | On |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | </div> |
830 | 830 | <div class="collapsible-body"> |
831 | 831 | |
832 | - <?php if ( $gdrive_construct ) : ?> |
|
832 | + <?php if ($gdrive_construct) : ?> |
|
833 | 833 | |
834 | 834 | <div class="row"> |
835 | 835 | <div class="col s12 m3 label"> |
@@ -837,11 +837,11 @@ discard block |
||
837 | 837 | </div> |
838 | 838 | <div class=" col s12 m9"> |
839 | 839 | <p> |
840 | - <?php echo sprintf( __( 'Visit %s to create a new application and get your Client ID and Client Secret.', 'xcloner-backup-and-restore' ), '<a href="https://console.developers.google.com" target="_blank">https://console.developers.google.com</a>' ) ?> |
|
840 | + <?php echo sprintf(__('Visit %s to create a new application and get your Client ID and Client Secret.', 'xcloner-backup-and-restore'), '<a href="https://console.developers.google.com" target="_blank">https://console.developers.google.com</a>') ?> |
|
841 | 841 | <a href="https://youtu.be/YXUVPUVgG8k" target="_blank" |
842 | 842 | class="btn-floating tooltipped btn-small" data-position="right" |
843 | 843 | data-delay="50" data-html="true" |
844 | - data-tooltip="<?php echo sprintf( __( 'Click here to view a short video explaining how to create the Client ID and Client Secret as well as connecting XCloner with the Google Drive API %s', 'xcloner-backup-and-restore' ), "<br />https://youtu.be/YXUVPUVgG8k" ) ?>" |
|
844 | + data-tooltip="<?php echo sprintf(__('Click here to view a short video explaining how to create the Client ID and Client Secret as well as connecting XCloner with the Google Drive API %s', 'xcloner-backup-and-restore'), "<br />https://youtu.be/YXUVPUVgG8k") ?>" |
|
845 | 845 | data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i |
846 | 846 | class="material-icons">help_outline</i></a> |
847 | 847 | </p> |
@@ -850,25 +850,25 @@ discard block |
||
850 | 850 | |
851 | 851 | <div class="row"> |
852 | 852 | <div class="col s12 m3 label"> |
853 | - <label for="gdrive_client_id"><?php echo __( "Client ID", 'xcloner-backup-and-restore' ) ?></label> |
|
853 | + <label for="gdrive_client_id"><?php echo __("Client ID", 'xcloner-backup-and-restore') ?></label> |
|
854 | 854 | </div> |
855 | 855 | <div class=" col s12 m6"> |
856 | - <input placeholder="<?php echo __( "Google Client ID", 'xcloner-backup-and-restore' ) ?>" |
|
856 | + <input placeholder="<?php echo __("Google Client ID", 'xcloner-backup-and-restore') ?>" |
|
857 | 857 | id="gdrive_client_id" type="text" name="xcloner_gdrive_client_id" |
858 | 858 | class="validate" |
859 | - value="<?php echo get_option( "xcloner_gdrive_client_id" ) ?>"> |
|
859 | + value="<?php echo get_option("xcloner_gdrive_client_id") ?>"> |
|
860 | 860 | </div> |
861 | 861 | </div> |
862 | 862 | |
863 | 863 | <div class="row"> |
864 | 864 | <div class="col s12 m3 label"> |
865 | - <label for="gdrive_client_secret"><?php echo __( "Client Secret", 'xcloner-backup-and-restore' ) ?></label> |
|
865 | + <label for="gdrive_client_secret"><?php echo __("Client Secret", 'xcloner-backup-and-restore') ?></label> |
|
866 | 866 | </div> |
867 | 867 | <div class=" col s12 m6"> |
868 | - <input placeholder="<?php echo __( "Google Client Secret", 'xcloner-backup-and-restore' ) ?>" |
|
868 | + <input placeholder="<?php echo __("Google Client Secret", 'xcloner-backup-and-restore') ?>" |
|
869 | 869 | id="gdrive_client_secret" type="text" name="xcloner_gdrive_client_secret" |
870 | 870 | class="validate" |
871 | - value="<?php echo get_option( "xcloner_gdrive_client_secret" ) ?>"> |
|
871 | + value="<?php echo get_option("xcloner_gdrive_client_secret") ?>"> |
|
872 | 872 | </div> |
873 | 873 | </div> |
874 | 874 | |
@@ -880,72 +880,72 @@ discard block |
||
880 | 880 | <div class=" col s12 m6"> |
881 | 881 | <a class="btn" target="_blank" id="gdrive_authorization_click" |
882 | 882 | onclick="jQuery('#authentification_code').show()" |
883 | - href="<?php echo $gdrive_auth_url ?>"><?php echo sprintf( __( 'Authorize Google Drive', 'xcloner-backup-and-restore' ) ) ?></a> |
|
883 | + href="<?php echo $gdrive_auth_url ?>"><?php echo sprintf(__('Authorize Google Drive', 'xcloner-backup-and-restore')) ?></a> |
|
884 | 884 | <input type="text" name="authentification_code" id="authentification_code" |
885 | - placeholder="<?php echo __( "Paste Authorization Code Here", "xcloner-backup-and-restore" ) ?>"> |
|
885 | + placeholder="<?php echo __("Paste Authorization Code Here", "xcloner-backup-and-restore") ?>"> |
|
886 | 886 | </div> |
887 | 887 | </div> |
888 | 888 | |
889 | 889 | <div class="row"> |
890 | 890 | <div class="col s12 m3 label"> |
891 | - <label for="gdrive_target_folder"><?php echo __( "Folder ID or Root Path", 'xcloner-backup-and-restore' ) ?> |
|
891 | + <label for="gdrive_target_folder"><?php echo __("Folder ID or Root Path", 'xcloner-backup-and-restore') ?> |
|
892 | 892 | <a class="btn-floating tooltipped btn-small" data-position="right" |
893 | 893 | data-delay="50" data-html="true" \ |
894 | - data-tooltip="<?php echo __( 'Folder ID can be found by right clicking on the folder name and selecting \'Get shareable link\' menu, format https://drive.google.com/open?id={FOLDER_ID}<br /> |
|
895 | - If you supply a folder name, it has to exists in the drive root and start with / , example /backups.xcloner.com/', 'xcloner-backup-and-restore' ) ?>" |
|
894 | + data-tooltip="<?php echo __('Folder ID can be found by right clicking on the folder name and selecting \'Get shareable link\' menu, format https://drive.google.com/open?id={FOLDER_ID}<br /> |
|
895 | + If you supply a folder name, it has to exists in the drive root and start with / , example /backups.xcloner.com/', 'xcloner-backup-and-restore') ?>" |
|
896 | 896 | data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i |
897 | 897 | class="material-icons">help_outline</i></a> |
898 | 898 | </label> |
899 | 899 | </div> |
900 | 900 | <div class=" col s12 m6"> |
901 | - <input placeholder="<?php echo __( "Target Folder ID or Root Path", 'xcloner-backup-and-restore' ) ?>" |
|
901 | + <input placeholder="<?php echo __("Target Folder ID or Root Path", 'xcloner-backup-and-restore') ?>" |
|
902 | 902 | id="gdrive_target_folder" type="text" name="xcloner_gdrive_target_folder" |
903 | 903 | class="validate" |
904 | - value="<?php echo get_option( "xcloner_gdrive_target_folder" ) ?>" |
|
904 | + value="<?php echo get_option("xcloner_gdrive_target_folder") ?>" |
|
905 | 905 | autocomplete="off"> |
906 | 906 | </div> |
907 | 907 | </div> |
908 | 908 | |
909 | 909 | <div class="row"> |
910 | 910 | <div class="col s12 m3 label"> |
911 | - <label for="gdrive_cleanup_days"><?php echo __( "Google Drive Cleanup (days)", 'xcloner-backup-and-restore' ) ?></label> |
|
911 | + <label for="gdrive_cleanup_days"><?php echo __("Google Drive Cleanup (days)", 'xcloner-backup-and-restore') ?></label> |
|
912 | 912 | </div> |
913 | 913 | <div class=" col s12 m6"> |
914 | - <input placeholder="<?php echo __( "how many days to keep the backups for", 'xcloner-backup-and-restore' ) ?>" |
|
914 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore') ?>" |
|
915 | 915 | id="gdrive_cleanup_days" type="text" name="xcloner_gdrive_cleanup_days" |
916 | 916 | class="validate" |
917 | - value="<?php echo get_option( "xcloner_gdrive_cleanup_days" ) ?>"> |
|
917 | + value="<?php echo get_option("xcloner_gdrive_cleanup_days") ?>"> |
|
918 | 918 | </div> |
919 | 919 | </div> |
920 | 920 | |
921 | 921 | <div class="row"> |
922 | 922 | <div class="col s12 m3 label"> |
923 | - <label for="gdrive_empty_trash"><?php echo __( "Automatically Empty Trash?", 'xcloner-backup-and-restore' ) ?></label> |
|
923 | + <label for="gdrive_empty_trash"><?php echo __("Automatically Empty Trash?", 'xcloner-backup-and-restore') ?></label> |
|
924 | 924 | </div> |
925 | 925 | <div class=" col s12 m6 input-field inline"> |
926 | 926 | <input name="xcloner_gdrive_empty_trash" type="radio" value="0" |
927 | - id="gdrive_empty_trash_off" <?php if ( ! get_option( "xcloner_gdrive_empty_trash", 0 ) ) |
|
927 | + id="gdrive_empty_trash_off" <?php if (!get_option("xcloner_gdrive_empty_trash", 0)) |
|
928 | 928 | echo "checked" ?> /> |
929 | - <label for="gdrive_empty_trash_off"><?php echo __( "Disabled", 'xcloner-backup-and-restore' ) ?></label> |
|
929 | + <label for="gdrive_empty_trash_off"><?php echo __("Disabled", 'xcloner-backup-and-restore') ?></label> |
|
930 | 930 | |
931 | 931 | <input name="xcloner_gdrive_empty_trash" type="radio" value="1" |
932 | - id="gdrive_empty_trash_on" <?php if ( get_option( "xcloner_gdrive_empty_trash", 0 ) ) |
|
932 | + id="gdrive_empty_trash_on" <?php if (get_option("xcloner_gdrive_empty_trash", 0)) |
|
933 | 933 | echo "checked" ?> /> |
934 | - <label for="gdrive_empty_trash_on"><?php echo __( "Enabled", 'xcloner-backup-and-restore' ) ?></label> |
|
934 | + <label for="gdrive_empty_trash_on"><?php echo __("Enabled", 'xcloner-backup-and-restore') ?></label> |
|
935 | 935 | </div> |
936 | 936 | </div> |
937 | 937 | |
938 | 938 | <div class="row"> |
939 | 939 | <div class="col s6 m4"> |
940 | 940 | <button class="btn waves-effect waves-light" type="submit" name="action" id="action" |
941 | - value="gdrive"><?php echo __( "Save Settings", 'xcloner-backup-and-restore' ) ?> |
|
941 | + value="gdrive"><?php echo __("Save Settings", 'xcloner-backup-and-restore') ?> |
|
942 | 942 | <i class="material-icons right">save</i> |
943 | 943 | </button> |
944 | 944 | </div> |
945 | 945 | <div class="col s6 m4"> |
946 | 946 | <button class="btn waves-effect waves-light orange" type="submit" name="action" |
947 | 947 | id="action" value="gdrive" |
948 | - onclick="jQuery('#connection_check').val('1')"><?php echo __( "Verify", 'xcloner-backup-and-restore' ) ?> |
|
948 | + onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore') ?> |
|
949 | 949 | <i class="material-icons right">import_export</i> |
950 | 950 | </button> |
951 | 951 | </div> |
@@ -956,26 +956,26 @@ discard block |
||
956 | 956 | <div class=" col s12"> |
957 | 957 | <div class="center"> |
958 | 958 | <?php |
959 | - $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=xcloner-google-drive' ), 'install-plugin_xcloner-google-drive' ); |
|
959 | + $url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=xcloner-google-drive'), 'install-plugin_xcloner-google-drive'); |
|
960 | 960 | ?> |
961 | - <h6><?php echo __( "This storage option requires the XCloner-Google-Drive Wordpress Plugin to be installed and activated." ) ?></h6> |
|
962 | - <h6><?php echo __( "PHP 5.5 minimum version is required." ) ?></h6> |
|
961 | + <h6><?php echo __("This storage option requires the XCloner-Google-Drive Wordpress Plugin to be installed and activated.") ?></h6> |
|
962 | + <h6><?php echo __("PHP 5.5 minimum version is required.") ?></h6> |
|
963 | 963 | <br/> |
964 | 964 | <a class="install-now btn" data-slug="xcloner-google-drive" |
965 | 965 | href="<?php echo $url; ?>" |
966 | 966 | aria-label="Install XCloner Google Drive 1.0.0 now" |
967 | 967 | data-name="XCloner Google Drive 1.0.0"> |
968 | - <?php echo sprintf( __( 'Install Now', 'xcloner-backup-and-restore' ) ) ?> |
|
968 | + <?php echo sprintf(__('Install Now', 'xcloner-backup-and-restore')) ?> |
|
969 | 969 | </a> |
970 | 970 | |
971 | - <a href="<?php echo admin_url( "plugin-install.php" ) ?>?tab=plugin-information&plugin=xcloner-google-drive&TB_iframe=true&width=772&height=499" |
|
971 | + <a href="<?php echo admin_url("plugin-install.php") ?>?tab=plugin-information&plugin=xcloner-google-drive&TB_iframe=true&width=772&height=499" |
|
972 | 972 | class="btn thickbox open-plugin-details-modal" |
973 | 973 | aria-label="More information about Theme Check 20160523.1" |
974 | 974 | data-title="Theme Check 20160523.1"> |
975 | 975 | <!-- |
976 | 976 | <a class="btn" href="https://github.com/ovidiul/XCloner-Google-Drive/archive/master.zip"> |
977 | 977 | --> |
978 | - <?php echo sprintf( __( 'More Details', 'xcloner-backup-and-restore' ) ) ?> |
|
978 | + <?php echo sprintf(__('More Details', 'xcloner-backup-and-restore')) ?> |
|
979 | 979 | </a> |
980 | 980 | </div> |
981 | 981 | </div> |
@@ -7,10 +7,10 @@ discard block |
||
7 | 7 | private $xcloner_sanitization; |
8 | 8 | private $xcloner_container; |
9 | 9 | |
10 | - public function __construct( Xcloner $xcloner_container, $hash = "" ) { |
|
10 | + public function __construct(Xcloner $xcloner_container, $hash = "") { |
|
11 | 11 | $this->xcloner_container = $xcloner_container; |
12 | - if ( isset( $hash ) ) { |
|
13 | - $this->set_hash( $hash ); |
|
12 | + if (isset($hash)) { |
|
13 | + $this->set_hash($hash); |
|
14 | 14 | } |
15 | 15 | } |
16 | 16 | |
@@ -18,37 +18,37 @@ discard block |
||
18 | 18 | return $this->xcloner_container; |
19 | 19 | } |
20 | 20 | |
21 | - public function get_logger_filename( $include_hash = 0 ) { |
|
22 | - if ( $include_hash ) { |
|
23 | - $filename = sprintf( $this->logger_file_hash, $this->get_hash() ); |
|
21 | + public function get_logger_filename($include_hash = 0) { |
|
22 | + if ($include_hash) { |
|
23 | + $filename = sprintf($this->logger_file_hash, $this->get_hash()); |
|
24 | 24 | } else { |
25 | - $filename = sprintf( $this->logger_file, $this->get_server_unique_hash( 5 ) ); |
|
25 | + $filename = sprintf($this->logger_file, $this->get_server_unique_hash(5)); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | return $filename; |
29 | 29 | } |
30 | 30 | |
31 | 31 | public function get_xcloner_start_path() { |
32 | - if ( ! get_option( 'xcloner_start_path' ) or ! is_dir( get_option( 'xcloner_start_path' ) ) ) { |
|
33 | - $path = realpath( ABSPATH ); |
|
32 | + if (!get_option('xcloner_start_path') or !is_dir(get_option('xcloner_start_path'))) { |
|
33 | + $path = realpath(ABSPATH); |
|
34 | 34 | } else { |
35 | - $path = get_option( 'xcloner_start_path' ); |
|
35 | + $path = get_option('xcloner_start_path'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | return $path; |
39 | 39 | } |
40 | 40 | |
41 | - public function get_xcloner_dir_path( $dir ) { |
|
42 | - $path = self::get_xcloner_start_path() . DS . $dir; |
|
41 | + public function get_xcloner_dir_path($dir) { |
|
42 | + $path = self::get_xcloner_start_path().DS.$dir; |
|
43 | 43 | |
44 | 44 | return $path; |
45 | 45 | } |
46 | 46 | |
47 | 47 | public function get_xcloner_store_path() { |
48 | - if ( ! get_option( 'xcloner_store_path' ) or ! is_dir( get_option( 'xcloner_store_path' ) ) ) { |
|
49 | - $path = realpath( XCLONER_STORAGE_PATH ); |
|
48 | + if (!get_option('xcloner_store_path') or !is_dir(get_option('xcloner_store_path'))) { |
|
49 | + $path = realpath(XCLONER_STORAGE_PATH); |
|
50 | 50 | } else { |
51 | - $path = get_option( 'xcloner_store_path' ); |
|
51 | + $path = get_option('xcloner_store_path'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | return $path; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | public function get_xcloner_encryption_key() { |
58 | 58 | |
59 | - if(!get_option('xcloner_encryption_key') ) |
|
59 | + if (!get_option('xcloner_encryption_key')) |
|
60 | 60 | { |
61 | 61 | return $this->randomString(35); |
62 | 62 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | private function randomString($length = 6) { |
74 | 74 | $str = ""; |
75 | - $characters = array_merge(range('A','Z'), range('a','z'), range('0','9')); |
|
75 | + $characters = array_merge(range('A', 'Z'), range('a', 'z'), range('0', '9')); |
|
76 | 76 | $max = count($characters) - 1; |
77 | 77 | for ($i = 0; $i < $length; $i++) { |
78 | 78 | $rand = mt_rand(0, $max); |
@@ -82,56 +82,56 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | public function get_xcloner_tmp_path_suffix() { |
85 | - return "xcloner" . $this->get_hash(); |
|
85 | + return "xcloner".$this->get_hash(); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | - public function get_xcloner_tmp_path( $suffix = true ) { |
|
90 | - if ( get_option( 'xcloner_force_tmp_path_site_root' ) ) { |
|
89 | + public function get_xcloner_tmp_path($suffix = true) { |
|
90 | + if (get_option('xcloner_force_tmp_path_site_root')) { |
|
91 | 91 | $path = $this->get_xcloner_store_path(); |
92 | 92 | } else { |
93 | 93 | |
94 | 94 | $path = sys_get_temp_dir(); |
95 | - if ( ! is_dir( $path ) ) { |
|
96 | - @mkdir( $path ); |
|
97 | - @chmod( $path, 0777 ); |
|
95 | + if (!is_dir($path)) { |
|
96 | + @mkdir($path); |
|
97 | + @chmod($path, 0777); |
|
98 | 98 | } |
99 | 99 | |
100 | - if ( ! is_dir( $path ) or ! is_writeable( $path ) ) { |
|
100 | + if (!is_dir($path) or !is_writeable($path)) { |
|
101 | 101 | $path = $this->get_xcloner_store_path(); |
102 | 102 | } |
103 | 103 | } |
104 | 104 | |
105 | - if ( $suffix ) { |
|
106 | - $path = $path . DS . "." . $this->get_xcloner_tmp_path_suffix(); |
|
105 | + if ($suffix) { |
|
106 | + $path = $path.DS.".".$this->get_xcloner_tmp_path_suffix(); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | return $path; |
110 | 110 | } |
111 | 111 | |
112 | 112 | public function get_enable_mysql_backup() { |
113 | - if ( get_option( 'xcloner_enable_mysql_backup' ) ) { |
|
113 | + if (get_option('xcloner_enable_mysql_backup')) { |
|
114 | 114 | return true; |
115 | 115 | } |
116 | 116 | |
117 | 117 | return false; |
118 | 118 | } |
119 | 119 | |
120 | - public function get_backup_extension_name( $ext = "" ) { |
|
121 | - if ( ! $ext ) { |
|
122 | - if ( get_option( 'xcloner_backup_compression_level' ) ) { |
|
120 | + public function get_backup_extension_name($ext = "") { |
|
121 | + if (!$ext) { |
|
122 | + if (get_option('xcloner_backup_compression_level')) { |
|
123 | 123 | $ext = ".tgz"; |
124 | 124 | } else { |
125 | 125 | $ext = ".tar"; |
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
129 | - return ( $this->get_hash() ) . $ext; |
|
129 | + return ($this->get_hash()).$ext; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | public function get_hash() { |
133 | - if ( ! $this->hash ) { |
|
134 | - $this->set_hash( "-" . $this->get_server_unique_hash( 5 ) ); |
|
133 | + if (!$this->hash) { |
|
134 | + $this->set_hash("-".$this->get_server_unique_hash(5)); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | //echo $this->hash; |
@@ -139,27 +139,27 @@ discard block |
||
139 | 139 | } |
140 | 140 | |
141 | 141 | public function generate_new_hash() { |
142 | - $hash = "-" . md5( rand() ); |
|
142 | + $hash = "-".md5(rand()); |
|
143 | 143 | |
144 | - $this->set_hash( substr( $hash, 0, 6 ) ); |
|
144 | + $this->set_hash(substr($hash, 0, 6)); |
|
145 | 145 | |
146 | 146 | return $hash; |
147 | 147 | } |
148 | 148 | |
149 | - public function set_hash( $hash = "" ) { |
|
150 | - if ( substr( $hash, 0, 1 ) != "-" and strlen( $hash ) ) { |
|
151 | - $hash = "-" . $hash; |
|
149 | + public function set_hash($hash = "") { |
|
150 | + if (substr($hash, 0, 1) != "-" and strlen($hash)) { |
|
151 | + $hash = "-".$hash; |
|
152 | 152 | } |
153 | 153 | |
154 | - $this->hash = substr( $hash, 0, 6 ); |
|
154 | + $this->hash = substr($hash, 0, 6); |
|
155 | 155 | |
156 | 156 | return $this; |
157 | 157 | } |
158 | 158 | |
159 | 159 | public function get_default_backup_name() { |
160 | - $data = parse_url( get_site_url() ); |
|
160 | + $data = parse_url(get_site_url()); |
|
161 | 161 | |
162 | - $backup_name = "backup_[domain]" . ( isset( $data['port'] ) ? "_" . $data['port'] : "" ) . "-[time]-" . ( $this->get_enable_mysql_backup() ? "sql" : "nosql" ); |
|
162 | + $backup_name = "backup_[domain]".(isset($data['port']) ? "_".$data['port'] : "")."-[time]-".($this->get_enable_mysql_backup() ? "sql" : "nosql"); |
|
163 | 163 | |
164 | 164 | return $backup_name; |
165 | 165 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | public function get_db_hostname() { |
168 | 168 | global $wpdb; |
169 | 169 | |
170 | - if ( ! $data = get_option( 'xcloner_mysql_hostname' ) ) { |
|
170 | + if (!$data = get_option('xcloner_mysql_hostname')) { |
|
171 | 171 | $data = $wpdb->dbhost; |
172 | 172 | } |
173 | 173 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | public function get_db_username() { |
178 | 178 | global $wpdb; |
179 | 179 | |
180 | - if ( ! $data = get_option( 'xcloner_mysql_username' ) ) { |
|
180 | + if (!$data = get_option('xcloner_mysql_username')) { |
|
181 | 181 | $data = $wpdb->dbuser; |
182 | 182 | } |
183 | 183 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | public function get_db_password() { |
188 | 188 | global $wpdb; |
189 | 189 | |
190 | - if ( ! $data = get_option( 'xcloner_mysql_password' ) ) { |
|
190 | + if (!$data = get_option('xcloner_mysql_password')) { |
|
191 | 191 | $data = $wpdb->dbpassword; |
192 | 192 | } |
193 | 193 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | public function get_db_database() { |
198 | 198 | global $wpdb; |
199 | 199 | |
200 | - if ( ! $data = get_option( 'xcloner_mysql_database' ) ) { |
|
200 | + if (!$data = get_option('xcloner_mysql_database')) { |
|
201 | 201 | $data = $wpdb->dbname; |
202 | 202 | } |
203 | 203 | |
@@ -210,17 +210,17 @@ discard block |
||
210 | 210 | return $wpdb->prefix; |
211 | 211 | } |
212 | 212 | |
213 | - public function get_xcloner_option( $option ) { |
|
214 | - $data = get_option( $option ); |
|
213 | + public function get_xcloner_option($option) { |
|
214 | + $data = get_option($option); |
|
215 | 215 | |
216 | 216 | return $data; |
217 | 217 | } |
218 | 218 | |
219 | - public function get_server_unique_hash( $strlen = 0 ) { |
|
220 | - $hash = md5( get_home_url() . __DIR__ ); |
|
219 | + public function get_server_unique_hash($strlen = 0) { |
|
220 | + $hash = md5(get_home_url().__DIR__); |
|
221 | 221 | |
222 | - if ( $strlen ) { |
|
223 | - $hash = substr( $hash, 0, $strlen ); |
|
222 | + if ($strlen) { |
|
223 | + $hash = substr($hash, 0, $strlen); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | return $hash; |
@@ -231,20 +231,20 @@ discard block |
||
231 | 231 | $this->xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
232 | 232 | |
233 | 233 | //ADDING MISSING OPTIONS |
234 | - if ( false == get_option( 'xcloner_mysql_settings_page' ) ) { |
|
235 | - add_option( 'xcloner_mysql_settings_page' ); |
|
234 | + if (false == get_option('xcloner_mysql_settings_page')) { |
|
235 | + add_option('xcloner_mysql_settings_page'); |
|
236 | 236 | } // end if |
237 | 237 | |
238 | - if ( false == get_option( 'xcloner_cron_settings_page' ) ) { |
|
239 | - add_option( 'xcloner_cron_settings_page' ); |
|
238 | + if (false == get_option('xcloner_cron_settings_page')) { |
|
239 | + add_option('xcloner_cron_settings_page'); |
|
240 | 240 | } // end if |
241 | 241 | |
242 | - if ( false == get_option( 'xcloner_system_settings_page' ) ) { |
|
243 | - add_option( 'xcloner_system_settings_page' ); |
|
242 | + if (false == get_option('xcloner_system_settings_page')) { |
|
243 | + add_option('xcloner_system_settings_page'); |
|
244 | 244 | } // end if |
245 | 245 | |
246 | - if ( false == get_option( 'xcloner_cleanup_settings_page' ) ) { |
|
247 | - add_option( 'xcloner_cleanup_settings_page' ); |
|
246 | + if (false == get_option('xcloner_cleanup_settings_page')) { |
|
247 | + add_option('xcloner_cleanup_settings_page'); |
|
248 | 248 | } // end if |
249 | 249 | |
250 | 250 | |
@@ -252,31 +252,31 @@ discard block |
||
252 | 252 | //GENERAL section |
253 | 253 | add_settings_section( |
254 | 254 | 'xcloner_general_settings_group', |
255 | - __( ' ' ), |
|
256 | - array( $this, 'xcloner_settings_section_cb' ), |
|
255 | + __(' '), |
|
256 | + array($this, 'xcloner_settings_section_cb'), |
|
257 | 257 | 'xcloner_settings_page' |
258 | 258 | ); |
259 | 259 | //MYSQL section |
260 | 260 | add_settings_section( |
261 | 261 | 'xcloner_mysql_settings_group', |
262 | - __( ' ' ), |
|
263 | - array( $this, 'xcloner_settings_section_cb' ), |
|
262 | + __(' '), |
|
263 | + array($this, 'xcloner_settings_section_cb'), |
|
264 | 264 | 'xcloner_mysql_settings_page' |
265 | 265 | ); |
266 | 266 | |
267 | 267 | //SYSTEM section |
268 | 268 | add_settings_section( |
269 | 269 | 'xcloner_system_settings_group', |
270 | - __( 'These are advanced options recommended for developers!', 'xcloner-backup-and-restore' ), |
|
271 | - array( $this, 'xcloner_settings_section_cb' ), |
|
270 | + __('These are advanced options recommended for developers!', 'xcloner-backup-and-restore'), |
|
271 | + array($this, 'xcloner_settings_section_cb'), |
|
272 | 272 | 'xcloner_system_settings_page' |
273 | 273 | ); |
274 | 274 | |
275 | 275 | //CLEANUP section |
276 | 276 | add_settings_section( |
277 | 277 | 'xcloner_cleanup_settings_group', |
278 | - __( ' ' ), |
|
279 | - array( $this, 'xcloner_settings_section_cb' ), |
|
278 | + __(' '), |
|
279 | + array($this, 'xcloner_settings_section_cb'), |
|
280 | 280 | 'xcloner_cleanup_settings_page' |
281 | 281 | ); |
282 | 282 | |
@@ -284,287 +284,287 @@ discard block |
||
284 | 284 | //CRON section |
285 | 285 | add_settings_section( |
286 | 286 | 'xcloner_cron_settings_group', |
287 | - __( ' ' ), |
|
288 | - array( $this, 'xcloner_settings_section_cb' ), |
|
287 | + __(' '), |
|
288 | + array($this, 'xcloner_settings_section_cb'), |
|
289 | 289 | 'xcloner_cron_settings_page' |
290 | 290 | ); |
291 | 291 | |
292 | 292 | |
293 | 293 | //REGISTERING THE 'GENERAL SECTION' FIELDS |
294 | - register_setting( 'xcloner_general_settings_group', 'xcloner_backup_compression_level', array( |
|
294 | + register_setting('xcloner_general_settings_group', 'xcloner_backup_compression_level', array( |
|
295 | 295 | $this->xcloner_sanitization, |
296 | 296 | "sanitize_input_as_int" |
297 | - ) ); |
|
297 | + )); |
|
298 | 298 | add_settings_field( |
299 | 299 | 'xcloner_backup_compression_level', |
300 | - __( 'Backup Compression Level', 'xcloner-backup-and-restore' ), |
|
301 | - array( $this, 'do_form_range_field' ), |
|
300 | + __('Backup Compression Level', 'xcloner-backup-and-restore'), |
|
301 | + array($this, 'do_form_range_field'), |
|
302 | 302 | 'xcloner_settings_page', |
303 | 303 | 'xcloner_general_settings_group', |
304 | 304 | array( |
305 | 305 | 'xcloner_backup_compression_level', |
306 | - __( 'Options between [0-9]. Value 0 means no compression, while 9 is maximum compression affecting cpu load', 'xcloner-backup-and-restore' ), |
|
306 | + __('Options between [0-9]. Value 0 means no compression, while 9 is maximum compression affecting cpu load', 'xcloner-backup-and-restore'), |
|
307 | 307 | 0, |
308 | 308 | 9 |
309 | 309 | ) |
310 | 310 | ); |
311 | 311 | |
312 | - register_setting( 'xcloner_general_settings_group', 'xcloner_start_path', array( |
|
312 | + register_setting('xcloner_general_settings_group', 'xcloner_start_path', array( |
|
313 | 313 | $this->xcloner_sanitization, |
314 | 314 | "sanitize_input_as_absolute_path" |
315 | - ) ); |
|
315 | + )); |
|
316 | 316 | add_settings_field( |
317 | 317 | 'xcloner_start_path', |
318 | - __( 'Backup Start Location', 'xcloner-backup-and-restore' ), |
|
319 | - array( $this, 'do_form_text_field' ), |
|
318 | + __('Backup Start Location', 'xcloner-backup-and-restore'), |
|
319 | + array($this, 'do_form_text_field'), |
|
320 | 320 | 'xcloner_settings_page', |
321 | 321 | 'xcloner_general_settings_group', |
322 | 322 | array( |
323 | 323 | 'xcloner_start_path', |
324 | - __( 'Base path location from where XCloner can start the Backup.', 'xcloner-backup-and-restore' ), |
|
324 | + __('Base path location from where XCloner can start the Backup.', 'xcloner-backup-and-restore'), |
|
325 | 325 | $this->get_xcloner_start_path(), |
326 | 326 | //'disabled' |
327 | 327 | ) |
328 | 328 | ); |
329 | 329 | |
330 | - register_setting( 'xcloner_general_settings_group', 'xcloner_store_path', array( |
|
330 | + register_setting('xcloner_general_settings_group', 'xcloner_store_path', array( |
|
331 | 331 | $this->xcloner_sanitization, |
332 | 332 | "sanitize_input_as_absolute_path" |
333 | - ) ); |
|
333 | + )); |
|
334 | 334 | add_settings_field( |
335 | 335 | 'xcloner_store_path', |
336 | - __( 'Backup Storage Location', 'xcloner-backup-and-restore' ), |
|
337 | - array( $this, 'do_form_text_field' ), |
|
336 | + __('Backup Storage Location', 'xcloner-backup-and-restore'), |
|
337 | + array($this, 'do_form_text_field'), |
|
338 | 338 | 'xcloner_settings_page', |
339 | 339 | 'xcloner_general_settings_group', |
340 | 340 | array( |
341 | 341 | 'xcloner_store_path', |
342 | - __( 'Location where XCloner will store the Backup archives.', 'xcloner-backup-and-restore' ), |
|
342 | + __('Location where XCloner will store the Backup archives.', 'xcloner-backup-and-restore'), |
|
343 | 343 | $this->get_xcloner_store_path(), |
344 | 344 | //'disabled' |
345 | 345 | ) |
346 | 346 | ); |
347 | 347 | |
348 | - register_setting( 'xcloner_general_settings_group', 'xcloner_encryption_key', array( |
|
348 | + register_setting('xcloner_general_settings_group', 'xcloner_encryption_key', array( |
|
349 | 349 | $this->xcloner_sanitization, |
350 | 350 | "sanitize_input_as_string" |
351 | - ) ); |
|
351 | + )); |
|
352 | 352 | add_settings_field( |
353 | 353 | 'xcloner_encryption_key', |
354 | - __( 'Backup Encryption Key', 'xcloner-backup-and-restore' ), |
|
355 | - array( $this, 'do_form_text_field' ), |
|
354 | + __('Backup Encryption Key', 'xcloner-backup-and-restore'), |
|
355 | + array($this, 'do_form_text_field'), |
|
356 | 356 | 'xcloner_settings_page', |
357 | 357 | 'xcloner_general_settings_group', |
358 | 358 | array( |
359 | 359 | 'xcloner_encryption_key', |
360 | - __( 'Backup Encryption Key used to Encrypt/Decrypt backups, you might want to save this somewhere else as well.', 'xcloner-backup-and-restore' ), |
|
360 | + __('Backup Encryption Key used to Encrypt/Decrypt backups, you might want to save this somewhere else as well.', 'xcloner-backup-and-restore'), |
|
361 | 361 | $this->get_xcloner_encryption_key(), |
362 | 362 | //'disabled' |
363 | 363 | ) |
364 | 364 | ); |
365 | 365 | |
366 | - register_setting( 'xcloner_general_settings_group', 'xcloner_enable_log', array( |
|
366 | + register_setting('xcloner_general_settings_group', 'xcloner_enable_log', array( |
|
367 | 367 | $this->xcloner_sanitization, |
368 | 368 | "sanitize_input_as_int" |
369 | - ) ); |
|
369 | + )); |
|
370 | 370 | add_settings_field( |
371 | 371 | 'xcloner_enable_log', |
372 | - __( 'Enable XCloner Backup Log', 'xcloner-backup-and-restore' ), |
|
373 | - array( $this, 'do_form_switch_field' ), |
|
372 | + __('Enable XCloner Backup Log', 'xcloner-backup-and-restore'), |
|
373 | + array($this, 'do_form_switch_field'), |
|
374 | 374 | 'xcloner_settings_page', |
375 | 375 | 'xcloner_general_settings_group', |
376 | 376 | array( |
377 | 377 | 'xcloner_enable_log', |
378 | - sprintf( __( 'Enable the XCloner Backup log. You will find it stored unde the Backup Storage Location, file %s', 'xcloner-backup-and-restore' ), $this->get_logger_filename() ) |
|
378 | + sprintf(__('Enable the XCloner Backup log. You will find it stored unde the Backup Storage Location, file %s', 'xcloner-backup-and-restore'), $this->get_logger_filename()) |
|
379 | 379 | ) |
380 | 380 | ); |
381 | 381 | |
382 | - register_setting( 'xcloner_general_settings_group', 'xcloner_enable_pre_update_backup', array( |
|
382 | + register_setting('xcloner_general_settings_group', 'xcloner_enable_pre_update_backup', array( |
|
383 | 383 | $this->xcloner_sanitization, |
384 | 384 | "sanitize_input_as_int" |
385 | - ) ); |
|
385 | + )); |
|
386 | 386 | add_settings_field( |
387 | 387 | 'xcloner_enable_pre_update_backup', |
388 | - __( 'Generate Backups before Automatic WP Upgrades', 'xcloner-backup-and-restore' ), |
|
389 | - array( $this, 'do_form_switch_field' ), |
|
388 | + __('Generate Backups before Automatic WP Upgrades', 'xcloner-backup-and-restore'), |
|
389 | + array($this, 'do_form_switch_field'), |
|
390 | 390 | 'xcloner_settings_page', |
391 | 391 | 'xcloner_general_settings_group', |
392 | 392 | array( |
393 | 393 | 'xcloner_enable_pre_update_backup', |
394 | - sprintf( __( 'Attempt to generate a core, plugins, themes or languages files backup before the automatic update of Wordpress core, plugins, themes or languages files.', 'xcloner-backup-and-restore' ), $this->get_logger_filename() ) |
|
394 | + sprintf(__('Attempt to generate a core, plugins, themes or languages files backup before the automatic update of Wordpress core, plugins, themes or languages files.', 'xcloner-backup-and-restore'), $this->get_logger_filename()) |
|
395 | 395 | ) |
396 | 396 | ); |
397 | 397 | |
398 | - register_setting( 'xcloner_general_settings_group', 'xcloner_regex_exclude', array( |
|
398 | + register_setting('xcloner_general_settings_group', 'xcloner_regex_exclude', array( |
|
399 | 399 | $this->xcloner_sanitization, |
400 | 400 | "sanitize_input_as_raw" |
401 | - ) ); |
|
401 | + )); |
|
402 | 402 | add_settings_field( |
403 | 403 | 'xcloner_regex_exclude', |
404 | - __( 'Regex Exclude Files', 'xcloner-backup-and-restore' ), |
|
405 | - array( $this, 'do_form_textarea_field' ), |
|
404 | + __('Regex Exclude Files', 'xcloner-backup-and-restore'), |
|
405 | + array($this, 'do_form_textarea_field'), |
|
406 | 406 | 'xcloner_settings_page', |
407 | 407 | 'xcloner_general_settings_group', |
408 | 408 | array( |
409 | 409 | 'xcloner_regex_exclude', |
410 | - __( 'Regular expression match to exclude files and folders, example patterns provided below, one pattern per line', 'xcloner-backup-and-restore' ), |
|
410 | + __('Regular expression match to exclude files and folders, example patterns provided below, one pattern per line', 'xcloner-backup-and-restore'), |
|
411 | 411 | //$this->get_xcloner_store_path(), |
412 | 412 | //'disabled' |
413 | 413 | ) |
414 | 414 | ); |
415 | 415 | |
416 | 416 | //REGISTERING THE 'MYSQL SECTION' FIELDS |
417 | - register_setting( 'xcloner_mysql_settings_group', 'xcloner_enable_mysql_backup', array( |
|
417 | + register_setting('xcloner_mysql_settings_group', 'xcloner_enable_mysql_backup', array( |
|
418 | 418 | $this->xcloner_sanitization, |
419 | 419 | "sanitize_input_as_int" |
420 | - ) ); |
|
420 | + )); |
|
421 | 421 | add_settings_field( |
422 | 422 | 'xcloner_enable_mysql_backup', |
423 | - __( 'Enable Mysql Backup', 'xcloner-backup-and-restore' ), |
|
424 | - array( $this, 'do_form_switch_field' ), |
|
423 | + __('Enable Mysql Backup', 'xcloner-backup-and-restore'), |
|
424 | + array($this, 'do_form_switch_field'), |
|
425 | 425 | 'xcloner_mysql_settings_page', |
426 | 426 | 'xcloner_mysql_settings_group', |
427 | 427 | array( |
428 | 428 | 'xcloner_enable_mysql_backup', |
429 | - __( 'Enable Mysql Backup Option. If you don\'t want to backup the database, you can disable this.', 'xcloner-backup-and-restore' ) |
|
429 | + __('Enable Mysql Backup Option. If you don\'t want to backup the database, you can disable this.', 'xcloner-backup-and-restore') |
|
430 | 430 | ) |
431 | 431 | ); |
432 | 432 | |
433 | - register_setting( 'xcloner_mysql_settings_group', 'xcloner_backup_only_wp_tables' ); |
|
433 | + register_setting('xcloner_mysql_settings_group', 'xcloner_backup_only_wp_tables'); |
|
434 | 434 | add_settings_field( |
435 | 435 | 'xcloner_backup_only_wp_tables', |
436 | - __( 'Backup only WP tables', 'xcloner-backup-and-restore' ), |
|
437 | - array( $this, 'do_form_switch_field' ), |
|
436 | + __('Backup only WP tables', 'xcloner-backup-and-restore'), |
|
437 | + array($this, 'do_form_switch_field'), |
|
438 | 438 | 'xcloner_mysql_settings_page', |
439 | 439 | 'xcloner_mysql_settings_group', |
440 | 440 | array( |
441 | 441 | 'xcloner_backup_only_wp_tables', |
442 | - sprintf( __( 'Enable this if you only want to Backup only tables starting with \'%s\' prefix', 'xcloner-backup-and-restore' ), $this->get_table_prefix() ) |
|
442 | + sprintf(__('Enable this if you only want to Backup only tables starting with \'%s\' prefix', 'xcloner-backup-and-restore'), $this->get_table_prefix()) |
|
443 | 443 | ) |
444 | 444 | ); |
445 | 445 | |
446 | - register_setting( 'xcloner_mysql_settings_group', 'xcloner_mysql_hostname', array( |
|
446 | + register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_hostname', array( |
|
447 | 447 | $this->xcloner_sanitization, |
448 | 448 | "sanitize_input_as_raw" |
449 | - ) ); |
|
449 | + )); |
|
450 | 450 | add_settings_field( |
451 | 451 | 'xcloner_mysql_hostname', |
452 | - __( 'Mysql Hostname', 'xcloner-backup-and-restore' ), |
|
453 | - array( $this, 'do_form_text_field' ), |
|
452 | + __('Mysql Hostname', 'xcloner-backup-and-restore'), |
|
453 | + array($this, 'do_form_text_field'), |
|
454 | 454 | 'xcloner_mysql_settings_page', |
455 | 455 | 'xcloner_mysql_settings_group', |
456 | 456 | array( |
457 | 457 | 'xcloner_mysql_hostname', |
458 | - __( 'Wordpress mysql hostname', 'xcloner-backup-and-restore' ), |
|
458 | + __('Wordpress mysql hostname', 'xcloner-backup-and-restore'), |
|
459 | 459 | $this->get_db_hostname(), |
460 | 460 | 'disabled' |
461 | 461 | ) |
462 | 462 | ); |
463 | 463 | |
464 | - register_setting( 'xcloner_mysql_settings_group', 'xcloner_mysql_username', array( |
|
464 | + register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_username', array( |
|
465 | 465 | $this->xcloner_sanitization, |
466 | 466 | "sanitize_input_as_raw" |
467 | - ) ); |
|
467 | + )); |
|
468 | 468 | add_settings_field( |
469 | 469 | 'xcloner_mysql_username', |
470 | - __( 'Mysql Username', 'xcloner-backup-and-restore' ), |
|
471 | - array( $this, 'do_form_text_field' ), |
|
470 | + __('Mysql Username', 'xcloner-backup-and-restore'), |
|
471 | + array($this, 'do_form_text_field'), |
|
472 | 472 | 'xcloner_mysql_settings_page', |
473 | 473 | 'xcloner_mysql_settings_group', |
474 | 474 | array( |
475 | 475 | 'xcloner_mysql_username', |
476 | - __( 'Wordpress mysql username', 'xcloner-backup-and-restore' ), |
|
476 | + __('Wordpress mysql username', 'xcloner-backup-and-restore'), |
|
477 | 477 | $this->get_db_username(), |
478 | 478 | 'disabled' |
479 | 479 | ) |
480 | 480 | ); |
481 | 481 | |
482 | - register_setting( 'xcloner_mysql_settings_group', 'xcloner_mysql_database', array( |
|
482 | + register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_database', array( |
|
483 | 483 | $this->xcloner_sanitization, |
484 | 484 | "sanitize_input_as_raw" |
485 | - ) ); |
|
485 | + )); |
|
486 | 486 | add_settings_field( |
487 | 487 | 'xcloner_mysql_database', |
488 | - __( 'Mysql Database', 'xcloner-backup-and-restore' ), |
|
489 | - array( $this, 'do_form_text_field' ), |
|
488 | + __('Mysql Database', 'xcloner-backup-and-restore'), |
|
489 | + array($this, 'do_form_text_field'), |
|
490 | 490 | 'xcloner_mysql_settings_page', |
491 | 491 | 'xcloner_mysql_settings_group', |
492 | 492 | array( |
493 | 493 | 'xcloner_mysql_database', |
494 | - __( 'Wordpress mysql database', 'xcloner-backup-and-restore' ), |
|
494 | + __('Wordpress mysql database', 'xcloner-backup-and-restore'), |
|
495 | 495 | $this->get_db_database(), |
496 | 496 | 'disabled' |
497 | 497 | ) |
498 | 498 | ); |
499 | 499 | |
500 | 500 | //REGISTERING THE 'SYSTEM SECTION' FIELDS |
501 | - register_setting( 'xcloner_system_settings_group', 'xcloner_size_limit_per_request', array( |
|
501 | + register_setting('xcloner_system_settings_group', 'xcloner_size_limit_per_request', array( |
|
502 | 502 | $this->xcloner_sanitization, |
503 | 503 | "sanitize_input_as_int" |
504 | - ) ); |
|
504 | + )); |
|
505 | 505 | add_settings_field( |
506 | 506 | 'xcloner_size_limit_per_request', |
507 | - __( 'Data Size Limit Per Request', 'xcloner-backup-and-restore' ), |
|
508 | - array( $this, 'do_form_range_field' ), |
|
507 | + __('Data Size Limit Per Request', 'xcloner-backup-and-restore'), |
|
508 | + array($this, 'do_form_range_field'), |
|
509 | 509 | 'xcloner_system_settings_page', |
510 | 510 | 'xcloner_system_settings_group', |
511 | 511 | array( |
512 | 512 | 'xcloner_size_limit_per_request', |
513 | - __( 'Use this option to set how much file data can XCloner backup in one AJAX request. Range 0-1024 MB', 'xcloner-backup-and-restore' ), |
|
513 | + __('Use this option to set how much file data can XCloner backup in one AJAX request. Range 0-1024 MB', 'xcloner-backup-and-restore'), |
|
514 | 514 | 0, |
515 | 515 | 1024 |
516 | 516 | ) |
517 | 517 | ); |
518 | 518 | |
519 | - register_setting( 'xcloner_system_settings_group', 'xcloner_files_to_process_per_request', array( |
|
519 | + register_setting('xcloner_system_settings_group', 'xcloner_files_to_process_per_request', array( |
|
520 | 520 | $this->xcloner_sanitization, |
521 | 521 | "sanitize_input_as_int" |
522 | - ) ); |
|
522 | + )); |
|
523 | 523 | add_settings_field( |
524 | 524 | 'xcloner_files_to_process_per_request', |
525 | - __( 'Files To Process Per Request', 'xcloner-backup-and-restore' ), |
|
526 | - array( $this, 'do_form_range_field' ), |
|
525 | + __('Files To Process Per Request', 'xcloner-backup-and-restore'), |
|
526 | + array($this, 'do_form_range_field'), |
|
527 | 527 | 'xcloner_system_settings_page', |
528 | 528 | 'xcloner_system_settings_group', |
529 | 529 | array( |
530 | 530 | 'xcloner_files_to_process_per_request', |
531 | - __( 'Use this option to set how many files XCloner should process at one time before doing another AJAX call', 'xcloner-backup-and-restore' ), |
|
531 | + __('Use this option to set how many files XCloner should process at one time before doing another AJAX call', 'xcloner-backup-and-restore'), |
|
532 | 532 | 0, |
533 | 533 | 1000 |
534 | 534 | ) |
535 | 535 | ); |
536 | 536 | |
537 | - register_setting( 'xcloner_system_settings_group', 'xcloner_directories_to_scan_per_request', array( |
|
537 | + register_setting('xcloner_system_settings_group', 'xcloner_directories_to_scan_per_request', array( |
|
538 | 538 | $this->xcloner_sanitization, |
539 | 539 | "sanitize_input_as_int" |
540 | - ) ); |
|
540 | + )); |
|
541 | 541 | add_settings_field( |
542 | 542 | 'xcloner_directories_to_scan_per_request', |
543 | - __( 'Directories To Scan Per Request', 'xcloner-backup-and-restore' ), |
|
544 | - array( $this, 'do_form_range_field' ), |
|
543 | + __('Directories To Scan Per Request', 'xcloner-backup-and-restore'), |
|
544 | + array($this, 'do_form_range_field'), |
|
545 | 545 | 'xcloner_system_settings_page', |
546 | 546 | 'xcloner_system_settings_group', |
547 | 547 | array( |
548 | 548 | 'xcloner_directories_to_scan_per_request', |
549 | - __( 'Use this option to set how many directories XCloner should scan at one time before doing another AJAX call', 'xcloner-backup-and-restore' ), |
|
549 | + __('Use this option to set how many directories XCloner should scan at one time before doing another AJAX call', 'xcloner-backup-and-restore'), |
|
550 | 550 | 0, |
551 | 551 | 1000 |
552 | 552 | ) |
553 | 553 | ); |
554 | 554 | |
555 | - register_setting( 'xcloner_system_settings_group', 'xcloner_database_records_per_request', array( |
|
555 | + register_setting('xcloner_system_settings_group', 'xcloner_database_records_per_request', array( |
|
556 | 556 | $this->xcloner_sanitization, |
557 | 557 | "sanitize_input_as_int" |
558 | - ) ); |
|
558 | + )); |
|
559 | 559 | add_settings_field( |
560 | 560 | 'xcloner_database_records_per_request', |
561 | - __( 'Database Records Per Request', 'xcloner-backup-and-restore' ), |
|
562 | - array( $this, 'do_form_range_field' ), |
|
561 | + __('Database Records Per Request', 'xcloner-backup-and-restore'), |
|
562 | + array($this, 'do_form_range_field'), |
|
563 | 563 | 'xcloner_system_settings_page', |
564 | 564 | 'xcloner_system_settings_group', |
565 | 565 | array( |
566 | 566 | 'xcloner_database_records_per_request', |
567 | - __( 'Use this option to set how many database table records should be fetched per AJAX request, or set to 0 to fetch all. Range 0-100000 records', 'xcloner-backup-and-restore' ), |
|
567 | + __('Use this option to set how many database table records should be fetched per AJAX request, or set to 0 to fetch all. Range 0-100000 records', 'xcloner-backup-and-restore'), |
|
568 | 568 | 0, |
569 | 569 | 100000 |
570 | 570 | ) |
@@ -582,140 +582,140 @@ discard block |
||
582 | 582 | ) |
583 | 583 | );*/ |
584 | 584 | |
585 | - register_setting( 'xcloner_system_settings_group', 'xcloner_exclude_files_larger_than_mb', array( |
|
585 | + register_setting('xcloner_system_settings_group', 'xcloner_exclude_files_larger_than_mb', array( |
|
586 | 586 | $this->xcloner_sanitization, |
587 | 587 | "sanitize_input_as_int" |
588 | - ) ); |
|
588 | + )); |
|
589 | 589 | add_settings_field( |
590 | 590 | 'xcloner_exclude_files_larger_than_mb', |
591 | - __( 'Exclude files larger than (MB)', 'xcloner-backup-and-restore' ), |
|
592 | - array( $this, 'do_form_number_field' ), |
|
591 | + __('Exclude files larger than (MB)', 'xcloner-backup-and-restore'), |
|
592 | + array($this, 'do_form_number_field'), |
|
593 | 593 | 'xcloner_system_settings_page', |
594 | 594 | 'xcloner_system_settings_group', |
595 | 595 | array( |
596 | 596 | 'xcloner_exclude_files_larger_than_mb', |
597 | - __( 'Use this option to automatically exclude files larger than a certain size in MB, or set to 0 to include all. Range 0-1000 MB', 'xcloner-backup-and-restore' ), |
|
597 | + __('Use this option to automatically exclude files larger than a certain size in MB, or set to 0 to include all. Range 0-1000 MB', 'xcloner-backup-and-restore'), |
|
598 | 598 | ) |
599 | 599 | ); |
600 | 600 | |
601 | - register_setting( 'xcloner_system_settings_group', 'xcloner_split_backup_limit', array( |
|
601 | + register_setting('xcloner_system_settings_group', 'xcloner_split_backup_limit', array( |
|
602 | 602 | $this->xcloner_sanitization, |
603 | 603 | "sanitize_input_as_int" |
604 | - ) ); |
|
604 | + )); |
|
605 | 605 | add_settings_field( |
606 | 606 | 'xcloner_split_backup_limit', |
607 | - __( 'Split Backup Archive Limit (MB)', 'xcloner-backup-and-restore' ), |
|
608 | - array( $this, 'do_form_number_field' ), |
|
607 | + __('Split Backup Archive Limit (MB)', 'xcloner-backup-and-restore'), |
|
608 | + array($this, 'do_form_number_field'), |
|
609 | 609 | 'xcloner_system_settings_page', |
610 | 610 | 'xcloner_system_settings_group', |
611 | 611 | array( |
612 | 612 | 'xcloner_split_backup_limit', |
613 | - __( 'Use this option to automatically split the backup archive into smaller parts. Range 0-10000 MB', 'xcloner-backup-and-restore' ), |
|
613 | + __('Use this option to automatically split the backup archive into smaller parts. Range 0-10000 MB', 'xcloner-backup-and-restore'), |
|
614 | 614 | ) |
615 | 615 | ); |
616 | 616 | |
617 | - register_setting( 'xcloner_system_settings_group', 'xcloner_force_tmp_path_site_root' ); |
|
617 | + register_setting('xcloner_system_settings_group', 'xcloner_force_tmp_path_site_root'); |
|
618 | 618 | add_settings_field( |
619 | 619 | 'xcloner_force_tmp_path_site_root', |
620 | - __( 'Force Temporary Path Within XCloner Storage', 'xcloner-backup-and-restore' ), |
|
621 | - array( $this, 'do_form_switch_field' ), |
|
620 | + __('Force Temporary Path Within XCloner Storage', 'xcloner-backup-and-restore'), |
|
621 | + array($this, 'do_form_switch_field'), |
|
622 | 622 | 'xcloner_system_settings_page', |
623 | 623 | 'xcloner_system_settings_group', |
624 | 624 | array( |
625 | 625 | 'xcloner_force_tmp_path_site_root', |
626 | - sprintf( __( 'Enable this option if you want the XCloner Temporary Path to be within your XCloner Storage Location', 'xcloner-backup-and-restore' ), $this->get_table_prefix() ) |
|
626 | + sprintf(__('Enable this option if you want the XCloner Temporary Path to be within your XCloner Storage Location', 'xcloner-backup-and-restore'), $this->get_table_prefix()) |
|
627 | 627 | ) |
628 | 628 | ); |
629 | 629 | |
630 | - register_setting( 'xcloner_system_settings_group', 'xcloner_disable_email_notification' ); |
|
630 | + register_setting('xcloner_system_settings_group', 'xcloner_disable_email_notification'); |
|
631 | 631 | add_settings_field( |
632 | 632 | 'xcloner_disable_email_notification', |
633 | - __( 'Disable Email Notifications', 'xcloner-backup-and-restore' ), |
|
634 | - array( $this, 'do_form_switch_field' ), |
|
633 | + __('Disable Email Notifications', 'xcloner-backup-and-restore'), |
|
634 | + array($this, 'do_form_switch_field'), |
|
635 | 635 | 'xcloner_system_settings_page', |
636 | 636 | 'xcloner_system_settings_group', |
637 | 637 | array( |
638 | 638 | 'xcloner_disable_email_notification', |
639 | - sprintf( __( 'Enable this option if you want the XCloner to NOT send email notifications on successful backups', 'xcloner-backup-and-restore' ), $this->get_table_prefix() ) |
|
639 | + sprintf(__('Enable this option if you want the XCloner to NOT send email notifications on successful backups', 'xcloner-backup-and-restore'), $this->get_table_prefix()) |
|
640 | 640 | ) |
641 | 641 | ); |
642 | 642 | |
643 | 643 | //REGISTERING THE 'CLEANUP SECTION' FIELDS |
644 | - register_setting( 'xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_days', array( |
|
644 | + register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_days', array( |
|
645 | 645 | $this->xcloner_sanitization, |
646 | 646 | "sanitize_input_as_int" |
647 | - ) ); |
|
647 | + )); |
|
648 | 648 | add_settings_field( |
649 | 649 | 'xcloner_cleanup_retention_limit_days', |
650 | - __( 'Cleanup by Date(days)', 'xcloner-backup-and-restore' ), |
|
651 | - array( $this, 'do_form_number_field' ), |
|
650 | + __('Cleanup by Date(days)', 'xcloner-backup-and-restore'), |
|
651 | + array($this, 'do_form_number_field'), |
|
652 | 652 | 'xcloner_cleanup_settings_page', |
653 | 653 | 'xcloner_cleanup_settings_group', |
654 | 654 | array( |
655 | 655 | 'xcloner_cleanup_retention_limit_days', |
656 | - __( 'Specify the maximum number of days a backup archive can be kept on the server. 0 disables this option', 'xcloner-backup-and-restore' ) |
|
656 | + __('Specify the maximum number of days a backup archive can be kept on the server. 0 disables this option', 'xcloner-backup-and-restore') |
|
657 | 657 | ) |
658 | 658 | ); |
659 | 659 | |
660 | - register_setting( 'xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_archives', array( |
|
660 | + register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_archives', array( |
|
661 | 661 | $this->xcloner_sanitization, |
662 | 662 | "sanitize_input_as_int" |
663 | - ) ); |
|
663 | + )); |
|
664 | 664 | add_settings_field( |
665 | 665 | 'xcloner_cleanup_retention_limit_archives', |
666 | - __( 'Cleanup by Quantity', 'xcloner-backup-and-restore' ), |
|
667 | - array( $this, 'do_form_number_field' ), |
|
666 | + __('Cleanup by Quantity', 'xcloner-backup-and-restore'), |
|
667 | + array($this, 'do_form_number_field'), |
|
668 | 668 | 'xcloner_cleanup_settings_page', |
669 | 669 | 'xcloner_cleanup_settings_group', |
670 | 670 | array( |
671 | 671 | 'xcloner_cleanup_retention_limit_archives', |
672 | - __( 'Specify the maximum number of backup archives to keep on the server. 0 disables this option', 'xcloner-backup-and-restore' ) |
|
672 | + __('Specify the maximum number of backup archives to keep on the server. 0 disables this option', 'xcloner-backup-and-restore') |
|
673 | 673 | ) |
674 | 674 | ); |
675 | 675 | |
676 | - register_setting( 'xcloner_cleanup_settings_group', 'xcloner_cleanup_capacity_limit', array( |
|
676 | + register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_capacity_limit', array( |
|
677 | 677 | $this->xcloner_sanitization, |
678 | 678 | "sanitize_input_as_int" |
679 | - ) ); |
|
679 | + )); |
|
680 | 680 | add_settings_field( |
681 | 681 | 'xcloner_cleanup_capacity_limit', |
682 | - __( 'Cleanup by Capacity(MB)', 'xcloner-backup-and-restore' ), |
|
683 | - array( $this, 'do_form_number_field' ), |
|
682 | + __('Cleanup by Capacity(MB)', 'xcloner-backup-and-restore'), |
|
683 | + array($this, 'do_form_number_field'), |
|
684 | 684 | 'xcloner_cleanup_settings_page', |
685 | 685 | 'xcloner_cleanup_settings_group', |
686 | 686 | array( |
687 | 687 | 'xcloner_cleanup_capacity_limit', |
688 | - __( 'Remove oldest backups if all created backups exceed the configured limit in Megabytes. 0 disables this option', 'xcloner-backup-and-restore' ) |
|
688 | + __('Remove oldest backups if all created backups exceed the configured limit in Megabytes. 0 disables this option', 'xcloner-backup-and-restore') |
|
689 | 689 | ) |
690 | 690 | ); |
691 | 691 | |
692 | - register_setting( 'xcloner_cleanup_settings_group', 'xcloner_cleanup_delete_after_remote_transfer', array( |
|
692 | + register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_delete_after_remote_transfer', array( |
|
693 | 693 | $this->xcloner_sanitization, |
694 | 694 | "sanitize_input_as_int" |
695 | - ) ); |
|
695 | + )); |
|
696 | 696 | add_settings_field( |
697 | 697 | 'xcloner_cleanup_delete_after_remote_transfer', |
698 | - __( 'Delete Backup After Remote Storage Transfer', 'xcloner-backup-and-restore' ), |
|
699 | - array( $this, 'do_form_switch_field' ), |
|
698 | + __('Delete Backup After Remote Storage Transfer', 'xcloner-backup-and-restore'), |
|
699 | + array($this, 'do_form_switch_field'), |
|
700 | 700 | 'xcloner_cleanup_settings_page', |
701 | 701 | 'xcloner_cleanup_settings_group', |
702 | 702 | array( |
703 | 703 | 'xcloner_cleanup_delete_after_remote_transfer', |
704 | - __( 'Remove backup created automatically from local storage after sending the backup to Remote Storage', 'xcloner-backup-and-restore' ) |
|
704 | + __('Remove backup created automatically from local storage after sending the backup to Remote Storage', 'xcloner-backup-and-restore') |
|
705 | 705 | ) |
706 | 706 | ); |
707 | 707 | |
708 | 708 | //REGISTERING THE 'CRON SECTION' FIELDS |
709 | - register_setting( 'xcloner_cron_settings_group', 'xcloner_cron_frequency' ); |
|
709 | + register_setting('xcloner_cron_settings_group', 'xcloner_cron_frequency'); |
|
710 | 710 | add_settings_field( |
711 | 711 | 'xcloner_cron_frequency', |
712 | - __( 'Cron frequency', 'xcloner-backup-and-restore' ), |
|
713 | - array( $this, 'do_form_text_field' ), |
|
712 | + __('Cron frequency', 'xcloner-backup-and-restore'), |
|
713 | + array($this, 'do_form_text_field'), |
|
714 | 714 | 'xcloner_cron_settings_page', |
715 | 715 | 'xcloner_cron_settings_group', |
716 | 716 | array( |
717 | 717 | 'xcloner_cron_frequency', |
718 | - __( 'Cron frequency' ) |
|
718 | + __('Cron frequency') |
|
719 | 719 | ) |
720 | 720 | ); |
721 | 721 | } |
@@ -733,26 +733,26 @@ discard block |
||
733 | 733 | } |
734 | 734 | |
735 | 735 | // text field content cb |
736 | - public function do_form_text_field( $params ) { |
|
737 | - if ( ! isset( $params['3'] ) ) { |
|
736 | + public function do_form_text_field($params) { |
|
737 | + if (!isset($params['3'])) { |
|
738 | 738 | $params[3] = 0; |
739 | 739 | } |
740 | - if ( ! isset( $params['2'] ) ) { |
|
740 | + if (!isset($params['2'])) { |
|
741 | 741 | $params[2] = 0; |
742 | 742 | } |
743 | 743 | |
744 | - list( $fieldname, $label, $value, $disabled ) = $params; |
|
744 | + list($fieldname, $label, $value, $disabled) = $params; |
|
745 | 745 | |
746 | - if ( ! $value ) { |
|
747 | - $value = get_option( $fieldname ); |
|
746 | + if (!$value) { |
|
747 | + $value = get_option($fieldname); |
|
748 | 748 | } |
749 | 749 | // output the field |
750 | 750 | ?> |
751 | 751 | <div class="row"> |
752 | 752 | <div class="input-field col s10 m10 l8"> |
753 | - <input class="validate" <?php echo ( $disabled ) ? "disabled" : "" ?> name="<?php echo $fieldname ?>" |
|
753 | + <input class="validate" <?php echo ($disabled) ? "disabled" : "" ?> name="<?php echo $fieldname ?>" |
|
754 | 754 | id="<?php echo $fieldname ?>" type="text" class="validate" |
755 | - value="<?php echo isset( $value ) ? esc_attr( $value ) : ''; ?>"> |
|
755 | + value="<?php echo isset($value) ? esc_attr($value) : ''; ?>"> |
|
756 | 756 | </div> |
757 | 757 | <div class="col s2 m2 "> |
758 | 758 | <a class="btn-floating tooltipped btn-small" data-position="left" data-delay="50" |
@@ -765,26 +765,26 @@ discard block |
||
765 | 765 | } |
766 | 766 | |
767 | 767 | // textarea field content cb |
768 | - public function do_form_textarea_field( $params ) { |
|
769 | - if ( ! isset( $params['3'] ) ) { |
|
768 | + public function do_form_textarea_field($params) { |
|
769 | + if (!isset($params['3'])) { |
|
770 | 770 | $params[3] = 0; |
771 | 771 | } |
772 | - if ( ! isset( $params['2'] ) ) { |
|
772 | + if (!isset($params['2'])) { |
|
773 | 773 | $params[2] = 0; |
774 | 774 | } |
775 | 775 | |
776 | - list( $fieldname, $label, $value, $disabled ) = $params; |
|
776 | + list($fieldname, $label, $value, $disabled) = $params; |
|
777 | 777 | |
778 | - if ( ! $value ) { |
|
779 | - $value = get_option( $fieldname ); |
|
778 | + if (!$value) { |
|
779 | + $value = get_option($fieldname); |
|
780 | 780 | } |
781 | 781 | // output the field |
782 | 782 | ?> |
783 | 783 | <div class="row"> |
784 | 784 | <div class="input-field col s10 m10 l8"> |
785 | - <textarea class="validate" <?php echo ( $disabled ) ? "disabled" : "" ?> name="<?php echo $fieldname ?>" |
|
785 | + <textarea class="validate" <?php echo ($disabled) ? "disabled" : "" ?> name="<?php echo $fieldname ?>" |
|
786 | 786 | id="<?php echo $fieldname ?>" type="text" class="validate" |
787 | - value=""><?php echo isset( $value ) ? esc_attr( $value ) : ''; ?></textarea> |
|
787 | + value=""><?php echo isset($value) ? esc_attr($value) : ''; ?></textarea> |
|
788 | 788 | </div> |
789 | 789 | <div class="col s2 m2 "> |
790 | 790 | <a class="btn-floating tooltipped btn-small" data-position="center" data-html="true" data-delay="50" |
@@ -793,39 +793,39 @@ discard block |
||
793 | 793 | <div class="col s12"> |
794 | 794 | <ul class="xcloner_regex_exclude_limit"> |
795 | 795 | <li>Exclude all except .php file: <span |
796 | - class="regex_pattern"><?php echo htmlentities( '(.*)\.(.+)$(?<!(php))' ) ?></span></li> |
|
796 | + class="regex_pattern"><?php echo htmlentities('(.*)\.(.+)$(?<!(php))') ?></span></li> |
|
797 | 797 | <li>Exclude all except .php and .txt: <span |
798 | - class="regex_pattern"> <?php echo htmlentities( '(.*)\.(.+)$(?<!(php|txt))' ) ?></span> |
|
798 | + class="regex_pattern"> <?php echo htmlentities('(.*)\.(.+)$(?<!(php|txt))') ?></span> |
|
799 | 799 | </li> |
800 | 800 | <li>Exclude all .avi files: <span |
801 | - class="regex_pattern"> <?php echo htmlentities( '(.*)\.(.+)$(?<=(avi))' ) ?></span></li> |
|
801 | + class="regex_pattern"> <?php echo htmlentities('(.*)\.(.+)$(?<=(avi))') ?></span></li> |
|
802 | 802 | <li>Exclude all .jpg,.gif and .png files: <span |
803 | - class="regex_pattern"> <?php echo htmlentities( '(.*)\.(.+)$(?<=(gif|png|jpg))' ) ?></span> |
|
803 | + class="regex_pattern"> <?php echo htmlentities('(.*)\.(.+)$(?<=(gif|png|jpg))') ?></span> |
|
804 | 804 | </li> |
805 | 805 | <li>Exclude all .svn and .git: <span |
806 | - class="regex_pattern"> <?php echo htmlentities( '(.*)\.(svn|git)(.*)$' ) ?></span></li> |
|
806 | + class="regex_pattern"> <?php echo htmlentities('(.*)\.(svn|git)(.*)$') ?></span></li> |
|
807 | 807 | <li>Exclude root directory /test: <span |
808 | - class="regex_pattern"> <?php echo htmlentities( '\/test(.*)$' ) ?></span> or <span |
|
809 | - class="regex_pattern"> <?php echo htmlentities( 'test(.*)$' ) ?></span></li> |
|
808 | + class="regex_pattern"> <?php echo htmlentities('\/test(.*)$') ?></span> or <span |
|
809 | + class="regex_pattern"> <?php echo htmlentities('test(.*)$') ?></span></li> |
|
810 | 810 | <li>Exclude the wp-admin folder: <span |
811 | - class="regex_pattern"> <?php echo htmlentities( '(\/wp-admin)(.*)$' ) ?></span></li> |
|
811 | + class="regex_pattern"> <?php echo htmlentities('(\/wp-admin)(.*)$') ?></span></li> |
|
812 | 812 | <li>Exclude the wp-content/uploads folder: <span |
813 | - class="regex_pattern"> <?php echo htmlentities( '(\/wp-content\/uploads)(.*)$' ) ?></span> |
|
813 | + class="regex_pattern"> <?php echo htmlentities('(\/wp-content\/uploads)(.*)$') ?></span> |
|
814 | 814 | </li> |
815 | 815 | <li>Exclude the wp-admin, wp-includes and wp-config.php: <span |
816 | - class="regex_pattern"> <?php echo htmlentities( '\/(wp-admin|wp-includes|wp-config.php)(.*)$' ) ?></span> |
|
816 | + class="regex_pattern"> <?php echo htmlentities('\/(wp-admin|wp-includes|wp-config.php)(.*)$') ?></span> |
|
817 | 817 | </li> |
818 | 818 | <li>Exclude wp-content/updraft and wp/content/uploads/wp_all_backup folder :<span |
819 | 819 | class="regex_pattern">\/(wp-content\/updraft|\/wp-content\/uploads\/wp_all_backup)(.*)$</span> |
820 | 820 | </li> |
821 | 821 | <li>Exclude all cache folders from wp-content/ and it's subdirectories: <span |
822 | - class="regex_pattern"> <?php echo htmlentities( '\/wp-content(.*)\/cache($|\/)(.*)' ) ?></span> |
|
822 | + class="regex_pattern"> <?php echo htmlentities('\/wp-content(.*)\/cache($|\/)(.*)') ?></span> |
|
823 | 823 | </li> |
824 | 824 | <li>Exclude wp-content/cache/ folder: <span |
825 | - class="regex_pattern"> <?php echo htmlentities( '\/wp-content\/cache(.*)' ) ?></span> |
|
825 | + class="regex_pattern"> <?php echo htmlentities('\/wp-content\/cache(.*)') ?></span> |
|
826 | 826 | </li> |
827 | 827 | <li>Exclude all error_log files: <span |
828 | - class="regex_pattern"> <?php echo htmlentities( '(.*)error_log$' ) ?></span></li> |
|
828 | + class="regex_pattern"> <?php echo htmlentities('(.*)error_log$') ?></span></li> |
|
829 | 829 | </ul> |
830 | 830 | </div> |
831 | 831 | </div> |
@@ -835,26 +835,26 @@ discard block |
||
835 | 835 | } |
836 | 836 | |
837 | 837 | // number field content cb |
838 | - public function do_form_number_field( $params ) { |
|
839 | - if ( ! isset( $params['3'] ) ) { |
|
838 | + public function do_form_number_field($params) { |
|
839 | + if (!isset($params['3'])) { |
|
840 | 840 | $params[3] = 0; |
841 | 841 | } |
842 | - if ( ! isset( $params['2'] ) ) { |
|
842 | + if (!isset($params['2'])) { |
|
843 | 843 | $params[2] = 0; |
844 | 844 | } |
845 | 845 | |
846 | - list( $fieldname, $label, $value, $disabled ) = $params; |
|
846 | + list($fieldname, $label, $value, $disabled) = $params; |
|
847 | 847 | |
848 | - if ( ! $value ) { |
|
849 | - $value = get_option( $fieldname ); |
|
848 | + if (!$value) { |
|
849 | + $value = get_option($fieldname); |
|
850 | 850 | } |
851 | 851 | // output the field |
852 | 852 | ?> |
853 | 853 | <div class="row"> |
854 | 854 | <div class="input-field col s10 m5 l3"> |
855 | - <input class="validate" <?php echo ( $disabled ) ? "disabled" : "" ?> name="<?php echo $fieldname ?>" |
|
855 | + <input class="validate" <?php echo ($disabled) ? "disabled" : "" ?> name="<?php echo $fieldname ?>" |
|
856 | 856 | id="<?php echo $fieldname ?>" type="number" class="validate" |
857 | - value="<?php echo isset( $value ) ? esc_attr( $value ) : ''; ?>"> |
|
857 | + value="<?php echo isset($value) ? esc_attr($value) : ''; ?>"> |
|
858 | 858 | </div> |
859 | 859 | <div class="col s2 m2 "> |
860 | 860 | <a class="btn-floating tooltipped btn-small" data-html="true" data-position="center" data-delay="50" |
@@ -866,22 +866,22 @@ discard block |
||
866 | 866 | <?php |
867 | 867 | } |
868 | 868 | |
869 | - public function do_form_range_field( $params ) { |
|
870 | - if ( ! isset( $params['4'] ) ) { |
|
869 | + public function do_form_range_field($params) { |
|
870 | + if (!isset($params['4'])) { |
|
871 | 871 | $params[4] = 0; |
872 | 872 | } |
873 | 873 | |
874 | - list( $fieldname, $label, $range_start, $range_end, $disabled ) = $params; |
|
875 | - $value = get_option( $fieldname ); |
|
874 | + list($fieldname, $label, $range_start, $range_end, $disabled) = $params; |
|
875 | + $value = get_option($fieldname); |
|
876 | 876 | ?> |
877 | 877 | <div class="row"> |
878 | 878 | <div class="input-field col s10 m10 l8"> |
879 | 879 | <p class="range-field"> |
880 | - <input <?php echo ( $disabled ) ? "disabled" : "" ?> type="range" name="<?php echo $fieldname ?>" |
|
880 | + <input <?php echo ($disabled) ? "disabled" : "" ?> type="range" name="<?php echo $fieldname ?>" |
|
881 | 881 | id="<?php echo $fieldname ?>" |
882 | 882 | min="<?php echo $range_start ?>" |
883 | 883 | max="<?php echo $range_end ?>" |
884 | - value="<?php echo isset( $value ) ? esc_attr( $value ) : ''; ?>"/> |
|
884 | + value="<?php echo isset($value) ? esc_attr($value) : ''; ?>"/> |
|
885 | 885 | </p> |
886 | 886 | </div> |
887 | 887 | <div class="col s2 m2 "> |
@@ -893,22 +893,22 @@ discard block |
||
893 | 893 | } |
894 | 894 | |
895 | 895 | |
896 | - public function do_form_switch_field( $params ) { |
|
897 | - if ( ! isset( $params['2'] ) ) { |
|
896 | + public function do_form_switch_field($params) { |
|
897 | + if (!isset($params['2'])) { |
|
898 | 898 | $params[2] = 0; |
899 | 899 | } |
900 | - list( $fieldname, $label, $disabled ) = $params; |
|
901 | - $value = get_option( $fieldname ); |
|
900 | + list($fieldname, $label, $disabled) = $params; |
|
901 | + $value = get_option($fieldname); |
|
902 | 902 | ?> |
903 | 903 | <div class="row"> |
904 | 904 | <div class="input-field col s10 m5 l3"> |
905 | 905 | <div class="switch"> |
906 | 906 | <label> |
907 | 907 | Off |
908 | - <input <?php echo ( $disabled ) ? "disabled" : "" ?> type="checkbox" |
|
908 | + <input <?php echo ($disabled) ? "disabled" : "" ?> type="checkbox" |
|
909 | 909 | name="<?php echo $fieldname ?>" |
910 | 910 | id="<?php echo $fieldname ?>" |
911 | - value="1" <?php echo ( $value ) ? 'checked="checked"' : ''; ?> |
|
911 | + value="1" <?php echo ($value) ? 'checked="checked"' : ''; ?> |
|
912 | 912 | "> |
913 | 913 | <span class="lever"></span> |
914 | 914 | On |
@@ -61,22 +61,22 @@ discard block |
||
61 | 61 | |
62 | 62 | global $wpdb; |
63 | 63 | |
64 | - if ( version_compare( phpversion(), Xcloner_Activator::xcloner_minimum_version, '<' ) ) { |
|
65 | - wp_die( '<p>' . sprintf( __( "XCloner requires minimum PHP version %s in order to run correctly. We have detected your version as %s" ), Xcloner_Activator::xcloner_minimum_version, phpversion() ) . '</p>', __( "XCloner Activation Error" ), array( 'response' => 500, |
|
64 | + if (version_compare(phpversion(), Xcloner_Activator::xcloner_minimum_version, '<')) { |
|
65 | + wp_die('<p>'.sprintf(__("XCloner requires minimum PHP version %s in order to run correctly. We have detected your version as %s"), Xcloner_Activator::xcloner_minimum_version, phpversion()).'</p>', __("XCloner Activation Error"), array('response' => 500, |
|
66 | 66 | 'back_link' => true |
67 | - ) ); |
|
67 | + )); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $charset_collate = $wpdb->get_charset_collate(); |
71 | 71 | |
72 | - $installed_ver = get_option( "xcloner_db_version" ); |
|
72 | + $installed_ver = get_option("xcloner_db_version"); |
|
73 | 73 | |
74 | 74 | $xcloner_db_version = Xcloner_Activator::xcloner_db_version; |
75 | 75 | |
76 | - $xcloner_scheduler_table = $wpdb->prefix . "xcloner_scheduler"; |
|
76 | + $xcloner_scheduler_table = $wpdb->prefix."xcloner_scheduler"; |
|
77 | 77 | |
78 | - if ( $installed_ver != $xcloner_db_version ) { |
|
79 | - $xcloner_schedule_sql = "CREATE TABLE `" . $xcloner_scheduler_table . "` ( |
|
78 | + if ($installed_ver != $xcloner_db_version) { |
|
79 | + $xcloner_schedule_sql = "CREATE TABLE `".$xcloner_scheduler_table."` ( |
|
80 | 80 | `id` int(11) NOT NULL AUTO_INCREMENT, |
81 | 81 | `name` varchar(255) NOT NULL, |
82 | 82 | `recurrence` varchar(25) NOT NULL, |
@@ -87,73 +87,73 @@ discard block |
||
87 | 87 | `status` int(1) NOT NULL, |
88 | 88 | `last_backup` varchar(100) DEFAULT NULL, |
89 | 89 | PRIMARY KEY (`id`) |
90 | - ) " . $charset_collate . "; |
|
90 | + ) " . $charset_collate."; |
|
91 | 91 | "; |
92 | 92 | |
93 | - require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
|
94 | - dbDelta( $xcloner_schedule_sql ); |
|
93 | + require_once(ABSPATH.'wp-admin/includes/upgrade.php'); |
|
94 | + dbDelta($xcloner_schedule_sql); |
|
95 | 95 | |
96 | - update_option( "xcloner_db_version", $xcloner_db_version ); |
|
96 | + update_option("xcloner_db_version", $xcloner_db_version); |
|
97 | 97 | } |
98 | 98 | |
99 | - if ( get_option( 'xcloner_backup_compression_level' ) === false ) { |
|
100 | - update_option( 'xcloner_backup_compression_level', 0 ); |
|
99 | + if (get_option('xcloner_backup_compression_level') === false) { |
|
100 | + update_option('xcloner_backup_compression_level', 0); |
|
101 | 101 | } |
102 | 102 | |
103 | - if ( get_option( 'xcloner_enable_log' ) === false ) { |
|
104 | - update_option( 'xcloner_enable_log', 1 ); |
|
103 | + if (get_option('xcloner_enable_log') === false) { |
|
104 | + update_option('xcloner_enable_log', 1); |
|
105 | 105 | } |
106 | 106 | |
107 | - if ( get_option( 'xcloner_enable_mysql_backup' ) === false ) { |
|
108 | - update_option( 'xcloner_enable_mysql_backup', 1 ); |
|
107 | + if (get_option('xcloner_enable_mysql_backup') === false) { |
|
108 | + update_option('xcloner_enable_mysql_backup', 1); |
|
109 | 109 | } |
110 | 110 | |
111 | - if ( get_option( 'xcloner_system_settings_page' ) === false ) { |
|
112 | - update_option( 'xcloner_system_settings_page', 100 ); |
|
111 | + if (get_option('xcloner_system_settings_page') === false) { |
|
112 | + update_option('xcloner_system_settings_page', 100); |
|
113 | 113 | } |
114 | 114 | |
115 | - if ( get_option( 'xcloner_files_to_process_per_request' ) === false ) { |
|
116 | - update_option( 'xcloner_files_to_process_per_request', 250 ); |
|
115 | + if (get_option('xcloner_files_to_process_per_request') === false) { |
|
116 | + update_option('xcloner_files_to_process_per_request', 250); |
|
117 | 117 | } |
118 | 118 | |
119 | - if ( get_option( 'xcloner_database_records_per_request' ) === false ) { |
|
120 | - update_option( 'xcloner_database_records_per_request', 10000 ); |
|
119 | + if (get_option('xcloner_database_records_per_request') === false) { |
|
120 | + update_option('xcloner_database_records_per_request', 10000); |
|
121 | 121 | } |
122 | 122 | |
123 | - if ( get_option( 'xcloner_exclude_files_larger_than_mb' ) === false ) { |
|
124 | - update_option( 'xcloner_exclude_files_larger_than_mb', 0 ); |
|
123 | + if (get_option('xcloner_exclude_files_larger_than_mb') === false) { |
|
124 | + update_option('xcloner_exclude_files_larger_than_mb', 0); |
|
125 | 125 | } |
126 | 126 | |
127 | - if ( get_option( 'xcloner_split_backup_limit' ) === false ) { |
|
128 | - update_option( 'xcloner_split_backup_limit', 2048 ); |
|
127 | + if (get_option('xcloner_split_backup_limit') === false) { |
|
128 | + update_option('xcloner_split_backup_limit', 2048); |
|
129 | 129 | } |
130 | 130 | |
131 | - if ( get_option( 'xcloner_size_limit_per_request' ) === false ) { |
|
132 | - update_option( 'xcloner_size_limit_per_request', 50 ); |
|
131 | + if (get_option('xcloner_size_limit_per_request') === false) { |
|
132 | + update_option('xcloner_size_limit_per_request', 50); |
|
133 | 133 | } |
134 | 134 | |
135 | - if ( get_option( 'xcloner_cleanup_retention_limit_days' ) === false ) { |
|
136 | - update_option( 'xcloner_cleanup_retention_limit_days', 60 ); |
|
135 | + if (get_option('xcloner_cleanup_retention_limit_days') === false) { |
|
136 | + update_option('xcloner_cleanup_retention_limit_days', 60); |
|
137 | 137 | } |
138 | 138 | |
139 | - if ( get_option( 'xcloner_cleanup_retention_limit_archives' ) === false ) { |
|
140 | - update_option( 'xcloner_cleanup_retention_limit_archives', 100 ); |
|
139 | + if (get_option('xcloner_cleanup_retention_limit_archives') === false) { |
|
140 | + update_option('xcloner_cleanup_retention_limit_archives', 100); |
|
141 | 141 | } |
142 | 142 | |
143 | - if ( get_option( 'xcloner_directories_to_scan_per_request' ) === false ) { |
|
144 | - update_option( 'xcloner_directories_to_scan_per_request', 25 ); |
|
143 | + if (get_option('xcloner_directories_to_scan_per_request') === false) { |
|
144 | + update_option('xcloner_directories_to_scan_per_request', 25); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /*if(!get_option('xcloner_diff_backup_recreate_period')) |
148 | 148 | update_option('xcloner_diff_backup_recreate_period', 10); |
149 | 149 | * */ |
150 | 150 | |
151 | - if ( ! get_option( 'xcloner_regex_exclude' ) ) { |
|
152 | - update_option( 'xcloner_regex_exclude', "(wp-content\/updraft|wp-content\/uploads\/wp_all_backup)(.*)$" . PHP_EOL . "(.*)\.(svn|git)(.*)$" . PHP_EOL . "wp-content\/cache(.*)$" . PHP_EOL . "(.*)error_log$" ); |
|
151 | + if (!get_option('xcloner_regex_exclude')) { |
|
152 | + update_option('xcloner_regex_exclude', "(wp-content\/updraft|wp-content\/uploads\/wp_all_backup)(.*)$".PHP_EOL."(.*)\.(svn|git)(.*)$".PHP_EOL."wp-content\/cache(.*)$".PHP_EOL."(.*)error_log$"); |
|
153 | 153 | } |
154 | 154 | |
155 | - if ( ! get_option( 'xcloner_regex_exclude' ) ) { |
|
156 | - update_option( 'xcloner_regex_exclude', "(wp-content\/updraft|wp-content\/uploads\/wp_all_backup)(.*)$" . PHP_EOL . "(.*)\.(svn|git)(.*)$" . PHP_EOL . "wp-content\/cache(.*)$" . PHP_EOL . "(.*)error_log$" ); |
|
155 | + if (!get_option('xcloner_regex_exclude')) { |
|
156 | + update_option('xcloner_regex_exclude', "(wp-content\/updraft|wp-content\/uploads\/wp_all_backup)(.*)$".PHP_EOL."(.*)\.(svn|git)(.*)$".PHP_EOL."wp-content\/cache(.*)$".PHP_EOL."(.*)error_log$"); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $this->xcloner_remote_storage = $xcloner_container->get_xcloner_remote_storage(); |
90 | 90 | |
91 | 91 | if (isset($_POST['API_ID'])) { |
92 | - $this->logger->info("Processing ajax request ID " . substr($this->xcloner_sanitization->sanitize_input_as_string($_POST['API_ID']), |
|
92 | + $this->logger->info("Processing ajax request ID ".substr($this->xcloner_sanitization->sanitize_input_as_string($_POST['API_ID']), |
|
93 | 93 | 0, 15)); |
94 | 94 | } |
95 | 95 | |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | |
132 | 132 | |
133 | 133 | $data['recordsPerSession'] = $this->xcloner_settings->get_xcloner_option('xcloner_database_records_per_request'); |
134 | - $data['TEMP_DBPROCESS_FILE'] = $this->xcloner_settings->get_xcloner_tmp_path() . DS . ".database"; |
|
135 | - $data['TEMP_DUMP_FILE'] = $this->xcloner_settings->get_xcloner_tmp_path() . DS . "database-sql.sql"; |
|
134 | + $data['TEMP_DBPROCESS_FILE'] = $this->xcloner_settings->get_xcloner_tmp_path().DS.".database"; |
|
135 | + $data['TEMP_DUMP_FILE'] = $this->xcloner_settings->get_xcloner_tmp_path().DS."database-sql.sql"; |
|
136 | 136 | |
137 | 137 | try { |
138 | 138 | $this->xcloner_database->init($data); |
139 | 139 | |
140 | - } catch (Exception $e) { |
|
140 | + }catch (Exception $e) { |
|
141 | 141 | |
142 | 142 | $this->send_response($e->getMessage()); |
143 | 143 | $this->logger->error($e->getMessage()); |
@@ -223,8 +223,8 @@ discard block |
||
223 | 223 | } else { |
224 | 224 | |
225 | 225 | $schedule['status'] = 1; |
226 | - $schedule['start_at'] = strtotime($this->form_params['backup_params']['schedule_start_date'] . |
|
227 | - " " . $this->form_params['backup_params']['schedule_start_time']); |
|
226 | + $schedule['start_at'] = strtotime($this->form_params['backup_params']['schedule_start_date']. |
|
227 | + " ".$this->form_params['backup_params']['schedule_start_time']); |
|
228 | 228 | |
229 | 229 | if ($schedule['start_at'] <= time()) { |
230 | 230 | $schedule['start_at'] = ""; |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | if (!isset($_POST['id'])) { |
251 | 251 | $wpdb->insert( |
252 | - $wpdb->prefix . 'xcloner_scheduler', |
|
252 | + $wpdb->prefix.'xcloner_scheduler', |
|
253 | 253 | $schedule, |
254 | 254 | array( |
255 | 255 | '%s', |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | ); |
259 | 259 | } else { |
260 | 260 | $wpdb->update( |
261 | - $wpdb->prefix . 'xcloner_scheduler', |
|
261 | + $wpdb->prefix.'xcloner_scheduler', |
|
262 | 262 | $schedule, |
263 | 263 | array('id' => $_POST['id']), |
264 | 264 | array( |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | try { |
310 | 310 | $return = $this->archive_system->start_incremental_backup($this->form_params['backup_params'], |
311 | 311 | $this->form_params['extra'], $init); |
312 | - } catch (Exception $e) { |
|
312 | + }catch (Exception $e) { |
|
313 | 313 | $return = array(); |
314 | 314 | $return['error'] = true; |
315 | 315 | $return['status'] = 500; |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $additional['lines_total'] = $return['extra']['lines_total']; |
337 | 337 | $this->archive_system->send_notification($to, $from, $subject, $return['extra']['backup_parent'], |
338 | 338 | $this->form_params, "", $additional); |
339 | - } catch (Exception $e) { |
|
339 | + }catch (Exception $e) { |
|
340 | 340 | $this->logger->error($e->getMessage()); |
341 | 341 | } |
342 | 342 | } |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | if (isset($params->backup_params)) { |
431 | 431 | foreach ($params->backup_params as $param) { |
432 | 432 | $this->form_params['backup_params'][$param->name] = $this->xcloner_sanitization->sanitize_input_as_string($param->value); |
433 | - $this->logger->debug("Adding form parameter " . $param->name . "." . $param->value . "\n", array( |
|
433 | + $this->logger->debug("Adding form parameter ".$param->name.".".$param->value."\n", array( |
|
434 | 434 | 'POST', |
435 | 435 | 'fields filter' |
436 | 436 | )); |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | if (isset($params->table_params)) { |
443 | 443 | foreach ($params->table_params as $param) { |
444 | 444 | $this->form_params['database'][$param->parent][] = $this->xcloner_sanitization->sanitize_input_as_raw($param->id); |
445 | - $this->logger->debug("Adding database filter " . $param->parent . "." . $param->id . "\n", array( |
|
445 | + $this->logger->debug("Adding database filter ".$param->parent.".".$param->id."\n", array( |
|
446 | 446 | 'POST', |
447 | 447 | 'database filter' |
448 | 448 | )); |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | if (!in_array($param->parent, $this->form_params['excluded_files'])) { |
462 | 462 | //$this->form_params['excluded_files'][] = $this->xcloner_sanitization->sanitize_input_as_relative_path($param->id); |
463 | 463 | $unique_exclude_files[] = $param->id; |
464 | - $this->logger->debug("Adding file filter " . $param->id . "\n", array( |
|
464 | + $this->logger->debug("Adding file filter ".$param->id."\n", array( |
|
465 | 465 | 'POST', |
466 | 466 | 'exclude files filter' |
467 | 467 | )); |
@@ -509,13 +509,13 @@ discard block |
||
509 | 509 | 'text' => $this->xcloner_settings->get_xcloner_start_path(), |
510 | 510 | //'children' => true, |
511 | 511 | 'state' => array('selected' => false, 'opened' => true), |
512 | - 'icon' => plugin_dir_url(dirname(__FILE__)) . "/admin/assets/file-icon-root.png" |
|
512 | + 'icon' => plugin_dir_url(dirname(__FILE__))."/admin/assets/file-icon-root.png" |
|
513 | 513 | ); |
514 | 514 | } |
515 | 515 | |
516 | 516 | try { |
517 | 517 | $files = $this->xcloner_file_system->list_directory($folder); |
518 | - } catch (Exception $e) { |
|
518 | + }catch (Exception $e) { |
|
519 | 519 | |
520 | 520 | print $e->getMessage(); |
521 | 521 | $this->logger->error($e->getMessage()); |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | if ($file['type'] == "dir") { |
537 | 537 | $children = true; |
538 | 538 | } else { |
539 | - $text .= " (" . $this->xcloner_requirements->file_format_size($file['size']) . ")"; |
|
539 | + $text .= " (".$this->xcloner_requirements->file_format_size($file['size']).")"; |
|
540 | 540 | } |
541 | 541 | |
542 | 542 | if ($this->xcloner_file_system->is_excluded($file)) { |
@@ -552,8 +552,8 @@ discard block |
||
552 | 552 | //'title' => "test", |
553 | 553 | 'children' => $children, |
554 | 554 | 'state' => array('selected' => $selected, 'opened' => false, "checkbox_disabled" => $selected), |
555 | - 'icon' => plugin_dir_url(dirname(__FILE__)) . "/admin/assets/file-icon-" . strtolower(substr($file['type'], |
|
556 | - 0, 1)) . ".png" |
|
555 | + 'icon' => plugin_dir_url(dirname(__FILE__))."/admin/assets/file-icon-".strtolower(substr($file['type'], |
|
556 | + 0, 1)).".png" |
|
557 | 557 | ); |
558 | 558 | } |
559 | 559 | |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | if ($database == "#") { |
580 | 580 | try { |
581 | 581 | $return = $this->xcloner_database->get_all_databases(); |
582 | - } catch (Exception $e) { |
|
582 | + }catch (Exception $e) { |
|
583 | 583 | $this->logger->error($e->getMessage()); |
584 | 584 | } |
585 | 585 | |
@@ -600,10 +600,10 @@ discard block |
||
600 | 600 | $data[] = array( |
601 | 601 | 'id' => $database['name'], |
602 | 602 | 'parent' => '#', |
603 | - 'text' => $database['name'] . " (" . (int)$database['num_tables'] . ")", |
|
603 | + 'text' => $database['name']." (".(int)$database['num_tables'].")", |
|
604 | 604 | 'children' => true, |
605 | 605 | 'state' => $state, |
606 | - 'icon' => plugin_dir_url(dirname(__FILE__)) . "/admin/assets/database-icon.png" |
|
606 | + 'icon' => plugin_dir_url(dirname(__FILE__))."/admin/assets/database-icon.png" |
|
607 | 607 | ); |
608 | 608 | } |
609 | 609 | |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | |
612 | 612 | try { |
613 | 613 | $return = $this->xcloner_database->list_tables($database, "", 1); |
614 | - } catch (Exception $e) { |
|
614 | + }catch (Exception $e) { |
|
615 | 615 | $this->logger->error($e->getMessage()); |
616 | 616 | } |
617 | 617 | |
@@ -628,12 +628,12 @@ discard block |
||
628 | 628 | } |
629 | 629 | |
630 | 630 | $data[] = array( |
631 | - 'id' => $database . "." . $table['name'], |
|
631 | + 'id' => $database.".".$table['name'], |
|
632 | 632 | 'parent' => $database, |
633 | - 'text' => $table['name'] . " (" . (int)$table['records'] . ")", |
|
633 | + 'text' => $table['name']." (".(int)$table['records'].")", |
|
634 | 634 | 'children' => false, |
635 | 635 | 'state' => $state, |
636 | - 'icon' => plugin_dir_url(dirname(__FILE__)) . "/admin/assets/table-icon.png" |
|
636 | + 'icon' => plugin_dir_url(dirname(__FILE__))."/admin/assets/table-icon.png" |
|
637 | 637 | ); |
638 | 638 | } |
639 | 639 | } |
@@ -677,17 +677,17 @@ discard block |
||
677 | 677 | $return['data'] = array(); |
678 | 678 | |
679 | 679 | foreach ($data as $res) { |
680 | - $action = "<a href=\"#" . $res->id . "\" class=\"edit\" title='Edit'> <i class=\"material-icons \">edit</i></a> |
|
681 | - <a href=\"#" . $res->id . "\" class=\"delete\" title='Delete'><i class=\"material-icons \">delete</i></a>"; |
|
680 | + $action = "<a href=\"#".$res->id."\" class=\"edit\" title='Edit'> <i class=\"material-icons \">edit</i></a> |
|
681 | + <a href=\"#" . $res->id."\" class=\"delete\" title='Delete'><i class=\"material-icons \">delete</i></a>"; |
|
682 | 682 | if ($res->status) { |
683 | 683 | $status = '<i class="material-icons active status">timer</i>'; |
684 | 684 | } else { |
685 | 685 | $status = '<i class="material-icons status inactive">timer_off</i>'; |
686 | 686 | } |
687 | 687 | |
688 | - $next_run_time = wp_next_scheduled('xcloner_scheduler_' . $res->id, array($res->id)); |
|
688 | + $next_run_time = wp_next_scheduled('xcloner_scheduler_'.$res->id, array($res->id)); |
|
689 | 689 | |
690 | - $next_run = date(get_option('date_format') . " " . get_option('time_format'), $next_run_time); |
|
690 | + $next_run = date(get_option('date_format')." ".get_option('time_format'), $next_run_time); |
|
691 | 691 | |
692 | 692 | $remote_storage = $res->remote_storage; |
693 | 693 | |
@@ -696,16 +696,16 @@ discard block |
||
696 | 696 | } |
697 | 697 | |
698 | 698 | if (trim($next_run)) { |
699 | - $date_text = date(get_option('date_format') . " " . get_option('time_format'), |
|
699 | + $date_text = date(get_option('date_format')." ".get_option('time_format'), |
|
700 | 700 | $next_run_time + (get_option('gmt_offset') * HOUR_IN_SECONDS)); |
701 | 701 | |
702 | 702 | if ($next_run_time >= time()) { |
703 | - $next_run = "in " . human_time_diff($next_run_time, time()); |
|
703 | + $next_run = "in ".human_time_diff($next_run_time, time()); |
|
704 | 704 | } else { |
705 | 705 | $next_run = __("executed", 'xcloner-backup-and-restore'); |
706 | 706 | } |
707 | 707 | |
708 | - $next_run = "<a href='#' title='" . $date_text . "'>" . $next_run . "</a>"; |
|
708 | + $next_run = "<a href='#' title='".$date_text."'>".$next_run."</a>"; |
|
709 | 709 | //$next_run .=" ($date_text)"; |
710 | 710 | } |
711 | 711 | |
@@ -717,11 +717,11 @@ discard block |
||
717 | 717 | if ($this->xcloner_file_system->get_storage_filesystem()->has($res->last_backup)) { |
718 | 718 | $metadata = $this->xcloner_file_system->get_storage_filesystem()->getMetadata($res->last_backup); |
719 | 719 | $backup_size = size_format($this->xcloner_file_system->get_backup_size($res->last_backup)); |
720 | - $backup_time = date(get_option('date_format') . " " . get_option('time_format'), |
|
720 | + $backup_time = date(get_option('date_format')." ".get_option('time_format'), |
|
721 | 721 | $metadata['timestamp'] + (get_option('gmt_offset') * HOUR_IN_SECONDS)); |
722 | 722 | } |
723 | 723 | |
724 | - $backup_text = "<span title='" . $backup_time . "' class='shorten_string'>" . $res->last_backup . " (" . $backup_size . ")</span>"; |
|
724 | + $backup_text = "<span title='".$backup_time."' class='shorten_string'>".$res->last_backup." (".$backup_size.")</span>"; |
|
725 | 725 | } |
726 | 726 | |
727 | 727 | $schedules = wp_get_schedules(); |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | $return['data'][] = array( |
734 | 734 | $res->id, |
735 | 735 | $res->name, |
736 | - $res->recurrence,/*$res->start_at,*/ |
|
736 | + $res->recurrence, /*$res->start_at,*/ |
|
737 | 737 | $next_run, |
738 | 738 | $remote_storage, |
739 | 739 | $backup_text, |
@@ -795,25 +795,25 @@ discard block |
||
795 | 795 | $this->process_params($params); |
796 | 796 | $source_backup_file = $this->xcloner_sanitization->sanitize_input_as_string($this->form_params['extra']['backup_parent']); |
797 | 797 | |
798 | - if(isset($this->form_params['extra']['start'])) { |
|
798 | + if (isset($this->form_params['extra']['start'])) { |
|
799 | 799 | $start = $this->xcloner_sanitization->sanitize_input_as_int($this->form_params['extra']['start']); |
800 | - }else{ |
|
800 | + } else { |
|
801 | 801 | $start = 0; |
802 | 802 | } |
803 | 803 | |
804 | - if(isset($this->form_params['extra']['iv'])) { |
|
804 | + if (isset($this->form_params['extra']['iv'])) { |
|
805 | 805 | $iv = $this->xcloner_sanitization->sanitize_input_as_raw($this->form_params['extra']['iv']); |
806 | - }else{ |
|
806 | + } else { |
|
807 | 807 | $iv = ""; |
808 | 808 | } |
809 | 809 | |
810 | - if(isset($this->form_params['extra']['part'])) { |
|
810 | + if (isset($this->form_params['extra']['part'])) { |
|
811 | 811 | $return['part'] = (int)$this->xcloner_sanitization->sanitize_input_as_int($this->form_params['extra']['part']); |
812 | - }else{ |
|
812 | + } else { |
|
813 | 813 | $return['part'] = 0; |
814 | 814 | } |
815 | 815 | |
816 | - }else{ |
|
816 | + } else { |
|
817 | 817 | $source_backup_file = $this->xcloner_sanitization->sanitize_input_as_string($_POST['file']); |
818 | 818 | $start = $this->xcloner_sanitization->sanitize_input_as_int($_POST['start']); |
819 | 819 | $iv = $this->xcloner_sanitization->sanitize_input_as_raw($_POST['iv']); |
@@ -828,14 +828,14 @@ discard block |
||
828 | 828 | } |
829 | 829 | |
830 | 830 | $return['processing_file'] = $backup_file; |
831 | - $return['total_size'] = filesize($this->xcloner_settings->get_xcloner_store_path() . DS . $backup_file); |
|
831 | + $return['total_size'] = filesize($this->xcloner_settings->get_xcloner_store_path().DS.$backup_file); |
|
832 | 832 | |
833 | 833 | try { |
834 | 834 | $this->logger->info(json_encode($_POST)); |
835 | 835 | $this->logger->info($iv); |
836 | 836 | $return = array_merge($return, |
837 | 837 | $this->xcloner_encryption->encrypt_file($backup_file, "", "", $start, base64_decode($iv))); |
838 | - }catch(\Exception $e){ |
|
838 | + }catch (\Exception $e) { |
|
839 | 839 | $return['error'] = true; |
840 | 840 | $return['message'] = $e->getMessage(); |
841 | 841 | $return['error_message'] = $e->getMessage(); |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | |
844 | 844 | //echo strlen($return['iv']);exit; |
845 | 845 | |
846 | - if($return['finished']) { |
|
846 | + if ($return['finished']) { |
|
847 | 847 | if ($this->xcloner_file_system->is_multipart($source_backup_file)) { |
848 | 848 | $return['start'] = 0; |
849 | 849 | |
@@ -857,7 +857,7 @@ discard block |
||
857 | 857 | } |
858 | 858 | |
859 | 859 | if (isset($_POST['data'])) { |
860 | - $return['extra'] = array_merge($this->form_params['extra'], $return); |
|
860 | + $return['extra'] = array_merge($this->form_params['extra'], $return); |
|
861 | 861 | } |
862 | 862 | |
863 | 863 | $this->send_response($return, 0); |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | $source_backup_file = $this->xcloner_sanitization->sanitize_input_as_string($_POST['file']); |
877 | 877 | $start = $this->xcloner_sanitization->sanitize_input_as_int($_POST['start']); |
878 | 878 | $iv = $this->xcloner_sanitization->sanitize_input_as_raw($_POST['iv']); |
879 | - $decryption_key = $this->xcloner_sanitization->sanitize_input_as_raw($_POST['decryption_key']);; |
|
879 | + $decryption_key = $this->xcloner_sanitization->sanitize_input_as_raw($_POST['decryption_key']); ; |
|
880 | 880 | $return['part'] = $this->xcloner_sanitization->sanitize_input_as_int($_POST['part']); |
881 | 881 | |
882 | 882 | $backup_file = $source_backup_file; |
@@ -887,17 +887,17 @@ discard block |
||
887 | 887 | } |
888 | 888 | |
889 | 889 | $return['processing_file'] = $backup_file; |
890 | - $return['total_size'] = filesize($this->xcloner_settings->get_xcloner_store_path() . DS . $backup_file); |
|
890 | + $return['total_size'] = filesize($this->xcloner_settings->get_xcloner_store_path().DS.$backup_file); |
|
891 | 891 | |
892 | 892 | try { |
893 | 893 | $return = array_merge($return, |
894 | 894 | $this->xcloner_encryption->decrypt_file($backup_file, "", $decryption_key, $start, base64_decode($iv))); |
895 | - }catch(\Exception $e){ |
|
895 | + }catch (\Exception $e) { |
|
896 | 896 | $return['error'] = true; |
897 | 897 | $return['message'] = $e->getMessage(); |
898 | 898 | } |
899 | 899 | |
900 | - if($return['finished']) { |
|
900 | + if ($return['finished']) { |
|
901 | 901 | if ($this->xcloner_file_system->is_multipart($source_backup_file)) { |
902 | 902 | $return['start'] = 0; |
903 | 903 | |
@@ -929,7 +929,7 @@ discard block |
||
929 | 929 | foreach ($backup_list as $file_info):?> |
930 | 930 | <?php |
931 | 931 | if ($storage_selection == "gdrive") { |
932 | - $file_info['path'] = $file_info['filename'] . "." . $file_info['extension']; |
|
932 | + $file_info['path'] = $file_info['filename'].".".$file_info['extension']; |
|
933 | 933 | } |
934 | 934 | $file_exists_on_local_storage = true; |
935 | 935 | |
@@ -989,7 +989,7 @@ discard block |
||
989 | 989 | <a href="#<?php echo $child[0]; ?>" class="download" |
990 | 990 | title="Download Backup"><i class="material-icons">file_download</i></a> |
991 | 991 | |
992 | - <?php if($this->xcloner_encryption->is_encrypted_file($child[0])) :?> |
|
992 | + <?php if ($this->xcloner_encryption->is_encrypted_file($child[0])) :?> |
|
993 | 993 | <a href="#<?php echo $child[0] ?>" class="backup-decryption" |
994 | 994 | title="<?php echo __('Backup Decryption', 'xcloner-backup-and-restore') ?>"> |
995 | 995 | <i class="material-icons">enhanced_encryption</i> |
@@ -1050,10 +1050,10 @@ discard block |
||
1050 | 1050 | <?php endif ?> |
1051 | 1051 | <?php |
1052 | 1052 | $basename = $file_info['basename']; |
1053 | - if(isset($file_info['childs']) and sizeof($file_info['childs'])) |
|
1053 | + if (isset($file_info['childs']) and sizeof($file_info['childs'])) |
|
1054 | 1054 | $basename = $file_info['childs'][0][0]; |
1055 | 1055 | ?> |
1056 | - <?php if($this->xcloner_encryption->is_encrypted_file($basename)) :?> |
|
1056 | + <?php if ($this->xcloner_encryption->is_encrypted_file($basename)) :?> |
|
1057 | 1057 | <a href="#<?php echo $file_info['basename'] ?>" class="backup-decryption" |
1058 | 1058 | title="<?php echo __('Backup Decryption', 'xcloner-backup-and-restore') ?>"> |
1059 | 1059 | <i class="material-icons">enhanced_encryption</i> |
@@ -1110,7 +1110,7 @@ discard block |
||
1110 | 1110 | $backup_file = $backup_parts[$return['part']]; |
1111 | 1111 | } |
1112 | 1112 | |
1113 | - if($this->xcloner_encryption->is_encrypted_file($backup_file)) { |
|
1113 | + if ($this->xcloner_encryption->is_encrypted_file($backup_file)) { |
|
1114 | 1114 | $return['error'] = true; |
1115 | 1115 | $return['message'] = __("Backup archive is encrypted, please decrypt it first before you can list it's content.", "xcloner-backup-and-restore"); |
1116 | 1116 | $this->send_response($return, 0); |
@@ -1118,10 +1118,10 @@ discard block |
||
1118 | 1118 | |
1119 | 1119 | try { |
1120 | 1120 | $tar = new Tar(); |
1121 | - $tar->open($this->xcloner_settings->get_xcloner_store_path() . DS . $backup_file, $start); |
|
1121 | + $tar->open($this->xcloner_settings->get_xcloner_store_path().DS.$backup_file, $start); |
|
1122 | 1122 | |
1123 | 1123 | $data = $tar->contents(get_option('xcloner_files_to_process_per_request')); |
1124 | - } catch (Exception $e) { |
|
1124 | + }catch (Exception $e) { |
|
1125 | 1125 | $return['error'] = true; |
1126 | 1126 | $return['message'] = $e->getMessage(); |
1127 | 1127 | $this->send_response($return, 0); |
@@ -1129,14 +1129,14 @@ discard block |
||
1129 | 1129 | |
1130 | 1130 | $return['files'] = array(); |
1131 | 1131 | $return['finished'] = 1; |
1132 | - $return['total_size'] = filesize($this->xcloner_settings->get_xcloner_store_path() . DS . $backup_file); |
|
1132 | + $return['total_size'] = filesize($this->xcloner_settings->get_xcloner_store_path().DS.$backup_file); |
|
1133 | 1133 | $i = 0; |
1134 | 1134 | |
1135 | 1135 | if (isset($data['extracted_files']) and is_array($data['extracted_files'])) { |
1136 | 1136 | foreach ($data['extracted_files'] as $file) { |
1137 | 1137 | $return['files'][$i]['path'] = $file->getPath(); |
1138 | 1138 | $return['files'][$i]['size'] = $file->getSize(); |
1139 | - $return['files'][$i]['mtime'] = date(get_option('date_format') . " " . get_option('time_format'), |
|
1139 | + $return['files'][$i]['mtime'] = date(get_option('date_format')." ".get_option('time_format'), |
|
1140 | 1140 | $file->getMtime()); |
1141 | 1141 | |
1142 | 1142 | $i++; |
@@ -1184,7 +1184,7 @@ discard block |
||
1184 | 1184 | "copy_backup_remote_to_local" |
1185 | 1185 | ), array($backup_file, $storage_type)); |
1186 | 1186 | } |
1187 | - } catch (Exception $e) { |
|
1187 | + }catch (Exception $e) { |
|
1188 | 1188 | |
1189 | 1189 | $return['error'] = 1; |
1190 | 1190 | $return['message'] = $e->getMessage(); |
@@ -1223,7 +1223,7 @@ discard block |
||
1223 | 1223 | "upload_backup_to_storage" |
1224 | 1224 | ), array($backup_file, $storage_type)); |
1225 | 1225 | } |
1226 | - } catch (Exception $e) { |
|
1226 | + }catch (Exception $e) { |
|
1227 | 1227 | |
1228 | 1228 | $return['error'] = 1; |
1229 | 1229 | $return['message'] = $e->getMessage(); |
@@ -1283,21 +1283,21 @@ discard block |
||
1283 | 1283 | $phar2->setStub($phar2->createDefaultStub('vendor/autoload.php', 'vendor/autoload.php')); |
1284 | 1284 | * */ |
1285 | 1285 | |
1286 | - $tmp_file = $this->xcloner_settings->get_xcloner_tmp_path() . DS . "xcloner-restore.tgz"; |
|
1286 | + $tmp_file = $this->xcloner_settings->get_xcloner_tmp_path().DS."xcloner-restore.tgz"; |
|
1287 | 1287 | |
1288 | 1288 | $tar = new Tar(); |
1289 | 1289 | $tar->create($tmp_file); |
1290 | 1290 | |
1291 | - $tar->addFile(dirname(__DIR__) . "/restore/vendor.build.txt", "vendor.phar"); |
|
1291 | + $tar->addFile(dirname(__DIR__)."/restore/vendor.build.txt", "vendor.phar"); |
|
1292 | 1292 | //$tar->addFile(dirname(__DIR__)."/restore/vendor.tgz", "vendor.tgz"); |
1293 | 1293 | |
1294 | 1294 | $files = $xcloner_plugin_filesystem->listContents("vendor/", true); |
1295 | 1295 | foreach ($files as $file) { |
1296 | - $tar->addFile(dirname(__DIR__) . DS . $file['path'], $file['path']); |
|
1296 | + $tar->addFile(dirname(__DIR__).DS.$file['path'], $file['path']); |
|
1297 | 1297 | } |
1298 | 1298 | |
1299 | - $content = file_get_contents(dirname(__DIR__) . "/restore/xcloner_restore.php"); |
|
1300 | - $content = str_replace("define('AUTH_KEY', '');", "define('AUTH_KEY', '" . md5(AUTH_KEY) . "');", $content); |
|
1299 | + $content = file_get_contents(dirname(__DIR__)."/restore/xcloner_restore.php"); |
|
1300 | + $content = str_replace("define('AUTH_KEY', '');", "define('AUTH_KEY', '".md5(AUTH_KEY)."');", $content); |
|
1301 | 1301 | |
1302 | 1302 | $tar->addData("xcloner_restore.php", $content); |
1303 | 1303 | |
@@ -1306,11 +1306,11 @@ discard block |
||
1306 | 1306 | if (file_exists($tmp_file)) { |
1307 | 1307 | header('Content-Description: File Transfer'); |
1308 | 1308 | header('Content-Type: application/octet-stream'); |
1309 | - header('Content-Disposition: attachment; filename="' . basename($tmp_file) . '"'); |
|
1309 | + header('Content-Disposition: attachment; filename="'.basename($tmp_file).'"'); |
|
1310 | 1310 | header('Expires: 0'); |
1311 | 1311 | header('Cache-Control: must-revalidate'); |
1312 | 1312 | header('Pragma: public'); |
1313 | - header('Content-Length: ' . filesize($tmp_file)); |
|
1313 | + header('Content-Length: '.filesize($tmp_file)); |
|
1314 | 1314 | readfile($tmp_file); |
1315 | 1315 | |
1316 | 1316 | } |
@@ -1342,9 +1342,9 @@ discard block |
||
1342 | 1342 | header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
1343 | 1343 | header('Cache-Control: private', false); |
1344 | 1344 | header('Content-Transfer-Encoding: binary'); |
1345 | - header('Content-Disposition: attachment; filename="' . $metadata['path'] . '";'); |
|
1345 | + header('Content-Disposition: attachment; filename="'.$metadata['path'].'";'); |
|
1346 | 1346 | header('Content-Type: application/octet-stream'); |
1347 | - header('Content-Length: ' . $metadata['size']); |
|
1347 | + header('Content-Length: '.$metadata['size']); |
|
1348 | 1348 | |
1349 | 1349 | @ob_end_clean(); |
1350 | 1350 | |
@@ -1404,12 +1404,12 @@ discard block |
||
1404 | 1404 | $xcloner_file_transfer->set_target($target_url); |
1405 | 1405 | $return['start'] = $xcloner_file_transfer->transfer_file($file, $start, $hash); |
1406 | 1406 | |
1407 | - } catch (Exception $e) { |
|
1407 | + }catch (Exception $e) { |
|
1408 | 1408 | |
1409 | 1409 | $return = array(); |
1410 | 1410 | $return['error'] = true; |
1411 | 1411 | $return['status'] = 500; |
1412 | - $return['message'] = "CURL communication error with the restore host. " . $e->getMessage(); |
|
1412 | + $return['message'] = "CURL communication error with the restore host. ".$e->getMessage(); |
|
1413 | 1413 | $this->send_response($return, 0); |
1414 | 1414 | |
1415 | 1415 | } |
@@ -1433,7 +1433,7 @@ discard block |
||
1433 | 1433 | $this->check_access(); |
1434 | 1434 | |
1435 | 1435 | define("XCLONER_PLUGIN_ACCESS", 1); |
1436 | - include_once(dirname(__DIR__) . DS . "restore" . DS . "xcloner_restore.php"); |
|
1436 | + include_once(dirname(__DIR__).DS."restore".DS."xcloner_restore.php"); |
|
1437 | 1437 | |
1438 | 1438 | return; |
1439 | 1439 | } |