Make WordPress Core

Changeset 57598


Ignore:
Timestamp:
02/12/2024 04:51:48 PM (3 months ago)
Author:
davidbaumwald
Message:

Upgrade/Install: Remove unnecessary individual subfiles from $_old_files array.

On upgrade, the $_old_files array is used to cleanup any files that exist in a previous version of core but are no longer present in the current version. Sometimes, an entire directory should be removed. In the past, when a parent directory was included in the array, subfiles were also included for good measure.

However, the code that removes the old files uses $wp_filesystem->delete() with the $recursive parameter set to true. With this setup, individual subfiles are not required to be individually listed when their parent directory is already included in the $_old_files array.

This commit removes all individual subfiles from the $_old_files array when their parent directory is already included.

Props SergeyBiryukov, mhshohel, pbiron, oglekler.
Fixes #58995.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/update-core.php

    r57578 r57598  
    3838    'wp-images/wpminilogo.png',
    3939    'wp.php',
    40     // 2.0.8
    41     'wp-includes/js/tinymce/plugins/inlinepopups/readme.txt',
    4240    // 2.1
    4341    'wp-admin/edit-form-ajax-cat.php',
     
    5351    'wp-includes/functions-post.php',
    5452    'wp-includes/js/dbx-key.js',
    55     'wp-includes/js/tinymce/plugins/autosave/langs/cs.js',
    56     'wp-includes/js/tinymce/plugins/autosave/langs/sv.js',
    5753    'wp-includes/links.php',
    5854    'wp-includes/pluggable-functions.php',
     
    6561    // 2.2
    6662    'wp-admin/cat-js.php',
    67     'wp-admin/import/b2.php',
    6863    'wp-includes/js/autosave-js.php',
    6964    'wp-includes/js/list-manipulation-js.php',
     
    109104    'wp-admin/profile-update.php',
    110105    'wp-admin/templates.php',
    111     'wp-includes/images/wlw/WpComments.png',
    112     'wp-includes/images/wlw/WpIcon.png',
    113     'wp-includes/images/wlw/WpWatermark.png',
    114106    'wp-includes/js/dbx.js',
    115107    'wp-includes/js/fat.js',
    116108    'wp-includes/js/list-manipulation.js',
    117109    'wp-includes/js/tinymce/langs/en.js',
    118     'wp-includes/js/tinymce/plugins/autosave/editor_plugin_src.js',
    119     'wp-includes/js/tinymce/plugins/autosave/langs',
    120110    'wp-includes/js/tinymce/plugins/directionality/images',
    121111    'wp-includes/js/tinymce/plugins/directionality/langs',
    122     'wp-includes/js/tinymce/plugins/inlinepopups/css',
    123     'wp-includes/js/tinymce/plugins/inlinepopups/images',
    124     'wp-includes/js/tinymce/plugins/inlinepopups/jscripts',
    125112    'wp-includes/js/tinymce/plugins/paste/images',
    126113    'wp-includes/js/tinymce/plugins/paste/jscripts',
    127114    'wp-includes/js/tinymce/plugins/paste/langs',
    128     'wp-includes/js/tinymce/plugins/spellchecker/classes/HttpClient.class.php',
    129     'wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php',
    130     'wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php',
    131     'wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php',
    132     'wp-includes/js/tinymce/plugins/spellchecker/css/spellchecker.css',
    133     'wp-includes/js/tinymce/plugins/spellchecker/images',
    134     'wp-includes/js/tinymce/plugins/spellchecker/langs',
    135     'wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php',
    136115    'wp-includes/js/tinymce/plugins/wordpress/images',
    137116    'wp-includes/js/tinymce/plugins/wordpress/langs',
    138117    'wp-includes/js/tinymce/plugins/wordpress/wordpress.css',
    139118    'wp-includes/js/tinymce/plugins/wphelp',
    140     'wp-includes/js/tinymce/themes/advanced/css',
    141     'wp-includes/js/tinymce/themes/advanced/images',
    142     'wp-includes/js/tinymce/themes/advanced/jscripts',
    143     'wp-includes/js/tinymce/themes/advanced/langs',
    144119    // 2.5.1
    145120    'wp-includes/js/tinymce/tiny_mce_gzip.php',
     
    185160    // 2.8
    186161    'wp-admin/js/users.js',
    187     'wp-includes/js/swfupload/plugins/swfupload.documentready.js',
    188     'wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js',
    189162    'wp-includes/js/swfupload/swfupload_f9.swf',
    190163    'wp-includes/js/tinymce/plugins/autosave',
     
    192165    'wp-includes/js/tinymce/utils/mclayer.js',
    193166    'wp-includes/js/tinymce/wordpress.css',
    194     // 2.8.5
    195     'wp-admin/import/btt.php',
    196     'wp-admin/import/jkw.php',
    197167    // 2.9
    198168    'wp-admin/js/page.dev.js',
     
    251221    'wp-admin/wp-admin.dev.css',
    252222    'wp-includes/js/codepress',
    253     'wp-includes/js/codepress/engines/khtml.js',
    254     'wp-includes/js/codepress/engines/older.js',
    255223    'wp-includes/js/jquery/autocomplete.dev.js',
    256224    'wp-includes/js/jquery/autocomplete.js',
    257225    'wp-includes/js/jquery/interface.js',
    258     'wp-includes/js/scriptaculous/prototype.js',
    259226    // Following file added back in 5.1, see #45645.
    260227    //'wp-includes/js/tinymce/wp-tinymce.js',
     
    278245    'wp-includes/classes.php',
    279246    'wp-includes/js/tinymce/blank.htm',
    280     'wp-includes/js/tinymce/plugins/media/css/content.css',
    281247    'wp-includes/js/tinymce/plugins/media/img',
    282248    'wp-includes/js/tinymce/plugins/safari',
     
    287253    'wp-admin/js/list-table.js',
    288254    'wp-includes/default-embeds.php',
    289     'wp-includes/js/tinymce/plugins/wordpress/img/help.gif',
    290     'wp-includes/js/tinymce/plugins/wordpress/img/more.gif',
    291     'wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif',
    292     'wp-includes/js/tinymce/themes/advanced/img/fm.gif',
    293     'wp-includes/js/tinymce/themes/advanced/img/sflogo.png',
    294255    // 3.3
    295256    'wp-admin/css/colors-classic-rtl.css',
     
    347308    'wp-includes/js/tinymce/plugins/wplink/img',
    348309    'wp-includes/js/tinymce/plugins/wplink/js',
    349     'wp-includes/js/tinymce/themes/advanced/img/wpicons.png',
    350     'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/butt2.png',
    351     'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/button_bg.png',
    352     'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/down_arrow.gif',
    353     'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/fade-butt.png',
    354     'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/separator.gif',
    355310    // Don't delete, yet: 'wp-rss.php',
    356311    // Don't delete, yet: 'wp-rdf.php',
     
    366321    'wp-admin/network/index-extra.php',
    367322    'wp-admin/user/index-extra.php',
    368     'wp-admin/images/screenshots/admin-flyouts.png',
    369     'wp-admin/images/screenshots/coediting.png',
    370     'wp-admin/images/screenshots/drag-and-drop.png',
    371     'wp-admin/images/screenshots/help-screen.png',
    372     'wp-admin/images/screenshots/media-icon.png',
    373     'wp-admin/images/screenshots/new-feature-pointer.png',
    374     'wp-admin/images/screenshots/welcome-screen.png',
    375323    'wp-includes/css/editor-buttons.css',
    376324    'wp-includes/css/editor-buttons.dev.css',
     
    378326    'wp-includes/js/tinymce/plugins/wordpress/css',
    379327    'wp-includes/js/tinymce/plugins/wordpress/editor_plugin.dev.js',
    380     'wp-includes/js/tinymce/plugins/wordpress/img/embedded.png',
    381     'wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif',
    382     'wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif',
    383328    'wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.dev.js',
    384     'wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css',
    385329    'wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js',
    386     'wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.dev.js',
    387330    'wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.dev.js',
    388     'wp-includes/js/tinymce/plugins/wpgallery/img/gallery.png',
    389331    'wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js',
    390332    // Don't delete, yet: 'wp-pass.php',
     
    501443    'wp-admin/js/categories.dev.js',
    502444    'wp-admin/js/editor.dev.js',
    503     'wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.dev.js',
    504     'wp-includes/js/tinymce/plugins/wpdialogs/js/popup.dev.js',
    505     'wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js',
    506445    'wp-includes/js/plupload/handlers.dev.js',
    507446    'wp-includes/js/plupload/wp-plupload.dev.js',
     
    530469    'wp-includes/js/jquery/ui/jquery.effects.transfer.min.js',
    531470    'wp-includes/js/jquery/ui/jquery.effects.fold.min.js',
    532     'wp-admin/images/screenshots/captions-1.png',
    533     'wp-admin/images/screenshots/captions-2.png',
    534     'wp-admin/images/screenshots/flex-header-1.png',
    535     'wp-admin/images/screenshots/flex-header-2.png',
    536     'wp-admin/images/screenshots/flex-header-3.png',
    537     'wp-admin/images/screenshots/flex-header-media-library.png',
    538     'wp-admin/images/screenshots/theme-customizer.png',
    539     'wp-admin/images/screenshots/twitter-embed-1.png',
    540     'wp-admin/images/screenshots/twitter-embed-2.png',
    541471    'wp-admin/js/utils.js',
    542472    // Added back in 5.3 [45448], see #43895.
     
    544474    'wp-app.php',
    545475    'wp-includes/class-wp-atom-server.php',
    546     'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css',
    547476    // 3.5.2
    548477    'wp-includes/js/swfupload/swfupload-all.js',
     
    557486    'wp-admin/js/cat.js',
    558487    'wp-admin/js/cat.min.js',
    559     'wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.min.js',
    560488    // 3.8
    561     'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/page_bug.gif',
    562     'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/more_bug.gif',
    563489    'wp-includes/js/thickbox/tb-close-2x.png',
    564490    'wp-includes/js/thickbox/tb-close.png',
     
    631557    'wp-includes/js/tinymce/plugins/wpeditimage/css',
    632558    'wp-includes/js/tinymce/plugins/wpgallery/img',
    633     'wp-includes/js/tinymce/plugins/wpfullscreen/css',
    634559    'wp-includes/js/tinymce/plugins/paste/js',
    635560    'wp-includes/js/tinymce/themes/advanced',
     
    660585    'wp-includes/js/tinymce/plugins/tabfocus/editor_plugin.js',
    661586    'wp-includes/js/tinymce/plugins/tabfocus/editor_plugin_src.js',
    662     'wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.js',
    663     'wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js',
    664587    'wp-includes/js/tinymce/plugins/paste/editor_plugin.js',
    665588    'wp-includes/js/tinymce/plugins/paste/pasteword.htm',
     
    751674    // 4.9.2
    752675    'wp-includes/js/mediaelement/lang',
    753     'wp-includes/js/mediaelement/lang/ca.js',
    754     'wp-includes/js/mediaelement/lang/cs.js',
    755     'wp-includes/js/mediaelement/lang/de.js',
    756     'wp-includes/js/mediaelement/lang/es.js',
    757     'wp-includes/js/mediaelement/lang/fa.js',
    758     'wp-includes/js/mediaelement/lang/fr.js',
    759     'wp-includes/js/mediaelement/lang/hr.js',
    760     'wp-includes/js/mediaelement/lang/hu.js',
    761     'wp-includes/js/mediaelement/lang/it.js',
    762     'wp-includes/js/mediaelement/lang/ja.js',
    763     'wp-includes/js/mediaelement/lang/ko.js',
    764     'wp-includes/js/mediaelement/lang/nl.js',
    765     'wp-includes/js/mediaelement/lang/pl.js',
    766     'wp-includes/js/mediaelement/lang/pt.js',
    767     'wp-includes/js/mediaelement/lang/ro.js',
    768     'wp-includes/js/mediaelement/lang/ru.js',
    769     'wp-includes/js/mediaelement/lang/sk.js',
    770     'wp-includes/js/mediaelement/lang/sv.js',
    771     'wp-includes/js/mediaelement/lang/uk.js',
    772     'wp-includes/js/mediaelement/lang/zh-cn.js',
    773     'wp-includes/js/mediaelement/lang/zh.js',
    774676    'wp-includes/js/mediaelement/mediaelement-flash-audio-ogg.swf',
    775677    'wp-includes/js/mediaelement/mediaelement-flash-audio.swf',
     
    788690    'wp-includes/js/codemirror/jshint.js',
    789691    // 5.1
    790     'wp-includes/random_compat/random_bytes_openssl.php',
    791692    'wp-includes/js/tinymce/wp-tinymce.js.gz',
    792693    // 5.3
     
    823724    'wp-includes/block-patterns/text-two-columns.php',
    824725    'wp-includes/block-patterns/large-header-button.php',
    825     'wp-includes/blocks/subhead/block.json',
    826726    'wp-includes/blocks/subhead',
    827727    'wp-includes/css/dist/editor/editor-styles.css',
     
    844744    // 6.1
    845745    'wp-includes/blocks/post-comments.php',
    846     'wp-includes/blocks/post-comments/block.json',
    847     'wp-includes/blocks/post-comments/editor.css',
    848     'wp-includes/blocks/post-comments/editor.min.css',
    849     'wp-includes/blocks/post-comments/editor-rtl.css',
    850     'wp-includes/blocks/post-comments/editor-rtl.min.css',
    851     'wp-includes/blocks/post-comments/style.css',
    852     'wp-includes/blocks/post-comments/style.min.css',
    853     'wp-includes/blocks/post-comments/style-rtl.css',
    854     'wp-includes/blocks/post-comments/style-rtl.min.css',
    855746    'wp-includes/blocks/post-comments',
    856     'wp-includes/blocks/comments-query-loop/block.json',
    857     'wp-includes/blocks/comments-query-loop/editor.css',
    858     'wp-includes/blocks/comments-query-loop/editor.min.css',
    859     'wp-includes/blocks/comments-query-loop/editor-rtl.css',
    860     'wp-includes/blocks/comments-query-loop/editor-rtl.min.css',
    861747    'wp-includes/blocks/comments-query-loop',
    862748    // 6.3
Note: See TracChangeset for help on using the changeset viewer.