Update plugin.js

Fixed #6608
Merge pull request #305 from penc/master

Fixed bug #6608