private function getLoadedAndActivated($pluginName)
{
if (!$this->pluginManager->isPluginLoaded($pluginName)) {
return;
}
try {
if (!$this->pluginManager->isPluginActivated($pluginName)) {
return;
}
$plugin = $this->pluginManager->getLoadedPlugin($pluginName);
} catch (\Exception $e) {
// we are not allowed to use possible settings from this plugin, plugin is not active
return;
}
return $plugin;
}