WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#11118 closed enhancement (fixed)

Add blog author data near top of export file

Reported by: briancolinger Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 2.9
Component: Export Keywords: exporter, WXR, has-patch
Focuses: Cc:

Description

Reading WXR to find post authors is slow. The entire file has to be scanned to find all authors.
Putting them near the top of the file would allow the importer to read the user list without having to scan the entire file.
I've attached a patch to enable this.

Attachments (2)

export.patch (2.0 KB) - added by briancolinger 4 years ago.
re-structuring the xml tags for users
export.php.patch (2.2 KB) - added by briancolinger 4 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 lloydbudd4 years ago

  • Keywords WXR added
  • Milestone changed from Unassigned to 3.0
  • Version set to 2.9

briancolinger4 years ago

re-structuring the xml tags for users

comment:2 briancolinger4 years ago

Changed the XML tags to follow convention.
<wp:users> root tag for containing users.
<wp:user> tag to contain each user record.

comment:3 ocean904 years ago

  • Keywords has-patch added

comment:4 dd324 years ago

Is this used by the importer at present? Or is this for non-WP platforms?

comment:5 xibe4 years ago

Indeed. It's one thing to change the export format, it's another to allow the importer to use it properly.

comment:6 briancolinger4 years ago

No, the importer does not read this format yet. I can make a patch for the importer check the version of the WXR, then use the data if it is present.

comment:7 dd324 years ago

Patch review:

  • Would SELECT DISTINCT perhaps be better than a GROUP BY?
  • <wp:users> might not be the best naming, since it only contains post authors, <wp:authors> might suit better?
  • Seems putting it in a <wp:users> is out of sync with the file, It holds everything as a flat index, ie. <wp:user>....</wp:user><wp:user>....</wp:user>, Without a wrapper around it all.

comment:8 Denis-de-Bernardy4 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 3.0 to Future Release

other notes:

  • get_results(select *) rather than a get_col(select id) would be sweeter. then we fill the cache so as to avoid a zillion queries on sites with multitudes of authors
  • also, it's important to only retrieve post authors (possibly comment authors as well?), rather than all users from an entire WPMU install
  • importer most welcome too

comment:9 lloydbudd4 years ago

  • Cc lloydomattic@… added

briancolinger4 years ago

comment:10 briancolinger4 years ago

I've made some of the suggested changes to the export patch. As far as the importer changes go, I would like to get these exporter changes finalized first.

comment:11 lloydbudd4 years ago

  • Milestone changed from Future Release to 3.1

comment:12 ocean904 years ago

  • Keywords has-patch added; needs-patch removed

comment:13 nacin3 years ago

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

(In [15961]) Importer and exporter overhaul, mega props duck.

Exporter overhaul:

  • Add author information to export
  • Greater usage of slug identifiers
  • Don't export auto-drafts, spam comments, or edit lock/last meta keys
  • Inline documentation improvements
  • Remove filtering for now (@todo)
  • Bump WXR version to 1.1, but remain back compat in the importer

Importer overhaul (http://plugins.trac.wordpress.org/changeset/304249):

  • Use an XML parser where available (SimpleXML, XML Parser)
  • Proper import support for navigation menus
  • Many bug fixes, specifically improvements to category and custom taxonomy handling
  • Better author/user mapping

Fixes #5447 #5460 #7400 #7973 #8471 #9237 #10319 #11118 #11144 #11354 #11574 #12685 #13364 #13394 #13453 #13454 #13627 #14306 #14442 #14524 #14750 #15055 #15091 #15108.

See #15197.

comment:14 nacin3 years ago

  • Milestone changed from Awaiting Triage to 3.1
Note: See TracTickets for help on using tickets.