Changeset 56525
- Timestamp:
- 09/06/2023 06:28:59 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-plugin-upgrader.php
r56174 r56525 275 275 * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional. 276 276 * 277 * @global string $wp_version The WordPress version string. 278 * 277 279 * @param string[] $plugins Array of paths to plugin files relative to the plugins directory. 278 280 * @param array $args { … … 284 286 */ 285 287 public function bulk_upgrade( $plugins, $args = array() ) { 288 global $wp_version; 289 286 290 $defaults = array( 287 291 'clear_update_cache' => true, … … 344 348 $this->skin->plugin_active = is_plugin_active( $plugin ); 345 349 346 $result = $this->run( 347 array( 348 'package' => $r->package, 349 'destination' => WP_PLUGIN_DIR, 350 'clear_destination' => true, 351 'clear_working' => true, 352 'is_multi' => true, 353 'hook_extra' => array( 354 'plugin' => $plugin, 355 'temp_backup' => array( 356 'slug' => dirname( $plugin ), 357 'src' => WP_PLUGIN_DIR, 358 'dir' => 'plugins', 350 if ( isset( $r->requires ) && ! is_wp_version_compatible( $r->requires ) ) { 351 $result = new WP_Error( 352 'incompatible_wp_required_version', 353 sprintf( 354 /* translators: 1: Current WordPress version, 2: WordPress version required by the new plugin version. */ 355 __( 'Your WordPress version is %1$s, however the new plugin version requires %2$s.' ), 356 $wp_version, 357 $r->requires 358 ) 359 ); 360 361 $this->skin->before( $result ); 362 $this->skin->error( $result ); 363 $this->skin->after(); 364 } elseif ( isset( $r->requires_php ) && ! is_php_version_compatible( $r->requires_php ) ) { 365 $result = new WP_Error( 366 'incompatible_php_required_version', 367 sprintf( 368 /* translators: 1: Current PHP version, 2: PHP version required by the new plugin version. */ 369 __( 'The PHP version on your server is %1$s, however the new plugin version requires %2$s.' ), 370 PHP_VERSION, 371 $r->requires_php 372 ) 373 ); 374 375 $this->skin->before( $result ); 376 $this->skin->error( $result ); 377 $this->skin->after(); 378 } else { 379 add_filter( 'upgrader_source_selection', array( $this, 'check_package' ) ); 380 $result = $this->run( 381 array( 382 'package' => $r->package, 383 'destination' => WP_PLUGIN_DIR, 384 'clear_destination' => true, 385 'clear_working' => true, 386 'is_multi' => true, 387 'hook_extra' => array( 388 'plugin' => $plugin, 389 'temp_backup' => array( 390 'slug' => dirname( $plugin ), 391 'src' => WP_PLUGIN_DIR, 392 'dir' => 'plugins', 393 ), 359 394 ), 360 ), 361 ) 362 ); 395 ) 396 ); 397 remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) ); 398 } 363 399 364 400 $results[ $plugin ] = $result;
Note: See TracChangeset
for help on using the changeset viewer.