diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index 9079a5df66..487df7f4f6 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -661,14 +661,8 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen ob_start(); - if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) { - define( 'WP_SANDBOX_SCRAPING', true ); - } - - wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin ); - $_wp_plugin_file = $plugin; - include_once WP_PLUGIN_DIR . '/' . $plugin; - $plugin = $_wp_plugin_file; // Avoid stomping of the $plugin variable in a plugin. + // Load the plugin to test whether it throws any errors. + plugin_sandbox_scrape( $plugin ); if ( ! $silent ) { /** @@ -732,6 +726,7 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen $output = ob_get_clean(); return new WP_Error( 'unexpected_output', __( 'The plugin generated unexpected output.' ), $output ); } + ob_end_clean(); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 4ddd58ec76..d6a6466b9d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-50786'; +$wp_version = '5.8-alpha-50787'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.