PluginProbe
MailerLite – WooCommerce integration / trunk
MailerLite – WooCommerce integration vtrunk
3.1.25 3.1.26 3.1.24 3.1.23 3.1.22 3.1.21 3.1.20 3.1.19 3.1.18 3.1.17 3.1.16 3.1.15 1.8.7 1.8.8 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 All 147 releases
woo-mailerlite / uninstall.php

uninstall.php in MailerLite – WooCommerce integration trunk, at uninstall.php

31 lines 955 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Fired when the plugin is uninstalled (deleted), not merely deactivated.
4 *
5 * This is the only place that is allowed to destroy plugin data: it drops the
6 * plugin tables and removes all stored options. Deactivation must preserve
7 * settings and carts (see WooMailerLiteDeActivator).
8 *
9 * @package WooMailerlite
10 */
11
12 // If uninstall is not called from WordPress, abort.
13 if (!defined('WP_UNINSTALL_PLUGIN')) {
14 die;
15 }
16
17 // Load the autoloader and helpers (db(), migrations, options, cache) without
18 // booting the full plugin.
19 require_once __DIR__ . '/bootstrap.php';
20
21 // Stop any scheduled background jobs.
22 if (function_exists('as_unschedule_all_actions')) {
23 as_unschedule_all_actions(WooMailerLiteCartCleanupJob::class);
24 }
25 WooMailerLiteCache::delete('cart_cleanup_scheduled');
26
27 // Drop plugin tables and remove all stored options.
28 WooMailerLiteMigration::rollback();
29 WooMailerLiteOptions::deleteAll();
30 delete_option('woo_mailerlite');
31