original_string: 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();
      }
code: 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();
      }
code_tokens: 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 ( ) ; }
docstring: Uninstalls the given plugin.
  
  @param string $pluginName Plugin's name
  @return void Redirects to previous page
docstring_tokens: Uninstalls the given plugin .