public function delete($pluginName)
    {
        $plugin = plugin($pluginName); // throws if not exists
        $task = (bool)WebShellDispatcher::run("Installer.plugins uninstall -p {$plugin->name}");

        if ($task) {
            $this->Flash->success(__d('system', 'Plugin was successfully removed!'));
        } else {
            $this->Flash->set(__d('system', 'Plugins could not be removed'), [
                'element' => 'System.installer_errors',
                'params' => ['errors' => WebShellDispatcher::output()],
            ]);
        }

        $this->title(__d('system', 'Uninstall Plugin'));
        header('Location:' . $this->referer());
        exit();
    }