| @@ -148,12 +148,9 @@ | ||
| 148 | 148 | */ |
| 149 | 149 | protected function start_run() { |
| 150 | 150 | $updater = $this->get_task_runner(); |
| 151 | 151 | |
| 152 | - // Skip if process is actively running (has lock) or queue already has items. | |
| 153 | - // Stuck queues (items exist but no lock) are handled by the shutdown fallback | |
| 154 | - // registered in the constructor, so we don't need to re-push callbacks here. | |
| 155 | - if ( $updater->is_process_locked() || $updater->is_running() ) { | |
| 152 | + if ( $updater->is_running() ) { | |
| 156 | 153 | return; |
| 157 | 154 | } |
| 158 | 155 | |
| 159 | 156 | $upgrade_callbacks = $this->get_upgrade_callbacks(); |
| @@ -227,17 +224,8 @@ | ||
| 227 | 224 | if ( is_admin() && current_user_can( 'update_plugins' ) && $this->get_flag( 'completed' ) ) { |
| 228 | 225 | add_action( 'admin_notices', [ $this, 'admin_notice_upgrade_is_completed' ] ); |
| 229 | 226 | } |
| 230 | 227 | |
| 231 | - // Don't run upgrade logic during background process AJAX requests. | |
| 232 | - // The AJAX handler (maybe_handle) will process the queue. | |
| 233 | - // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 234 | - $ajax_action = isset( $_REQUEST['action'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['action'] ) ) : ''; | |
| 235 | - | |
| 236 | - if ( wp_doing_ajax() && $ajax_action && false !== strpos( $ajax_action, 'updater' ) ) { | |
| 237 | - return; | |
| 238 | - } | |
| 239 | - | |
| 240 | 228 | if ( ! $this->should_upgrade() ) { |
| 241 | 229 | return; |
| 242 | 230 | } |
| 243 | 231 | |
| @@ -243,15 +231,8 @@ | ||
| 243 | 231 | |
| 244 | 232 | $updater = $this->get_task_runner(); |
| 245 | 233 | |
| 246 | 234 | $this->start_run(); |
| 247 | - | |
| 248 | - // If queue has items but process is not locked, it's stuck - try to process on shutdown. | |
| 249 | - if ( $updater->is_running() && ! $updater->is_process_locked() ) { | |
| 250 | - if ( is_admin() && ! wp_doing_ajax() && ! wp_doing_cron() ) { | |
| 251 | - add_action( 'shutdown', [ $updater, 'maybe_handle_on_shutdown' ], 0 ); | |
| 252 | - } | |
| 253 | - } | |
| 254 | 235 | |
| 255 | 236 | if ( $updater->is_running() && current_user_can( 'update_plugins' ) ) { |
| 256 | 237 | add_action( 'admin_notices', [ $this, 'admin_notice_upgrade_is_running' ] ); |
| 257 | 238 | } |