@@ -26,6 +26,6 @@ |
||
26 | 26 | */ |
27 | 27 | |
28 | 28 | // If uninstall not called from WordPress, then exit. |
29 | -if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
29 | +if (!defined('WP_UNINSTALL_PLUGIN')) { |
|
30 | 30 | exit; |
31 | 31 | } |
@@ -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; |
@@ -111,12 +111,12 @@ discard block |
||
111 | 111 | { |
112 | 112 | register_shutdown_function(array($this, 'exception_handler')); |
113 | 113 | |
114 | - if(defined('XCLONER_PLUGIN_ACCESS') && XCLONER_PLUGIN_ACCESS) |
|
114 | + if (defined('XCLONER_PLUGIN_ACCESS') && XCLONER_PLUGIN_ACCESS) |
|
115 | 115 | { |
116 | 116 | $dir = $parent_api->get_xcloner_container()->get_xcloner_settings()->get_xcloner_store_path(); |
117 | 117 | } |
118 | 118 | |
119 | - if(!isset($dir) || !$dir){ |
|
119 | + if (!isset($dir) || !$dir) { |
|
120 | 120 | $dir = dirname(__FILE__); |
121 | 121 | } |
122 | 122 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | $this->backup_storage_dir = $dir; |
126 | 126 | |
127 | - $this->adapter = new Local($dir ,LOCK_EX, 'SKIP_LINKS'); |
|
127 | + $this->adapter = new Local($dir, LOCK_EX, 'SKIP_LINKS'); |
|
128 | 128 | $this->filesystem = new Filesystem($this->adapter, new Config([ |
129 | 129 | 'disable_asserts' => true, |
130 | 130 | ])); |
@@ -133,15 +133,15 @@ discard block |
||
133 | 133 | |
134 | 134 | $logger_path = $this->get_logger_filename(); |
135 | 135 | |
136 | - if(!is_writeable($logger_path) and !touch($logger_path)) |
|
136 | + if (!is_writeable($logger_path) and !touch($logger_path)) |
|
137 | 137 | { |
138 | 138 | $logger_path = "php://stderr"; |
139 | 139 | } |
140 | 140 | |
141 | 141 | $this->logger->pushHandler(new StreamHandler($logger_path, Logger::DEBUG)); |
142 | 142 | |
143 | - if(isset($_POST['API_ID'])){ |
|
144 | - $this->logger->info("Processing ajax request ID ".substr(filter_input(INPUT_POST, 'API_ID', FILTER_SANITIZE_STRING), 0 , 15)); |
|
143 | + if (isset($_POST['API_ID'])) { |
|
144 | + $this->logger->info("Processing ajax request ID ".substr(filter_input(INPUT_POST, 'API_ID', FILTER_SANITIZE_STRING), 0, 15)); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | } |
@@ -150,20 +150,20 @@ discard block |
||
150 | 150 | |
151 | 151 | $error = error_get_last(); |
152 | 152 | |
153 | - if($error['type'] and $this->logger) |
|
153 | + if ($error['type'] and $this->logger) |
|
154 | 154 | { |
155 | - $this->logger->info($this->friendly_error_type ($error['type']).": ".var_export($error, true)); |
|
155 | + $this->logger->info($this->friendly_error_type($error['type']).": ".var_export($error, true)); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | } |
159 | 159 | |
160 | 160 | private function friendly_error_type($type) { |
161 | - static $levels=null; |
|
162 | - if ($levels===null) { |
|
163 | - $levels=[]; |
|
161 | + static $levels = null; |
|
162 | + if ($levels === null) { |
|
163 | + $levels = []; |
|
164 | 164 | foreach (get_defined_constants() as $key=>$value) { |
165 | - if (strpos($key,'E_')!==0) {continue;} |
|
166 | - $levels[$value]= $key; //substr($key,2); |
|
165 | + if (strpos($key, 'E_') !== 0) {continue; } |
|
166 | + $levels[$value] = $key; //substr($key,2); |
|
167 | 167 | } |
168 | 168 | } |
169 | 169 | return (isset($levels[$type]) ? $levels[$type] : "Error #{$type}"); |
@@ -171,14 +171,14 @@ discard block |
||
171 | 171 | |
172 | 172 | public function get_logger_filename() |
173 | 173 | { |
174 | - $filename = $this->backup_storage_dir .DS. "xcloner_restore.log"; |
|
174 | + $filename = $this->backup_storage_dir.DS."xcloner_restore.log"; |
|
175 | 175 | |
176 | 176 | return $filename; |
177 | 177 | } |
178 | 178 | |
179 | 179 | public function init() |
180 | 180 | { |
181 | - if(isset($_POST['xcloner_action']) and $_POST['xcloner_action']) |
|
181 | + if (isset($_POST['xcloner_action']) and $_POST['xcloner_action']) |
|
182 | 182 | { |
183 | 183 | $method = filter_input(INPUT_POST, 'xcloner_action', FILTER_SANITIZE_STRING); |
184 | 184 | |
@@ -186,13 +186,13 @@ discard block |
||
186 | 186 | |
187 | 187 | $method .= "_action"; |
188 | 188 | |
189 | - if(method_exists($this, $method)) |
|
189 | + if (method_exists($this, $method)) |
|
190 | 190 | { |
191 | 191 | $this->logger->debug(sprintf('Starting action %s', $method)); |
192 | 192 | return call_user_func(array($this, $method)); |
193 | 193 | |
194 | - }else{ |
|
195 | - throw new Exception($method ." does not exists"); |
|
194 | + } else { |
|
195 | + throw new Exception($method." does not exists"); |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | |
@@ -201,38 +201,38 @@ discard block |
||
201 | 201 | |
202 | 202 | public function write_file_action() |
203 | 203 | { |
204 | - if(isset($_POST['file'])) |
|
204 | + if (isset($_POST['file'])) |
|
205 | 205 | { |
206 | 206 | $target_file = filter_input(INPUT_POST, 'file', FILTER_SANITIZE_STRING); |
207 | 207 | |
208 | - if(!$_POST['start']) |
|
208 | + if (!$_POST['start']) |
|
209 | 209 | $fp = fopen($target_file, "wb+"); |
210 | 210 | else |
211 | 211 | $fp = fopen($target_file, "ab+"); |
212 | 212 | |
213 | - if(!$fp) |
|
213 | + if (!$fp) |
|
214 | 214 | throw new Exception("Unable to open $target_file file for writing"); |
215 | 215 | |
216 | 216 | fseek($fp, $_POST['start']); |
217 | 217 | |
218 | - if(isset($_FILES['blob'])) |
|
218 | + if (isset($_FILES['blob'])) |
|
219 | 219 | { |
220 | 220 | $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'])); |
221 | 221 | |
222 | 222 | $blob = file_get_contents($_FILES['blob']['tmp_name']); |
223 | 223 | |
224 | - if(!$bytes_written = fwrite($fp, $blob)) |
|
224 | + if (!$bytes_written = fwrite($fp, $blob)) |
|
225 | 225 | throw new Exception("Unable to write data to file $target_file"); |
226 | 226 | |
227 | 227 | @unlink($_FILES['blob']['tmp_name']); |
228 | - }elseif(isset($_POST['blob'])){ |
|
228 | + }elseif (isset($_POST['blob'])) { |
|
229 | 229 | $this->logger->debug(sprintf('Writing %s bytes to file %s starting position %s using POST blob', strlen($_POST['blob']), $target_file, $_POST['start'])); |
230 | 230 | |
231 | 231 | $blob = $_POST['blob']; |
232 | 232 | |
233 | - if(!$bytes_written = fwrite($fp, $blob)) |
|
233 | + if (!$bytes_written = fwrite($fp, $blob)) |
|
234 | 234 | throw new Exception("Unable to write data to file $target_file"); |
235 | - }else{ |
|
235 | + } else { |
|
236 | 236 | throw new Exception("Upload failed, did not receive any binary data"); |
237 | 237 | } |
238 | 238 | |
@@ -243,20 +243,20 @@ discard block |
||
243 | 243 | |
244 | 244 | } |
245 | 245 | |
246 | - public function mysql_connect($remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db ) |
|
246 | + public function mysql_connect($remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db) |
|
247 | 247 | { |
248 | 248 | $this->logger->info(sprintf('Connecting to mysql database %s with %s@%s', $remote_mysql_db, $remote_mysql_user, $remote_mysql_host)); |
249 | 249 | |
250 | 250 | $mysqli = new mysqli($remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db); |
251 | 251 | |
252 | 252 | if ($mysqli->connect_error) { |
253 | - throw new Exception('Connect Error (' . $mysqli->connect_errno . ') ' |
|
253 | + throw new Exception('Connect Error ('.$mysqli->connect_errno.') ' |
|
254 | 254 | . $mysqli->connect_error); |
255 | 255 | } |
256 | 256 | |
257 | 257 | $mysqli->query("SET sql_mode='';"); |
258 | 258 | $mysqli->query("SET foreign_key_checks = 0;"); |
259 | - if(isset($_REQUEST['charset_of_file']) and $_REQUEST['charset_of_file']) |
|
259 | + if (isset($_REQUEST['charset_of_file']) and $_REQUEST['charset_of_file']) |
|
260 | 260 | $mysqli->query("SET NAMES ".$_REQUEST['charset_of_file'].""); |
261 | 261 | else |
262 | 262 | $mysqli->query("SET NAMES utf8;"); |
@@ -266,15 +266,15 @@ discard block |
||
266 | 266 | |
267 | 267 | public function restore_mysql_backup_action() |
268 | 268 | { |
269 | - $mysqldump_file = filter_input(INPUT_POST, 'mysqldump_file', FILTER_SANITIZE_STRING); |
|
270 | - $remote_path = filter_input(INPUT_POST, 'remote_path', FILTER_SANITIZE_STRING); |
|
269 | + $mysqldump_file = filter_input(INPUT_POST, 'mysqldump_file', FILTER_SANITIZE_STRING); |
|
270 | + $remote_path = filter_input(INPUT_POST, 'remote_path', FILTER_SANITIZE_STRING); |
|
271 | 271 | $remote_mysql_user = filter_input(INPUT_POST, 'remote_mysql_user', FILTER_SANITIZE_STRING); |
272 | 272 | $remote_mysql_pass = filter_input(INPUT_POST, 'remote_mysql_pass', FILTER_SANITIZE_STRING); |
273 | - $remote_mysql_db = filter_input(INPUT_POST, 'remote_mysql_db', FILTER_SANITIZE_STRING); |
|
273 | + $remote_mysql_db = filter_input(INPUT_POST, 'remote_mysql_db', FILTER_SANITIZE_STRING); |
|
274 | 274 | $remote_mysql_host = filter_input(INPUT_POST, 'remote_mysql_host', FILTER_SANITIZE_STRING); |
275 | - $execute_query = trim(stripslashes($_POST['query'])); |
|
276 | - $error_line = filter_input(INPUT_POST, 'error_line', FILTER_SANITIZE_NUMBER_INT); |
|
277 | - $start = filter_input(INPUT_POST, 'start', FILTER_SANITIZE_NUMBER_INT); |
|
275 | + $execute_query = trim(stripslashes($_POST['query'])); |
|
276 | + $error_line = filter_input(INPUT_POST, 'error_line', FILTER_SANITIZE_NUMBER_INT); |
|
277 | + $start = filter_input(INPUT_POST, 'start', FILTER_SANITIZE_NUMBER_INT); |
|
278 | 278 | |
279 | 279 | $wp_home_url = filter_input(INPUT_POST, 'wp_home_url', FILTER_SANITIZE_STRING); |
280 | 280 | $remote_restore_url = filter_input(INPUT_POST, 'remote_restore_url', FILTER_SANITIZE_STRING); |
@@ -284,8 +284,8 @@ discard block |
||
284 | 284 | |
285 | 285 | $mysql_backup_file = $remote_path.DS.$mysqldump_file; |
286 | 286 | |
287 | - if(!file_exists($mysql_backup_file)) |
|
288 | - throw new Exception(sprintf("Mysql backup file %s does not exists",$mysql_backup_file)); |
|
287 | + if (!file_exists($mysql_backup_file)) |
|
288 | + throw new Exception(sprintf("Mysql backup file %s does not exists", $mysql_backup_file)); |
|
289 | 289 | |
290 | 290 | |
291 | 291 | /*if(defined('XCLONER_PLUGIN_ACCESS') && XCLONER_PLUGIN_ACCESS) |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | }*/ |
300 | 300 | |
301 | 301 | { |
302 | - $mysqli = $this->mysql_connect($remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db ); |
|
302 | + $mysqli = $this->mysql_connect($remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | $line_count = 0; |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | $return['backup_size'] = filesize($mysql_backup_file); |
310 | 310 | |
311 | 311 | $fp = fopen($mysql_backup_file, "r"); |
312 | - if($fp) |
|
312 | + if ($fp) |
|
313 | 313 | { |
314 | 314 | $this->logger->info(sprintf("Opening mysql dump file %s at position %s.", $mysql_backup_file, $start)); |
315 | 315 | fseek($fp, $start); |
@@ -317,49 +317,49 @@ discard block |
||
317 | 317 | // process the line read. |
318 | 318 | |
319 | 319 | //check if line is comment |
320 | - if(substr($line, 0, 1) == "#") |
|
320 | + if (substr($line, 0, 1) == "#") |
|
321 | 321 | continue; |
322 | 322 | |
323 | 323 | //check if line is empty |
324 | - if($line == "\n" or trim($line) == "") |
|
324 | + if ($line == "\n" or trim($line) == "") |
|
325 | 325 | continue; |
326 | 326 | |
327 | - if(substr($line, strlen($line)-2, strlen($line)) == ";\n") |
|
327 | + if (substr($line, strlen($line) - 2, strlen($line)) == ";\n") |
|
328 | 328 | $query .= $line; |
329 | - else{ |
|
329 | + else { |
|
330 | 330 | $query .= $line; |
331 | 331 | continue; |
332 | 332 | } |
333 | 333 | |
334 | - if($execute_query) |
|
334 | + if ($execute_query) |
|
335 | 335 | { |
336 | - $query = (($execute_query)); |
|
336 | + $query = (($execute_query)); |
|
337 | 337 | $execute_query = ""; |
338 | 338 | } |
339 | 339 | |
340 | 340 | //Doing serialized url replace here |
341 | 341 | |
342 | - if($wp_site_url and $wp_home_url and strlen($wp_home_url) < strlen($wp_site_url)) |
|
342 | + if ($wp_site_url and $wp_home_url and strlen($wp_home_url) < strlen($wp_site_url)) |
|
343 | 343 | { |
344 | - list($wp_home_url,$wp_site_url) = array($wp_site_url,$wp_home_url); |
|
345 | - list($remote_restore_url,$restore_site_url) = array($restore_site_url,$remote_restore_url); |
|
344 | + list($wp_home_url, $wp_site_url) = array($wp_site_url, $wp_home_url); |
|
345 | + list($remote_restore_url, $restore_site_url) = array($restore_site_url, $remote_restore_url); |
|
346 | 346 | |
347 | 347 | } |
348 | 348 | |
349 | - if($wp_home_url and $remote_restore_url and strpos($query, $wp_home_url) !== false) |
|
349 | + if ($wp_home_url and $remote_restore_url and strpos($query, $wp_home_url) !== false) |
|
350 | 350 | { |
351 | 351 | $query = $this->url_replace($wp_home_url, $remote_restore_url, $query); |
352 | 352 | } |
353 | 353 | |
354 | - if($wp_site_url and $restore_site_url and strpos($query, $wp_site_url) !== false) |
|
354 | + if ($wp_site_url and $restore_site_url and strpos($query, $wp_site_url) !== false) |
|
355 | 355 | { |
356 | 356 | $query = $this->url_replace($wp_site_url, $restore_site_url, $query); |
357 | 357 | } |
358 | 358 | |
359 | - if(!$mysqli->query($query) && !stristr($mysqli->error,"Duplicate entry")) |
|
359 | + if (!$mysqli->query($query) && !stristr($mysqli->error, "Duplicate entry")) |
|
360 | 360 | { |
361 | 361 | //$return['error_line'] = $line_count; |
362 | - $return['start'] = ftell($fp)-strlen($line); |
|
362 | + $return['start'] = ftell($fp) - strlen($line); |
|
363 | 363 | $return['query_error'] = true; |
364 | 364 | $return['query'] = $query; |
365 | 365 | $return['message'] = sprintf("Mysql Error: %s\n", $mysqli->error); |
@@ -380,12 +380,12 @@ discard block |
||
380 | 380 | |
381 | 381 | $return['start'] = ftell($fp); |
382 | 382 | |
383 | - $this->logger->info(sprintf("Executed %s queries of size %s bytes", $line_count, ($return['start']-$start))); |
|
383 | + $this->logger->info(sprintf("Executed %s queries of size %s bytes", $line_count, ($return['start'] - $start))); |
|
384 | 384 | |
385 | - if(!feof($fp)) |
|
385 | + if (!feof($fp)) |
|
386 | 386 | { |
387 | 387 | $return['finished'] = 0; |
388 | - }else{ |
|
388 | + } else { |
|
389 | 389 | $this->logger->info(sprintf("Mysql Import Done.")); |
390 | 390 | } |
391 | 391 | |
@@ -400,12 +400,12 @@ discard block |
||
400 | 400 | $query = str_replace($search, $replace, $query); |
401 | 401 | $original_query = $query; |
402 | 402 | |
403 | - if($this->has_serialized($query)) |
|
403 | + if ($this->has_serialized($query)) |
|
404 | 404 | { |
405 | 405 | $this->logger->info(sprintf("Query contains serialized data, doing serialized size fix"), array("QUERY_REPLACE")); |
406 | 406 | $query = $this->do_serialized_fix($query); |
407 | 407 | |
408 | - if(!$query) |
|
408 | + if (!$query) |
|
409 | 409 | { |
410 | 410 | $this->logger->info(sprintf("Serialization probably failed here..."), array("QUERY_REPLACE")); |
411 | 411 | $query = $original_query; |
@@ -421,37 +421,37 @@ discard block |
||
421 | 421 | $backup_parts = array(); |
422 | 422 | |
423 | 423 | $source_backup_file = filter_input(INPUT_POST, 'file', FILTER_SANITIZE_STRING); |
424 | - $start = (int)filter_input(INPUT_POST, 'start', FILTER_SANITIZE_STRING); |
|
425 | - $return['part'] = (int)filter_input(INPUT_POST, 'part', FILTER_SANITIZE_STRING); |
|
424 | + $start = (int)filter_input(INPUT_POST, 'start', FILTER_SANITIZE_STRING); |
|
425 | + $return['part'] = (int)filter_input(INPUT_POST, 'part', FILTER_SANITIZE_STRING); |
|
426 | 426 | |
427 | 427 | $backup_file = $source_backup_file; |
428 | 428 | |
429 | - if($this->is_multipart($backup_file)) |
|
429 | + if ($this->is_multipart($backup_file)) |
|
430 | 430 | { |
431 | 431 | $backup_parts = $this->get_multipart_files($backup_file); |
432 | 432 | $backup_file = $backup_parts[$return['part']]; |
433 | 433 | } |
434 | 434 | |
435 | - try{ |
|
435 | + try { |
|
436 | 436 | $tar = new Tar(); |
437 | 437 | $tar->open($this->backup_storage_dir.DS.$backup_file, $start); |
438 | 438 | |
439 | 439 | $data = $tar->contents($this->process_files_limit_list); |
440 | - }catch(Exception $e) |
|
440 | + }catch (Exception $e) |
|
441 | 441 | { |
442 | 442 | $return['error'] = true; |
443 | 443 | $return['message'] = $e->getMessage(); |
444 | 444 | $this->send_response(200, $return); |
445 | 445 | } |
446 | 446 | |
447 | - $return['files'] = array(); |
|
448 | - $return['finished'] = 1; |
|
449 | - $return['total_size'] = filesize($this->backup_storage_dir.DS.$backup_file); |
|
447 | + $return['files'] = array(); |
|
448 | + $return['finished'] = 1; |
|
449 | + $return['total_size'] = filesize($this->backup_storage_dir.DS.$backup_file); |
|
450 | 450 | $i = 0; |
451 | 451 | |
452 | - if(isset($data['extracted_files']) and is_array($data['extracted_files'])) |
|
452 | + if (isset($data['extracted_files']) and is_array($data['extracted_files'])) |
|
453 | 453 | { |
454 | - foreach($data['extracted_files'] as $file) |
|
454 | + foreach ($data['extracted_files'] as $file) |
|
455 | 455 | { |
456 | 456 | $return['files'][$i]['path'] = $file->getPath(); |
457 | 457 | $return['files'][$i]['size'] = $file->getSize(); |
@@ -461,18 +461,18 @@ discard block |
||
461 | 461 | } |
462 | 462 | } |
463 | 463 | |
464 | - if(isset($data['start'])) |
|
464 | + if (isset($data['start'])) |
|
465 | 465 | { |
466 | 466 | $return['start'] = $data['start']; |
467 | 467 | $return['finished'] = 0; |
468 | - }else{ |
|
469 | - if($this->is_multipart($source_backup_file)) |
|
468 | + } else { |
|
469 | + if ($this->is_multipart($source_backup_file)) |
|
470 | 470 | { |
471 | 471 | $return['start'] = 0; |
472 | 472 | |
473 | 473 | ++$return['part']; |
474 | 474 | |
475 | - if($return['part'] < sizeof($backup_parts)) |
|
475 | + if ($return['part'] < sizeof($backup_parts)) |
|
476 | 476 | $return['finished'] = 0; |
477 | 477 | |
478 | 478 | } |
@@ -490,28 +490,28 @@ discard block |
||
490 | 490 | |
491 | 491 | $remote_mysql_user = filter_input(INPUT_POST, 'remote_mysql_user', FILTER_SANITIZE_STRING); |
492 | 492 | $remote_mysql_pass = filter_input(INPUT_POST, 'remote_mysql_pass', FILTER_SANITIZE_STRING); |
493 | - $remote_mysql_db = filter_input(INPUT_POST, 'remote_mysql_db', FILTER_SANITIZE_STRING); |
|
493 | + $remote_mysql_db = filter_input(INPUT_POST, 'remote_mysql_db', FILTER_SANITIZE_STRING); |
|
494 | 494 | $remote_mysql_host = filter_input(INPUT_POST, 'remote_mysql_host', FILTER_SANITIZE_STRING); |
495 | 495 | |
496 | - $update_remote_site_url = filter_input(INPUT_POST, 'update_remote_site_url', FILTER_SANITIZE_NUMBER_INT); |
|
497 | - $delete_restore_script = filter_input(INPUT_POST, 'delete_restore_script', FILTER_SANITIZE_NUMBER_INT); |
|
498 | - $delete_backup_temporary_folder = filter_input(INPUT_POST, 'delete_backup_temporary_folder', FILTER_SANITIZE_NUMBER_INT); |
|
496 | + $update_remote_site_url = filter_input(INPUT_POST, 'update_remote_site_url', FILTER_SANITIZE_NUMBER_INT); |
|
497 | + $delete_restore_script = filter_input(INPUT_POST, 'delete_restore_script', FILTER_SANITIZE_NUMBER_INT); |
|
498 | + $delete_backup_temporary_folder = filter_input(INPUT_POST, 'delete_backup_temporary_folder', FILTER_SANITIZE_NUMBER_INT); |
|
499 | 499 | |
500 | - if($update_remote_site_url) |
|
500 | + if ($update_remote_site_url) |
|
501 | 501 | { |
502 | - $mysqli = $this->mysql_connect($remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db ); |
|
502 | + $mysqli = $this->mysql_connect($remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db); |
|
503 | 503 | $this->update_wp_config($remote_path, $remote_mysql_host, $remote_mysql_user, $remote_mysql_pass, $remote_mysql_db); |
504 | 504 | $this->update_wp_url($remote_path, $remote_restore_url, $mysqli); |
505 | 505 | } |
506 | 506 | |
507 | - if($delete_backup_temporary_folder) |
|
507 | + if ($delete_backup_temporary_folder) |
|
508 | 508 | { |
509 | 509 | $this->delete_backup_temporary_folder($remote_path); |
510 | 510 | } |
511 | 511 | |
512 | - if(!defined('XCLONER_PLUGIN_ACCESS') || XCLONER_PLUGIN_ACCESS != 1) |
|
512 | + if (!defined('XCLONER_PLUGIN_ACCESS') || XCLONER_PLUGIN_ACCESS != 1) |
|
513 | 513 | { |
514 | - if($delete_restore_script) |
|
514 | + if ($delete_restore_script) |
|
515 | 515 | { |
516 | 516 | $this->delete_self(); |
517 | 517 | } |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | |
524 | 524 | private function delete_backup_temporary_folder($remote_path) |
525 | 525 | { |
526 | - $this->target_adapter = new Local($remote_path ,LOCK_EX, 'SKIP_LINKS'); |
|
526 | + $this->target_adapter = new Local($remote_path, LOCK_EX, 'SKIP_LINKS'); |
|
527 | 527 | $this->target_filesystem = new Filesystem($this->target_adapter, new Config([ |
528 | 528 | 'disable_asserts' => true, |
529 | 529 | ])); |
@@ -531,13 +531,13 @@ discard block |
||
531 | 531 | $mysqldump_list = array(); |
532 | 532 | $list = $this->target_filesystem->listContents(); |
533 | 533 | |
534 | - foreach($list as $file) |
|
534 | + foreach ($list as $file) |
|
535 | 535 | { |
536 | 536 | $matches = array(); |
537 | 537 | |
538 | - if($file['type'] == "dir") |
|
538 | + if ($file['type'] == "dir") |
|
539 | 539 | { |
540 | - if(preg_match("/xcloner-(\w*)/", $file['basename'], $matches)){ |
|
540 | + if (preg_match("/xcloner-(\w*)/", $file['basename'], $matches)) { |
|
541 | 541 | $this->logger->info(sprintf('Deleting temporary folder %s', $file['path'])); |
542 | 542 | $this->target_filesystem->deleteDir($file['path']); |
543 | 543 | } |
@@ -550,29 +550,29 @@ discard block |
||
550 | 550 | |
551 | 551 | private function delete_self() |
552 | 552 | { |
553 | - if($this->filesystem->has("vendor.phar")) |
|
553 | + if ($this->filesystem->has("vendor.phar")) |
|
554 | 554 | { |
555 | 555 | $this->logger->info(sprintf('Deleting vendor.phar')); |
556 | 556 | $this->filesystem->delete("vendor.phar"); |
557 | 557 | } |
558 | - if($this->filesystem->has("vendor")) |
|
558 | + if ($this->filesystem->has("vendor")) |
|
559 | 559 | { |
560 | 560 | $this->logger->info(sprintf('Deleting vendor folder')); |
561 | 561 | $this->filesystem->deleteDir("vendor"); |
562 | 562 | } |
563 | - if($this->filesystem->has("xcloner_restore.php")) |
|
563 | + if ($this->filesystem->has("xcloner_restore.php")) |
|
564 | 564 | { |
565 | 565 | $this->logger->info(sprintf('Deleting xcloner_restore.php')); |
566 | 566 | $this->filesystem->delete("xcloner_restore.php"); |
567 | 567 | } |
568 | 568 | |
569 | - if($this->filesystem->has("xcloner_restore.log")) |
|
569 | + if ($this->filesystem->has("xcloner_restore.log")) |
|
570 | 570 | { |
571 | 571 | $this->logger->info(sprintf('Deleting xcloner_restore.log')); |
572 | 572 | $this->filesystem->delete("xcloner_restore.log"); |
573 | 573 | } |
574 | 574 | |
575 | - if($this->filesystem->has($this->get_logger_filename())) |
|
575 | + if ($this->filesystem->has($this->get_logger_filename())) |
|
576 | 576 | { |
577 | 577 | $this->logger->info(sprintf('Deleting logger file %s', $this->get_logger_filename())); |
578 | 578 | $this->filesystem->delete($this->get_logger_filename()); |
@@ -586,11 +586,11 @@ discard block |
||
586 | 586 | |
587 | 587 | $this->logger->info(sprintf('Updating site url to %s', $url)); |
588 | 588 | |
589 | - if(file_exists($wp_config)) |
|
589 | + if (file_exists($wp_config)) |
|
590 | 590 | { |
591 | 591 | $config = file_get_contents($wp_config); |
592 | 592 | preg_match("/.*table_prefix.*=.*'(.*)'/i", $config, $matches); |
593 | - if(isset($matches[1])) |
|
593 | + if (isset($matches[1])) |
|
594 | 594 | $table_prefix = $matches[1]; |
595 | 595 | else |
596 | 596 | throw new Exception("Could not load wordpress table prefix from wp-config.php file."); |
@@ -598,10 +598,10 @@ discard block |
||
598 | 598 | else |
599 | 599 | throw new Exception("Could not update the SITEURL and HOME, wp-config.php file not found"); |
600 | 600 | |
601 | - if(!$mysqli->query("update ".$table_prefix."options set option_value='".($url)."' where option_name='home'")) |
|
601 | + if (!$mysqli->query("update ".$table_prefix."options set option_value='".($url)."' where option_name='home'")) |
|
602 | 602 | throw new Exception(sprintf("Could not update the HOME option, error: %s\n", $mysqli->error)); |
603 | 603 | |
604 | - if(!$mysqli->query("update ".$table_prefix."options set option_value='".($url)."' where option_name='siteurl'")) |
|
604 | + if (!$mysqli->query("update ".$table_prefix."options set option_value='".($url)."' where option_name='siteurl'")) |
|
605 | 605 | throw new Exception(sprintf("Could not update the SITEURL option, error: %s\n", $mysqli->error)); |
606 | 606 | |
607 | 607 | return true; |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | { |
612 | 612 | $wp_config = $remote_path.DS."wp-config.php"; |
613 | 613 | |
614 | - if(!file_exists($wp_config)) |
|
614 | + if (!file_exists($wp_config)) |
|
615 | 615 | { |
616 | 616 | throw new Exception("Could not find the wp-config.php in ".$remote_path); |
617 | 617 | } |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | |
630 | 630 | $this->logger->info(sprintf('Updating wp-config.php file with the new mysql details')); |
631 | 631 | |
632 | - if(!file_put_contents($wp_config, $content)) |
|
632 | + if (!file_put_contents($wp_config, $content)) |
|
633 | 633 | throw new Exception("Could not write updated config data to ".$wp_config); |
634 | 634 | |
635 | 635 | chmod($wp_config, $file_perms); |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | |
646 | 646 | $hash = $this->get_hash_from_backup($source_backup_file); |
647 | 647 | |
648 | - $this->target_adapter = new Local($remote_path ,LOCK_EX, 'SKIP_LINKS'); |
|
648 | + $this->target_adapter = new Local($remote_path, LOCK_EX, 'SKIP_LINKS'); |
|
649 | 649 | $this->target_filesystem = new Filesystem($this->target_adapter, new Config([ |
650 | 650 | 'disable_asserts' => true, |
651 | 651 | ])); |
@@ -653,25 +653,25 @@ discard block |
||
653 | 653 | $mysqldump_list = array(); |
654 | 654 | $list = $this->target_filesystem->listContents(); |
655 | 655 | |
656 | - foreach($list as $file) |
|
656 | + foreach ($list as $file) |
|
657 | 657 | { |
658 | 658 | $matches = array(); |
659 | 659 | |
660 | - if($file['type'] == "dir") |
|
660 | + if ($file['type'] == "dir") |
|
661 | 661 | { |
662 | - if(preg_match("/xcloner-(\w*)/", $file['basename'], $matches)) |
|
662 | + if (preg_match("/xcloner-(\w*)/", $file['basename'], $matches)) |
|
663 | 663 | { |
664 | 664 | $files = $this->target_filesystem->listContents($file['basename']); |
665 | - foreach($files as $file) |
|
665 | + foreach ($files as $file) |
|
666 | 666 | { |
667 | - if($file['extension'] == "sql") |
|
667 | + if ($file['extension'] == "sql") |
|
668 | 668 | { |
669 | 669 | $this->logger->info(sprintf('Found %s mysql backup file', $file['path'])); |
670 | 670 | $mysqldump_list[$file['path']]['path'] = $file['path']; |
671 | 671 | $mysqldump_list[$file['path']]['size'] = $file['size']; |
672 | - $mysqldump_list[$file['path']]['timestamp'] = date("d M,Y H:i",$file['timestamp']); |
|
672 | + $mysqldump_list[$file['path']]['timestamp'] = date("d M,Y H:i", $file['timestamp']); |
|
673 | 673 | |
674 | - if($hash and $hash == $matches[1]) |
|
674 | + if ($hash and $hash == $matches[1]) |
|
675 | 675 | $mysqldump_list[$file['path']]['selected'] = "selected"; |
676 | 676 | else |
677 | 677 | $mysqldump_list[$file['path']]['selected'] = ""; |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | } |
682 | 682 | } |
683 | 683 | |
684 | - $this->sort_by($mysqldump_list, 'timestamp','desc'); |
|
684 | + $this->sort_by($mysqldump_list, 'timestamp', 'desc'); |
|
685 | 685 | $return['files'] = $mysqldump_list; |
686 | 686 | |
687 | 687 | $this->send_response(200, $return); |
@@ -689,12 +689,12 @@ discard block |
||
689 | 689 | |
690 | 690 | private function get_hash_from_backup($backup_file) |
691 | 691 | { |
692 | - if(!$backup_file) |
|
692 | + if (!$backup_file) |
|
693 | 693 | return false; |
694 | 694 | |
695 | - $result = preg_match("/-(\w*)./", substr($backup_file, strlen($backup_file)-10, strlen($backup_file)), $matches) ; |
|
695 | + $result = preg_match("/-(\w*)./", substr($backup_file, strlen($backup_file) - 10, strlen($backup_file)), $matches); |
|
696 | 696 | |
697 | - if($result and isset($matches[1])) |
|
697 | + if ($result and isset($matches[1])) |
|
698 | 698 | return ($matches[1]); |
699 | 699 | |
700 | 700 | return false; |
@@ -708,18 +708,18 @@ discard block |
||
708 | 708 | $backup_files = array(); |
709 | 709 | $parents = array(); |
710 | 710 | |
711 | - foreach($list as $file_info) |
|
711 | + foreach ($list as $file_info) |
|
712 | 712 | { |
713 | 713 | $data = array(); |
714 | 714 | |
715 | - if(isset($file_info['extension']) and $file_info['extension'] == "csv") |
|
715 | + if (isset($file_info['extension']) and $file_info['extension'] == "csv") |
|
716 | 716 | { |
717 | 717 | $lines = explode(PHP_EOL, $this->filesystem->read($file_info['path'])); |
718 | - foreach($lines as $line) |
|
719 | - if($line) |
|
718 | + foreach ($lines as $line) |
|
719 | + if ($line) |
|
720 | 720 | { |
721 | 721 | $data = str_getcsv($line); |
722 | - if(is_array($data)){ |
|
722 | + if (is_array($data)) { |
|
723 | 723 | $parents[$data[0]] = $file_info['path']; |
724 | 724 | $file_info['childs'][] = $data; |
725 | 725 | $file_info['size'] += $data[2]; |
@@ -728,19 +728,19 @@ discard block |
||
728 | 728 | |
729 | 729 | } |
730 | 730 | |
731 | - if($file_info['type'] == 'file' and isset($file_info['extension']) and in_array($file_info['extension'], $this->backup_archive_extensions)) |
|
731 | + if ($file_info['type'] == 'file' and isset($file_info['extension']) and in_array($file_info['extension'], $this->backup_archive_extensions)) |
|
732 | 732 | $backup_files[$file_info['path']] = $file_info; |
733 | 733 | } |
734 | 734 | |
735 | 735 | $new_list = array(); |
736 | 736 | |
737 | - foreach($backup_files as $key=>$file_info) |
|
737 | + foreach ($backup_files as $key=>$file_info) |
|
738 | 738 | { |
739 | - if(isset($parents[$file_info['path']])) |
|
739 | + if (isset($parents[$file_info['path']])) |
|
740 | 740 | $backup_files[$key]['parent'] = $parents[$file_info['path']]; |
741 | - else{ |
|
741 | + else { |
|
742 | 742 | |
743 | - if($local_backup_file and ($file_info['basename'] == $local_backup_file)) |
|
743 | + if ($local_backup_file and ($file_info['basename'] == $local_backup_file)) |
|
744 | 744 | $file_info['selected'] = 'selected'; |
745 | 745 | |
746 | 746 | $this->logger->info(sprintf('Found %s backup file', $file_info['path'])); |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | |
751 | 751 | } |
752 | 752 | |
753 | - $this->sort_by($new_list, "timestamp","desc"); |
|
753 | + $this->sort_by($new_list, "timestamp", "desc"); |
|
754 | 754 | |
755 | 755 | $return['files'] = $new_list; |
756 | 756 | |
@@ -760,15 +760,15 @@ discard block |
||
760 | 760 | |
761 | 761 | public function restore_backup_to_path_action() |
762 | 762 | { |
763 | - $source_backup_file = filter_input(INPUT_POST, 'backup_file', FILTER_SANITIZE_STRING); |
|
764 | - $remote_path = filter_input(INPUT_POST, 'remote_path', FILTER_SANITIZE_STRING); |
|
763 | + $source_backup_file = filter_input(INPUT_POST, 'backup_file', FILTER_SANITIZE_STRING); |
|
764 | + $remote_path = filter_input(INPUT_POST, 'remote_path', FILTER_SANITIZE_STRING); |
|
765 | 765 | $include_filter_files = filter_input(INPUT_POST, 'filter_files', FILTER_SANITIZE_STRING); |
766 | 766 | $exclude_filter_files = ""; |
767 | - $start = filter_input(INPUT_POST, 'start', FILTER_SANITIZE_NUMBER_INT); |
|
768 | - $return['part'] = (int)filter_input(INPUT_POST, 'part', FILTER_SANITIZE_NUMBER_INT); |
|
767 | + $start = filter_input(INPUT_POST, 'start', FILTER_SANITIZE_NUMBER_INT); |
|
768 | + $return['part'] = (int)filter_input(INPUT_POST, 'part', FILTER_SANITIZE_NUMBER_INT); |
|
769 | 769 | $return['processed'] = (int)filter_input(INPUT_POST, 'processed', FILTER_SANITIZE_NUMBER_INT); |
770 | 770 | |
771 | - $this->target_adapter = new Local($remote_path ,LOCK_EX, 'SKIP_LINKS'); |
|
771 | + $this->target_adapter = new Local($remote_path, LOCK_EX, 'SKIP_LINKS'); |
|
772 | 772 | $this->target_filesystem = new Filesystem($this->target_adapter, new Config([ |
773 | 773 | 'disable_asserts' => true, |
774 | 774 | ])); |
@@ -780,9 +780,9 @@ discard block |
||
780 | 780 | $return['total_size'] = $this->get_backup_size($backup_file); |
781 | 781 | |
782 | 782 | $backup_archive = new Tar(); |
783 | - if($this->is_multipart($backup_file)) |
|
783 | + if ($this->is_multipart($backup_file)) |
|
784 | 784 | { |
785 | - if(!$return['part']) |
|
785 | + if (!$return['part']) |
|
786 | 786 | $return['processed'] += $this->filesystem->getSize($backup_file); |
787 | 787 | |
788 | 788 | $backup_parts = $this->get_multipart_files($backup_file); |
@@ -790,41 +790,41 @@ discard block |
||
790 | 790 | } |
791 | 791 | |
792 | 792 | $this->logger->info(sprintf('Opening backup archive %s at position %s', $backup_file, $start)); |
793 | - $backup_archive->open($this->backup_storage_dir .DS. $backup_file, $start); |
|
793 | + $backup_archive->open($this->backup_storage_dir.DS.$backup_file, $start); |
|
794 | 794 | |
795 | - $data = $backup_archive->extract($remote_path, '',$exclude_filter_files,$include_filter_files, $this->process_files_limit); |
|
795 | + $data = $backup_archive->extract($remote_path, '', $exclude_filter_files, $include_filter_files, $this->process_files_limit); |
|
796 | 796 | |
797 | - if(isset($data['extracted_files'])) |
|
797 | + if (isset($data['extracted_files'])) |
|
798 | 798 | { |
799 | - foreach($data['extracted_files'] as $spl_fileinfo) |
|
799 | + foreach ($data['extracted_files'] as $spl_fileinfo) |
|
800 | 800 | { |
801 | 801 | $this->logger->info(sprintf('Extracted %s file', $spl_fileinfo->getPath())); |
802 | 802 | $return['extracted_files'][] = $spl_fileinfo->getPath()." (".$spl_fileinfo->getSize()." bytes)"; |
803 | 803 | } |
804 | 804 | } |
805 | 805 | |
806 | - if(isset($data['start'])) |
|
806 | + if (isset($data['start'])) |
|
807 | 807 | //if(isset($data['start']) and $data['start'] <= $this->filesystem->getSize($backup_file)) |
808 | 808 | { |
809 | 809 | $return['finished'] = 0; |
810 | 810 | $return['start'] = $data['start']; |
811 | - }else{ |
|
811 | + } else { |
|
812 | 812 | |
813 | 813 | $return['processed'] += $start; |
814 | 814 | |
815 | - if($this->is_multipart($source_backup_file)) |
|
815 | + if ($this->is_multipart($source_backup_file)) |
|
816 | 816 | { |
817 | 817 | $return['start'] = 0; |
818 | 818 | |
819 | 819 | ++$return['part']; |
820 | 820 | |
821 | - if($return['part'] < sizeof($backup_parts)) |
|
821 | + if ($return['part'] < sizeof($backup_parts)) |
|
822 | 822 | $return['finished'] = 0; |
823 | 823 | |
824 | 824 | } |
825 | 825 | } |
826 | 826 | |
827 | - if($return['finished']) |
|
827 | + if ($return['finished']) |
|
828 | 828 | $this->logger->info(sprintf('Done extracting %s', $source_backup_file)); |
829 | 829 | |
830 | 830 | $return['backup_file'] = $backup_file; |
@@ -838,24 +838,24 @@ discard block |
||
838 | 838 | |
839 | 839 | $restore_script_url = filter_input(INPUT_POST, 'restore_script_url', FILTER_SANITIZE_STRING); |
840 | 840 | |
841 | - $pathinfo = pathinfo( __FILE__); |
|
841 | + $pathinfo = pathinfo(__FILE__); |
|
842 | 842 | |
843 | 843 | $suffix = ""; |
844 | 844 | $return['remote_mysql_host'] = "localhost"; |
845 | 845 | $return['remote_mysql_user'] = ""; |
846 | 846 | $return['remote_mysql_pass'] = ""; |
847 | - $return['remote_mysql_db'] = ""; |
|
847 | + $return['remote_mysql_db'] = ""; |
|
848 | 848 | |
849 | - if(defined('XCLONER_PLUGIN_ACCESS') && XCLONER_PLUGIN_ACCESS) |
|
849 | + if (defined('XCLONER_PLUGIN_ACCESS') && XCLONER_PLUGIN_ACCESS) |
|
850 | 850 | { |
851 | 851 | $return['dir'] = realpath(get_home_path().DS.$suffix); |
852 | - $return['restore_script_url'] = get_site_url(); |
|
852 | + $return['restore_script_url'] = get_site_url(); |
|
853 | 853 | $return['remote_mysql_host'] = $wpdb->dbhost; |
854 | 854 | $return['remote_mysql_user'] = $wpdb->dbuser; |
855 | 855 | $return['remote_mysql_pass'] = $wpdb->dbpassword; |
856 | - $return['remote_mysql_db'] = $wpdb->dbname; |
|
856 | + $return['remote_mysql_db'] = $wpdb->dbname; |
|
857 | 857 | } |
858 | - else{ |
|
858 | + else { |
|
859 | 859 | $return['dir'] = ($pathinfo['dirname']).DS.$suffix; |
860 | 860 | $return['restore_script_url'] = str_replace($pathinfo['basename'], "", $restore_script_url).$suffix; |
861 | 861 | } |
@@ -869,17 +869,17 @@ discard block |
||
869 | 869 | { |
870 | 870 | //check if i can write |
871 | 871 | $tmp_file = md5(time()); |
872 | - if(!file_put_contents($tmp_file, "++")) |
|
872 | + if (!file_put_contents($tmp_file, "++")) |
|
873 | 873 | throw new Exception("Could not write to new host"); |
874 | 874 | |
875 | - if(!unlink($tmp_file)) |
|
875 | + if (!unlink($tmp_file)) |
|
876 | 876 | throw new Exception("Could not delete temporary file from new host"); |
877 | 877 | |
878 | 878 | $max_upload = $this->return_bytes((ini_get('upload_max_filesize'))); |
879 | 879 | $max_post = $this->return_bytes((ini_get('post_max_size'))); |
880 | 880 | |
881 | 881 | $return['max_upload_size'] = min($max_upload, $max_post); // bytes |
882 | - $return['status'] = true; |
|
882 | + $return['status'] = true; |
|
883 | 883 | |
884 | 884 | $this->logger->info(sprintf('Current filesystem max upload size is %s bytes', $return['max_upload_size'])); |
885 | 885 | |
@@ -888,8 +888,8 @@ discard block |
||
888 | 888 | |
889 | 889 | private function return_bytes($val) { |
890 | 890 | $val = trim($val); |
891 | - $last = strtolower($val[strlen($val)-1]); |
|
892 | - switch($last) { |
|
891 | + $last = strtolower($val[strlen($val) - 1]); |
|
892 | + switch ($last) { |
|
893 | 893 | // The 'G' modifier is available since PHP 5.1.0 |
894 | 894 | case 'g': |
895 | 895 | $val *= 1024; |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | |
905 | 905 | public function is_multipart($backup_name) |
906 | 906 | { |
907 | - if(stristr($backup_name, "-multipart")) |
|
907 | + if (stristr($backup_name, "-multipart")) |
|
908 | 908 | return true; |
909 | 909 | |
910 | 910 | return false; |
@@ -913,10 +913,10 @@ discard block |
||
913 | 913 | public function get_backup_size($backup_name) |
914 | 914 | { |
915 | 915 | $backup_size = $this->filesystem->getSize($backup_name); |
916 | - if($this->is_multipart($backup_name)) |
|
916 | + if ($this->is_multipart($backup_name)) |
|
917 | 917 | { |
918 | 918 | $backup_parts = $this->get_multipart_files($backup_name); |
919 | - foreach($backup_parts as $part_file) |
|
919 | + foreach ($backup_parts as $part_file) |
|
920 | 920 | $backup_size += $this->filesystem->getSize($part_file); |
921 | 921 | } |
922 | 922 | |
@@ -927,12 +927,12 @@ discard block |
||
927 | 927 | { |
928 | 928 | $files = array(); |
929 | 929 | |
930 | - if($this->is_multipart($backup_name)) |
|
930 | + if ($this->is_multipart($backup_name)) |
|
931 | 931 | { |
932 | 932 | $lines = explode(PHP_EOL, $this->filesystem->read($backup_name)); |
933 | - foreach($lines as $line) |
|
933 | + foreach ($lines as $line) |
|
934 | 934 | { |
935 | - if($line) |
|
935 | + if ($line) |
|
936 | 936 | { |
937 | 937 | $data = str_getcsv($line); |
938 | 938 | $files[] = $data[0]; |
@@ -943,20 +943,20 @@ discard block |
||
943 | 943 | return $files; |
944 | 944 | } |
945 | 945 | |
946 | - private function sort_by( &$array, $field, $direction = 'asc') |
|
946 | + private function sort_by(&$array, $field, $direction = 'asc') |
|
947 | 947 | { |
948 | 948 | $direction = strtolower($direction); |
949 | 949 | |
950 | 950 | usort($array, create_function('$a, $b', ' |
951 | - $a = $a["' . $field . '"]; |
|
952 | - $b = $b["' . $field . '"]; |
|
951 | + $a = $a["' . $field.'"]; |
|
952 | + $b = $b["' . $field.'"]; |
|
953 | 953 | |
954 | 954 | if ($a == $b) |
955 | 955 | { |
956 | 956 | return 0; |
957 | 957 | } |
958 | 958 | |
959 | - return ($a ' . ($direction == 'desc' ? '>' : '<') .' $b) ? -1 : 1; |
|
959 | + return ($a ' . ($direction == 'desc' ? '>' : '<').' $b) ? -1 : 1; |
|
960 | 960 | ')); |
961 | 961 | |
962 | 962 | return true; |
@@ -970,11 +970,11 @@ discard block |
||
970 | 970 | $return['status'] = $status; |
971 | 971 | $return['statusText'] = $response; |
972 | 972 | |
973 | - if(isset($response['error']) && $response['error']) |
|
973 | + if (isset($response['error']) && $response['error']) |
|
974 | 974 | { |
975 | 975 | $return['statusText'] = $response['message']; |
976 | 976 | $return['error'] = true; |
977 | - }elseif($status != 200 and $status != 418) |
|
977 | + }elseif ($status != 200 and $status != 418) |
|
978 | 978 | { |
979 | 979 | $return['error'] = true; |
980 | 980 | $return['message'] = $response; |
@@ -990,12 +990,12 @@ discard block |
||
990 | 990 | |
991 | 991 | function do_serialized_fix($query) |
992 | 992 | { |
993 | - $query = str_replace(array("\\n","\\r","\\'"), array("","","\""), ($query)); |
|
993 | + $query = str_replace(array("\\n", "\\r", "\\'"), array("", "", "\""), ($query)); |
|
994 | 994 | |
995 | - return preg_replace_callback('!s:(\d+):([\\\\]?"[\\\\]?"|[\\\\]?"((.*?)[^\\\\])[\\\\]?");!', function ($m) { |
|
995 | + return preg_replace_callback('!s:(\d+):([\\\\]?"[\\\\]?"|[\\\\]?"((.*?)[^\\\\])[\\\\]?");!', function($m) { |
|
996 | 996 | $data = ""; |
997 | 997 | |
998 | - if(!isset($m[3])) |
|
998 | + if (!isset($m[3])) |
|
999 | 999 | $m[3] = ""; |
1000 | 1000 | |
1001 | 1001 | $data = 's:'.strlen(($m[3])).':\"'.($m[3]).'\";'; |
@@ -1010,22 +1010,22 @@ discard block |
||
1010 | 1010 | } |
1011 | 1011 | |
1012 | 1012 | private function unescape_mysql($value) { |
1013 | - return str_replace(array("\\\\", "\\0", "\\n", "\\r", "\Z", "\'", '\"'), |
|
1014 | - array("\\", "\0", "\n", "\r", "\x1a", "'", '"'), |
|
1013 | + return str_replace(array("\\\\", "\\0", "\\n", "\\r", "\Z", "\'", '\"'), |
|
1014 | + array("\\", "\0", "\n", "\r", "\x1a", "'", '"'), |
|
1015 | 1015 | $value); |
1016 | 1016 | } |
1017 | 1017 | |
1018 | 1018 | |
1019 | 1019 | private function has_serialized($s) |
1020 | 1020 | { |
1021 | - if( |
|
1022 | - stristr($s, '{' ) != false && |
|
1023 | - stristr($s, '}' ) != false && |
|
1024 | - stristr($s, ';' ) != false && |
|
1025 | - stristr($s, ':' ) != false |
|
1026 | - ){ |
|
1021 | + if ( |
|
1022 | + stristr($s, '{') != false && |
|
1023 | + stristr($s, '}') != false && |
|
1024 | + stristr($s, ';') != false && |
|
1025 | + stristr($s, ':') != false |
|
1026 | + ) { |
|
1027 | 1027 | return true; |
1028 | - }else{ |
|
1028 | + } else { |
|
1029 | 1029 | return false; |
1030 | 1030 | } |
1031 | 1031 |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | */ |
22 | 22 | |
23 | 23 | |
24 | -class Xcloner_Database extends wpdb{ |
|
24 | +class Xcloner_Database extends wpdb { |
|
25 | 25 | |
26 | 26 | |
27 | - public $debug = 0; |
|
28 | - public $recordsPerSession = 10000; |
|
29 | - public $dbCompatibility = ""; |
|
27 | + public $debug = 0; |
|
28 | + public $recordsPerSession = 10000; |
|
29 | + public $dbCompatibility = ""; |
|
30 | 30 | public $dbDropSyntax = 1; |
31 | 31 | public $countRecords = 0; |
32 | 32 | |
@@ -38,24 +38,24 @@ discard block |
||
38 | 38 | private $TEMP_DBPROCESS_FILE = ".database"; |
39 | 39 | private $TEMP_DUMP_FILE = "database-backup.sql"; |
40 | 40 | |
41 | - public function __construct(Xcloner $xcloner_container, $wp_user="", $wp_pass="", $wp_db="", $wp_host="") |
|
41 | + public function __construct(Xcloner $xcloner_container, $wp_user = "", $wp_pass = "", $wp_db = "", $wp_host = "") |
|
42 | 42 | { |
43 | - $this->logger = $xcloner_container->get_xcloner_logger()->withName("xcloner_database"); |
|
44 | - $this->xcloner_settings = $xcloner_container->get_xcloner_settings(); |
|
45 | - $this->fs = $xcloner_container->get_xcloner_filesystem(); |
|
43 | + $this->logger = $xcloner_container->get_xcloner_logger()->withName("xcloner_database"); |
|
44 | + $this->xcloner_settings = $xcloner_container->get_xcloner_settings(); |
|
45 | + $this->fs = $xcloner_container->get_xcloner_filesystem(); |
|
46 | 46 | |
47 | - if($this->xcloner_settings->get_xcloner_option('xcloner_database_records_per_request')) |
|
48 | - $this->recordsPerSession = $this->xcloner_settings->get_xcloner_option('xcloner_database_records_per_request'); |
|
47 | + if ($this->xcloner_settings->get_xcloner_option('xcloner_database_records_per_request')) |
|
48 | + $this->recordsPerSession = $this->xcloner_settings->get_xcloner_option('xcloner_database_records_per_request'); |
|
49 | 49 | |
50 | - if(!$this->recordsPerSession) |
|
50 | + if (!$this->recordsPerSession) |
|
51 | 51 | $this->recordsPerSession = 100; |
52 | 52 | |
53 | - if(!$wp_user && !$wp_pass && !$wp_host && !$wp_db ) |
|
53 | + if (!$wp_user && !$wp_pass && !$wp_host && !$wp_db) |
|
54 | 54 | { |
55 | 55 | $wp_host = $this->xcloner_settings->get_db_hostname(); |
56 | 56 | $wp_user = $this->xcloner_settings->get_db_username(); |
57 | 57 | $wp_pass = $this->xcloner_settings->get_db_password(); |
58 | - $wp_db = $this->xcloner_settings->get_db_database(); |
|
58 | + $wp_db = $this->xcloner_settings->get_db_database(); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | parent::__construct($wp_user, $wp_pass, $wp_db, $wp_host); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function init($data, $start = 0) |
73 | 73 | { |
74 | - if($start and $this->fs->get_tmp_filesystem()->has($this->TEMP_DBPROCESS_FILE)){ |
|
74 | + if ($start and $this->fs->get_tmp_filesystem()->has($this->TEMP_DBPROCESS_FILE)) { |
|
75 | 75 | $this->fs->get_tmp_filesystem()->delete($this->TEMP_DBPROCESS_FILE); |
76 | 76 | } |
77 | 77 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | "database_count"=>0, |
91 | 91 | ); |
92 | 92 | |
93 | - if(!$this->xcloner_settings->get_enable_mysql_backup()) |
|
93 | + if (!$this->xcloner_settings->get_enable_mysql_backup()) |
|
94 | 94 | { |
95 | 95 | $return['finished'] = 1; |
96 | 96 | return $return; |
@@ -100,44 +100,44 @@ discard block |
||
100 | 100 | |
101 | 101 | $this->init($params, $init); |
102 | 102 | |
103 | - if($init) |
|
103 | + if ($init) |
|
104 | 104 | { |
105 | 105 | $db_count = 0; |
106 | 106 | |
107 | - if(isset($params['#'])) |
|
107 | + if (isset($params['#'])) |
|
108 | 108 | { |
109 | - foreach($params['#'] as $database) |
|
109 | + foreach ($params['#'] as $database) |
|
110 | 110 | { |
111 | - if(!isset($params[$database]) or !is_array($params[$database])) |
|
111 | + if (!isset($params[$database]) or !is_array($params[$database])) |
|
112 | 112 | $params[$database] = array(); |
113 | 113 | } |
114 | 114 | $db_count = -1; |
115 | 115 | } |
116 | 116 | |
117 | - if(isset($params) and is_array($params)) |
|
118 | - foreach($params as $database=>$tables) |
|
117 | + if (isset($params) and is_array($params)) |
|
118 | + foreach ($params as $database=>$tables) |
|
119 | 119 | { |
120 | - if($database != "#") |
|
120 | + if ($database != "#") |
|
121 | 121 | { |
122 | 122 | $stats = $this->write_backup_process_list($database, $tables); |
123 | - $return['stats']['tables_count'] += $stats['tables_count']; |
|
124 | - $return['stats']['total_records'] += $stats['total_records']; |
|
123 | + $return['stats']['tables_count'] += $stats['tables_count']; |
|
124 | + $return['stats']['total_records'] += $stats['total_records']; |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | |
128 | - if(sizeof($params)) |
|
129 | - $return['stats']['database_count'] = sizeof($params)+$db_count; |
|
128 | + if (sizeof($params)) |
|
129 | + $return['stats']['database_count'] = sizeof($params) + $db_count; |
|
130 | 130 | else |
131 | 131 | $return['stats']['database_count'] = 0; |
132 | 132 | |
133 | 133 | return $return; |
134 | 134 | } |
135 | 135 | |
136 | - if(!isset($extra_params['startAtLine'])) |
|
136 | + if (!isset($extra_params['startAtLine'])) |
|
137 | 137 | $extra_params['startAtLine'] = 0; |
138 | - if(!isset($extra_params['startAtRecord'])) |
|
138 | + if (!isset($extra_params['startAtRecord'])) |
|
139 | 139 | $extra_params['startAtRecord'] = 0; |
140 | - if(!isset($extra_params['dumpfile'])) |
|
140 | + if (!isset($extra_params['dumpfile'])) |
|
141 | 141 | $extra_params['dumpfile'] = ""; |
142 | 142 | |
143 | 143 | $return = $this->process_incremental($extra_params['startAtLine'], $extra_params['startAtRecord'], $extra_params['dumpfile']); |
@@ -148,13 +148,13 @@ discard block |
||
148 | 148 | public function log($message = "") |
149 | 149 | { |
150 | 150 | |
151 | - if($message){ |
|
152 | - $this->logger->info( $message, array("")); |
|
153 | - }else{ |
|
154 | - if($this->last_query) |
|
155 | - $this->logger->debug( $this->last_query, array("")); |
|
156 | - if($this->last_error) |
|
157 | - $this->logger->error( $this->last_error, array("")); |
|
151 | + if ($message) { |
|
152 | + $this->logger->info($message, array("")); |
|
153 | + } else { |
|
154 | + if ($this->last_query) |
|
155 | + $this->logger->debug($this->last_query, array("")); |
|
156 | + if ($this->last_error) |
|
157 | + $this->logger->error($this->last_error, array("")); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | return; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | */ |
170 | 170 | public function error($message) |
171 | 171 | { |
172 | - $this->logger->error( $message, array("")); |
|
172 | + $this->logger->error($message, array("")); |
|
173 | 173 | |
174 | 174 | return; |
175 | 175 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | $query = "show tables in `".$database."`"; |
204 | 204 | |
205 | - $res = $this->get_results($query); |
|
205 | + $res = $this->get_results($query); |
|
206 | 206 | $this->log(); |
207 | 207 | |
208 | 208 | return count($res); |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | $databases_list[$i]['num_tables'] = $this->get_database_num_tables($this->dbname); |
226 | 226 | $i++; |
227 | 227 | |
228 | - if(is_array($databases)) |
|
229 | - foreach( $databases as $db){ |
|
230 | - if($db->Database != $this->dbname) |
|
228 | + if (is_array($databases)) |
|
229 | + foreach ($databases as $db) { |
|
230 | + if ($db->Database != $this->dbname) |
|
231 | 231 | { |
232 | 232 | $databases_list[$i]['name'] = $db->Database; |
233 | 233 | $databases_list[$i]['num_tables'] = $this->get_database_num_tables($db->Database); |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $tablesList[0] = array( ); |
253 | 253 | $inc = 0; |
254 | 254 | |
255 | - if(!$database) |
|
255 | + if (!$database) |
|
256 | 256 | $database = $this->dbname; |
257 | 257 | |
258 | 258 | $this->logger->debug(sprintf(("Listing tables in %s database"), $database)); |
@@ -260,14 +260,14 @@ discard block |
||
260 | 260 | $tables = $this->get_results("SHOW TABLES in `".$database."`"); |
261 | 261 | $this->log(); |
262 | 262 | |
263 | - foreach ($tables as $table){ |
|
263 | + foreach ($tables as $table) { |
|
264 | 264 | |
265 | 265 | $table = array_values((array)$table)[0]; |
266 | 266 | |
267 | 267 | $tablesList[$inc]['name'] = $table; |
268 | 268 | $tablesList[$inc]['database'] = $database; |
269 | 269 | |
270 | - if($get_num_records) |
|
270 | + if ($get_num_records) |
|
271 | 271 | { |
272 | 272 | $records_num_result = $this->get_var("SELECT count(*) FROM `".$database."`.`".$table."`"); |
273 | 273 | $this->log(); |
@@ -277,8 +277,8 @@ discard block |
||
277 | 277 | |
278 | 278 | $tablesList[$inc]['excluded'] = 0; |
279 | 279 | |
280 | - if(sizeof($included) and is_array($included)) |
|
281 | - if(!in_array($table, $included) ) |
|
280 | + if (sizeof($included) and is_array($included)) |
|
281 | + if (!in_array($table, $included)) |
|
282 | 282 | { |
283 | 283 | $tablesList[$inc]['excluded'] = 1; |
284 | 284 | $this->log(sprintf(__("Excluding table %s.%s from backup"), $table, $database)); |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | |
300 | 300 | $tables = $this->list_tables($dbname, $incl_tables, 1); |
301 | 301 | |
302 | - if($this->dbname != $dbname) |
|
302 | + if ($this->dbname != $dbname) |
|
303 | 303 | $dumpfile = $dbname."-backup.sql"; |
304 | 304 | else |
305 | 305 | $dumpfile = $this->TEMP_DUMP_FILE; |
@@ -308,8 +308,8 @@ discard block |
||
308 | 308 | $this->fs->get_tmp_filesystem_append()->write($this->TEMP_DBPROCESS_FILE, $line); |
309 | 309 | |
310 | 310 | // write this to the class and write to $TEMP_DBPROCESS_FILE file as database.table records |
311 | - foreach($tables as $key=>$table) |
|
312 | - if($table!= "" and !$tables[$key]['excluded']){ |
|
311 | + foreach ($tables as $key=>$table) |
|
312 | + if ($table != "" and !$tables[$key]['excluded']) { |
|
313 | 313 | |
314 | 314 | $line = sprintf("`%s`.`%s`\t%s\t%s\n", $dbname, $tables[$key]['name'], $tables[$key]['records'], $tables[$key]['excluded']); |
315 | 315 | $this->fs->get_tmp_filesystem_append()->write($this->TEMP_DBPROCESS_FILE, $line); |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | |
338 | 338 | $result = $this->get_var("SELECT count(*) FROM $table;"); |
339 | 339 | |
340 | - return intval($result) ;// not max limit on 32 bit systems 2147483647; on 64 bit 999999999999 |
|
340 | + return intval($result); // not max limit on 32 bit systems 2147483647; on 64 bit 999999999999 |
|
341 | 341 | |
342 | 342 | } |
343 | 343 | |
@@ -353,25 +353,25 @@ discard block |
||
353 | 353 | * int $dbDropSyntax - check if the DROP TABLE syntax should be added |
354 | 354 | * @return array $return |
355 | 355 | */ |
356 | - public function process_incremental($startAtLine= 0, $startAtRecord = 0, $dumpfile = "", $dbCompatibility= ""){ |
|
356 | + public function process_incremental($startAtLine = 0, $startAtRecord = 0, $dumpfile = "", $dbCompatibility = "") { |
|
357 | 357 | |
358 | 358 | $count = 0; |
359 | 359 | $return['finished'] = 0; |
360 | 360 | $lines = array(); |
361 | 361 | |
362 | - if($this->fs->get_tmp_filesystem()->has($this->TEMP_DBPROCESS_FILE)) |
|
363 | - $lines = array_filter(explode("\n",$this->fs->get_tmp_filesystem()->read($this->TEMP_DBPROCESS_FILE))); |
|
362 | + if ($this->fs->get_tmp_filesystem()->has($this->TEMP_DBPROCESS_FILE)) |
|
363 | + $lines = array_filter(explode("\n", $this->fs->get_tmp_filesystem()->read($this->TEMP_DBPROCESS_FILE))); |
|
364 | 364 | |
365 | - foreach ($lines as $buffer){ |
|
365 | + foreach ($lines as $buffer) { |
|
366 | 366 | |
367 | - if($count == $startAtLine) |
|
367 | + if ($count == $startAtLine) |
|
368 | 368 | { |
369 | 369 | |
370 | - $tableInfo =explode("\t", $buffer); |
|
370 | + $tableInfo = explode("\t", $buffer); |
|
371 | 371 | |
372 | - if($tableInfo[0] == "###newdump###"){ |
|
372 | + if ($tableInfo[0] == "###newdump###") { |
|
373 | 373 | // we create a new mysql dump file |
374 | - if($dumpfile != ""){ |
|
374 | + if ($dumpfile != "") { |
|
375 | 375 | // we finished a previous one and write the footers |
376 | 376 | $return['dumpsize'] = $this->data_footers($dumpfile); |
377 | 377 | } |
@@ -385,13 +385,13 @@ discard block |
||
385 | 385 | $startAtLine++; |
386 | 386 | $return['new_dump'] = 1; |
387 | 387 | //break; |
388 | - }else{ |
|
388 | + } else { |
|
389 | 389 | //we export the table |
390 | - if($tableInfo[0] == "###enddump###") |
|
390 | + if ($tableInfo[0] == "###enddump###") |
|
391 | 391 | $return['endDump'] = 1; |
392 | 392 | |
393 | 393 | //table is excluded |
394 | - if($tableInfo[2]) |
|
394 | + if ($tableInfo[2]) |
|
395 | 395 | continue; |
396 | 396 | |
397 | 397 | $next = $startAtRecord + $this->recordsPerSession; |
@@ -403,28 +403,28 @@ discard block |
||
403 | 403 | |
404 | 404 | //return something to the browser |
405 | 405 | $return['databaseName'] = $databaseName; |
406 | - $return['tableName'] = $tableName; |
|
406 | + $return['tableName'] = $tableName; |
|
407 | 407 | $return['totalRecords'] = $tableInfo[1]; |
408 | 408 | |
409 | 409 | $processed_records = 0; |
410 | 410 | |
411 | - if(trim($tableName) !="" and !$tableInfo[2]) |
|
411 | + if (trim($tableName) != "" and !$tableInfo[2]) |
|
412 | 412 | $processed_records = $this->export_table($databaseName, $tableName, $startAtRecord, $this->recordsPerSession, $dumpfile); |
413 | 413 | |
414 | - $return['processedRecords'] = $startAtRecord+$processed_records; |
|
414 | + $return['processedRecords'] = $startAtRecord + $processed_records; |
|
415 | 415 | |
416 | - if($next >= $tableInfo[1]) //we finished loading the records for next sessions, will go to the new record |
|
416 | + if ($next >= $tableInfo[1]) //we finished loading the records for next sessions, will go to the new record |
|
417 | 417 | { |
418 | - $startAtLine ++; |
|
418 | + $startAtLine++; |
|
419 | 419 | $startAtRecord = 0; |
420 | - }else{ |
|
420 | + } else { |
|
421 | 421 | $startAtRecord = $startAtRecord + $this->recordsPerSession; |
422 | 422 | } |
423 | 423 | |
424 | 424 | //$return['dbCompatibility'] = self::$dbCompatibility; |
425 | 425 | |
426 | - $return['startAtLine'] = $startAtLine; |
|
427 | - $return['startAtRecord'] = $startAtRecord; |
|
426 | + $return['startAtLine'] = $startAtLine; |
|
427 | + $return['startAtRecord'] = $startAtRecord; |
|
428 | 428 | $return['dumpfile'] = $dumpfile; |
429 | 429 | $return['dumpsize'] = $this->fs->get_tmp_filesystem_append()->getSize($dumpfile); |
430 | 430 | |
@@ -442,15 +442,15 @@ discard block |
||
442 | 442 | } |
443 | 443 | |
444 | 444 | //while is finished, lets go home... |
445 | - if($dumpfile != ""){ |
|
445 | + if ($dumpfile != "") { |
|
446 | 446 | // we finished a previous one and write the footers |
447 | 447 | $return['dumpsize'] = $this->data_footers($dumpfile); |
448 | 448 | $return['dumpfile'] = ($dumpfile); |
449 | 449 | } |
450 | 450 | $return['finished'] = 1; |
451 | - $return['startAtLine'] = $startAtLine; |
|
451 | + $return['startAtLine'] = $startAtLine; |
|
452 | 452 | |
453 | - if($this->fs->get_tmp_filesystem()->has($this->TEMP_DBPROCESS_FILE)) |
|
453 | + if ($this->fs->get_tmp_filesystem()->has($this->TEMP_DBPROCESS_FILE)) |
|
454 | 454 | $this->fs->get_tmp_filesystem()->delete($this->TEMP_DBPROCESS_FILE); |
455 | 455 | |
456 | 456 | $this->logger->debug(sprintf(("Database backup finished!"))); |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | |
480 | 480 | $records = 0; |
481 | 481 | |
482 | - if($start == 0) |
|
482 | + if ($start == 0) |
|
483 | 483 | $this->dump_structure($databaseName, $tableName, $dumpfile); |
484 | 484 | |
485 | 485 | $start = intval($start); |
@@ -487,20 +487,20 @@ discard block |
||
487 | 487 | //exporting the table content now |
488 | 488 | |
489 | 489 | $query = "SELECT * from `$databaseName`.`$tableName` Limit $start, $limit ;"; |
490 | - if($this->use_mysqli) |
|
490 | + if ($this->use_mysqli) |
|
491 | 491 | { |
492 | 492 | $result = mysqli_query($this->dbh, $query); |
493 | 493 | $mysql_fetch_function = "mysqli_fetch_array"; |
494 | 494 | |
495 | - }else{ |
|
495 | + } else { |
|
496 | 496 | $result = mysql_query($query, $this->dbh); |
497 | 497 | $mysql_fetch_function = "mysqli_fetch_array"; |
498 | 498 | } |
499 | 499 | //$result = $this->get_results($query, ARRAY_N); |
500 | 500 | //print_r($result); exit; |
501 | 501 | |
502 | - if($result){ |
|
503 | - while($row = $mysql_fetch_function($result, MYSQLI_ASSOC)){ |
|
502 | + if ($result) { |
|
503 | + while ($row = $mysql_fetch_function($result, MYSQLI_ASSOC)) { |
|
504 | 504 | |
505 | 505 | $this->fs->get_tmp_filesystem_append()->write($dumpfile, "INSERT INTO `$tableName` VALUES ("); |
506 | 506 | $arr = $row; |
@@ -510,13 +510,13 @@ discard block |
||
510 | 510 | foreach ($arr as $key => $value) { |
511 | 511 | $value = $this->_real_escape($value); |
512 | 512 | |
513 | - if(method_exists($this, 'remove_placeholder_escape')){ |
|
513 | + if (method_exists($this, 'remove_placeholder_escape')) { |
|
514 | 514 | $value = $this->remove_placeholder_escape($value); |
515 | 515 | } |
516 | 516 | |
517 | 517 | $buffer .= "'".$value."', "; |
518 | 518 | } |
519 | - $buffer = rtrim($buffer, ', ') . ");\n"; |
|
519 | + $buffer = rtrim($buffer, ', ').");\n"; |
|
520 | 520 | $this->fs->get_tmp_filesystem_append()->write($dumpfile, $buffer); |
521 | 521 | unset($buffer); |
522 | 522 | |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | |
532 | 532 | } |
533 | 533 | |
534 | - public function dump_structure($databaseName, $tableName ,$dumpfile) |
|
534 | + public function dump_structure($databaseName, $tableName, $dumpfile) |
|
535 | 535 | { |
536 | 536 | $this->log(sprintf(__("Dumping the structure for %s.%s table"), $databaseName, $tableName)); |
537 | 537 | |
@@ -546,14 +546,14 @@ discard block |
||
546 | 546 | |
547 | 547 | //$result = mysqli_query($this->dbh,"SHOW CREATE table `$databaseName`.`$tableName`;"); |
548 | 548 | $result = $this->get_row("SHOW CREATE table `$databaseName`.`$tableName`;", ARRAY_N); |
549 | - if($result){ |
|
549 | + if ($result) { |
|
550 | 550 | //$row = mysqli_fetch_row( $result); |
551 | 551 | $line = ($result[1].";\n"); |
552 | 552 | $this->fs->get_tmp_filesystem_append()->write($dumpfile, $line); |
553 | 553 | } |
554 | 554 | |
555 | - $line = ( "\n#\n# End Structure for table `$tableName`\n#\n\n"); |
|
556 | - $line .=("#\n# Dumping data for table `$tableName`\n#\n\n"); |
|
555 | + $line = ("\n#\n# End Structure for table `$tableName`\n#\n\n"); |
|
556 | + $line .= ("#\n# Dumping data for table `$tableName`\n#\n\n"); |
|
557 | 557 | $this->fs->get_tmp_filesystem_append()->write($dumpfile, $line); |
558 | 558 | |
559 | 559 | return; |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | |
577 | 577 | } |
578 | 578 | |
579 | - public function resetcountRecords(){ |
|
579 | + public function resetcountRecords() { |
|
580 | 580 | |
581 | 581 | $this->countRecords = 0; |
582 | 582 | |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | |
585 | 585 | } |
586 | 586 | |
587 | - public function getcountRecords(){ |
|
587 | + public function getcountRecords() { |
|
588 | 588 | |
589 | 589 | return $this->countRecords; |
590 | 590 | |
@@ -601,14 +601,14 @@ discard block |
||
601 | 601 | $return .= "# Powered by XCloner Site Backup\n"; |
602 | 602 | $return .= "# http://www.xcloner.com\n"; |
603 | 603 | $return .= "#\n"; |
604 | - $return .= "# Host: " . get_site_url() . "\n"; |
|
605 | - $return .= "# Generation Time: " . date("M j, Y \a\\t H:i") . "\n"; |
|
606 | - $return .= "# PHP Version: " . phpversion() . "\n"; |
|
607 | - $return .= "# Database Charset: ". $this->charset . "\n"; |
|
604 | + $return .= "# Host: ".get_site_url()."\n"; |
|
605 | + $return .= "# Generation Time: ".date("M j, Y \a\\t H:i")."\n"; |
|
606 | + $return .= "# PHP Version: ".phpversion()."\n"; |
|
607 | + $return .= "# Database Charset: ".$this->charset."\n"; |
|
608 | 608 | |
609 | 609 | $results = $this->get_results("SHOW VARIABLES LIKE \"%version%\";", ARRAY_N); |
610 | - if(isset($results)){ |
|
611 | - foreach($results as $result){ |
|
610 | + if (isset($results)) { |
|
611 | + foreach ($results as $result) { |
|
612 | 612 | |
613 | 613 | $return .= "# MYSQL ".$result[0].": ".$result[1]."\n"; |
614 | 614 | |
@@ -618,13 +618,13 @@ discard block |
||
618 | 618 | $results = $this->get_results("SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME |
619 | 619 | FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '".$database."';"); |
620 | 620 | |
621 | - if(isset($results[0])){ |
|
621 | + if (isset($results[0])) { |
|
622 | 622 | |
623 | 623 | $return .= "# MYSQL DEFAULT_CHARACTER_SET_NAME: ".$results[0]->DEFAULT_CHARACTER_SET_NAME."\n"; |
624 | 624 | $return .= "# MYSQL SCHEMA_NAME: ".$results[0]->DEFAULT_COLLATION_NAME."\n"; |
625 | 625 | } |
626 | 626 | |
627 | - $return .= "#\n# Database : `" . $database . "`\n# --------------------------------------------------------\n\n"; |
|
627 | + $return .= "#\n# Database : `".$database."`\n# --------------------------------------------------------\n\n"; |
|
628 | 628 | |
629 | 629 | $this->log(sprintf(__("Writing %s database dump headers"), $database)); |
630 | 630 |
@@ -65,7 +65,7 @@ |
||
65 | 65 | foreach ($backup_list as $file_info):?> |
66 | 66 | <?php |
67 | 67 | if ($storage_selection == "gdrive") { |
68 | - $file_info['path'] = $file_info['filename'] . "." . $file_info['extension']; |
|
68 | + $file_info['path'] = $file_info['filename'].".".$file_info['extension']; |
|
69 | 69 | } |
70 | 70 | $file_exists_on_local_storage = true; |
71 | 71 |
@@ -11,10 +11,10 @@ discard block |
||
11 | 11 | |
12 | 12 | ?> |
13 | 13 | |
14 | -<h1><?= esc_html( get_admin_page_title() ); ?></h1> |
|
14 | +<h1><?= esc_html(get_admin_page_title()); ?></h1> |
|
15 | 15 | |
16 | 16 | <script> |
17 | - var xcloner_auth_key = '<?php echo md5( AUTH_KEY )?>'; |
|
17 | + var xcloner_auth_key = '<?php echo md5(AUTH_KEY)?>'; |
|
18 | 18 | </script> |
19 | 19 | |
20 | 20 | <div class="row xcloner-restore"> |
@@ -22,36 +22,36 @@ discard block |
||
22 | 22 | <ul class="collapsible xcloner-restore " data-collapsible="accordion"> |
23 | 23 | <li data-step="1" class="restore-script-upload-step steps active show"> |
24 | 24 | <div class="collapsible-header active"><i |
25 | - class="material-icons">settings_remote</i><?php echo __( "Restore Script Upload", 'xcloner-backup-and-restore' ) ?> |
|
25 | + class="material-icons">settings_remote</i><?php echo __("Restore Script Upload", 'xcloner-backup-and-restore') ?> |
|
26 | 26 | </div> |
27 | 27 | <div class="collapsible-body row"> |
28 | 28 | |
29 | 29 | <ul class="text-steps"> |
30 | - <li><?php echo __( "If you want to do a <strong>Local Target System Restore</strong>, leave Url field below empty and click 'Check Connection', you can skip the next steps.", 'xcloner-backup-and-restore' ) ?> |
|
30 | + <li><?php echo __("If you want to do a <strong>Local Target System Restore</strong>, leave Url field below empty and click 'Check Connection', you can skip the next steps.", 'xcloner-backup-and-restore') ?> |
|
31 | 31 | </li> |
32 | - <li><?php echo __( "If you want to do a <strong>Remote Target System Restore</strong>, please download the restore script from", 'xcloner-backup-and-restore' ) ?> |
|
32 | + <li><?php echo __("If you want to do a <strong>Remote Target System Restore</strong>, please download the restore script from", 'xcloner-backup-and-restore') ?> |
|
33 | 33 | <a href='#' |
34 | - onclick="window.location=ajaxurl+'?action=download_restore_script&phar=true'"><strong><?php echo __( "here", 'xcloner-backup-and-restore' ) ?></strong></a> |
|
34 | + onclick="window.location=ajaxurl+'?action=download_restore_script&phar=true'"><strong><?php echo __("here", 'xcloner-backup-and-restore') ?></strong></a> |
|
35 | 35 | </li> |
36 | 36 | <li> |
37 | - <?php echo __( "Extract the restore script archive files on your new host", 'xcloner-backup-and-restore' ) ?> |
|
37 | + <?php echo __("Extract the restore script archive files on your new host", 'xcloner-backup-and-restore') ?> |
|
38 | 38 | </li> |
39 | 39 | <li> |
40 | - <?php echo __( "Provide url below to the <u>xcloner_restore.php</u> restore script, like http://my_restore_site.com/xcloner_restore.php", 'xcloner-backup-and-restore' ) ?> |
|
40 | + <?php echo __("Provide url below to the <u>xcloner_restore.php</u> restore script, like http://my_restore_site.com/xcloner_restore.php", 'xcloner-backup-and-restore') ?> |
|
41 | 41 | </li> |
42 | 42 | <li> |
43 | - <?php echo __( "If your server is not web accessible, like a localhost computer, you can use a DynDNS service or install a blank copy of Wordpress with XCloner in the same environment and start the restore from there.", 'xcloner-backup-and-restore' ) ?> |
|
43 | + <?php echo __("If your server is not web accessible, like a localhost computer, you can use a DynDNS service or install a blank copy of Wordpress with XCloner in the same environment and start the restore from there.", 'xcloner-backup-and-restore') ?> |
|
44 | 44 | </li> |
45 | - <?php if ( is_ssl() ): ?> |
|
45 | + <?php if (is_ssl()): ?> |
|
46 | 46 | <li class="warning"> |
47 | - <?php echo __( "We have detected your connection to the site as being secure, so your restore script address must start with https://." ) ?> |
|
47 | + <?php echo __("We have detected your connection to the site as being secure, so your restore script address must start with https://.") ?> |
|
48 | 48 | </li> |
49 | 49 | <?php endif ?> |
50 | 50 | |
51 | 51 | </ul> |
52 | 52 | |
53 | 53 | <div class="input-field col l9 s12"> |
54 | - <input value="<?php echo ( is_ssl() ) ? "https://" : "" ?>" id="restore_script_url" type="text" |
|
54 | + <input value="<?php echo (is_ssl()) ? "https://" : "" ?>" id="restore_script_url" type="text" |
|
55 | 55 | class="validate" |
56 | 56 | placeholder="Url to XCloner Restore Script, example http://myddns.com/xcloner/xcloner_restore.php"> |
57 | 57 | <label for="restore_script_url"></label> |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | </div> |
60 | 60 | <div class="col l3 s12 right-align"> |
61 | 61 | <button class="btn waves-effect waves-light" type="submit" id="validate_url" |
62 | - name="action"><?php echo __( "Check Connection", 'xcloner-backup-and-restore' ) ?> |
|
62 | + name="action"><?php echo __("Check Connection", 'xcloner-backup-and-restore') ?> |
|
63 | 63 | <i class="material-icons right">send</i> |
64 | 64 | </button> |
65 | 65 | </div> |
@@ -68,18 +68,18 @@ discard block |
||
68 | 68 | |
69 | 69 | <li data-step="2" class="backup-upload-step steps"> |
70 | 70 | <div class="collapsible-header active"><i |
71 | - class="material-icons">file_upload</i><?php echo __( "Upload Local Backup Archive To Target Host", 'xcloner-backup-and-restore' ) ?> |
|
71 | + class="material-icons">file_upload</i><?php echo __("Upload Local Backup Archive To Target Host", 'xcloner-backup-and-restore') ?> |
|
72 | 72 | </div> |
73 | 73 | <div class="collapsible-body row"> |
74 | - <p><?php echo __( "You can skip this step if you want to transfer the archive in some other way, make sure you upload it in the same directory as the restore script from the previous step.", 'xcloner-backup-and-restore' ) ?></p> |
|
74 | + <p><?php echo __("You can skip this step if you want to transfer the archive in some other way, make sure you upload it in the same directory as the restore script from the previous step.", 'xcloner-backup-and-restore') ?></p> |
|
75 | 75 | <div class="input-field col s12 l7"> |
76 | 76 | <select id="backup_file" name="backup_file" class="browser-default"> |
77 | 77 | <option value="" disabled |
78 | - selected><?php echo __( "Please select a local backup archive to upload to target host", 'xcloner-backup-and-restore' ) ?></option> |
|
79 | - <?php if ( is_array( $backup_list ) ): ?> |
|
80 | - <?php foreach ( $backup_list as $file ): ?> |
|
78 | + selected><?php echo __("Please select a local backup archive to upload to target host", 'xcloner-backup-and-restore') ?></option> |
|
79 | + <?php if (is_array($backup_list)): ?> |
|
80 | + <?php foreach ($backup_list as $file): ?> |
|
81 | 81 | <option value="<?php echo $file['basename'] ?>"> |
82 | - <?php echo $file['basename'] ?> (<?php echo size_format( $file['size'] ) ?>) |
|
82 | + <?php echo $file['basename'] ?> (<?php echo size_format($file['size']) ?>) |
|
83 | 83 | </option> |
84 | 84 | <?php endforeach ?> |
85 | 85 | <?php endif ?> |
@@ -94,18 +94,18 @@ discard block |
||
94 | 94 | <div class="col s12 l5 right-align"> |
95 | 95 | <div class="toggler"> |
96 | 96 | <button class="btn waves-effect waves-light upload-backup normal" type="submit" id="" |
97 | - name="action"><?php echo __( "Upload", 'xcloner-backup-and-restore' ) ?> |
|
97 | + name="action"><?php echo __("Upload", 'xcloner-backup-and-restore') ?> |
|
98 | 98 | <i class="material-icons left">navigate_before</i> |
99 | 99 | </button> |
100 | 100 | <button class="btn waves-effect waves-light red upload-backup cancel" type="submit" id="" |
101 | - name="action"><?php echo __( "Cancel", 'xcloner-backup-and-restore' ) ?> |
|
101 | + name="action"><?php echo __("Cancel", 'xcloner-backup-and-restore') ?> |
|
102 | 102 | <i class="material-icons right">close</i> |
103 | 103 | </button> |
104 | 104 | </div> |
105 | 105 | <button class="btn waves-effect waves-light grey" type="submit" |
106 | - title="<?php echo __( "Skip Next", 'xcloner-backup-and-restore' ) ?>" |
|
106 | + title="<?php echo __("Skip Next", 'xcloner-backup-and-restore') ?>" |
|
107 | 107 | id="skip_upload_backup" |
108 | - name="action"><?php echo __( "Skip Next", 'xcloner-backup-and-restore' ) ?> |
|
108 | + name="action"><?php echo __("Skip Next", 'xcloner-backup-and-restore') ?> |
|
109 | 109 | <i class="material-icons right">navigate_next</i> |
110 | 110 | </button> |
111 | 111 | </div> |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | |
115 | 115 | <li data-step="3" class="restore-remote-backup-step steps active"> |
116 | 116 | <div class="collapsible-header"><i |
117 | - class="material-icons">folder_open</i><?php echo __( "Restore Files Backup Available On Target Location", 'xcloner-backup-and-restore' ) ?> |
|
117 | + class="material-icons">folder_open</i><?php echo __("Restore Files Backup Available On Target Location", 'xcloner-backup-and-restore') ?> |
|
118 | 118 | <i class="material-icons right" title="Refresh Target Backup Files List" |
119 | 119 | id="refresh_remote_backup_file">cached</i> |
120 | 120 | |
121 | 121 | <div class="switch right"> |
122 | 122 | <label> |
123 | - <?php echo __( 'Verbose Output', 'xcloner-backup-and-restore' ) ?> |
|
123 | + <?php echo __('Verbose Output', 'xcloner-backup-and-restore') ?> |
|
124 | 124 | <input type="checkbox" id="toggle_file_restore_display" name="toggle_file_restore_display" |
125 | 125 | class="" checked value="1"> |
126 | 126 | <span class="lever"></span> |
@@ -135,11 +135,11 @@ discard block |
||
135 | 135 | <div class="col s12"> |
136 | 136 | <a class="btn-floating tooltipped btn-small right" data-html="true" data-position="left" |
137 | 137 | data-delay="50" |
138 | - data-tooltip="<?php echo __( "This is the directory where you would like to restore the backup archive files.<br /> |
|
139 | - Please use this with caution when restoring to a live site.", 'xcloner-backup-and-restore' ) ?>"><i |
|
138 | + data-tooltip="<?php echo __("This is the directory where you would like to restore the backup archive files.<br /> |
|
139 | + Please use this with caution when restoring to a live site.", 'xcloner-backup-and-restore') ?>"><i |
|
140 | 140 | class="material-icons">help_outline</i> |
141 | 141 | </a> |
142 | - <h5><?php echo __( "Restore Target Path:", 'xcloner-backup-and-restore' ) ?></h5> |
|
142 | + <h5><?php echo __("Restore Target Path:", 'xcloner-backup-and-restore') ?></h5> |
|
143 | 143 | <input type="text" name="remote_restore_path" id="remote_restore_path" class="validate" |
144 | 144 | placeholder="Restore Target Path"> |
145 | 145 | <label></label> |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | <div class="col s12"> |
152 | 152 | <a href="#backup_localhost-2017-04-03_10-58-sql-diff2017-03-22_00-00-5b6c4.tgz" |
153 | 153 | class="list-backup-content btn-floating tooltipped btn-small right" |
154 | - data-tooltip="<?php echo __( 'Click To List The Selected Backup Content', 'xcloner-backup-and-restore' ) ?>"> |
|
154 | + data-tooltip="<?php echo __('Click To List The Selected Backup Content', 'xcloner-backup-and-restore') ?>"> |
|
155 | 155 | <i class="material-icons">folder_open</i> |
156 | 156 | </a> |
157 | - <h5><?php echo __( "Restore Backup Archive:", 'xcloner-backup-and-restore' ) ?></h5> |
|
157 | + <h5><?php echo __("Restore Backup Archive:", 'xcloner-backup-and-restore') ?></h5> |
|
158 | 158 | <select id="remote_backup_file" name="remote_backup_file" class="browser-default"> |
159 | 159 | <option value="" disabled |
160 | - selected><?php echo __( "Please select the target backup file to restore", 'xcloner-backup-and-restore' ) ?></option> |
|
160 | + selected><?php echo __("Please select the target backup file to restore", 'xcloner-backup-and-restore') ?></option> |
|
161 | 161 | </select> |
162 | 162 | <label></label> |
163 | 163 | </div> |
@@ -166,41 +166,41 @@ discard block |
||
166 | 166 | <input class="with-gap" name="filter_files" type="radio" id="filter_files_all" checked |
167 | 167 | value="" disabled/> |
168 | 168 | <label for="filter_files_all" class="tooltipped" data-position="right" |
169 | - data-tooltip="<?php echo __( "Restore all backup files. Available only when doing a Remote Target System Restore", 'xcloner-backup-and-restore' ) ?>"><?php echo __( "Restore All Files", "xcloner-backup-and-restore" ) ?></label> |
|
169 | + data-tooltip="<?php echo __("Restore all backup files. Available only when doing a Remote Target System Restore", 'xcloner-backup-and-restore') ?>"><?php echo __("Restore All Files", "xcloner-backup-and-restore") ?></label> |
|
170 | 170 | |
171 | 171 | <input class="with-gap" name="filter_files" type="radio" id="filter_files_wp_content" |
172 | 172 | value="/^wp-content\/(.*)/"/> |
173 | 173 | <label for="filter_files_wp_content" class="tooltipped" |
174 | - data-tooltip="<?php echo __( 'Restore the files only of the wp-content/ folder', 'xcloner-backup-and-restore' ) ?>"> |
|
175 | - <?php echo __( "Only wp-content", "xcloner-backup-and-restore" ) ?> |
|
174 | + data-tooltip="<?php echo __('Restore the files only of the wp-content/ folder', 'xcloner-backup-and-restore') ?>"> |
|
175 | + <?php echo __("Only wp-content", "xcloner-backup-and-restore") ?> |
|
176 | 176 | </label> |
177 | 177 | |
178 | 178 | <input class="with-gap" name="filter_files" type="radio" id="filter_files_plugins" |
179 | 179 | value="/^wp-content\/plugins(.*)/"/> |
180 | 180 | <label for="filter_files_plugins" class="tooltipped" |
181 | - data-tooltip="<?php echo __( 'Restore the files only of the wp-content/plugins/ folder', 'xcloner-backup-and-restore' ) ?>"> |
|
182 | - <?php echo __( "Only Plugins", "xcloner-backup-and-restore" ) ?> |
|
181 | + data-tooltip="<?php echo __('Restore the files only of the wp-content/plugins/ folder', 'xcloner-backup-and-restore') ?>"> |
|
182 | + <?php echo __("Only Plugins", "xcloner-backup-and-restore") ?> |
|
183 | 183 | </label> |
184 | 184 | |
185 | 185 | <input class="with-gap" name="filter_files" type="radio" id="filter_files_uploads" |
186 | 186 | value="/^wp-content\/uploads(.*)/"/> |
187 | 187 | <label for="filter_files_uploads" class="tooltipped" |
188 | - data-tooltip="<?php echo __( 'Restore the files only of the wp-content/uploads/ folder only', 'xcloner-backup-and-restore' ) ?>"> |
|
189 | - <?php echo __( "Only Uploads", "xcloner-backup-and-restore" ) ?> |
|
188 | + data-tooltip="<?php echo __('Restore the files only of the wp-content/uploads/ folder only', 'xcloner-backup-and-restore') ?>"> |
|
189 | + <?php echo __("Only Uploads", "xcloner-backup-and-restore") ?> |
|
190 | 190 | </label> |
191 | 191 | |
192 | 192 | <input class="with-gap" name="filter_files" type="radio" id="filter_files_themes" |
193 | 193 | value="/^wp-content\/themes(.*)/"/> |
194 | 194 | <label for="filter_files_themes" class="tooltipped" |
195 | - data-tooltip="<?php echo __( 'Restore the files only of the wp-content/themes/ folder', 'xcloner-backup-and-restore' ) ?>"> |
|
196 | - <?php echo __( "Only Themes", "xcloner-backup-and-restore" ) ?> |
|
195 | + data-tooltip="<?php echo __('Restore the files only of the wp-content/themes/ folder', 'xcloner-backup-and-restore') ?>"> |
|
196 | + <?php echo __("Only Themes", "xcloner-backup-and-restore") ?> |
|
197 | 197 | </label> |
198 | 198 | |
199 | 199 | <input class="with-gap" name="filter_files" type="radio" id="filter_files_database" |
200 | 200 | value="/^xcloner-(.*)\/(.*)\.sql/"/> |
201 | 201 | <label for="filter_files_database" class="tooltipped" |
202 | - data-tooltip="<?php echo __( 'Restore the database-sql.sql mysql backup from the xcloner-xxxxx/ folder', 'xcloner-backup-and-restore' ) ?>"> |
|
203 | - <?php echo __( "Only Database Backup", "xcloner-backup-and-restore" ) ?> |
|
202 | + data-tooltip="<?php echo __('Restore the database-sql.sql mysql backup from the xcloner-xxxxx/ folder', 'xcloner-backup-and-restore') ?>"> |
|
203 | + <?php echo __("Only Database Backup", "xcloner-backup-and-restore") ?> |
|
204 | 204 | </label> |
205 | 205 | </div> |
206 | 206 | </div> |
@@ -216,18 +216,18 @@ discard block |
||
216 | 216 | <div class="col s12 l5 right-align"> |
217 | 217 | <div class="toggler"> |
218 | 218 | <button class="btn waves-effect waves-light restore_remote_backup normal " type="submit" |
219 | - id="" name="action"><?php echo __( "Restore", 'xcloner-backup-and-restore' ) ?> |
|
219 | + id="" name="action"><?php echo __("Restore", 'xcloner-backup-and-restore') ?> |
|
220 | 220 | <i class="material-icons left">navigate_before</i> |
221 | 221 | </button> |
222 | 222 | <button class="btn waves-effect waves-light red restore_remote_backup cancel" type="submit" |
223 | - id="" name="action"><?php echo __( "Cancel", 'xcloner-backup-and-restore' ) ?> |
|
223 | + id="" name="action"><?php echo __("Cancel", 'xcloner-backup-and-restore') ?> |
|
224 | 224 | <i class="material-icons right">close</i> |
225 | 225 | </button> |
226 | 226 | </div> |
227 | 227 | <button class="btn waves-effect waves-light grey" type="submit" |
228 | - title="<?php echo __( "Skip Next", 'xcloner-backup-and-restore' ) ?>" |
|
228 | + title="<?php echo __("Skip Next", 'xcloner-backup-and-restore') ?>" |
|
229 | 229 | id="skip_remote_backup_step" |
230 | - name="action"><?php echo __( "Skip Next", 'xcloner-backup-and-restore' ) ?> |
|
230 | + name="action"><?php echo __("Skip Next", 'xcloner-backup-and-restore') ?> |
|
231 | 231 | <i class="material-icons right">navigate_next</i> |
232 | 232 | </button> |
233 | 233 | </div> |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | |
237 | 237 | <li data-step="4" class="restore-remote-database-step steps active"> |
238 | 238 | <div class="collapsible-header"><i |
239 | - class="material-icons">list</i><?php echo __( "Restore Target Database - Search and Replace", 'xcloner-backup-and-restore' ) ?> |
|
239 | + class="material-icons">list</i><?php echo __("Restore Target Database - Search and Replace", 'xcloner-backup-and-restore') ?> |
|
240 | 240 | <i class="material-icons right" title="Refresh Database Backup Files List" |
241 | 241 | id="refresh_database_file">cached</i> |
242 | 242 | </div> |
@@ -246,68 +246,68 @@ discard block |
||
246 | 246 | <div class="col s12"> |
247 | 247 | <a class="btn-floating tooltipped btn-small right" data-position="left" data-delay="50" |
248 | 248 | data-html="true" |
249 | - data-tooltip="<?php echo __( 'Please provide below the mysql connection details for the target host database.<br />For live sites we recommend using a new separate database.', 'xcloner-backup-and-restore' ) ?>" |
|
249 | + data-tooltip="<?php echo __('Please provide below the mysql connection details for the target host database.<br />For live sites we recommend using a new separate database.', 'xcloner-backup-and-restore') ?>" |
|
250 | 250 | data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a> |
251 | - <h5><?php echo __( 'Target Mysql Details', 'xcloner-backup-and-restore' ) ?></h5> |
|
251 | + <h5><?php echo __('Target Mysql Details', 'xcloner-backup-and-restore') ?></h5> |
|
252 | 252 | </div> |
253 | 253 | <div class=" col s12"> |
254 | 254 | <div class="input-field col s12 m6"> |
255 | 255 | <input type="text" name="remote_mysql_host" id="remote_mysql_host" class="validate" |
256 | 256 | placeholder="Target Mysql Hostname"> |
257 | - <label><?php echo __( "Target Mysql Hostname", 'xcloner-backup-and-restore' ) ?></label> |
|
257 | + <label><?php echo __("Target Mysql Hostname", 'xcloner-backup-and-restore') ?></label> |
|
258 | 258 | </div> |
259 | 259 | |
260 | 260 | <div class="input-field col s12 m6"> |
261 | 261 | <input type="text" name="remote_mysql_db" id="remote_mysql_db" class="validate" |
262 | 262 | placeholder="Target Mysql Database"> |
263 | - <label><?php echo __( "Target Mysql Database", 'xcloner-backup-and-restore' ) ?></label> |
|
263 | + <label><?php echo __("Target Mysql Database", 'xcloner-backup-and-restore') ?></label> |
|
264 | 264 | </div> |
265 | 265 | |
266 | 266 | <div class="input-field col s12 m6"> |
267 | 267 | <input type="text" name="remote_mysql_user" id="remote_mysql_user" class="validate" |
268 | 268 | placeholder="Target Mysql Username"> |
269 | - <label><?php echo __( "Target Mysql Username", 'xcloner-backup-and-restore' ) ?></label> |
|
269 | + <label><?php echo __("Target Mysql Username", 'xcloner-backup-and-restore') ?></label> |
|
270 | 270 | </div> |
271 | 271 | |
272 | 272 | |
273 | 273 | <div class="input-field col s12 m6"> |
274 | 274 | <input type="text" name="remote_mysql_pass" id="remote_mysql_pass" class="validate" |
275 | 275 | placeholder="Target Mysql Password"> |
276 | - <label><?php echo __( "Target Mysql Password", 'xcloner-backup-and-restore' ) ?></label> |
|
276 | + <label><?php echo __("Target Mysql Password", 'xcloner-backup-and-restore') ?></label> |
|
277 | 277 | </div> |
278 | 278 | |
279 | 279 | </div> |
280 | 280 | <div class="col s12"> |
281 | 281 | <a class="btn-floating tooltipped btn-small right" data-position="left" data-delay="50" |
282 | 282 | data-html="true" |
283 | - data-tooltip="<?php echo __( 'I will attempt to replace all mysql backup records matching the provided Source Url with the provided Target Url. <br />Leave blank the Target Url if you would like to skip this option. <br />As a bonus, I will also replace all matching serialized data and fix it\'s parsing.', 'xcloner-backup-and-restore' ) ?>" |
|
283 | + data-tooltip="<?php echo __('I will attempt to replace all mysql backup records matching the provided Source Url with the provided Target Url. <br />Leave blank the Target Url if you would like to skip this option. <br />As a bonus, I will also replace all matching serialized data and fix it\'s parsing.', 'xcloner-backup-and-restore') ?>" |
|
284 | 284 | data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a> |
285 | - <h5><?php echo __( 'Target Mysql Search and Replace', 'xcloner-backup-and-restore' ) ?></h5> |
|
285 | + <h5><?php echo __('Target Mysql Search and Replace', 'xcloner-backup-and-restore') ?></h5> |
|
286 | 286 | </div> |
287 | 287 | <div class="col s12"> |
288 | 288 | <div class="input-field col s12 m6 "> |
289 | 289 | <input type="text" name="wp_home_url" id="wp_home_url" class="validate" |
290 | 290 | placeholder="WP Home Url" value="<?php echo home_url(); ?>"> |
291 | - <label><?php echo __( "Source Home Url", 'xcloner-backup-and-restore' ) ?></label> |
|
291 | + <label><?php echo __("Source Home Url", 'xcloner-backup-and-restore') ?></label> |
|
292 | 292 | </div> |
293 | 293 | |
294 | 294 | <div class="input-field col s12 m6 "> |
295 | 295 | <input type="text" name="remote_restore_url" id="remote_restore_url" class="validate" |
296 | 296 | placeholder="Restore Target Url"> |
297 | - <label><?php echo __( "With Target Home Url", 'xcloner-backup-and-restore' ) ?></label> |
|
297 | + <label><?php echo __("With Target Home Url", 'xcloner-backup-and-restore') ?></label> |
|
298 | 298 | </div> |
299 | 299 | |
300 | - <?php if ( site_url() != home_url() ) : ?> |
|
300 | + <?php if (site_url() != home_url()) : ?> |
|
301 | 301 | <div class="input-field col s12 m6 "> |
302 | 302 | <input type="text" name="wp_site_url" id="wp_site_url" class="validate" |
303 | 303 | placeholder="WP Site Url" value="<?php echo site_url(); ?>"> |
304 | - <label><?php echo __( "Source Site Url", 'xcloner-backup-and-restore' ) ?></label> |
|
304 | + <label><?php echo __("Source Site Url", 'xcloner-backup-and-restore') ?></label> |
|
305 | 305 | </div> |
306 | 306 | |
307 | 307 | <div class="input-field col s12 m6 "> |
308 | 308 | <input type="text" name="remote_restore_site_url" id="remote_restore_site_url" |
309 | 309 | class="validate" placeholder="Restore Target Url"> |
310 | - <label><?php echo __( "With Target Site Url", 'xcloner-backup-and-restore' ) ?></label> |
|
310 | + <label><?php echo __("With Target Site Url", 'xcloner-backup-and-restore') ?></label> |
|
311 | 311 | </div> |
312 | 312 | |
313 | 313 | <?php endif; ?> |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | <div class="input-field row"> |
320 | 320 | <select id="remote_database_file" name="remote_database_file" class="browser-default"> |
321 | 321 | <option value="" disabled |
322 | - selected><?php echo __( "Please select the target database backup file to restore", 'xcloner-backup-and-restore' ) ?></option> |
|
322 | + selected><?php echo __("Please select the target database backup file to restore", 'xcloner-backup-and-restore') ?></option> |
|
323 | 323 | </select> |
324 | 324 | |
325 | 325 | <label></label> |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | |
332 | 332 | <div class="status"></div> |
333 | 333 | <div class="query-box"> |
334 | - <h6><?php echo __( 'Use the field below to fix your mysql query and Retry again the Restore, or replace with # to Skip next', 'xcloner-backup-and-restore' ) ?></h6> |
|
334 | + <h6><?php echo __('Use the field below to fix your mysql query and Retry again the Restore, or replace with # to Skip next', 'xcloner-backup-and-restore') ?></h6> |
|
335 | 335 | <textarea class="query-list" cols="5"></textarea> |
336 | 336 | </div> |
337 | 337 | </div> |
@@ -339,20 +339,20 @@ discard block |
||
339 | 339 | <div class="col s12 l5 right-align"> |
340 | 340 | <div class="toggler"> |
341 | 341 | <button class="btn waves-effect waves-light restore_remote_mysqldump normal " type="submit" |
342 | - id="" name="action"><?php echo __( "Restore", 'xcloner-backup-and-restore' ) ?> |
|
342 | + id="" name="action"><?php echo __("Restore", 'xcloner-backup-and-restore') ?> |
|
343 | 343 | <i class="material-icons left">navigate_before</i> |
344 | 344 | </button> |
345 | 345 | <button class="btn waves-effect waves-light red restore_remote_mysqldump cancel" |
346 | 346 | type="submit" id="" |
347 | - name="action"><?php echo __( "Cancel", 'xcloner-backup-and-restore' ) ?> |
|
347 | + name="action"><?php echo __("Cancel", 'xcloner-backup-and-restore') ?> |
|
348 | 348 | <i class="material-icons right">close</i> |
349 | 349 | </button> |
350 | 350 | </div> |
351 | 351 | |
352 | 352 | <button class="btn waves-effect waves-light grey" type="submit" |
353 | - title="<?php echo __( "Skip Next", 'xcloner-backup-and-restore' ) ?>" |
|
353 | + title="<?php echo __("Skip Next", 'xcloner-backup-and-restore') ?>" |
|
354 | 354 | id="skip_restore_remote_database_step" |
355 | - name="action"><?php echo __( "Skip Next", 'xcloner-backup-and-restore' ) ?> |
|
355 | + name="action"><?php echo __("Skip Next", 'xcloner-backup-and-restore') ?> |
|
356 | 356 | <i class="material-icons right">navigate_next</i> |
357 | 357 | </button> |
358 | 358 | |
@@ -363,13 +363,13 @@ discard block |
||
363 | 363 | |
364 | 364 | <li data-step="5" class="restore-finish-step steps active"> |
365 | 365 | <div class="collapsible-header"><i |
366 | - class="material-icons">folder_open</i><?php echo __( "Finishing up...", 'xcloner-backup-and-restore' ) ?> |
|
366 | + class="material-icons">folder_open</i><?php echo __("Finishing up...", 'xcloner-backup-and-restore') ?> |
|
367 | 367 | </div> |
368 | 368 | <div class="collapsible-body row"> |
369 | 369 | |
370 | 370 | <div class="row"> |
371 | 371 | <div class="col s4"> |
372 | - <label><?php echo __( "Update wp-config.php mysql details and update the Target Site Url", 'xcloner-backup-and-restore' ) ?></label> |
|
372 | + <label><?php echo __("Update wp-config.php mysql details and update the Target Site Url", 'xcloner-backup-and-restore') ?></label> |
|
373 | 373 | </div> |
374 | 374 | |
375 | 375 | <div class="col s8"> |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | |
388 | 388 | <div class="row"> |
389 | 389 | <div class="col s4"> |
390 | - <label><?php echo __( "Delete Restored Backup Temporary Folder", 'xcloner-backup-and-restore' ) ?></label> |
|
390 | + <label><?php echo __("Delete Restored Backup Temporary Folder", 'xcloner-backup-and-restore') ?></label> |
|
391 | 391 | </div> |
392 | 392 | <div class="col s8"> |
393 | 393 | <div class="switch"> |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | |
405 | 405 | <div class="row"> |
406 | 406 | <div class="col s4"> |
407 | - <label><?php echo __( "Delete Restore Script", 'xcloner-backup-and-restore' ) ?></label> |
|
407 | + <label><?php echo __("Delete Restore Script", 'xcloner-backup-and-restore') ?></label> |
|
408 | 408 | </div> |
409 | 409 | <div class="col s8"> |
410 | 410 | <div class="switch"> |
@@ -424,8 +424,8 @@ discard block |
||
424 | 424 | </div> |
425 | 425 | |
426 | 426 | <div class=" row col s12 center-align" id="xcloner_restore_finish"> |
427 | - <h5><?php echo __( "Thank you for using XCloner.", 'xcloner-backup-and-restore' ) ?></h5> |
|
428 | - <h6><?php echo sprintf( __( "We would love to hear about your experience in the %s.", 'xcloner-backup-and-restore' ), '<a href="https://wordpress.org/support/plugin/xcloner-backup-and-restore" target="_blank">Wordpress XCloner forums</a>' ) ?></h6> |
|
427 | + <h5><?php echo __("Thank you for using XCloner.", 'xcloner-backup-and-restore') ?></h5> |
|
428 | + <h6><?php echo sprintf(__("We would love to hear about your experience in the %s.", 'xcloner-backup-and-restore'), '<a href="https://wordpress.org/support/plugin/xcloner-backup-and-restore" target="_blank">Wordpress XCloner forums</a>') ?></h6> |
|
429 | 429 | <a class="twitter-follow-button" href="https://twitter.com/thinkovi" data-show-count="false">Follow |
430 | 430 | @thinkovi</a> |
431 | 431 | <script src="//platform.twitter.com/widgets.js" async="" charset="utf-8"></script> |
@@ -435,14 +435,14 @@ discard block |
||
435 | 435 | <div class="row"> |
436 | 436 | <div class="col s6 right-align"> |
437 | 437 | <button class="btn waves-effect waves-light teal" type="submit" id="restore_finish" |
438 | - name="action"><?php echo __( "Finish", 'xcloner-backup-and-restore' ) ?> |
|
438 | + name="action"><?php echo __("Finish", 'xcloner-backup-and-restore') ?> |
|
439 | 439 | <i class="material-icons right">navigate_next</i> |
440 | 440 | </button> |
441 | 441 | </div> |
442 | 442 | |
443 | 443 | <div id="open_target_site" class="col s6 left-align"> |
444 | 444 | <a disabled="disabled" href="#" class="btn waves-effect waves-light teal" type="button" |
445 | - target="_blank"><?php echo __( "Open Target Site", 'xcloner-backup-and-restore' ) ?> |
|
445 | + target="_blank"><?php echo __("Open Target Site", 'xcloner-backup-and-restore') ?> |
|
446 | 446 | <i class="material-icons right">navigate_next</i> |
447 | 447 | </a> |
448 | 448 | </div> |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | <!-- List Backup Content Modal--> |
460 | 460 | <div id="backup_cotent_modal" class="modal"> |
461 | 461 | <div class="modal-content"> |
462 | - <h4><?php echo sprintf( __( "Listing Backup Content ", 'xcloner-backup-and-restore' ), "" ) ?></h4> |
|
462 | + <h4><?php echo sprintf(__("Listing Backup Content ", 'xcloner-backup-and-restore'), "") ?></h4> |
|
463 | 463 | <h5 class="backup-name"></h5> |
464 | 464 | |
465 | 465 | <div class="progress"> |
@@ -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 ( $latest_backup ): ?> |
|
92 | + <?php if ($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> |
@@ -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 __( "Keeps Deleted Backups in Trash", 'xcloner-backup-and-restore' ) ?></label> |
|
923 | + <label for="gdrive_empty_trash"><?php echo __("Keeps Deleted Backups in 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 __( "Enabled", 'xcloner-backup-and-restore' ) ?></label> |
|
929 | + <label for="gdrive_empty_trash_off"><?php echo __("Enabled", '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 __( "Disabled", 'xcloner-backup-and-restore' ) ?></label> |
|
934 | + <label for="gdrive_empty_trash_on"><?php echo __("Disabled", '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,17 +7,17 @@ |
||
7 | 7 | <div class="col s12 "> |
8 | 8 | <div> |
9 | 9 | <h5 class="left-align"> |
10 | - <?php echo __( 'XCloner Debugger Dashboard', 'xcloner-backup-and-restore' ) ?> |
|
10 | + <?php echo __('XCloner Debugger Dashboard', 'xcloner-backup-and-restore') ?> |
|
11 | 11 | </h5> |
12 | 12 | |
13 | - <?php if ( $xcloner_settings->get_xcloner_option( 'xcloner_enable_log' ) ) : ?> |
|
13 | + <?php if ($xcloner_settings->get_xcloner_option('xcloner_enable_log')) : ?> |
|
14 | 14 | <ul class="collapsible xcloner-debugger" data-collapsible="accordion"> |
15 | 15 | <li class="active"> |
16 | 16 | <div class="collapsible-header active"><i class="material-icons">bug_report</i>XCloner Debugger |
17 | 17 | </div> |
18 | 18 | <div class="collapsible-body"> |
19 | - <div class="console" id="xcloner-console"><?php if ( isset( $logger_content ) ) { |
|
20 | - echo implode( "<br />\n", $logger_content ); |
|
19 | + <div class="console" id="xcloner-console"><?php if (isset($logger_content)) { |
|
20 | + echo implode("<br />\n", $logger_content); |
|
21 | 21 | } ?></div> |
22 | 22 | </div> |
23 | 23 | </li> |
@@ -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,15 +97,15 @@ discard block |
||
97 | 97 | <div class="row"> |
98 | 98 | <div class="input-field col s12"> |
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 inline col s12 l6"> |
103 | 103 | <select id="backup_type" class="" name="backup_type" id="backup_type"> |
104 | - <option value=""><?php echo __( "Full Backup", "xcloner-backup-and-restore" ); ?></option> |
|
105 | - <option value="diff"><?php echo __( "Differential Backups", "xcloner-backup-and-restore" ); ?></option> |
|
106 | - <option value="full_diff"><?php echo __( "Full Backup + Differential Backups", "xcloner-backup-and-restore" ); ?></option> |
|
104 | + <option value=""><?php echo __("Full Backup", "xcloner-backup-and-restore"); ?></option> |
|
105 | + <option value="diff"><?php echo __("Differential Backups", "xcloner-backup-and-restore"); ?></option> |
|
106 | + <option value="full_diff"><?php echo __("Full Backup + Differential Backups", "xcloner-backup-and-restore"); ?></option> |
|
107 | 107 | </select> |
108 | - <label for="backup_type"><?php echo __( 'Scheduled Backup Type', 'xcloner-backup-and-restore' ) ?></label> |
|
108 | + <label for="backup_type"><?php echo __('Scheduled Backup Type', 'xcloner-backup-and-restore') ?></label> |
|
109 | 109 | </div>--> |
110 | 110 | </div> |
111 | 111 | |
@@ -114,18 +114,18 @@ discard block |
||
114 | 114 | <input placeholder="" name="schedule_start_date" id="schedule_start_date" type="datetime" |
115 | 115 | value=""> |
116 | 116 | <label for="schedule_start_date" |
117 | - class="active"><?php echo __( 'Schedule Start At', 'xcloner-backup-and-restore' ) ?> |
|
117 | + class="active"><?php echo __('Schedule Start At', 'xcloner-backup-and-restore') ?> |
|
118 | 118 | :</label> |
119 | 119 | </div> |
120 | 120 | |
121 | 121 | <div class="input-field col s12 l6"> |
122 | 122 | <select name="schedule_frequency" id="schedule_frequency" class="validate" required> |
123 | 123 | <option value="" disabled |
124 | - selected><?php echo __( 'Schedule Recurrence', 'xcloner-backup-and-restore' ) ?></option> |
|
124 | + selected><?php echo __('Schedule Recurrence', 'xcloner-backup-and-restore') ?></option> |
|
125 | 125 | <?php |
126 | 126 | $schedules = $xcloner_scheduler->get_available_intervals(); |
127 | 127 | |
128 | - foreach ( $schedules as $key => $schedule ) { |
|
128 | + foreach ($schedules as $key => $schedule) { |
|
129 | 129 | ?> |
130 | 130 | <option value="<?php echo $key ?>"><?php echo $schedule['display'] ?></option> |
131 | 131 | <?php |
@@ -135,17 +135,17 @@ discard block |
||
135 | 135 | </div> |
136 | 136 | </div> |
137 | 137 | |
138 | - <?php if ( sizeof( $available_storages ) ): ?> |
|
138 | + <?php if (sizeof($available_storages)): ?> |
|
139 | 139 | <div class="row"> |
140 | 140 | <div class="input-field col s12 l12"> |
141 | 141 | <select name="schedule_storage" id="schedule_storage" class="validate"> |
142 | 142 | <option value="" |
143 | - selected><?php echo __( 'none', 'xcloner-backup-and-restore' ) ?></option> |
|
144 | - <?php foreach ( $available_storages as $storage => $text ): ?> |
|
143 | + selected><?php echo __('none', 'xcloner-backup-and-restore') ?></option> |
|
144 | + <?php foreach ($available_storages as $storage => $text): ?> |
|
145 | 145 | <option value="<?php echo $storage ?>"><?php echo $text ?></option> |
146 | 146 | <?php endforeach ?> |
147 | 147 | </select> |
148 | - <label><?php echo __( 'Send To Remote Storage ', 'xcloner-backup-and-restore' ) ?></label> |
|
148 | + <label><?php echo __('Send To Remote Storage ', 'xcloner-backup-and-restore') ?></label> |
|
149 | 149 | </div> |
150 | 150 | </div> |
151 | 151 | <?php endif ?> |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | <div class="input-field col s12 l12"> |
155 | 155 | <input placeholder="" name="email_notification" id="email_notification" type="text" |
156 | 156 | value=""> |
157 | - <label for="email_notification"><?php echo __( 'Email Notification Address', 'xcloner-backup-and-restore' ) ?></label> |
|
157 | + <label for="email_notification"><?php echo __('Email Notification Address', 'xcloner-backup-and-restore') ?></label> |
|
158 | 158 | </div> |
159 | 159 | </div> |
160 | 160 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | <div class="input-field col s12 l12"> |
163 | 163 | <input placeholder="" name="diff_start_date" id="diff_start_date" type="text" |
164 | 164 | class="datepicker_max_today" value=""> |
165 | - <label for="diff_start_date"><?php echo __( 'Backup Only Files Modified/Created After', 'xcloner-backup-and-restore' ) ?></label> |
|
165 | + <label for="diff_start_date"><?php echo __('Backup Only Files Modified/Created After', 'xcloner-backup-and-restore') ?></label> |
|
166 | 166 | </div> |
167 | 167 | </div> |
168 | 168 | </div> |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | <div class="row"> |
172 | 172 | <div class="input-field col s12 l12"> |
173 | 173 | <input placeholder="" name="backup_name" id="backup_name" type="text" required value=""> |
174 | - <label for="backup_name"><?php echo __( 'Backup Name', 'xcloner-backup-and-restore' ) ?></label> |
|
174 | + <label for="backup_name"><?php echo __('Backup Name', 'xcloner-backup-and-restore') ?></label> |
|
175 | 175 | </div> |
176 | 176 | </div> |
177 | 177 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | <textarea id="table_params" name="table_params" class="materialize-textarea" |
181 | 181 | rows="15"></textarea> |
182 | 182 | <label for="table_params" |
183 | - class="active"><?php echo __( 'Included Database Data', 'xcloner-backup-and-restore' ) ?></label> |
|
183 | + class="active"><?php echo __('Included Database Data', 'xcloner-backup-and-restore') ?></label> |
|
184 | 184 | </div> |
185 | 185 | </div> |
186 | 186 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | <textarea id="excluded_files" name="excluded_files" class="materialize-textarea" |
190 | 190 | rows="15"></textarea> |
191 | 191 | <label for="excluded_files" |
192 | - class="active"><?php echo __( 'Excluded Files', 'xcloner-backup-and-restore' ) ?></label> |
|
192 | + class="active"><?php echo __('Excluded Files', 'xcloner-backup-and-restore') ?></label> |
|
193 | 193 | </div> |
194 | 194 | </div> |
195 | 195 | </div> |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | |
200 | 200 | <div class="input-field col s12 "> |
201 | 201 | <button class="right btn waves-effect waves-light" type="submit" |
202 | - name="action"><?php echo __( 'Save', 'xcloner-backup-and-restore' ) ?> |
|
202 | + name="action"><?php echo __('Save', 'xcloner-backup-and-restore') ?> |
|
203 | 203 | <i class="material-icons right">send</i> |
204 | 204 | </button> |
205 | 205 | </div> |