[wp-trac] [WordPress Trac] #14757: users with no posts are not exported
WordPress Trac
wp-trac at lists.automattic.com
Sat Apr 2 19:36:38 UTC 2011
#14757: users with no posts are not exported
-------------------------------------+------------------------------
Reporter: sillybean | Owner:
Type: enhancement | Status: reopened
Priority: normal | Milestone: Awaiting Review
Component: Export | Version: 3.0.1
Severity: normal | Resolution:
Keywords: 2nd-opinion needs-patch |
-------------------------------------+------------------------------
Changes (by nacin):
* keywords: 2nd-opinion has-patch => 2nd-opinion needs-patch
Comment:
This patch isn't scalable and doesn't use the API properly.
Querying all user IDs in a multisite instance might result in thousands
(or millions) of users to loop through. That's a lot of queries. What we
could do instead is join the usermeta table and fetch users that are
specifically assigned to this blog. (And at that point, we'd probably just
use get_users() with a blog ID.)
The logic is also flawed -- we can't make assumptions based on roles. We'd
instead need to run user_can() for each user -- which is pretty expensive
for so many users. Will take too much memory. The goal here would be one
of two things: export any user with a user level <> 0, or export any user
tied to the blog in general (including subscribers). If our goal is to
include users in export files for now on, then this seems reasonable
(except where limited by just too many users).
It should be noted that user level <> 0 is a hack -- normally, we can only
check capabilities. Not role names, not user levels. Just when using the
API for future patches.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14757#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list