[wp-trac] [WordPress Trac] #64519: WP_Filesystem_FTP and WP_Filesystem_FTPext classes create orphaned temp/noise files
WordPress Trac
noreply at wordpress.org
Fri Jan 16 10:04:00 UTC 2026
#64519: WP_Filesystem_FTP and WP_Filesystem_FTPext classes create orphaned
temp/noise files
----------------------------+-----------------------------
Reporter: lucianwpwhite | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Filesystem API | Version: 6.9
Severity: normal | Keywords:
Focuses: |
----------------------------+-----------------------------
The WP_Filesystem_FTP and WP_Filesystem_FTPext classes create temporary
files during put_contents operations, but if the FTP connection is invalid
or null, the method throws an exception without cleaning up the temp file,
resulting in orphaned files in tmp.on busy sites you can easily end up
with 100K files in matter of days not to mention the fact that the file
name provided is not respected.
For example lets say you pass/var/www/html/wp-
content/uploads/plugin/index.php
If ftp is not configured you will end up with:/tmp/plugin-{random
string}.php
And then the FTP will throw exception and the file will remain
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64519>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list