Education is key. Plugin authors need to take responsibility for their code and go about things the right way to limit the potential damage security vulnerabilities can cause.