Opened 3 months ago
Closed 3 months ago
#64327 closed defect (bug) (duplicate)
WordPress transients are not cleared
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Options, Meta APIs | Keywords: | 2nd-opinion |
| Focuses: | Cc: |
Description
I have some 5-minute transients that are never cleared due to the long name, and a varchar(191) option_name...
I am storing a wp transient with a long name, it is stored as option_name
_transient_timeout_{"json":"data"... (clipped 191 char)
and a option_value of timestamp of months ago, this is still picked up and is not cleared by WordPress system.
Change History (3)
#1
@
3 months ago
- Component changed from General to Options, Meta APIs
- Keywords 2nd-opinion added
- Version 6.8.3 deleted
Note: See
TracTickets for help on using
tickets.
As noted in the documentation, there are limits to the length of transient names:
For your purposes, I'd recommend naming the transients with a hash of the JSON date.
I think the bug in this situation is that WordPress isn't catching the names are too long ans this is causing them not to be deleted. For long names WordPress could be updated to either:
My leaning is towards the second option as renaming the transient without notifying the developer would be confusing (the names would not appear in the database as expected) but I'll let others weigh in.