Plugin Directory

Changeset 3378249


Ignore:
Timestamp:
10/14/2025 02:40:40 PM (4 months ago)
Author:
1clickmigration
Message:

2.3.5

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

Legend:

Unmodified
Added
Removed
  • 1-click-migration/trunk/inc/admin/class-admin-page.php

    r3372639 r3378249  
    7474                                class="button button-primary button-large ocm-button restart-button">Restart</a>
    7575                </div>
     76               
     77                <p class="ocm-exclusion-warning" style="display:none; color: #dc3232; margin-top: 10px; text-align: center;">
     78                    <em>Please select at least one component to backup / restore.</em>
     79                </p>
    7680
    7781            </form>
  • 1-click-migration/trunk/inc/backup/class-ocm-backup.php

    r3376496 r3378249  
    327327
    328328        if (!One_Click_Migration::$process_backup_single->is_queue_empty()) {
    329 
    330             One_Click_Migration::$process_backup_single->handle_cron_healthcheck();
     329            // Queue already exists, just dispatch it
     330            One_Click_Migration::$process_backup_single->dispatch();
     331            wp_safe_redirect(admin_url('tools.php?page=one-click-migration'));
    331332            exit;
    332333        }
     
    444445            }
    445446          }
    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
    451 
     447        // Save the queue and dispatch for processing
     448        One_Click_Migration::$process_backup_single->save();
     449       
     450        // Try async dispatch first
     451        $dispatched = One_Click_Migration::$process_backup_single->dispatch();
     452       
     453        if (is_wp_error($dispatched)) {
     454            // If async dispatch fails, use direct processing for compatibility
     455            One_Click_Migration::write_to_log(' SYSLOG: Async dispatch failed, using direct processing for maximum compatibility');
     456            One_Click_Migration::$process_backup_single->trigger_processing(); // Process it directly
     457        } else {
     458            One_Click_Migration::write_to_log(' SYSLOG: Backup dispatched asynchronously');
     459        }
     460
     461        // Redirect back to the admin page (Note: 500 error may still appear in console but is cosmetic only)
     462        wp_safe_redirect(admin_url('tools.php?page=one-click-migration'));
    452463        exit;
    453464    }
     
    489500
    490501        if (!One_Click_Migration::$process_restore_single->is_queue_empty()) {
    491             One_Click_Migration::$process_restore_single->handle_cron_healthcheck();
     502            // Queue already exists, just dispatch it
     503            One_Click_Migration::$process_restore_single->dispatch();
     504            wp_safe_redirect(admin_url('tools.php?page=one-click-migration'));
    492505            exit;
    493506        } else {
    494507            One_Click_Migration::$process_restore_single->push_to_queue(array($username, $password));
    495508           
    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 
     509            // Save the queue and dispatch for processing
     510            One_Click_Migration::$process_restore_single->save();
     511           
     512            // Try async dispatch first
     513            $dispatched = One_Click_Migration::$process_restore_single->dispatch();
     514           
     515            if (is_wp_error($dispatched)) {
     516                // If async dispatch fails, use direct processing for compatibility
     517                One_Click_Migration::write_to_log(' SYSLOG: Async dispatch failed, using direct restore processing for maximum compatibility');
     518                One_Click_Migration::$process_restore_single->trigger_processing(); // Process it directly
     519            } else {
     520                One_Click_Migration::write_to_log(' SYSLOG: Restore dispatched asynchronously');
     521            }
     522
     523            // Redirect back to the admin page
     524            wp_safe_redirect(admin_url('tools.php?page=one-click-migration'));
    502525            exit;
    503526        }
     
    18381861        $default_text = array(
    18391862            'text' => 'Start a backup or a restore to see current progress here.</br></br>Entire process runs in the background, independent of your browser activity.</br> </br>If you get logged out during restore, log back in using your backup old WordPress credentials and refresh this page for progress.',
    1840             'value' => '0%'
     1863            'value' => '1%'  // Changed from 0% to 1% to prevent initial progress bar jump from 1% → 0% → 1%
    18411864        );
    18421865
  • 1-click-migration/trunk/js/admin-script.js

    r3376496 r3378249  
    683683
    684684      });
     685     
     686      // Hook into multiselect checkbox clicks to update button states
     687      setTimeout(function() {
     688        jQuery('#selective-backup_itemList').on('click', '.multiselect-checkbox', function() {
     689          // Use setTimeout to let the multiselect library update the underlying select first
     690          setTimeout(function() {
     691            updateButtonStates();
     692          }, 10);
     693        });
     694      }, 100);
    685695
    686696    };
     697
     698  // Function to check if all components are excluded and disable buttons accordingly
     699  var updateButtonStates = function() {
     700    var selectedFolders = jQuery('#selective-backup').val() || [];
     701    var allExcluded = selectedFolders.length === 4; // All 4 options selected means everything excluded
     702   
     703    if (allExcluded) {
     704        jQuery('.backup-button, .restore-button').addClass('disabled').attr('disabled', 'disabled');
     705        jQuery('.backup-button, .restore-button').css({
     706            'opacity': '0.5',
     707            'cursor': 'not-allowed',
     708            'pointer-events': 'none'
     709        });
     710        jQuery('.ocm-exclusion-warning').show();
     711    } else {
     712        jQuery('.backup-button, .restore-button').removeClass('disabled').removeAttr('disabled');
     713        jQuery('.backup-button, .restore-button').css({
     714            'opacity': '1',
     715            'cursor': 'pointer',
     716            'pointer-events': 'auto'
     717        });
     718        jQuery('.ocm-exclusion-warning').hide();
     719    }
     720  };
    687721
    688722  var reloadPaypalButtons = function(){
     
    775809
    776810    renderMultiselect();
     811   
     812    // Check button states on page load
     813    updateButtonStates();
     814   
    777815    reloadPaypalButtons();
    778816    restartFailedProcess();
  • 1-click-migration/trunk/one-click-migration.php

    r3377780 r3378249  
    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.4
     7 * Version: 2.3.5
    88 * Author: 1ClickMigration
    99 * Author URI: https://1clickmigration.com/
  • 1-click-migration/trunk/readme.txt

    r3377784 r3378249  
    55Tested up to: 6.8.3
    66Requires PHP: 7.4
    7 Stable tag: 2.3.4
     7Stable tag: 2.3.5
    88Author URI: https://1clickmigration.com
    99License: GPLv3 or later
     
    111111
    112112== Changelog ==
     113= 2.3.5 =
     114* **UX Improvement**: Disable Backup/Restore buttons when all components are excluded to prevent empty backups
     115* **UX Improvement**: Fixed progress bar jump from 1% to 0% at the start of backup/restore operations
     116* **Bug Fix**: Added validation to prevent silent failures when attempting to backup with all components excluded
     117
    113118= 2.3.3 =
    114119* **Bug Fix**: Fixed `is_processing()` method compatibility issue with different WP Background Processing library versions
Note: See TracChangeset for help on using the changeset viewer.