Plugin Directory

Changeset 2766823


Ignore:
Timestamp:
08/05/2022 10:50:03 AM (4 years ago)
Author:
WPTimeCapsule
Message:

release 1.22.11

Location:
wp-time-capsule/trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • wp-time-capsule/trunk/Classes/AppFunctions/AppFunctions.php

    r2599701 r2766823  
    847847        $this->config->set_option('update_prev_backups_1_14_10', true); //set it like it already done for new users
    848848        $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
    849850        $this->config->set_option('backup_db_query_limit', WPTC_DEFAULT_DB_ROWS_BACKUP_LIMIT);
    850851
  • wp-time-capsule/trunk/Classes/DatabaseBackup.php

    r2599701 r2766823  
    286286    private function save_colllected_tables(){
    287287
    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";
    289289        wptc_log($sql,'-----------$sql save_colllected_tables----------------');
    290290        $result = $this->database->query($sql);
     
    11001100
    11011101    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 '%/%'";
    11031103        wptc_log($update_all_tables, '---------------$update_all_tables-----------------');
    11041104        $result = $this->database->query($update_all_tables);
  • wp-time-capsule/trunk/Classes/Processed/Base.php

    r2226910 r2766823  
    201201
    202202    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");
    204204        return $all_restores;
    205205    }
     
    210210                            JOIN (
    211211                                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 file
     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 file
    213213                            ) AS t2 ON t1.file_id = t2.file_id
    214214                            ORDER BY file_id DESC";
     
    226226                            JOIN (
    227227                                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 file
     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 file
    229229                            ) AS t2 ON t1.file_id = t2.file_id
    230230                            ORDER BY file_id DESC";
     
    387387        $this_revision = $this->db->get_results(
    388388                    $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_id
     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_id
    390390                    )
    391391                );
     
    402402
    403403        $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_id
     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_id
    405405            )
    406406        );
  • wp-time-capsule/trunk/Classes/Processed/Files.php

    r2645777 r2766823  
    961961
    962962    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 name NOT 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 '%/%'");
    964964        $processed_tables = empty($processed_tables) ? 0 : $processed_tables;
    965965        return $processed_tables;
     
    11001100
    11011101        $last_month_time = apply_filters('get_days_show_from_revision_limits_wptc', '');
     1102        if(empty($last_month_time)){
     1103            return 0;
     1104        }
    11021105
    11031106        $count = $this->db->get_var('SELECT count(*) FROM ' . $this->db->base_prefix . 'wptc_backups WHERE `backup_id` > ' . $last_month_time);
     
    11111114
    11121115        $last_month_time = apply_filters('get_days_show_from_revision_limits_wptc', '');
     1116        if(empty($last_month_time)){
     1117            return [];
     1118        }
    11131119
    11141120        $final_data = array();
  • wp-time-capsule/trunk/Classes/Processed/Restoredfiles.php

    r1970828 r2766823  
    414414        }
    415415
    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";
    417417
    418418        $result = $this->db->query($sql);
    419419
    420420        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-------------');
    422422            wptc_log($this->db->last_error,'-----------$this->db->last_error----------------');
    423423        }
     
    472472        }
    473473
    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";
    475475
    476476        $result = $this->db->query($sql);
  • wp-time-capsule/trunk/Classes/Processed/iterator.php

    r2112729 r2766823  
    6060
    6161    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";
    6363        $response = $this->db->get_results($sql);
    6464
  • wp-time-capsule/trunk/Classes/class-file-iterator.php

    r2262350 r2766823  
    206206
    207207    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";
    209209        $result = $this->wpdb->query($sql);
    210210    }
    211211
    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        }
    215216
    216217        $path = $this->iterator_common->is_valid_path($path);
     
    227228    }
    228229
    229     public function copy_dir($from, $to){
     230    public function copy_dir($from, $to, $special = false){
    230231        $this->init_fs();
    231         $files = $this->get_files_obj_by_path($from, true);
     232        $files = $this->get_files_obj_by_path($from, true, $special);
    232233        foreach ($files as $key => $file) {
    233234            $pathname = $files->getPathname();
  • wp-time-capsule/trunk/Classes/class-replace-db-links.php

    r2718556 r2766823  
    399399                            $sql = "UPDATE `{$table}` SET " . implode(', ', $upd_sql) . ' WHERE ' . implode(' AND ', array_filter($where_sql));
    400400
    401                             wptc_log($sql, "--------replacing sql--------");
     401                            // wptc_log($sql, "--------replacing sql--------");
    402402
    403403                            $result = $this->wpdb->query($sql);
     
    491491
    492492    private function recursive_unserialize_replace($from = '', $to = '', $data = '', $serialised = false) {
     493        // wptc_log('', "------f--recursive_unserialize_replace--start------");
    493494
    494495        try {
    495496            if (is_string($data) && ($unserialized = @unserialize($data)) !== false) {
     497                // wptc_log('', "------f--string--------");
    496498                $data = $this->recursive_unserialize_replace($from, $to, $unserialized, true);
    497499            } else if (is_array($data)) {
    498500                $_tmp = array();
    499501                foreach ($data as $key => $value) {
     502                    // wptc_log($key, "--------key--------");
    500503                    // if (strstr($key, "\0") !== false ) {
    501504                    //  continue;
     
    509512                unset($_tmp);
    510513            } else if (is_object($data)) {
     514                // $this_get_class = get_class($data);
     515                // wptc_log($this_get_class, "--------this_get_class--------");
    511516                if( get_class($data) != '__PHP_Incomplete_Class' ){
     517                    // wptc_log('', "------before get object vars----------");
    512518
    513519                    $_tmp = $data;
    514520                    $props = get_object_vars( $data );
     521                    // wptc_log('', "------after get object vars----------");
    515522                    foreach ($props as $key => $value) {
     523                        // wptc_log($key, "--------key--------");
    516524                        //If some objects has \0 in the key it creates the fatal error so skip such contents
    517525                        if (is_string($key) && strstr($key, "\0") !== false ) {
     
    525533                    $data = $_tmp;
    526534                    unset($_tmp);
     535                   
    527536                }
    528537            } else {
     538                // wptc_log('', "--------else--------");
    529539                if (is_string($data)) {
    530540
     
    534544                }
    535545            }
     546            // wptc_log('', "------below--------");
    536547
    537548            if ($serialised)
     
    539550
    540551        } catch (Exception $error){
     552            wptc_log($error->getMessage(), "--------recursive replace error--------");
    541553
    542554        }
     
    780792    }
    781793
     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
    782830    public function multi_site_db_changes($new_prefix, $new_site_url, $old_url){
    783831
     
    803851
    804852        //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);
    807854
    808855        if ( $result === false ) {
  • wp-time-capsule/trunk/Pro/Staging/init.php

    r2599701 r2766823  
    12641264
    12651265        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);
    12671267        }
    12681268
  • wp-time-capsule/trunk/S3/class.s3.php

    r2708904 r2766823  
    379379                return array('error' => $neat_err_msg );
    380380            }
     381           
    381382            return array('error' => $err_msg );
    382383        }
  • wp-time-capsule/trunk/readme.txt

    r2718589 r2766823  
    44Tags: 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
    55Requires at least: 3.9.14
    6 Tested up to: 5.9.3
    7 Stable tag: 1.22.10
     6Tested up to: 6.0.1
     7Stable tag: 1.22.11
    88
    99Backup 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.
     
    100100
    101101== 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
    102108= 1.22.10 =
    103109*Release Date - 05 May 2022*
    104110
    105 * Improvement : Support for new bucket regions in Backblaze cloud storage.
    106 * Improvement : Support for new bucket regions in Wasabi cloud storage.
     111* Improvement : New bucket region support in Backblaze cloud storage.
     112* Improvement : New bucket region support Wasabi cloud storage.
    107113
    108114= 1.22.9 =
  • wp-time-capsule/trunk/time-capsule-update-actions.js

    r2599701 r2766823  
    12391239        ips = '52.33.122.174';
    12401240    }
     1241    ips = '52.33.122.174, 52.27.206.180 and 52.25.129.179';
    12411242
    12421243    if (err_msg.length > 1000) {
  • wp-time-capsule/trunk/wp-tcapsule-bridge/wptc-ajax.php

    r2237493 r2766823  
    585585                $current_processed_files = $uploaded_files = array();
    586586
    587                 // wptc_log($file, '---------------dowloading file-----------------');
     587                // wptc_log($file, '---------------downloading file-----------------');
    588588
    589589                $cloud_response = $this->output->drop_download($site_abspath, $file, $version, $value, (array) $value);
     
    673673        wptc_log(array(),'-----------Yes its state file.----------------');
    674674
    675         $sql = "SELECT offset FROM {$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 ."'";
    676676
    677677        wptc_log($sql,'-----------$sql----------------');
     
    12391239            }
    12401240        }
     1241        // wptc_log($this->prepared_file_array, '--------prepared_file_array--------');
    12411242
    12421243        if (!empty($this->prepared_file_array)) {
     
    12461247            $this->prepared_file_array = array();
    12471248        }
     1249        // wptc_log('', '--------below added files for restoring--------');
    12481250
    12491251        $this->free_mysql_buffer();
  • wp-time-capsule/trunk/wp-time-capsule.php

    r2718556 r2766823  
    55Description: 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.
    66Author: Revmakx
    7 Version: 1.22.10
     7Version: 1.22.11
    88Author URI: http://www.revmakx.com
    9 Tested up to: 5.9.3
     9Tested up to: 6.0.1
    1010/************************************************************
    1111 * This plugin was modified by Revmakx
     
    10091009            `id` bigint(20) NOT NULL AUTO_INCREMENT,
    10101010            `backup_id` varchar(100) NOT NULL,
     1011            `backup_name` text,
    10111012            `backup_type` char(1) NOT NULL COMMENT 'M = Manual, D = Daily Main Cycle , S- Sub Cycle',
    10121013            `files_count` int(11) NOT NULL,
     
    37843785        wptc_log($last_time, "--------last_time--------");
    37853786
    3786         $wpdb->query("DROP TABLE `" . $wpdb->base_prefix . "wptc_query_recorder`");
     3787        $wpdb->query("DROP TABLE IF EXISTS `" . $wpdb->base_prefix . "wptc_query_recorder`");
    37873788
    37883789        $cachecollation = wptc_get_collation();
  • wp-time-capsule/trunk/wptc-constants.php

    r2718556 r2766823  
    7575
    7676    public function versions(){
    77         $this->define( 'WPTC_VERSION', '1.22.10' );
     77        $this->define( 'WPTC_VERSION', '1.22.11' );
    7878        $this->define( 'WPTC_DATABASE_VERSION', '17.0' );
    7979    }
Note: See TracChangeset for help on using the changeset viewer.