robotstxt-2fa/uninstall.php
2026-06-05 14:04:51 +00:00

32 lines
627 B
PHP

<?php
/**
* Uninstall cleanup for the 2FA (by ROBOTSTXT) plugin.
*
* @package Robotstxt_2FA
*/
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
delete_option( 'robotstxt_2fa_settings' );
delete_site_option( 'robotstxt_2fa_settings' );
global $wpdb;
$meta_keys = array(
'robotstxt_2fa_user_settings',
'robotstxt_2fa_email_challenge',
'robotstxt_2fa_last_verifications',
'robotstxt_2fa_recovery_codes',
'robotstxt_2fa_otp_secret',
);
foreach ( $meta_keys as $meta_key ) {
$wpdb->query(
$wpdb->prepare(
"DELETE FROM {$wpdb->usermeta} WHERE meta_key = %s",
$meta_key
)
);
}