WordPress / theme-test-data

Theme Test Data
620 stars 16 forks source link

WXR file format for Playground #82

Open courtneyr-dev opened 6 months ago

courtneyr-dev commented 6 months ago

Can we host a WXR file format in this GitHub repo to use for importing to WP Playground installs?

carolinan commented 5 months ago

Can this be closed?

flexseth commented 4 months ago

Can this be closed?

Not quite yet. The issue involves being able to automatically import images when working in Playground.

What happens is that the images are hosted at https://wpthemetestdata.wordpress.com/, which doesn't have the proper headers to allow the files to be downloaded remotely. They are blocked by a content restriction policy (CORS) - fairly common in website security.

In order for the issue to be closed, we simply need the images hosted somewhere on WordPress.org, which is much easier than updating the security policy.

However: I (and maybe "we" to a certain degree) - don't know where to reach out to the WP.com folks to request the change. I emailed through the all purpose contact form on WP.com, but dunno if that is effective.

Here's what happens in the console when trying to import now:

321819784-c7b6e57f-dc30-4833-9efc-421a450ff9ef

Once the images are moved we can resolve this ticket and also

We have a similar request for SVN which is mentioned here

cc @tellyworth @dd32 – should plugins.svn.wordpress.org expose the CORS headers to allow using additional assets in Blueprints?

What it looks like is it is out of the control of a lot of the .org folks. Can't 100% be sure of this, but it's the signal I'm getting based on the fact that the images are hosted from .com :)

@carolinan - ideas? Know any infrastructure folks at .com? :)

carolinan commented 4 months ago

I don't understand why wp.com would be a blocker if the images just need to be downloaded and uploaded again on .org?

But I also don't understand how images hosted on .org would have links that matches an actual uploaded image attachment with id's, they would not be exported from a real database?

I don't understand what the plan is.

carolinan commented 4 months ago

@carolinan - ideas? Know any infrastructure folks at .com? :)

@danielbachhuber Know any infrastructure folks at .com? PInging @kraftbj too as I know you are the person who helps us with the bundled theme demos...

dd32 commented 4 months ago

I went and looked internal at Automattic; Long story short is that CORS headers for *.files.wordpress.com is not possible (based on previous discussions)

I would personally suggest not hosting these on WordPress.com, and instead store them in this Github repo and use raw.githubcontent.com instead to access them.

If you absolutely must use wpcom as the hosting for the images, you'd have to replace URLS likehttps://wpthemetestdata.files.wordpress.com/2013/03/image-alignment-580x300.jpg with https://i0.wp.com/wpthemetestdata.files.wordpress.com/2013/03/image-alignment-580x300.jpg to go via an image-only CDN on the WordPress.com end that has CORS headers set.

flexseth commented 3 months ago

escalated to WP.com folks, stay tuned, props to @jp-imagines

carolinan commented 3 months ago

In https://github.com/WordPress/wordpress-playground/pull/1250, there is a suggestion to reduce the number of media files that are imported. This can be a separate pull request. I am mentioning it in this issue since it is related to playground.