Index: src/wp-admin/includes/plugin.php
===================================================================
--- src/wp-admin/includes/plugin.php	(revision 52971)
+++ src/wp-admin/includes/plugin.php	(working copy)
@@ -1247,8 +1247,7 @@
 		update_option( 'uninstall_plugins', $uninstallable_plugins );
 		unset( $uninstallable_plugins );
 
-		wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $file );
-		include_once WP_PLUGIN_DIR . '/' . $file;
+		wp_load_plugin_file( WP_PLUGIN_DIR . '/' . $file );
 
 		add_action( "uninstall_{$file}", $callable );
 
@@ -2299,8 +2298,7 @@
 		define( 'WP_SANDBOX_SCRAPING', true );
 	}
 
-	wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
-	include_once WP_PLUGIN_DIR . '/' . $plugin;
+	wp_load_plugin_file( WP_PLUGIN_DIR . '/' . $plugin );
 }
 
 /**
Index: src/wp-admin/update.php
===================================================================
--- src/wp-admin/update.php	(revision 52971)
+++ src/wp-admin/update.php	(working copy)
@@ -97,8 +97,8 @@
 
 			error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
 			ini_set( 'display_errors', true ); // Ensure that fatal errors are displayed.
-			wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
-			include WP_PLUGIN_DIR . '/' . $plugin;
+
+			wp_load_plugin_file( WP_PLUGIN_DIR . '/' . $plugin );
 		}
 		iframe_footer();
 	} elseif ( 'install-plugin' === $action ) {
Index: src/wp-includes/plugin.php
===================================================================
--- src/wp-includes/plugin.php	(revision 52971)
+++ src/wp-includes/plugin.php	(working copy)
@@ -772,6 +772,18 @@
 }
 
 /**
+ * Loads a plugin's file.
+ *
+ * @since 6.0.0
+ *
+ * @param string $file Path to the plugin file.
+ */
+function wp_load_plugin_file( $file ) {
+	wp_register_plugin_realpath( $file );
+	include_once $file;
+}
+
+/**
  * Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in.
  *
  * @since 2.8.0
Index: src/wp-settings.php
===================================================================
--- src/wp-settings.php	(revision 52971)
+++ src/wp-settings.php	(working copy)
@@ -362,8 +362,7 @@
 // Load network activated plugins.
 if ( is_multisite() ) {
 	foreach ( wp_get_active_network_plugins() as $network_plugin ) {
-		wp_register_plugin_realpath( $network_plugin );
-		include_once $network_plugin;
+		wp_load_plugin_file( $network_plugin );
 
 		/**
 		 * Fires once a single network-activated plugin has loaded.
@@ -414,8 +413,7 @@
 
 // Load active plugins.
 foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
-	wp_register_plugin_realpath( $plugin );
-	include_once $plugin;
+	wp_load_plugin_file( $plugin );
 
 	/**
 	 * Fires once a single activated plugin has loaded.
