[wp-trac] [WordPress Trac] #41699: Expired transients are not flushed by cron

WordPress Trac noreply at wordpress.org
Thu Sep 28 07:57:40 UTC 2017


#41699: Expired transients are not flushed by cron
--------------------------------+--------------------
 Reporter:  bor0                |       Owner:
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  4.9
Component:  Options, Meta APIs  |     Version:  4.8.1
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:
--------------------------------+--------------------

Comment (by dd32):

 The correct code to copy for this is the section from schema.php:
 https://github.com/WordPress/WordPress/blob/master/wp-
 admin/includes/schema.php#L587-L607

 For some background on when the cleanup code was added, check out #20316

 At the time, it wasn't uncommon for people to be abusing transients, but
 it was rare for it to be causing issue.
 Clearing on DB upgrade was acceptable as it didn't need to happen *that*
 often, once every few months was plenty.

 Unfortunately since adding that code, more plugins have abused it in even
 more wonderful ways, passing even more unique keys through to transients..
 causing this need for it to occur more often.

 One of the suggestions from #20316 was for it to be part of
 `wp_scheduled_delete()` which cleans up the Trash'd posts/comments.
 [attachment:41699.2.diff] is a mostly untested first scratch at such a
 patch putting it into it's own function. The patch queues the job up in
 admin.php which doesn't seem like the best location, but does mean that
 it'll only be added for existing sites that are used.

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


More information about the wp-trac mailing list