improve writPluginFile method for support multiples plugins