base-migration.php
2 years ago
version-2-1-0.php
10 months ago
version-2-1-7.php
2 years ago
version-2-1-8.php
2 years ago
version-3-1-7.php
2 years ago
version-3-6-1.php
3 months ago
version-3-6-5-2.php
6 days ago
version-3-6-5-2.php
38 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Migrations\Versions; |
| 5 | |
| 6 | use Jet_Form_Builder\Migrations\Auto_Migrator; |
| 7 | use JFB_Modules\Validation\Advanced_Rules\Ssr_Callback_Allowlist; |
| 8 | |
| 9 | // If this file is called directly, abort. |
| 10 | if ( ! defined( 'WPINC' ) ) { |
| 11 | die; |
| 12 | } |
| 13 | |
| 14 | /** |
| 15 | * Starts a bounded backfill of the SSR "Server-Side callback" allowlist. The first batch |
| 16 | * runs immediately and a capable admin page processes the remainder through a sequence |
| 17 | * of short AJAX requests, resuming from a persisted form-ID cursor when needed. Forms |
| 18 | * reached before the backfill completes initialize their own allowlist lazily from saved |
| 19 | * content, so unattended updates do not interrupt existing custom validation. The |
| 20 | * backfill does not depend on WP-Cron. |
| 21 | * |
| 22 | * @since 3.6.5.2 |
| 23 | */ |
| 24 | class Version_3_6_5_2 extends Base_Migration { |
| 25 | |
| 26 | public function up( \wpdb $wpdb ) { |
| 27 | Ssr_Callback_Allowlist::rebuild_from_all_forms(); |
| 28 | } |
| 29 | |
| 30 | public function down( \wpdb $wpdb ) { |
| 31 | delete_post_meta_by_key( Ssr_Callback_Allowlist::META_KEY ); |
| 32 | delete_option( Ssr_Callback_Allowlist::OPTION_KEY ); |
| 33 | delete_option( Ssr_Callback_Allowlist::REBUILD_PROGRESS_OPTION ); |
| 34 | delete_transient( Ssr_Callback_Allowlist::REBUILD_LOCK_TRANSIENT ); |
| 35 | delete_option( Auto_Migrator::DB_VERSION_OPTION ); |
| 36 | } |
| 37 | } |
| 38 |