Keine Beschreibung

update-core.php 62KB

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