@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | $this->log(sprintf(__("Excluding table %s.%s from backup"), $table, $database)); |
| 280 | 280 | } |
| 281 | 281 | $inc++; |
| 282 | - } |
|
| 282 | + } |
|
| 283 | 283 | |
| 284 | 284 | return $tablesList; |
| 285 | 285 | |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | $buffer = ""; |
| 504 | 504 | $this->countRecords++; |
| 505 | 505 | |
| 506 | - foreach ($arr as $key => $value) { |
|
| 506 | + foreach ($arr as $key => $value) { |
|
| 507 | 507 | $value = $this->_real_escape($value); |
| 508 | 508 | $buffer .= "'".$value."', "; |
| 509 | 509 | } |
@@ -529,8 +529,8 @@ discard block |
||
| 529 | 529 | $line = ("\n#\n# Table structure for table `$tableName`\n#\n\n"); |
| 530 | 530 | $this->fs->get_tmp_filesystem_append()->write($dumpfile, $line); |
| 531 | 531 | |
| 532 | - if ($this->dbDropSyntax) |
|
| 533 | - { |
|
| 532 | + if ($this->dbDropSyntax) |
|
| 533 | + { |
|
| 534 | 534 | $line = ("\nDROP table IF EXISTS `$tableName`;\n"); |
| 535 | 535 | $this->fs->get_tmp_filesystem_append()->write($dumpfile, $line); |
| 536 | 536 | } |
@@ -147,14 +147,14 @@ |
||
| 147 | 147 | $unit_list = array('B', 'KB', 'MB', 'GB', 'PB'); |
| 148 | 148 | |
| 149 | 149 | if ($bytes == 0) { |
| 150 | - return $bytes . ' ' . $unit_list[0]; |
|
| 150 | + return $bytes . ' ' . $unit_list[0]; |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | $unit_count = count($unit_list); |
| 154 | 154 | for ($i = $unit_count - 1; $i >= 0; $i--) { |
| 155 | - $power = $i * 10; |
|
| 156 | - if (($bytes >> $power) >= 1) |
|
| 157 | - return round($bytes / (1 << $power), $decimals) . ' ' . $unit_list[$i]; |
|
| 155 | + $power = $i * 10; |
|
| 156 | + if (($bytes >> $power) >= 1) |
|
| 157 | + return round($bytes / (1 << $power), $decimals) . ' ' . $unit_list[$i]; |
|
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | } |
@@ -555,15 +555,15 @@ discard block |
||
| 555 | 555 | return array($bytes_wrote, $last_position); |
| 556 | 556 | } |
| 557 | 557 | |
| 558 | - /** |
|
| 559 | - * Open a TAR archive and put the file cursor at the end for data appending |
|
| 560 | - * |
|
| 561 | - * If $file is empty, the tar file will be created in memory |
|
| 562 | - * |
|
| 563 | - * @param string $file |
|
| 564 | - * @throws ArchiveIOException |
|
| 565 | - */ |
|
| 566 | - /* |
|
| 558 | + /** |
|
| 559 | + * Open a TAR archive and put the file cursor at the end for data appending |
|
| 560 | + * |
|
| 561 | + * If $file is empty, the tar file will be created in memory |
|
| 562 | + * |
|
| 563 | + * @param string $file |
|
| 564 | + * @throws ArchiveIOException |
|
| 565 | + */ |
|
| 566 | + /* |
|
| 567 | 567 | public function openForAppend($file = '') |
| 568 | 568 | { |
| 569 | 569 | $this->file = $file; |
@@ -593,16 +593,16 @@ discard block |
||
| 593 | 593 | } |
| 594 | 594 | */ |
| 595 | 595 | |
| 596 | - /** |
|
| 597 | - * Append data to a file to the current TAR archive using an existing file in the filesystem |
|
| 598 | - * |
|
| 599 | - * @param string $file path to the original file |
|
| 600 | - * @param int $start starting reading position in file |
|
| 601 | - * @param int $end end position in reading multiple with 512 |
|
| 602 | - * @param string|FileInfo $fileinfo either the name to us in archive (string) or a FileInfo oject with all meta data, empty to take from original |
|
| 603 | - * @throws ArchiveIOException |
|
| 604 | - */ |
|
| 605 | - /* |
|
| 596 | + /** |
|
| 597 | + * Append data to a file to the current TAR archive using an existing file in the filesystem |
|
| 598 | + * |
|
| 599 | + * @param string $file path to the original file |
|
| 600 | + * @param int $start starting reading position in file |
|
| 601 | + * @param int $end end position in reading multiple with 512 |
|
| 602 | + * @param string|FileInfo $fileinfo either the name to us in archive (string) or a FileInfo oject with all meta data, empty to take from original |
|
| 603 | + * @throws ArchiveIOException |
|
| 604 | + */ |
|
| 605 | + /* |
|
| 606 | 606 | * public function appendFileData($file, $fileinfo = '', $start = 0, $limit = 0) |
| 607 | 607 | { |
| 608 | 608 | $end = $start+($limit*512); |
@@ -658,14 +658,14 @@ discard block |
||
| 658 | 658 | return $last_position; |
| 659 | 659 | }*/ |
| 660 | 660 | |
| 661 | - /** |
|
| 662 | - * Adds a file to a TAR archive by appending it's data |
|
| 663 | - * |
|
| 664 | - * @param string $archive name of the archive file |
|
| 665 | - * @param string $file name of the file to read data from |
|
| 666 | - * @param string $start start position from where to start reading data |
|
| 667 | - * @throws ArchiveIOException |
|
| 668 | - */ |
|
| 661 | + /** |
|
| 662 | + * Adds a file to a TAR archive by appending it's data |
|
| 663 | + * |
|
| 664 | + * @param string $archive name of the archive file |
|
| 665 | + * @param string $file name of the file to read data from |
|
| 666 | + * @param string $start start position from where to start reading data |
|
| 667 | + * @throws ArchiveIOException |
|
| 668 | + */ |
|
| 669 | 669 | /*public function addFileToArchive($archive, $file, $start = 0) |
| 670 | 670 | { |
| 671 | 671 | $this->openForAppend($archive); |
@@ -54,10 +54,10 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | curl_setopt($ch, CURLOPT_POST, 1); |
| 56 | 56 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
| 57 | - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
|
| 58 | - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60); |
|
| 59 | - curl_setopt($ch, CURLOPT_TIMEOUT, 1200); |
|
| 60 | - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
| 57 | + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
|
| 58 | + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60); |
|
| 59 | + curl_setopt($ch, CURLOPT_TIMEOUT, 1200); |
|
| 60 | + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
| 61 | 61 | |
| 62 | 62 | curl_setopt($ch, CURLOPT_POSTFIELDS, $send_array ); |
| 63 | 63 | curl_setopt($ch, CURLOPT_VERBOSE, true); |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | private function curl_file_create($filename, $mimetype = '', $postname = '') { |
| 90 | 90 | if (!function_exists('curl_file_create')) { |
| 91 | 91 | |
| 92 | - return "@$filename;filename=" |
|
| 93 | - . ($postname ?: basename($filename)) |
|
| 94 | - . ($mimetype ? ";type=$mimetype" : ''); |
|
| 92 | + return "@$filename;filename=" |
|
| 93 | + . ($postname ?: basename($filename)) |
|
| 94 | + . ($mimetype ? ";type=$mimetype" : ''); |
|
| 95 | 95 | |
| 96 | 96 | }else{ |
| 97 | 97 | |
@@ -221,28 +221,28 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | // add error/update messages |
| 223 | 223 | |
| 224 | - // check if the user have submitted the settings |
|
| 225 | - // wordpress will add the "settings-updated" $_GET parameter to the url |
|
| 226 | - if (isset($_GET['settings-updated'])) { |
|
| 227 | - // add settings saved message with the class of "updated" |
|
| 228 | - add_settings_error('wporg_messages', 'wporg_message', __('Settings Saved', 'wporg'), 'updated'); |
|
| 229 | - } |
|
| 224 | + // check if the user have submitted the settings |
|
| 225 | + // wordpress will add the "settings-updated" $_GET parameter to the url |
|
| 226 | + if (isset($_GET['settings-updated'])) { |
|
| 227 | + // add settings saved message with the class of "updated" |
|
| 228 | + add_settings_error('wporg_messages', 'wporg_message', __('Settings Saved', 'wporg'), 'updated'); |
|
| 229 | + } |
|
| 230 | 230 | |
| 231 | - // show error/update messages |
|
| 232 | - settings_errors('wporg_messages'); |
|
| 233 | - ?> |
|
| 231 | + // show error/update messages |
|
| 232 | + settings_errors('wporg_messages'); |
|
| 233 | + ?> |
|
| 234 | 234 | |
| 235 | 235 | <?php |
| 236 | 236 | $xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
| 237 | 237 | |
| 238 | - if( isset( $_GET[ 'tab' ] ) ) { |
|
| 239 | - $active_tab = $xcloner_sanitization->sanitize_input_as_string($_GET[ 'tab' ]); |
|
| 240 | - } // end if |
|
| 241 | - else{ |
|
| 238 | + if( isset( $_GET[ 'tab' ] ) ) { |
|
| 239 | + $active_tab = $xcloner_sanitization->sanitize_input_as_string($_GET[ 'tab' ]); |
|
| 240 | + } // end if |
|
| 241 | + else{ |
|
| 242 | 242 | $active_tab = "general_options"; |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | - ?> |
|
| 245 | + ?> |
|
| 246 | 246 | <h1><?= esc_html(get_admin_page_title()); ?></h1> |
| 247 | 247 | |
| 248 | 248 | <ul class="nav-tab-wrapper row"> |
@@ -276,9 +276,9 @@ discard block |
||
| 276 | 276 | do_settings_sections('xcloner_cleanup_settings_page'); |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | - // output save settings button |
|
| 280 | - submit_button('Save Settings'); |
|
| 281 | - ?> |
|
| 279 | + // output save settings button |
|
| 280 | + submit_button('Save Settings'); |
|
| 281 | + ?> |
|
| 282 | 282 | </form> |
| 283 | 283 | |
| 284 | 284 | </div> |
@@ -385,9 +385,9 @@ discard block |
||
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | $endpoint = sprintf( |
| 388 | - 'DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s', |
|
| 389 | - get_option("xcloner_azure_account_name"), |
|
| 390 | - get_option("xcloner_azure_api_key") |
|
| 388 | + 'DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s', |
|
| 389 | + get_option("xcloner_azure_account_name"), |
|
| 390 | + get_option("xcloner_azure_api_key") |
|
| 391 | 391 | ); |
| 392 | 392 | |
| 393 | 393 | $blobRestProxy = ServicesBuilder::getInstance()->createBlobService($endpoint); |
@@ -431,12 +431,12 @@ discard block |
||
| 431 | 431 | |
| 432 | 432 | |
| 433 | 433 | $client = new S3Client([ |
| 434 | - 'credentials' => [ |
|
| 435 | - 'key' => get_option("xcloner_aws_key"), |
|
| 436 | - 'secret' => get_option("xcloner_aws_secret") |
|
| 437 | - ], |
|
| 438 | - 'region' => get_option("xcloner_aws_region"), |
|
| 439 | - 'version' => 'latest', |
|
| 434 | + 'credentials' => [ |
|
| 435 | + 'key' => get_option("xcloner_aws_key"), |
|
| 436 | + 'secret' => get_option("xcloner_aws_secret") |
|
| 437 | + ], |
|
| 438 | + 'region' => get_option("xcloner_aws_region"), |
|
| 439 | + 'version' => 'latest', |
|
| 440 | 440 | ]); |
| 441 | 441 | |
| 442 | 442 | $adapter = new AwsS3Adapter($client, get_option("xcloner_aws_bucket_name")); |
@@ -599,9 +599,9 @@ discard block |
||
| 599 | 599 | { |
| 600 | 600 | $query = sprintf('mimeType = \'application/vnd.google-apps.folder\' and \'%s\' in parents and name contains \'%s\'', $parent, $dir); |
| 601 | 601 | $response = $service->files->listFiles([ |
| 602 | - 'pageSize' => 1, |
|
| 603 | - 'q' => $query |
|
| 604 | - ]); |
|
| 602 | + 'pageSize' => 1, |
|
| 603 | + 'q' => $query |
|
| 604 | + ]); |
|
| 605 | 605 | |
| 606 | 606 | if(sizeof($response)) |
| 607 | 607 | { |
@@ -630,16 +630,16 @@ discard block |
||
| 630 | 630 | $this->logger->info(sprintf("Creating the FTP remote storage connection"), array("")); |
| 631 | 631 | |
| 632 | 632 | $adapter = new Adapter([ |
| 633 | - 'host' => get_option("xcloner_ftp_hostname"), |
|
| 634 | - 'username' => get_option("xcloner_ftp_username"), |
|
| 635 | - 'password' => get_option("xcloner_ftp_password"), |
|
| 636 | - |
|
| 637 | - /** optional config settings */ |
|
| 638 | - 'port' => get_option("xcloner_ftp_port", 21), |
|
| 639 | - 'root' => get_option("xcloner_ftp_path"), |
|
| 640 | - 'passive' => get_option("xcloner_ftp_transfer_mode"), |
|
| 641 | - 'ssl' => get_option("xcloner_ftp_ssl_mode"), |
|
| 642 | - 'timeout' => get_option("xcloner_ftp_timeout", 30), |
|
| 633 | + 'host' => get_option("xcloner_ftp_hostname"), |
|
| 634 | + 'username' => get_option("xcloner_ftp_username"), |
|
| 635 | + 'password' => get_option("xcloner_ftp_password"), |
|
| 636 | + |
|
| 637 | + /** optional config settings */ |
|
| 638 | + 'port' => get_option("xcloner_ftp_port", 21), |
|
| 639 | + 'root' => get_option("xcloner_ftp_path"), |
|
| 640 | + 'passive' => get_option("xcloner_ftp_transfer_mode"), |
|
| 641 | + 'ssl' => get_option("xcloner_ftp_ssl_mode"), |
|
| 642 | + 'timeout' => get_option("xcloner_ftp_timeout", 30), |
|
| 643 | 643 | ]); |
| 644 | 644 | |
| 645 | 645 | $adapter->connect(); |
@@ -656,15 +656,15 @@ discard block |
||
| 656 | 656 | $this->logger->info(sprintf("Creating the SFTP remote storage connection"), array("")); |
| 657 | 657 | |
| 658 | 658 | $adapter = new SftpAdapter([ |
| 659 | - 'host' => get_option("xcloner_sftp_hostname"), |
|
| 660 | - 'username' => get_option("xcloner_sftp_username"), |
|
| 661 | - 'password' => get_option("xcloner_sftp_password"), |
|
| 662 | - |
|
| 663 | - /** optional config settings */ |
|
| 664 | - 'port' => get_option("xcloner_sftp_port", 22), |
|
| 665 | - 'root' => get_option("xcloner_sftp_path"), |
|
| 666 | - 'privateKey' => get_option("xcloner_sftp_private_key"), |
|
| 667 | - 'timeout' => get_option("xcloner_ftp_timeout", 30), |
|
| 659 | + 'host' => get_option("xcloner_sftp_hostname"), |
|
| 660 | + 'username' => get_option("xcloner_sftp_username"), |
|
| 661 | + 'password' => get_option("xcloner_sftp_password"), |
|
| 662 | + |
|
| 663 | + /** optional config settings */ |
|
| 664 | + 'port' => get_option("xcloner_sftp_port", 22), |
|
| 665 | + 'root' => get_option("xcloner_sftp_path"), |
|
| 666 | + 'privateKey' => get_option("xcloner_sftp_private_key"), |
|
| 667 | + 'timeout' => get_option("xcloner_ftp_timeout", 30), |
|
| 668 | 668 | ]); |
| 669 | 669 | |
| 670 | 670 | $adapter->connect(); |
@@ -209,262 +209,262 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | public function settings_init() |
| 211 | 211 | { |
| 212 | - global $wpdb; |
|
| 213 | - $this->xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
|
| 212 | + global $wpdb; |
|
| 213 | + $this->xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
|
| 214 | 214 | |
| 215 | - //ADDING MISSING OPTIONS |
|
| 216 | - if( false == get_option( 'xcloner_mysql_settings_page' ) ) { |
|
| 215 | + //ADDING MISSING OPTIONS |
|
| 216 | + if( false == get_option( 'xcloner_mysql_settings_page' ) ) { |
|
| 217 | 217 | add_option( 'xcloner_mysql_settings_page' ); |
| 218 | 218 | } // end if |
| 219 | 219 | |
| 220 | - if( false == get_option( 'xcloner_cron_settings_page' ) ) { |
|
| 220 | + if( false == get_option( 'xcloner_cron_settings_page' ) ) { |
|
| 221 | 221 | add_option( 'xcloner_cron_settings_page' ); |
| 222 | 222 | } // end if |
| 223 | 223 | |
| 224 | - if( false == get_option( 'xcloner_system_settings_page' ) ) { |
|
| 224 | + if( false == get_option( 'xcloner_system_settings_page' ) ) { |
|
| 225 | 225 | add_option( 'xcloner_system_settings_page' ); |
| 226 | 226 | } // end if |
| 227 | 227 | |
| 228 | - if( false == get_option( 'xcloner_cleanup_settings_page' ) ) { |
|
| 228 | + if( false == get_option( 'xcloner_cleanup_settings_page' ) ) { |
|
| 229 | 229 | add_option( 'xcloner_cleanup_settings_page' ); |
| 230 | 230 | } // end if |
| 231 | 231 | |
| 232 | 232 | |
| 233 | - //ADDING SETTING SECTIONS |
|
| 234 | - //GENERAL section |
|
| 235 | - add_settings_section( |
|
| 236 | - 'xcloner_general_settings_group', |
|
| 237 | - __(' '), |
|
| 238 | - array($this, 'xcloner_settings_section_cb'), |
|
| 239 | - 'xcloner_settings_page' |
|
| 240 | - ); |
|
| 241 | - //MYSQL section |
|
| 242 | - add_settings_section( |
|
| 243 | - 'xcloner_mysql_settings_group', |
|
| 244 | - __(' '), |
|
| 245 | - array($this, 'xcloner_settings_section_cb'), |
|
| 246 | - 'xcloner_mysql_settings_page' |
|
| 247 | - ); |
|
| 233 | + //ADDING SETTING SECTIONS |
|
| 234 | + //GENERAL section |
|
| 235 | + add_settings_section( |
|
| 236 | + 'xcloner_general_settings_group', |
|
| 237 | + __(' '), |
|
| 238 | + array($this, 'xcloner_settings_section_cb'), |
|
| 239 | + 'xcloner_settings_page' |
|
| 240 | + ); |
|
| 241 | + //MYSQL section |
|
| 242 | + add_settings_section( |
|
| 243 | + 'xcloner_mysql_settings_group', |
|
| 244 | + __(' '), |
|
| 245 | + array($this, 'xcloner_settings_section_cb'), |
|
| 246 | + 'xcloner_mysql_settings_page' |
|
| 247 | + ); |
|
| 248 | 248 | |
| 249 | - //SYSTEM section |
|
| 250 | - add_settings_section( |
|
| 251 | - 'xcloner_system_settings_group', |
|
| 252 | - __('These are advanced options recommended for developers!','xcloner-backup-and-restore'), |
|
| 253 | - array($this, 'xcloner_settings_section_cb'), |
|
| 254 | - 'xcloner_system_settings_page' |
|
| 255 | - ); |
|
| 249 | + //SYSTEM section |
|
| 250 | + add_settings_section( |
|
| 251 | + 'xcloner_system_settings_group', |
|
| 252 | + __('These are advanced options recommended for developers!','xcloner-backup-and-restore'), |
|
| 253 | + array($this, 'xcloner_settings_section_cb'), |
|
| 254 | + 'xcloner_system_settings_page' |
|
| 255 | + ); |
|
| 256 | 256 | |
| 257 | - //CLEANUP section |
|
| 258 | - add_settings_section( |
|
| 259 | - 'xcloner_cleanup_settings_group', |
|
| 260 | - __(' '), |
|
| 261 | - array($this, 'xcloner_settings_section_cb'), |
|
| 262 | - 'xcloner_cleanup_settings_page' |
|
| 263 | - ); |
|
| 257 | + //CLEANUP section |
|
| 258 | + add_settings_section( |
|
| 259 | + 'xcloner_cleanup_settings_group', |
|
| 260 | + __(' '), |
|
| 261 | + array($this, 'xcloner_settings_section_cb'), |
|
| 262 | + 'xcloner_cleanup_settings_page' |
|
| 263 | + ); |
|
| 264 | 264 | |
| 265 | 265 | |
| 266 | 266 | //CRON section |
| 267 | - add_settings_section( |
|
| 268 | - 'xcloner_cron_settings_group', |
|
| 269 | - __(' '), |
|
| 270 | - array($this, 'xcloner_settings_section_cb'), |
|
| 271 | - 'xcloner_cron_settings_page' |
|
| 272 | - ); |
|
| 267 | + add_settings_section( |
|
| 268 | + 'xcloner_cron_settings_group', |
|
| 269 | + __(' '), |
|
| 270 | + array($this, 'xcloner_settings_section_cb'), |
|
| 271 | + 'xcloner_cron_settings_page' |
|
| 272 | + ); |
|
| 273 | 273 | |
| 274 | 274 | |
| 275 | 275 | |
| 276 | 276 | //REGISTERING THE 'GENERAL SECTION' FIELDS |
| 277 | 277 | register_setting('xcloner_general_settings_group', 'xcloner_backup_compression_level', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
| 278 | - add_settings_field( |
|
| 279 | - 'xcloner_backup_compression_level', |
|
| 280 | - __('Backup Compression Level','xcloner-backup-and-restore'), |
|
| 281 | - array($this, 'do_form_range_field'), |
|
| 282 | - 'xcloner_settings_page', |
|
| 283 | - 'xcloner_general_settings_group', |
|
| 284 | - array('xcloner_backup_compression_level', |
|
| 285 | - __('Options between [0-9]. Value 0 means no compression, while 9 is maximum compression affecting cpu load','xcloner-backup-and-restore'), |
|
| 286 | - 0, |
|
| 287 | - 9 |
|
| 288 | - ) |
|
| 289 | - ); |
|
| 278 | + add_settings_field( |
|
| 279 | + 'xcloner_backup_compression_level', |
|
| 280 | + __('Backup Compression Level','xcloner-backup-and-restore'), |
|
| 281 | + array($this, 'do_form_range_field'), |
|
| 282 | + 'xcloner_settings_page', |
|
| 283 | + 'xcloner_general_settings_group', |
|
| 284 | + array('xcloner_backup_compression_level', |
|
| 285 | + __('Options between [0-9]. Value 0 means no compression, while 9 is maximum compression affecting cpu load','xcloner-backup-and-restore'), |
|
| 286 | + 0, |
|
| 287 | + 9 |
|
| 288 | + ) |
|
| 289 | + ); |
|
| 290 | 290 | |
| 291 | - register_setting('xcloner_general_settings_group', 'xcloner_start_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
|
| 292 | - add_settings_field( |
|
| 293 | - 'xcloner_start_path', |
|
| 294 | - __('Backup Start Location','xcloner-backup-and-restore'), |
|
| 295 | - array($this, 'do_form_text_field'), |
|
| 296 | - 'xcloner_settings_page', |
|
| 297 | - 'xcloner_general_settings_group', |
|
| 298 | - array('xcloner_start_path', |
|
| 291 | + register_setting('xcloner_general_settings_group', 'xcloner_start_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
|
| 292 | + add_settings_field( |
|
| 293 | + 'xcloner_start_path', |
|
| 294 | + __('Backup Start Location','xcloner-backup-and-restore'), |
|
| 295 | + array($this, 'do_form_text_field'), |
|
| 296 | + 'xcloner_settings_page', |
|
| 297 | + 'xcloner_general_settings_group', |
|
| 298 | + array('xcloner_start_path', |
|
| 299 | 299 | __('Base path location from where XCloner can start the Backup.','xcloner-backup-and-restore'), |
| 300 | 300 | $this->get_xcloner_start_path(), |
| 301 | 301 | //'disabled' |
| 302 | 302 | ) |
| 303 | - ); |
|
| 303 | + ); |
|
| 304 | 304 | |
| 305 | - register_setting('xcloner_general_settings_group', 'xcloner_store_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
|
| 306 | - add_settings_field( |
|
| 307 | - 'xcloner_store_path', |
|
| 308 | - __('Backup Storage Location','xcloner-backup-and-restore'), |
|
| 309 | - array($this, 'do_form_text_field'), |
|
| 310 | - 'xcloner_settings_page', |
|
| 311 | - 'xcloner_general_settings_group', |
|
| 312 | - array('xcloner_store_path', |
|
| 305 | + register_setting('xcloner_general_settings_group', 'xcloner_store_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
|
| 306 | + add_settings_field( |
|
| 307 | + 'xcloner_store_path', |
|
| 308 | + __('Backup Storage Location','xcloner-backup-and-restore'), |
|
| 309 | + array($this, 'do_form_text_field'), |
|
| 310 | + 'xcloner_settings_page', |
|
| 311 | + 'xcloner_general_settings_group', |
|
| 312 | + array('xcloner_store_path', |
|
| 313 | 313 | __('Location where XCloner will store the Backup archives.','xcloner-backup-and-restore'), |
| 314 | 314 | $this->get_xcloner_store_path(), |
| 315 | 315 | //'disabled' |
| 316 | 316 | ) |
| 317 | - ); |
|
| 317 | + ); |
|
| 318 | 318 | |
| 319 | - register_setting('xcloner_general_settings_group', 'xcloner_enable_log', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
|
| 320 | - add_settings_field( |
|
| 321 | - 'xcloner_enable_log', |
|
| 322 | - __('Enable XCloner Backup Log','xcloner-backup-and-restore'), |
|
| 323 | - array($this, 'do_form_switch_field'), |
|
| 324 | - 'xcloner_settings_page', |
|
| 325 | - 'xcloner_general_settings_group', |
|
| 326 | - array('xcloner_enable_log', |
|
| 319 | + register_setting('xcloner_general_settings_group', 'xcloner_enable_log', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
|
| 320 | + add_settings_field( |
|
| 321 | + 'xcloner_enable_log', |
|
| 322 | + __('Enable XCloner Backup Log','xcloner-backup-and-restore'), |
|
| 323 | + array($this, 'do_form_switch_field'), |
|
| 324 | + 'xcloner_settings_page', |
|
| 325 | + 'xcloner_general_settings_group', |
|
| 326 | + array('xcloner_enable_log', |
|
| 327 | 327 | 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()) |
| 328 | 328 | ) |
| 329 | 329 | ); |
| 330 | 330 | |
| 331 | 331 | register_setting('xcloner_general_settings_group', 'xcloner_regex_exclude', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
| 332 | - add_settings_field( |
|
| 333 | - 'xcloner_regex_exclude', |
|
| 334 | - __('Regex Exclude Files','xcloner-backup-and-restore'), |
|
| 335 | - array($this, 'do_form_textarea_field'), |
|
| 336 | - 'xcloner_settings_page', |
|
| 337 | - 'xcloner_general_settings_group', |
|
| 338 | - array('xcloner_regex_exclude', |
|
| 332 | + add_settings_field( |
|
| 333 | + 'xcloner_regex_exclude', |
|
| 334 | + __('Regex Exclude Files','xcloner-backup-and-restore'), |
|
| 335 | + array($this, 'do_form_textarea_field'), |
|
| 336 | + 'xcloner_settings_page', |
|
| 337 | + 'xcloner_general_settings_group', |
|
| 338 | + array('xcloner_regex_exclude', |
|
| 339 | 339 | __('Regular expression match to exclude files and folders, example patterns provided below, one pattern per line','xcloner-backup-and-restore'), |
| 340 | 340 | //$this->get_xcloner_store_path(), |
| 341 | 341 | //'disabled' |
| 342 | 342 | ) |
| 343 | - ); |
|
| 343 | + ); |
|
| 344 | 344 | |
| 345 | 345 | //REGISTERING THE 'MYSQL SECTION' FIELDS |
| 346 | 346 | register_setting('xcloner_mysql_settings_group', 'xcloner_enable_mysql_backup', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
| 347 | - add_settings_field( |
|
| 348 | - 'xcloner_enable_mysql_backup', |
|
| 349 | - __('Enable Mysql Backup','xcloner-backup-and-restore'), |
|
| 350 | - array($this, 'do_form_switch_field'), |
|
| 351 | - 'xcloner_mysql_settings_page', |
|
| 352 | - 'xcloner_mysql_settings_group', |
|
| 353 | - array('xcloner_enable_mysql_backup', |
|
| 347 | + add_settings_field( |
|
| 348 | + 'xcloner_enable_mysql_backup', |
|
| 349 | + __('Enable Mysql Backup','xcloner-backup-and-restore'), |
|
| 350 | + array($this, 'do_form_switch_field'), |
|
| 351 | + 'xcloner_mysql_settings_page', |
|
| 352 | + 'xcloner_mysql_settings_group', |
|
| 353 | + array('xcloner_enable_mysql_backup', |
|
| 354 | 354 | __('Enable Mysql Backup Option. If you don\'t want to backup the database, you can disable this.','xcloner-backup-and-restore') |
| 355 | 355 | ) |
| 356 | - ); |
|
| 356 | + ); |
|
| 357 | 357 | |
| 358 | - register_setting('xcloner_mysql_settings_group', 'xcloner_backup_only_wp_tables'); |
|
| 359 | - add_settings_field( |
|
| 360 | - 'xcloner_backup_only_wp_tables', |
|
| 361 | - __('Backup only WP tables','xcloner-backup-and-restore'), |
|
| 362 | - array($this, 'do_form_switch_field'), |
|
| 363 | - 'xcloner_mysql_settings_page', |
|
| 364 | - 'xcloner_mysql_settings_group', |
|
| 365 | - array('xcloner_backup_only_wp_tables', |
|
| 358 | + register_setting('xcloner_mysql_settings_group', 'xcloner_backup_only_wp_tables'); |
|
| 359 | + add_settings_field( |
|
| 360 | + 'xcloner_backup_only_wp_tables', |
|
| 361 | + __('Backup only WP tables','xcloner-backup-and-restore'), |
|
| 362 | + array($this, 'do_form_switch_field'), |
|
| 363 | + 'xcloner_mysql_settings_page', |
|
| 364 | + 'xcloner_mysql_settings_group', |
|
| 365 | + array('xcloner_backup_only_wp_tables', |
|
| 366 | 366 | sprintf(__('Enable this if you only want to Backup only tables starting with \'%s\' prefix','xcloner-backup-and-restore'), $this->get_table_prefix()) |
| 367 | 367 | ) |
| 368 | - ); |
|
| 368 | + ); |
|
| 369 | 369 | |
| 370 | - register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_hostname', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
| 371 | - add_settings_field( |
|
| 372 | - 'xcloner_mysql_hostname', |
|
| 373 | - __('Mysql Hostname','xcloner-backup-and-restore'), |
|
| 374 | - array($this, 'do_form_text_field'), |
|
| 375 | - 'xcloner_mysql_settings_page', |
|
| 376 | - 'xcloner_mysql_settings_group', |
|
| 377 | - array('xcloner_mysql_hostname', |
|
| 370 | + register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_hostname', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
| 371 | + add_settings_field( |
|
| 372 | + 'xcloner_mysql_hostname', |
|
| 373 | + __('Mysql Hostname','xcloner-backup-and-restore'), |
|
| 374 | + array($this, 'do_form_text_field'), |
|
| 375 | + 'xcloner_mysql_settings_page', |
|
| 376 | + 'xcloner_mysql_settings_group', |
|
| 377 | + array('xcloner_mysql_hostname', |
|
| 378 | 378 | __('Wordpress mysql hostname','xcloner-backup-and-restore'), |
| 379 | 379 | $this->get_db_hostname(), |
| 380 | 380 | 'disabled' |
| 381 | 381 | ) |
| 382 | - ); |
|
| 382 | + ); |
|
| 383 | 383 | |
| 384 | - register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_username', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
| 385 | - add_settings_field( |
|
| 386 | - 'xcloner_mysql_username', |
|
| 387 | - __('Mysql Username','xcloner-backup-and-restore'), |
|
| 388 | - array($this, 'do_form_text_field'), |
|
| 389 | - 'xcloner_mysql_settings_page', |
|
| 390 | - 'xcloner_mysql_settings_group', |
|
| 391 | - array('xcloner_mysql_username', |
|
| 384 | + register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_username', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
| 385 | + add_settings_field( |
|
| 386 | + 'xcloner_mysql_username', |
|
| 387 | + __('Mysql Username','xcloner-backup-and-restore'), |
|
| 388 | + array($this, 'do_form_text_field'), |
|
| 389 | + 'xcloner_mysql_settings_page', |
|
| 390 | + 'xcloner_mysql_settings_group', |
|
| 391 | + array('xcloner_mysql_username', |
|
| 392 | 392 | __('Wordpress mysql username','xcloner-backup-and-restore'), |
| 393 | 393 | $this->get_db_username(), |
| 394 | 394 | 'disabled' |
| 395 | 395 | ) |
| 396 | - ); |
|
| 396 | + ); |
|
| 397 | 397 | |
| 398 | - register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_database', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
| 399 | - add_settings_field( |
|
| 400 | - 'xcloner_mysql_database', |
|
| 401 | - __('Mysql Database','xcloner-backup-and-restore'), |
|
| 402 | - array($this, 'do_form_text_field'), |
|
| 403 | - 'xcloner_mysql_settings_page', |
|
| 404 | - 'xcloner_mysql_settings_group', |
|
| 405 | - array('xcloner_mysql_database', |
|
| 398 | + register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_database', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
| 399 | + add_settings_field( |
|
| 400 | + 'xcloner_mysql_database', |
|
| 401 | + __('Mysql Database','xcloner-backup-and-restore'), |
|
| 402 | + array($this, 'do_form_text_field'), |
|
| 403 | + 'xcloner_mysql_settings_page', |
|
| 404 | + 'xcloner_mysql_settings_group', |
|
| 405 | + array('xcloner_mysql_database', |
|
| 406 | 406 | __('Wordpress mysql database','xcloner-backup-and-restore'), |
| 407 | 407 | $this->get_db_database(), |
| 408 | 408 | 'disabled' |
| 409 | 409 | ) |
| 410 | - ); |
|
| 410 | + ); |
|
| 411 | 411 | |
| 412 | - //REGISTERING THE 'SYSTEM SECTION' FIELDS |
|
| 413 | - register_setting('xcloner_system_settings_group', 'xcloner_size_limit_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
|
| 414 | - add_settings_field( |
|
| 415 | - 'xcloner_size_limit_per_request', |
|
| 416 | - __('Data Size Limit Per Request','xcloner-backup-and-restore'), |
|
| 417 | - array($this, 'do_form_range_field'), |
|
| 418 | - 'xcloner_system_settings_page', |
|
| 419 | - 'xcloner_system_settings_group', |
|
| 420 | - array('xcloner_size_limit_per_request', |
|
| 421 | - __('Use this option to set how much file data can XCloner backup in one AJAX request. Range 0-1024 MB','xcloner-backup-and-restore'), |
|
| 422 | - 0, |
|
| 423 | - 1024 |
|
| 424 | - ) |
|
| 425 | - ); |
|
| 412 | + //REGISTERING THE 'SYSTEM SECTION' FIELDS |
|
| 413 | + register_setting('xcloner_system_settings_group', 'xcloner_size_limit_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
|
| 414 | + add_settings_field( |
|
| 415 | + 'xcloner_size_limit_per_request', |
|
| 416 | + __('Data Size Limit Per Request','xcloner-backup-and-restore'), |
|
| 417 | + array($this, 'do_form_range_field'), |
|
| 418 | + 'xcloner_system_settings_page', |
|
| 419 | + 'xcloner_system_settings_group', |
|
| 420 | + array('xcloner_size_limit_per_request', |
|
| 421 | + __('Use this option to set how much file data can XCloner backup in one AJAX request. Range 0-1024 MB','xcloner-backup-and-restore'), |
|
| 422 | + 0, |
|
| 423 | + 1024 |
|
| 424 | + ) |
|
| 425 | + ); |
|
| 426 | 426 | |
| 427 | 427 | register_setting('xcloner_system_settings_group', 'xcloner_files_to_process_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
| 428 | - add_settings_field( |
|
| 429 | - 'xcloner_files_to_process_per_request', |
|
| 430 | - __('Files To Process Per Request','xcloner-backup-and-restore'), |
|
| 431 | - array($this, 'do_form_range_field'), |
|
| 432 | - 'xcloner_system_settings_page', |
|
| 433 | - 'xcloner_system_settings_group', |
|
| 434 | - array('xcloner_files_to_process_per_request', |
|
| 435 | - __('Use this option to set how many files XCloner should process at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
| 436 | - 0, |
|
| 437 | - 1000 |
|
| 438 | - ) |
|
| 439 | - ); |
|
| 428 | + add_settings_field( |
|
| 429 | + 'xcloner_files_to_process_per_request', |
|
| 430 | + __('Files To Process Per Request','xcloner-backup-and-restore'), |
|
| 431 | + array($this, 'do_form_range_field'), |
|
| 432 | + 'xcloner_system_settings_page', |
|
| 433 | + 'xcloner_system_settings_group', |
|
| 434 | + array('xcloner_files_to_process_per_request', |
|
| 435 | + __('Use this option to set how many files XCloner should process at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
| 436 | + 0, |
|
| 437 | + 1000 |
|
| 438 | + ) |
|
| 439 | + ); |
|
| 440 | 440 | |
| 441 | 441 | register_setting('xcloner_system_settings_group', 'xcloner_directories_to_scan_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
| 442 | - add_settings_field( |
|
| 443 | - 'xcloner_directories_to_scan_per_request', |
|
| 444 | - __('Directories To Scan Per Request','xcloner-backup-and-restore'), |
|
| 445 | - array($this, 'do_form_range_field'), |
|
| 446 | - 'xcloner_system_settings_page', |
|
| 447 | - 'xcloner_system_settings_group', |
|
| 448 | - array('xcloner_directories_to_scan_per_request', |
|
| 449 | - __('Use this option to set how many directories XCloner should scan at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
| 450 | - 0, |
|
| 451 | - 1000 |
|
| 452 | - ) |
|
| 453 | - ); |
|
| 442 | + add_settings_field( |
|
| 443 | + 'xcloner_directories_to_scan_per_request', |
|
| 444 | + __('Directories To Scan Per Request','xcloner-backup-and-restore'), |
|
| 445 | + array($this, 'do_form_range_field'), |
|
| 446 | + 'xcloner_system_settings_page', |
|
| 447 | + 'xcloner_system_settings_group', |
|
| 448 | + array('xcloner_directories_to_scan_per_request', |
|
| 449 | + __('Use this option to set how many directories XCloner should scan at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
| 450 | + 0, |
|
| 451 | + 1000 |
|
| 452 | + ) |
|
| 453 | + ); |
|
| 454 | 454 | |
| 455 | 455 | register_setting('xcloner_system_settings_group', 'xcloner_database_records_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
| 456 | - add_settings_field( |
|
| 457 | - 'xcloner_database_records_per_request', |
|
| 458 | - __('Database Records Per Request','xcloner-backup-and-restore'), |
|
| 459 | - array($this, 'do_form_range_field'), |
|
| 460 | - 'xcloner_system_settings_page', |
|
| 461 | - 'xcloner_system_settings_group', |
|
| 462 | - array('xcloner_database_records_per_request', |
|
| 463 | - __('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'), |
|
| 464 | - 0, |
|
| 465 | - 100000 |
|
| 466 | - ) |
|
| 467 | - ); |
|
| 456 | + add_settings_field( |
|
| 457 | + 'xcloner_database_records_per_request', |
|
| 458 | + __('Database Records Per Request','xcloner-backup-and-restore'), |
|
| 459 | + array($this, 'do_form_range_field'), |
|
| 460 | + 'xcloner_system_settings_page', |
|
| 461 | + 'xcloner_system_settings_group', |
|
| 462 | + array('xcloner_database_records_per_request', |
|
| 463 | + __('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'), |
|
| 464 | + 0, |
|
| 465 | + 100000 |
|
| 466 | + ) |
|
| 467 | + ); |
|
| 468 | 468 | |
| 469 | 469 | /*register_setting('xcloner_system_settings_group', 'xcloner_diff_backup_recreate_period', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
| 470 | 470 | add_settings_field( |
@@ -479,90 +479,90 @@ discard block |
||
| 479 | 479 | );*/ |
| 480 | 480 | |
| 481 | 481 | register_setting('xcloner_system_settings_group', 'xcloner_exclude_files_larger_than_mb', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
| 482 | - add_settings_field( |
|
| 483 | - 'xcloner_exclude_files_larger_than_mb', |
|
| 484 | - __('Exclude files larger than (MB)','xcloner-backup-and-restore'), |
|
| 485 | - array($this, 'do_form_number_field'), |
|
| 486 | - 'xcloner_system_settings_page', |
|
| 487 | - 'xcloner_system_settings_group', |
|
| 488 | - array('xcloner_exclude_files_larger_than_mb', |
|
| 489 | - __('Use this option to automatically exclude files larger than a certain size in MB, or set to 0 to include all. Range 0-1000 MB','xcloner-backup-and-restore'), |
|
| 490 | - ) |
|
| 491 | - ); |
|
| 482 | + add_settings_field( |
|
| 483 | + 'xcloner_exclude_files_larger_than_mb', |
|
| 484 | + __('Exclude files larger than (MB)','xcloner-backup-and-restore'), |
|
| 485 | + array($this, 'do_form_number_field'), |
|
| 486 | + 'xcloner_system_settings_page', |
|
| 487 | + 'xcloner_system_settings_group', |
|
| 488 | + array('xcloner_exclude_files_larger_than_mb', |
|
| 489 | + __('Use this option to automatically exclude files larger than a certain size in MB, or set to 0 to include all. Range 0-1000 MB','xcloner-backup-and-restore'), |
|
| 490 | + ) |
|
| 491 | + ); |
|
| 492 | 492 | |
| 493 | 493 | register_setting('xcloner_system_settings_group', 'xcloner_split_backup_limit', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
| 494 | - add_settings_field( |
|
| 495 | - 'xcloner_split_backup_limit', |
|
| 496 | - __('Split Backup Archive Limit (MB)','xcloner-backup-and-restore'), |
|
| 497 | - array($this, 'do_form_number_field'), |
|
| 498 | - 'xcloner_system_settings_page', |
|
| 499 | - 'xcloner_system_settings_group', |
|
| 500 | - array('xcloner_split_backup_limit', |
|
| 501 | - __('Use this option to automatically split the backup archive into smaller parts. Range 0-10000 MB','xcloner-backup-and-restore'), |
|
| 502 | - ) |
|
| 503 | - ); |
|
| 494 | + add_settings_field( |
|
| 495 | + 'xcloner_split_backup_limit', |
|
| 496 | + __('Split Backup Archive Limit (MB)','xcloner-backup-and-restore'), |
|
| 497 | + array($this, 'do_form_number_field'), |
|
| 498 | + 'xcloner_system_settings_page', |
|
| 499 | + 'xcloner_system_settings_group', |
|
| 500 | + array('xcloner_split_backup_limit', |
|
| 501 | + __('Use this option to automatically split the backup archive into smaller parts. Range 0-10000 MB','xcloner-backup-and-restore'), |
|
| 502 | + ) |
|
| 503 | + ); |
|
| 504 | 504 | |
| 505 | - register_setting('xcloner_system_settings_group', 'xcloner_force_tmp_path_site_root'); |
|
| 506 | - add_settings_field( |
|
| 507 | - 'xcloner_force_tmp_path_site_root', |
|
| 508 | - __('Force Temporary Path Within XCloner Storage','xcloner-backup-and-restore'), |
|
| 509 | - array($this, 'do_form_switch_field'), |
|
| 510 | - 'xcloner_system_settings_page', |
|
| 511 | - 'xcloner_system_settings_group', |
|
| 512 | - array('xcloner_force_tmp_path_site_root', |
|
| 505 | + register_setting('xcloner_system_settings_group', 'xcloner_force_tmp_path_site_root'); |
|
| 506 | + add_settings_field( |
|
| 507 | + 'xcloner_force_tmp_path_site_root', |
|
| 508 | + __('Force Temporary Path Within XCloner Storage','xcloner-backup-and-restore'), |
|
| 509 | + array($this, 'do_form_switch_field'), |
|
| 510 | + 'xcloner_system_settings_page', |
|
| 511 | + 'xcloner_system_settings_group', |
|
| 512 | + array('xcloner_force_tmp_path_site_root', |
|
| 513 | 513 | 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()) |
| 514 | 514 | ) |
| 515 | - ); |
|
| 515 | + ); |
|
| 516 | 516 | |
| 517 | 517 | //REGISTERING THE 'CLEANUP SECTION' FIELDS |
| 518 | 518 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_days', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
| 519 | - add_settings_field( |
|
| 520 | - 'xcloner_cleanup_retention_limit_days', |
|
| 521 | - __('Cleanup by Date(days)','xcloner-backup-and-restore'), |
|
| 522 | - array($this, 'do_form_number_field'), |
|
| 523 | - 'xcloner_cleanup_settings_page', |
|
| 524 | - 'xcloner_cleanup_settings_group', |
|
| 525 | - array('xcloner_cleanup_retention_limit_days', |
|
| 519 | + add_settings_field( |
|
| 520 | + 'xcloner_cleanup_retention_limit_days', |
|
| 521 | + __('Cleanup by Date(days)','xcloner-backup-and-restore'), |
|
| 522 | + array($this, 'do_form_number_field'), |
|
| 523 | + 'xcloner_cleanup_settings_page', |
|
| 524 | + 'xcloner_cleanup_settings_group', |
|
| 525 | + array('xcloner_cleanup_retention_limit_days', |
|
| 526 | 526 | __('Specify the maximum number of days a backup archive can be kept on the server. 0 disables this option','xcloner-backup-and-restore') |
| 527 | 527 | ) |
| 528 | - ); |
|
| 528 | + ); |
|
| 529 | 529 | |
| 530 | 530 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_archives', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
| 531 | - add_settings_field( |
|
| 532 | - 'xcloner_cleanup_retention_limit_archives', |
|
| 533 | - __('Cleanup by Quantity','xcloner-backup-and-restore'), |
|
| 534 | - array($this, 'do_form_number_field'), |
|
| 535 | - 'xcloner_cleanup_settings_page', |
|
| 536 | - 'xcloner_cleanup_settings_group', |
|
| 537 | - array('xcloner_cleanup_retention_limit_archives', |
|
| 531 | + add_settings_field( |
|
| 532 | + 'xcloner_cleanup_retention_limit_archives', |
|
| 533 | + __('Cleanup by Quantity','xcloner-backup-and-restore'), |
|
| 534 | + array($this, 'do_form_number_field'), |
|
| 535 | + 'xcloner_cleanup_settings_page', |
|
| 536 | + 'xcloner_cleanup_settings_group', |
|
| 537 | + array('xcloner_cleanup_retention_limit_archives', |
|
| 538 | 538 | __('Specify the maximum number of backup archives to keep on the server. 0 disables this option','xcloner-backup-and-restore') |
| 539 | 539 | ) |
| 540 | - ); |
|
| 540 | + ); |
|
| 541 | 541 | |
| 542 | 542 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_capacity_limit', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
| 543 | - add_settings_field( |
|
| 544 | - 'xcloner_cleanup_capacity_limit', |
|
| 545 | - __('Cleanup by Capacity(MB)','xcloner-backup-and-restore'), |
|
| 546 | - array($this, 'do_form_number_field'), |
|
| 547 | - 'xcloner_cleanup_settings_page', |
|
| 548 | - 'xcloner_cleanup_settings_group', |
|
| 549 | - array('xcloner_cleanup_capacity_limit', |
|
| 543 | + add_settings_field( |
|
| 544 | + 'xcloner_cleanup_capacity_limit', |
|
| 545 | + __('Cleanup by Capacity(MB)','xcloner-backup-and-restore'), |
|
| 546 | + array($this, 'do_form_number_field'), |
|
| 547 | + 'xcloner_cleanup_settings_page', |
|
| 548 | + 'xcloner_cleanup_settings_group', |
|
| 549 | + array('xcloner_cleanup_capacity_limit', |
|
| 550 | 550 | __('Remove oldest backups if all created backups exceed the configured limit in Megabytes. 0 disables this option','xcloner-backup-and-restore') |
| 551 | 551 | ) |
| 552 | - ); |
|
| 552 | + ); |
|
| 553 | 553 | |
| 554 | 554 | //REGISTERING THE 'CRON SECTION' FIELDS |
| 555 | 555 | register_setting('xcloner_cron_settings_group', 'xcloner_cron_frequency'); |
| 556 | - add_settings_field( |
|
| 557 | - 'xcloner_cron_frequency', |
|
| 558 | - __('Cron frequency','xcloner-backup-and-restore'), |
|
| 559 | - array($this, 'do_form_text_field'), |
|
| 560 | - 'xcloner_cron_settings_page', |
|
| 561 | - 'xcloner_cron_settings_group', |
|
| 562 | - array('xcloner_cron_frequency', |
|
| 556 | + add_settings_field( |
|
| 557 | + 'xcloner_cron_frequency', |
|
| 558 | + __('Cron frequency','xcloner-backup-and-restore'), |
|
| 559 | + array($this, 'do_form_text_field'), |
|
| 560 | + 'xcloner_cron_settings_page', |
|
| 561 | + 'xcloner_cron_settings_group', |
|
| 562 | + array('xcloner_cron_frequency', |
|
| 563 | 563 | __('Cron frequency') |
| 564 | 564 | ) |
| 565 | - ); |
|
| 565 | + ); |
|
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | // section content cb |
| 576 | 576 | public function xcloner_settings_section_cb() |
| 577 | 577 | { |
| 578 | - //echo '<p>WPOrg Section Introduction.</p>'; |
|
| 578 | + //echo '<p>WPOrg Section Introduction.</p>'; |
|
| 579 | 579 | } |
| 580 | 580 | |
| 581 | 581 | // text field content cb |
@@ -590,8 +590,8 @@ discard block |
||
| 590 | 590 | |
| 591 | 591 | if(!$value) |
| 592 | 592 | $value = get_option($fieldname); |
| 593 | - // output the field |
|
| 594 | - ?> |
|
| 593 | + // output the field |
|
| 594 | + ?> |
|
| 595 | 595 | <div class="row"> |
| 596 | 596 | <div class="input-field col s10 m10 l8"> |
| 597 | 597 | <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) : ''; ?>"> |
@@ -617,8 +617,8 @@ discard block |
||
| 617 | 617 | |
| 618 | 618 | if(!$value) |
| 619 | 619 | $value = get_option($fieldname); |
| 620 | - // output the field |
|
| 621 | - ?> |
|
| 620 | + // output the field |
|
| 621 | + ?> |
|
| 622 | 622 | <div class="row"> |
| 623 | 623 | <div class="input-field col s10 m10 l8"> |
| 624 | 624 | <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> |
@@ -661,8 +661,8 @@ discard block |
||
| 661 | 661 | |
| 662 | 662 | if(!$value) |
| 663 | 663 | $value = get_option($fieldname); |
| 664 | - // output the field |
|
| 665 | - ?> |
|
| 664 | + // output the field |
|
| 665 | + ?> |
|
| 666 | 666 | <div class="row"> |
| 667 | 667 | <div class="input-field col s10 m5 l3"> |
| 668 | 668 | <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) : ''; ?>"> |
@@ -220,12 +220,12 @@ discard block |
||
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if( $wpdb->last_error ) { |
| 223 | - $response['error'] = 1; |
|
| 224 | - $response['error_message'] = $wpdb->last_error/*."--".$wpdb->last_query*/; |
|
| 223 | + $response['error'] = 1; |
|
| 224 | + $response['error_message'] = $wpdb->last_error/*."--".$wpdb->last_query*/; |
|
| 225 | 225 | |
| 226 | - } |
|
| 226 | + } |
|
| 227 | 227 | |
| 228 | - $scheduler->update_wp_cron_hooks(); |
|
| 228 | + $scheduler->update_wp_cron_hooks(); |
|
| 229 | 229 | $response['finished'] = 1; |
| 230 | 230 | |
| 231 | 231 | $this->send_response($response); |
@@ -916,14 +916,14 @@ discard block |
||
| 916 | 916 | $tar->close(); |
| 917 | 917 | |
| 918 | 918 | if (file_exists($tmp_file)) { |
| 919 | - header('Content-Description: File Transfer'); |
|
| 920 | - header('Content-Type: application/octet-stream'); |
|
| 921 | - header('Content-Disposition: attachment; filename="'.basename($tmp_file).'"'); |
|
| 922 | - header('Expires: 0'); |
|
| 923 | - header('Cache-Control: must-revalidate'); |
|
| 924 | - header('Pragma: public'); |
|
| 925 | - header('Content-Length: ' . filesize($tmp_file)); |
|
| 926 | - readfile($tmp_file); |
|
| 919 | + header('Content-Description: File Transfer'); |
|
| 920 | + header('Content-Type: application/octet-stream'); |
|
| 921 | + header('Content-Disposition: attachment; filename="'.basename($tmp_file).'"'); |
|
| 922 | + header('Expires: 0'); |
|
| 923 | + header('Cache-Control: must-revalidate'); |
|
| 924 | + header('Pragma: public'); |
|
| 925 | + header('Content-Length: ' . filesize($tmp_file)); |
|
| 926 | + readfile($tmp_file); |
|
| 927 | 927 | |
| 928 | 928 | } |
| 929 | 929 | |
@@ -950,24 +950,24 @@ discard block |
||
| 950 | 950 | |
| 951 | 951 | |
| 952 | 952 | header('Pragma: public'); |
| 953 | - header('Expires: 0'); |
|
| 954 | - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
|
| 955 | - header('Cache-Control: private', false); |
|
| 956 | - header('Content-Transfer-Encoding: binary'); |
|
| 957 | - header('Content-Disposition: attachment; filename="'.$metadata['path'].'";'); |
|
| 958 | - header('Content-Type: application/octet-stream'); |
|
| 959 | - header('Content-Length: ' . $metadata['size']); |
|
| 953 | + header('Expires: 0'); |
|
| 954 | + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
|
| 955 | + header('Cache-Control: private', false); |
|
| 956 | + header('Content-Transfer-Encoding: binary'); |
|
| 957 | + header('Content-Disposition: attachment; filename="'.$metadata['path'].'";'); |
|
| 958 | + header('Content-Type: application/octet-stream'); |
|
| 959 | + header('Content-Length: ' . $metadata['size']); |
|
| 960 | 960 | |
| 961 | - @ob_end_clean(); |
|
| 961 | + @ob_end_clean(); |
|
| 962 | 962 | |
| 963 | - $chunkSize = 1024 * 1024; |
|
| 964 | - while (!feof($read_stream)) |
|
| 965 | - { |
|
| 966 | - $buffer = fread($read_stream, $chunkSize); |
|
| 967 | - echo $buffer; |
|
| 968 | - } |
|
| 969 | - fclose($read_stream); |
|
| 970 | - exit; |
|
| 963 | + $chunkSize = 1024 * 1024; |
|
| 964 | + while (!feof($read_stream)) |
|
| 965 | + { |
|
| 966 | + $buffer = fread($read_stream, $chunkSize); |
|
| 967 | + echo $buffer; |
|
| 968 | + } |
|
| 969 | + fclose($read_stream); |
|
| 970 | + exit; |
|
| 971 | 971 | |
| 972 | 972 | } |
| 973 | 973 | |
@@ -299,12 +299,12 @@ discard block |
||
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | public function getMetadataFull($adapter = "storage_adapter" , $path) |
| 302 | - { |
|
| 303 | - $location = $this->$adapter->applyPathPrefix($path); |
|
| 304 | - $spl_info = new SplFileInfo($location); |
|
| 302 | + { |
|
| 303 | + $location = $this->$adapter->applyPathPrefix($path); |
|
| 304 | + $spl_info = new SplFileInfo($location); |
|
| 305 | 305 | |
| 306 | - return ($spl_info); |
|
| 307 | - } |
|
| 306 | + return ($spl_info); |
|
| 307 | + } |
|
| 308 | 308 | |
| 309 | 309 | |
| 310 | 310 | public function get_backup_archives_list($storage_selection = "") |
@@ -697,27 +697,27 @@ discard block |
||
| 697 | 697 | |
| 698 | 698 | private function array_orderby() |
| 699 | 699 | { |
| 700 | - $args = func_get_args(); |
|
| 701 | - $data = array_shift($args); |
|
| 700 | + $args = func_get_args(); |
|
| 701 | + $data = array_shift($args); |
|
| 702 | 702 | |
| 703 | - foreach ($args as $n => $field) { |
|
| 704 | - if (is_string($field)) { |
|
| 705 | - $tmp = array(); |
|
| 706 | - foreach ($data as $key => $row) |
|
| 707 | - { |
|
| 703 | + foreach ($args as $n => $field) { |
|
| 704 | + if (is_string($field)) { |
|
| 705 | + $tmp = array(); |
|
| 706 | + foreach ($data as $key => $row) |
|
| 707 | + { |
|
| 708 | 708 | if(is_array($row)) |
| 709 | 709 | $tmp[$key] = $row[$field]; |
| 710 | 710 | else |
| 711 | 711 | $tmp[$key] = $row->$field; |
| 712 | 712 | } |
| 713 | - $args[$n] = $tmp; |
|
| 714 | - } |
|
| 715 | - } |
|
| 716 | - $args[] = &$data; |
|
| 713 | + $args[$n] = $tmp; |
|
| 714 | + } |
|
| 715 | + } |
|
| 716 | + $args[] = &$data; |
|
| 717 | 717 | |
| 718 | - call_user_func_array('array_multisort', $args); |
|
| 718 | + call_user_func_array('array_multisort', $args); |
|
| 719 | 719 | |
| 720 | - return array_pop($args); |
|
| 720 | + return array_pop($args); |
|
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | private function check_file_diff_time($file) |