Changeset 47122 for trunk/src/wp-admin/includes/class-core-upgrader.php
- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-core-upgrader.php
r47099 r47122 116 116 } 117 117 118 // Lock to prevent multiple Core Updates occurring 118 // Lock to prevent multiple Core Updates occurring. 119 119 $lock = WP_Upgrader::create_lock( 'core_updater', 15 * MINUTE_IN_SECONDS ); 120 120 if ( ! $lock ) { … … 221 221 ); 222 222 223 // Clear the current updates 223 // Clear the current updates. 224 224 delete_site_transient( 'update_core' ); 225 225 … … 273 273 include( ABSPATH . WPINC . '/version.php' ); // $wp_version; // x.y.z 274 274 275 $current_branch = implode( '.', array_slice( preg_split( '/[.-]/', $wp_version ), 0, 2 ) ); // x.y 276 $new_branch = implode( '.', array_slice( preg_split( '/[.-]/', $offered_ver ), 0, 2 ) ); // x.y 275 $current_branch = implode( '.', array_slice( preg_split( '/[.-]/', $wp_version ), 0, 2 ) ); // x.y 276 $new_branch = implode( '.', array_slice( preg_split( '/[.-]/', $offered_ver ), 0, 2 ) ); // x.y 277 277 278 $current_is_development_version = (bool) strpos( $wp_version, '-' ); 278 279 … … 285 286 if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) { 286 287 if ( false === WP_AUTO_UPDATE_CORE ) { 287 // Defaults to turned off, unless a filter allows it 288 // Defaults to turned off, unless a filter allows it. 288 289 $upgrade_dev = false; 289 290 $upgrade_minor = false; 290 291 $upgrade_major = false; 291 292 } elseif ( true === WP_AUTO_UPDATE_CORE ) { 292 // ALL updates for core 293 // ALL updates for core. 293 294 $upgrade_dev = true; 294 295 $upgrade_minor = true; 295 296 $upgrade_major = true; 296 297 } elseif ( 'minor' === WP_AUTO_UPDATE_CORE ) { 297 // Only minor updates for core 298 // Only minor updates for core. 298 299 $upgrade_dev = false; 299 300 $upgrade_minor = true; … … 307 308 } 308 309 309 // 2: If we're running a newer version, that's a nope 310 // 2: If we're running a newer version, that's a nope. 310 311 if ( version_compare( $wp_version, $offered_ver, '>' ) ) { 311 312 return false; … … 324 325 } 325 326 326 // Cannot update if we're retrying the same A to B update that caused a non-critical failure. 327 // Some non-critical failures do allow retries, like download_failed. 328 // 3.7.1 => 3.7.2 resulted in files_not_writable, if we are still on 3.7.1 and still trying to update to 3.7.2. 327 /* 328 * Cannot update if we're retrying the same A to B update that caused a non-critical failure. 329 * Some non-critical failures do allow retries, like download_failed. 330 * 3.7.1 => 3.7.2 resulted in files_not_writable, if we are still on 3.7.1 and still trying to update to 3.7.2. 331 */ 329 332 if ( empty( $failure_data['retry'] ) && $wp_version == $failure_data['current'] && $offered_ver == $failure_data['attempted'] ) { 330 333 return false; … … 332 335 } 333 336 334 // 3: 3.7-alpha-25000 -> 3.7-alpha-25678 -> 3.7-beta1 -> 3.7-beta2 337 // 3: 3.7-alpha-25000 -> 3.7-alpha-25678 -> 3.7-beta1 -> 3.7-beta2. 335 338 if ( $current_is_development_version ) { 336 339 … … 349 352 } 350 353 351 // 4: Minor In-branch updates (3.7.0 -> 3.7.1 -> 3.7.2 -> 3.7.4)354 // 4: Minor in-branch updates (3.7.0 -> 3.7.1 -> 3.7.2 -> 3.7.4). 352 355 if ( $current_branch == $new_branch ) { 353 356 … … 362 365 } 363 366 364 // 5: Major version updates (3.7.0 -> 3.8.0 -> 3.9.1) 367 // 5: Major version updates (3.7.0 -> 3.8.0 -> 3.9.1). 365 368 if ( version_compare( $new_branch, $current_branch, '>' ) ) { 366 369 … … 375 378 } 376 379 377 // If we're not sure, we don't want it 380 // If we're not sure, we don't want it. 378 381 return false; 379 382 } … … 399 402 400 403 foreach ( $checksums as $file => $checksum ) { 401 // Skip files which get updated 404 // Skip files which get updated. 402 405 if ( 'wp-content' == substr( $file, 0, 10 ) ) { 403 406 continue;
Note: See TracChangeset
for help on using the changeset viewer.