| 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 |
|