From what I see, your plugin may work, however the suitability of it to other devs could be concerning. For example, in one if statement you return the boolean as true if the if statement triggers, and in the rest you don't. Your indentation is not in line too, which could cause some confusion...