PluginProbe ʕ •ᴥ•ʔ
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More / 1.4.5.2
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More v1.4.5.2
1.10.1 1.10.0.5 trunk 1.1.4 1.1.4.2 1.1.5 1.1.5.1 1.1.6 1.1.6.1 1.1.7 1.1.7.1 1.1.7.2 1.1.8 1.1.8.1 1.1.8.2 1.1.8.3 1.1.8.4 1.10.0.1 1.10.0.2 1.10.0.3 1.10.0.4 1.2.0 1.2.0.1 1.2.1 1.2.2 1.2.2.1 1.2.2.2 1.2.3 1.2.3.1 1.2.3.2 1.2.4 1.2.4.1 1.2.5 1.2.5.1 1.2.6 1.2.7 1.2.8 1.2.8.1 1.2.9 1.3.0 1.3.1 1.3.1.1 1.3.1.2 1.3.2 1.3.3 1.3.5 1.3.6 1.3.6.1 1.3.6.2 1.3.7.2 1.3.7.3 1.3.7.4 1.3.8 1.3.9.1 1.4.0.1 1.4.1.1 1.4.2 1.4.2.1 1.4.2.2 1.4.3 1.4.4 1.4.4.1 1.4.5 1.4.5.1 1.4.5.2 1.4.5.3 1.4.6 1.4.7.1 1.4.7.2 1.4.8.1 1.4.9 1.5.0.1 1.5.0.3 1.5.0.4 1.5.1 1.5.1.1 1.5.1.3 1.5.2.1 1.5.2.2 1.5.2.3 1.5.3 1.5.3.1 1.5.4.1 1.5.4.2 1.5.5 1.5.5.1 1.5.6 1.5.6.2 1.5.7 1.5.8.2 1.5.9.1 1.5.9.4 1.5.9.5 1.6.0.1 1.6.0.2 1.6.1 1.6.2.2 1.6.2.3 1.6.3.1 1.6.4 1.6.4.1 1.6.5 1.6.6 1.6.7 1.6.7.1 1.6.7.2 1.6.7.3 1.6.8 1.6.8.1 1.6.9 1.7.0 1.7.1.1 1.7.1.2 1.7.2 1.7.2.1 1.7.3 1.7.4 1.7.4.1 1.7.4.2 1.7.5.1 1.7.5.2 1.7.5.3 1.7.5.5 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.7.9.1 1.8.0.1 1.8.0.2 1.8.1.1 1.8.1.2 1.8.1.3 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.3.1 1.8.4 1.8.4.1 1.8.5.2 1.8.5.3 1.8.5.4 1.8.6.2 1.8.6.3 1.8.6.4 1.8.7.2 1.8.8.2 1.8.8.3 1.8.9.1 1.8.9.2 1.8.9.4 1.8.9.5 1.8.9.6 1.9.0.1 1.9.0.2 1.9.0.3 1.9.0.4 1.9.1.1 1.9.1.2 1.9.1.3 1.9.1.4 1.9.1.5 1.9.1.6 1.9.2.1 1.9.2.2 1.9.2.3 1.9.3.1 1.9.3.2 1.9.4.1 1.9.4.2 1.9.5 1.9.5.1 1.9.5.2 1.9.6 1.9.6.1 1.9.6.2 1.9.7.1 1.9.7.2 1.9.7.3 1.9.8.1 1.9.8.2 1.9.8.4 1.9.8.7 1.9.9.2 1.9.9.3 1.9.9.4
wpforms-lite / uninstall.php
wpforms-lite Last commit date
assets 8 years ago includes 8 years ago languages 8 years ago lite 8 years ago changelog.txt 8 years ago readme.txt 8 years ago uninstall.php 8 years ago wpforms.php 8 years ago
uninstall.php
89 lines
1 <?php
2 /**
3 * Uninstalls WPForms.
4 *
5 * Removes:
6 * - Entries table
7 * - Entry Meta table
8 * - Entry fields table
9 * - Form Preview page
10 * - wpforms_log post type posts and post_meta
11 * - wpforms post type posts and post_meta
12 * - WPForms settings/options
13 * - WPForms Uploads
14 *
15 * @package WPForms
16 * @author WPForms
17 * @since 1.4.5
18 * @license GPL-2.0+
19 * @copyright Copyright (c) 2018, WPForms LLC
20 */
21
22 // Exit if accessed directly.
23 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
24 exit;
25 }
26
27 // Confirm user has decided to remove all data, otherwise stop.
28 $settings = get_option( 'wpforms_settings', array() );
29 if ( empty( $settings['uninstall-data'] ) ) {
30 return;
31 }
32
33 global $wpdb;
34
35 // Delete entries table.
36 $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'wpforms_entries' );
37
38 // Delete entry meta table.
39 $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'wpforms_entry_meta' );
40
41 // Delete entry fields table.
42 $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'wpforms_entry_fields' );
43
44 // Delete Preview page.
45 $preview = get_option( 'wpforms_preview_page', false );
46 if ( ! empty( $preview ) ) {
47 wp_delete_post( $preview, true );
48 }
49
50 // Delete wpform and wpform_log post type posts/post_meta.
51 $posts = get_posts( array(
52 'post_type' => array( 'wpforms_log', 'wpforms' ),
53 'post_status' => 'any',
54 'numberposts' => -1,
55 'fields' => 'ids',
56 ) );
57 if ( $posts ) {
58 foreach ( $posts as $post ) {
59 wp_delete_post( $post, true);
60 }
61 }
62
63 // Delete plugin settings.
64 delete_option( 'wpforms_version' );
65 delete_option( 'wpforms_providers' );
66 delete_option( 'wpforms_license' );
67 delete_option( 'wpforms_license_updates' );
68 delete_option( 'wpforms_settings' );
69 delete_option( 'wpforms_version_upgraded_from' );
70 delete_option( 'wpforms_preview_page' );
71 delete_option( 'wpforms_zapier_apikey' );
72 delete_option( 'wpforms_activated' );
73 delete_option( 'wpforms_review' );
74 delete_option( 'wpforms_imported' );
75
76 // Remove any transients we've left behind.
77 $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '\_transient\_wpforms\_%'" );
78 $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '\_site\_transient\_wpforms\_%'" );
79 $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '\_transient\_timeout\_wpforms\_%'" );
80 $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '\_site\_transient\_timeout\_wpforms\_%'" );
81
82 // Remove uploaded files.
83 $uploads_directory = wp_upload_dir();
84 if ( ! empty( $uploads_directory['error'] ) ) {
85 return;
86 }
87 global $wp_filesystem;
88 $wp_filesystem->rmdir( $uploads_directory['basedir'] . '/wpforms/', true );
89