PluginProbe
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.6
JetFormBuilder — Dynamic Blocks Form Builder v3.6.6
3.6.6.1 3.6.6 3.6.5.4 3.6.5.3 3.6.5.2 3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 All 134 releases
jetformbuilder / includes / migrations / versions / version-3-6-5-2.php

version-3-6-5-2.php in JetFormBuilder — Dynamic Blocks Form Builder 3.6.6, at includes/migrations/versions/version-3-6-5-2.php

38 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 * Runs a time-boxed backfill of the SSR "Server-Side callback" allowlist
16 * (`Ssr_Callback_Allowlist::rebuild_from_all_forms()`). When the forms table is large
17 * enough that a full scan would exceed its time budget, progress (a form-ID cursor plus
18 * the partial callback accumulator) is persisted and the call throws, leaving this
19 * migration "not installed" so the next capable admin's `admin_init` request resumes the
20 * scan automatically. The backfill does not depend on WP-Cron or AJAX.
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