Enforce 2FA for Admins
// Hook into the WordPress login process add_action(‘wp_login’, ‘send_otp_to_admin’, 10, 2); function send_otp_to_admin($user_login, $user) { // Check if the user is an administrator if (in_array(‘administrator’, $user->roles)) { // Generate a random 6-digit OTP $otp = wp_rand(100000, 999999); // Store the…Continue reading