Plugin Directory

Changeset 3376496


Ignore:
Timestamp:
10/11/2025 01:59:05 AM (4 months ago)
Author:
1clickmigration
Message:

Update to version 2.3.2

Location:
1-click-migration/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 1-click-migration/trunk/inc/background/class-background-backup.php

    r2726289 r3376496  
    4747        $presigned_urls = get_option('ocm_presigned_urls');
    4848
    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));
    5050
    5151
     
    112112     */
    113113    protected function handle() {
     114        One_Click_Migration::write_to_log(' SYSLOG: *** BACKGROUND PROCESS HANDLER STARTED ***');
    114115
    115116        $this->lock_process();
     
    119120        do {
    120121            $batch = $this->get_batch();
     122            One_Click_Migration::write_to_log(' SYSLOG: *** BATCH RETRIEVED: ' . count($batch->data) . ' items ***');
    121123
    122124            foreach ( $batch->data as $key => $value ) {
     
    242244
    243245    /**
     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    /**
    244277     * Time exceeded.
    245278     *
  • 1-click-migration/trunk/inc/background/class-background-restore.php

    r2414581 r3376496  
    4343        list($username, $password) = $data;
    4444
     45        One_Click_Migration::write_to_log(' SYSLOG: *** RESTORE TASK STARTED ***');
    4546        OCM_Backup::start_restore_process($username, $password);
    4647        One_Click_Migration::write_to_log('Download task has been completed.');
     
    187188
    188189    /**
     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    /**
    189221     * Time exceeded.
    190222     *
  • 1-click-migration/trunk/inc/backup/class-ocm-backup.php

    r3374608 r3376496  
    391391
    392392            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           
    393400            self::deleteDir(OCM_PLUGIN_WRITABLE_PATH, 'Cleaning temporary directory', $presigned_urls);
    394401
     
    437444            }
    438445          }
    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
    440451
    441452        exit;
     
    482493        } else {
    483494            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
    485502            exit;
    486503        }
  • 1-click-migration/trunk/js/admin-script.js

    r3372639 r3376496  
    336336                }
    337337
     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                    }
    338354                }
    339355            });
  • 1-click-migration/trunk/one-click-migration.php

    r3374608 r3376496  
    55 * Plugin URI: https://wordpress.org/plugins/1-click-migration/
    66 * 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.1
     7 * Version: 2.3.2
    88 * Author: 1ClickMigration
    99 * Author URI: https://1clickmigration.com/
     
    280280    public static function install()
    281281    {
     282        // Ensure clean state on activation
     283        self::stop_and_reset();
     284       
    282285        // Make sure our API route is added
    283286        flush_rewrite_rules();
     
    342345      delete_option('ocm_restore_child_delete_retry_uploads');
    343346
     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
    344358    }
    345359
     
    347361    public static function uninstall()
    348362    {
    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();
    378365    }
    379366   
     
    565552        self::disable_maintenance_mode();
    566553
     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
    567573        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');
    568586
    569587        // Delete ocm_restore folder
    570588        if(!WP_DEBUG){
    571 
    572589          if (is_dir(WP_CONTENT_DIR . '/ocm_restore/')) {
    573590              OCM_Backup::deleteDir(WP_CONTENT_DIR . '/ocm_restore/', 'Deleting ocm_restore', null);
     
    579596            OCM_Backup::deleteDir(OCM_PLUGIN_WRITABLE_PATH, 'Deleting TMP Folder', null);
    580597        }
    581        
    582         // Load the background helper class before using it
    583         if (!class_exists('OCM\OCM_BackgroundHelper')) {
    584             require_once __DIR__ . '/inc/background/class-background-helper.php';
    585         }
    586         OCM_BackgroundHelper::delete_all_batch_process();
    587598
    588599        // Make sure we don't leave un-necessary routes laying around
  • 1-click-migration/trunk/readme.txt

    r3376396 r3376496  
    55Tested up to: 6.8.3
    66Requires PHP: 7.4
    7 Stable tag: 2.3.1
     7Stable tag: 2.3.2
    88Author URI: https://1clickmigration.com
    99License: GPLv3 or later
     
    8080
    8181== 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
    8289= 2.3.1 =
    8390* Fixed white screen on deactivation 
Note: See TracChangeset for help on using the changeset viewer.