Index: src/wp-admin/includes/plugin.php
===================================================================
--- src/wp-admin/includes/plugin.php	(revision 48315)
+++ src/wp-admin/includes/plugin.php	(working copy)
@@ -658,13 +658,7 @@
 		}
 
 		ob_start();
-		wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
-		$_wp_plugin_file = $plugin;
-		if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
-			define( 'WP_SANDBOX_SCRAPING', true );
-		}
-		include_once WP_PLUGIN_DIR . '/' . $plugin;
-		$plugin = $_wp_plugin_file; // Avoid stomping of the $plugin variable in a plugin.
+		plugin_sandbox_scrape( $plugin );
 
 		if ( ! $silent ) {
 			/**
@@ -2287,6 +2281,7 @@
 	if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
 		define( 'WP_SANDBOX_SCRAPING', true );
 	}
+
 	wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
 	include WP_PLUGIN_DIR . '/' . $plugin;
 }
