Changeset 3673717
- Timestamp:
- 08/31/2026 09:03:52 AM (3 months ago)
- Location:
- haseebvault-backup-migration/trunk
- Files:
-
- 11 edited
-
admin/views/_progress.php (modified) (1 diff)
-
admin/views/settings.php (modified) (1 diff)
-
assets/css/admin.css (modified) (1 diff)
-
assets/js/admin.js (modified) (4 diffs)
-
haseebvault.php (modified) (2 diffs)
-
includes/class-activator.php (modified) (1 diff)
-
includes/class-admin.php (modified) (3 diffs)
-
includes/class-archive.php (modified) (3 diffs)
-
includes/class-database-exporter.php (modified) (1 diff)
-
includes/class-file-scanner.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
haseebvault-backup-migration/trunk/admin/views/_progress.php
r3662954 r3673717 12 12 <div class="hv-progress-meta"><strong id="hv-progress-percent">0%</strong><span id="hv-progress-message"><?php esc_html_e( 'Preparing the operation…', 'haseebvault-backup-migration' ); ?></span></div> 13 13 <p class="hv-progress-lock-note"><span class="dashicons dashicons-lock"></span><?php esc_html_e( 'Keep this window open until the operation finishes.', 'haseebvault-backup-migration' ); ?></p> 14 <div class="hv-inline-actions hv-modal-actions"><button type="button" class="button" id="hv-job-pause"><?php esc_html_e( 'Pause', 'haseebvault-backup-migration' ); ?></button><button type="button" class="button" id="hv-job-resume" hidden><?php esc_html_e( 'Resume', 'haseebvault-backup-migration' ); ?></button><button type="button" class="button button-link-delete" id="hv-job-cancel"><?php esc_html_e( 'Cancel', 'haseebvault-backup-migration' ); ?></button>< /div>14 <div class="hv-inline-actions hv-modal-actions"><button type="button" class="button" id="hv-job-pause"><?php esc_html_e( 'Pause', 'haseebvault-backup-migration' ); ?></button><button type="button" class="button" id="hv-job-resume" hidden><?php esc_html_e( 'Resume', 'haseebvault-backup-migration' ); ?></button><button type="button" class="button button-link-delete" id="hv-job-cancel"><?php esc_html_e( 'Cancel', 'haseebvault-backup-migration' ); ?></button><button type="button" class="button button-primary" id="hv-job-ok" hidden><?php esc_html_e( 'OK', 'haseebvault-backup-migration' ); ?></button></div> 15 15 </section> 16 16 </div> -
haseebvault-backup-migration/trunk/admin/views/settings.php
r3662954 r3673717 13 13 </section> 14 14 <section class="hv-card hv-form"><div class="hv-card-heading"><div><p class="hv-kicker"><?php esc_html_e( 'Export exclusions', 'haseebvault-backup-migration' ); ?></p><h2><?php esc_html_e( 'Keep temporary data out', 'haseebvault-backup-migration' ); ?></h2></div></div><div class="hv-grid hv-grid-2"><label class="hv-field"><span><?php esc_html_e( 'Excluded paths', 'haseebvault-backup-migration' ); ?></span><textarea rows="5" name="haseebvault_settings[excluded_paths]"><?php echo esc_textarea( implode( "\n", (array) ( $settings['excluded_paths'] ?? array() ) ) ); ?></textarea><small><?php esc_html_e( 'One path per line, relative to the WordPress root.', 'haseebvault-backup-migration' ); ?></small></label><label class="hv-field"><span><?php esc_html_e( 'Excluded extensions', 'haseebvault-backup-migration' ); ?></span><textarea rows="5" name="haseebvault_settings[excluded_extensions]"><?php echo esc_textarea( implode( "\n", (array) ( $settings['excluded_extensions'] ?? array() ) ) ); ?></textarea><small><?php esc_html_e( 'One extension per line without a dot.', 'haseebvault-backup-migration' ); ?></small></label></div><label class="hv-field hv-field-small"><span><?php esc_html_e( 'Exclude files larger than (MB)', 'haseebvault-backup-migration' ); ?></span><input type="number" min="0" name="haseebvault_settings[max_file_size_mb]" value="<?php echo esc_attr( (int) ( ( $settings['max_file_size'] ?? 0 ) / MB_IN_BYTES ) ); ?>"><small><?php esc_html_e( '0 includes files of every size.', 'haseebvault-backup-migration' ); ?></small></label></section> 15 <section class="hv-card hv-form"><div class="hv-card-heading"><div><p class="hv-kicker"><?php esc_html_e( 'Performance', 'haseebvault-backup-migration' ); ?></p><h2><?php esc_html_e( 'Batch engine', 'haseebvault-backup-migration' ); ?></h2></div></div><div class="hv-grid hv-grid-3"><label class="hv-field"><span><?php esc_html_e( 'Files per batch', 'haseebvault-backup-migration' ); ?></span><input type="number" min="5" max="500" name="haseebvault_settings[files_per_batch]" value="<?php echo esc_attr( $settings['files_per_batch'] ?? 80 ); ?>"></label><label class="hv-field"><span><?php esc_html_e( 'Database rows per batch', 'haseebvault-backup-migration' ); ?></span><input type="number" min="10" max="5000" name="haseebvault_settings[database_rows_per_batch]" value="<?php echo esc_attr( $settings['database_rows_per_batch'] ?? 250 ); ?>"></label><label class="hv-field"><span><?php esc_html_e( 'Request time budget (seconds)', 'haseebvault-backup-migration' ); ?></span><input type="number" min="2" max="20" name="haseebvault_settings[time_budget]" value="<?php echo esc_attr( $settings['time_budget'] ?? 8 ); ?>"></label><label class="hv-field"><span><?php esc_html_e( 'AJAX delay (milliseconds)', 'haseebvault-backup-migration' ); ?></span><input type="number" min="0" max="5000" name="haseebvault_settings[ajax_delay]" value="<?php echo esc_attr( $settings['ajax_delay'] ?? 250 ); ?>"></label><label class="hv-field"><span><?php esc_html_e( 'Upload chunk size (MB)', 'haseebvault-backup-migration' ); ?></span><input type="number" min="1" max="20" name="haseebvault_settings[upload_chunk_size_mb]" value="<?php echo esc_attr( (int) ( ( $settings['upload_chunk_size'] ?? 5 * MB_IN_BYTES ) / MB_IN_BYTES ) ); ?>"></label></div></section>15 <section class="hv-card hv-form"><div class="hv-card-heading"><div><p class="hv-kicker"><?php esc_html_e( 'Performance', 'haseebvault-backup-migration' ); ?></p><h2><?php esc_html_e( 'Batch engine', 'haseebvault-backup-migration' ); ?></h2></div></div><div class="hv-grid hv-grid-3"><label class="hv-field"><span><?php esc_html_e( 'Files per batch', 'haseebvault-backup-migration' ); ?></span><input type="number" min="5" max="500" name="haseebvault_settings[files_per_batch]" value="<?php echo esc_attr( $settings['files_per_batch'] ?? 300 ); ?>"></label><label class="hv-field"><span><?php esc_html_e( 'Database rows per batch', 'haseebvault-backup-migration' ); ?></span><input type="number" min="10" max="5000" name="haseebvault_settings[database_rows_per_batch]" value="<?php echo esc_attr( $settings['database_rows_per_batch'] ?? 1000 ); ?>"></label><label class="hv-field"><span><?php esc_html_e( 'Request time budget (seconds)', 'haseebvault-backup-migration' ); ?></span><input type="number" min="2" max="20" name="haseebvault_settings[time_budget]" value="<?php echo esc_attr( $settings['time_budget'] ?? 8 ); ?>"></label><label class="hv-field"><span><?php esc_html_e( 'AJAX delay (milliseconds)', 'haseebvault-backup-migration' ); ?></span><input type="number" min="0" max="5000" name="haseebvault_settings[ajax_delay]" value="<?php echo esc_attr( $settings['ajax_delay'] ?? 50 ); ?>"></label><label class="hv-field"><span><?php esc_html_e( 'Upload chunk size (MB)', 'haseebvault-backup-migration' ); ?></span><input type="number" min="1" max="20" name="haseebvault_settings[upload_chunk_size_mb]" value="<?php echo esc_attr( (int) ( ( $settings['upload_chunk_size'] ?? 5 * MB_IN_BYTES ) / MB_IN_BYTES ) ); ?>"></label></div></section> 16 16 <?php submit_button( __( 'Save Settings', 'haseebvault-backup-migration' ), 'primary button-hero', 'submit', false ); ?> 17 17 </form> -
haseebvault-backup-migration/trunk/assets/css/admin.css
r3662954 r3673717 333 333 .hv-progress-meta strong { color: var(--hv-navy); } 334 334 .hv-operation-overlay[hidden] { display: none !important; } 335 .hv-operation-overlay [hidden] { display: none !important; } 335 336 .hv-operation-overlay { 336 337 position: fixed; -
haseebvault-backup-migration/trunk/assets/js/admin.js
r3663759 r3673717 54 54 const resumeButton = document.getElementById('hv-job-resume'); 55 55 const cancelButton = document.getElementById('hv-job-cancel'); 56 const okButton = document.getElementById('hv-job-ok'); 56 57 const runner = { 57 58 jobId: '', … … 101 102 if (resumeButton) resumeButton.hidden = !runner.paused || runner.terminal; 102 103 if (cancelButton) { 103 cancelButton.hidden = !canCancel && !runner.terminal; 104 cancelButton.textContent = runner.terminal && runner.redirectUrl ? (runner.actionLabel || 'OK') : (runner.terminal ? 'Close' : 'Cancel'); 105 cancelButton.classList.toggle('button-primary', Boolean(runner.terminal && runner.redirectUrl)); 106 cancelButton.classList.toggle('button-link-delete', !runner.terminal || !runner.redirectUrl); 107 } 104 cancelButton.hidden = Boolean(runner.terminal && runner.redirectUrl) || (!canCancel && !runner.terminal); 105 cancelButton.textContent = runner.terminal ? 'Close' : 'Cancel'; 106 } 107 if (okButton) { 108 okButton.hidden = !runner.terminal || !runner.redirectUrl; 109 okButton.textContent = runner.actionLabel || 'OK'; 110 } 108 111 } 109 112 … … 375 378 if (cancelButton) cancelButton.addEventListener('click', async () => { 376 379 if (runner.terminal) { 377 if (runner.redirectUrl) {378 window.location.assign(runner.redirectUrl);379 return;380 }381 380 closeProgress(); 382 381 return; … … 398 397 toast(error.message, true); 399 398 } 399 }); 400 401 if (okButton) okButton.addEventListener('click', () => { 402 if (runner.redirectUrl) window.location.assign(runner.redirectUrl); 400 403 }); 401 404 -
haseebvault-backup-migration/trunk/haseebvault.php
r3663759 r3673717 3 3 * Plugin Name: HaseebVault - Backup & Migration 4 4 * Description: Secure WordPress backup, migration, import, and export with resumable processing, integrity checks, and safe URL replacement. 5 * Version: 1.1. 85 * Version: 1.1.9 6 6 * Requires at least: 6.2 7 7 * Requires PHP: 7.4 … … 18 18 defined( 'ABSPATH' ) || exit; 19 19 20 define( 'HASEEBVAULT_VERSION', '1.1. 8' );20 define( 'HASEEBVAULT_VERSION', '1.1.9' ); 21 21 define( 'HASEEBVAULT_FORMAT_VERSION', '1.0' ); 22 22 define( 'HASEEBVAULT_FILE', __FILE__ ); -
haseebvault-backup-migration/trunk/includes/class-activator.php
r3662954 r3673717 86 86 'delete_on_uninstall' => false, 87 87 'enable_logging' => true, 88 'files_per_batch' => 80,89 'database_rows_per_batch' => 250,90 'ajax_delay' => 250,88 'files_per_batch' => 300, 89 'database_rows_per_batch' => 1000, 90 'ajax_delay' => 50, 91 91 'time_budget' => 8, 92 92 'upload_chunk_size' => 5 * MB_IN_BYTES, -
haseebvault-backup-migration/trunk/includes/class-admin.php
r3663759 r3673717 60 60 wp_enqueue_script( 'haseebvault-admin', HASEEBVAULT_URL . 'assets/js/admin.js', array(), HASEEBVAULT_VERSION, true ); 61 61 $settings = get_option( 'haseebvault_settings', array() ); 62 $delay = max( 0, (int) ( $settings['ajax_delay'] ?? 50 ) ); 63 $delay = 250 === $delay ? 50 : $delay; 62 64 wp_localize_script( 63 65 'haseebvault-admin', … … 66 68 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 67 69 'nonce' => wp_create_nonce( 'haseebvault_admin' ), 68 'delay' => max( 0, (int) ( $settings['ajax_delay'] ?? 250 ) ),70 'delay' => $delay, 69 71 'chunkSize' => max( MB_IN_BYTES, min( 20 * MB_IN_BYTES, (int) ( $settings['upload_chunk_size'] ?? 5 * MB_IN_BYTES ) ) ), 70 72 'urls' => array( … … 116 118 } 117 119 } 118 $output['files_per_batch'] = max( 5, min( 500, (int) ( $output['files_per_batch'] ?? 80 ) ) );119 $output['database_rows_per_batch'] = max( 10, min( 5000, (int) ( $output['database_rows_per_batch'] ?? 250 ) ) );120 $output['files_per_batch'] = max( 5, min( 500, (int) ( $output['files_per_batch'] ?? 300 ) ) ); 121 $output['database_rows_per_batch'] = max( 10, min( 5000, (int) ( $output['database_rows_per_batch'] ?? 1000 ) ) ); 120 122 $output['time_budget'] = max( 2, min( 20, (int) ( $output['time_budget'] ?? 8 ) ) ); 121 123 if ( isset( $input['upload_chunk_size_mb'] ) ) { -
haseebvault-backup-migration/trunk/includes/class-archive.php
r3662954 r3673717 68 68 public function add_files( $job_id, array $state ) { 69 69 $settings = get_option( 'haseebvault_settings', array() ); 70 $batch = max( 1, min( 500, (int) apply_filters( 'haseebvault_batch_size', $settings['files_per_batch'] ?? 80 ) ) ); 70 $configured_batch = (int) ( $settings['files_per_batch'] ?? 300 ); 71 // Upgrade the original conservative default automatically without 72 // overriding a site owner's explicitly customized batch value. 73 $configured_batch = 80 === $configured_batch ? 300 : $configured_batch; 74 $batch = max( 1, min( 500, (int) apply_filters( 'haseebvault_batch_size', $configured_batch ) ) ); 71 75 $time_budget = max( 2, min( 20, (int) ( $settings['time_budget'] ?? 8 ) ) ); 72 76 $started = microtime( true ); … … 113 117 } 114 118 $required_entries[] = $entry; 115 if ( (int) $record['size'] > 64 * MB_IN_BYTES&& method_exists( $zip, 'setCompressionName' ) ) {119 if ( $this->store_without_recompression( $relative, (int) $record['size'] ) && method_exists( $zip, 'setCompressionName' ) ) { 116 120 $zip->setCompressionName( $entry, ZipArchive::CM_STORE ); 117 121 } … … 142 146 'complete' => $eof, 143 147 ); 148 } 149 150 /** 151 * Avoid wasting CPU recompressing media and archive formats that are already 152 * compressed. Their SHA-256 integrity verification remains unchanged. 153 * 154 * @param string $relative Relative file path. 155 * @param int $size File size in bytes. 156 * @return bool 157 */ 158 private function store_without_recompression( $relative, $size ) { 159 if ( $size > 64 * MB_IN_BYTES ) { 160 return true; 161 } 162 $extensions = array( 163 '7z', 'avi', 'avif', 'flac', 'gif', 'gz', 'jpeg', 'jpg', 'm4a', 'mkv', 164 'mov', 'mp3', 'mp4', 'ogg', 'pdf', 'png', 'rar', 'webm', 'webp', 'woff', 165 'woff2', 'zip', 166 ); 167 $extensions = (array) apply_filters( 'haseebvault_store_extensions', $extensions ); 168 return in_array( strtolower( pathinfo( $relative, PATHINFO_EXTENSION ) ), $extensions, true ); 144 169 } 145 170 -
haseebvault-backup-migration/trunk/includes/class-database-exporter.php
r3662954 r3673717 55 55 global $wpdb; 56 56 $settings = get_option( 'haseebvault_settings', array() ); 57 $row_limit = max( 10, min( 5000, (int) apply_filters( 'haseebvault_database_batch_size', $settings['database_rows_per_batch'] ?? 250 ) ) ); 57 $configured = (int) ( $settings['database_rows_per_batch'] ?? 1000 ); 58 $configured = 250 === $configured ? 1000 : $configured; 59 $row_limit = max( 10, min( 5000, (int) apply_filters( 'haseebvault_database_batch_size', $configured ) ) ); 58 60 $time_budget = max( 2, min( 20, (int) ( $settings['time_budget'] ?? 8 ) ) ); 59 61 $started = microtime( true ); -
haseebvault-backup-migration/trunk/includes/class-file-scanner.php
r3662954 r3673717 34 34 public function process( $job_id, array $state, array $components, array $options ) { 35 35 $settings = get_option( 'haseebvault_settings', array() ); 36 $batch = max( 5, (int) ( $settings['files_per_batch'] ?? 80 ) ); 36 $configured = (int) ( $settings['files_per_batch'] ?? 300 ); 37 $configured = 80 === $configured ? 300 : $configured; 38 $batch = max( 5, min( 500, $configured ) ); 37 39 $time_budget = max( 2, min( 20, (int) ( $settings['time_budget'] ?? 8 ) ) ); 38 40 $started = microtime( true ); -
haseebvault-backup-migration/trunk/readme.txt
r3663759 r3673717 5 5 Tested up to: 7.0 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 87 Stable tag: 1.1.9 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 96 96 == Changelog == 97 97 98 = 1.1.9 = 99 * Shows a dedicated OK button as the only action after a successful website import. 100 * Reliably hides Pause, Resume, and Cancel controls in terminal success popups across WordPress admin styles. 101 * Speeds up exports with larger safe adaptive batches and shorter inter-request delays. 102 * Avoids CPU-intensive recompression for media, fonts, PDFs, and archive formats that are already compressed. 103 98 104 = 1.1.8 = 99 105 * Removed the typed confirmation and manual source/destination URL fields from import setup.
Note:
See TracChangeset
for help on using the changeset viewer.