public function uninstallPlugin($pluginName)
{
if ($this->isPluginLoaded($pluginName)) {
throw new \Exception("To uninstall the plugin {$pluginName}, first disable it in Piwik > Settings > Plugins");
}
$this->loadAllPluginsAndGetTheirInfo();
SettingsStorage\Backend\PluginSettingsTable::removeAllSettingsForPlugin($pluginName);
SettingsStorage\Backend\MeasurableSettingsTable::removeAllSettingsForPlugin($pluginName);
$this->executePluginDeactivate($pluginName);
$this->executePluginUninstall($pluginName);
$this->removePluginFromPluginsInstalledConfig($pluginName);
$this->unloadPluginFromMemory($pluginName);
$this->removePluginFromConfig($pluginName);
$this->removeInstalledVersionFromOptionTable($pluginName);
$this->clearCache($pluginName);
self::deletePluginFromFilesystem($pluginName);
if ($this->isPluginInFilesystem($pluginName)) {
return false;
}
/**
* Event triggered after a plugin has been uninstalled.
*
* @param string $pluginName The plugin that has been uninstalled.
*/
Piwik::postEvent('PluginManager.pluginUninstalled', array($pluginName));
return true;
}