private function getCurrentVersion($name) { switch (strtolower($name)) { case 'piwik': return $this->piwikVersion; case 'php': return PHP_VERSION; default: try { $pluginNames = PluginManager::getAllPluginsNames(); if (!in_array($name, $pluginNames) || !PluginManager::getInstance()->isPluginLoaded($name)) { return ''; } $plugin = PluginManager::getInstance()->loadPlugin(ucfirst($name)); if (!empty($plugin)) { return $plugin->getVersion(); } } catch (\Exception $e) { } } return ''; }