[wp-trac] [WordPress Trac] #41978: `_delete_all_data()` does not delete attachment files

WordPress Trac noreply at wordpress.org
Sat Jun 14 16:33:25 UTC 2025


#41978: `_delete_all_data()` does not delete attachment files
-------------------------------------------------+-------------------------
 Reporter:  Frank Klein                          |       Owner:
                                                 |  johnbillion
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Build/Test Tools                     |     Version:  4.7
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests 2nd-        |     Focuses:
  opinion                                        |
-------------------------------------------------+-------------------------
Changes (by SirLouen):

 * keywords:  has-patch needs-testing has-unit-tests => has-patch has-unit-
     tests 2nd-opinion


Comment:

 Maybe I'm wrong, but should attachments be handled on setup instead of on
 wrap up?

 The problem with handling this on wrap up is that if the test fails for
 any reason, it could leave leftovers that might hang future runs (it
 happened to me twice in the past 2 months)

 For the DB it's not a big deal, just leftovers that rarely conflict with
 future runs (we never check for the exact record I of the DB entry, it
 doesn't make any sense). But file leftovers can interfere, and it's too
 sensitive to be left for a wrap up function that might never run.

 cc @johnbillion @frank-klein

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/41978#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list