wp/wp-admin/includes/class-plugin-upgrader.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
--- a/wp/wp-admin/includes/class-plugin-upgrader.php	Fri Sep 05 18:40:08 2025 +0200
+++ b/wp/wp-admin/includes/class-plugin-upgrader.php	Fri Sep 05 18:52:52 2025 +0200
@@ -274,8 +274,6 @@
 	 * @since 2.8.0
 	 * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional.
 	 *
-	 * @global string $wp_version The WordPress version string.
-	 *
 	 * @param string[] $plugins Array of paths to plugin files relative to the plugins directory.
 	 * @param array    $args {
 	 *     Optional. Other arguments for upgrading several plugins at once.
@@ -285,7 +283,7 @@
 	 * @return array|false An array of results indexed by plugin file, or false if unable to connect to the filesystem.
 	 */
 	public function bulk_upgrade( $plugins, $args = array() ) {
-		global $wp_version;
+		$wp_version = wp_get_wp_version();
 
 		$defaults    = array(
 			'clear_update_cache' => true,
@@ -457,14 +455,14 @@
 	 * @since 3.3.0
 	 *
 	 * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
-	 * @global string             $wp_version    The WordPress version string.
 	 *
 	 * @param string $source The path to the downloaded package source.
 	 * @return string|WP_Error The source as passed, or a WP_Error object on failure.
 	 */
 	public function check_package( $source ) {
-		global $wp_filesystem, $wp_version;
+		global $wp_filesystem;
 
+		$wp_version            = wp_get_wp_version();
 		$this->new_plugin_data = array();
 
 		if ( is_wp_error( $source ) ) {