Opened 14 years ago
Last modified 4 years ago
#14757 reopened enhancement
users with no posts are not exported
Reported by: | sillybean | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Export | Keywords: | 2nd-opinion needs-patch |
Focuses: | Cc: |
Description
I just exported a large standalone site and imported into a multisite setup, and I discovered that a number of users who hadn't yet posted anything didn't get moved to the new site.
Attachments (3)
Change History (15)
#2
in reply to:
↑ 1
@
14 years ago
Replying to duck_:
Though I suppose only users with
edit_posts
capability and above could be exported or something.
That seems like a good idea.
#4
@
14 years ago
all changes to be made in wp-admin/includes/export.php .
We can also specify selective users as mentioned in diff file.
#8
@
14 years ago
- Keywords needs-patch added; has-patch removed
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.
The arguments against would be that you could potentially be creating a massive export file with all the users and that WXR export files are "not intended to serve as a complete backup of your site".
Though I suppose only users with
edit_posts
capability and above could be exported or something.