PluginProbe
Happyforms – Form Builder for WordPress: Drag & Drop Contact Forms, Surveys, Payments & Multipurpose Forms / delete
Happyforms – Form Builder for WordPress: Drag & Drop Contact Forms, Surveys, Payments & Multipurpose Forms vdelete
1.26.15 trunk 1.0 1.10.0 1.11.0 1.11.1 1.12.0 1.12.1 1.12.10 1.12.11 1.12.12 1.12.2 1.12.3 1.12.4 1.12.5 1.12.6 1.12.7 1.12.8 1.12.9 1.13.0 1.13.1 1.13.10 1.13.11 1.13.12 1.13.2 All 194 releases
happyforms / uninstall.php

uninstall.php in Happyforms – Form Builder for WordPress: Drag & Drop Contact Forms, Surveys, Payments & Multipurpose Forms delete, at uninstall.php

52 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4 die;
5 }
6
7 // Free version specific options
8 delete_transient( 'happyforms_review_notice_recommend' );
9 delete_option( 'happyforms_modal_dismissed_onboarding' );
10 delete_option( 'happyforms_show_powered_by' );
11 delete_option( '_happyforms_received_submissions' );
12
13 // Stop cleanup if upgrade version is currently active.
14 if ( defined( 'HAPPYFORMS_UPGRADE_VERSION' ) ) {
15 return;
16 }
17
18 // Forms
19 $statuses = array( 'publish', 'trash', 'any' );
20
21 foreach( $statuses as $status ) {
22 $form_ids = get_posts( array(
23 'post_type' => 'happyform',
24 'post_status' => $status,
25 'numberposts' => -1,
26 'fields' => 'ids',
27 ) );
28
29 foreach( $form_ids as $form_id ) {
30 wp_delete_post( $form_id, true );
31 }
32 }
33
34 // General options
35 delete_option( 'widget_happyforms_widget' );
36 delete_option( 'happyforms-tracking' );
37 delete_option( 'ttf_updates_key_happyforms' );
38
39 // User meta
40 $users = get_users();
41
42 foreach( $users as $user ) {
43 delete_user_meta( $user->ID, 'happyforms-dismissed-notices' );
44 delete_transient( 'happyforms_admin_notices_' . md5( $user->user_login ) );
45 delete_user_meta( $user->ID, 'happyforms-settings-sections-states' );
46 }
47
48 // Migrations
49 delete_option( 'happyforms-data-version' );
50
51 // Old deactivation flag
52 delete_option( '_happyforms_cleanup_on_deactivate' );