PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.1
JetFormBuilder — Dynamic Blocks Form Builder v3.6.1
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 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / uninstall.php
jetformbuilder Last commit date
assets 1 month ago compatibility 1 month ago components 7 months ago includes 1 month ago languages 1 month ago modules 1 month ago templates 1 year ago vendor 1 month ago .eslintrc.js 1 year ago index.php 2 years ago jet-form-builder.php 1 month ago load.php 2 years ago readme.txt 1 month ago uninstall.php 2 years ago
uninstall.php
115 lines
1 <?php
2 /**
3 * @since 3.0.0
4 */
5
6 // phpcs:disable WordPress.DB.DirectDatabaseQuery
7
8 // if uninstall.php is not called by WordPress, die
9 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
10 die;
11 }
12
13 require_once 'jet-form-builder.php';
14
15 // Disable Action Schedule Queue Runner.
16 if ( class_exists( 'ActionScheduler_QueueRunner' ) ) {
17 ActionScheduler_QueueRunner::instance()->unhook_dispatch_async_request();
18 }
19
20 $options = get_option( 'jet_form_builder_settings__options-tab' );
21
22 if ( ! $options ) {
23 return;
24 }
25
26 $options = json_decode( $options, true );
27
28 if ( empty( $options['clear_on_uninstall'] ) ) {
29 return;
30 }
31
32 $opt_prefixes = array(
33 'jet\_form\_builder\_settings\_\_',
34 'jet\_fb\_',
35 'jfb\-',
36 'jfb\_',
37 );
38 $additional_prefixes = array();
39
40 foreach ( $opt_prefixes as $prefix ) {
41 array_push(
42 $additional_prefixes,
43 '\_transient\_' . $prefix,
44 '\_site\_transient\_' . $prefix,
45 '\_transient\_timeout\_' . $prefix,
46 '\_site\_transient\_timeout\_' . $prefix
47 );
48 }
49
50 $opt_prefixes = array_merge( $opt_prefixes, $additional_prefixes );
51
52 $options_condition = "option_name LIKE '" . implode( "%' OR option_name LIKE '", $opt_prefixes ) . "%'";
53
54 $tables = array(
55 // secondary tables
56 'tokens_to_records',
57 'records_actions',
58 'records_errors',
59 'records_fields',
60 'subscription_to_payer_shipping',
61 'subscriptions_to_records',
62 'subscriptions_to_payments',
63 'subscriptions_notes',
64 'payment_to_payer_shipping',
65 'payments_to_records',
66 'payers_shipping',
67 // primary tables
68 'tokens',
69 'csrf_tokens',
70 'recurring_cycles',
71 'subscriptions',
72 'payments',
73 'migrations',
74 'payers',
75 'records',
76 );
77
78 global $wpdb;
79
80 // phpcs:disable WordPress.DB.PreparedSQL
81
82 foreach ( $tables as $table_name ) {
83 $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'jet_fb_' . $table_name );
84 }
85
86 $wpdb->query( "DELETE FROM {$wpdb->options} WHERE {$options_condition}" );
87
88 // phpcs:enable WordPress.DB.PreparedSQL
89
90 $forms = get_posts(
91 array(
92 'post_type' => array( 'jet-form-builder' ),
93 'post_status' => 'any',
94 'numberposts' => - 1,
95 'fields' => 'ids',
96 )
97 );
98 if ( $forms ) {
99 foreach ( $forms as $form_id ) {
100 wp_delete_post( $form_id, true );
101 }
102 }
103
104 /**
105 * @var WP_Filesystem_Base $wp_filesystem
106 */
107 global $wp_filesystem;
108
109 $uploads_directory = wp_upload_dir();
110 if ( empty( $uploads_directory['error'] ) ) {
111 $wp_filesystem->rmdir( $uploads_directory['basedir'] . '/jet-form-builder/', true );
112 }
113
114 ( new JFB_Modules\Jobs\Module() )->unschedule_all();
115