[wp-trac] [WordPress Trac] #55712: Remove _copy_dir() as originally intended
WordPress Trac
noreply at wordpress.org
Thu May 12 08:18:37 UTC 2022
#55712: Remove _copy_dir() as originally intended
------------------------------+---------------------
Reporter: afragen | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.1
Component: Upgrade/Install | Version: 3.2
Severity: normal | Resolution:
Keywords: has-patch commit | Focuses:
------------------------------+---------------------
Comment (by costdev):
''Scroll to the bottom for the TL;DR''.
**Search 1**
As linked above, I searched wpdirectory.net for public plugins and themes
referencing `_copy_dir\(`.
- There was one result, a plugin, which called the function.
- The call was protected by a `function_exists()` guard.
- It was submitted 11 years ago.
- It was a plugin for unit testing.
- This plugin is now closed.
- Its version was `0.0.2`.
-----
**Search 2**
I searched Google for `_copy_dir`: No codebase or developer discussions on
this.
-----
**Search 3**
I searched GitHub for `_copy_dir` with:
- The language set to `PHP`.
- The extension set to `php`.
- `Search *not* in forks` set.
The first 20 pages, the last 10 pages, and the middle 10 pages are all
from `wp-admin/includes/update-core.php` stored in the repositories. I
can't find any usage of it anywhere, other than from the 11 year old
plugin mentioned in the results in my earlier comment.
-----
**Search 4**
I ran [https://wpdirectory.net/search/01G2VMF3RG5VY6T2R16SHN5VJX this
search] on wpdirectory.net (which accounts for different coding styles)
for plugins that have:
1. A `require/require_once/include/include_once` statement for `wp-
admin/includes/update-core.php`.
2. A reference just to `wp-admin/includes/update-core.php`.
After reviewing all 53 results:
1. These are used either for calling `update_core()`, or making use of the
`$_old_files` array.
2. These are references to the file, and don't concern me.
-----
**Overview**
- Doesn't appear in the developer documentation.
- Is marked with a leading underscore.
- Needs a `require` or `include` statement in order to be used.
- Has an alternative via `copy_dir()`, which was introduced earlier
(2.5.0), is public, is available in developer documentation and can be
found in references online.
- Available sources that do have a
`require/require_once/include/include_once` statement for the file
containing this function are only looking at `update_core()` and the
`$_old_files` array.
- Has one ancient, now defunct, reference to it online (from 11 years ago,
which is when this function was introduced).
I think this is just about as safe as anyone could expect when removing a
function from Core, and can't find any indication that deprecating it
would be of any benefit here.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55712#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list