Changeset 58128
- Timestamp:
- 05/10/2024 11:46:51 AM (3 months ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-automatic-updater.php
r56549 r58128 447 447 } 448 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 449 472 // Boom, this site's about to get a whole new splash of paint! 450 473 $upgrade_result = $upgrader->upgrade( … … 461 484 ); 462 485 486 487 488 489 490 491 492 493 494 495 496 463 497 // If the filesystem is unavailable, false is returned. 464 498 if ( false === $upgrade_result ) { … … 487 521 } 488 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 489 609 $this->update_results[ $type ][] = (object) array( 490 610 'item' => $item, … … 515 635 } 516 636 637 638 517 639 // Don't automatically run these things, as we'll handle it ourselves. 518 640 remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 ); … … 525 647 $plugin_updates = get_site_transient( 'update_plugins' ); 526 648 if ( $plugin_updates && ! empty( $plugin_updates->response ) ) { 649 650 527 651 foreach ( $plugin_updates->response as $plugin ) { 528 652 $this->update( 'plugin', $plugin ); 529 653 } 654 530 655 // Force refresh of plugin update information. 531 656 wp_clean_plugins_cache(); 657 658 532 659 } 533 660 … … 536 663 $theme_updates = get_site_transient( 'update_themes' ); 537 664 if ( $theme_updates && ! empty( $theme_updates->response ) ) { 665 666 538 667 foreach ( $theme_updates->response as $theme ) { 539 668 $this->update( 'theme', (object) $theme ); … … 541 670 // Force refresh of theme update information. 542 671 wp_clean_themes_cache(); 543 } 672 673 error_log( ' Automatic theme updates complete.' ); 674 } 675 676 error_log( 'Automatic updates complete.' ); 544 677 545 678 // Next, process any core update. … … 1164 1297 // List failed plugin updates. 1165 1298 if ( ! empty( $failed_updates['plugin'] ) ) { 1166 $body[] = __( 'The se plugins failed to update:' );1299 $body[] = __( 'The' ); 1167 1300 1168 1301 foreach ( $failed_updates['plugin'] as $item ) { … … 1552 1685 wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] ); 1553 1686 } 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1554 1767 } -
trunk/src/wp-admin/includes/class-wp-upgrader.php
r58105 r58128 902 902 903 903 if ( is_wp_error( $result ) ) { 904 904 905 if ( ! empty( $options['hook_extra']['temp_backup'] ) ) { 905 906 $this->temp_restores[] = $options['hook_extra']['temp_backup']; … … 910 911 * so in case the failure was due to a PHP timeout, 911 912 * it will still be able to properly restore the previous version. 913 914 915 916 912 917 */ 913 add_action( 'shutdown', array( $this, 'restore_temp_backup' ) );918 add_action( 'shutdown', array( $this, 'restore_temp_backup' ) ); 914 919 } 915 920 $this->skin->error( $result ); … … 984 989 public function maintenance_mode( $enable = false ) { 985 990 global $wp_filesystem; 991 992 993 994 995 996 986 997 $file = $wp_filesystem->abspath() . '.maintenance'; 987 998 if ( $enable ) { 988 $this->skin->feedback( 'maintenance_start' ); 999 if ( ! wp_doing_cron() ) { 1000 $this->skin->feedback( 'maintenance_start' ); 1001 } 989 1002 // Create maintenance file to signal that we are upgrading. 990 1003 $maintenance_string = '<?php $upgrading = ' . time() . '; ?>'; … … 992 1005 $wp_filesystem->put_contents( $file, $maintenance_string, FS_CHMOD_FILE ); 993 1006 } elseif ( ! $enable && $wp_filesystem->exists( $file ) ) { 994 $this->skin->feedback( 'maintenance_end' ); 1007 if ( ! wp_doing_cron() ) { 1008 $this->skin->feedback( 'maintenance_end' ); 1009 } 995 1010 $wp_filesystem->delete( $file ); 996 1011 } … … 1134 1149 * 1135 1150 * @since 6.3.0 1151 1136 1152 * 1137 1153 * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. 1138 1154 * 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1139 1166 * @return bool|WP_Error True on success, false on early exit, otherwise WP_Error. 1140 1167 */ 1141 public function restore_temp_backup( ) {1168 public function restore_temp_backup() { 1142 1169 global $wp_filesystem; 1143 1170 1144 1171 $errors = new WP_Error(); 1145 1172 1146 foreach ( $this->temp_restores as $args ) { 1173 if ( empty( $temp_backups ) ) { 1174 $temp_backups = $this->temp_restores; 1175 } 1176 1177 foreach ( $temp_backups as $args ) { 1147 1178 if ( empty( $args['slug'] ) || empty( $args['src'] ) || empty( $args['dir'] ) ) { 1148 1179 return false; … … 1187 1218 * 1188 1219 * @since 6.3.0 1220 1189 1221 * 1190 1222 * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. 1191 1223 * 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1192 1235 * @return bool|WP_Error True on success, false on early exit, otherwise WP_Error. 1193 1236 */ 1194 public function delete_temp_backup( ) {1237 public function delete_temp_backup() { 1195 1238 global $wp_filesystem; 1196 1239 1197 1240 $errors = new WP_Error(); 1198 1241 1199 foreach ( $this->temp_backups as $args ) { 1242 if ( empty( $temp_backups ) ) { 1243 $temp_backups = $this->temp_backups; 1244 } 1245 1246 foreach ( $temp_backups as $args ) { 1200 1247 if ( empty( $args['slug'] ) || empty( $args['dir'] ) ) { 1201 1248 return false; -
trunk/src/wp-includes/load.php
r57831 r58128 419 419 if ( ( time() - $upgrading ) >= 10 * MINUTE_IN_SECONDS ) { 420 420 return false; 421 422 423 424 425 426 427 428 429 430 421 431 } 422 432
Note: See TracChangeset
for help on using the changeset viewer.