Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Apr 18, 2023

Conversation

adamziel
Copy link
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