The best way to protect your plugin from viruses or malware is to update it regularly. It is also important that you only download plugins from trusted sources and that you enable all available security features that come with your plugin.