public function uninstall( $args, $assoc_args = array() ) {

		$all = Utils\get_flag_value( $assoc_args, 'all', false );

		// Check if plugin names of --all is passed.
		$args = $this->check_optional_args_and_all( $args, $all, 'uninstall' );
		if ( ! $args ) {
			return;
		}

		$successes = 0;
		$errors    = 0;
		$plugins   = $this->fetcher->get_many( $args );
		if ( count( $plugins ) < count( $args ) ) {
			$errors = count( $args ) - count( $plugins );
		}

		foreach ( $plugins as $plugin ) {
			if ( is_plugin_active( $plugin->file ) && ! WP_CLI\Utils\get_flag_value( $assoc_args, 'deactivate' ) ) {
				WP_CLI::warning( "The '{$plugin->name}' plugin is active." );
				$errors++;
				continue;
			}

			if ( Utils\get_flag_value( $assoc_args, 'deactivate' ) ) {
				WP_CLI::log( "Deactivating '{$plugin->name}'..." );
				$this->chained_command = true;
				$this->deactivate( array( $plugin->name ) );
				$this->chained_command = false;
			}

			uninstall_plugin( $plugin->file );

			if ( ! Utils\get_flag_value( $assoc_args, 'skip-delete' ) && $this->delete_plugin( $plugin ) ) {
				WP_CLI::log( "Uninstalled and deleted '$plugin->name' plugin." );
			} else {
				WP_CLI::log( "Ran uninstall procedure for '$plugin->name' plugin without deleting." );
			}
			$successes++;
		}
		if ( ! $this->chained_command ) {
			Utils\report_batch_operation_results( 'plugin', 'uninstall', count( $args ), $successes, $errors );
		}
	}
public function uninstall( $args, $assoc_args = array() ) {

		$all = Utils\get_flag_value( $assoc_args, 'all', false );

		// Check if plugin names of --all is passed.
		$args = $this->check_optional_args_and_all( $args, $all, 'uninstall' );
		if ( ! $args ) {
			return;
		}

		$successes = 0;
		$errors    = 0;
		$plugins   = $this->fetcher->get_many( $args );
		if ( count( $plugins ) < count( $args ) ) {
			$errors = count( $args ) - count( $plugins );
		}

		foreach ( $plugins as $plugin ) {
			if ( is_plugin_active( $plugin->file ) && ! WP_CLI\Utils\get_flag_value( $assoc_args, 'deactivate' ) ) {
				WP_CLI::warning( "The '{$plugin->name}' plugin is active." );
				$errors++;
				continue;
			}

			if ( Utils\get_flag_value( $assoc_args, 'deactivate' ) ) {
				WP_CLI::log( "Deactivating '{$plugin->name}'..." );
				$this->chained_command = true;
				$this->deactivate( array( $plugin->name ) );
				$this->chained_command = false;
			}

			uninstall_plugin( $plugin->file );

			if ( ! Utils\get_flag_value( $assoc_args, 'skip-delete' ) && $this->delete_plugin( $plugin ) ) {
				WP_CLI::log( "Uninstalled and deleted '$plugin->name' plugin." );
			} else {
				WP_CLI::log( "Ran uninstall procedure for '$plugin->name' plugin without deleting." );
			}
			$successes++;
		}
		if ( ! $this->chained_command ) {
			Utils\report_batch_operation_results( 'plugin', 'uninstall', count( $args ), $successes, $errors );
		}
	}
public function uninstall ( $ args , $ assoc_args = array ( ) ) { $ all = Utils \ get_flag_value ( $ assoc_args , 'all' , false ) ; // Check if plugin names of --all is passed. $ args = $ this -> check_optional_args_and_all ( $ args , $ all , 'uninstall' ) ; if ( ! $ args ) { return ; } $ successes = 0 ; $ errors = 0 ; $ plugins = $ this -> fetcher -> get_many ( $ args ) ; if ( count ( $ plugins ) < count ( $ args ) ) { $ errors = count ( $ args ) - count ( $ plugins ) ; } foreach ( $ plugins as $ plugin ) { if ( is_plugin_active ( $ plugin -> file ) && ! WP_CLI \ Utils \ get_flag_value ( $ assoc_args , 'deactivate' ) ) { WP_CLI :: warning ( "The '{$plugin->name}' plugin is active." ) ; $ errors ++ ; continue ; } if ( Utils \ get_flag_value ( $ assoc_args , 'deactivate' ) ) { WP_CLI :: log ( "Deactivating '{$plugin->name}'..." ) ; $ this -> chained_command = true ; $ this -> deactivate ( array ( $ plugin -> name ) ) ; $ this -> chained_command = false ; } uninstall_plugin ( $ plugin -> file ) ; if ( ! Utils \ get_flag_value ( $ assoc_args , 'skip-delete' ) && $ this -> delete_plugin ( $ plugin ) ) { WP_CLI :: log ( "Uninstalled and deleted '$plugin->name' plugin." ) ; } else { WP_CLI :: log ( "Ran uninstall procedure for '$plugin->name' plugin without deleting." ) ; } $ successes ++ ; } if ( ! $ this -> chained_command ) { Utils \ report_batch_operation_results ( 'plugin' , 'uninstall' , count ( $ args ) , $ successes , $ errors ) ; } }
Uninstalls one or more plugins.

## OPTIONS

[<plugin>...]
: One or more plugins to uninstall.

[--deactivate]
: Deactivate the plugin before uninstalling. Default behavior is to warn and skip if the plugin is active.

[--skip-delete]
: If set, the plugin files will not be deleted. Only the uninstall procedure
will be run.

[--all]
: If set, all plugins will be uninstalled.

## EXAMPLES

$ wp plugin uninstall hello
Uninstalled and deleted 'hello' plugin.
Success: Uninstalled 1 of 1 plugins.
Uninstalls one or more plugins .