PluginProbe
Authorizer / 2.9.6
Authorizer v2.9.6
3.15.3 3.15.2 3.15.1 3.15.0 3.14.3 3.14.4 3.14.2 3.14.1 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.10 2.9.11 2.9.12 2.9.13 2.9.2 2.9.3 2.9.6 All 126 releases
authorizer / uninstall.php

uninstall.php in Authorizer 2.9.6, at uninstall.php

48 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Remove traces of plugin when uninstalling it.
4 *
5 * @package authorizer
6 */
7
8 /**
9 * Exit if uninstall not called from WordPress.
10 */
11 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
12 exit();
13 }
14
15 /**
16 * Delete options in database.
17 */
18 delete_option( 'auth_settings' );
19 delete_option( 'auth_settings_recently_sent_emails' );
20 delete_option( 'auth_settings_advanced_admin_notice' );
21 delete_option( 'auth_settings_advanced_login_error' );
22 delete_option( 'auth_settings_advanced_lockouts_time_last_failed' );
23 delete_option( 'auth_settings_advanced_lockouts_failed_attempts' );
24
25 /**
26 * Delete multisite options.
27 */
28 if ( is_multisite() ) {
29 delete_blog_option( BLOG_ID_CURRENT_SITE, 'auth_multisite_settings' );
30 }
31
32 /**
33 * For security, delete blocked users (since we can't enforce their blocked
34 * status without this plugin enabled, which means they would be able to reset
35 * their passwords and log in). If they have any content, reassign it to the
36 * current user (the user uninstalling the plugin).
37 */
38 if ( ! is_multisite() ) {
39 $current_user = wp_get_current_user();
40 $blocked_users = get_users( array(
41 'meta_key' => 'auth_blocked',
42 'meta_value' => 'yes',
43 ));
44 foreach ( $blocked_users as $blocked_user ) {
45 wp_delete_user( $blocked_user->ID, $current_user->ID );
46 }
47 }
48