Skip to content

[Import/export] Support WXR, WXZ, and full-site import and export#209

Merged
adamziel merged 3 commits intotrunkfrom
export-wxz-wxz-full-site
Apr 18, 2023
Merged

[Import/export] Support WXR, WXZ, and full-site import and export#209
adamziel merged 3 commits intotrunkfrom
export-wxz-wxz-full-site

Conversation

@adamziel
Copy link
Copy Markdown
Collaborator

This PR adds multiple ways to move data in and out of Playground.
Specifically, it implements the following client functions:

  • zipEntireSite()
  • replaceSite()
  • exportWXR()
  • exportWXZ()
  • submitImporterForm()

The WXR format is one natively used by the official WordPress importer plugin.

The WXZ format is supported through the following plugin:

https://github.com/akirk/export-wxz
https://github.com/akirk/wordpress-importer

The full-site export is simply a zip archive containing the entire site.

It solves the problem of escaping arguments when writing PHP code in JavaScript.

Before:
```js
const code = `define('WP_HOME', "${absoluteUrl}");`
// if absoluteUrl contains the '"' character, this code will break
```

After:
```js
const code = t.define('WP_HOME', absoluteUrl).toString();
// absoluteUrl is correctly escaped and can even be an array
// or an object
```
This commit adds multiple ways to move data in and out of Playground.
Specifically, it implements the following client functions:

* zipEntireSite()
* replaceSite()
* exportWXR()
* exportWXZ()
* submitImporterForm()

The WXR format is one natively used by the official WordPress importer plugin.

The WXZ format is supported through the following plugin:

https://github.com/akirk/export-wxz
https://github.com/akirk/wordpress-importer

The full-site export is simply a zip archive containing the entire site.
@adamziel adamziel self-assigned this Apr 18, 2023
@adamziel adamziel added [Type] Enhancement New feature or request Importing labels Apr 18, 2023
@adamziel adamziel mentioned this pull request Apr 18, 2023
@adamziel adamziel merged commit c588dec into trunk Apr 18, 2023
@adamziel adamziel deleted the export-wxz-wxz-full-site branch April 18, 2023 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant