loadPlugin = async (plugin, force, forceFetch) => {
  if (plugin.source === "npm" && !isFixedPlugin(plugin)) {
    try {
      await ensurePluginSupport(plugin, forceFetch);
    } catch (e) {
      console.log(
        `Warning: Unable to find a supported version for '${plugin.location}' Continuing with the installed version`
      );
    }
  }
  // load plugin
  const loader = new PluginInstaller(plugin, {
    scVersion: packagejson.version,
    envVars: { PUPPETEER_SKIP_DOWNLOAD: true },
  });
  const res = await loader.install(force);
  const configuration =
    typeof plugin.configuration === "string"
      ? JSON.parse(plugin.configuration)
      : plugin.configuration;
  try {
    // register plugin
    getState().registerPlugin(
      res.plugin_module.plugin_name || plugin.name,
      res.plugin_module,
      configuration,
      res.location,
      res.name
    );
  } catch (error) {
    getState().log(
      3,
      `Error loading plugin ${plugin.name}: ${error.message || error}`
    );
    if (force) {
      // remove the install dir and try again
      await loader.remove();
      await loader.install(force);
      getState().registerPlugin(
        res.plugin_module.plugin_name || plugin.name,
        res.plugin_module,
        configuration,
        res.location,
        res.name
      );
    }
  }
  if (res.plugin_module.user_config_form) await getState().refreshUserLayouts();
  if (res.plugin_module.onLoad) {
    try {
      await res.plugin_module.onLoad(plugin.configuration);
    } catch (error) {
      console.error(error); // todo i think that situation is not resolved
    }
  }

  if (isRoot() && res.plugin_module.authentication)
    await eachTenant(reloadAuthFromRoot);
  return res;
}
Load one plugin
TODO correct names for functions loadPlugin, requirePlugin - currently uncler
@param plugin - plugin to load
@param force - force flag