PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.0
JetFormBuilder — Dynamic Blocks Form Builder v3.1.0
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 tests 2 years ago README.md 2 years ago composer.json 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 wp-cli.local.yml 2 years ago
uninstall.php
104 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 'records_actions',
50 'records_errors',
51 'records_fields',
52 'subscription_to_payer_shipping',
53 'subscriptions_to_records',
54 'subscriptions_to_payments',
55 'subscriptions_notes',
56 'payment_to_payer_shipping',
57 'payments_to_records',
58 'payers_shipping',
59 // primary tables
60 'csrf_tokens',
61 'recurring_cycles',
62 'subscriptions',
63 'payments',
64 'migrations',
65 'payers',
66 'records',
67 );
68
69 global $wpdb;
70
71 // phpcs:disable WordPress.DB.PreparedSQL
72
73 foreach ( $tables as $table_name ) {
74 $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'jet_fb_' . $table_name );
75 }
76
77 $wpdb->query( "DELETE FROM {$wpdb->options} WHERE {$options_condition}" );
78
79 // phpcs:enable WordPress.DB.PreparedSQL
80
81 $forms = get_posts(
82 array(
83 'post_type' => array( 'jet-form-builder' ),
84 'post_status' => 'any',
85 'numberposts' => - 1,
86 'fields' => 'ids',
87 )
88 );
89 if ( $forms ) {
90 foreach ( $forms as $form_id ) {
91 wp_delete_post( $form_id, true );
92 }
93 }
94
95 /**
96 * @var WP_Filesystem_Base $wp_filesystem
97 */
98 global $wp_filesystem;
99
100 $uploads_directory = wp_upload_dir();
101 if ( empty( $uploads_directory['error'] ) ) {
102 $wp_filesystem->rmdir( $uploads_directory['basedir'] . '/jet-form-builder/', true );
103 }
104