PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.2.1
JetFormBuilder — Dynamic Blocks Form Builder v3.2.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 2 years ago compatibility 2 years ago components 2 years ago includes 2 years ago languages 2 years ago modules 2 years ago templates 2 years ago index.php 2 years ago jet-form-builder.php 2 years ago readme.txt 2 years ago uninstall.php 2 years ago
uninstall.php
106 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 $options = get_option( 'jet_form_builder_settings__options-tab' );
14
15 if ( ! $options ) {
16 return;
17 }
18
19 $options = json_decode( $options, true );
20
21 if ( empty( $options['clear_on_uninstall'] ) ) {
22 return;
23 }
24
25 $opt_prefixes = array(
26 'jet\_form\_builder\_settings\_\_',
27 'jet\_fb\_',
28 'jfb\-',
29 'jfb\_',
30 );
31 $additional_prefixes = array();
32
33 foreach ( $opt_prefixes as $prefix ) {
34 array_push(
35 $additional_prefixes,
36 '\_transient\_' . $prefix,
37 '\_site\_transient\_' . $prefix,
38 '\_transient\_timeout\_' . $prefix,
39 '\_site\_transient\_timeout\_' . $prefix
40 );
41 }
42
43 $opt_prefixes = array_merge( $opt_prefixes, $additional_prefixes );
44
45 $options_condition = "option_name LIKE '" . implode( "%' OR option_name LIKE '", $opt_prefixes ) . "%'";
46
47 $tables = array(
48 // secondary tables
49 'tokens_to_records',
50 'records_actions',
51 'records_errors',
52 'records_fields',
53 'subscription_to_payer_shipping',
54 'subscriptions_to_records',
55 'subscriptions_to_payments',
56 'subscriptions_notes',
57 'payment_to_payer_shipping',
58 'payments_to_records',
59 'payers_shipping',
60 // primary tables
61 'tokens',
62 'csrf_tokens',
63 'recurring_cycles',
64 'subscriptions',
65 'payments',
66 'migrations',
67 'payers',
68 'records',
69 );
70
71 global $wpdb;
72
73 // phpcs:disable WordPress.DB.PreparedSQL
74
75 foreach ( $tables as $table_name ) {
76 $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'jet_fb_' . $table_name );
77 }
78
79 $wpdb->query( "DELETE FROM {$wpdb->options} WHERE {$options_condition}" );
80
81 // phpcs:enable WordPress.DB.PreparedSQL
82
83 $forms = get_posts(
84 array(
85 'post_type' => array( 'jet-form-builder' ),
86 'post_status' => 'any',
87 'numberposts' => - 1,
88 'fields' => 'ids',
89 )
90 );
91 if ( $forms ) {
92 foreach ( $forms as $form_id ) {
93 wp_delete_post( $form_id, true );
94 }
95 }
96
97 /**
98 * @var WP_Filesystem_Base $wp_filesystem
99 */
100 global $wp_filesystem;
101
102 $uploads_directory = wp_upload_dir();
103 if ( empty( $uploads_directory['error'] ) ) {
104 $wp_filesystem->rmdir( $uploads_directory['basedir'] . '/jet-form-builder/', true );
105 }
106