| @@ 320-332 (lines=13) @@ | ||
| 317 | */ |
|
| 318 | public function __pause_db_update( $force = false ) { |
|
| 319 | // Bailout. |
|
| 320 | if ( |
|
| 321 | ! $force && |
|
| 322 | ( |
|
| 323 | wp_doing_ajax() || |
|
| 324 | ! isset( $_GET['page'] ) || |
|
| 325 | 'give-updates' !== $_GET['page'] || |
|
| 326 | ! isset( $_GET['give-pause-db-upgrades'] ) || |
|
| 327 | self::$background_updater->is_paused_process() |
|
| 328 | ) |
|
| 329 | ||
| 330 | ) { |
|
| 331 | return false; |
|
| 332 | } |
|
| 333 | ||
| 334 | delete_option( 'give_upgrade_error' ); |
|
| 335 | ||
| @@ 382-390 (lines=9) @@ | ||
| 379 | */ |
|
| 380 | public function __restart_db_update() { |
|
| 381 | // Bailout. |
|
| 382 | if ( |
|
| 383 | wp_doing_ajax() || |
|
| 384 | ! isset( $_GET['page'] ) || |
|
| 385 | 'give-updates' !== $_GET['page'] || |
|
| 386 | ! isset( $_GET['give-restart-db-upgrades'] ) || |
|
| 387 | ! self::$background_updater->is_paused_process() |
|
| 388 | ) { |
|
| 389 | return false; |
|
| 390 | } |
|
| 391 | ||
| 392 | Give_Background_Updater::flush_cache(); |
|
| 393 | $batch = get_option( 'give_paused_batches' ); |
|