Check for empty $plugin var, some plugins don't pass in the plugin file.