735 'wp-includes/blocks/heading/editor-rtl.min.css', |
739 'wp-includes/blocks/heading/editor-rtl.min.css', |
736 'wp-includes/blocks/query-title/editor.css', |
740 'wp-includes/blocks/query-title/editor.css', |
737 'wp-includes/blocks/query-title/editor.min.css', |
741 'wp-includes/blocks/query-title/editor.min.css', |
738 'wp-includes/blocks/query-title/editor-rtl.css', |
742 'wp-includes/blocks/query-title/editor-rtl.css', |
739 'wp-includes/blocks/query-title/editor-rtl.min.css', |
743 'wp-includes/blocks/query-title/editor-rtl.min.css', |
740 'wp-includes/blocks/tag-cloud/editor.css', |
744 /* |
741 'wp-includes/blocks/tag-cloud/editor.min.css', |
745 * Restored in WordPress 6.7 |
742 'wp-includes/blocks/tag-cloud/editor-rtl.css', |
746 * |
743 'wp-includes/blocks/tag-cloud/editor-rtl.min.css', |
747 * 'wp-includes/blocks/tag-cloud/editor.css', |
|
748 * 'wp-includes/blocks/tag-cloud/editor.min.css', |
|
749 * 'wp-includes/blocks/tag-cloud/editor-rtl.css', |
|
750 * 'wp-includes/blocks/tag-cloud/editor-rtl.min.css', |
|
751 */ |
744 // 6.1 |
752 // 6.1 |
745 'wp-includes/blocks/post-comments.php', |
753 'wp-includes/blocks/post-comments.php', |
746 'wp-includes/blocks/post-comments', |
754 'wp-includes/blocks/post-comments', |
747 'wp-includes/blocks/comments-query-loop', |
755 'wp-includes/blocks/comments-query-loop', |
748 // 6.3 |
756 // 6.3 |
768 // 6.6 |
776 // 6.6 |
769 'wp-includes/blocks/block/editor.css', |
777 'wp-includes/blocks/block/editor.css', |
770 'wp-includes/blocks/block/editor.min.css', |
778 'wp-includes/blocks/block/editor.min.css', |
771 'wp-includes/blocks/block/editor-rtl.css', |
779 'wp-includes/blocks/block/editor-rtl.css', |
772 'wp-includes/blocks/block/editor-rtl.min.css', |
780 'wp-includes/blocks/block/editor-rtl.min.css', |
|
781 /* |
|
782 * 6.7 |
|
783 * |
|
784 * WordPress 6.7 included a SimplePie upgrade that included a major |
|
785 * refactoring of the file structure and library. The old files are |
|
786 * split in to two sections to account for this: files and directories. |
|
787 * |
|
788 * See https://core.trac.wordpress.org/changeset/59141 |
|
789 */ |
|
790 // 6.7 - files |
|
791 'wp-includes/js/dist/interactivity-router.asset.php', |
|
792 'wp-includes/js/dist/interactivity-router.js', |
|
793 'wp-includes/js/dist/interactivity-router.min.js', |
|
794 'wp-includes/js/dist/interactivity-router.min.asset.php', |
|
795 'wp-includes/js/dist/interactivity.js', |
|
796 'wp-includes/js/dist/interactivity.min.js', |
|
797 'wp-includes/js/dist/vendor/react-dom.min.js.LICENSE.txt', |
|
798 'wp-includes/js/dist/vendor/react.min.js.LICENSE.txt', |
|
799 'wp-includes/js/dist/vendor/wp-polyfill-importmap.js', |
|
800 'wp-includes/js/dist/vendor/wp-polyfill-importmap.min.js', |
|
801 'wp-includes/sodium_compat/src/Core/Base64/Common.php', |
|
802 'wp-includes/SimplePie/Author.php', |
|
803 'wp-includes/SimplePie/Cache.php', |
|
804 'wp-includes/SimplePie/Caption.php', |
|
805 'wp-includes/SimplePie/Category.php', |
|
806 'wp-includes/SimplePie/Copyright.php', |
|
807 'wp-includes/SimplePie/Core.php', |
|
808 'wp-includes/SimplePie/Credit.php', |
|
809 'wp-includes/SimplePie/Enclosure.php', |
|
810 'wp-includes/SimplePie/Exception.php', |
|
811 'wp-includes/SimplePie/File.php', |
|
812 'wp-includes/SimplePie/gzdecode.php', |
|
813 'wp-includes/SimplePie/IRI.php', |
|
814 'wp-includes/SimplePie/Item.php', |
|
815 'wp-includes/SimplePie/Locator.php', |
|
816 'wp-includes/SimplePie/Misc.php', |
|
817 'wp-includes/SimplePie/Parser.php', |
|
818 'wp-includes/SimplePie/Rating.php', |
|
819 'wp-includes/SimplePie/Registry.php', |
|
820 'wp-includes/SimplePie/Restriction.php', |
|
821 'wp-includes/SimplePie/Sanitize.php', |
|
822 'wp-includes/SimplePie/Source.php', |
|
823 // 6.7 - directories |
|
824 'wp-includes/SimplePie/Cache/', |
|
825 'wp-includes/SimplePie/Content/', |
|
826 'wp-includes/SimplePie/Decode/', |
|
827 'wp-includes/SimplePie/HTTP/', |
|
828 'wp-includes/SimplePie/Net/', |
|
829 'wp-includes/SimplePie/Parse/', |
|
830 'wp-includes/SimplePie/XML/', |
|
831 // 6.8 |
|
832 'wp-includes/blocks/post-content/editor.css', |
|
833 'wp-includes/blocks/post-content/editor.min.css', |
|
834 'wp-includes/blocks/post-content/editor-rtl.css', |
|
835 'wp-includes/blocks/post-content/editor-rtl.min.css', |
|
836 'wp-includes/blocks/post-template/editor.css', |
|
837 'wp-includes/blocks/post-template/editor.min.css', |
|
838 'wp-includes/blocks/post-template/editor-rtl.css', |
|
839 'wp-includes/blocks/post-template/editor-rtl.min.css', |
|
840 'wp-includes/js/dist/undo-manager.js', |
|
841 'wp-includes/js/dist/undo-manager.min.js', |
|
842 'wp-includes/js/dist/fields.min.js', |
|
843 'wp-includes/js/dist/fields.js', |
773 ); |
844 ); |
774 |
845 |
775 /** |
846 /** |
776 * Stores Requests files to be preloaded and deleted. |
847 * Stores Requests files to be preloaded and deleted. |
777 * |
848 * |
916 * The files in the `$_new_bundled_files` list will be added to the installation |
988 * The files in the `$_new_bundled_files` list will be added to the installation |
917 * if the version is greater than or equal to the old version being upgraded. |
989 * if the version is greater than or equal to the old version being upgraded. |
918 * |
990 * |
919 * The steps for the upgrader for after the new release is downloaded and |
991 * The steps for the upgrader for after the new release is downloaded and |
920 * unzipped is: |
992 * unzipped is: |
|
993 * |
921 * 1. Test unzipped location for select files to ensure that unzipped worked. |
994 * 1. Test unzipped location for select files to ensure that unzipped worked. |
922 * 2. Create the .maintenance file in current WordPress base. |
995 * 2. Create the .maintenance file in current WordPress base. |
923 * 3. Copy new WordPress directory over old WordPress files. |
996 * 3. Copy new WordPress directory over old WordPress files. |
924 * 4. Upgrade WordPress to new version. |
997 * 4. Upgrade WordPress to new version. |
925 * 4.1. Copy all files/folders other than wp-content |
998 * 1. Copy all files/folders other than wp-content |
926 * 4.2. Copy any language files to WP_LANG_DIR (which may differ from WP_CONTENT_DIR |
999 * 2. Copy any language files to `WP_LANG_DIR` (which may differ from `WP_CONTENT_DIR` |
927 * 4.3. Copy any new bundled themes/plugins to their respective locations |
1000 * 3. Copy any new bundled themes/plugins to their respective locations |
928 * 5. Delete new WordPress directory path. |
1001 * 5. Delete new WordPress directory path. |
929 * 6. Delete .maintenance file. |
1002 * 6. Delete .maintenance file. |
930 * 7. Remove old files. |
1003 * 7. Remove old files. |
931 * 8. Delete 'update_core' option. |
1004 * 8. Delete 'update_core' option. |
932 * |
1005 * |
944 * your changes remain. |
1017 * your changes remain. |
945 * |
1018 * |
946 * @since 2.7.0 |
1019 * @since 2.7.0 |
947 * |
1020 * |
948 * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. |
1021 * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. |
949 * @global array $_old_files |
1022 * @global string[] $_old_files |
950 * @global array $_old_requests_files |
1023 * @global string[] $_old_requests_files |
951 * @global array $_new_bundled_files |
1024 * @global string[] $_new_bundled_files |
952 * @global wpdb $wpdb WordPress database abstraction object. |
1025 * @global wpdb $wpdb WordPress database abstraction object. |
953 * @global string $wp_version |
|
954 * @global string $required_php_version |
|
955 * @global string $required_mysql_version |
|
956 * |
1026 * |
957 * @param string $from New release unzipped path. |
1027 * @param string $from New release unzipped path. |
958 * @param string $to Path to old WordPress installation. |
1028 * @param string $to Path to old WordPress installation. |
959 * @return string|WP_Error New WordPress version on success, WP_Error on failure. |
1029 * @return string|WP_Error New WordPress version on success, WP_Error on failure. |
960 */ |
1030 */ |
961 function update_core( $from, $to ) { |
1031 function update_core( $from, $to ) { |
962 global $wp_filesystem, $_old_files, $_old_requests_files, $_new_bundled_files, $wpdb; |
1032 global $wp_filesystem, $_old_files, $_old_requests_files, $_new_bundled_files, $wpdb; |
963 |
1033 |
|
1034 /* |
|
1035 * Give core update script an additional 300 seconds (5 minutes) |
|
1036 * to finish updating large files when running on slower servers. |
|
1037 */ |
964 if ( function_exists( 'set_time_limit' ) ) { |
1038 if ( function_exists( 'set_time_limit' ) ) { |
965 set_time_limit( 300 ); |
1039 set_time_limit( 300 ); |
966 } |
1040 } |
967 |
1041 |
968 /* |
1042 /* |
1116 $mysql_version |
1190 $mysql_version |
1117 ) |
1191 ) |
1118 ); |
1192 ); |
1119 } |
1193 } |
1120 |
1194 |
1121 // Add a warning when the JSON PHP extension is missing. |
1195 if ( isset( $required_php_extensions ) && is_array( $required_php_extensions ) ) { |
1122 if ( ! extension_loaded( 'json' ) ) { |
1196 $missing_extensions = new WP_Error(); |
1123 return new WP_Error( |
1197 |
1124 'php_not_compatible_json', |
1198 foreach ( $required_php_extensions as $extension ) { |
1125 sprintf( |
1199 if ( extension_loaded( $extension ) ) { |
1126 /* translators: 1: WordPress version number, 2: The PHP extension name needed. */ |
1200 continue; |
1127 __( 'The update cannot be installed because WordPress %1$s requires the %2$s PHP extension.' ), |
1201 } |
1128 $wp_version, |
1202 |
1129 'JSON' |
1203 $missing_extensions->add( |
1130 ) |
1204 "php_not_compatible_{$extension}", |
1131 ); |
1205 sprintf( |
|
1206 /* translators: 1: WordPress version number, 2: The PHP extension name needed. */ |
|
1207 __( 'The update cannot be installed because WordPress %1$s requires the %2$s PHP extension.' ), |
|
1208 $wp_version, |
|
1209 $extension |
|
1210 ) |
|
1211 ); |
|
1212 } |
|
1213 |
|
1214 // Add a warning when required PHP extensions are missing. |
|
1215 if ( ! empty( $missing_extensions->errors ) ) { |
|
1216 return $missing_extensions; |
|
1217 } |
1132 } |
1218 } |
1133 |
1219 |
1134 /** This filter is documented in wp-admin/includes/update-core.php */ |
1220 /** This filter is documented in wp-admin/includes/update-core.php */ |
1135 apply_filters( 'update_feedback', __( 'Preparing to install the latest version…' ) ); |
1221 apply_filters( 'update_feedback', __( 'Preparing to install the latest version…' ) ); |
1136 |
1222 |
1761 $deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg ); |
1847 $deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg ); |
1762 update_site_option( 'wp_force_deactivated_plugins', $deactivated_plugins ); |
1848 update_site_option( 'wp_force_deactivated_plugins', $deactivated_plugins ); |
1763 } else { |
1849 } else { |
1764 $deactivated_plugins = get_option( 'wp_force_deactivated_plugins', array() ); |
1850 $deactivated_plugins = get_option( 'wp_force_deactivated_plugins', array() ); |
1765 $deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg ); |
1851 $deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg ); |
1766 update_option( 'wp_force_deactivated_plugins', $deactivated_plugins ); |
1852 update_option( 'wp_force_deactivated_plugins', $deactivated_plugins, false ); |
1767 } |
1853 } |
1768 deactivate_plugins( array( 'gutenberg/gutenberg.php' ), true ); |
1854 deactivate_plugins( array( 'gutenberg/gutenberg.php' ), true ); |
1769 } |
1855 } |
1770 } |
1856 } |