PluginProbe
ChatHelp – Click to Chat Button, WooCommerce Chat to Order & Floating Chat Form / trunk
ChatHelp – Click to Chat Button, WooCommerce Chat to Order & Floating Chat Form vtrunk
3.5.9 3.5.8 3.5.7 3.5.6 3.5.5 3.5.4 3.5.3 3.5.2 3.5.0 3.5.1 3.4.2 3.4.1 3.4.0 3.3.2 trunk 1.6.1 1.6.2 1.6.3 1.6.4 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 All 76 releases
chat-help / uninstall.php

uninstall.php in ChatHelp – Click to Chat Button, WooCommerce Chat to Order & Floating Chat Form trunk, at uninstall.php

61 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Fired when the plugin is uninstalled.
5 *
6 * @link https://themeatelier.net
7 * @since 1.0.0
8 *
9 * @package chat-help
10 * @subpackage chat-help/src/Admin/Views/Advance
11 * @author ThemeAtelier<themeatelierbd@gmail.com>
12 */
13
14 // If uninstall not called from WordPress, then exit.
15 if (! defined('WP_UNINSTALL_PLUGIN')) {
16 exit;
17 }
18
19 /**
20 * Delete plugin data function.
21 *
22 * @return void
23 */
24 function chat_help_delete_plugin_data()
25 {
26 global $wpdb;
27 // Delete plugin option settings.
28 $options = [
29 'cwp_option',
30 'ch_wooCommerce',
31 'ch_shortcode',
32 'ch_settings',
33 'ch_help',
34 'chat_help_version',
35 'chat_help_db_version',
36 'chat_help_first_version',
37 'chat_help_activation_date',
38 'themeatelier_offer_banner_dismissed_new_year_2026',
39 ];
40
41 foreach ($options as $option_name) {
42 delete_option($option_name); // Delete regular option.
43 delete_site_option($option_name); // Delete multisite option.
44 }
45
46 // delete leads table
47 $table_name = $wpdb->prefix . 'chat_help_leads';
48 $wpdb->query("DROP TABLE IF EXISTS `$table_name`");
49 $table_name_analytics = $wpdb->prefix . 'chat_help_analytics';
50 $wpdb->query("DROP TABLE IF EXISTS `$table_name_analytics`");
51 }
52
53 // Load WPTP file.
54 require plugin_dir_path(__FILE__) . '/chat-whatsapp.php';
55 $ch_settings = get_option('ch_settings');
56 $chat_help_data_delete = isset($ch_settings['cleanup_data_deletion']) ? $ch_settings['cleanup_data_deletion'] : false;
57
58 if ($chat_help_data_delete) {
59 chat_help_delete_plugin_data();
60 }
61