-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.php
More file actions
41 lines (37 loc) · 875 Bytes
/
uninstall.php
File metadata and controls
41 lines (37 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* Plugin Hub Uninstall
*
* Uninstalling Plugin Hub deletes plugin options and transients.
*
* @package PluginHub
* @subpackage PluginHub/uninstall
* @since 1.1.0
*/
// If uninstall not called from WordPress, then exit.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
/**
* Delete plugin options.
*/
delete_option( 'plugin_hub_github_plugins' );
delete_option( 'plugin_hub_show_beta' );
delete_option( 'plugin_hub_github_token' );
/**
* Delete plugin transients.
*/
delete_transient( 'plugin_hub_csv_cache' );
delete_transient( 'plugin_hub_rate_limit' );
/**
* Delete disabled plugin options.
*
* Get all options that start with 'plugin_hub_disabled_' and delete them.
*/
global $wpdb;
$wpdb->query(
$wpdb->prepare(
"DELETE FROM {$wpdb->options} WHERE option_name LIKE %s",
$wpdb->esc_like( 'plugin_hub_disabled_' ) . '%'
)
);