':param plugin: A plugin to initialize.
:returns: An initialized plugin with all default methods set.'

def _initialize_plugin(self, plugin):

    for attr in (defaults.DEFAULTS + ['ORDER']):
        if (not hasattr(plugin, attr)):
            setattr(plugin, attr, getattr(defaults, attr))
    if (not hasattr(plugin, 'plugin_name')):
        if hasattr(plugin, '__name__'):
            plugin.plugin_name = plugin.__name__
        elif hasattr(plugin, '__class__'):
            plugin.plugin_name = plugin.__class__.__name__
        else:
            plugin.plugin_name = 'anonymous'
