WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\Notes

InstallJPAndWCSPlugins::install_and_activate_plugin() private WC 1.0

Installs and activates the specified plugin.

{} It's a method of the class: InstallJPAndWCSPlugins{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->install_and_activate_plugin( $plugin );
$plugin(string) (required)
The plugin slug.

Code of InstallJPAndWCSPlugins::install_and_activate_plugin() WC 5.3.0

<?php
private function install_and_activate_plugin( $plugin ) {
	$install_request = array( 'plugin' => $plugin );
	$installer       = new \Automattic\WooCommerce\Admin\API\OnboardingPlugins();
	$result          = $installer->install_plugin( $install_request );

	// @todo Use the error statuses to decide whether or not to action the note.
	if ( is_wp_error( $result ) ) {
		return;
	}

	$activate_request = array( 'plugins' => $plugin );

	$installer->activate_plugins( $activate_request );
}