require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
$slug =
$request['slug'
];
// Verify filesystem is accessible first.
$filesystem_available =
$this->
is_filesystem_available();
if ( is_wp_error( $filesystem_available ) ) { return $filesystem_available;
} $api =
plugins_api( 'plugin_information',
array
( 'slug' =>
$slug,
'fields' => array
( 'sections' => false,
'language_packs' => true,
),
) );
if ( is_wp_error( $api ) ) {