[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
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 * Bundled theme files should not be included in this list. 14 * 15 * @since 2.7.0 16 * 17 * @global array $_old_files 18 * @var array 19 * @name $_old_files 20 */ 21 global $_old_files; 22 23 $_old_files = array( 24 // 2.0 25 'wp-admin/import-b2.php', 26 'wp-admin/import-blogger.php', 27 'wp-admin/import-greymatter.php', 28 'wp-admin/import-livejournal.php', 29 'wp-admin/import-mt.php', 30 'wp-admin/import-rss.php', 31 'wp-admin/import-textpattern.php', 32 'wp-admin/quicktags.js', 33 'wp-images/fade-butt.png', 34 'wp-images/get-firefox.png', 35 'wp-images/header-shadow.png', 36 'wp-images/smilies', 37 'wp-images/wp-small.png', 38 'wp-images/wpminilogo.png', 39 'wp.php', 40 // 2.1 41 'wp-admin/edit-form-ajax-cat.php', 42 'wp-admin/execute-pings.php', 43 'wp-admin/inline-uploading.php', 44 'wp-admin/link-categories.php', 45 'wp-admin/list-manipulation.js', 46 'wp-admin/list-manipulation.php', 47 'wp-includes/comment-functions.php', 48 'wp-includes/feed-functions.php', 49 'wp-includes/functions-compat.php', 50 'wp-includes/functions-formatting.php', 51 'wp-includes/functions-post.php', 52 'wp-includes/js/dbx-key.js', 53 'wp-includes/links.php', 54 'wp-includes/pluggable-functions.php', 55 'wp-includes/template-functions-author.php', 56 'wp-includes/template-functions-category.php', 57 'wp-includes/template-functions-general.php', 58 'wp-includes/template-functions-links.php', 59 'wp-includes/template-functions-post.php', 60 'wp-includes/wp-l10n.php', 61 // 2.2 62 'wp-admin/cat-js.php', 63 'wp-includes/js/autosave-js.php', 64 'wp-includes/js/list-manipulation-js.php', 65 'wp-includes/js/wp-ajax-js.php', 66 // 2.3 67 'wp-admin/admin-db.php', 68 'wp-admin/cat.js', 69 'wp-admin/categories.js', 70 'wp-admin/custom-fields.js', 71 'wp-admin/dbx-admin-key.js', 72 'wp-admin/edit-comments.js', 73 'wp-admin/install-rtl.css', 74 'wp-admin/install.css', 75 'wp-admin/upgrade-schema.php', 76 'wp-admin/upload-functions.php', 77 'wp-admin/upload-rtl.css', 78 'wp-admin/upload.css', 79 'wp-admin/upload.js', 80 'wp-admin/users.js', 81 'wp-admin/widgets-rtl.css', 82 'wp-admin/widgets.css', 83 'wp-admin/xfn.js', 84 'wp-includes/js/tinymce/license.html', 85 // 2.5 86 'wp-admin/css/upload.css', 87 'wp-admin/images/box-bg-left.gif', 88 'wp-admin/images/box-bg-right.gif', 89 'wp-admin/images/box-bg.gif', 90 'wp-admin/images/box-butt-left.gif', 91 'wp-admin/images/box-butt-right.gif', 92 'wp-admin/images/box-butt.gif', 93 'wp-admin/images/box-head-left.gif', 94 'wp-admin/images/box-head-right.gif', 95 'wp-admin/images/box-head.gif', 96 'wp-admin/images/heading-bg.gif', 97 'wp-admin/images/login-bkg-bottom.gif', 98 'wp-admin/images/login-bkg-tile.gif', 99 'wp-admin/images/notice.gif', 100 'wp-admin/images/toggle.gif', 101 'wp-admin/includes/upload.php', 102 'wp-admin/js/dbx-admin-key.js', 103 'wp-admin/js/link-cat.js', 104 'wp-admin/profile-update.php', 105 'wp-admin/templates.php', 106 'wp-includes/js/dbx.js', 107 'wp-includes/js/fat.js', 108 'wp-includes/js/list-manipulation.js', 109 'wp-includes/js/tinymce/langs/en.js', 110 'wp-includes/js/tinymce/plugins/directionality/images', 111 'wp-includes/js/tinymce/plugins/directionality/langs', 112 'wp-includes/js/tinymce/plugins/paste/images', 113 'wp-includes/js/tinymce/plugins/paste/jscripts', 114 'wp-includes/js/tinymce/plugins/paste/langs', 115 'wp-includes/js/tinymce/plugins/wordpress/images', 116 'wp-includes/js/tinymce/plugins/wordpress/langs', 117 'wp-includes/js/tinymce/plugins/wordpress/wordpress.css', 118 'wp-includes/js/tinymce/plugins/wphelp', 119 // 2.5.1 120 'wp-includes/js/tinymce/tiny_mce_gzip.php', 121 // 2.6 122 'wp-admin/bookmarklet.php', 123 'wp-includes/js/jquery/jquery.dimensions.min.js', 124 'wp-includes/js/tinymce/plugins/wordpress/popups.css', 125 'wp-includes/js/wp-ajax.js', 126 // 2.7 127 'wp-admin/css/press-this-ie-rtl.css', 128 'wp-admin/css/press-this-ie.css', 129 'wp-admin/css/upload-rtl.css', 130 'wp-admin/edit-form.php', 131 'wp-admin/images/comment-pill.gif', 132 'wp-admin/images/comment-stalk-classic.gif', 133 'wp-admin/images/comment-stalk-fresh.gif', 134 'wp-admin/images/comment-stalk-rtl.gif', 135 'wp-admin/images/del.png', 136 'wp-admin/images/gear.png', 137 'wp-admin/images/media-button-gallery.gif', 138 'wp-admin/images/media-buttons.gif', 139 'wp-admin/images/postbox-bg.gif', 140 'wp-admin/images/tab.png', 141 'wp-admin/images/tail.gif', 142 'wp-admin/js/forms.js', 143 'wp-admin/js/upload.js', 144 'wp-admin/link-import.php', 145 'wp-includes/images/audio.png', 146 'wp-includes/images/css.png', 147 'wp-includes/images/default.png', 148 'wp-includes/images/doc.png', 149 'wp-includes/images/exe.png', 150 'wp-includes/images/html.png', 151 'wp-includes/images/js.png', 152 'wp-includes/images/pdf.png', 153 'wp-includes/images/swf.png', 154 'wp-includes/images/tar.png', 155 'wp-includes/images/text.png', 156 'wp-includes/images/video.png', 157 'wp-includes/images/zip.png', 158 'wp-includes/js/tinymce/tiny_mce_config.php', 159 'wp-includes/js/tinymce/tiny_mce_ext.js', 160 // 2.8 161 'wp-admin/js/users.js', 162 'wp-includes/js/swfupload/swfupload_f9.swf', 163 'wp-includes/js/tinymce/plugins/autosave', 164 'wp-includes/js/tinymce/plugins/paste/css', 165 'wp-includes/js/tinymce/utils/mclayer.js', 166 'wp-includes/js/tinymce/wordpress.css', 167 // 2.9 168 'wp-admin/js/page.dev.js', 169 'wp-admin/js/page.js', 170 'wp-admin/js/set-post-thumbnail-handler.dev.js', 171 'wp-admin/js/set-post-thumbnail-handler.js', 172 'wp-admin/js/slug.dev.js', 173 'wp-admin/js/slug.js', 174 'wp-includes/gettext.php', 175 'wp-includes/js/tinymce/plugins/wordpress/js', 176 'wp-includes/streams.php', 177 // MU 178 'README.txt', 179 'htaccess.dist', 180 'index-install.php', 181 'wp-admin/css/mu-rtl.css', 182 'wp-admin/css/mu.css', 183 'wp-admin/images/site-admin.png', 184 'wp-admin/includes/mu.php', 185 'wp-admin/wpmu-admin.php', 186 'wp-admin/wpmu-blogs.php', 187 'wp-admin/wpmu-edit.php', 188 'wp-admin/wpmu-options.php', 189 'wp-admin/wpmu-themes.php', 190 'wp-admin/wpmu-upgrade-site.php', 191 'wp-admin/wpmu-users.php', 192 'wp-includes/images/wordpress-mu.png', 193 'wp-includes/wpmu-default-filters.php', 194 'wp-includes/wpmu-functions.php', 195 'wpmu-settings.php', 196 // 3.0 197 'wp-admin/categories.php', 198 'wp-admin/edit-category-form.php', 199 'wp-admin/edit-page-form.php', 200 'wp-admin/edit-pages.php', 201 'wp-admin/images/admin-header-footer.png', 202 'wp-admin/images/browse-happy.gif', 203 'wp-admin/images/ico-add.png', 204 'wp-admin/images/ico-close.png', 205 'wp-admin/images/ico-edit.png', 206 'wp-admin/images/ico-viewpage.png', 207 'wp-admin/images/fav-top.png', 208 'wp-admin/images/screen-options-left.gif', 209 'wp-admin/images/wp-logo-vs.gif', 210 'wp-admin/images/wp-logo.gif', 211 'wp-admin/import', 212 'wp-admin/js/wp-gears.dev.js', 213 'wp-admin/js/wp-gears.js', 214 'wp-admin/options-misc.php', 215 'wp-admin/page-new.php', 216 'wp-admin/page.php', 217 'wp-admin/rtl.css', 218 'wp-admin/rtl.dev.css', 219 'wp-admin/update-links.php', 220 'wp-admin/wp-admin.css', 221 'wp-admin/wp-admin.dev.css', 222 'wp-includes/js/codepress', 223 'wp-includes/js/jquery/autocomplete.dev.js', 224 'wp-includes/js/jquery/autocomplete.js', 225 'wp-includes/js/jquery/interface.js', 226 // Following file added back in 5.1, see #45645. 227 //'wp-includes/js/tinymce/wp-tinymce.js', 228 // 3.1 229 'wp-admin/edit-attachment-rows.php', 230 'wp-admin/edit-link-categories.php', 231 'wp-admin/edit-link-category-form.php', 232 'wp-admin/edit-post-rows.php', 233 'wp-admin/images/button-grad-active-vs.png', 234 'wp-admin/images/button-grad-vs.png', 235 'wp-admin/images/fav-arrow-vs-rtl.gif', 236 'wp-admin/images/fav-arrow-vs.gif', 237 'wp-admin/images/fav-top-vs.gif', 238 'wp-admin/images/list-vs.png', 239 'wp-admin/images/screen-options-right-up.gif', 240 'wp-admin/images/screen-options-right.gif', 241 'wp-admin/images/visit-site-button-grad-vs.gif', 242 'wp-admin/images/visit-site-button-grad.gif', 243 'wp-admin/link-category.php', 244 'wp-admin/sidebar.php', 245 'wp-includes/classes.php', 246 'wp-includes/js/tinymce/blank.htm', 247 'wp-includes/js/tinymce/plugins/media/img', 248 'wp-includes/js/tinymce/plugins/safari', 249 // 3.2 250 'wp-admin/images/logo-login.gif', 251 'wp-admin/images/star.gif', 252 'wp-admin/js/list-table.dev.js', 253 'wp-admin/js/list-table.js', 254 'wp-includes/default-embeds.php', 255 // 3.3 256 'wp-admin/css/colors-classic-rtl.css', 257 'wp-admin/css/colors-classic-rtl.dev.css', 258 'wp-admin/css/colors-fresh-rtl.css', 259 'wp-admin/css/colors-fresh-rtl.dev.css', 260 'wp-admin/css/dashboard-rtl.dev.css', 261 'wp-admin/css/dashboard.dev.css', 262 'wp-admin/css/global-rtl.css', 263 'wp-admin/css/global-rtl.dev.css', 264 'wp-admin/css/global.css', 265 'wp-admin/css/global.dev.css', 266 'wp-admin/css/install-rtl.dev.css', 267 'wp-admin/css/login-rtl.dev.css', 268 'wp-admin/css/login.dev.css', 269 'wp-admin/css/ms.css', 270 'wp-admin/css/ms.dev.css', 271 'wp-admin/css/nav-menu-rtl.css', 272 'wp-admin/css/nav-menu-rtl.dev.css', 273 'wp-admin/css/nav-menu.css', 274 'wp-admin/css/nav-menu.dev.css', 275 'wp-admin/css/plugin-install-rtl.css', 276 'wp-admin/css/plugin-install-rtl.dev.css', 277 'wp-admin/css/plugin-install.css', 278 'wp-admin/css/plugin-install.dev.css', 279 'wp-admin/css/press-this-rtl.dev.css', 280 'wp-admin/css/press-this.dev.css', 281 'wp-admin/css/theme-editor-rtl.css', 282 'wp-admin/css/theme-editor-rtl.dev.css', 283 'wp-admin/css/theme-editor.css', 284 'wp-admin/css/theme-editor.dev.css', 285 'wp-admin/css/theme-install-rtl.css', 286 'wp-admin/css/theme-install-rtl.dev.css', 287 'wp-admin/css/theme-install.css', 288 'wp-admin/css/theme-install.dev.css', 289 'wp-admin/css/widgets-rtl.dev.css', 290 'wp-admin/css/widgets.dev.css', 291 'wp-admin/includes/internal-linking.php', 292 'wp-includes/images/admin-bar-sprite-rtl.png', 293 'wp-includes/js/jquery/ui.button.js', 294 'wp-includes/js/jquery/ui.core.js', 295 'wp-includes/js/jquery/ui.dialog.js', 296 'wp-includes/js/jquery/ui.draggable.js', 297 'wp-includes/js/jquery/ui.droppable.js', 298 'wp-includes/js/jquery/ui.mouse.js', 299 'wp-includes/js/jquery/ui.position.js', 300 'wp-includes/js/jquery/ui.resizable.js', 301 'wp-includes/js/jquery/ui.selectable.js', 302 'wp-includes/js/jquery/ui.sortable.js', 303 'wp-includes/js/jquery/ui.tabs.js', 304 'wp-includes/js/jquery/ui.widget.js', 305 'wp-includes/js/l10n.dev.js', 306 'wp-includes/js/l10n.js', 307 'wp-includes/js/tinymce/plugins/wplink/css', 308 'wp-includes/js/tinymce/plugins/wplink/img', 309 'wp-includes/js/tinymce/plugins/wplink/js', 310 // Don't delete, yet: 'wp-rss.php', 311 // Don't delete, yet: 'wp-rdf.php', 312 // Don't delete, yet: 'wp-rss2.php', 313 // Don't delete, yet: 'wp-commentsrss2.php', 314 // Don't delete, yet: 'wp-atom.php', 315 // Don't delete, yet: 'wp-feed.php', 316 // 3.4 317 'wp-admin/images/gray-star.png', 318 'wp-admin/images/logo-login.png', 319 'wp-admin/images/star.png', 320 'wp-admin/index-extra.php', 321 'wp-admin/network/index-extra.php', 322 'wp-admin/user/index-extra.php', 323 'wp-includes/css/editor-buttons.css', 324 'wp-includes/css/editor-buttons.dev.css', 325 'wp-includes/js/tinymce/plugins/paste/blank.htm', 326 'wp-includes/js/tinymce/plugins/wordpress/css', 327 'wp-includes/js/tinymce/plugins/wordpress/editor_plugin.dev.js', 328 'wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.dev.js', 329 'wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js', 330 'wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.dev.js', 331 'wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js', 332 // Don't delete, yet: 'wp-pass.php', 333 // Don't delete, yet: 'wp-register.php', 334 // 3.5 335 'wp-admin/gears-manifest.php', 336 'wp-admin/includes/manifest.php', 337 'wp-admin/images/archive-link.png', 338 'wp-admin/images/blue-grad.png', 339 'wp-admin/images/button-grad-active.png', 340 'wp-admin/images/button-grad.png', 341 'wp-admin/images/ed-bg-vs.gif', 342 'wp-admin/images/ed-bg.gif', 343 'wp-admin/images/fade-butt.png', 344 'wp-admin/images/fav-arrow-rtl.gif', 345 'wp-admin/images/fav-arrow.gif', 346 'wp-admin/images/fav-vs.png', 347 'wp-admin/images/fav.png', 348 'wp-admin/images/gray-grad.png', 349 'wp-admin/images/loading-publish.gif', 350 'wp-admin/images/logo-ghost.png', 351 'wp-admin/images/logo.gif', 352 'wp-admin/images/menu-arrow-frame-rtl.png', 353 'wp-admin/images/menu-arrow-frame.png', 354 'wp-admin/images/menu-arrows.gif', 355 'wp-admin/images/menu-bits-rtl-vs.gif', 356 'wp-admin/images/menu-bits-rtl.gif', 357 'wp-admin/images/menu-bits-vs.gif', 358 'wp-admin/images/menu-bits.gif', 359 'wp-admin/images/menu-dark-rtl-vs.gif', 360 'wp-admin/images/menu-dark-rtl.gif', 361 'wp-admin/images/menu-dark-vs.gif', 362 'wp-admin/images/menu-dark.gif', 363 'wp-admin/images/required.gif', 364 'wp-admin/images/screen-options-toggle-vs.gif', 365 'wp-admin/images/screen-options-toggle.gif', 366 'wp-admin/images/toggle-arrow-rtl.gif', 367 'wp-admin/images/toggle-arrow.gif', 368 'wp-admin/images/upload-classic.png', 369 'wp-admin/images/upload-fresh.png', 370 'wp-admin/images/white-grad-active.png', 371 'wp-admin/images/white-grad.png', 372 'wp-admin/images/widgets-arrow-vs.gif', 373 'wp-admin/images/widgets-arrow.gif', 374 'wp-admin/images/wpspin_dark.gif', 375 'wp-includes/images/upload.png', 376 'wp-includes/js/prototype.js', 377 'wp-includes/js/scriptaculous', 378 'wp-admin/css/wp-admin-rtl.dev.css', 379 'wp-admin/css/wp-admin.dev.css', 380 'wp-admin/css/media-rtl.dev.css', 381 'wp-admin/css/media.dev.css', 382 'wp-admin/css/colors-classic.dev.css', 383 'wp-admin/css/customize-controls-rtl.dev.css', 384 'wp-admin/css/customize-controls.dev.css', 385 'wp-admin/css/ie-rtl.dev.css', 386 'wp-admin/css/ie.dev.css', 387 'wp-admin/css/install.dev.css', 388 'wp-admin/css/colors-fresh.dev.css', 389 'wp-includes/js/customize-base.dev.js', 390 'wp-includes/js/json2.dev.js', 391 'wp-includes/js/comment-reply.dev.js', 392 'wp-includes/js/customize-preview.dev.js', 393 'wp-includes/js/wplink.dev.js', 394 'wp-includes/js/tw-sack.dev.js', 395 'wp-includes/js/wp-list-revisions.dev.js', 396 'wp-includes/js/autosave.dev.js', 397 'wp-includes/js/admin-bar.dev.js', 398 'wp-includes/js/quicktags.dev.js', 399 'wp-includes/js/wp-ajax-response.dev.js', 400 'wp-includes/js/wp-pointer.dev.js', 401 'wp-includes/js/hoverIntent.dev.js', 402 'wp-includes/js/colorpicker.dev.js', 403 'wp-includes/js/wp-lists.dev.js', 404 'wp-includes/js/customize-loader.dev.js', 405 'wp-includes/js/jquery/jquery.table-hotkeys.dev.js', 406 'wp-includes/js/jquery/jquery.color.dev.js', 407 'wp-includes/js/jquery/jquery.color.js', 408 'wp-includes/js/jquery/jquery.hotkeys.dev.js', 409 'wp-includes/js/jquery/jquery.form.dev.js', 410 'wp-includes/js/jquery/suggest.dev.js', 411 'wp-admin/js/xfn.dev.js', 412 'wp-admin/js/set-post-thumbnail.dev.js', 413 'wp-admin/js/comment.dev.js', 414 'wp-admin/js/theme.dev.js', 415 'wp-admin/js/cat.dev.js', 416 'wp-admin/js/password-strength-meter.dev.js', 417 'wp-admin/js/user-profile.dev.js', 418 'wp-admin/js/theme-preview.dev.js', 419 'wp-admin/js/post.dev.js', 420 'wp-admin/js/media-upload.dev.js', 421 'wp-admin/js/word-count.dev.js', 422 'wp-admin/js/plugin-install.dev.js', 423 'wp-admin/js/edit-comments.dev.js', 424 'wp-admin/js/media-gallery.dev.js', 425 'wp-admin/js/custom-fields.dev.js', 426 'wp-admin/js/custom-background.dev.js', 427 'wp-admin/js/common.dev.js', 428 'wp-admin/js/inline-edit-tax.dev.js', 429 'wp-admin/js/gallery.dev.js', 430 'wp-admin/js/utils.dev.js', 431 'wp-admin/js/widgets.dev.js', 432 'wp-admin/js/wp-fullscreen.dev.js', 433 'wp-admin/js/nav-menu.dev.js', 434 'wp-admin/js/dashboard.dev.js', 435 'wp-admin/js/link.dev.js', 436 'wp-admin/js/user-suggest.dev.js', 437 'wp-admin/js/postbox.dev.js', 438 'wp-admin/js/tags.dev.js', 439 'wp-admin/js/image-edit.dev.js', 440 'wp-admin/js/media.dev.js', 441 'wp-admin/js/customize-controls.dev.js', 442 'wp-admin/js/inline-edit-post.dev.js', 443 'wp-admin/js/categories.dev.js', 444 'wp-admin/js/editor.dev.js', 445 'wp-includes/js/plupload/handlers.dev.js', 446 'wp-includes/js/plupload/wp-plupload.dev.js', 447 'wp-includes/js/swfupload/handlers.dev.js', 448 'wp-includes/js/jcrop/jquery.Jcrop.dev.js', 449 'wp-includes/js/jcrop/jquery.Jcrop.js', 450 'wp-includes/js/jcrop/jquery.Jcrop.css', 451 'wp-includes/js/imgareaselect/jquery.imgareaselect.dev.js', 452 'wp-includes/css/wp-pointer.dev.css', 453 'wp-includes/css/editor.dev.css', 454 'wp-includes/css/jquery-ui-dialog.dev.css', 455 'wp-includes/css/admin-bar-rtl.dev.css', 456 'wp-includes/css/admin-bar.dev.css', 457 'wp-includes/js/jquery/ui/jquery.effects.clip.min.js', 458 'wp-includes/js/jquery/ui/jquery.effects.scale.min.js', 459 'wp-includes/js/jquery/ui/jquery.effects.blind.min.js', 460 'wp-includes/js/jquery/ui/jquery.effects.core.min.js', 461 'wp-includes/js/jquery/ui/jquery.effects.shake.min.js', 462 'wp-includes/js/jquery/ui/jquery.effects.fade.min.js', 463 'wp-includes/js/jquery/ui/jquery.effects.explode.min.js', 464 'wp-includes/js/jquery/ui/jquery.effects.slide.min.js', 465 'wp-includes/js/jquery/ui/jquery.effects.drop.min.js', 466 'wp-includes/js/jquery/ui/jquery.effects.highlight.min.js', 467 'wp-includes/js/jquery/ui/jquery.effects.bounce.min.js', 468 'wp-includes/js/jquery/ui/jquery.effects.pulsate.min.js', 469 'wp-includes/js/jquery/ui/jquery.effects.transfer.min.js', 470 'wp-includes/js/jquery/ui/jquery.effects.fold.min.js', 471 'wp-admin/js/utils.js', 472 // Added back in 5.3 [45448], see #43895. 473 // 'wp-admin/options-privacy.php', 474 'wp-app.php', 475 'wp-includes/class-wp-atom-server.php', 476 // 3.5.2 477 'wp-includes/js/swfupload/swfupload-all.js', 478 // 3.6 479 'wp-admin/js/revisions-js.php', 480 'wp-admin/images/screenshots', 481 'wp-admin/js/categories.js', 482 'wp-admin/js/categories.min.js', 483 'wp-admin/js/custom-fields.js', 484 'wp-admin/js/custom-fields.min.js', 485 // 3.7 486 'wp-admin/js/cat.js', 487 'wp-admin/js/cat.min.js', 488 // 3.8 489 'wp-includes/js/thickbox/tb-close-2x.png', 490 'wp-includes/js/thickbox/tb-close.png', 491 'wp-includes/images/wpmini-blue-2x.png', 492 'wp-includes/images/wpmini-blue.png', 493 'wp-admin/css/colors-fresh.css', 494 'wp-admin/css/colors-classic.css', 495 'wp-admin/css/colors-fresh.min.css', 496 'wp-admin/css/colors-classic.min.css', 497 'wp-admin/js/about.min.js', 498 'wp-admin/js/about.js', 499 'wp-admin/images/arrows-dark-vs-2x.png', 500 'wp-admin/images/wp-logo-vs.png', 501 'wp-admin/images/arrows-dark-vs.png', 502 'wp-admin/images/wp-logo.png', 503 'wp-admin/images/arrows-pr.png', 504 'wp-admin/images/arrows-dark.png', 505 'wp-admin/images/press-this.png', 506 'wp-admin/images/press-this-2x.png', 507 'wp-admin/images/arrows-vs-2x.png', 508 'wp-admin/images/welcome-icons.png', 509 'wp-admin/images/wp-logo-2x.png', 510 'wp-admin/images/stars-rtl-2x.png', 511 'wp-admin/images/arrows-dark-2x.png', 512 'wp-admin/images/arrows-pr-2x.png', 513 'wp-admin/images/menu-shadow-rtl.png', 514 'wp-admin/images/arrows-vs.png', 515 'wp-admin/images/about-search-2x.png', 516 'wp-admin/images/bubble_bg-rtl-2x.gif', 517 'wp-admin/images/wp-badge-2x.png', 518 'wp-admin/images/wordpress-logo-2x.png', 519 'wp-admin/images/bubble_bg-rtl.gif', 520 'wp-admin/images/wp-badge.png', 521 'wp-admin/images/menu-shadow.png', 522 'wp-admin/images/about-globe-2x.png', 523 'wp-admin/images/welcome-icons-2x.png', 524 'wp-admin/images/stars-rtl.png', 525 'wp-admin/images/wp-logo-vs-2x.png', 526 'wp-admin/images/about-updates-2x.png', 527 // 3.9 528 'wp-admin/css/colors.css', 529 'wp-admin/css/colors.min.css', 530 'wp-admin/css/colors-rtl.css', 531 'wp-admin/css/colors-rtl.min.css', 532 // Following files added back in 4.5, see #36083. 533 // 'wp-admin/css/media-rtl.min.css', 534 // 'wp-admin/css/media.min.css', 535 // 'wp-admin/css/farbtastic-rtl.min.css', 536 'wp-admin/images/lock-2x.png', 537 'wp-admin/images/lock.png', 538 'wp-admin/js/theme-preview.js', 539 'wp-admin/js/theme-install.min.js', 540 'wp-admin/js/theme-install.js', 541 'wp-admin/js/theme-preview.min.js', 542 'wp-includes/js/plupload/plupload.html4.js', 543 'wp-includes/js/plupload/plupload.html5.js', 544 'wp-includes/js/plupload/changelog.txt', 545 'wp-includes/js/plupload/plupload.silverlight.js', 546 'wp-includes/js/plupload/plupload.flash.js', 547 // Added back in 4.9 [41328], see #41755. 548 // 'wp-includes/js/plupload/plupload.js', 549 'wp-includes/js/tinymce/plugins/spellchecker', 550 'wp-includes/js/tinymce/plugins/inlinepopups', 551 'wp-includes/js/tinymce/plugins/media/js', 552 'wp-includes/js/tinymce/plugins/media/css', 553 'wp-includes/js/tinymce/plugins/wordpress/img', 554 'wp-includes/js/tinymce/plugins/wpdialogs/js', 555 'wp-includes/js/tinymce/plugins/wpeditimage/img', 556 'wp-includes/js/tinymce/plugins/wpeditimage/js', 557 'wp-includes/js/tinymce/plugins/wpeditimage/css', 558 'wp-includes/js/tinymce/plugins/wpgallery/img', 559 'wp-includes/js/tinymce/plugins/paste/js', 560 'wp-includes/js/tinymce/themes/advanced', 561 'wp-includes/js/tinymce/tiny_mce.js', 562 'wp-includes/js/tinymce/mark_loaded_src.js', 563 'wp-includes/js/tinymce/wp-tinymce-schema.js', 564 'wp-includes/js/tinymce/plugins/media/editor_plugin.js', 565 'wp-includes/js/tinymce/plugins/media/editor_plugin_src.js', 566 'wp-includes/js/tinymce/plugins/media/media.htm', 567 'wp-includes/js/tinymce/plugins/wpview/editor_plugin_src.js', 568 'wp-includes/js/tinymce/plugins/wpview/editor_plugin.js', 569 'wp-includes/js/tinymce/plugins/directionality/editor_plugin.js', 570 'wp-includes/js/tinymce/plugins/directionality/editor_plugin_src.js', 571 'wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js', 572 'wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js', 573 'wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js', 574 'wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.js', 575 'wp-includes/js/tinymce/plugins/wpeditimage/editimage.html', 576 'wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js', 577 'wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js', 578 'wp-includes/js/tinymce/plugins/fullscreen/editor_plugin_src.js', 579 'wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm', 580 'wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js', 581 'wp-includes/js/tinymce/plugins/wplink/editor_plugin_src.js', 582 'wp-includes/js/tinymce/plugins/wplink/editor_plugin.js', 583 'wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js', 584 'wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js', 585 'wp-includes/js/tinymce/plugins/tabfocus/editor_plugin.js', 586 'wp-includes/js/tinymce/plugins/tabfocus/editor_plugin_src.js', 587 'wp-includes/js/tinymce/plugins/paste/editor_plugin.js', 588 'wp-includes/js/tinymce/plugins/paste/pasteword.htm', 589 'wp-includes/js/tinymce/plugins/paste/editor_plugin_src.js', 590 'wp-includes/js/tinymce/plugins/paste/pastetext.htm', 591 'wp-includes/js/tinymce/langs/wp-langs.php', 592 // 4.1 593 'wp-includes/js/jquery/ui/jquery.ui.accordion.min.js', 594 'wp-includes/js/jquery/ui/jquery.ui.autocomplete.min.js', 595 'wp-includes/js/jquery/ui/jquery.ui.button.min.js', 596 'wp-includes/js/jquery/ui/jquery.ui.core.min.js', 597 'wp-includes/js/jquery/ui/jquery.ui.datepicker.min.js', 598 'wp-includes/js/jquery/ui/jquery.ui.dialog.min.js', 599 'wp-includes/js/jquery/ui/jquery.ui.draggable.min.js', 600 'wp-includes/js/jquery/ui/jquery.ui.droppable.min.js', 601 'wp-includes/js/jquery/ui/jquery.ui.effect-blind.min.js', 602 'wp-includes/js/jquery/ui/jquery.ui.effect-bounce.min.js', 603 'wp-includes/js/jquery/ui/jquery.ui.effect-clip.min.js', 604 'wp-includes/js/jquery/ui/jquery.ui.effect-drop.min.js', 605 'wp-includes/js/jquery/ui/jquery.ui.effect-explode.min.js', 606 'wp-includes/js/jquery/ui/jquery.ui.effect-fade.min.js', 607 'wp-includes/js/jquery/ui/jquery.ui.effect-fold.min.js', 608 'wp-includes/js/jquery/ui/jquery.ui.effect-highlight.min.js', 609 'wp-includes/js/jquery/ui/jquery.ui.effect-pulsate.min.js', 610 'wp-includes/js/jquery/ui/jquery.ui.effect-scale.min.js', 611 'wp-includes/js/jquery/ui/jquery.ui.effect-shake.min.js', 612 'wp-includes/js/jquery/ui/jquery.ui.effect-slide.min.js', 613 'wp-includes/js/jquery/ui/jquery.ui.effect-transfer.min.js', 614 'wp-includes/js/jquery/ui/jquery.ui.effect.min.js', 615 'wp-includes/js/jquery/ui/jquery.ui.menu.min.js', 616 'wp-includes/js/jquery/ui/jquery.ui.mouse.min.js', 617 'wp-includes/js/jquery/ui/jquery.ui.position.min.js', 618 'wp-includes/js/jquery/ui/jquery.ui.progressbar.min.js', 619 'wp-includes/js/jquery/ui/jquery.ui.resizable.min.js', 620 'wp-includes/js/jquery/ui/jquery.ui.selectable.min.js', 621 'wp-includes/js/jquery/ui/jquery.ui.slider.min.js', 622 'wp-includes/js/jquery/ui/jquery.ui.sortable.min.js', 623 'wp-includes/js/jquery/ui/jquery.ui.spinner.min.js', 624 'wp-includes/js/jquery/ui/jquery.ui.tabs.min.js', 625 'wp-includes/js/jquery/ui/jquery.ui.tooltip.min.js', 626 'wp-includes/js/jquery/ui/jquery.ui.widget.min.js', 627 'wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png', 628 // 4.3 629 'wp-admin/js/wp-fullscreen.js', 630 'wp-admin/js/wp-fullscreen.min.js', 631 'wp-includes/js/tinymce/wp-mce-help.php', 632 'wp-includes/js/tinymce/plugins/wpfullscreen', 633 // 4.5 634 'wp-includes/theme-compat/comments-popup.php', 635 // 4.6 636 'wp-admin/includes/class-wp-automatic-upgrader.php', // Wrong file name, see #37628. 637 // 4.8 638 'wp-includes/js/tinymce/plugins/wpembed', 639 'wp-includes/js/tinymce/plugins/media/moxieplayer.swf', 640 'wp-includes/js/tinymce/skins/lightgray/fonts/readme.md', 641 'wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.json', 642 'wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.json', 643 'wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css', 644 // 4.9 645 'wp-admin/css/press-this-editor-rtl.css', 646 'wp-admin/css/press-this-editor-rtl.min.css', 647 'wp-admin/css/press-this-editor.css', 648 'wp-admin/css/press-this-editor.min.css', 649 'wp-admin/css/press-this-rtl.css', 650 'wp-admin/css/press-this-rtl.min.css', 651 'wp-admin/css/press-this.css', 652 'wp-admin/css/press-this.min.css', 653 'wp-admin/includes/class-wp-press-this.php', 654 'wp-admin/js/bookmarklet.js', 655 'wp-admin/js/bookmarklet.min.js', 656 'wp-admin/js/press-this.js', 657 'wp-admin/js/press-this.min.js', 658 'wp-includes/js/mediaelement/background.png', 659 'wp-includes/js/mediaelement/bigplay.png', 660 'wp-includes/js/mediaelement/bigplay.svg', 661 'wp-includes/js/mediaelement/controls.png', 662 'wp-includes/js/mediaelement/controls.svg', 663 'wp-includes/js/mediaelement/flashmediaelement.swf', 664 'wp-includes/js/mediaelement/froogaloop.min.js', 665 'wp-includes/js/mediaelement/jumpforward.png', 666 'wp-includes/js/mediaelement/loading.gif', 667 'wp-includes/js/mediaelement/silverlightmediaelement.xap', 668 'wp-includes/js/mediaelement/skipback.png', 669 'wp-includes/js/plupload/plupload.flash.swf', 670 'wp-includes/js/plupload/plupload.full.min.js', 671 'wp-includes/js/plupload/plupload.silverlight.xap', 672 'wp-includes/js/swfupload/plugins', 673 'wp-includes/js/swfupload/swfupload.swf', 674 // 4.9.2 675 'wp-includes/js/mediaelement/lang', 676 'wp-includes/js/mediaelement/mediaelement-flash-audio-ogg.swf', 677 'wp-includes/js/mediaelement/mediaelement-flash-audio.swf', 678 'wp-includes/js/mediaelement/mediaelement-flash-video-hls.swf', 679 'wp-includes/js/mediaelement/mediaelement-flash-video-mdash.swf', 680 'wp-includes/js/mediaelement/mediaelement-flash-video.swf', 681 'wp-includes/js/mediaelement/renderers/dailymotion.js', 682 'wp-includes/js/mediaelement/renderers/dailymotion.min.js', 683 'wp-includes/js/mediaelement/renderers/facebook.js', 684 'wp-includes/js/mediaelement/renderers/facebook.min.js', 685 'wp-includes/js/mediaelement/renderers/soundcloud.js', 686 'wp-includes/js/mediaelement/renderers/soundcloud.min.js', 687 'wp-includes/js/mediaelement/renderers/twitch.js', 688 'wp-includes/js/mediaelement/renderers/twitch.min.js', 689 // 5.0 690 'wp-includes/js/codemirror/jshint.js', 691 // 5.1 692 'wp-includes/js/tinymce/wp-tinymce.js.gz', 693 // 5.3 694 'wp-includes/js/wp-a11y.js', // Moved to: wp-includes/js/dist/a11y.js 695 'wp-includes/js/wp-a11y.min.js', // Moved to: wp-includes/js/dist/a11y.min.js 696 // 5.4 697 'wp-admin/js/wp-fullscreen-stub.js', 698 'wp-admin/js/wp-fullscreen-stub.min.js', 699 // 5.5 700 'wp-admin/css/ie.css', 701 'wp-admin/css/ie.min.css', 702 'wp-admin/css/ie-rtl.css', 703 'wp-admin/css/ie-rtl.min.css', 704 // 5.6 705 'wp-includes/js/jquery/ui/position.min.js', 706 'wp-includes/js/jquery/ui/widget.min.js', 707 // 5.7 708 'wp-includes/blocks/classic/block.json', 709 // 5.8 710 'wp-admin/images/freedoms.png', 711 'wp-admin/images/privacy.png', 712 'wp-admin/images/about-badge.svg', 713 'wp-admin/images/about-color-palette.svg', 714 'wp-admin/images/about-color-palette-vert.svg', 715 'wp-admin/images/about-header-brushes.svg', 716 'wp-includes/block-patterns/large-header.php', 717 'wp-includes/block-patterns/heading-paragraph.php', 718 'wp-includes/block-patterns/quote.php', 719 'wp-includes/block-patterns/text-three-columns-buttons.php', 720 'wp-includes/block-patterns/two-buttons.php', 721 'wp-includes/block-patterns/two-images.php', 722 'wp-includes/block-patterns/three-buttons.php', 723 'wp-includes/block-patterns/text-two-columns-with-images.php', 724 'wp-includes/block-patterns/text-two-columns.php', 725 'wp-includes/block-patterns/large-header-button.php', 726 'wp-includes/blocks/subhead', 727 'wp-includes/css/dist/editor/editor-styles.css', 728 'wp-includes/css/dist/editor/editor-styles.min.css', 729 'wp-includes/css/dist/editor/editor-styles-rtl.css', 730 'wp-includes/css/dist/editor/editor-styles-rtl.min.css', 731 // 5.9 732 'wp-includes/blocks/heading/editor.css', 733 'wp-includes/blocks/heading/editor.min.css', 734 'wp-includes/blocks/heading/editor-rtl.css', 735 'wp-includes/blocks/heading/editor-rtl.min.css', 736 'wp-includes/blocks/query-title/editor.css', 737 'wp-includes/blocks/query-title/editor.min.css', 738 'wp-includes/blocks/query-title/editor-rtl.css', 739 'wp-includes/blocks/query-title/editor-rtl.min.css', 740 'wp-includes/blocks/tag-cloud/editor.css', 741 'wp-includes/blocks/tag-cloud/editor.min.css', 742 'wp-includes/blocks/tag-cloud/editor-rtl.css', 743 'wp-includes/blocks/tag-cloud/editor-rtl.min.css', 744 // 6.1 745 'wp-includes/blocks/post-comments.php', 746 'wp-includes/blocks/post-comments', 747 'wp-includes/blocks/comments-query-loop', 748 // 6.3 749 'wp-includes/images/wlw', 750 'wp-includes/wlwmanifest.xml', 751 'wp-includes/random_compat', 752 // 6.4 753 'wp-includes/navigation-fallback.php', 754 'wp-includes/blocks/navigation/view-modal.min.js', 755 'wp-includes/blocks/navigation/view-modal.js', 756 // 6.5 757 'wp-includes/ID3/license.commercial.txt', 758 'wp-includes/blocks/query/style-rtl.min.css', 759 'wp-includes/blocks/query/style.min.css', 760 'wp-includes/blocks/query/style-rtl.css', 761 'wp-includes/blocks/query/style.css', 762 'wp-admin/images/about-header-privacy.svg', 763 'wp-admin/images/about-header-about.svg', 764 'wp-admin/images/about-header-credits.svg', 765 'wp-admin/images/about-header-freedoms.svg', 766 'wp-admin/images/about-header-contribute.svg', 767 'wp-admin/images/about-header-background.svg', 768 ); 769 770 /** 771 * Stores Requests files to be preloaded and deleted. 772 * 773 * For classes/interfaces, use the class/interface name 774 * as the array key. 775 * 776 * All other files/directories should not have a key. 777 * 778 * @since 6.2.0 779 * 780 * @global array $_old_requests_files 781 * @var array 782 * @name $_old_requests_files 783 */ 784 global $_old_requests_files; 785 786 $_old_requests_files = array( 787 // Interfaces. 788 'Requests_Auth' => 'wp-includes/Requests/Auth.php', 789 'Requests_Hooker' => 'wp-includes/Requests/Hooker.php', 790 'Requests_Proxy' => 'wp-includes/Requests/Proxy.php', 791 'Requests_Transport' => 'wp-includes/Requests/Transport.php', 792 793 // Classes. 794 'Requests_Auth_Basic' => 'wp-includes/Requests/Auth/Basic.php', 795 'Requests_Cookie_Jar' => 'wp-includes/Requests/Cookie/Jar.php', 796 'Requests_Exception_HTTP' => 'wp-includes/Requests/Exception/HTTP.php', 797 'Requests_Exception_Transport' => 'wp-includes/Requests/Exception/Transport.php', 798 'Requests_Exception_HTTP_304' => 'wp-includes/Requests/Exception/HTTP/304.php', 799 'Requests_Exception_HTTP_305' => 'wp-includes/Requests/Exception/HTTP/305.php', 800 'Requests_Exception_HTTP_306' => 'wp-includes/Requests/Exception/HTTP/306.php', 801 'Requests_Exception_HTTP_400' => 'wp-includes/Requests/Exception/HTTP/400.php', 802 'Requests_Exception_HTTP_401' => 'wp-includes/Requests/Exception/HTTP/401.php', 803 'Requests_Exception_HTTP_402' => 'wp-includes/Requests/Exception/HTTP/402.php', 804 'Requests_Exception_HTTP_403' => 'wp-includes/Requests/Exception/HTTP/403.php', 805 'Requests_Exception_HTTP_404' => 'wp-includes/Requests/Exception/HTTP/404.php', 806 'Requests_Exception_HTTP_405' => 'wp-includes/Requests/Exception/HTTP/405.php', 807 'Requests_Exception_HTTP_406' => 'wp-includes/Requests/Exception/HTTP/406.php', 808 'Requests_Exception_HTTP_407' => 'wp-includes/Requests/Exception/HTTP/407.php', 809 'Requests_Exception_HTTP_408' => 'wp-includes/Requests/Exception/HTTP/408.php', 810 'Requests_Exception_HTTP_409' => 'wp-includes/Requests/Exception/HTTP/409.php', 811 'Requests_Exception_HTTP_410' => 'wp-includes/Requests/Exception/HTTP/410.php', 812 'Requests_Exception_HTTP_411' => 'wp-includes/Requests/Exception/HTTP/411.php', 813 'Requests_Exception_HTTP_412' => 'wp-includes/Requests/Exception/HTTP/412.php', 814 'Requests_Exception_HTTP_413' => 'wp-includes/Requests/Exception/HTTP/413.php', 815 'Requests_Exception_HTTP_414' => 'wp-includes/Requests/Exception/HTTP/414.php', 816 'Requests_Exception_HTTP_415' => 'wp-includes/Requests/Exception/HTTP/415.php', 817 'Requests_Exception_HTTP_416' => 'wp-includes/Requests/Exception/HTTP/416.php', 818 'Requests_Exception_HTTP_417' => 'wp-includes/Requests/Exception/HTTP/417.php', 819 'Requests_Exception_HTTP_418' => 'wp-includes/Requests/Exception/HTTP/418.php', 820 'Requests_Exception_HTTP_428' => 'wp-includes/Requests/Exception/HTTP/428.php', 821 'Requests_Exception_HTTP_429' => 'wp-includes/Requests/Exception/HTTP/429.php', 822 'Requests_Exception_HTTP_431' => 'wp-includes/Requests/Exception/HTTP/431.php', 823 'Requests_Exception_HTTP_500' => 'wp-includes/Requests/Exception/HTTP/500.php', 824 'Requests_Exception_HTTP_501' => 'wp-includes/Requests/Exception/HTTP/501.php', 825 'Requests_Exception_HTTP_502' => 'wp-includes/Requests/Exception/HTTP/502.php', 826 'Requests_Exception_HTTP_503' => 'wp-includes/Requests/Exception/HTTP/503.php', 827 'Requests_Exception_HTTP_504' => 'wp-includes/Requests/Exception/HTTP/504.php', 828 'Requests_Exception_HTTP_505' => 'wp-includes/Requests/Exception/HTTP/505.php', 829 'Requests_Exception_HTTP_511' => 'wp-includes/Requests/Exception/HTTP/511.php', 830 'Requests_Exception_HTTP_Unknown' => 'wp-includes/Requests/Exception/HTTP/Unknown.php', 831 'Requests_Exception_Transport_cURL' => 'wp-includes/Requests/Exception/Transport/cURL.php', 832 'Requests_Proxy_HTTP' => 'wp-includes/Requests/Proxy/HTTP.php', 833 'Requests_Response_Headers' => 'wp-includes/Requests/Response/Headers.php', 834 'Requests_Transport_cURL' => 'wp-includes/Requests/Transport/cURL.php', 835 'Requests_Transport_fsockopen' => 'wp-includes/Requests/Transport/fsockopen.php', 836 'Requests_Utility_CaseInsensitiveDictionary' => 'wp-includes/Requests/Utility/CaseInsensitiveDictionary.php', 837 'Requests_Utility_FilteredIterator' => 'wp-includes/Requests/Utility/FilteredIterator.php', 838 'Requests_Cookie' => 'wp-includes/Requests/Cookie.php', 839 'Requests_Exception' => 'wp-includes/Requests/Exception.php', 840 'Requests_Hooks' => 'wp-includes/Requests/Hooks.php', 841 'Requests_IDNAEncoder' => 'wp-includes/Requests/IDNAEncoder.php', 842 'Requests_IPv6' => 'wp-includes/Requests/IPv6.php', 843 'Requests_IRI' => 'wp-includes/Requests/IRI.php', 844 'Requests_Response' => 'wp-includes/Requests/Response.php', 845 'Requests_SSL' => 'wp-includes/Requests/SSL.php', 846 'Requests_Session' => 'wp-includes/Requests/Session.php', 847 848 // Directories. 849 'wp-includes/Requests/Auth/', 850 'wp-includes/Requests/Cookie/', 851 'wp-includes/Requests/Exception/HTTP/', 852 'wp-includes/Requests/Exception/Transport/', 853 'wp-includes/Requests/Exception/', 854 'wp-includes/Requests/Proxy/', 855 'wp-includes/Requests/Response/', 856 'wp-includes/Requests/Transport/', 857 'wp-includes/Requests/Utility/', 858 ); 859 860 /** 861 * Stores new files in wp-content to copy 862 * 863 * The contents of this array indicate any new bundled plugins/themes which 864 * should be installed with the WordPress Upgrade. These items will not be 865 * re-installed in future upgrades, this behavior is controlled by the 866 * introduced version present here being older than the current installed version. 867 * 868 * The content of this array should follow the following format: 869 * Filename (relative to wp-content) => Introduced version 870 * Directories should be noted by suffixing it with a trailing slash (/) 871 * 872 * @since 3.2.0 873 * @since 4.7.0 New themes were not automatically installed for 4.4-4.6 on 874 * upgrade. New themes are now installed again. To disable new 875 * themes from being installed on upgrade, explicitly define 876 * CORE_UPGRADE_SKIP_NEW_BUNDLED as true. 877 * @global array $_new_bundled_files 878 * @var array 879 * @name $_new_bundled_files 880 */ 881 global $_new_bundled_files; 882 883 $_new_bundled_files = array( 884 'plugins/akismet/' => '2.0', 885 'themes/twentyten/' => '3.0', 886 'themes/twentyeleven/' => '3.2', 887 'themes/twentytwelve/' => '3.5', 888 'themes/twentythirteen/' => '3.6', 889 'themes/twentyfourteen/' => '3.8', 890 'themes/twentyfifteen/' => '4.1', 891 'themes/twentysixteen/' => '4.4', 892 'themes/twentyseventeen/' => '4.7', 893 'themes/twentynineteen/' => '5.0', 894 'themes/twentytwenty/' => '5.3', 895 'themes/twentytwentyone/' => '5.6', 896 'themes/twentytwentytwo/' => '5.9', 897 'themes/twentytwentythree/' => '6.1', 898 'themes/twentytwentyfour/' => '6.4', 899 ); 900 901 /** 902 * Upgrades the core of WordPress. 903 * 904 * This will create a .maintenance file at the base of the WordPress directory 905 * to ensure that people can not access the website, when the files are being 906 * copied to their locations. 907 * 908 * The files in the `$_old_files` list will be removed and the new files 909 * copied from the zip file after the database is upgraded. 910 * 911 * The files in the `$_new_bundled_files` list will be added to the installation 912 * if the version is greater than or equal to the old version being upgraded. 913 * 914 * The steps for the upgrader for after the new release is downloaded and 915 * unzipped is: 916 * 1. Test unzipped location for select files to ensure that unzipped worked. 917 * 2. Create the .maintenance file in current WordPress base. 918 * 3. Copy new WordPress directory over old WordPress files. 919 * 4. Upgrade WordPress to new version. 920 * 4.1. Copy all files/folders other than wp-content 921 * 4.2. Copy any language files to WP_LANG_DIR (which may differ from WP_CONTENT_DIR 922 * 4.3. Copy any new bundled themes/plugins to their respective locations 923 * 5. Delete new WordPress directory path. 924 * 6. Delete .maintenance file. 925 * 7. Remove old files. 926 * 8. Delete 'update_core' option. 927 * 928 * There are several areas of failure. For instance if PHP times out before step 929 * 6, then you will not be able to access any portion of your site. Also, since 930 * the upgrade will not continue where it left off, you will not be able to 931 * automatically remove old files and remove the 'update_core' option. This 932 * isn't that bad. 933 * 934 * If the copy of the new WordPress over the old fails, then the worse is that 935 * the new WordPress directory will remain. 936 * 937 * If it is assumed that every file will be copied over, including plugins and 938 * themes, then if you edit the default theme, you should rename it, so that 939 * your changes remain. 940 * 941 * @since 2.7.0 942 * 943 * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. 944 * @global array $_old_files 945 * @global array $_old_requests_files 946 * @global array $_new_bundled_files 947 * @global wpdb $wpdb WordPress database abstraction object. 948 * @global string $wp_version 949 * @global string $required_php_version 950 * @global string $required_mysql_version 951 * 952 * @param string $from New release unzipped path. 953 * @param string $to Path to old WordPress installation. 954 * @return string|WP_Error New WordPress version on success, WP_Error on failure. 955 */ 956 function update_core( $from, $to ) { 957 global $wp_filesystem, $_old_files, $_old_requests_files, $_new_bundled_files, $wpdb; 958 959 if ( function_exists( 'set_time_limit' ) ) { 960 set_time_limit( 300 ); 961 } 962 963 /* 964 * Merge the old Requests files and directories into the `$_old_files`. 965 * Then preload these Requests files first, before the files are deleted 966 * and replaced to ensure the code is in memory if needed. 967 */ 968 $_old_files = array_merge( $_old_files, array_values( $_old_requests_files ) ); 969 _preload_old_requests_classes_and_interfaces( $to ); 970 971 /** 972 * Filters feedback messages displayed during the core update process. 973 * 974 * The filter is first evaluated after the zip file for the latest version 975 * has been downloaded and unzipped. It is evaluated five more times during 976 * the process: 977 * 978 * 1. Before WordPress begins the core upgrade process. 979 * 2. Before Maintenance Mode is enabled. 980 * 3. Before WordPress begins copying over the necessary files. 981 * 4. Before Maintenance Mode is disabled. 982 * 5. Before the database is upgraded. 983 * 984 * @since 2.5.0 985 * 986 * @param string $feedback The core update feedback messages. 987 */ 988 apply_filters( 'update_feedback', __( 'Verifying the unpacked files…' ) ); 989 990 // Confidence check the unzipped distribution. 991 $distro = ''; 992 $roots = array( '/wordpress/', '/wordpress-mu/' ); 993 994 foreach ( $roots as $root ) { 995 if ( $wp_filesystem->exists( $from . $root . 'readme.html' ) 996 && $wp_filesystem->exists( $from . $root . 'wp-includes/version.php' ) 997 ) { 998 $distro = $root; 999 break; 1000 } 1001 } 1002 1003 if ( ! $distro ) { 1004 $wp_filesystem->delete( $from, true ); 1005 1006 return new WP_Error( 'insane_distro', __( 'The update could not be unpacked' ) ); 1007 } 1008 1009 /* 1010 * Import $wp_version, $required_php_version, and $required_mysql_version from the new version. 1011 * DO NOT globalize any variables imported from `version-current.php` in this function. 1012 * 1013 * BC Note: $wp_filesystem->wp_content_dir() returned unslashed pre-2.8. 1014 */ 1015 $versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php'; 1016 1017 if ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $versions_file ) ) { 1018 $wp_filesystem->delete( $from, true ); 1019 1020 return new WP_Error( 1021 'copy_failed_for_version_file', 1022 __( 'The update cannot be installed because some files could not be copied. This is usually due to inconsistent file permissions.' ), 1023 'wp-includes/version.php' 1024 ); 1025 } 1026 1027 $wp_filesystem->chmod( $versions_file, FS_CHMOD_FILE ); 1028 1029 /* 1030 * `wp_opcache_invalidate()` only exists in WordPress 5.5 or later, 1031 * so don't run it when upgrading from older versions. 1032 */ 1033 if ( function_exists( 'wp_opcache_invalidate' ) ) { 1034 wp_opcache_invalidate( $versions_file ); 1035 } 1036 1037 require WP_CONTENT_DIR . '/upgrade/version-current.php'; 1038 $wp_filesystem->delete( $versions_file ); 1039 1040 $php_version = PHP_VERSION; 1041 $mysql_version = $wpdb->db_version(); 1042 $old_wp_version = $GLOBALS['wp_version']; // The version of WordPress we're updating from. 1043 /* 1044 * Note: str_contains() is not used here, as this file is included 1045 * when updating from older WordPress versions, in which case 1046 * the polyfills from wp-includes/compat.php may not be available. 1047 */ 1048 $development_build = ( false !== strpos( $old_wp_version . $wp_version, '-' ) ); // A dash in the version indicates a development release. 1049 $php_compat = version_compare( $php_version, $required_php_version, '>=' ); 1050 1051 if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) { 1052 $mysql_compat = true; 1053 } else { 1054 $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ); 1055 } 1056 1057 if ( ! $mysql_compat || ! $php_compat ) { 1058 $wp_filesystem->delete( $from, true ); 1059 } 1060 1061 $php_update_message = ''; 1062 1063 if ( function_exists( 'wp_get_update_php_url' ) ) { 1064 $php_update_message = '</p><p>' . sprintf( 1065 /* translators: %s: URL to Update PHP page. */ 1066 __( '<a href="%s">Learn more about updating PHP</a>.' ), 1067 esc_url( wp_get_update_php_url() ) 1068 ); 1069 1070 if ( function_exists( 'wp_get_update_php_annotation' ) ) { 1071 $annotation = wp_get_update_php_annotation(); 1072 1073 if ( $annotation ) { 1074 $php_update_message .= '</p><p><em>' . $annotation . '</em>'; 1075 } 1076 } 1077 } 1078 1079 if ( ! $mysql_compat && ! $php_compat ) { 1080 return new WP_Error( 1081 'php_mysql_not_compatible', 1082 sprintf( 1083 /* 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. */ 1084 __( '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.' ), 1085 $wp_version, 1086 $required_php_version, 1087 $required_mysql_version, 1088 $php_version, 1089 $mysql_version 1090 ) . $php_update_message 1091 ); 1092 } elseif ( ! $php_compat ) { 1093 return new WP_Error( 1094 'php_not_compatible', 1095 sprintf( 1096 /* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Current PHP version number. */ 1097 __( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.' ), 1098 $wp_version, 1099 $required_php_version, 1100 $php_version 1101 ) . $php_update_message 1102 ); 1103 } elseif ( ! $mysql_compat ) { 1104 return new WP_Error( 1105 'mysql_not_compatible', 1106 sprintf( 1107 /* translators: 1: WordPress version number, 2: Minimum required MySQL version number, 3: Current MySQL version number. */ 1108 __( 'The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.' ), 1109 $wp_version, 1110 $required_mysql_version, 1111 $mysql_version 1112 ) 1113 ); 1114 } 1115 1116 // Add a warning when the JSON PHP extension is missing. 1117 if ( ! extension_loaded( 'json' ) ) { 1118 return new WP_Error( 1119 'php_not_compatible_json', 1120 sprintf( 1121 /* translators: 1: WordPress version number, 2: The PHP extension name needed. */ 1122 __( 'The update cannot be installed because WordPress %1$s requires the %2$s PHP extension.' ), 1123 $wp_version, 1124 'JSON' 1125 ) 1126 ); 1127 } 1128 1129 /** This filter is documented in wp-admin/includes/update-core.php */ 1130 apply_filters( 'update_feedback', __( 'Preparing to install the latest version…' ) ); 1131 1132 /* 1133 * Don't copy wp-content, we'll deal with that below. 1134 * We also copy version.php last so failed updates report their old version. 1135 */ 1136 $skip = array( 'wp-content', 'wp-includes/version.php' ); 1137 $check_is_writable = array(); 1138 1139 // Check to see which files don't really need updating - only available for 3.7 and higher. 1140 if ( function_exists( 'get_core_checksums' ) ) { 1141 // Find the local version of the working directory. 1142 $working_dir_local = WP_CONTENT_DIR . '/upgrade/' . basename( $from ) . $distro; 1143 1144 $checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' ); 1145 1146 if ( is_array( $checksums ) && isset( $checksums[ $wp_version ] ) ) { 1147 $checksums = $checksums[ $wp_version ]; // Compat code for 3.7-beta2. 1148 } 1149 1150 if ( is_array( $checksums ) ) { 1151 foreach ( $checksums as $file => $checksum ) { 1152 /* 1153 * Note: str_starts_with() is not used here, as this file is included 1154 * when updating from older WordPress versions, in which case 1155 * the polyfills from wp-includes/compat.php may not be available. 1156 */ 1157 if ( 'wp-content' === substr( $file, 0, 10 ) ) { 1158 continue; 1159 } 1160 1161 if ( ! file_exists( ABSPATH . $file ) ) { 1162 continue; 1163 } 1164 1165 if ( ! file_exists( $working_dir_local . $file ) ) { 1166 continue; 1167 } 1168 1169 if ( '.' === dirname( $file ) 1170 && in_array( pathinfo( $file, PATHINFO_EXTENSION ), array( 'html', 'txt' ), true ) 1171 ) { 1172 continue; 1173 } 1174 1175 if ( md5_file( ABSPATH . $file ) === $checksum ) { 1176 $skip[] = $file; 1177 } else { 1178 $check_is_writable[ $file ] = ABSPATH . $file; 1179 } 1180 } 1181 } 1182 } 1183 1184 // If we're using the direct method, we can predict write failures that are due to permissions. 1185 if ( $check_is_writable && 'direct' === $wp_filesystem->method ) { 1186 $files_writable = array_filter( $check_is_writable, array( $wp_filesystem, 'is_writable' ) ); 1187 1188 if ( $files_writable !== $check_is_writable ) { 1189 $files_not_writable = array_diff_key( $check_is_writable, $files_writable ); 1190 1191 foreach ( $files_not_writable as $relative_file_not_writable => $file_not_writable ) { 1192 // If the writable check failed, chmod file to 0644 and try again, same as copy_dir(). 1193 $wp_filesystem->chmod( $file_not_writable, FS_CHMOD_FILE ); 1194 1195 if ( $wp_filesystem->is_writable( $file_not_writable ) ) { 1196 unset( $files_not_writable[ $relative_file_not_writable ] ); 1197 } 1198 } 1199 1200 // Store package-relative paths (the key) of non-writable files in the WP_Error object. 1201 $error_data = version_compare( $old_wp_version, '3.7-beta2', '>' ) ? array_keys( $files_not_writable ) : ''; 1202 1203 if ( $files_not_writable ) { 1204 return new WP_Error( 1205 'files_not_writable', 1206 __( 'The update cannot be installed because your site is unable to copy some files. This is usually due to inconsistent file permissions.' ), 1207 implode( ', ', $error_data ) 1208 ); 1209 } 1210 } 1211 } 1212 1213 /** This filter is documented in wp-admin/includes/update-core.php */ 1214 apply_filters( 'update_feedback', __( 'Enabling Maintenance mode…' ) ); 1215 1216 // Create maintenance file to signal that we are upgrading. 1217 $maintenance_string = '<?php $upgrading = ' . time() . '; ?>'; 1218 $maintenance_file = $to . '.maintenance'; 1219 $wp_filesystem->delete( $maintenance_file ); 1220 $wp_filesystem->put_contents( $maintenance_file, $maintenance_string, FS_CHMOD_FILE ); 1221 1222 /** This filter is documented in wp-admin/includes/update-core.php */ 1223 apply_filters( 'update_feedback', __( 'Copying the required files…' ) ); 1224 1225 // Copy new versions of WP files into place. 1226 $result = copy_dir( $from . $distro, $to, $skip ); 1227 1228 if ( is_wp_error( $result ) ) { 1229 $result = new WP_Error( 1230 $result->get_error_code(), 1231 $result->get_error_message(), 1232 substr( $result->get_error_data(), strlen( $to ) ) 1233 ); 1234 } 1235 1236 // Since we know the core files have copied over, we can now copy the version file. 1237 if ( ! is_wp_error( $result ) ) { 1238 if ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $to . 'wp-includes/version.php', true /* overwrite */ ) ) { 1239 $wp_filesystem->delete( $from, true ); 1240 $result = new WP_Error( 1241 'copy_failed_for_version_file', 1242 __( 'The update cannot be installed because your site is unable to copy some files. This is usually due to inconsistent file permissions.' ), 1243 'wp-includes/version.php' 1244 ); 1245 } 1246 1247 $wp_filesystem->chmod( $to . 'wp-includes/version.php', FS_CHMOD_FILE ); 1248 1249 /* 1250 * `wp_opcache_invalidate()` only exists in WordPress 5.5 or later, 1251 * so don't run it when upgrading from older versions. 1252 */ 1253 if ( function_exists( 'wp_opcache_invalidate' ) ) { 1254 wp_opcache_invalidate( $to . 'wp-includes/version.php' ); 1255 } 1256 } 1257 1258 // Check to make sure everything copied correctly, ignoring the contents of wp-content. 1259 $skip = array( 'wp-content' ); 1260 $failed = array(); 1261 1262 if ( isset( $checksums ) && is_array( $checksums ) ) { 1263 foreach ( $checksums as $file => $checksum ) { 1264 /* 1265 * Note: str_starts_with() is not used here, as this file is included 1266 * when updating from older WordPress versions, in which case 1267 * the polyfills from wp-includes/compat.php may not be available. 1268 */ 1269 if ( 'wp-content' === substr( $file, 0, 10 ) ) { 1270 continue; 1271 } 1272 1273 if ( ! file_exists( $working_dir_local . $file ) ) { 1274 continue; 1275 } 1276 1277 if ( '.' === dirname( $file ) 1278 && in_array( pathinfo( $file, PATHINFO_EXTENSION ), array( 'html', 'txt' ), true ) 1279 ) { 1280 $skip[] = $file; 1281 continue; 1282 } 1283 1284 if ( file_exists( ABSPATH . $file ) && md5_file( ABSPATH . $file ) === $checksum ) { 1285 $skip[] = $file; 1286 } else { 1287 $failed[] = $file; 1288 } 1289 } 1290 } 1291 1292 // Some files didn't copy properly. 1293 if ( ! empty( $failed ) ) { 1294 $total_size = 0; 1295 1296 foreach ( $failed as $file ) { 1297 if ( file_exists( $working_dir_local . $file ) ) { 1298 $total_size += filesize( $working_dir_local . $file ); 1299 } 1300 } 1301 1302 /* 1303 * If we don't have enough free space, it isn't worth trying again. 1304 * Unlikely to be hit due to the check in unzip_file(). 1305 */ 1306 $available_space = function_exists( 'disk_free_space' ) ? @disk_free_space( ABSPATH ) : false; 1307 1308 if ( $available_space && $total_size >= $available_space ) { 1309 $result = new WP_Error( 'disk_full', __( 'There is not enough free disk space to complete the update.' ) ); 1310 } else { 1311 $result = copy_dir( $from . $distro, $to, $skip ); 1312 1313 if ( is_wp_error( $result ) ) { 1314 $result = new WP_Error( 1315 $result->get_error_code() . '_retry', 1316 $result->get_error_message(), 1317 substr( $result->get_error_data(), strlen( $to ) ) 1318 ); 1319 } 1320 } 1321 } 1322 1323 /* 1324 * Custom content directory needs updating now. 1325 * Copy languages. 1326 */ 1327 if ( ! is_wp_error( $result ) && $wp_filesystem->is_dir( $from . $distro . 'wp-content/languages' ) ) { 1328 if ( WP_LANG_DIR !== ABSPATH . WPINC . '/languages' || @is_dir( WP_LANG_DIR ) ) { 1329 $lang_dir = WP_LANG_DIR; 1330 } else { 1331 $lang_dir = WP_CONTENT_DIR . '/languages'; 1332 } 1333 /* 1334 * Note: str_starts_with() is not used here, as this file is included 1335 * when updating from older WordPress versions, in which case 1336 * the polyfills from wp-includes/compat.php may not be available. 1337 */ 1338 // Check if the language directory exists first. 1339 if ( ! @is_dir( $lang_dir ) && 0 === strpos( $lang_dir, ABSPATH ) ) { 1340 // If it's within the ABSPATH we can handle it here, otherwise they're out of luck. 1341 $wp_filesystem->mkdir( $to . str_replace( ABSPATH, '', $lang_dir ), FS_CHMOD_DIR ); 1342 clearstatcache(); // For FTP, need to clear the stat cache. 1343 } 1344 1345 if ( @is_dir( $lang_dir ) ) { 1346 $wp_lang_dir = $wp_filesystem->find_folder( $lang_dir ); 1347 1348 if ( $wp_lang_dir ) { 1349 $result = copy_dir( $from . $distro . 'wp-content/languages/', $wp_lang_dir ); 1350 1351 if ( is_wp_error( $result ) ) { 1352 $result = new WP_Error( 1353 $result->get_error_code() . '_languages', 1354 $result->get_error_message(), 1355 substr( $result->get_error_data(), strlen( $wp_lang_dir ) ) 1356 ); 1357 } 1358 } 1359 } 1360 } 1361 1362 /** This filter is documented in wp-admin/includes/update-core.php */ 1363 apply_filters( 'update_feedback', __( 'Disabling Maintenance mode…' ) ); 1364 1365 // Remove maintenance file, we're done with potential site-breaking changes. 1366 $wp_filesystem->delete( $maintenance_file ); 1367 1368 /* 1369 * 3.5 -> 3.5+ - an empty twentytwelve directory was created upon upgrade to 3.5 for some users, 1370 * preventing installation of Twenty Twelve. 1371 */ 1372 if ( '3.5' === $old_wp_version ) { 1373 if ( is_dir( WP_CONTENT_DIR . '/themes/twentytwelve' ) 1374 && ! file_exists( WP_CONTENT_DIR . '/themes/twentytwelve/style.css' ) 1375 ) { 1376 $wp_filesystem->delete( $wp_filesystem->wp_themes_dir() . 'twentytwelve/' ); 1377 } 1378 } 1379 1380 /* 1381 * Copy new bundled plugins & themes. 1382 * This gives us the ability to install new plugins & themes bundled with 1383 * future versions of WordPress whilst avoiding the re-install upon upgrade issue. 1384 * $development_build controls us overwriting bundled themes and plugins when a non-stable release is being updated. 1385 */ 1386 if ( ! is_wp_error( $result ) 1387 && ( ! defined( 'CORE_UPGRADE_SKIP_NEW_BUNDLED' ) || ! CORE_UPGRADE_SKIP_NEW_BUNDLED ) 1388 ) { 1389 foreach ( (array) $_new_bundled_files as $file => $introduced_version ) { 1390 // If a $development_build or if $introduced version is greater than what the site was previously running. 1391 if ( $development_build || version_compare( $introduced_version, $old_wp_version, '>' ) ) { 1392 $directory = ( '/' === $file[ strlen( $file ) - 1 ] ); 1393 1394 list( $type, $filename ) = explode( '/', $file, 2 ); 1395 1396 // Check to see if the bundled items exist before attempting to copy them. 1397 if ( ! $wp_filesystem->exists( $from . $distro . 'wp-content/' . $file ) ) { 1398 continue; 1399 } 1400 1401 if ( 'plugins' === $type ) { 1402 $dest = $wp_filesystem->wp_plugins_dir(); 1403 } elseif ( 'themes' === $type ) { 1404 // Back-compat, ::wp_themes_dir() did not return trailingslash'd pre-3.2. 1405 $dest = trailingslashit( $wp_filesystem->wp_themes_dir() ); 1406 } else { 1407 continue; 1408 } 1409 1410 if ( ! $directory ) { 1411 if ( ! $development_build && $wp_filesystem->exists( $dest . $filename ) ) { 1412 continue; 1413 } 1414 1415 if ( ! $wp_filesystem->copy( $from . $distro . 'wp-content/' . $file, $dest . $filename, FS_CHMOD_FILE ) ) { 1416 $result = new WP_Error( "copy_failed_for_new_bundled_$type", __( 'Could not copy file.' ), $dest . $filename ); 1417 } 1418 } else { 1419 if ( ! $development_build && $wp_filesystem->is_dir( $dest . $filename ) ) { 1420 continue; 1421 } 1422 1423 $wp_filesystem->mkdir( $dest . $filename, FS_CHMOD_DIR ); 1424 $_result = copy_dir( $from . $distro . 'wp-content/' . $file, $dest . $filename ); 1425 1426 /* 1427 * If an error occurs partway through this final step, 1428 * keep the error flowing through, but keep the process going. 1429 */ 1430 if ( is_wp_error( $_result ) ) { 1431 if ( ! is_wp_error( $result ) ) { 1432 $result = new WP_Error(); 1433 } 1434 1435 $result->add( 1436 $_result->get_error_code() . "_$type", 1437 $_result->get_error_message(), 1438 substr( $_result->get_error_data(), strlen( $dest ) ) 1439 ); 1440 } 1441 } 1442 } 1443 } // End foreach. 1444 } 1445 1446 // Handle $result error from the above blocks. 1447 if ( is_wp_error( $result ) ) { 1448 $wp_filesystem->delete( $from, true ); 1449 1450 return $result; 1451 } 1452 1453 // Remove old files. 1454 foreach ( $_old_files as $old_file ) { 1455 $old_file = $to . $old_file; 1456 1457 if ( ! $wp_filesystem->exists( $old_file ) ) { 1458 continue; 1459 } 1460 1461 // If the file isn't deleted, try writing an empty string to the file instead. 1462 if ( ! $wp_filesystem->delete( $old_file, true ) && $wp_filesystem->is_file( $old_file ) ) { 1463 $wp_filesystem->put_contents( $old_file, '' ); 1464 } 1465 } 1466 1467 // Remove any Genericons example.html's from the filesystem. 1468 _upgrade_422_remove_genericons(); 1469 1470 // Deactivate the REST API plugin if its version is 2.0 Beta 4 or lower. 1471 _upgrade_440_force_deactivate_incompatible_plugins(); 1472 1473 // Deactivate incompatible plugins. 1474 _upgrade_core_deactivate_incompatible_plugins(); 1475 1476 // Upgrade DB with separate request. 1477 /** This filter is documented in wp-admin/includes/update-core.php */ 1478 apply_filters( 'update_feedback', __( 'Upgrading database…' ) ); 1479 1480 $db_upgrade_url = admin_url( 'upgrade.php?step=upgrade_db' ); 1481 wp_remote_post( $db_upgrade_url, array( 'timeout' => 60 ) ); 1482 1483 // Clear the cache to prevent an update_option() from saving a stale db_version to the cache. 1484 wp_cache_flush(); 1485 // Not all cache back ends listen to 'flush'. 1486 wp_cache_delete( 'alloptions', 'options' ); 1487 1488 // Remove working directory. 1489 $wp_filesystem->delete( $from, true ); 1490 1491 // Force refresh of update information. 1492 if ( function_exists( 'delete_site_transient' ) ) { 1493 delete_site_transient( 'update_core' ); 1494 } else { 1495 delete_option( 'update_core' ); 1496 } 1497 1498 /** 1499 * Fires after WordPress core has been successfully updated. 1500 * 1501 * @since 3.3.0 1502 * 1503 * @param string $wp_version The current WordPress version. 1504 */ 1505 do_action( '_core_updated_successfully', $wp_version ); 1506 1507 // Clear the option that blocks auto-updates after failures, now that we've been successful. 1508 if ( function_exists( 'delete_site_option' ) ) { 1509 delete_site_option( 'auto_core_update_failed' ); 1510 } 1511 1512 return $wp_version; 1513 } 1514 1515 /** 1516 * Preloads old Requests classes and interfaces. 1517 * 1518 * This function preloads the old Requests code into memory before the 1519 * upgrade process deletes the files. Why? Requests code is loaded into 1520 * memory via an autoloader, meaning when a class or interface is needed 1521 * If a request is in process, Requests could attempt to access code. If 1522 * the file is not there, a fatal error could occur. If the file was 1523 * replaced, the new code is not compatible with the old, resulting in 1524 * a fatal error. Preloading ensures the code is in memory before the 1525 * code is updated. 1526 * 1527 * @since 6.2.0 1528 * 1529 * @global array $_old_requests_files Requests files to be preloaded. 1530 * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. 1531 * @global string $wp_version The WordPress version string. 1532 * 1533 * @param string $to Path to old WordPress installation. 1534 */ 1535 function _preload_old_requests_classes_and_interfaces( $to ) { 1536 global $_old_requests_files, $wp_filesystem, $wp_version; 1537 1538 /* 1539 * Requests was introduced in WordPress 4.6. 1540 * 1541 * Skip preloading if the website was previously using 1542 * an earlier version of WordPress. 1543 */ 1544 if ( version_compare( $wp_version, '4.6', '<' ) ) { 1545 return; 1546 } 1547 1548 if ( ! defined( 'REQUESTS_SILENCE_PSR0_DEPRECATIONS' ) ) { 1549 define( 'REQUESTS_SILENCE_PSR0_DEPRECATIONS', true ); 1550 } 1551 1552 foreach ( $_old_requests_files as $name => $file ) { 1553 // Skip files that aren't interfaces or classes. 1554 if ( is_int( $name ) ) { 1555 continue; 1556 } 1557 1558 // Skip if it's already loaded. 1559 if ( class_exists( $name ) || interface_exists( $name ) ) { 1560 continue; 1561 } 1562 1563 // Skip if the file is missing. 1564 if ( ! $wp_filesystem->is_file( $to . $file ) ) { 1565 continue; 1566 } 1567 1568 require_once $to . $file; 1569 } 1570 } 1571 1572 /** 1573 * Redirect to the About WordPress page after a successful upgrade. 1574 * 1575 * This function is only needed when the existing installation is older than 3.4.0. 1576 * 1577 * @since 3.3.0 1578 * 1579 * @global string $wp_version The WordPress version string. 1580 * @global string $pagenow The filename of the current screen. 1581 * @global string $action 1582 * 1583 * @param string $new_version 1584 */ 1585 function _redirect_to_about_wordpress( $new_version ) { 1586 global $wp_version, $pagenow, $action; 1587 1588 if ( version_compare( $wp_version, '3.4-RC1', '>=' ) ) { 1589 return; 1590 } 1591 1592 // Ensure we only run this on the update-core.php page. The Core_Upgrader may be used in other contexts. 1593 if ( 'update-core.php' !== $pagenow ) { 1594 return; 1595 } 1596 1597 if ( 'do-core-upgrade' !== $action && 'do-core-reinstall' !== $action ) { 1598 return; 1599 } 1600 1601 // Load the updated default text localization domain for new strings. 1602 load_default_textdomain(); 1603 1604 // See do_core_upgrade(). 1605 show_message( __( 'WordPress updated successfully.' ) ); 1606 1607 // self_admin_url() won't exist when upgrading from <= 3.0, so relative URLs are intentional. 1608 show_message( 1609 '<span class="hide-if-no-js">' . sprintf( 1610 /* translators: 1: WordPress version, 2: URL to About screen. */ 1611 __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href="%2$s">here</a>.' ), 1612 $new_version, 1613 'about.php?updated' 1614 ) . '</span>' 1615 ); 1616 show_message( 1617 '<span class="hide-if-js">' . sprintf( 1618 /* translators: 1: WordPress version, 2: URL to About screen. */ 1619 __( 'Welcome to WordPress %1$s. <a href="%2$s">Learn more</a>.' ), 1620 $new_version, 1621 'about.php?updated' 1622 ) . '</span>' 1623 ); 1624 echo '</div>'; 1625 ?> 1626 <script type="text/javascript"> 1627 window.location = 'about.php?updated'; 1628 </script> 1629 <?php 1630 1631 // Include admin-footer.php and exit. 1632 require_once ABSPATH . 'wp-admin/admin-footer.php'; 1633 exit; 1634 } 1635 1636 /** 1637 * Cleans up Genericons example files. 1638 * 1639 * @since 4.2.2 1640 * 1641 * @global array $wp_theme_directories 1642 * @global WP_Filesystem_Base $wp_filesystem 1643 */ 1644 function _upgrade_422_remove_genericons() { 1645 global $wp_theme_directories, $wp_filesystem; 1646 1647 // A list of the affected files using the filesystem absolute paths. 1648 $affected_files = array(); 1649 1650 // Themes. 1651 foreach ( $wp_theme_directories as $directory ) { 1652 $affected_theme_files = _upgrade_422_find_genericons_files_in_folder( $directory ); 1653 $affected_files = array_merge( $affected_files, $affected_theme_files ); 1654 } 1655 1656 // Plugins. 1657 $affected_plugin_files = _upgrade_422_find_genericons_files_in_folder( WP_PLUGIN_DIR ); 1658 $affected_files = array_merge( $affected_files, $affected_plugin_files ); 1659 1660 foreach ( $affected_files as $file ) { 1661 $gen_dir = $wp_filesystem->find_folder( trailingslashit( dirname( $file ) ) ); 1662 1663 if ( empty( $gen_dir ) ) { 1664 continue; 1665 } 1666 1667 // The path when the file is accessed via WP_Filesystem may differ in the case of FTP. 1668 $remote_file = $gen_dir . basename( $file ); 1669 1670 if ( ! $wp_filesystem->exists( $remote_file ) ) { 1671 continue; 1672 } 1673 1674 if ( ! $wp_filesystem->delete( $remote_file, false, 'f' ) ) { 1675 $wp_filesystem->put_contents( $remote_file, '' ); 1676 } 1677 } 1678 } 1679 1680 /** 1681 * Recursively find Genericons example files in a given folder. 1682 * 1683 * @ignore 1684 * @since 4.2.2 1685 * 1686 * @param string $directory Directory path. Expects trailingslashed. 1687 * @return array 1688 */ 1689 function _upgrade_422_find_genericons_files_in_folder( $directory ) { 1690 $directory = trailingslashit( $directory ); 1691 $files = array(); 1692 1693 if ( file_exists( "{$directory}example.html" ) 1694 /* 1695 * Note: str_contains() is not used here, as this file is included 1696 * when updating from older WordPress versions, in which case 1697 * the polyfills from wp-includes/compat.php may not be available. 1698 */ 1699 && false !== strpos( file_get_contents( "{$directory}example.html" ), '<title>Genericons</title>' ) 1700 ) { 1701 $files[] = "{$directory}example.html"; 1702 } 1703 1704 $dirs = glob( $directory . '*', GLOB_ONLYDIR ); 1705 $dirs = array_filter( 1706 $dirs, 1707 static function ( $dir ) { 1708 /* 1709 * Skip any node_modules directories. 1710 * 1711 * Note: str_contains() is not used here, as this file is included 1712 * when updating from older WordPress versions, in which case 1713 * the polyfills from wp-includes/compat.php may not be available. 1714 */ 1715 return false === strpos( $dir, 'node_modules' ); 1716 } 1717 ); 1718 1719 if ( $dirs ) { 1720 foreach ( $dirs as $dir ) { 1721 $files = array_merge( $files, _upgrade_422_find_genericons_files_in_folder( $dir ) ); 1722 } 1723 } 1724 1725 return $files; 1726 } 1727 1728 /** 1729 * @ignore 1730 * @since 4.4.0 1731 */ 1732 function _upgrade_440_force_deactivate_incompatible_plugins() { 1733 if ( defined( 'REST_API_VERSION' ) && version_compare( REST_API_VERSION, '2.0-beta4', '<=' ) ) { 1734 deactivate_plugins( array( 'rest-api/plugin.php' ), true ); 1735 } 1736 } 1737 1738 /** 1739 * @access private 1740 * @ignore 1741 * @since 5.8.0 1742 * @since 5.9.0 The minimum compatible version of Gutenberg is 11.9. 1743 * @since 6.1.1 The minimum compatible version of Gutenberg is 14.1. 1744 * @since 6.4.0 The minimum compatible version of Gutenberg is 16.5. 1745 * @since 6.5.0 The minimum compatible version of Gutenberg is 17.6. 1746 */ 1747 function _upgrade_core_deactivate_incompatible_plugins() { 1748 if ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '17.6', '<' ) ) { 1749 $deactivated_gutenberg['gutenberg'] = array( 1750 'plugin_name' => 'Gutenberg', 1751 'version_deactivated' => GUTENBERG_VERSION, 1752 'version_compatible' => '17.6', 1753 ); 1754 if ( is_plugin_active_for_network( 'gutenberg/gutenberg.php' ) ) { 1755 $deactivated_plugins = get_site_option( 'wp_force_deactivated_plugins', array() ); 1756 $deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg ); 1757 update_site_option( 'wp_force_deactivated_plugins', $deactivated_plugins ); 1758 } else { 1759 $deactivated_plugins = get_option( 'wp_force_deactivated_plugins', array() ); 1760 $deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg ); 1761 update_option( 'wp_force_deactivated_plugins', $deactivated_plugins ); 1762 } 1763 deactivate_plugins( array( 'gutenberg/gutenberg.php' ), true ); 1764 } 1765 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Sat Apr 20 08:20:01 2024 | Cross-referenced by PHPXref |