wordpress-popup
Last commit date
assets
5 years ago
inc
5 years ago
languages
5 years ago
lib
5 years ago
vendor
5 years ago
views
5 years ago
humans.txt
5 years ago
license.txt
5 years ago
opt-in-static.php
6 years ago
popover.php
5 years ago
readme.txt
5 years ago
uninstall.php
5 years ago
uninstall.php
62 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Hustle Uninstall methods |
| 4 | * Called when plugin is deleted |
| 5 | * |
| 6 | * @since 4.0.3 |
| 7 | */ |
| 8 | |
| 9 | // If uninstall.php is not called by WordPress, die. |
| 10 | if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
| 11 | die; |
| 12 | } |
| 13 | |
| 14 | // Require helper file for uninstallation. |
| 15 | if ( ! class_exists( 'Hustle_Deletion' ) ) { |
| 16 | require_once dirname( __FILE__ ) . '/inc/hustle-deletion.php'; |
| 17 | } |
| 18 | |
| 19 | Hustle_Deletion::clear_cronjobs(); |
| 20 | |
| 21 | $hustle_settings = get_option( 'hustle_settings', array() ); |
| 22 | |
| 23 | if ( ! empty( $hustle_settings['data'] ) && ! empty( $hustle_settings['data']['reset_settings_uninstall'] ) && '1' === $hustle_settings['data']['reset_settings_uninstall'] ) { |
| 24 | Hustle_Deletion::hustle_reset_notifications(); |
| 25 | Hustle_Deletion::hustle_delete_custom_options(); |
| 26 | Hustle_Deletion::hustle_delete_addon_options( hustle_addon_slugs() ); |
| 27 | Hustle_Deletion::hustle_clear_modules(); |
| 28 | Hustle_Deletion::hustle_clear_module_submissions(); |
| 29 | Hustle_Deletion::hustle_clear_module_views(); |
| 30 | Hustle_Deletion::hustle_drop_custom_tables(); |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Delete slug params |
| 35 | * |
| 36 | * @since 1.4 |
| 37 | */ |
| 38 | function hustle_addon_slugs() { |
| 39 | $addon_slugs = array( |
| 40 | 'activecampaign', |
| 41 | 'aweber', |
| 42 | 'campaignmonitor', |
| 43 | 'constantcontact', |
| 44 | 'convertkit', |
| 45 | 'e_newsletter', |
| 46 | 'getresponse', |
| 47 | 'hubspot', |
| 48 | 'icontact', |
| 49 | 'infusionsoft', |
| 50 | 'mad_mimi', |
| 51 | 'mailchimp', |
| 52 | 'mailerlite', |
| 53 | 'mautic', |
| 54 | 'sendgrid', |
| 55 | 'sendinblue', |
| 56 | 'sendy', |
| 57 | 'zapier', |
| 58 | ); |
| 59 | |
| 60 | return $addon_slugs; |
| 61 | } |
| 62 |