Changeset 3376496
- Timestamp:
- 10/11/2025 01:59:05 AM (4 months ago)
- Location:
- 1-click-migration/trunk
- Files:
-
- 6 edited
-
inc/background/class-background-backup.php (modified) (4 diffs)
-
inc/background/class-background-restore.php (modified) (2 diffs)
-
inc/backup/class-ocm-backup.php (modified) (3 diffs)
-
js/admin-script.js (modified) (1 diff)
-
one-click-migration.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
1-click-migration/trunk/inc/background/class-background-backup.php
r2726289 r3376496 47 47 $presigned_urls = get_option('ocm_presigned_urls'); 48 48 49 One_Click_Migration::write_to_log(sprintf(' %s task has been started.', $action));49 One_Click_Migration::write_to_log(sprintf(' SYSLOG: *** BACKGROUND TASK STARTED: %s ***', $action)); 50 50 51 51 … … 112 112 */ 113 113 protected function handle() { 114 One_Click_Migration::write_to_log(' SYSLOG: *** BACKGROUND PROCESS HANDLER STARTED ***'); 114 115 115 116 $this->lock_process(); … … 119 120 do { 120 121 $batch = $this->get_batch(); 122 One_Click_Migration::write_to_log(' SYSLOG: *** BATCH RETRIEVED: ' . count($batch->data) . ' items ***'); 121 123 122 124 foreach ( $batch->data as $key => $value ) { … … 242 244 243 245 /** 246 * Public method to unlock the background process 247 * Used during stop & reset to prevent stuck state 248 */ 249 public function unlock_process() 250 { 251 parent::unlock_process(); 252 } 253 254 /** 255 * Public method to directly trigger background processing 256 * Used as fallback when dispatch fails 257 */ 258 public function trigger_processing() 259 { 260 One_Click_Migration::write_to_log(' SYSLOG: *** DIRECT PROCESSING TRIGGERED ***'); 261 262 if ( $this->is_processing() ) { 263 One_Click_Migration::write_to_log(' SYSLOG: Background process already running'); 264 return; 265 } 266 267 if ( $this->is_queue_empty() ) { 268 One_Click_Migration::write_to_log(' SYSLOG: Queue is empty - nothing to process'); 269 return; 270 } 271 272 One_Click_Migration::write_to_log(' SYSLOG: Starting direct background processing'); 273 $this->handle(); 274 } 275 276 /** 244 277 * Time exceeded. 245 278 * -
1-click-migration/trunk/inc/background/class-background-restore.php
r2414581 r3376496 43 43 list($username, $password) = $data; 44 44 45 One_Click_Migration::write_to_log(' SYSLOG: *** RESTORE TASK STARTED ***'); 45 46 OCM_Backup::start_restore_process($username, $password); 46 47 One_Click_Migration::write_to_log('Download task has been completed.'); … … 187 188 188 189 /** 190 * Public method to unlock the background process 191 * Used during stop & reset to prevent stuck state 192 */ 193 public function unlock_process() 194 { 195 parent::unlock_process(); 196 } 197 198 /** 199 * Public method to directly trigger background processing 200 * Used as fallback when dispatch fails 201 */ 202 public function trigger_processing() 203 { 204 One_Click_Migration::write_to_log(' SYSLOG: *** RESTORE DIRECT PROCESSING TRIGGERED ***'); 205 206 if ( $this->is_processing() ) { 207 One_Click_Migration::write_to_log(' SYSLOG: Restore background process already running'); 208 return; 209 } 210 211 if ( $this->is_queue_empty() ) { 212 One_Click_Migration::write_to_log(' SYSLOG: Restore queue is empty - nothing to process'); 213 return; 214 } 215 216 One_Click_Migration::write_to_log(' SYSLOG: Starting direct restore processing'); 217 $this->handle(); 218 } 219 220 /** 189 221 * Time exceeded. 190 222 * -
1-click-migration/trunk/inc/backup/class-ocm-backup.php
r3374608 r3376496 391 391 392 392 self::save_system_data_to_log_file($username, $bucket_key); 393 394 // Server configuration diagnostics 395 One_Click_Migration::write_to_log(' SYSLOG: Server IP: ' . ($_SERVER['SERVER_ADDR'] ?? 'unknown')); 396 One_Click_Migration::write_to_log(' SYSLOG: WP_HTTP_BLOCK_EXTERNAL: ' . (defined('WP_HTTP_BLOCK_EXTERNAL') ? (WP_HTTP_BLOCK_EXTERNAL ? 'true' : 'false') : 'not set')); 397 One_Click_Migration::write_to_log(' SYSLOG: WP_ACCESSIBLE_HOSTS: ' . (defined('WP_ACCESSIBLE_HOSTS') ? WP_ACCESSIBLE_HOSTS : 'not set')); 398 One_Click_Migration::write_to_log(' SYSLOG: Admin URL: ' . admin_url('admin-ajax.php')); 399 393 400 self::deleteDir(OCM_PLUGIN_WRITABLE_PATH, 'Cleaning temporary directory', $presigned_urls); 394 401 … … 437 444 } 438 445 } 439 One_Click_Migration::$process_backup_single->save()->dispatch(); 446 // Use direct processing for maximum compatibility across all environments 447 // Async requests can be blocked by Cloudflare, firewalls, or security plugins 448 One_Click_Migration::write_to_log(' SYSLOG: Using direct processing for maximum compatibility'); 449 One_Click_Migration::$process_backup_single->save(); // Save the queue 450 One_Click_Migration::$process_backup_single->trigger_processing(); // Process it directly 440 451 441 452 exit; … … 482 493 } else { 483 494 One_Click_Migration::$process_restore_single->push_to_queue(array($username, $password)); 484 One_Click_Migration::$process_restore_single->save()->dispatch(); 495 496 // Use direct processing for maximum compatibility across all environments 497 // Async requests can be blocked by Cloudflare, firewalls, or security plugins 498 One_Click_Migration::write_to_log(' SYSLOG: Using direct restore processing for maximum compatibility'); 499 One_Click_Migration::$process_restore_single->save(); // Save the queue 500 One_Click_Migration::$process_restore_single->trigger_processing(); // Process it directly 501 485 502 exit; 486 503 } -
1-click-migration/trunk/js/admin-script.js
r3372639 r3376496 336 336 } 337 337 338 }, 339 error: function(xhr, status, error) { 340 // If we get a 403 (authentication failure), reload page to refresh nonce 341 // This happens after restore when DB is replaced and user logs back in 342 if (xhr.status === 403) { 343 console.log('Progress endpoint returned 403 - waiting for restore to complete before reloading'); 344 clearInterval(intervalId); 345 clearTimeout(timeoutId); 346 347 // Wait 5 seconds for restore to complete before reloading 348 // This prevents showing empty WordPress install page during DB replacement 349 setTimeout(function() { 350 console.log('Reloading page after 403 error to refresh authentication'); 351 window.location.reload(); 352 }, 5000); 353 } 338 354 } 339 355 }); -
1-click-migration/trunk/one-click-migration.php
r3374608 r3376496 5 5 * Plugin URI: https://wordpress.org/plugins/1-click-migration/ 6 6 * Description: Migrate, copy, or clone your entire site with 1 click. <strong>Any host, no size limitation, no premium versions.</strong> 7 * Version: 2.3. 17 * Version: 2.3.2 8 8 * Author: 1ClickMigration 9 9 * Author URI: https://1clickmigration.com/ … … 280 280 public static function install() 281 281 { 282 // Ensure clean state on activation 283 self::stop_and_reset(); 284 282 285 // Make sure our API route is added 283 286 flush_rewrite_rules(); … … 342 345 delete_option('ocm_restore_child_delete_retry_uploads'); 343 346 347 // Clear additional options that might cause redirect loops 348 delete_option('ocm_s3_bucket'); 349 delete_option('ocm_s3_region'); 350 delete_option('ocm_s3_access_key'); 351 delete_option('ocm_s3_secret_key'); 352 delete_option('ocm_backup_id'); 353 delete_option('ocm_backup_password'); 354 delete_option('ocm_backup_completed_steps'); 355 delete_option('ocm_restore_completed_steps'); 356 delete_option('ocm_maintenance_mode'); 357 344 358 } 345 359 … … 347 361 public static function uninstall() 348 362 { 349 self::delete_options(); 350 351 // Delete ocm_restore folder (silently - don't log errors during deactivation) 352 try { 353 if (is_dir(WP_CONTENT_DIR . '/ocm_restore/')) { 354 self::delete_directory_recursive(WP_CONTENT_DIR . '/ocm_restore/'); 355 } 356 } catch (\Exception $e) { 357 // Silently fail during deactivation 358 } 359 360 // Clear tmp folder (silently - don't log errors during deactivation) 361 try { 362 if (is_dir(OCM_PLUGIN_WRITABLE_PATH)) { 363 self::delete_directory_recursive(OCM_PLUGIN_WRITABLE_PATH); 364 } 365 } catch (\Exception $e) { 366 // Silently fail during deactivation 367 } 368 369 // Load the background helper class before using it 370 if (!class_exists('OCM\OCM_BackgroundHelper')) { 371 require_once __DIR__ . '/inc/background/class-background-helper.php'; 372 } 373 OCM_BackgroundHelper::delete_all_batch_process(); 374 375 // Make sure we don't leave un-necessary routes laying around 376 flush_rewrite_rules(); 377 363 // Use stop_and_reset for complete cleanup on deactivation 364 self::stop_and_reset(); 378 365 } 379 366 … … 565 552 self::disable_maintenance_mode(); 566 553 554 // Unlock any locked processes before cleanup 555 if (self::$process_backup_single) { 556 self::$process_backup_single->unlock_process(); 557 } 558 if (self::$process_restore_single) { 559 self::$process_restore_single->unlock_process(); 560 } 561 562 // Clear all queues and batches 563 if (self::$process_backup_single) { 564 self::$process_backup_single->cancel_all_process(); 565 self::$process_backup_single->cancel_scheduled_event(); 566 } 567 if (self::$process_restore_single) { 568 self::$process_restore_single->cancel_all_process(); 569 self::$process_restore_single->cancel_scheduled_event(); 570 } 571 572 // Delete all options and batch data 567 573 self::delete_options(); 574 575 // Load the background helper class before using it 576 if (!class_exists('OCM\OCM_BackgroundHelper')) { 577 require_once __DIR__ . '/inc/background/class-background-helper.php'; 578 } 579 OCM_BackgroundHelper::delete_all_batch_process(); 580 581 // Clear specific process status options that might be stuck 582 delete_option('wp_ocm_background_backup_status'); 583 delete_option('wp_ocm_background_restore_status'); 584 delete_site_transient('wp_ocm_background_backup_process_lock'); 585 delete_site_transient('wp_ocm_background_restore_process_lock'); 568 586 569 587 // Delete ocm_restore folder 570 588 if(!WP_DEBUG){ 571 572 589 if (is_dir(WP_CONTENT_DIR . '/ocm_restore/')) { 573 590 OCM_Backup::deleteDir(WP_CONTENT_DIR . '/ocm_restore/', 'Deleting ocm_restore', null); … … 579 596 OCM_Backup::deleteDir(OCM_PLUGIN_WRITABLE_PATH, 'Deleting TMP Folder', null); 580 597 } 581 582 // Load the background helper class before using it583 if (!class_exists('OCM\OCM_BackgroundHelper')) {584 require_once __DIR__ . '/inc/background/class-background-helper.php';585 }586 OCM_BackgroundHelper::delete_all_batch_process();587 598 588 599 // Make sure we don't leave un-necessary routes laying around -
1-click-migration/trunk/readme.txt
r3376396 r3376496 5 5 Tested up to: 6.8.3 6 6 Requires PHP: 7.4 7 Stable tag: 2.3. 17 Stable tag: 2.3.2 8 8 Author URI: https://1clickmigration.com 9 9 License: GPLv3 or later … … 80 80 81 81 == Changelog == 82 = 2.3.2 = 83 * **Security Fix**: Added nonce verification and capability checks to prevent unauthorized access (CVE-2025-3455) 84 * **Reliability**: Simplified background processing for maximum compatibility across all hosting environments 85 * **UX Improvement**: Fixed progress bar freeze after restore completion and login 86 * **Performance**: Removed async complexity that caused race conditions on various hosts 87 * **Compatibility**: Enhanced stop & reset functionality to prevent stuck states 88 82 89 = 2.3.1 = 83 90 * Fixed white screen on deactivation
Note: See TracChangeset
for help on using the changeset viewer.