[wp-trac] [WordPress Trac] #19500: User deletion doesn't clear user_meta cache

WordPress Trac wp-trac at lists.automattic.com
Sat Dec 10 14:58:47 UTC 2011


#19500: User deletion doesn't clear user_meta cache
--------------------------+----------------------------
 Reporter:  duck_         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Future Release
Component:  Cache         |    Version:  3.2.1
 Severity:  normal        |   Keywords:
--------------------------+----------------------------
 wp_delete_user() and wpmu_delete_user() leave user_meta in the cache.
 Example:

 {{{
 get_user_meta( $user_id );
 wp_delete_user( $user_id );
 var_dump( is_user_member_of_blog( $user_id ) ); // bool(true) instead of
 bool(false)
 }}}

 Possible solutions:

  1. Extend clean_user_cache() to delete from user_meta too
  2. delete_user_meta() in wp_delete_user() instead of direct query

 Ryan wasn't keen on 1 as "Most of the time clean_user_cache() doesn't need
 to touch meta cache".

 2. will introduce the delete(d)_user_meta actions when using
 wp_delete_user().

 wp_cache_delete( $id, 'user_meta' ) in wp_delete_user() was also floated
 as a stop-gap measure, but since this will be fixed in a future release we
 can ignore the suggestion.

 See: [comment:ticket:19160:6], #11761

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19500>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list