WordPress / blueprints-library

32 stars 7 forks source link

Import WXR using WP-CLI #90

Closed adamziel closed 7 months ago

adamziel commented 8 months ago

In blueprints v1, the importFile step runs fetch() requests to simulate a user going through the importer flow.

See this issue for more context.

In V2, let's lean on WP-CLI and this command: https://github.com/wp-cli/import-command

Mte90 commented 7 months ago

Any ETA for this? Now the wp plugin repo has the option to turn on the live preview

flexseth commented 7 months ago

Any ETA for this?

Now the wp plugin repo has the option to turn on the live preview

The existing spec is in documentation process - v1

V2 is in the works but will probably be a bit until the main project is tooled accordingly.

We're looking at focusing on the developer experience and hoping devs can build out examples that will help the greater community!

adamziel commented 7 months ago

@Mte90 I think https://github.com/WordPress/wordpress-playground/issues/1183 solved it without WP-CLI!

I just tried this Blueprint and it imported Glossary entries:

{
  "landingPage": "/wp-admin/post.php?post=9&action=edit",
  "phpExtensionBundles": [
    "kitchen-sink"
  ],
  "steps": [
    {
      "step": "login"
    },
    {
      "step": "installPlugin",
      "pluginZipFile": {
        "resource": "wordpress.org/plugins",
        "slug": "glossary-by-codeat"
      },
      "options": {
        "activate": true
      }
    },
    {
      "step": "importFile",
      "file": {
        "resource": "url",
        "url": "https://docs.codeat.co/glossary/playground-import.xml"
      }
    }
  ]
}