Clean up plugin logic and warning text

added a test