Changeset 2869535
- Timestamp:
- 02/22/2023 05:29:08 PM (3 years ago)
- Location:
- zoneit-backup
- Files:
-
- 44 added
- 4 edited
-
tags/1.1.1 (added)
-
tags/1.1.1/assets (added)
-
tags/1.1.1/assets/css (added)
-
tags/1.1.1/assets/css/sweetalert2.min.css (added)
-
tags/1.1.1/assets/css/timepicker.css (added)
-
tags/1.1.1/assets/js (added)
-
tags/1.1.1/assets/js/sweetalert2.min.js (added)
-
tags/1.1.1/assets/js/timepicker.js (added)
-
tags/1.1.1/composer.json (added)
-
tags/1.1.1/composer.lock (added)
-
tags/1.1.1/includes (added)
-
tags/1.1.1/includes/class-backup-core.php (added)
-
tags/1.1.1/includes/class-backups-list.php (added)
-
tags/1.1.1/includes/class-cron-backup.php (added)
-
tags/1.1.1/includes/class-rest-api.php (added)
-
tags/1.1.1/includes/class-restore-core.php (added)
-
tags/1.1.1/includes/class-settings.php (added)
-
tags/1.1.1/includes/services (added)
-
tags/1.1.1/includes/services/class-backup-service.php (added)
-
tags/1.1.1/readme.txt (added)
-
tags/1.1.1/vendor (added)
-
tags/1.1.1/vendor/autoload.php (added)
-
tags/1.1.1/vendor/composer (added)
-
tags/1.1.1/vendor/composer/ClassLoader.php (added)
-
tags/1.1.1/vendor/composer/InstalledVersions.php (added)
-
tags/1.1.1/vendor/composer/LICENSE (added)
-
tags/1.1.1/vendor/composer/autoload_classmap.php (added)
-
tags/1.1.1/vendor/composer/autoload_namespaces.php (added)
-
tags/1.1.1/vendor/composer/autoload_psr4.php (added)
-
tags/1.1.1/vendor/composer/autoload_real.php (added)
-
tags/1.1.1/vendor/composer/autoload_static.php (added)
-
tags/1.1.1/vendor/composer/installed.json (added)
-
tags/1.1.1/vendor/composer/installed.php (added)
-
tags/1.1.1/vendor/composer/platform_check.php (added)
-
tags/1.1.1/vendor/ifsnop (added)
-
tags/1.1.1/vendor/ifsnop/mysqldump-php (added)
-
tags/1.1.1/vendor/ifsnop/mysqldump-php/LICENSE (added)
-
tags/1.1.1/vendor/ifsnop/mysqldump-php/README.md (added)
-
tags/1.1.1/vendor/ifsnop/mysqldump-php/composer.json (added)
-
tags/1.1.1/vendor/ifsnop/mysqldump-php/src (added)
-
tags/1.1.1/vendor/ifsnop/mysqldump-php/src/Ifsnop (added)
-
tags/1.1.1/vendor/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump (added)
-
tags/1.1.1/vendor/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php (added)
-
tags/1.1.1/zoneit-backup.php (added)
-
trunk/includes/class-backup-core.php (modified) (4 diffs)
-
trunk/includes/class-rest-api.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/zoneit-backup.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
zoneit-backup/trunk/includes/class-backup-core.php
r2865347 r2869535 7 7 * Author: Zoneit Cloud 8 8 * DateTime: 2022/11/06 16:38 9 * Last Modified Time: 2023/02/ 16 02:489 * Last Modified Time: 2023/02/22 20:57 10 10 * License: GPL-2.0+ 11 11 * License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 259 259 260 260 // final request to endpoint of internal zoneit cloud services 261 self::connect_zoneit_api(); 261 $zoneit_cloud_id = get_transient('zoneit_cloud_id'); 262 if(!empty($zoneit_cloud_id)) 263 { 264 self::connect_zoneit_api( $zoneit_cloud_id ); 265 } 262 266 } 263 267 else … … 522 526 /** 523 527 * Request to Zoneit cloud api 524 */ 525 public static function connect_zoneit_api() 528 * 529 * @param UUID $zoneit_cloud_id 530 * 531 * @return void 532 */ 533 public static function connect_zoneit_api( $zoneit_cloud_id ) 526 534 { 527 535 $request = wp_remote_post("https://api.zoneit.cloud/v2/api/wp/backup/", [ 528 536 'body' => [ 537 'backup_id' => $zoneit_cloud_id, 529 538 'token' => Zoneit_Backup_REST_API::generate_token(), 530 539 'domain' => Zoneit_Backup_REST_API::get_domain_name( get_site_url() ), … … 532 541 ] 533 542 ]); 534 print_r($request);535 543 } 536 544 -
zoneit-backup/trunk/includes/class-rest-api.php
r2865347 r2869535 7 7 * Author: Rasool Vahdati 8 8 * DateTime: 2022/10/08 11:55:03 9 * Last Modified Time: 2023/02/ 16 02:48:309 * Last Modified Time: 2023/02/22 20:51:30 10 10 * License: GPL-3.0+ 11 11 */ … … 66 66 $params = $request->get_params(); 67 67 $generate_token = self::generate_token(); 68 69 68 $results = array(); 70 69 … … 74 73 if( $user_token == $generate_token ) 75 74 { 76 $backups_list = Backup_Core::get_backup_urls( 0, 1 ); // all service type and only last link 77 if( !is_null($url) ) 78 { 79 $results = [ 80 'status' => true, 81 'id' => $backups_list['zoneit_backup_id'], 82 'url' => $backups_list['backup_url'], 83 ]; 75 $urls = Backup_Core::get_backup_urls( 0, 1 ); // all service type and only last link 76 if( !is_null($urls) ) 77 { 78 $results = $urls; 84 79 } 85 80 else … … 121 116 if( $user_token == $geneate_token ) 122 117 { 123 if( !empty( Backup_Core::get( [ 'status' => 1 ] ) ) ) 124 { 125 $results = [ 126 'status' => false, 127 'msg' => __('There is a backup with \'in progress\' status. You cannot create a new backup until this backup is completed.', 'zoneit-backup') 128 ]; 129 return new WP_REST_Response( $results, 200 ); 118 if(isset($params['backup_id'])) 119 { 120 if( !empty( Backup_Core::get( [ 'status' => 1 ] ) ) ) 121 { 122 $results = [ 123 'status' => false, 124 'msg' => __('There is a backup with \'in progress\' status. You cannot create a new backup until this backup is completed.', 'zoneit-backup') 125 ]; 126 return new WP_REST_Response( $results, 200 ); 127 } 128 else 129 { 130 set_transient('zoneit_cloud_id', sanitize_text_field( $params['backup_id'] ), 90 * MINUTE_IN_SECONDS ); // set receive backup_id for 131 Backup_Core::run_backup_event(); 132 $results = [ 133 'status' => true, 134 'msg' => __('The plugin is creating the backups of db and files...Please wait...', 'zoneit-backup') 135 ]; 136 return new WP_REST_Response( $results, 200 ); 137 } 130 138 } 131 139 else 132 140 { 133 Backup_Core::run_backup_event(); 134 $results = [ 135 'status' => true, 136 'msg' => __('The plugin is creating the backups of db and files...Please wait...', 'zoneit-backup') 137 ]; 138 return new WP_REST_Response( $results, 200 ); 141 return new WP_Error( 'error', __('Backup UUID not found', 'zoneit-backup'), array( 'status' => 400 ) ); 139 142 } 140 143 } -
zoneit-backup/trunk/readme.txt
r2865347 r2869535 4 4 Requires at least: 5.0 5 5 Tested up to: 6.1.1 6 Stable tag: 1.1. 16 Stable tag: 1.1.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 42 42 == Changelog == 43 43 44 = 1.1.2 = 45 * Bugs fixes and improvements 46 44 47 = 1.1.1 = 45 48 * Bugs fixes and improvements -
zoneit-backup/trunk/zoneit-backup.php
r2865347 r2869535 3 3 Plugin Name: Zoneit Backup 4 4 Description: This plugin is creating a backup from website files and db 5 Version: 1.1. 15 Version: 1.1.2 6 6 Author: Zoneit Cloud 7 7 Author URI: https://zoneit.cloud
Note: See TracChangeset
for help on using the changeset viewer.