'Registers the given plugin(s).
Static sanity checks is also performed.
If a plugin is already registered, this will raise PluginAlreadyRegistered.'

def register_plugin(self, plugin):

    if (not issubclass(plugin, CMSPluginBase)):
        raise ImproperlyConfigured(('CMS    Plugins    must    be    subclasses    of    CMSPluginBase,    %r    is    not.' % plugin))
    plugin_name = plugin.__name__
    if (plugin_name in self.plugins):
        raise PluginAlreadyRegistered(('Cannot    register    %r,    a    plugin    with    this    name    (%r)    is    already    registered.' % (plugin, plugin_name)))
    plugin.value = plugin_name
    self.plugins[plugin_name] = plugin
    from cms.signals import pre_save_plugins, post_delete_plugins, pre_delete_plugins
    signals.pre_save.connect(pre_save_plugins, sender=plugin.model, dispatch_uid=('cms_pre_save_plugin_%s' % plugin_name))
    signals.post_delete.connect(post_delete_plugins, sender=CMSPlugin, dispatch_uid=('cms_post_delete_plugin_%s' % plugin_name))
    signals.pre_delete.connect(pre_delete_plugins, sender=CMSPlugin, dispatch_uid=('cms_pre_delete_plugin_%s' % plugin_name))
    if is_installed('reversion'):
        from cms.utils.reversion_hacks import RegistrationError
        try:
            reversion_register(plugin.model)
        except RegistrationError:
            pass
    return plugin
