Plugin.php: Update duplicated code

There are some duplicated code when I commit the file before.
Remove them now.
Merge pull request #4 from weakish/patch-1

Plugin.php: remove duplicated code