is_totp_configured( $user_id ) && $this->is_totp_enabled( $user_id ); } /** * @param int $user_id * * @return bool */ private function is_totp_configured( $user_id ) { return (bool) get_user_meta( $user_id, self::TWOFAS_LIGHT_TOTP_SECRET, true ); } /** * @param int $user_id * * @return bool */ private function is_totp_enabled( $user_id ) { return get_user_meta( $user_id, self::TWOFAS_LIGHT_TOTP_STATUS, true ) === self::TWOFAS_LIGHT_TOTP_STATUS_ENABLED; } }