@@ -4,18 +4,18 @@ discard block |
||
4 | 4 | { |
5 | 5 | private $logger_file = "xcloner_main_%s.log"; |
6 | 6 | private $logger_file_hash = "xcloner%s.log"; |
7 | - private $hash ; |
|
7 | + private $hash; |
|
8 | 8 | private $xcloner_sanitization; |
9 | 9 | |
10 | 10 | public function __construct($hash = "") |
11 | 11 | { |
12 | - if(isset($hash)) |
|
12 | + if (isset($hash)) |
|
13 | 13 | $this->set_hash($hash); |
14 | 14 | } |
15 | 15 | |
16 | 16 | public function get_logger_filename($include_hash = 0) |
17 | 17 | { |
18 | - if($include_hash) |
|
18 | + if ($include_hash) |
|
19 | 19 | $filename = sprintf($this->logger_file_hash, $this->get_hash()); |
20 | 20 | else |
21 | 21 | $filename = sprintf($this->logger_file, $this->get_server_unique_hash(5)); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | public function get_xcloner_start_path() |
27 | 27 | { |
28 | - if(!get_option('xcloner_start_path') or !is_dir(get_option('xcloner_start_path'))) |
|
28 | + if (!get_option('xcloner_start_path') or !is_dir(get_option('xcloner_start_path'))) |
|
29 | 29 | $path = realpath(ABSPATH); |
30 | 30 | else |
31 | 31 | $path = get_option('xcloner_start_path'); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public function get_xcloner_store_path() |
44 | 44 | { |
45 | - if(!get_option('xcloner_store_path') or !is_dir(get_option('xcloner_store_path'))) |
|
45 | + if (!get_option('xcloner_store_path') or !is_dir(get_option('xcloner_store_path'))) |
|
46 | 46 | $path = realpath(XCLONER_STORAGE_PATH); |
47 | 47 | else |
48 | 48 | $path = get_option('xcloner_store_path'); |
@@ -59,13 +59,13 @@ discard block |
||
59 | 59 | public function get_xcloner_tmp_path() |
60 | 60 | { |
61 | 61 | $path = sys_get_temp_dir().DS.".".$this->get_xcloner_tmp_path_suffix(); |
62 | - if(!is_dir($path)) |
|
62 | + if (!is_dir($path)) |
|
63 | 63 | { |
64 | 64 | @mkdir($path); |
65 | 65 | @chmod($path, 0777); |
66 | 66 | } |
67 | 67 | |
68 | - if(!is_dir($path) or !is_writeable($path) or get_option('xcloner_force_tmp_path_site_root')) |
|
68 | + if (!is_dir($path) or !is_writeable($path) or get_option('xcloner_force_tmp_path_site_root')) |
|
69 | 69 | $path = $this->get_xcloner_store_path().DS.".".$this->get_xcloner_tmp_path_suffix(); |
70 | 70 | |
71 | 71 | return $path; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | public function get_enable_mysql_backup() |
75 | 75 | { |
76 | - if(get_option('xcloner_enable_mysql_backup')) |
|
76 | + if (get_option('xcloner_enable_mysql_backup')) |
|
77 | 77 | return true; |
78 | 78 | |
79 | 79 | return false; |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | |
82 | 82 | public function get_backup_extension_name($ext = "") |
83 | 83 | { |
84 | - if(!$ext) |
|
84 | + if (!$ext) |
|
85 | 85 | { |
86 | - if(get_option('xcloner_backup_compression_level')) |
|
86 | + if (get_option('xcloner_backup_compression_level')) |
|
87 | 87 | $ext = ".tgz"; |
88 | 88 | else |
89 | 89 | $ext = ".tar"; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | public function get_hash() |
95 | 95 | { |
96 | - if(!$this->hash){ |
|
96 | + if (!$this->hash) { |
|
97 | 97 | $this->set_hash("-".$this->get_server_unique_hash(5)); |
98 | 98 | } |
99 | 99 | |
@@ -105,17 +105,17 @@ discard block |
||
105 | 105 | { |
106 | 106 | $hash = "-".md5(rand()); |
107 | 107 | |
108 | - $this->set_hash(substr( $hash, 0, 6)); |
|
108 | + $this->set_hash(substr($hash, 0, 6)); |
|
109 | 109 | |
110 | 110 | return $hash; |
111 | 111 | } |
112 | 112 | |
113 | 113 | public function set_hash($hash = "") |
114 | 114 | { |
115 | - if(substr($hash, 0, 1) != "-" and strlen($hash)) |
|
115 | + if (substr($hash, 0, 1) != "-" and strlen($hash)) |
|
116 | 116 | $hash = "-".$hash; |
117 | 117 | |
118 | - $this->hash = substr( $hash, 0, 6); |
|
118 | + $this->hash = substr($hash, 0, 6); |
|
119 | 119 | |
120 | 120 | return $this; |
121 | 121 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | { |
125 | 125 | $data = parse_url(get_site_url()); |
126 | 126 | |
127 | - $backup_name = "backup_[domain]".(isset($data['port'])?":".$data['port']:"")."-[time]-".($this->get_enable_mysql_backup()?"sql":"nosql"); |
|
127 | + $backup_name = "backup_[domain]".(isset($data['port']) ? ":".$data['port'] : "")."-[time]-".($this->get_enable_mysql_backup() ? "sql" : "nosql"); |
|
128 | 128 | |
129 | 129 | return $backup_name; |
130 | 130 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | { |
134 | 134 | global $wpdb; |
135 | 135 | |
136 | - if(!$data = get_option('xcloner_mysql_hostname')) |
|
136 | + if (!$data = get_option('xcloner_mysql_hostname')) |
|
137 | 137 | $data = $wpdb->dbhost; |
138 | 138 | |
139 | 139 | return $data; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | { |
144 | 144 | global $wpdb; |
145 | 145 | |
146 | - if(!$data = get_option('xcloner_mysql_username')) |
|
146 | + if (!$data = get_option('xcloner_mysql_username')) |
|
147 | 147 | $data = $wpdb->dbuser; |
148 | 148 | |
149 | 149 | return $data; |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | { |
154 | 154 | global $wpdb; |
155 | 155 | |
156 | - if(!$data = get_option('xcloner_mysql_password')) |
|
156 | + if (!$data = get_option('xcloner_mysql_password')) |
|
157 | 157 | $data = $wpdb->dbpassword; |
158 | 158 | |
159 | 159 | return $data; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | { |
164 | 164 | global $wpdb; |
165 | 165 | |
166 | - if(!$data = get_option('xcloner_mysql_database')) |
|
166 | + if (!$data = get_option('xcloner_mysql_database')) |
|
167 | 167 | $data = $wpdb->dbname; |
168 | 168 | |
169 | 169 | return $data; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | { |
188 | 188 | $hash = md5(get_home_url().__DIR__); |
189 | 189 | |
190 | - if($strlen) |
|
190 | + if ($strlen) |
|
191 | 191 | $hash = substr($hash, 0, $strlen); |
192 | 192 | |
193 | 193 | return $hash; |
@@ -199,20 +199,20 @@ discard block |
||
199 | 199 | $this->xcloner_sanitization = new Xcloner_Sanitization(); |
200 | 200 | |
201 | 201 | //ADDING MISSING OPTIONS |
202 | - if( false == get_option( 'xcloner_mysql_settings_page' ) ) { |
|
203 | - add_option( 'xcloner_mysql_settings_page' ); |
|
202 | + if (false == get_option('xcloner_mysql_settings_page')) { |
|
203 | + add_option('xcloner_mysql_settings_page'); |
|
204 | 204 | } // end if |
205 | 205 | |
206 | - if( false == get_option( 'xcloner_cron_settings_page' ) ) { |
|
207 | - add_option( 'xcloner_cron_settings_page' ); |
|
206 | + if (false == get_option('xcloner_cron_settings_page')) { |
|
207 | + add_option('xcloner_cron_settings_page'); |
|
208 | 208 | } // end if |
209 | 209 | |
210 | - if( false == get_option( 'xcloner_system_settings_page' ) ) { |
|
211 | - add_option( 'xcloner_system_settings_page' ); |
|
210 | + if (false == get_option('xcloner_system_settings_page')) { |
|
211 | + add_option('xcloner_system_settings_page'); |
|
212 | 212 | } // end if |
213 | 213 | |
214 | - if( false == get_option( 'xcloner_cleanup_settings_page' ) ) { |
|
215 | - add_option( 'xcloner_cleanup_settings_page' ); |
|
214 | + if (false == get_option('xcloner_cleanup_settings_page')) { |
|
215 | + add_option('xcloner_cleanup_settings_page'); |
|
216 | 216 | } // end if |
217 | 217 | |
218 | 218 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | //SYSTEM section |
236 | 236 | add_settings_section( |
237 | 237 | 'xcloner_system_settings_group', |
238 | - __('These are advanced options recommended for developers!','xcloner-backup-and-restore'), |
|
238 | + __('These are advanced options recommended for developers!', 'xcloner-backup-and-restore'), |
|
239 | 239 | array($this, 'xcloner_settings_section_cb'), |
240 | 240 | 'xcloner_system_settings_page' |
241 | 241 | ); |
@@ -263,12 +263,12 @@ discard block |
||
263 | 263 | register_setting('xcloner_general_settings_group', 'xcloner_backup_compression_level', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
264 | 264 | add_settings_field( |
265 | 265 | 'xcloner_backup_compression_level', |
266 | - __('Backup Compression Level','xcloner-backup-and-restore'), |
|
266 | + __('Backup Compression Level', 'xcloner-backup-and-restore'), |
|
267 | 267 | array($this, 'do_form_range_field'), |
268 | 268 | 'xcloner_settings_page', |
269 | 269 | 'xcloner_general_settings_group', |
270 | 270 | array('xcloner_backup_compression_level', |
271 | - __('Options between [0-9]. Value 0 means no compression, while 9 is maximum compression affecting cpu load','xcloner-backup-and-restore'), |
|
271 | + __('Options between [0-9]. Value 0 means no compression, while 9 is maximum compression affecting cpu load', 'xcloner-backup-and-restore'), |
|
272 | 272 | 0, |
273 | 273 | 9 |
274 | 274 | ) |
@@ -277,12 +277,12 @@ discard block |
||
277 | 277 | register_setting('xcloner_general_settings_group', 'xcloner_start_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
278 | 278 | add_settings_field( |
279 | 279 | 'xcloner_start_path', |
280 | - __('Backup Start Location','xcloner-backup-and-restore'), |
|
280 | + __('Backup Start Location', 'xcloner-backup-and-restore'), |
|
281 | 281 | array($this, 'do_form_text_field'), |
282 | 282 | 'xcloner_settings_page', |
283 | 283 | 'xcloner_general_settings_group', |
284 | 284 | array('xcloner_start_path', |
285 | - __('Base path location from where XCloner can start the Backup.','xcloner-backup-and-restore'), |
|
285 | + __('Base path location from where XCloner can start the Backup.', 'xcloner-backup-and-restore'), |
|
286 | 286 | $this->get_xcloner_start_path(), |
287 | 287 | //'disabled' |
288 | 288 | ) |
@@ -291,12 +291,12 @@ discard block |
||
291 | 291 | register_setting('xcloner_general_settings_group', 'xcloner_store_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
292 | 292 | add_settings_field( |
293 | 293 | 'xcloner_store_path', |
294 | - __('Backup Storage Location','xcloner-backup-and-restore'), |
|
294 | + __('Backup Storage Location', 'xcloner-backup-and-restore'), |
|
295 | 295 | array($this, 'do_form_text_field'), |
296 | 296 | 'xcloner_settings_page', |
297 | 297 | 'xcloner_general_settings_group', |
298 | 298 | array('xcloner_store_path', |
299 | - __('Location where XCloner will store the Backup archives.','xcloner-backup-and-restore'), |
|
299 | + __('Location where XCloner will store the Backup archives.', 'xcloner-backup-and-restore'), |
|
300 | 300 | $this->get_xcloner_store_path(), |
301 | 301 | //'disabled' |
302 | 302 | ) |
@@ -305,24 +305,24 @@ discard block |
||
305 | 305 | register_setting('xcloner_general_settings_group', 'xcloner_enable_log', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
306 | 306 | add_settings_field( |
307 | 307 | 'xcloner_enable_log', |
308 | - __('Enable XCloner Backup Log','xcloner-backup-and-restore'), |
|
308 | + __('Enable XCloner Backup Log', 'xcloner-backup-and-restore'), |
|
309 | 309 | array($this, 'do_form_switch_field'), |
310 | 310 | 'xcloner_settings_page', |
311 | 311 | 'xcloner_general_settings_group', |
312 | 312 | array('xcloner_enable_log', |
313 | - sprintf(__('Enable the XCloner Backup log. You will find it stored unde the Backup Storage Location, file %s','xcloner-backup-and-restore'), $this->get_logger_filename()) |
|
313 | + sprintf(__('Enable the XCloner Backup log. You will find it stored unde the Backup Storage Location, file %s', 'xcloner-backup-and-restore'), $this->get_logger_filename()) |
|
314 | 314 | ) |
315 | 315 | ); |
316 | 316 | |
317 | 317 | register_setting('xcloner_general_settings_group', 'xcloner_regex_exclude', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
318 | 318 | add_settings_field( |
319 | 319 | 'xcloner_regex_exclude', |
320 | - __('Regex Exclude Files','xcloner-backup-and-restore'), |
|
320 | + __('Regex Exclude Files', 'xcloner-backup-and-restore'), |
|
321 | 321 | array($this, 'do_form_textarea_field'), |
322 | 322 | 'xcloner_settings_page', |
323 | 323 | 'xcloner_general_settings_group', |
324 | 324 | array('xcloner_regex_exclude', |
325 | - __('Regular expression match to exclude files and folders, example patterns provided below, one pattern per line','xcloner-backup-and-restore'), |
|
325 | + __('Regular expression match to exclude files and folders, example patterns provided below, one pattern per line', 'xcloner-backup-and-restore'), |
|
326 | 326 | //$this->get_xcloner_store_path(), |
327 | 327 | //'disabled' |
328 | 328 | ) |
@@ -332,36 +332,36 @@ discard block |
||
332 | 332 | register_setting('xcloner_mysql_settings_group', 'xcloner_enable_mysql_backup', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
333 | 333 | add_settings_field( |
334 | 334 | 'xcloner_enable_mysql_backup', |
335 | - __('Enable Mysql Backup','xcloner-backup-and-restore'), |
|
335 | + __('Enable Mysql Backup', 'xcloner-backup-and-restore'), |
|
336 | 336 | array($this, 'do_form_switch_field'), |
337 | 337 | 'xcloner_mysql_settings_page', |
338 | 338 | 'xcloner_mysql_settings_group', |
339 | 339 | array('xcloner_enable_mysql_backup', |
340 | - __('Enable Mysql Backup Option. If you don\'t want to backup the database, you can disable this.','xcloner-backup-and-restore') |
|
340 | + __('Enable Mysql Backup Option. If you don\'t want to backup the database, you can disable this.', 'xcloner-backup-and-restore') |
|
341 | 341 | ) |
342 | 342 | ); |
343 | 343 | |
344 | 344 | register_setting('xcloner_mysql_settings_group', 'xcloner_backup_only_wp_tables'); |
345 | 345 | add_settings_field( |
346 | 346 | 'xcloner_backup_only_wp_tables', |
347 | - __('Backup only WP tables','xcloner-backup-and-restore'), |
|
347 | + __('Backup only WP tables', 'xcloner-backup-and-restore'), |
|
348 | 348 | array($this, 'do_form_switch_field'), |
349 | 349 | 'xcloner_mysql_settings_page', |
350 | 350 | 'xcloner_mysql_settings_group', |
351 | 351 | array('xcloner_backup_only_wp_tables', |
352 | - sprintf(__('Enable this if you only want to Backup only tables starting with \'%s\' prefix','xcloner-backup-and-restore'), $this->get_table_prefix()) |
|
352 | + sprintf(__('Enable this if you only want to Backup only tables starting with \'%s\' prefix', 'xcloner-backup-and-restore'), $this->get_table_prefix()) |
|
353 | 353 | ) |
354 | 354 | ); |
355 | 355 | |
356 | 356 | register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_hostname', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
357 | 357 | add_settings_field( |
358 | 358 | 'xcloner_mysql_hostname', |
359 | - __('Mysql Hostname','xcloner-backup-and-restore'), |
|
359 | + __('Mysql Hostname', 'xcloner-backup-and-restore'), |
|
360 | 360 | array($this, 'do_form_text_field'), |
361 | 361 | 'xcloner_mysql_settings_page', |
362 | 362 | 'xcloner_mysql_settings_group', |
363 | 363 | array('xcloner_mysql_hostname', |
364 | - __('Wordpress mysql hostname','xcloner-backup-and-restore'), |
|
364 | + __('Wordpress mysql hostname', 'xcloner-backup-and-restore'), |
|
365 | 365 | $this->get_db_hostname(), |
366 | 366 | 'disabled' |
367 | 367 | ) |
@@ -370,12 +370,12 @@ discard block |
||
370 | 370 | register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_username', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
371 | 371 | add_settings_field( |
372 | 372 | 'xcloner_mysql_username', |
373 | - __('Mysql Username','xcloner-backup-and-restore'), |
|
373 | + __('Mysql Username', 'xcloner-backup-and-restore'), |
|
374 | 374 | array($this, 'do_form_text_field'), |
375 | 375 | 'xcloner_mysql_settings_page', |
376 | 376 | 'xcloner_mysql_settings_group', |
377 | 377 | array('xcloner_mysql_username', |
378 | - __('Wordpress mysql username','xcloner-backup-and-restore'), |
|
378 | + __('Wordpress mysql username', 'xcloner-backup-and-restore'), |
|
379 | 379 | $this->get_db_username(), |
380 | 380 | 'disabled' |
381 | 381 | ) |
@@ -384,12 +384,12 @@ discard block |
||
384 | 384 | register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_database', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
385 | 385 | add_settings_field( |
386 | 386 | 'xcloner_mysql_database', |
387 | - __('Mysql Database','xcloner-backup-and-restore'), |
|
387 | + __('Mysql Database', 'xcloner-backup-and-restore'), |
|
388 | 388 | array($this, 'do_form_text_field'), |
389 | 389 | 'xcloner_mysql_settings_page', |
390 | 390 | 'xcloner_mysql_settings_group', |
391 | 391 | array('xcloner_mysql_database', |
392 | - __('Wordpress mysql database','xcloner-backup-and-restore'), |
|
392 | + __('Wordpress mysql database', 'xcloner-backup-and-restore'), |
|
393 | 393 | $this->get_db_database(), |
394 | 394 | 'disabled' |
395 | 395 | ) |
@@ -399,12 +399,12 @@ discard block |
||
399 | 399 | register_setting('xcloner_system_settings_group', 'xcloner_size_limit_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
400 | 400 | add_settings_field( |
401 | 401 | 'xcloner_size_limit_per_request', |
402 | - __('Data Size Limit Per Request','xcloner-backup-and-restore'), |
|
402 | + __('Data Size Limit Per Request', 'xcloner-backup-and-restore'), |
|
403 | 403 | array($this, 'do_form_range_field'), |
404 | 404 | 'xcloner_system_settings_page', |
405 | 405 | 'xcloner_system_settings_group', |
406 | 406 | array('xcloner_size_limit_per_request', |
407 | - __('Use this option to set how much file data can XCloner backup in one AJAX request. Range 0-1024 MB','xcloner-backup-and-restore'), |
|
407 | + __('Use this option to set how much file data can XCloner backup in one AJAX request. Range 0-1024 MB', 'xcloner-backup-and-restore'), |
|
408 | 408 | 0, |
409 | 409 | 1024 |
410 | 410 | ) |
@@ -413,12 +413,12 @@ discard block |
||
413 | 413 | register_setting('xcloner_system_settings_group', 'xcloner_files_to_process_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
414 | 414 | add_settings_field( |
415 | 415 | 'xcloner_files_to_process_per_request', |
416 | - __('Files To Process Per Request','xcloner-backup-and-restore'), |
|
416 | + __('Files To Process Per Request', 'xcloner-backup-and-restore'), |
|
417 | 417 | array($this, 'do_form_range_field'), |
418 | 418 | 'xcloner_system_settings_page', |
419 | 419 | 'xcloner_system_settings_group', |
420 | 420 | array('xcloner_files_to_process_per_request', |
421 | - __('Use this option to set how many files XCloner should process at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
421 | + __('Use this option to set how many files XCloner should process at one time before doing another AJAX call', 'xcloner-backup-and-restore'), |
|
422 | 422 | 0, |
423 | 423 | 1000 |
424 | 424 | ) |
@@ -427,12 +427,12 @@ discard block |
||
427 | 427 | register_setting('xcloner_system_settings_group', 'xcloner_directories_to_scan_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
428 | 428 | add_settings_field( |
429 | 429 | 'xcloner_directories_to_scan_per_request', |
430 | - __('Directories To Scan Per Request','xcloner-backup-and-restore'), |
|
430 | + __('Directories To Scan Per Request', 'xcloner-backup-and-restore'), |
|
431 | 431 | array($this, 'do_form_range_field'), |
432 | 432 | 'xcloner_system_settings_page', |
433 | 433 | 'xcloner_system_settings_group', |
434 | 434 | array('xcloner_directories_to_scan_per_request', |
435 | - __('Use this option to set how many directories XCloner should scan at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
435 | + __('Use this option to set how many directories XCloner should scan at one time before doing another AJAX call', 'xcloner-backup-and-restore'), |
|
436 | 436 | 0, |
437 | 437 | 1000 |
438 | 438 | ) |
@@ -441,12 +441,12 @@ discard block |
||
441 | 441 | register_setting('xcloner_system_settings_group', 'xcloner_database_records_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
442 | 442 | add_settings_field( |
443 | 443 | 'xcloner_database_records_per_request', |
444 | - __('Database Records Per Request','xcloner-backup-and-restore'), |
|
444 | + __('Database Records Per Request', 'xcloner-backup-and-restore'), |
|
445 | 445 | array($this, 'do_form_range_field'), |
446 | 446 | 'xcloner_system_settings_page', |
447 | 447 | 'xcloner_system_settings_group', |
448 | 448 | array('xcloner_database_records_per_request', |
449 | - __('Use this option to set how many database table records should be fetched per AJAX request, or set to 0 to fetch all. Range 0-100000 records','xcloner-backup-and-restore'), |
|
449 | + __('Use this option to set how many database table records should be fetched per AJAX request, or set to 0 to fetch all. Range 0-100000 records', 'xcloner-backup-and-restore'), |
|
450 | 450 | 0, |
451 | 451 | 100000 |
452 | 452 | ) |
@@ -455,36 +455,36 @@ discard block |
||
455 | 455 | register_setting('xcloner_system_settings_group', 'xcloner_exclude_files_larger_than_mb', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
456 | 456 | add_settings_field( |
457 | 457 | 'xcloner_exclude_files_larger_than_mb', |
458 | - __('Exclude files larger than (MB)','xcloner-backup-and-restore'), |
|
458 | + __('Exclude files larger than (MB)', 'xcloner-backup-and-restore'), |
|
459 | 459 | array($this, 'do_form_number_field'), |
460 | 460 | 'xcloner_system_settings_page', |
461 | 461 | 'xcloner_system_settings_group', |
462 | 462 | array('xcloner_exclude_files_larger_than_mb', |
463 | - __('Use this option to automatically exclude files larger than a certain size in MB, or set to -1 to include all. Range 0-1000 MB','xcloner-backup-and-restore'), |
|
463 | + __('Use this option to automatically exclude files larger than a certain size in MB, or set to -1 to include all. Range 0-1000 MB', 'xcloner-backup-and-restore'), |
|
464 | 464 | ) |
465 | 465 | ); |
466 | 466 | |
467 | 467 | register_setting('xcloner_system_settings_group', 'xcloner_split_backup_limit', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
468 | 468 | add_settings_field( |
469 | 469 | 'xcloner_split_backup_limit', |
470 | - __('Split Backup Archive Limit (MB)','xcloner-backup-and-restore'), |
|
470 | + __('Split Backup Archive Limit (MB)', 'xcloner-backup-and-restore'), |
|
471 | 471 | array($this, 'do_form_number_field'), |
472 | 472 | 'xcloner_system_settings_page', |
473 | 473 | 'xcloner_system_settings_group', |
474 | 474 | array('xcloner_split_backup_limit', |
475 | - __('Use this option to automatically split the backup archive into smaller parts. Range 0-10000 MB','xcloner-backup-and-restore'), |
|
475 | + __('Use this option to automatically split the backup archive into smaller parts. Range 0-10000 MB', 'xcloner-backup-and-restore'), |
|
476 | 476 | ) |
477 | 477 | ); |
478 | 478 | |
479 | 479 | register_setting('xcloner_system_settings_group', 'xcloner_force_tmp_path_site_root'); |
480 | 480 | add_settings_field( |
481 | 481 | 'xcloner_force_tmp_path_site_root', |
482 | - __('Force Temporary Path Within XCloner Storage','xcloner-backup-and-restore'), |
|
482 | + __('Force Temporary Path Within XCloner Storage', 'xcloner-backup-and-restore'), |
|
483 | 483 | array($this, 'do_form_switch_field'), |
484 | 484 | 'xcloner_system_settings_page', |
485 | 485 | 'xcloner_system_settings_group', |
486 | 486 | array('xcloner_force_tmp_path_site_root', |
487 | - sprintf(__('Enable this option if you want the XCloner Temporary Path to be within your XCloner Storage Location','xcloner-backup-and-restore'), $this->get_table_prefix()) |
|
487 | + sprintf(__('Enable this option if you want the XCloner Temporary Path to be within your XCloner Storage Location', 'xcloner-backup-and-restore'), $this->get_table_prefix()) |
|
488 | 488 | ) |
489 | 489 | ); |
490 | 490 | |
@@ -492,36 +492,36 @@ discard block |
||
492 | 492 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_days', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
493 | 493 | add_settings_field( |
494 | 494 | 'xcloner_cleanup_retention_limit_days', |
495 | - __('Cleanup by Date(days)','xcloner-backup-and-restore'), |
|
495 | + __('Cleanup by Date(days)', 'xcloner-backup-and-restore'), |
|
496 | 496 | array($this, 'do_form_number_field'), |
497 | 497 | 'xcloner_cleanup_settings_page', |
498 | 498 | 'xcloner_cleanup_settings_group', |
499 | 499 | array('xcloner_cleanup_retention_limit_days', |
500 | - __('Specify the maximum number of days a backup archive can be kept on the server. 0 disables this option','xcloner-backup-and-restore') |
|
500 | + __('Specify the maximum number of days a backup archive can be kept on the server. 0 disables this option', 'xcloner-backup-and-restore') |
|
501 | 501 | ) |
502 | 502 | ); |
503 | 503 | |
504 | 504 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_archives', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
505 | 505 | add_settings_field( |
506 | 506 | 'xcloner_cleanup_retention_limit_archives', |
507 | - __('Cleanup by Quantity','xcloner-backup-and-restore'), |
|
507 | + __('Cleanup by Quantity', 'xcloner-backup-and-restore'), |
|
508 | 508 | array($this, 'do_form_number_field'), |
509 | 509 | 'xcloner_cleanup_settings_page', |
510 | 510 | 'xcloner_cleanup_settings_group', |
511 | 511 | array('xcloner_cleanup_retention_limit_archives', |
512 | - __('Specify the maximum number of backup archives to keep on the server. 0 disables this option','xcloner-backup-and-restore') |
|
512 | + __('Specify the maximum number of backup archives to keep on the server. 0 disables this option', 'xcloner-backup-and-restore') |
|
513 | 513 | ) |
514 | 514 | ); |
515 | 515 | |
516 | 516 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_capacity_limit', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
517 | 517 | add_settings_field( |
518 | 518 | 'xcloner_cleanup_capacity_limit', |
519 | - __('Cleanup by Capacity(MB)','xcloner-backup-and-restore'), |
|
519 | + __('Cleanup by Capacity(MB)', 'xcloner-backup-and-restore'), |
|
520 | 520 | array($this, 'do_form_number_field'), |
521 | 521 | 'xcloner_cleanup_settings_page', |
522 | 522 | 'xcloner_cleanup_settings_group', |
523 | 523 | array('xcloner_cleanup_capacity_limit', |
524 | - __('Remove oldest backups if all created backups exceed the configured limit in Megabytes. 0 disables this option','xcloner-backup-and-restore') |
|
524 | + __('Remove oldest backups if all created backups exceed the configured limit in Megabytes. 0 disables this option', 'xcloner-backup-and-restore') |
|
525 | 525 | ) |
526 | 526 | ); |
527 | 527 | |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | register_setting('xcloner_cron_settings_group', 'xcloner_cron_frequency'); |
530 | 530 | add_settings_field( |
531 | 531 | 'xcloner_cron_frequency', |
532 | - __('Cron frequency','xcloner-backup-and-restore'), |
|
532 | + __('Cron frequency', 'xcloner-backup-and-restore'), |
|
533 | 533 | array($this, 'do_form_text_field'), |
534 | 534 | 'xcloner_cron_settings_page', |
535 | 535 | 'xcloner_cron_settings_group', |
@@ -555,20 +555,20 @@ discard block |
||
555 | 555 | // text field content cb |
556 | 556 | public function do_form_text_field($params) |
557 | 557 | { |
558 | - if(!isset($params['3'])) |
|
558 | + if (!isset($params['3'])) |
|
559 | 559 | $params[3] = 0; |
560 | - if(!isset($params['2'])) |
|
560 | + if (!isset($params['2'])) |
|
561 | 561 | $params[2] = 0; |
562 | 562 | |
563 | 563 | list($fieldname, $label, $value, $disabled) = $params; |
564 | 564 | |
565 | - if(!$value) |
|
565 | + if (!$value) |
|
566 | 566 | $value = get_option($fieldname); |
567 | 567 | // output the field |
568 | 568 | ?> |
569 | 569 | <div class="row"> |
570 | 570 | <div class="input-field col s10 m10 l8"> |
571 | - <input class="validate" <?php echo ($disabled)?"disabled":""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="text" class="validate" value="<?php echo isset($value) ? esc_attr($value) : ''; ?>"> |
|
571 | + <input class="validate" <?php echo ($disabled) ? "disabled" : ""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="text" class="validate" value="<?php echo isset($value) ? esc_attr($value) : ''; ?>"> |
|
572 | 572 | </div> |
573 | 573 | <div class="col s2 m2 "> |
574 | 574 | <a class="btn-floating tooltipped btn-small" data-position="left" data-delay="50" data-tooltip="<?php echo $label?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a> |
@@ -582,20 +582,20 @@ discard block |
||
582 | 582 | // textarea field content cb |
583 | 583 | public function do_form_textarea_field($params) |
584 | 584 | { |
585 | - if(!isset($params['3'])) |
|
585 | + if (!isset($params['3'])) |
|
586 | 586 | $params[3] = 0; |
587 | - if(!isset($params['2'])) |
|
587 | + if (!isset($params['2'])) |
|
588 | 588 | $params[2] = 0; |
589 | 589 | |
590 | 590 | list($fieldname, $label, $value, $disabled) = $params; |
591 | 591 | |
592 | - if(!$value) |
|
592 | + if (!$value) |
|
593 | 593 | $value = get_option($fieldname); |
594 | 594 | // output the field |
595 | 595 | ?> |
596 | 596 | <div class="row"> |
597 | 597 | <div class="input-field col s10 m10 l8"> |
598 | - <textarea class="validate" <?php echo ($disabled)?"disabled":""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="text" class="validate" value=""><?php echo isset($value) ? esc_attr($value) : ''; ?></textarea> |
|
598 | + <textarea class="validate" <?php echo ($disabled) ? "disabled" : ""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="text" class="validate" value=""><?php echo isset($value) ? esc_attr($value) : ''; ?></textarea> |
|
599 | 599 | </div> |
600 | 600 | <div class="col s2 m2 "> |
601 | 601 | <a class="btn-floating tooltipped btn-small" data-position="center" data-html="true" data-delay="50" data-tooltip="<?php echo $label?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a> |
@@ -625,20 +625,20 @@ discard block |
||
625 | 625 | // number field content cb |
626 | 626 | public function do_form_number_field($params) |
627 | 627 | { |
628 | - if(!isset($params['3'])) |
|
628 | + if (!isset($params['3'])) |
|
629 | 629 | $params[3] = 0; |
630 | - if(!isset($params['2'])) |
|
630 | + if (!isset($params['2'])) |
|
631 | 631 | $params[2] = 0; |
632 | 632 | |
633 | 633 | list($fieldname, $label, $value, $disabled) = $params; |
634 | 634 | |
635 | - if(!$value) |
|
635 | + if (!$value) |
|
636 | 636 | $value = get_option($fieldname); |
637 | 637 | // output the field |
638 | 638 | ?> |
639 | 639 | <div class="row"> |
640 | 640 | <div class="input-field col s10 m5 l3"> |
641 | - <input class="validate" <?php echo ($disabled)?"disabled":""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="number" class="validate" value="<?php echo isset($value) ? esc_attr($value) : ''; ?>"> |
|
641 | + <input class="validate" <?php echo ($disabled) ? "disabled" : ""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="number" class="validate" value="<?php echo isset($value) ? esc_attr($value) : ''; ?>"> |
|
642 | 642 | </div> |
643 | 643 | <div class="col s2 m2 "> |
644 | 644 | <a class="btn-floating tooltipped btn-small" data-position="center" data-delay="50" data-tooltip="<?php echo $label?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a> |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | |
652 | 652 | public function do_form_range_field($params) |
653 | 653 | { |
654 | - if(!isset($params['4'])) |
|
654 | + if (!isset($params['4'])) |
|
655 | 655 | $params[4] = 0; |
656 | 656 | |
657 | 657 | list($fieldname, $label, $range_start, $range_end, $disabled) = $params; |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | <div class="row"> |
661 | 661 | <div class="input-field col s10 m10 l8"> |
662 | 662 | <p class="range-field"> |
663 | - <input <?php echo ($disabled)?"disabled":""?> type="range" name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" min="<?php echo $range_start?>" max="<?php echo $range_end?>" value="<?php echo isset($value) ? esc_attr($value) : ''; ?>" /> |
|
663 | + <input <?php echo ($disabled) ? "disabled" : ""?> type="range" name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" min="<?php echo $range_start?>" max="<?php echo $range_end?>" value="<?php echo isset($value) ? esc_attr($value) : ''; ?>" /> |
|
664 | 664 | </p> |
665 | 665 | </div> |
666 | 666 | <div class="col s2 m2 "> |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | |
674 | 674 | public function do_form_switch_field($params) |
675 | 675 | { |
676 | - if(!isset($params['2'])) |
|
676 | + if (!isset($params['2'])) |
|
677 | 677 | $params[2] = 0; |
678 | 678 | list($fieldname, $label, $disabled) = $params; |
679 | 679 | $value = get_option($fieldname); |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | <div class="switch"> |
684 | 684 | <label> |
685 | 685 | Off |
686 | - <input <?php echo ($disabled)?"disabled":""?> type="checkbox" name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" value="1" <?php echo ($value) ? 'checked="checked"' : ''; ?>"> |
|
686 | + <input <?php echo ($disabled) ? "disabled" : ""?> type="checkbox" name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" value="1" <?php echo ($value) ? 'checked="checked"' : ''; ?>"> |
|
687 | 687 | <span class="lever"></span> |
688 | 688 | On |
689 | 689 | </label> |