| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Fired when Hash Form is deleted from the Plugins screen. |
| 5 |
* |
| 6 |
* Only things the plugin added to WordPress itself are removed here. Forms, |
| 7 |
* fields, entries and their uploaded files are deliberately left in place: |
| 8 |
* deleting a plugin should not throw away submissions a site may still need, |
| 9 |
* or be legally required to keep, and a plugin that quietly destroys data on |
| 10 |
* uninstall is one nobody can safely reinstall to try again. |
| 11 |
* |
| 12 |
* @package Hash_Form |
| 13 |
*/ |
| 14 |
// If uninstall was not called by WordPress, then exit. |
| 15 |
if (!defined('WP_UNINSTALL_PLUGIN')) { |
| 16 |
exit; |
| 17 |
} |
| 18 |
|
| 19 |
require_once plugin_dir_path(__FILE__) . 'includes/HashFormCapabilities.php'; |
| 20 |
|
| 21 |
if (class_exists('HashFormCapabilities')) { |
| 22 |
// Take the plugin's capabilities back off every role, so it does not |
| 23 |
// leave them scattered across roles it once touched. |
| 24 |
HashFormCapabilities::remove_caps(); |
| 25 |
} |
| 26 |
|
| 27 |
delete_option('hashform_caps_version'); |
| 28 |
|
| 29 |
// A scheduled event outlives the plugin file unless it is cleared, and then |
| 30 |
// fires forever against a hook nothing answers. |
| 31 |
wp_clear_scheduled_hook('hashform_daily_maintenance'); |
| 32 |
|
| 33 |
// Migration bookkeeping, not data. The tables and everything in them stay. |
| 34 |
delete_option('hashform_schema_version'); |
| 35 |
delete_option('hashform_schema_progress'); |
| 36 |
delete_transient('hashform_schema_lock'); |
| 37 |
|