[wp-trac] [WordPress Trac] #27538: Widget Customizer: Persistent object cache/Transients causes certain previewed widgets to leak outside of customizer

WordPress Trac noreply at wordpress.org
Mon Apr 7 11:29:30 UTC 2014


#27538: Widget Customizer: Persistent object cache/Transients causes certain
previewed widgets to leak outside of customizer
--------------------------+-----------------------
 Reporter:  westonruter   |       Owner:  ocean90
     Type:  defect (bug)  |      Status:  reopened
 Priority:  high          |   Milestone:  3.9
Component:  Widgets       |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------
Changes (by Denis-de-Bernardy):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Re-opening, because I think r27966 is can of worms that borders on crazy.

 This should be fixed in the wp_cache API directly: you cannot
 realistically rely on WP widget authors who might try to use the cache in
 a way or another (be it using `wp_cache_get()` or a transient).

 Methinks the cache API should get updated, with methods such as
 `wp_cache_enable()` and `wp_cache_disable()` introduced and getting called
 as appropriate. Perhaps use `wp_switch_to_blog(-1)` or something to that
 order if they're around, in an effort to keep some level of backwards
 compatibility. Or maybe unregister all buckets and make them temporarily
 non-persistent. Anything.

 The point here is that existing widgets will not get updated any time soon
 to make use of `WP_Widget#is_preview()`. In contrast, object cache plugins
 will get updated and upgraded very quickly if using the theme or widget
 customizer yields fatal errors related to non-existing cache methods
 (which are no big deal here, really, since only admins would ever see
 them).

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


More information about the wp-trac mailing list