Plugin.php: Update duplicated code

There are some duplicated code when I commit the file before.
Remove them now.