PluginProbe
Sendy / trunk
Sendy vtrunk
3.4.6 3.4.7 trunk 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 All 32 releases
sendy / uninstall.php

uninstall.php in Sendy trunk, at uninstall.php

41 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Removes the plugin's options and transients when the plugin is uninstalled,
5 * so a reinstall starts with fresh credentials and the portal creates a new
6 * OAuth client. Shipment metadata on orders is left in place.
7 */
8
9 if (! defined('WP_UNINSTALL_PLUGIN')) {
10 exit;
11 }
12
13 $sendy_options = [
14 'sendy_client_id',
15 'sendy_client_secret',
16 'sendy_hostname',
17 'sendy_access_token',
18 'sendy_refresh_token',
19 'sendy_token_expires',
20 'sendy_webhook_secret',
21 'sendy_webhook_id',
22 'sendy_webhook_last_checked',
23 'sendy_shipping_methods_last_sync',
24 'sendy_flash_admin_messages',
25 'sendy_import_weight',
26 'sendy_import_products',
27 'sendy_mark_order_as_completed',
28 'sendy_processing_method',
29 'sendy_processable_order_status',
30 'sendy_default_shop',
31 'sendy_previously_used_preference_id',
32 'sendy_previously_used_amount',
33 'sendy_previously_used_shop_id',
34 ];
35
36 foreach ($sendy_options as $sendy_option) {
37 delete_option($sendy_option);
38 }
39
40 delete_transient('sendy_shops');
41