protected function makePlugin($name, array $config)
    {
        $className = $name;
        if (strpos($className, '\\') === false) {
            $className = str_replace('/', '\\', $className) . '\\' . 'Plugin';
        }
        if (class_exists($className)) {
            return new $className($config);
        }

        if (!isset($config['path'])) {
            $config['path'] = $this->plugins->findPath($name);
        }
        $config['name'] = $name;

        return new BasePlugin($config);
    }