Globalised variable as it wasn't being found

Not working on PHP 5.3 testing environment
Reformatted code & renamed
Added name of original plugin