private function upload_and_install_pro() {
$result = [];
$error_message = __( 'There was a problem uploading your file', 'elementor' );
if ( empty( $_FILES['fileToUpload'] ) ) {
$result = [
'status' => 'error',
'payload' => [
'error_message' => $error_message,
],
];
return $result;
}
if ( ! class_exists( 'Automatic_Upgrader_Skin' ) ) {
[B] require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';[/B]
}
$skin = new Automatic_Upgrader_Skin();
$upgrader = new Plugin_Upgrader( $skin );
$upload_result = $upgrader->install( $_FILES['fileToUpload']['tmp_name'], [ 'overwrite_package' => false ] );