Skip to content

Commit 6f86c75

Browse files
authored
[Data Liberation] Fork humanmade/WordPress-Importer (#1968)
This PR kicks off a streamable WXR importer that uses a PHP-only XML parser, a PHP-only HTML parser, and a PHP-only streaming multi-request HTTP client. The first step is bringing in the `WXR_Importer` class from this repository: https://github.com/humanmade/WordPress-Importer The importer is decoupled from the runtime and can run both in a request handler and via CLI. It makes a great starting point for a streaming, resumable, parallelized WXR importer that may eventually be proposed for WordPress core. Looping in the original plugin authors mentioned in the upstream README file Ryan Boren, Jon Cave (@joncave), Andrew Nacin (@nacin), Peter Westwood (@westi), Ryan McCue (@rmmccue) ## Testing instructions None, this PR only brings new code in. Everything else still works the same.
1 parent 07988b6 commit 6f86c75

File tree

3 files changed

+2322
-0
lines changed

3 files changed

+2322
-0
lines changed

packages/playground/data-liberation/phpcs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<ruleset name="WordPressStandard">
22
<description>PHP 7.0 compatibility.</description>
33
<config name="testVersion" value="7.2"/>
4+
<exclude-pattern>src/WXR_Importer.php</exclude-pattern>
45
<rule ref="PHPCompatibility">
56
<exclude name="PHPCompatibility.Keywords.ForbiddenNamesAsDeclared"/>
67
</rule>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
* A fork of the WordPress Importer plugin (humanmade/WordPress-Importer).
4+
* It's meant to be rewritten to use the new libraries shipped with Data Liberation:
5+
*
6+
* * HTML parser
7+
* * Streaming XML parser
8+
* * Streaming multi-request HTTP client
9+
*
10+
* Original plugin created by Ryan Boren, Jon Cave (@joncave), Andrew Nacin (@nacin),
11+
* and Peter Westwood (@westi). Redux project by Ryan McCue and contributors.
12+
*
13+
* See https://github.com/humanmade/WordPress-Importer/blob/master/class-wxr-importer.php
14+
*/
15+
class WXR_Import_Info {
16+
public $home;
17+
public $siteurl;
18+
19+
public $title;
20+
21+
public $users = array();
22+
public $post_count = 0;
23+
public $media_count = 0;
24+
public $comment_count = 0;
25+
public $term_count = 0;
26+
27+
public $generator = '';
28+
public $version;
29+
}

0 commit comments

Comments
 (0)