Adapted for sidebar login plugin