PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 1.2.9
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v1.2.9
2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 1.8.1 All 42 releases
sellkit / uninstall.php

uninstall.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 1.2.9, at uninstall.php

52 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Sellkit Uninstall
4 *
5 * Uninstalling Sellkit deletes tables, and options.
6 *
7 * @package Sellkit\Uninstaller
8 * @version NEXT
9 */
10
11 defined( 'WP_UNINSTALL_PLUGIN' ) || exit;
12
13 // Include file of Database Class.
14 require_once dirname( __FILE__ ) . '/includes/db.php';
15
16 $options = get_option( 'sellkit', [] );
17
18 if ( '1' === $options['delete_data'] ) {
19 // Drop Sellkit admin tables.
20 Sellkit\Database::drop_all_tables();
21
22 // Delete sellkit option from wp_options.
23 delete_option( 'sellkit' );
24
25 // Delete alls sellkit posts with their related meta fields.
26 global $wpdb;
27
28 $posts_id = $wpdb->prefix . 'posts.id';
29 $meta_id = $wpdb->prefix . 'postmeta.post_id';
30 $posts = $wpdb->prefix . 'posts'; // phpcs:ignore
31 $meta = $wpdb->prefix . 'postmeta';
32 $post_type = $wpdb->prefix . 'posts.post_type'; //phpcs:ignore
33
34 // phpcs:disable
35 $wpdb->query(
36 "DELETE $posts, $meta
37 FROM $posts
38 INNER JOIN $meta ON $meta_id = $posts_id
39 WHERE $post_type IN ( 'sellkit-funnels', 'sellkit_step' )"
40 );
41 // phpcs:enable
42
43 // Unset sellkit cookie.
44 setcookie( 'sellkit_contact_segmentation', null, -1, '/' );
45
46 // Clear any cached data that has been removed.
47 wp_cache_flush();
48
49 // Temporary option.
50 update_option( 'sellkit_pro_delete_data', '1' );
51 }
52