Fixes #1013
Fixes duplicate line and adds a new clear_profile function
Add plugin hooks
Removed double line
Merge remote-tracking branch 'upstream/feature' into fix-1013
Forgot to globalize $plugins... -.-
Merge pull request #1120 from JN-Jones/fix-1013

Fixes #1013