Changeset 2766823
- Timestamp:
- 08/05/2022 10:50:03 AM (4 years ago)
- Location:
- wp-time-capsule/trunk
- Files:
-
- 15 edited
-
Classes/AppFunctions/AppFunctions.php (modified) (1 diff)
-
Classes/DatabaseBackup.php (modified) (2 diffs)
-
Classes/Processed/Base.php (modified) (5 diffs)
-
Classes/Processed/Files.php (modified) (3 diffs)
-
Classes/Processed/Restoredfiles.php (modified) (2 diffs)
-
Classes/Processed/iterator.php (modified) (1 diff)
-
Classes/class-file-iterator.php (modified) (2 diffs)
-
Classes/class-replace-db-links.php (modified) (8 diffs)
-
Pro/Staging/init.php (modified) (1 diff)
-
S3/class.s3.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
time-capsule-update-actions.js (modified) (1 diff)
-
wp-tcapsule-bridge/wptc-ajax.php (modified) (4 diffs)
-
wp-time-capsule.php (modified) (3 diffs)
-
wptc-constants.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-time-capsule/trunk/Classes/AppFunctions/AppFunctions.php
r2599701 r2766823 847 847 $this->config->set_option('update_prev_backups_1_14_10', true); //set it like it already done for new users 848 848 $this->config->set_option('update_prev_backups_1_15_10', true); //set it like it already done for new users 849 $this->config->set_option('update_prev_backups_1_18_0', true); //set it like it already done for new users 849 850 $this->config->set_option('backup_db_query_limit', WPTC_DEFAULT_DB_ROWS_BACKUP_LIMIT); 850 851 -
wp-time-capsule/trunk/Classes/DatabaseBackup.php
r2599701 r2766823 286 286 private function save_colllected_tables(){ 287 287 288 $sql = "insert into " . $this->database->base_prefix . "wptc_processed_iterator ( id, name, offset) values $this->bulk_table_insert";288 $sql = "insert into " . $this->database->base_prefix . "wptc_processed_iterator (`id`, `name`, `offset`) values $this->bulk_table_insert"; 289 289 wptc_log($sql,'-----------$sql save_colllected_tables----------------'); 290 290 $result = $this->database->query($sql); … … 1100 1100 1101 1101 public function complete_all_tables(){ 1102 $update_all_tables = "UPDATE " . $this->database->base_prefix . "wptc_processed_iterator SET offset= '-1' WHERE `name` NOT LIKE '%/%'";1102 $update_all_tables = "UPDATE " . $this->database->base_prefix . "wptc_processed_iterator SET `offset` = '-1' WHERE `name` NOT LIKE '%/%'"; 1103 1103 wptc_log($update_all_tables, '---------------$update_all_tables-----------------'); 1104 1104 $result = $this->database->query($update_all_tables); -
wp-time-capsule/trunk/Classes/Processed/Base.php
r2226910 r2766823 201 201 202 202 protected function get_limited_restores($file_id) { 203 $all_restores = $this->db->get_results("SELECT * FROM {$this->db->base_prefix}wptc_processed_{$this->getTableName()} WHERE ( (file_id = $file_id AND offset!= 0 ) OR file_id > $file_id ) AND is_future_file = 0 LIMIT 1");203 $all_restores = $this->db->get_results("SELECT * FROM {$this->db->base_prefix}wptc_processed_{$this->getTableName()} WHERE ( (file_id = $file_id AND `offset` != 0 ) OR file_id > $file_id ) AND is_future_file = 0 LIMIT 1"); 204 204 return $all_restores; 205 205 } … … 210 210 JOIN ( 211 211 SELECT MAX(file_id) AS file_id FROM {$this->db->base_prefix}wptc_processed_files 212 WHERE is_dir = 0 AND offset= 0 AND backupID <= $cur_res_b_id AND file NOT LIKE '%-wptc-secret%' AND file NOT LIKE '%wptc_saved_queries.sql%' AND file NOT LIKE '%db_meta_data%' AND parent_dir LIKE '%$parent_folder%' GROUP BY file212 WHERE is_dir = 0 AND `offset` = 0 AND backupID <= $cur_res_b_id AND file NOT LIKE '%-wptc-secret%' AND file NOT LIKE '%wptc_saved_queries.sql%' AND file NOT LIKE '%db_meta_data%' AND parent_dir LIKE '%$parent_folder%' GROUP BY file 213 213 ) AS t2 ON t1.file_id = t2.file_id 214 214 ORDER BY file_id DESC"; … … 226 226 JOIN ( 227 227 SELECT MAX(file_id) AS file_id FROM {$this->db->base_prefix}wptc_processed_files 228 WHERE is_dir = 0 AND offset= 0 AND backupID <= $cur_res_b_id AND file NOT LIKE '%-wptc-secret%' AND file NOT LIKE '%wptc_saved_queries.sql%' AND file NOT LIKE '%db_meta_data%' GROUP BY file228 WHERE is_dir = 0 AND `offset` = 0 AND backupID <= $cur_res_b_id AND file NOT LIKE '%-wptc-secret%' AND file NOT LIKE '%wptc_saved_queries.sql%' AND file NOT LIKE '%db_meta_data%' GROUP BY file 229 229 ) AS t2 ON t1.file_id = t2.file_id 230 230 ORDER BY file_id DESC"; … … 387 387 $this_revision = $this->db->get_results( 388 388 $this->db->prepare( 389 "SELECT * FROM {$this->db->base_prefix}wptc_processed_files WHERE file = %s AND offset= %d AND backupID <= %s ORDER BY file_id DESC LIMIT 0,1 ", $file, 0, $backup_id389 "SELECT * FROM {$this->db->base_prefix}wptc_processed_files WHERE file = %s AND `offset` = %d AND backupID <= %s ORDER BY file_id DESC LIMIT 0,1 ", $file, 0, $backup_id 390 390 ) 391 391 ); … … 402 402 403 403 $this->db->prepare( 404 "SELECT * FROM {$this->db->base_prefix}wptc_processed_files WHERE file = %s AND offset= %d AND backupID <= %s ORDER BY file_id DESC LIMIT 0,1 ", $file, 0, $backup_id404 "SELECT * FROM {$this->db->base_prefix}wptc_processed_files WHERE file = %s AND `offset` = %d AND backupID <= %s ORDER BY file_id DESC LIMIT 0,1 ", $file, 0, $backup_id 405 405 ) 406 406 ); -
wp-time-capsule/trunk/Classes/Processed/Files.php
r2645777 r2766823 961 961 962 962 public function get_processed_tables(){ 963 $processed_tables = $this->db->get_var("SELECT count(*) FROM {$this->db->base_prefix}wptc_processed_iterator WHERE offset = '-1' AND name != 'header' AND nameNOT LIKE '%/%'");963 $processed_tables = $this->db->get_var("SELECT count(*) FROM {$this->db->base_prefix}wptc_processed_iterator WHERE `offset` = '-1' AND `name` != 'header' AND `name` NOT LIKE '%/%'"); 964 964 $processed_tables = empty($processed_tables) ? 0 : $processed_tables; 965 965 return $processed_tables; … … 1100 1100 1101 1101 $last_month_time = apply_filters('get_days_show_from_revision_limits_wptc', ''); 1102 if(empty($last_month_time)){ 1103 return 0; 1104 } 1102 1105 1103 1106 $count = $this->db->get_var('SELECT count(*) FROM ' . $this->db->base_prefix . 'wptc_backups WHERE `backup_id` > ' . $last_month_time); … … 1111 1114 1112 1115 $last_month_time = apply_filters('get_days_show_from_revision_limits_wptc', ''); 1116 if(empty($last_month_time)){ 1117 return []; 1118 } 1113 1119 1114 1120 $final_data = array(); -
wp-time-capsule/trunk/Classes/Processed/Restoredfiles.php
r1970828 r2766823 414 414 } 415 415 416 $sql = "insert into " . $this->db->base_prefix . "wptc_processed_restored_files (file, offset, backupID, revision_number, revision_id, mtime_during_upload, download_status, uploaded_file_size, g_file_id, file_hash) values $query";416 $sql = "insert into " . $this->db->base_prefix . "wptc_processed_restored_files (file, `offset`, backupID, revision_number, revision_id, mtime_during_upload, download_status, uploaded_file_size, g_file_id, file_hash) values $query"; 417 417 418 418 $result = $this->db->query($sql); 419 419 420 420 if ($result === false) { 421 wptc_log(substr($ query, 0, 300),'-----------$query---error on add_files_for_restoring-------------');421 wptc_log(substr($sql, 0, 300),'-----------$query---error on add_files_for_restoring-------------'); 422 422 wptc_log($this->db->last_error,'-----------$this->db->last_error----------------'); 423 423 } … … 472 472 } 473 473 474 $sql = "insert into " . $this->db->base_prefix . "wptc_processed_restored_files (file, offset, backupID, revision_number, revision_id, mtime_during_upload, download_status, uploaded_file_size, g_file_id, file_hash, is_future_file) values $query";474 $sql = "insert into " . $this->db->base_prefix . "wptc_processed_restored_files (file, `offset`, backupID, revision_number, revision_id, mtime_during_upload, download_status, uploaded_file_size, g_file_id, file_hash, is_future_file) values $query"; 475 475 476 476 $result = $this->db->query($sql); -
wp-time-capsule/trunk/Classes/Processed/iterator.php
r2112729 r2766823 60 60 61 61 public function get_unfnished_folder() { 62 $sql = "SELECT * FROM {$this->db->base_prefix}wptc_processed_{$this->getTableName()} WHERE offset!= -1 LIMIT 1";62 $sql = "SELECT * FROM {$this->db->base_prefix}wptc_processed_{$this->getTableName()} WHERE `offset` != -1 LIMIT 1"; 63 63 $response = $this->db->get_results($sql); 64 64 -
wp-time-capsule/trunk/Classes/class-file-iterator.php
r2262350 r2766823 206 206 207 207 private function insert_into_iterator_process($qry){ 208 $sql = "insert into " . $this->wpdb->base_prefix . "wptc_processed_iterator ( name, offset) values $qry";208 $sql = "insert into " . $this->wpdb->base_prefix . "wptc_processed_iterator ( `name`, `offset` ) values $qry"; 209 209 $result = $this->wpdb->query($sql); 210 210 } 211 211 212 public function get_files_obj_by_path($path, $recursive = false){ 213 214 $path = wptc_add_fullpath($path); 212 public function get_files_obj_by_path($path, $recursive = false, $special = false){ 213 if(!$special){ 214 $path = wptc_add_fullpath($path); 215 } 215 216 216 217 $path = $this->iterator_common->is_valid_path($path); … … 227 228 } 228 229 229 public function copy_dir($from, $to ){230 public function copy_dir($from, $to, $special = false){ 230 231 $this->init_fs(); 231 $files = $this->get_files_obj_by_path($from, true );232 $files = $this->get_files_obj_by_path($from, true, $special); 232 233 foreach ($files as $key => $file) { 233 234 $pathname = $files->getPathname(); -
wp-time-capsule/trunk/Classes/class-replace-db-links.php
r2718556 r2766823 399 399 $sql = "UPDATE `{$table}` SET " . implode(', ', $upd_sql) . ' WHERE ' . implode(' AND ', array_filter($where_sql)); 400 400 401 wptc_log($sql, "--------replacing sql--------");401 // wptc_log($sql, "--------replacing sql--------"); 402 402 403 403 $result = $this->wpdb->query($sql); … … 491 491 492 492 private function recursive_unserialize_replace($from = '', $to = '', $data = '', $serialised = false) { 493 // wptc_log('', "------f--recursive_unserialize_replace--start------"); 493 494 494 495 try { 495 496 if (is_string($data) && ($unserialized = @unserialize($data)) !== false) { 497 // wptc_log('', "------f--string--------"); 496 498 $data = $this->recursive_unserialize_replace($from, $to, $unserialized, true); 497 499 } else if (is_array($data)) { 498 500 $_tmp = array(); 499 501 foreach ($data as $key => $value) { 502 // wptc_log($key, "--------key--------"); 500 503 // if (strstr($key, "\0") !== false ) { 501 504 // continue; … … 509 512 unset($_tmp); 510 513 } else if (is_object($data)) { 514 // $this_get_class = get_class($data); 515 // wptc_log($this_get_class, "--------this_get_class--------"); 511 516 if( get_class($data) != '__PHP_Incomplete_Class' ){ 517 // wptc_log('', "------before get object vars----------"); 512 518 513 519 $_tmp = $data; 514 520 $props = get_object_vars( $data ); 521 // wptc_log('', "------after get object vars----------"); 515 522 foreach ($props as $key => $value) { 523 // wptc_log($key, "--------key--------"); 516 524 //If some objects has \0 in the key it creates the fatal error so skip such contents 517 525 if (is_string($key) && strstr($key, "\0") !== false ) { … … 525 533 $data = $_tmp; 526 534 unset($_tmp); 535 527 536 } 528 537 } else { 538 // wptc_log('', "--------else--------"); 529 539 if (is_string($data)) { 530 540 … … 534 544 } 535 545 } 546 // wptc_log('', "------below--------"); 536 547 537 548 if ($serialised) … … 539 550 540 551 } catch (Exception $error){ 552 wptc_log($error->getMessage(), "--------recursive replace error--------"); 541 553 542 554 } … … 780 792 } 781 793 794 public function update_wp_blogs_path_multisite($new_prefix, $live_path, $staging_path){ 795 $this_query = 'SELECT `blog_id`, `path` from `' . $new_prefix . 'blogs` WHERE 1=1'; 796 $all_paths = $this->wpdb->get_results($this_query, ARRAY_A); 797 798 if(empty($all_paths)){ 799 800 wptc_log($this_query, '--------all_paths--false---------'); 801 802 return; 803 } 804 805 foreach($all_paths as $k => $v){ 806 if(empty($v['path'])){ 807 808 continue; 809 } 810 $exploded = explode($live_path, $v['path']); 811 if(empty($exploded)){ 812 813 continue; 814 } 815 $exploded[0] = $staging_path; 816 817 $this_new_path = implode('', $exploded); 818 819 wptc_log($this_new_path, '------update_wp_blogs_path_multisite--this_new_path---------'); 820 821 $this_query_2 = "UPDATE `" . $new_prefix . "blogs` SET `path`='$this_new_path' WHERE `blog_id`='" . $v['blog_id'] . "';"; 822 $result2 = $this->wpdb->query($this_query_2); 823 824 if($result2 === false){ 825 wptc_log($this_query_2, '------update_wp_blogs_path_multisite--result2 failed---------'); 826 } 827 } 828 } 829 782 830 public function multi_site_db_changes($new_prefix, $new_site_url, $old_url){ 783 831 … … 803 851 804 852 //update blogs table 805 $sql2 = "UPDATE " . $new_prefix . "blogs SET path = REPLACE(path, '" . $live_path . "', '" . $staging_path . "') WHERE path LIKE '%" . $live_path . "%'"; 806 $result = $this->wpdb->query($sql2); 853 $this->update_wp_blogs_path_multisite($new_prefix, $live_path, $staging_path); 807 854 808 855 if ( $result === false ) { -
wp-time-capsule/trunk/Pro/Staging/init.php
r2599701 r2766823 1264 1264 1265 1265 foreach ($dirs as $live_path => $stage_path) { 1266 $this->file_iterator->copy_dir($live_path, $stage_path );1266 $this->file_iterator->copy_dir($live_path, $stage_path, true); 1267 1267 } 1268 1268 -
wp-time-capsule/trunk/S3/class.s3.php
r2708904 r2766823 379 379 return array('error' => $neat_err_msg ); 380 380 } 381 381 382 return array('error' => $err_msg ); 382 383 } -
wp-time-capsule/trunk/readme.txt
r2718589 r2766823 4 4 Tags: backup, staging, schedule backup, DB backup, database backup, woocommerce backup, amazon s3 backup, backblaze, backblaze backup, amazon, auto backup, auto updater, auto updates, automatic updates, back up, backup before update, backup files, backup guard, backup mysql, backup plugin, backup posts, backup tool, backup without zip, backupguard, backups, clone, cloning, cloud backup, complete backup, db backup, db migration, dropbox backup, dropbox, duplicate, full backup, google drive backup, google drive, incremental migrate db, light weight backup, migrate, migration, real-time backup, real-time, restore, remote backups, rollback, s3, scheduled backup, screenshots, visual comparision, site backup, storage, synchronize, time, updates manager, updraft, website backup, wordpress backup, wordpress incremental backup, wasabi, wasabi backup, backup wasabi, wasabisys, wptimecapsule, wp backup, wp time capsule, wptc, backblaze, b2, git, simple backup plugin 5 5 Requires at least: 3.9.14 6 Tested up to: 5.9.37 Stable tag: 1.22.1 06 Tested up to: 6.0.1 7 Stable tag: 1.22.11 8 8 9 9 Backup and Staging by WP Time Capsule is an automated incremental backup plugin that backs up your website changes as per your schedule to Dropbox, Google Drive, Amazon S3, Wasabi and Backblaze B2 Cloud. … … 100 100 101 101 == Changelog == 102 = 1.22.11 = 103 *Release Date - 05 Aug 2022* 104 105 * Fix : Restoration/Migration failed in a few sites having MariaDB Database. 106 * Fix : Child site links are not properly replaced on the staging site in a few cases. 107 102 108 = 1.22.10 = 103 109 *Release Date - 05 May 2022* 104 110 105 * Improvement : Support for new bucket regionsin Backblaze cloud storage.106 * Improvement : Support for new bucket regions inWasabi cloud storage.111 * Improvement : New bucket region support in Backblaze cloud storage. 112 * Improvement : New bucket region support Wasabi cloud storage. 107 113 108 114 = 1.22.9 = -
wp-time-capsule/trunk/time-capsule-update-actions.js
r2599701 r2766823 1239 1239 ips = '52.33.122.174'; 1240 1240 } 1241 ips = '52.33.122.174, 52.27.206.180 and 52.25.129.179'; 1241 1242 1242 1243 if (err_msg.length > 1000) { -
wp-time-capsule/trunk/wp-tcapsule-bridge/wptc-ajax.php
r2237493 r2766823 585 585 $current_processed_files = $uploaded_files = array(); 586 586 587 // wptc_log($file, '---------------dow loading file-----------------');587 // wptc_log($file, '---------------downloading file-----------------'); 588 588 589 589 $cloud_response = $this->output->drop_download($site_abspath, $file, $version, $value, (array) $value); … … 673 673 wptc_log(array(),'-----------Yes its state file.----------------'); 674 674 675 $sql = "SELECT offsetFROM {$this->wpdb->base_prefix}wptc_processed_restored_files WHERE file = '". $file ."'";675 $sql = "SELECT `offset` FROM {$this->wpdb->base_prefix}wptc_processed_restored_files WHERE file = '". $file ."'"; 676 676 677 677 wptc_log($sql,'-----------$sql----------------'); … … 1239 1239 } 1240 1240 } 1241 // wptc_log($this->prepared_file_array, '--------prepared_file_array--------'); 1241 1242 1242 1243 if (!empty($this->prepared_file_array)) { … … 1246 1247 $this->prepared_file_array = array(); 1247 1248 } 1249 // wptc_log('', '--------below added files for restoring--------'); 1248 1250 1249 1251 $this->free_mysql_buffer(); -
wp-time-capsule/trunk/wp-time-capsule.php
r2718556 r2766823 5 5 Description: Backup and Staging by WP Time Capsule is an incremental automated schedule backup plugin that backups up your website to Dropbox, Google Drive, Amazon S3, Wasabi and Backblaze B2 Cloud on a daily basis. 6 6 Author: Revmakx 7 Version: 1.22.1 07 Version: 1.22.11 8 8 Author URI: http://www.revmakx.com 9 Tested up to: 5.9.39 Tested up to: 6.0.1 10 10 /************************************************************ 11 11 * This plugin was modified by Revmakx … … 1009 1009 `id` bigint(20) NOT NULL AUTO_INCREMENT, 1010 1010 `backup_id` varchar(100) NOT NULL, 1011 `backup_name` text, 1011 1012 `backup_type` char(1) NOT NULL COMMENT 'M = Manual, D = Daily Main Cycle , S- Sub Cycle', 1012 1013 `files_count` int(11) NOT NULL, … … 3784 3785 wptc_log($last_time, "--------last_time--------"); 3785 3786 3786 $wpdb->query("DROP TABLE `" . $wpdb->base_prefix . "wptc_query_recorder`");3787 $wpdb->query("DROP TABLE IF EXISTS `" . $wpdb->base_prefix . "wptc_query_recorder`"); 3787 3788 3788 3789 $cachecollation = wptc_get_collation(); -
wp-time-capsule/trunk/wptc-constants.php
r2718556 r2766823 75 75 76 76 public function versions(){ 77 $this->define( 'WPTC_VERSION', '1.22.1 0' );77 $this->define( 'WPTC_VERSION', '1.22.11' ); 78 78 $this->define( 'WPTC_DATABASE_VERSION', '17.0' ); 79 79 }
Note: See TracChangeset
for help on using the changeset viewer.