-
Notifications
You must be signed in to change notification settings - Fork 38
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
Playground plugin: Unable to start a sandbox #213
Comments
Just to make sure – are you using the latest v0.0.3 release? https://github.com/WordPress/playground-tools/releases/tag/v0.0.3 Looping in @bgrgicak |
Fixes #213 #208 <!-- Thanks for contributing to WordPress Playground Tools! --> ## What? This PR adds support for exporting Playground data and implements an error modal when Playground fails to load. ## Why? We would like to allow users to export snapshots of their sites that can later be imported into Playground (a feature in Playground isn't implemented). Some users reported errors like CORS issues and we need to ensure users have a next step to debug the issue. ## How? Playground snapshot is now an option in Tools > Export. By catching errors while Playground is loading and displaying an alert. ## Testing Instructions <!-- Please include step by step instructions on how to test this PR. --> 1. Check out the branch. 2. Start a site with the plugin running for example by using wp-env ``` cd packages/playground wp-env start ``` 3. Go to wp-admin > Tools > Export 4. Select _Playground snapshot_ and export it 5. Ensure that the downloaded zip contains data 6. Add one of the headers to the top of `playground.php` ``` header("Content-Security-Policy: default-src 'self'"); header("Content-Security-Policy: default-src 'self' style-src 'self' 'unsafe-inline' 'unsafe-eval'; script-src 'self' 'unsafe-inline' 'unsafe-eval';"); ``` 7. Try starting a sandbox 8. Confirm that you see an error alert
Hi @adamziel, apologies: I missed the notification... I was using a version that said 0.0.4 (before this commit). So, I downloaded and installed v0.0.3 linked in your comment above, and got a new error: I updated the plugin to 0.1.0 (via the WordPress admin), and then the site broke—got "the white screen of death" :-) That's what it says in the
I'm on WordPress 6.5, PHP 8.3. |
@ironnysh could you please update to 0.1.1? |
Alright, it's working on my local machine. I wonder if it has something to do with the fact that my live site is running in a sub-folder ( |
@bgrgicak, yay! It doesn't "brake" the site :-) However, when I go into Tools > Sandbox Site I see a clean install. My changes aren't reflected there. |
Sorry about that 😓
This error means the SQL export failed. Do you have any errors in your debug.log? |
So, latest update :-)
|
Thank you for all your feedback, I really appreciate it! TBH I never tested sites in subfolders. I can take a look at it next week. |
Sure thing :-) No rush... I was just curious about the plugin, so installed it on my experiments site. |
@ironnysh can you please link to this info? I've been in the docs for almost a week straight and hadn't seen the option for |
Hey @flexseth, it's a feature of the new Playground plugin, which I'm guessing isn't documented yet. Ditto ;-) |
Wow I've been working on the Playground docs for a week straight now and still find new things :) Adding it to the list of things to document, a good candidate for the Yoast Contributor Day on April 18th! |
Tagging Yoast Online Contributor Day to get this mentioned as an issue over there! |
@ironnysh would you have time to take a look at this? I'm not sure when I would be able to prioritize it. |
Hi @bgrgicak, sorry for my late response. Are we talking about the issue itself or the addition to the documentation? :-) |
I was thinking of the issue When I click Tools > Sandbox Site on the live, sub-folder-based site (...MYDOMAIN/wptests...), I get a clean install. My changes aren't reflected. |
@bgrgicak --I ran another test of the “sub-folder site” in an Incognito window.
The only error I see in the console is this: |
This error was fixed today WordPress/wordpress-playground#1458 What PHP version is that server using? |
I still see this error. After adding this to the CSP: I get hundreds of duplicated JS errors (they weren't there before, and fire after the Sandbox tries to execute the SQL):
8.3. |
Hi,
I'm trying to use the Start a sandbox option of the plugin, and ran into a few errors:
First, there was Playground plugin: Show a useful error when the iframe can't be loaded due to CORP mismatch #208, so I added
https://playground.wordpress.net/
to my CSP: ✅Then, I got this:
Error: Could not download "https://MYDOMAIN/wp-admin/admin.php?page=playground&download=1"
.admin_url('admin.php?page=' . PLAYGROUND_ADMIN_PAGE_SLUG)
, replacing admin.php with tools.php: ✅Finally, I got a new error:
Error: Could not read "/wordpress/schema/_Schema.sql": There is no such file or directory OR the parent directory does not exist.
Not sure how to solve this one :-)
The text was updated successfully, but these errors were encountered: