Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#22178 closed defect (bug) (fixed)

Reduce user_meta bloat for super admin users

Reported by: ryan's profile ryan Owned by: ryan's profile ryan
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.4.2
Component: Users Keywords:
Focuses: Cc:

Description

Super admins have {$blog_id}_user-settings, {$blog_id}_user-settings-time, and {$blog_id}_dashboard_quick_press_last_post_id usermeta entries added for every dashboard they visit, regardless of whether they are a user on the blog or not. The end result is that some super admins have many thousands of usermeta entries and a user object possibly over 1MB. We have seen several in the 800k range containing these entries for over 300 blogs.

Attachments (3)

22178.diff (1.6 KB) - added by ryan 13 years ago.
22178.2.diff (3.0 KB) - added by ryan 13 years ago.
Handle dashboard_quick_press_last_post_id
22178.3.diff (2.2 KB) - added by ryan 13 years ago.
Clean up

Download all attachments as: .zip

Change History (9)

#1 @scribu
13 years ago

  • Cc scribu added

#2 @nacin
13 years ago

I wonder if we can just toss out dashboard_quick_press_last_post_id by always just generating an auto-draft on the fly for QuickPress. Avoiding a single insert query doesn't seem like the end of the world, and cron cleans them up.

Or, should QuickPress be hidden for users that, minus their super admin capabilities, don't actually have posting access?

I think it is fine to avoid saving user settings in the DB when super admins wouldn't otherwise have access to the dashboard. Let it stay in the cookie and that's it.

#3 @nacin
13 years ago

Things currently handled by user settings: folding/unfolding of the admin menu, which editor you use by default (tinymce v html), your editor height, your DFW width, your default gallery settings (columns, etc.), plupload versus html4 uploader, default image properties (alignment, size, where it links to), internal linking expansion. So, decent amount of stuff, but nothing that is much of an issue.

Kind of weird that folding/unfolding of the admin menu isn't global, though.

@ryan
13 years ago

#4 @ryan
13 years ago

That could be refined to go ahead and update the options if they are already present.

@ryan
13 years ago

Handle dashboard_quick_press_last_post_id

@ryan
13 years ago

Clean up

#5 @ryan
13 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [22256]:

Don't create {$blog_id}_user-settings, {$blog_id}_user-settings-time, and {$blog_id}_dashboard_quick_press_last_post_id user options when a super admin visits a site they aren't a member of. Instead, rely solely on the wp-settings cookie.

fixes #22178

#6 @ocean90
12 years ago

  • Milestone changed from Future Release to 3.5
Note: See TracTickets for help on using tickets.