PageRenderTime 70ms CodeModel.GetById 3ms app.highlight 58ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-admin/includes/update-core.php

http://github.com/markjaquith/WordPress
PHP | 1523 lines | 1146 code | 81 blank | 296 comment | 119 complexity | 8212b176434947565acbb0a7864abf5a MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1<?php
   2/**
   3 * WordPress core upgrade functionality.
   4 *
   5 * @package WordPress
   6 * @subpackage Administration
   7 * @since 2.7.0
   8 */
   9
  10/**
  11 * Stores files to be deleted.
  12 *
  13 * @since 2.7.0
  14 * @global array $_old_files
  15 * @var array
  16 * @name $_old_files
  17 */
  18global $_old_files;
  19
  20$_old_files = array(
  21	// 2.0
  22	'wp-admin/import-b2.php',
  23	'wp-admin/import-blogger.php',
  24	'wp-admin/import-greymatter.php',
  25	'wp-admin/import-livejournal.php',
  26	'wp-admin/import-mt.php',
  27	'wp-admin/import-rss.php',
  28	'wp-admin/import-textpattern.php',
  29	'wp-admin/quicktags.js',
  30	'wp-images/fade-butt.png',
  31	'wp-images/get-firefox.png',
  32	'wp-images/header-shadow.png',
  33	'wp-images/smilies',
  34	'wp-images/wp-small.png',
  35	'wp-images/wpminilogo.png',
  36	'wp.php',
  37	// 2.0.8
  38	'wp-includes/js/tinymce/plugins/inlinepopups/readme.txt',
  39	// 2.1
  40	'wp-admin/edit-form-ajax-cat.php',
  41	'wp-admin/execute-pings.php',
  42	'wp-admin/inline-uploading.php',
  43	'wp-admin/link-categories.php',
  44	'wp-admin/list-manipulation.js',
  45	'wp-admin/list-manipulation.php',
  46	'wp-includes/comment-functions.php',
  47	'wp-includes/feed-functions.php',
  48	'wp-includes/functions-compat.php',
  49	'wp-includes/functions-formatting.php',
  50	'wp-includes/functions-post.php',
  51	'wp-includes/js/dbx-key.js',
  52	'wp-includes/js/tinymce/plugins/autosave/langs/cs.js',
  53	'wp-includes/js/tinymce/plugins/autosave/langs/sv.js',
  54	'wp-includes/links.php',
  55	'wp-includes/pluggable-functions.php',
  56	'wp-includes/template-functions-author.php',
  57	'wp-includes/template-functions-category.php',
  58	'wp-includes/template-functions-general.php',
  59	'wp-includes/template-functions-links.php',
  60	'wp-includes/template-functions-post.php',
  61	'wp-includes/wp-l10n.php',
  62	// 2.2
  63	'wp-admin/cat-js.php',
  64	'wp-admin/import/b2.php',
  65	'wp-includes/js/autosave-js.php',
  66	'wp-includes/js/list-manipulation-js.php',
  67	'wp-includes/js/wp-ajax-js.php',
  68	// 2.3
  69	'wp-admin/admin-db.php',
  70	'wp-admin/cat.js',
  71	'wp-admin/categories.js',
  72	'wp-admin/custom-fields.js',
  73	'wp-admin/dbx-admin-key.js',
  74	'wp-admin/edit-comments.js',
  75	'wp-admin/install-rtl.css',
  76	'wp-admin/install.css',
  77	'wp-admin/upgrade-schema.php',
  78	'wp-admin/upload-functions.php',
  79	'wp-admin/upload-rtl.css',
  80	'wp-admin/upload.css',
  81	'wp-admin/upload.js',
  82	'wp-admin/users.js',
  83	'wp-admin/widgets-rtl.css',
  84	'wp-admin/widgets.css',
  85	'wp-admin/xfn.js',
  86	'wp-includes/js/tinymce/license.html',
  87	// 2.5
  88	'wp-admin/css/upload.css',
  89	'wp-admin/images/box-bg-left.gif',
  90	'wp-admin/images/box-bg-right.gif',
  91	'wp-admin/images/box-bg.gif',
  92	'wp-admin/images/box-butt-left.gif',
  93	'wp-admin/images/box-butt-right.gif',
  94	'wp-admin/images/box-butt.gif',
  95	'wp-admin/images/box-head-left.gif',
  96	'wp-admin/images/box-head-right.gif',
  97	'wp-admin/images/box-head.gif',
  98	'wp-admin/images/heading-bg.gif',
  99	'wp-admin/images/login-bkg-bottom.gif',
 100	'wp-admin/images/login-bkg-tile.gif',
 101	'wp-admin/images/notice.gif',
 102	'wp-admin/images/toggle.gif',
 103	'wp-admin/includes/upload.php',
 104	'wp-admin/js/dbx-admin-key.js',
 105	'wp-admin/js/link-cat.js',
 106	'wp-admin/profile-update.php',
 107	'wp-admin/templates.php',
 108	'wp-includes/images/wlw/WpComments.png',
 109	'wp-includes/images/wlw/WpIcon.png',
 110	'wp-includes/images/wlw/WpWatermark.png',
 111	'wp-includes/js/dbx.js',
 112	'wp-includes/js/fat.js',
 113	'wp-includes/js/list-manipulation.js',
 114	'wp-includes/js/tinymce/langs/en.js',
 115	'wp-includes/js/tinymce/plugins/autosave/editor_plugin_src.js',
 116	'wp-includes/js/tinymce/plugins/autosave/langs',
 117	'wp-includes/js/tinymce/plugins/directionality/images',
 118	'wp-includes/js/tinymce/plugins/directionality/langs',
 119	'wp-includes/js/tinymce/plugins/inlinepopups/css',
 120	'wp-includes/js/tinymce/plugins/inlinepopups/images',
 121	'wp-includes/js/tinymce/plugins/inlinepopups/jscripts',
 122	'wp-includes/js/tinymce/plugins/paste/images',
 123	'wp-includes/js/tinymce/plugins/paste/jscripts',
 124	'wp-includes/js/tinymce/plugins/paste/langs',
 125	'wp-includes/js/tinymce/plugins/spellchecker/classes/HttpClient.class.php',
 126	'wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php',
 127	'wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php',
 128	'wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php',
 129	'wp-includes/js/tinymce/plugins/spellchecker/css/spellchecker.css',
 130	'wp-includes/js/tinymce/plugins/spellchecker/images',
 131	'wp-includes/js/tinymce/plugins/spellchecker/langs',
 132	'wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php',
 133	'wp-includes/js/tinymce/plugins/wordpress/images',
 134	'wp-includes/js/tinymce/plugins/wordpress/langs',
 135	'wp-includes/js/tinymce/plugins/wordpress/wordpress.css',
 136	'wp-includes/js/tinymce/plugins/wphelp',
 137	'wp-includes/js/tinymce/themes/advanced/css',
 138	'wp-includes/js/tinymce/themes/advanced/images',
 139	'wp-includes/js/tinymce/themes/advanced/jscripts',
 140	'wp-includes/js/tinymce/themes/advanced/langs',
 141	// 2.5.1
 142	'wp-includes/js/tinymce/tiny_mce_gzip.php',
 143	// 2.6
 144	'wp-admin/bookmarklet.php',
 145	'wp-includes/js/jquery/jquery.dimensions.min.js',
 146	'wp-includes/js/tinymce/plugins/wordpress/popups.css',
 147	'wp-includes/js/wp-ajax.js',
 148	// 2.7
 149	'wp-admin/css/press-this-ie-rtl.css',
 150	'wp-admin/css/press-this-ie.css',
 151	'wp-admin/css/upload-rtl.css',
 152	'wp-admin/edit-form.php',
 153	'wp-admin/images/comment-pill.gif',
 154	'wp-admin/images/comment-stalk-classic.gif',
 155	'wp-admin/images/comment-stalk-fresh.gif',
 156	'wp-admin/images/comment-stalk-rtl.gif',
 157	'wp-admin/images/del.png',
 158	'wp-admin/images/gear.png',
 159	'wp-admin/images/media-button-gallery.gif',
 160	'wp-admin/images/media-buttons.gif',
 161	'wp-admin/images/postbox-bg.gif',
 162	'wp-admin/images/tab.png',
 163	'wp-admin/images/tail.gif',
 164	'wp-admin/js/forms.js',
 165	'wp-admin/js/upload.js',
 166	'wp-admin/link-import.php',
 167	'wp-includes/images/audio.png',
 168	'wp-includes/images/css.png',
 169	'wp-includes/images/default.png',
 170	'wp-includes/images/doc.png',
 171	'wp-includes/images/exe.png',
 172	'wp-includes/images/html.png',
 173	'wp-includes/images/js.png',
 174	'wp-includes/images/pdf.png',
 175	'wp-includes/images/swf.png',
 176	'wp-includes/images/tar.png',
 177	'wp-includes/images/text.png',
 178	'wp-includes/images/video.png',
 179	'wp-includes/images/zip.png',
 180	'wp-includes/js/tinymce/tiny_mce_config.php',
 181	'wp-includes/js/tinymce/tiny_mce_ext.js',
 182	// 2.8
 183	'wp-admin/js/users.js',
 184	'wp-includes/js/swfupload/plugins/swfupload.documentready.js',
 185	'wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js',
 186	'wp-includes/js/swfupload/swfupload_f9.swf',
 187	'wp-includes/js/tinymce/plugins/autosave',
 188	'wp-includes/js/tinymce/plugins/paste/css',
 189	'wp-includes/js/tinymce/utils/mclayer.js',
 190	'wp-includes/js/tinymce/wordpress.css',
 191	// 2.8.5
 192	'wp-admin/import/btt.php',
 193	'wp-admin/import/jkw.php',
 194	// 2.9
 195	'wp-admin/js/page.dev.js',
 196	'wp-admin/js/page.js',
 197	'wp-admin/js/set-post-thumbnail-handler.dev.js',
 198	'wp-admin/js/set-post-thumbnail-handler.js',
 199	'wp-admin/js/slug.dev.js',
 200	'wp-admin/js/slug.js',
 201	'wp-includes/gettext.php',
 202	'wp-includes/js/tinymce/plugins/wordpress/js',
 203	'wp-includes/streams.php',
 204	// MU
 205	'README.txt',
 206	'htaccess.dist',
 207	'index-install.php',
 208	'wp-admin/css/mu-rtl.css',
 209	'wp-admin/css/mu.css',
 210	'wp-admin/images/site-admin.png',
 211	'wp-admin/includes/mu.php',
 212	'wp-admin/wpmu-admin.php',
 213	'wp-admin/wpmu-blogs.php',
 214	'wp-admin/wpmu-edit.php',
 215	'wp-admin/wpmu-options.php',
 216	'wp-admin/wpmu-themes.php',
 217	'wp-admin/wpmu-upgrade-site.php',
 218	'wp-admin/wpmu-users.php',
 219	'wp-includes/images/wordpress-mu.png',
 220	'wp-includes/wpmu-default-filters.php',
 221	'wp-includes/wpmu-functions.php',
 222	'wpmu-settings.php',
 223	// 3.0
 224	'wp-admin/categories.php',
 225	'wp-admin/edit-category-form.php',
 226	'wp-admin/edit-page-form.php',
 227	'wp-admin/edit-pages.php',
 228	'wp-admin/images/admin-header-footer.png',
 229	'wp-admin/images/browse-happy.gif',
 230	'wp-admin/images/ico-add.png',
 231	'wp-admin/images/ico-close.png',
 232	'wp-admin/images/ico-edit.png',
 233	'wp-admin/images/ico-viewpage.png',
 234	'wp-admin/images/fav-top.png',
 235	'wp-admin/images/screen-options-left.gif',
 236	'wp-admin/images/wp-logo-vs.gif',
 237	'wp-admin/images/wp-logo.gif',
 238	'wp-admin/import',
 239	'wp-admin/js/wp-gears.dev.js',
 240	'wp-admin/js/wp-gears.js',
 241	'wp-admin/options-misc.php',
 242	'wp-admin/page-new.php',
 243	'wp-admin/page.php',
 244	'wp-admin/rtl.css',
 245	'wp-admin/rtl.dev.css',
 246	'wp-admin/update-links.php',
 247	'wp-admin/wp-admin.css',
 248	'wp-admin/wp-admin.dev.css',
 249	'wp-includes/js/codepress',
 250	'wp-includes/js/codepress/engines/khtml.js',
 251	'wp-includes/js/codepress/engines/older.js',
 252	'wp-includes/js/jquery/autocomplete.dev.js',
 253	'wp-includes/js/jquery/autocomplete.js',
 254	'wp-includes/js/jquery/interface.js',
 255	'wp-includes/js/scriptaculous/prototype.js',
 256	// Following file added back in 5.1, see #45645.
 257	//'wp-includes/js/tinymce/wp-tinymce.js',
 258	// 3.1
 259	'wp-admin/edit-attachment-rows.php',
 260	'wp-admin/edit-link-categories.php',
 261	'wp-admin/edit-link-category-form.php',
 262	'wp-admin/edit-post-rows.php',
 263	'wp-admin/images/button-grad-active-vs.png',
 264	'wp-admin/images/button-grad-vs.png',
 265	'wp-admin/images/fav-arrow-vs-rtl.gif',
 266	'wp-admin/images/fav-arrow-vs.gif',
 267	'wp-admin/images/fav-top-vs.gif',
 268	'wp-admin/images/list-vs.png',
 269	'wp-admin/images/screen-options-right-up.gif',
 270	'wp-admin/images/screen-options-right.gif',
 271	'wp-admin/images/visit-site-button-grad-vs.gif',
 272	'wp-admin/images/visit-site-button-grad.gif',
 273	'wp-admin/link-category.php',
 274	'wp-admin/sidebar.php',
 275	'wp-includes/classes.php',
 276	'wp-includes/js/tinymce/blank.htm',
 277	'wp-includes/js/tinymce/plugins/media/css/content.css',
 278	'wp-includes/js/tinymce/plugins/media/img',
 279	'wp-includes/js/tinymce/plugins/safari',
 280	// 3.2
 281	'wp-admin/images/logo-login.gif',
 282	'wp-admin/images/star.gif',
 283	'wp-admin/js/list-table.dev.js',
 284	'wp-admin/js/list-table.js',
 285	'wp-includes/default-embeds.php',
 286	'wp-includes/js/tinymce/plugins/wordpress/img/help.gif',
 287	'wp-includes/js/tinymce/plugins/wordpress/img/more.gif',
 288	'wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif',
 289	'wp-includes/js/tinymce/themes/advanced/img/fm.gif',
 290	'wp-includes/js/tinymce/themes/advanced/img/sflogo.png',
 291	// 3.3
 292	'wp-admin/css/colors-classic-rtl.css',
 293	'wp-admin/css/colors-classic-rtl.dev.css',
 294	'wp-admin/css/colors-fresh-rtl.css',
 295	'wp-admin/css/colors-fresh-rtl.dev.css',
 296	'wp-admin/css/dashboard-rtl.dev.css',
 297	'wp-admin/css/dashboard.dev.css',
 298	'wp-admin/css/global-rtl.css',
 299	'wp-admin/css/global-rtl.dev.css',
 300	'wp-admin/css/global.css',
 301	'wp-admin/css/global.dev.css',
 302	'wp-admin/css/install-rtl.dev.css',
 303	'wp-admin/css/login-rtl.dev.css',
 304	'wp-admin/css/login.dev.css',
 305	'wp-admin/css/ms.css',
 306	'wp-admin/css/ms.dev.css',
 307	'wp-admin/css/nav-menu-rtl.css',
 308	'wp-admin/css/nav-menu-rtl.dev.css',
 309	'wp-admin/css/nav-menu.css',
 310	'wp-admin/css/nav-menu.dev.css',
 311	'wp-admin/css/plugin-install-rtl.css',
 312	'wp-admin/css/plugin-install-rtl.dev.css',
 313	'wp-admin/css/plugin-install.css',
 314	'wp-admin/css/plugin-install.dev.css',
 315	'wp-admin/css/press-this-rtl.dev.css',
 316	'wp-admin/css/press-this.dev.css',
 317	'wp-admin/css/theme-editor-rtl.css',
 318	'wp-admin/css/theme-editor-rtl.dev.css',
 319	'wp-admin/css/theme-editor.css',
 320	'wp-admin/css/theme-editor.dev.css',
 321	'wp-admin/css/theme-install-rtl.css',
 322	'wp-admin/css/theme-install-rtl.dev.css',
 323	'wp-admin/css/theme-install.css',
 324	'wp-admin/css/theme-install.dev.css',
 325	'wp-admin/css/widgets-rtl.dev.css',
 326	'wp-admin/css/widgets.dev.css',
 327	'wp-admin/includes/internal-linking.php',
 328	'wp-includes/images/admin-bar-sprite-rtl.png',
 329	'wp-includes/js/jquery/ui.button.js',
 330	'wp-includes/js/jquery/ui.core.js',
 331	'wp-includes/js/jquery/ui.dialog.js',
 332	'wp-includes/js/jquery/ui.draggable.js',
 333	'wp-includes/js/jquery/ui.droppable.js',
 334	'wp-includes/js/jquery/ui.mouse.js',
 335	'wp-includes/js/jquery/ui.position.js',
 336	'wp-includes/js/jquery/ui.resizable.js',
 337	'wp-includes/js/jquery/ui.selectable.js',
 338	'wp-includes/js/jquery/ui.sortable.js',
 339	'wp-includes/js/jquery/ui.tabs.js',
 340	'wp-includes/js/jquery/ui.widget.js',
 341	'wp-includes/js/l10n.dev.js',
 342	'wp-includes/js/l10n.js',
 343	'wp-includes/js/tinymce/plugins/wplink/css',
 344	'wp-includes/js/tinymce/plugins/wplink/img',
 345	'wp-includes/js/tinymce/plugins/wplink/js',
 346	'wp-includes/js/tinymce/themes/advanced/img/wpicons.png',
 347	'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/butt2.png',
 348	'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/button_bg.png',
 349	'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/down_arrow.gif',
 350	'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/fade-butt.png',
 351	'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/separator.gif',
 352	// Don't delete, yet: 'wp-rss.php',
 353	// Don't delete, yet: 'wp-rdf.php',
 354	// Don't delete, yet: 'wp-rss2.php',
 355	// Don't delete, yet: 'wp-commentsrss2.php',
 356	// Don't delete, yet: 'wp-atom.php',
 357	// Don't delete, yet: 'wp-feed.php',
 358	// 3.4
 359	'wp-admin/images/gray-star.png',
 360	'wp-admin/images/logo-login.png',
 361	'wp-admin/images/star.png',
 362	'wp-admin/index-extra.php',
 363	'wp-admin/network/index-extra.php',
 364	'wp-admin/user/index-extra.php',
 365	'wp-admin/images/screenshots/admin-flyouts.png',
 366	'wp-admin/images/screenshots/coediting.png',
 367	'wp-admin/images/screenshots/drag-and-drop.png',
 368	'wp-admin/images/screenshots/help-screen.png',
 369	'wp-admin/images/screenshots/media-icon.png',
 370	'wp-admin/images/screenshots/new-feature-pointer.png',
 371	'wp-admin/images/screenshots/welcome-screen.png',
 372	'wp-includes/css/editor-buttons.css',
 373	'wp-includes/css/editor-buttons.dev.css',
 374	'wp-includes/js/tinymce/plugins/paste/blank.htm',
 375	'wp-includes/js/tinymce/plugins/wordpress/css',
 376	'wp-includes/js/tinymce/plugins/wordpress/editor_plugin.dev.js',
 377	'wp-includes/js/tinymce/plugins/wordpress/img/embedded.png',
 378	'wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif',
 379	'wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif',
 380	'wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.dev.js',
 381	'wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css',
 382	'wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js',
 383	'wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.dev.js',
 384	'wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.dev.js',
 385	'wp-includes/js/tinymce/plugins/wpgallery/img/gallery.png',
 386	'wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js',
 387	// Don't delete, yet: 'wp-pass.php',
 388	// Don't delete, yet: 'wp-register.php',
 389	// 3.5
 390	'wp-admin/gears-manifest.php',
 391	'wp-admin/includes/manifest.php',
 392	'wp-admin/images/archive-link.png',
 393	'wp-admin/images/blue-grad.png',
 394	'wp-admin/images/button-grad-active.png',
 395	'wp-admin/images/button-grad.png',
 396	'wp-admin/images/ed-bg-vs.gif',
 397	'wp-admin/images/ed-bg.gif',
 398	'wp-admin/images/fade-butt.png',
 399	'wp-admin/images/fav-arrow-rtl.gif',
 400	'wp-admin/images/fav-arrow.gif',
 401	'wp-admin/images/fav-vs.png',
 402	'wp-admin/images/fav.png',
 403	'wp-admin/images/gray-grad.png',
 404	'wp-admin/images/loading-publish.gif',
 405	'wp-admin/images/logo-ghost.png',
 406	'wp-admin/images/logo.gif',
 407	'wp-admin/images/menu-arrow-frame-rtl.png',
 408	'wp-admin/images/menu-arrow-frame.png',
 409	'wp-admin/images/menu-arrows.gif',
 410	'wp-admin/images/menu-bits-rtl-vs.gif',
 411	'wp-admin/images/menu-bits-rtl.gif',
 412	'wp-admin/images/menu-bits-vs.gif',
 413	'wp-admin/images/menu-bits.gif',
 414	'wp-admin/images/menu-dark-rtl-vs.gif',
 415	'wp-admin/images/menu-dark-rtl.gif',
 416	'wp-admin/images/menu-dark-vs.gif',
 417	'wp-admin/images/menu-dark.gif',
 418	'wp-admin/images/required.gif',
 419	'wp-admin/images/screen-options-toggle-vs.gif',
 420	'wp-admin/images/screen-options-toggle.gif',
 421	'wp-admin/images/toggle-arrow-rtl.gif',
 422	'wp-admin/images/toggle-arrow.gif',
 423	'wp-admin/images/upload-classic.png',
 424	'wp-admin/images/upload-fresh.png',
 425	'wp-admin/images/white-grad-active.png',
 426	'wp-admin/images/white-grad.png',
 427	'wp-admin/images/widgets-arrow-vs.gif',
 428	'wp-admin/images/widgets-arrow.gif',
 429	'wp-admin/images/wpspin_dark.gif',
 430	'wp-includes/images/upload.png',
 431	'wp-includes/js/prototype.js',
 432	'wp-includes/js/scriptaculous',
 433	'wp-admin/css/wp-admin-rtl.dev.css',
 434	'wp-admin/css/wp-admin.dev.css',
 435	'wp-admin/css/media-rtl.dev.css',
 436	'wp-admin/css/media.dev.css',
 437	'wp-admin/css/colors-classic.dev.css',
 438	'wp-admin/css/customize-controls-rtl.dev.css',
 439	'wp-admin/css/customize-controls.dev.css',
 440	'wp-admin/css/ie-rtl.dev.css',
 441	'wp-admin/css/ie.dev.css',
 442	'wp-admin/css/install.dev.css',
 443	'wp-admin/css/colors-fresh.dev.css',
 444	'wp-includes/js/customize-base.dev.js',
 445	'wp-includes/js/json2.dev.js',
 446	'wp-includes/js/comment-reply.dev.js',
 447	'wp-includes/js/customize-preview.dev.js',
 448	'wp-includes/js/wplink.dev.js',
 449	'wp-includes/js/tw-sack.dev.js',
 450	'wp-includes/js/wp-list-revisions.dev.js',
 451	'wp-includes/js/autosave.dev.js',
 452	'wp-includes/js/admin-bar.dev.js',
 453	'wp-includes/js/quicktags.dev.js',
 454	'wp-includes/js/wp-ajax-response.dev.js',
 455	'wp-includes/js/wp-pointer.dev.js',
 456	'wp-includes/js/hoverIntent.dev.js',
 457	'wp-includes/js/colorpicker.dev.js',
 458	'wp-includes/js/wp-lists.dev.js',
 459	'wp-includes/js/customize-loader.dev.js',
 460	'wp-includes/js/jquery/jquery.table-hotkeys.dev.js',
 461	'wp-includes/js/jquery/jquery.color.dev.js',
 462	'wp-includes/js/jquery/jquery.color.js',
 463	'wp-includes/js/jquery/jquery.hotkeys.dev.js',
 464	'wp-includes/js/jquery/jquery.form.dev.js',
 465	'wp-includes/js/jquery/suggest.dev.js',
 466	'wp-admin/js/xfn.dev.js',
 467	'wp-admin/js/set-post-thumbnail.dev.js',
 468	'wp-admin/js/comment.dev.js',
 469	'wp-admin/js/theme.dev.js',
 470	'wp-admin/js/cat.dev.js',
 471	'wp-admin/js/password-strength-meter.dev.js',
 472	'wp-admin/js/user-profile.dev.js',
 473	'wp-admin/js/theme-preview.dev.js',
 474	'wp-admin/js/post.dev.js',
 475	'wp-admin/js/media-upload.dev.js',
 476	'wp-admin/js/word-count.dev.js',
 477	'wp-admin/js/plugin-install.dev.js',
 478	'wp-admin/js/edit-comments.dev.js',
 479	'wp-admin/js/media-gallery.dev.js',
 480	'wp-admin/js/custom-fields.dev.js',
 481	'wp-admin/js/custom-background.dev.js',
 482	'wp-admin/js/common.dev.js',
 483	'wp-admin/js/inline-edit-tax.dev.js',
 484	'wp-admin/js/gallery.dev.js',
 485	'wp-admin/js/utils.dev.js',
 486	'wp-admin/js/widgets.dev.js',
 487	'wp-admin/js/wp-fullscreen.dev.js',
 488	'wp-admin/js/nav-menu.dev.js',
 489	'wp-admin/js/dashboard.dev.js',
 490	'wp-admin/js/link.dev.js',
 491	'wp-admin/js/user-suggest.dev.js',
 492	'wp-admin/js/postbox.dev.js',
 493	'wp-admin/js/tags.dev.js',
 494	'wp-admin/js/image-edit.dev.js',
 495	'wp-admin/js/media.dev.js',
 496	'wp-admin/js/customize-controls.dev.js',
 497	'wp-admin/js/inline-edit-post.dev.js',
 498	'wp-admin/js/categories.dev.js',
 499	'wp-admin/js/editor.dev.js',
 500	'wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.dev.js',
 501	'wp-includes/js/tinymce/plugins/wpdialogs/js/popup.dev.js',
 502	'wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js',
 503	'wp-includes/js/plupload/handlers.dev.js',
 504	'wp-includes/js/plupload/wp-plupload.dev.js',
 505	'wp-includes/js/swfupload/handlers.dev.js',
 506	'wp-includes/js/jcrop/jquery.Jcrop.dev.js',
 507	'wp-includes/js/jcrop/jquery.Jcrop.js',
 508	'wp-includes/js/jcrop/jquery.Jcrop.css',
 509	'wp-includes/js/imgareaselect/jquery.imgareaselect.dev.js',
 510	'wp-includes/css/wp-pointer.dev.css',
 511	'wp-includes/css/editor.dev.css',
 512	'wp-includes/css/jquery-ui-dialog.dev.css',
 513	'wp-includes/css/admin-bar-rtl.dev.css',
 514	'wp-includes/css/admin-bar.dev.css',
 515	'wp-includes/js/jquery/ui/jquery.effects.clip.min.js',
 516	'wp-includes/js/jquery/ui/jquery.effects.scale.min.js',
 517	'wp-includes/js/jquery/ui/jquery.effects.blind.min.js',
 518	'wp-includes/js/jquery/ui/jquery.effects.core.min.js',
 519	'wp-includes/js/jquery/ui/jquery.effects.shake.min.js',
 520	'wp-includes/js/jquery/ui/jquery.effects.fade.min.js',
 521	'wp-includes/js/jquery/ui/jquery.effects.explode.min.js',
 522	'wp-includes/js/jquery/ui/jquery.effects.slide.min.js',
 523	'wp-includes/js/jquery/ui/jquery.effects.drop.min.js',
 524	'wp-includes/js/jquery/ui/jquery.effects.highlight.min.js',
 525	'wp-includes/js/jquery/ui/jquery.effects.bounce.min.js',
 526	'wp-includes/js/jquery/ui/jquery.effects.pulsate.min.js',
 527	'wp-includes/js/jquery/ui/jquery.effects.transfer.min.js',
 528	'wp-includes/js/jquery/ui/jquery.effects.fold.min.js',
 529	'wp-admin/images/screenshots/captions-1.png',
 530	'wp-admin/images/screenshots/captions-2.png',
 531	'wp-admin/images/screenshots/flex-header-1.png',
 532	'wp-admin/images/screenshots/flex-header-2.png',
 533	'wp-admin/images/screenshots/flex-header-3.png',
 534	'wp-admin/images/screenshots/flex-header-media-library.png',
 535	'wp-admin/images/screenshots/theme-customizer.png',
 536	'wp-admin/images/screenshots/twitter-embed-1.png',
 537	'wp-admin/images/screenshots/twitter-embed-2.png',
 538	'wp-admin/js/utils.js',
 539	// Added back in 5.3 [45448], see #43895.
 540	// 'wp-admin/options-privacy.php',
 541	'wp-app.php',
 542	'wp-includes/class-wp-atom-server.php',
 543	'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css',
 544	// 3.5.2
 545	'wp-includes/js/swfupload/swfupload-all.js',
 546	// 3.6
 547	'wp-admin/js/revisions-js.php',
 548	'wp-admin/images/screenshots',
 549	'wp-admin/js/categories.js',
 550	'wp-admin/js/categories.min.js',
 551	'wp-admin/js/custom-fields.js',
 552	'wp-admin/js/custom-fields.min.js',
 553	// 3.7
 554	'wp-admin/js/cat.js',
 555	'wp-admin/js/cat.min.js',
 556	'wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.min.js',
 557	// 3.8
 558	'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/page_bug.gif',
 559	'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/more_bug.gif',
 560	'wp-includes/js/thickbox/tb-close-2x.png',
 561	'wp-includes/js/thickbox/tb-close.png',
 562	'wp-includes/images/wpmini-blue-2x.png',
 563	'wp-includes/images/wpmini-blue.png',
 564	'wp-admin/css/colors-fresh.css',
 565	'wp-admin/css/colors-classic.css',
 566	'wp-admin/css/colors-fresh.min.css',
 567	'wp-admin/css/colors-classic.min.css',
 568	'wp-admin/js/about.min.js',
 569	'wp-admin/js/about.js',
 570	'wp-admin/images/arrows-dark-vs-2x.png',
 571	'wp-admin/images/wp-logo-vs.png',
 572	'wp-admin/images/arrows-dark-vs.png',
 573	'wp-admin/images/wp-logo.png',
 574	'wp-admin/images/arrows-pr.png',
 575	'wp-admin/images/arrows-dark.png',
 576	'wp-admin/images/press-this.png',
 577	'wp-admin/images/press-this-2x.png',
 578	'wp-admin/images/arrows-vs-2x.png',
 579	'wp-admin/images/welcome-icons.png',
 580	'wp-admin/images/wp-logo-2x.png',
 581	'wp-admin/images/stars-rtl-2x.png',
 582	'wp-admin/images/arrows-dark-2x.png',
 583	'wp-admin/images/arrows-pr-2x.png',
 584	'wp-admin/images/menu-shadow-rtl.png',
 585	'wp-admin/images/arrows-vs.png',
 586	'wp-admin/images/about-search-2x.png',
 587	'wp-admin/images/bubble_bg-rtl-2x.gif',
 588	'wp-admin/images/wp-badge-2x.png',
 589	'wp-admin/images/wordpress-logo-2x.png',
 590	'wp-admin/images/bubble_bg-rtl.gif',
 591	'wp-admin/images/wp-badge.png',
 592	'wp-admin/images/menu-shadow.png',
 593	'wp-admin/images/about-globe-2x.png',
 594	'wp-admin/images/welcome-icons-2x.png',
 595	'wp-admin/images/stars-rtl.png',
 596	'wp-admin/images/wp-logo-vs-2x.png',
 597	'wp-admin/images/about-updates-2x.png',
 598	// 3.9
 599	'wp-admin/css/colors.css',
 600	'wp-admin/css/colors.min.css',
 601	'wp-admin/css/colors-rtl.css',
 602	'wp-admin/css/colors-rtl.min.css',
 603	// Following files added back in 4.5, see #36083.
 604	// 'wp-admin/css/media-rtl.min.css',
 605	// 'wp-admin/css/media.min.css',
 606	// 'wp-admin/css/farbtastic-rtl.min.css',
 607	'wp-admin/images/lock-2x.png',
 608	'wp-admin/images/lock.png',
 609	'wp-admin/js/theme-preview.js',
 610	'wp-admin/js/theme-install.min.js',
 611	'wp-admin/js/theme-install.js',
 612	'wp-admin/js/theme-preview.min.js',
 613	'wp-includes/js/plupload/plupload.html4.js',
 614	'wp-includes/js/plupload/plupload.html5.js',
 615	'wp-includes/js/plupload/changelog.txt',
 616	'wp-includes/js/plupload/plupload.silverlight.js',
 617	'wp-includes/js/plupload/plupload.flash.js',
 618	// Added back in 4.9 [41328], see #41755.
 619	// 'wp-includes/js/plupload/plupload.js',
 620	'wp-includes/js/tinymce/plugins/spellchecker',
 621	'wp-includes/js/tinymce/plugins/inlinepopups',
 622	'wp-includes/js/tinymce/plugins/media/js',
 623	'wp-includes/js/tinymce/plugins/media/css',
 624	'wp-includes/js/tinymce/plugins/wordpress/img',
 625	'wp-includes/js/tinymce/plugins/wpdialogs/js',
 626	'wp-includes/js/tinymce/plugins/wpeditimage/img',
 627	'wp-includes/js/tinymce/plugins/wpeditimage/js',
 628	'wp-includes/js/tinymce/plugins/wpeditimage/css',
 629	'wp-includes/js/tinymce/plugins/wpgallery/img',
 630	'wp-includes/js/tinymce/plugins/wpfullscreen/css',
 631	'wp-includes/js/tinymce/plugins/paste/js',
 632	'wp-includes/js/tinymce/themes/advanced',
 633	'wp-includes/js/tinymce/tiny_mce.js',
 634	'wp-includes/js/tinymce/mark_loaded_src.js',
 635	'wp-includes/js/tinymce/wp-tinymce-schema.js',
 636	'wp-includes/js/tinymce/plugins/media/editor_plugin.js',
 637	'wp-includes/js/tinymce/plugins/media/editor_plugin_src.js',
 638	'wp-includes/js/tinymce/plugins/media/media.htm',
 639	'wp-includes/js/tinymce/plugins/wpview/editor_plugin_src.js',
 640	'wp-includes/js/tinymce/plugins/wpview/editor_plugin.js',
 641	'wp-includes/js/tinymce/plugins/directionality/editor_plugin.js',
 642	'wp-includes/js/tinymce/plugins/directionality/editor_plugin_src.js',
 643	'wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js',
 644	'wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js',
 645	'wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js',
 646	'wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.js',
 647	'wp-includes/js/tinymce/plugins/wpeditimage/editimage.html',
 648	'wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js',
 649	'wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js',
 650	'wp-includes/js/tinymce/plugins/fullscreen/editor_plugin_src.js',
 651	'wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm',
 652	'wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js',
 653	'wp-includes/js/tinymce/plugins/wplink/editor_plugin_src.js',
 654	'wp-includes/js/tinymce/plugins/wplink/editor_plugin.js',
 655	'wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js',
 656	'wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js',
 657	'wp-includes/js/tinymce/plugins/tabfocus/editor_plugin.js',
 658	'wp-includes/js/tinymce/plugins/tabfocus/editor_plugin_src.js',
 659	'wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.js',
 660	'wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js',
 661	'wp-includes/js/tinymce/plugins/paste/editor_plugin.js',
 662	'wp-includes/js/tinymce/plugins/paste/pasteword.htm',
 663	'wp-includes/js/tinymce/plugins/paste/editor_plugin_src.js',
 664	'wp-includes/js/tinymce/plugins/paste/pastetext.htm',
 665	'wp-includes/js/tinymce/langs/wp-langs.php',
 666	// 4.1
 667	'wp-includes/js/jquery/ui/jquery.ui.accordion.min.js',
 668	'wp-includes/js/jquery/ui/jquery.ui.autocomplete.min.js',
 669	'wp-includes/js/jquery/ui/jquery.ui.button.min.js',
 670	'wp-includes/js/jquery/ui/jquery.ui.core.min.js',
 671	'wp-includes/js/jquery/ui/jquery.ui.datepicker.min.js',
 672	'wp-includes/js/jquery/ui/jquery.ui.dialog.min.js',
 673	'wp-includes/js/jquery/ui/jquery.ui.draggable.min.js',
 674	'wp-includes/js/jquery/ui/jquery.ui.droppable.min.js',
 675	'wp-includes/js/jquery/ui/jquery.ui.effect-blind.min.js',
 676	'wp-includes/js/jquery/ui/jquery.ui.effect-bounce.min.js',
 677	'wp-includes/js/jquery/ui/jquery.ui.effect-clip.min.js',
 678	'wp-includes/js/jquery/ui/jquery.ui.effect-drop.min.js',
 679	'wp-includes/js/jquery/ui/jquery.ui.effect-explode.min.js',
 680	'wp-includes/js/jquery/ui/jquery.ui.effect-fade.min.js',
 681	'wp-includes/js/jquery/ui/jquery.ui.effect-fold.min.js',
 682	'wp-includes/js/jquery/ui/jquery.ui.effect-highlight.min.js',
 683	'wp-includes/js/jquery/ui/jquery.ui.effect-pulsate.min.js',
 684	'wp-includes/js/jquery/ui/jquery.ui.effect-scale.min.js',
 685	'wp-includes/js/jquery/ui/jquery.ui.effect-shake.min.js',
 686	'wp-includes/js/jquery/ui/jquery.ui.effect-slide.min.js',
 687	'wp-includes/js/jquery/ui/jquery.ui.effect-transfer.min.js',
 688	'wp-includes/js/jquery/ui/jquery.ui.effect.min.js',
 689	'wp-includes/js/jquery/ui/jquery.ui.menu.min.js',
 690	'wp-includes/js/jquery/ui/jquery.ui.mouse.min.js',
 691	'wp-includes/js/jquery/ui/jquery.ui.position.min.js',
 692	'wp-includes/js/jquery/ui/jquery.ui.progressbar.min.js',
 693	'wp-includes/js/jquery/ui/jquery.ui.resizable.min.js',
 694	'wp-includes/js/jquery/ui/jquery.ui.selectable.min.js',
 695	'wp-includes/js/jquery/ui/jquery.ui.slider.min.js',
 696	'wp-includes/js/jquery/ui/jquery.ui.sortable.min.js',
 697	'wp-includes/js/jquery/ui/jquery.ui.spinner.min.js',
 698	'wp-includes/js/jquery/ui/jquery.ui.tabs.min.js',
 699	'wp-includes/js/jquery/ui/jquery.ui.tooltip.min.js',
 700	'wp-includes/js/jquery/ui/jquery.ui.widget.min.js',
 701	'wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png',
 702	// 4.3
 703	'wp-admin/js/wp-fullscreen.js',
 704	'wp-admin/js/wp-fullscreen.min.js',
 705	'wp-includes/js/tinymce/wp-mce-help.php',
 706	'wp-includes/js/tinymce/plugins/wpfullscreen',
 707	// 4.5
 708	'wp-includes/theme-compat/comments-popup.php',
 709	// 4.6
 710	'wp-admin/includes/class-wp-automatic-upgrader.php', // Wrong file name, see #37628.
 711	// 4.8
 712	'wp-includes/js/tinymce/plugins/wpembed',
 713	'wp-includes/js/tinymce/plugins/media/moxieplayer.swf',
 714	'wp-includes/js/tinymce/skins/lightgray/fonts/readme.md',
 715	'wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.json',
 716	'wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.json',
 717	'wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css',
 718	// 4.9
 719	'wp-admin/css/press-this-editor-rtl.css',
 720	'wp-admin/css/press-this-editor-rtl.min.css',
 721	'wp-admin/css/press-this-editor.css',
 722	'wp-admin/css/press-this-editor.min.css',
 723	'wp-admin/css/press-this-rtl.css',
 724	'wp-admin/css/press-this-rtl.min.css',
 725	'wp-admin/css/press-this.css',
 726	'wp-admin/css/press-this.min.css',
 727	'wp-admin/includes/class-wp-press-this.php',
 728	'wp-admin/js/bookmarklet.js',
 729	'wp-admin/js/bookmarklet.min.js',
 730	'wp-admin/js/press-this.js',
 731	'wp-admin/js/press-this.min.js',
 732	'wp-includes/js/mediaelement/background.png',
 733	'wp-includes/js/mediaelement/bigplay.png',
 734	'wp-includes/js/mediaelement/bigplay.svg',
 735	'wp-includes/js/mediaelement/controls.png',
 736	'wp-includes/js/mediaelement/controls.svg',
 737	'wp-includes/js/mediaelement/flashmediaelement.swf',
 738	'wp-includes/js/mediaelement/froogaloop.min.js',
 739	'wp-includes/js/mediaelement/jumpforward.png',
 740	'wp-includes/js/mediaelement/loading.gif',
 741	'wp-includes/js/mediaelement/silverlightmediaelement.xap',
 742	'wp-includes/js/mediaelement/skipback.png',
 743	'wp-includes/js/plupload/plupload.flash.swf',
 744	'wp-includes/js/plupload/plupload.full.min.js',
 745	'wp-includes/js/plupload/plupload.silverlight.xap',
 746	'wp-includes/js/swfupload/plugins',
 747	'wp-includes/js/swfupload/swfupload.swf',
 748	// 4.9.2
 749	'wp-includes/js/mediaelement/lang',
 750	'wp-includes/js/mediaelement/lang/ca.js',
 751	'wp-includes/js/mediaelement/lang/cs.js',
 752	'wp-includes/js/mediaelement/lang/de.js',
 753	'wp-includes/js/mediaelement/lang/es.js',
 754	'wp-includes/js/mediaelement/lang/fa.js',
 755	'wp-includes/js/mediaelement/lang/fr.js',
 756	'wp-includes/js/mediaelement/lang/hr.js',
 757	'wp-includes/js/mediaelement/lang/hu.js',
 758	'wp-includes/js/mediaelement/lang/it.js',
 759	'wp-includes/js/mediaelement/lang/ja.js',
 760	'wp-includes/js/mediaelement/lang/ko.js',
 761	'wp-includes/js/mediaelement/lang/nl.js',
 762	'wp-includes/js/mediaelement/lang/pl.js',
 763	'wp-includes/js/mediaelement/lang/pt.js',
 764	'wp-includes/js/mediaelement/lang/ro.js',
 765	'wp-includes/js/mediaelement/lang/ru.js',
 766	'wp-includes/js/mediaelement/lang/sk.js',
 767	'wp-includes/js/mediaelement/lang/sv.js',
 768	'wp-includes/js/mediaelement/lang/uk.js',
 769	'wp-includes/js/mediaelement/lang/zh-cn.js',
 770	'wp-includes/js/mediaelement/lang/zh.js',
 771	'wp-includes/js/mediaelement/mediaelement-flash-audio-ogg.swf',
 772	'wp-includes/js/mediaelement/mediaelement-flash-audio.swf',
 773	'wp-includes/js/mediaelement/mediaelement-flash-video-hls.swf',
 774	'wp-includes/js/mediaelement/mediaelement-flash-video-mdash.swf',
 775	'wp-includes/js/mediaelement/mediaelement-flash-video.swf',
 776	'wp-includes/js/mediaelement/renderers/dailymotion.js',
 777	'wp-includes/js/mediaelement/renderers/dailymotion.min.js',
 778	'wp-includes/js/mediaelement/renderers/facebook.js',
 779	'wp-includes/js/mediaelement/renderers/facebook.min.js',
 780	'wp-includes/js/mediaelement/renderers/soundcloud.js',
 781	'wp-includes/js/mediaelement/renderers/soundcloud.min.js',
 782	'wp-includes/js/mediaelement/renderers/twitch.js',
 783	'wp-includes/js/mediaelement/renderers/twitch.min.js',
 784	// 5.0
 785	'wp-includes/js/codemirror/jshint.js',
 786	// 5.1
 787	'wp-includes/random_compat/random_bytes_openssl.php',
 788	'wp-includes/js/tinymce/wp-tinymce.js.gz',
 789	// 5.3
 790	'wp-includes/js/wp-a11y.js',     // Moved to: wp-includes/js/dist/a11y.js
 791	'wp-includes/js/wp-a11y.min.js', // Moved to: wp-includes/js/dist/a11y.min.js
 792	// 5.4
 793	'wp-admin/js/wp-fullscreen-stub.js',
 794	'wp-admin/js/wp-fullscreen-stub.min.js',
 795	// 5.5
 796	'wp-admin/css/ie.css',
 797	'wp-admin/css/ie.min.css',
 798	'wp-admin/css/ie-rtl.css',
 799	'wp-admin/css/ie-rtl.min.css',
 800);
 801
 802/**
 803 * Stores new files in wp-content to copy
 804 *
 805 * The contents of this array indicate any new bundled plugins/themes which
 806 * should be installed with the WordPress Upgrade. These items will not be
 807 * re-installed in future upgrades, this behaviour is controlled by the
 808 * introduced version present here being older than the current installed version.
 809 *
 810 * The content of this array should follow the following format:
 811 * Filename (relative to wp-content) => Introduced version
 812 * Directories should be noted by suffixing it with a trailing slash (/)
 813 *
 814 * @since 3.2.0
 815 * @since 4.7.0 New themes were not automatically installed for 4.4-4.6 on
 816 *              upgrade. New themes are now installed again. To disable new
 817 *              themes from being installed on upgrade, explicitly define
 818 *              CORE_UPGRADE_SKIP_NEW_BUNDLED as true.
 819 * @global array $_new_bundled_files
 820 * @var array
 821 * @name $_new_bundled_files
 822 */
 823global $_new_bundled_files;
 824
 825$_new_bundled_files = array(
 826	'plugins/akismet/'        => '2.0',
 827	'themes/twentyten/'       => '3.0',
 828	'themes/twentyeleven/'    => '3.2',
 829	'themes/twentytwelve/'    => '3.5',
 830	'themes/twentythirteen/'  => '3.6',
 831	'themes/twentyfourteen/'  => '3.8',
 832	'themes/twentyfifteen/'   => '4.1',
 833	'themes/twentysixteen/'   => '4.4',
 834	'themes/twentyseventeen/' => '4.7',
 835	'themes/twentynineteen/'  => '5.0',
 836	'themes/twentytwenty/'    => '5.3',
 837);
 838
 839/**
 840 * Upgrades the core of WordPress.
 841 *
 842 * This will create a .maintenance file at the base of the WordPress directory
 843 * to ensure that people can not access the web site, when the files are being
 844 * copied to their locations.
 845 *
 846 * The files in the `$_old_files` list will be removed and the new files
 847 * copied from the zip file after the database is upgraded.
 848 *
 849 * The files in the `$_new_bundled_files` list will be added to the installation
 850 * if the version is greater than or equal to the old version being upgraded.
 851 *
 852 * The steps for the upgrader for after the new release is downloaded and
 853 * unzipped is:
 854 *   1. Test unzipped location for select files to ensure that unzipped worked.
 855 *   2. Create the .maintenance file in current WordPress base.
 856 *   3. Copy new WordPress directory over old WordPress files.
 857 *   4. Upgrade WordPress to new version.
 858 *     4.1. Copy all files/folders other than wp-content
 859 *     4.2. Copy any language files to WP_LANG_DIR (which may differ from WP_CONTENT_DIR
 860 *     4.3. Copy any new bundled themes/plugins to their respective locations
 861 *   5. Delete new WordPress directory path.
 862 *   6. Delete .maintenance file.
 863 *   7. Remove old files.
 864 *   8. Delete 'update_core' option.
 865 *
 866 * There are several areas of failure. For instance if PHP times out before step
 867 * 6, then you will not be able to access any portion of your site. Also, since
 868 * the upgrade will not continue where it left off, you will not be able to
 869 * automatically remove old files and remove the 'update_core' option. This
 870 * isn't that bad.
 871 *
 872 * If the copy of the new WordPress over the old fails, then the worse is that
 873 * the new WordPress directory will remain.
 874 *
 875 * If it is assumed that every file will be copied over, including plugins and
 876 * themes, then if you edit the default theme, you should rename it, so that
 877 * your changes remain.
 878 *
 879 * @since 2.7.0
 880 *
 881 * @global WP_Filesystem_Base $wp_filesystem          WordPress filesystem subclass.
 882 * @global array              $_old_files
 883 * @global array              $_new_bundled_files
 884 * @global wpdb               $wpdb                   WordPress database abstraction object.
 885 * @global string             $wp_version
 886 * @global string             $required_php_version
 887 * @global string             $required_mysql_version
 888 *
 889 * @param string $from New release unzipped path.
 890 * @param string $to   Path to old WordPress installation.
 891 * @return string|WP_Error New WordPress version on success, WP_Error on failure.
 892 */
 893function update_core( $from, $to ) {
 894	global $wp_filesystem, $_old_files, $_new_bundled_files, $wpdb;
 895
 896	set_time_limit( 300 );
 897
 898	/**
 899	 * Filters feedback messages displayed during the core update process.
 900	 *
 901	 * The filter is first evaluated after the zip file for the latest version
 902	 * has been downloaded and unzipped. It is evaluated five more times during
 903	 * the process:
 904	 *
 905	 * 1. Before WordPress begins the core upgrade process.
 906	 * 2. Before Maintenance Mode is enabled.
 907	 * 3. Before WordPress begins copying over the necessary files.
 908	 * 4. Before Maintenance Mode is disabled.
 909	 * 5. Before the database is upgraded.
 910	 *
 911	 * @since 2.5.0
 912	 *
 913	 * @param string $feedback The core update feedback messages.
 914	 */
 915	apply_filters( 'update_feedback', __( 'Verifying the unpacked files&#8230;' ) );
 916
 917	// Sanity check the unzipped distribution.
 918	$distro = '';
 919	$roots  = array( '/wordpress/', '/wordpress-mu/' );
 920	foreach ( $roots as $root ) {
 921		if ( $wp_filesystem->exists( $from . $root . 'readme.html' ) && $wp_filesystem->exists( $from . $root . 'wp-includes/version.php' ) ) {
 922			$distro = $root;
 923			break;
 924		}
 925	}
 926	if ( ! $distro ) {
 927		$wp_filesystem->delete( $from, true );
 928		return new WP_Error( 'insane_distro', __( 'The update could not be unpacked' ) );
 929	}
 930
 931	/*
 932	 * Import $wp_version, $required_php_version, and $required_mysql_version from the new version.
 933	 * DO NOT globalise any variables imported from `version-current.php` in this function.
 934	 *
 935	 * BC Note: $wp_filesystem->wp_content_dir() returned unslashed pre-2.8
 936	 */
 937	$versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php';
 938	if ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $versions_file ) ) {
 939		$wp_filesystem->delete( $from, true );
 940		return new WP_Error( 'copy_failed_for_version_file', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), 'wp-includes/version.php' );
 941	}
 942
 943	$wp_filesystem->chmod( $versions_file, FS_CHMOD_FILE );
 944	require WP_CONTENT_DIR . '/upgrade/version-current.php';
 945	$wp_filesystem->delete( $versions_file );
 946
 947	$php_version       = phpversion();
 948	$mysql_version     = $wpdb->db_version();
 949	$old_wp_version    = $GLOBALS['wp_version']; // The version of WordPress we're updating from.
 950	$development_build = ( false !== strpos( $old_wp_version . $wp_version, '-' ) ); // A dash in the version indicates a development release.
 951	$php_compat        = version_compare( $php_version, $required_php_version, '>=' );
 952	if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {
 953		$mysql_compat = true;
 954	} else {
 955		$mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' );
 956	}
 957
 958	if ( ! $mysql_compat || ! $php_compat ) {
 959		$wp_filesystem->delete( $from, true );
 960	}
 961
 962	$php_update_message = '';
 963	if ( function_exists( 'wp_get_update_php_url' ) ) {
 964		/* translators: %s: URL to Update PHP page. */
 965		$php_update_message = '</p><p>' . sprintf( __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) );
 966
 967		if ( function_exists( 'wp_get_update_php_annotation' ) ) {
 968			$annotation = wp_get_update_php_annotation();
 969			if ( $annotation ) {
 970				$php_update_message .= '</p><p><em>' . $annotation . '</em>';
 971			}
 972		}
 973	}
 974
 975	if ( ! $mysql_compat && ! $php_compat ) {
 976		return new WP_Error(
 977			'php_mysql_not_compatible',
 978			sprintf(
 979				/* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Minimum required MySQL version number, 4: Current PHP version number, 5: Current MySQL version number. */
 980				__( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ),
 981				$wp_version,
 982				$required_php_version,
 983				$required_mysql_version,
 984				$php_version,
 985				$mysql_version
 986			) . $php_update_message
 987		);
 988	} elseif ( ! $php_compat ) {
 989		return new WP_Error(
 990			'php_not_compatible',
 991			sprintf(
 992				/* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Current PHP version number. */
 993				__( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.' ),
 994				$wp_version,
 995				$required_php_version,
 996				$php_version
 997			) . $php_update_message
 998		);
 999	} elseif ( ! $mysql_compat ) {
1000		return new WP_Error(
1001			'mysql_not_compatible',
1002			sprintf(
1003				/* translators: 1: WordPress version number, 2: Minimum required MySQL version number, 3: Current MySQL version number. */
1004				__( 'The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.' ),
1005				$wp_version,
1006				$required_mysql_version,
1007				$mysql_version
1008			)
1009		);
1010	}
1011
1012	// Add a warning when the JSON PHP extension is missing.
1013	if ( ! extension_loaded( 'json' ) ) {
1014		return new WP_Error(
1015			'php_not_compatible_json',
1016			sprintf(
1017				/* translators: 1: WordPress version number, 2: The PHP extension name needed. */
1018				__( 'The update cannot be installed because WordPress %1$s requires the %2$s PHP extension.' ),
1019				$wp_version,
1020				'JSON'
1021			)
1022		);
1023	}
1024
1025	/** This filter is documented in wp-admin/includes/update-core.php */
1026	apply_filters( 'update_feedback', __( 'Preparing to install the latest version&#8230;' ) );
1027
1028	// Don't copy wp-content, we'll deal with that below.
1029	// We also copy version.php last so failed updates report their old version.
1030	$skip              = array( 'wp-content', 'wp-includes/version.php' );
1031	$check_is_writable = array();
1032
1033	// Check to see which files don't really need updating - only available for 3.7 and higher.
1034	if ( function_exists( 'get_core_checksums' ) ) {
1035		// Find the local version of the working directory.
1036		$working_dir_local = WP_CONTENT_DIR . '/upgrade/' . basename( $from ) . $distro;
1037
1038		$checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' );
1039		if ( is_array( $checksums ) && isset( $checksums[ $wp_version ] ) ) {
1040			$checksums = $checksums[ $wp_version ]; // Compat code for 3.7-beta2.
1041		}
1042		if ( is_array( $checksums ) ) {
1043			foreach ( $checksums as $file => $checksum ) {
1044				if ( 'wp-content' == substr( $file, 0, 10 ) ) {
1045					continue;
1046				}
1047				if ( ! file_exists( ABSPATH . $file ) ) {
1048					continue;
1049				}
1050				if ( ! file_exists( $working_dir_local . $file ) ) {
1051					continue;
1052				}
1053				if ( '.' === dirname( $file ) && in_array( pathinfo( $file, PATHINFO_EXTENSION ), array( 'html', 'txt' ), true ) ) {
1054					continue;
1055				}
1056				if ( md5_file( ABSPATH . $file ) === $checksum ) {
1057					$skip[] = $file;
1058				} else {
1059					$check_is_writable[ $file ] = ABSPATH . $file;
1060				}
1061			}
1062		}
1063	}
1064
1065	// If we're using the direct method, we can predict write failures that are due to permissions.
1066	if ( $check_is_writable && 'direct' === $wp_filesystem->method ) {
1067		$files_writable = array_filter( $check_is_writable, array( $wp_filesystem, 'is_writable' ) );
1068		if ( $files_writable !== $check_is_writable ) {
1069			$files_not_writable = array_diff_key( $check_is_writable, $files_writable );
1070			foreach ( $files_not_writable as $relative_file_not_writable => $file_not_writable ) {
1071				// If the writable check failed, chmod file to 0644 and try again, same as copy_dir().
1072				$wp_filesystem->chmod( $file_not_writable, FS_CHMOD_FILE );
1073				if ( $wp_filesystem->is_writable( $file_not_writable ) ) {
1074					unset( $files_not_writable[ $relative_file_not_writable ] );
1075				}
1076			}
1077
1078			// Store package-relative paths (the key) of non-writable files in the WP_Error object.
1079			$error_data = version_compare( $old_wp_version, '3.7-beta2', '>' ) ? array_keys( $files_not_writable ) : '';
1080
1081			if ( $files_not_writable ) {
1082				return new WP_Error( 'files_not_writable', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), implode( ', ', $error_data ) );
1083			}
1084		}
1085	}
1086
1087	/** This filter is documented in wp-admin/includes/update-core.php */
1088	apply_filters( 'update_feedback', __( 'Enabling Maintenance mode&#8230;' ) );
1089	// Create maintenance file to signal that we are upgrading.
1090	$maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
1091	$maintenance_file   = $to . '.maintenance';
1092	$wp_filesystem->delete( $maintenance_file );
1093	$wp_filesystem->put_contents( $maintenance_file, $maintenance_string, FS_CHMOD_FILE );
1094
1095	/** This filter is documented in wp-admin/includes/update-core.php */
1096	apply_filters( 'update_feedback', __( 'Copying the required files&#8230;' ) );
1097	// Copy new versions of WP files into place.
1098	$result = _copy_dir( $from . $distro, $to, $skip );
1099	if ( is_wp_error( $result ) ) {
1100		$result = new WP_Error( $result->get_error_code(), $result->get_error_message(), substr( $result->get_error_data(), strlen( $to ) ) );
1101	}
1102
1103	// Since we know the core files have copied over, we can now copy the version file.
1104	if ( ! is_wp_error( $result ) ) {
1105		if ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $to . 'wp-includes/version.php', true /* overwrite */ ) ) {
1106			$wp_filesystem->delete( $from, true );
1107			$result = new WP_Error( 'copy_failed_for_version_file', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), 'wp-includes/version.php' );
1108		}
1109		$wp_filesystem->chmod( $to . 'wp-includes/version.php', FS_CHMOD_FILE );
1110	}
1111
1112	// Check to make sure everything copied correctly, ignoring the contents of wp-content.
1113	$skip   = array( 'wp-content' );
1114	$failed = array();
1115	if ( isset( $checksums ) && is_array( $checksums ) ) {
1116		foreach ( $checksums as $file => $checksum ) {
1117			if ( 'wp-content' == substr( $file, 0, 10 ) ) {
1118				continue;
1119			}
1120			if ( ! file_exists( $working_dir_local . $file ) ) {
1121				continue;
1122			}
1123			if ( '.' === dirname( $file ) && in_array( pathinfo( $file, PATHINFO_EXTENSION ), array( 'html', 'txt' ), true ) ) {
1124				$skip[] = $file;
1125				continue;
1126			}
1127			if ( file_exists( ABSPATH . $file ) && md5_file( ABSPATH . $file ) == $checksum ) {
1128				$skip[] = $file;
1129			} else {
1130				$failed[] = $file;
1131			}
1132		}
1133	}
1134
1135	// Some files didn't copy properly.
1136	if ( ! empty( $failed ) ) {
1137		$total_size = 0;
1138		foreach ( $failed as $file ) {
1139			if ( file_exists( $working_dir_local . $file ) ) {
1140				$total_size += filesize( $working_dir_local . $file );
1141			}
1142		}
1143
1144		// If we don't have enough free space, it isn't worth trying again.
1145		// Unlikely to be hit due to the check in unzip_file().
1146		$available_space = @disk_free_space( ABSPATH );
1147		if ( $available_space && $total_size >= $available_space ) {
1148			$result = new WP_Error( 'disk_full', __( 'There is not enough free disk space to complete the update.' ) );
1149		} else {
1150			$result = _copy_dir( $from . $distro, $to, $skip );
1151			if ( is_wp_error( $result ) ) {
1152				$result = new WP_Error( $result->get_error_code() . '_retry', $result->get_error_message(), substr( $result->get_error_data(), strlen( $to ) ) );
1153			}
1154		}
1155	}
1156
1157	// Custom content directory needs updating now.
1158	// Copy languages.
1159	if ( ! is_wp_error( $result ) && $wp_filesystem->is_dir( $from . $distro . 'wp-content/languages' ) ) {
1160		if ( WP_LANG_DIR != ABSPATH . WPINC . '/languages' || @is_dir( WP_LANG_DIR ) ) {
1161			$lang_dir = WP_LANG_DIR;
1162		} else {
1163			$lang_dir = WP_CONTENT_DIR . '/languages';
1164		}
1165
1166		// Check if the language directory exists first.
1167		if ( ! @is_dir( $lang_dir ) && 0 === strpos( $lang_dir, ABSPATH ) ) {
1168			// If it's within the ABSPATH we can handle it here, otherwise they're out of luck.
1169			$wp_filesystem->mkdir( $to . str_replace( ABSPATH, '', $lang_dir ), FS_CHMOD_DIR );
1170			clearstatcache(); // For FTP, need to clear the stat cache.
1171		}
1172
1173		if ( @is_dir( $lang_dir ) ) {
1174			$wp_lang_dir = $wp_filesystem->find_folder( $lang_dir );
1175			if ( $wp_lang_dir ) {
1176				$result = copy_dir( $from . $distro . 'wp-content/languages/', $wp_lang_dir );
1177				if ( is_wp_error( $result ) ) {
1178					$result = new WP_Error( $result->get_error_code() . '_languages', $result->get_error_message(), substr( $result->get_error_data(), strlen( $wp_lang_dir ) ) );
1179				}
1180			}
1181		}
1182	}
1183
1184	/** This filter is documented in wp-admin/includes/update-core.php */
1185	apply_filters( 'update_feedback', __( 'Disabling Maintenance mode&#8230;' ) );
1186	// Remove maintenance file, we're done with potential site-breaking changes.
1187	$wp_filesystem->delete( $maintenance_file );
1188
1189	// 3.5 -> 3.5+ - an empty twentytwelve directory was created upon upgrade to 3.5 for some users, preventing installation of Twenty Twelve.
1190	if ( '3.5' == $old_wp_version ) {
1191		if ( is_dir( WP_CONTENT_DIR . '/themes/twentytwelve' ) && ! file_exists( WP_CONTENT_DIR . '/themes/twentytwelve/style.css' ) ) {
1192			$wp_filesystem->delete( $wp_filesystem->wp_themes_dir() . 'twentytwelve/' );
1193		}
1194	}
1195
1196	/*
1197	 * Copy new bundled plugins & themes.
1198	 * This gives us the ability to install new plugins & themes bundled with
1199	 * future versions of WordPress whilst avoiding the re-install upon upgrade issue.
1200	 * $development_build controls us overwriting bundled themes and plugins when a non-stable release is being updated.
1201	 */
1202	if ( ! is_wp_error( $result ) && ( ! defined( 'CORE_UPGRADE_SKIP_NEW_BUNDLED' ) || ! CORE_UPGRADE_SKIP_NEW_BUNDLED ) ) {
1203		foreach ( (array) $_new_bundled_files as $file => $introduced_version ) {
1204			// If a $development_build or if $introduced version is greater than what the site was previously running.
1205			if ( $development_build || version_compare( $introduced_version, $old_wp_version, '>' ) ) {
1206				$directory             = ( '/' == $file[ strlen( $file ) - 1 ] );
1207				list($type, $filename) = explode( '/', $file, 2 );
1208
1209				// Check to see if the bundled items exist before attempting to copy them.
1210				if ( ! $wp_filesystem->exists( $from . $distro . 'wp-content/' . $file ) ) {
1211					continue;
1212				}
1213
1214				if ( 'plugins' == $type ) {
1215					$dest = $wp_filesystem->wp_plugins_dir();
1216				} elseif ( 'themes' == $type ) {
1217					// Back-compat, ::wp_themes_dir() did not return trailingslash'd pre-3.2.
1218

Large files files are truncated, but you can click here to view the full file