plugin(plugin, options) {
      if (_.isString(plugin)) {
        if (plugin === 'pagination') {
          const message =
            'Pagination plugin was moved into core Bookshelf. You can now use `fetchPage()` without having to ' +
            "call `.plugin('pagination')`. Remove any `.plugin('pagination')` calls to clear this message.";
          return console.warn(message); // eslint-disable-line no-console
        }

        if (plugin === 'visibility') {
          const message =
            'Visibility plugin was moved into core Bookshelf. You can now set the `hidden` and `visible` properties ' +
            "without having to call `.plugin('visibility')`. Remove any `.plugin('visibility')` calls to clear this " +
            'message.';
          return console.warn(message); // eslint-disable-line no-console
        }

        if (plugin === 'registry') {
          const message =
            'Registry plugin was moved into core Bookshelf. You can now register models using `bookshelf.model()` ' +
            "and collections using `bookshelf.collection()` without having to call `.plugin('registry')`. Remove " +
            "any `.plugin('registry')` calls to clear this message.";
          return console.warn(message); // eslint-disable-line no-console
        }

        if (plugin === 'processor') {
          const message =
            'Processor plugin was removed from core Bookshelf. To migrate to the new standalone package follow the ' +
            'instructions in https://github.com/bookshelf/bookshelf/wiki/Migrating-from-0.15.1-to-1.0.0#processor-plugin';
          return console.warn(message); // eslint-disable-line no-console
        }

        if (plugin === 'case-converter') {
          const message =
            'Case converter plugin was removed from core Bookshelf. To migrate to the new standalone package follow ' +
            'the instructions in https://github.com/bookshelf/bookshelf/wiki/Migrating-from-0.15.1-to-1.0.0#case-converter-plugin';
          return console.warn(message); // eslint-disable-line no-console
        }

        if (plugin === 'virtuals') {
          const message =
            'Virtuals plugin was removed from core Bookshelf. To migrate to the new standalone package follow ' +
            'the instructions in https://github.com/bookshelf/bookshelf/wiki/Migrating-from-0.15.1-to-1.0.0#virtuals-plugin';
          return console.warn(message); // eslint-disable-line no-console
        }

        require(plugin)(this, options);
      } else if (Array.isArray(plugin)) {
        plugin.forEach((p) => this.plugin(p, options));
      } else {
        plugin(this, options);
      }

      return this;
    }
@method Bookshelf#plugin
@memberOf Bookshelf
@description

This method provides a nice, tested, standardized way of adding plugins
to a `Bookshelf` instance, injecting the current instance into the
plugin, which should be a `module.exports`.

You can add a plugin by specifying a string with the name of the plugin
to load. In this case it will try to find a module. It will pass the
string to `require()`, so you can either require a third-party dependency
by name or one of your own modules by relative path:

    bookshelf.plugin('./bookshelf-plugins/my-favourite-plugin');
    bookshelf.plugin('plugin-from-npm');

There are a few official plugins published in `npm`, along with many
independently developed ones. See
[the list of available plugins](index.html#official-plugins).

You can also provide an array of strings or functions, which is the same
as calling `bookshelf.plugin()` multiple times. In this case the same
options object will be reused:

    bookshelf.plugin(['cool-plugin', './my-plugins/even-cooler-plugin']);

Example plugin:

    // Converts all string values to lower case when setting attributes on a model
    module.exports = function(bookshelf) {
      bookshelf.Model = bookshelf.Model.extend({
        set(key, value, options) {
          if (!key) return this
          if (typeof value === 'string') value = value.toLowerCase()
          return bookshelf.Model.prototype.set.call(this, key, value, options)
        }
      })
    }

@param {string|array|Function} plugin
  The plugin or plugins to load. If you provide a string it can
  represent an npm package or a file somewhere on your project. You can
  also pass a function as argument to add it as a plugin. Finally, it's
  also possible to pass an array of strings or functions to add them all
  at once.
@param {mixed} options
   This can be anything you want and it will be passed directly to the
   plugin as the second argument when loading it.
@return {Bookshelf} The bookshelf instance for chaining.