-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.php
More file actions
22 lines (17 loc) · 854 Bytes
/
Copy pathuninstall.php
File metadata and controls
22 lines (17 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
if (! defined('WP_UNINSTALL_PLUGIN')) {
exit;
}
delete_option('captchaapi_options');
delete_option('captchaapi_version');
// Drop the legacy single-use store if an older version left it behind. The
// server owns single-use now, so there is no table or purge cron in 2.0.
$captchaapi_hook = 'captchaapi_purge_expired';
$captchaapi_timestamp = wp_next_scheduled($captchaapi_hook);
if ($captchaapi_timestamp) {
wp_unschedule_event($captchaapi_timestamp, $captchaapi_hook);
}
global $wpdb;
$captchaapi_table = $wpdb->prefix . 'captchaapi_used_attestations';
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery, PluginCheck.Security.DirectDB.UnescapedDBParameter -- table name is a fixed prefix plus a constant string, not user input
$wpdb->query("DROP TABLE IF EXISTS {$captchaapi_table}");