Changeset 60997
- Timestamp:
- 10/20/2025 11:35:29 PM (3 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-plugin-upgrader.php
r59159 r60997 207 207 208 208 // Get the URL to the zip file. 209 $ r= $current->response[ $plugin ];209 $upgrade_data = $current->response[ $plugin ]; 210 210 211 211 add_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ), 10, 2 ); … … 224 224 $this->run( 225 225 array( 226 'package' => $ r->package,226 'package' => $upgrade_data->package, 227 227 'destination' => WP_PLUGIN_DIR, 228 228 'clear_destination' => true, … … 302 302 303 303 // Connect to the filesystem first. 304 $ res= $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) );305 if ( ! $ res) {304 $connected = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) ); 305 if ( ! $connected ) { 306 306 $this->skin->footer(); 307 307 return false; … … 342 342 343 343 // Get the URL to the zip file. 344 $ r= $current->response[ $plugin ];344 $upgrade_data = $current->response[ $plugin ]; 345 345 346 346 $this->skin->plugin_active = is_plugin_active( $plugin ); 347 347 348 if ( isset( $ r->requires ) && ! is_wp_version_compatible( $r->requires ) ) {348 if ( isset( $upgrade_data->requires ) && ! is_wp_version_compatible( $upgrade_data->requires ) ) { 349 349 $result = new WP_Error( 350 350 'incompatible_wp_required_version', … … 353 353 __( 'Your WordPress version is %1$s, however the new plugin version requires %2$s.' ), 354 354 $wp_version, 355 $ r->requires355 $upgrade_data->requires 356 356 ) 357 357 ); … … 360 360 $this->skin->error( $result ); 361 361 $this->skin->after(); 362 } elseif ( isset( $ r->requires_php ) && ! is_php_version_compatible( $r->requires_php ) ) {362 } elseif ( isset( $upgrade_data->requires_php ) && ! is_php_version_compatible( $upgrade_data->requires_php ) ) { 363 363 $result = new WP_Error( 364 364 'incompatible_php_required_version', … … 367 367 __( 'The PHP version on your server is %1$s, however the new plugin version requires %2$s.' ), 368 368 PHP_VERSION, 369 $ r->requires_php369 $upgrade_data->requires_php 370 370 ) 371 371 ); … … 378 378 $result = $this->run( 379 379 array( 380 'package' => $ r->package,380 'package' => $upgrade_data->package, 381 381 'destination' => WP_PLUGIN_DIR, 382 382 'clear_destination' => true, … … 479 479 if ( $files ) { 480 480 foreach ( $files as $file ) { 481 $ info= get_plugin_data( $file, false, false );482 if ( ! empty( $ info['Name'] ) ) {483 $this->new_plugin_data = $ info;481 $new_plugin_data = get_plugin_data( $file, false, false ); 482 if ( ! empty( $new_plugin_data['Name'] ) ) { 483 $this->new_plugin_data = $new_plugin_data; 484 484 break; 485 485 } … … 491 491 } 492 492 493 $requires_php = isset( $ info['RequiresPHP'] ) ? $info['RequiresPHP'] : null;494 $requires_wp = isset( $ info['RequiresWP'] ) ? $info['RequiresWP'] : null;493 $requires_php = isset( $new_plugin_data['RequiresPHP'] ) ? $new_plugin_data['RequiresPHP'] : null; 494 $requires_wp = isset( $new_plugin_data['RequiresWP'] ) ? $new_plugin_data['RequiresWP'] : null; 495 495 496 496 if ( ! is_php_version_compatible( $requires_php ) ) { … … 543 543 544 544 // Assume the requested plugin is the first in the list. 545 $plugin files = array_keys( $plugin );546 547 return $this->result['destination_name'] . '/' . $plugin files[0];545 $plugin_files = array_keys( $plugin ); 546 547 return $this->result['destination_name'] . '/' . $plugin_files[0]; 548 548 } 549 549
Note: See TracChangeset
for help on using the changeset viewer.