-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.php
More file actions
66 lines (58 loc) · 1.48 KB
/
uninstall.php
File metadata and controls
66 lines (58 loc) · 1.48 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* Smart SEO Booster Uninstall Script
*
* Fired when the plugin is uninstalled via WordPress admin.
* Cleans up plugin data and options.
*
* @package SmartSEOBooster
* @since 2.1.0
*/
// If uninstall not called from WordPress, exit
if (!defined('WP_UNINSTALL_PLUGIN')) {
exit('Direct access forbidden.');
}
// Check if user has the capability to uninstall plugins
if (!current_user_can('activate_plugins')) {
exit('Insufficient permissions.');
}
/**
* Clean up plugin options and data
*/
// Delete plugin settings
delete_option('smart_seo_options');
delete_option('smart_seo_version');
delete_option('smart_seo_installed_date');
// Delete site options (for multisite)
delete_site_option('smart_seo_options');
// Clean up any transients
delete_transient('smart_seo_audit_cache');
delete_transient('smart_seo_schema_cache');
/**
* Optional: Clean up post meta data
*
* Uncomment the following code to remove all Smart SEO meta fields from posts.
* WARNING: This will permanently delete all SEO meta data for posts/pages.
*/
/*
global $wpdb;
$wpdb->query(
$wpdb->prepare(
"DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE %s",
$wpdb->esc_like('_smart_seo_') . '%'
)
);
*/
/**
* Optional: Clean up user meta
*
* Uncomment the following code to remove all Smart SEO user preferences.
*/
/*
$wpdb->query(
$wpdb->prepare(
"DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE %s",
$wpdb->esc_like('smart_seo_') . '%'
)
);
*/