-
Notifications
You must be signed in to change notification settings - Fork 42
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: export data and catch load errors #219
Conversation
} | ||
$user = get_user_by( 'id', ${playground.userId} ); | ||
if( $user ) { | ||
wp_set_current_user( $user->ID, $user->user_login ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be moved to the login
step in core
resource: 'url', | ||
url: playground.zipUrl, | ||
}, | ||
extractToPath: '/wordpress', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just struck me that it's writing over the WordPress instance that's already in /wordpress
. Oh well 🤷 Are we compressing the entire WordPress installation with wp-admin
and wp-includes
? I wonder if this step would be more appropriate:
{
"step": "importWordPressFiles",
"wordPressFilesZip": {
"resource": "url",
"url": playground.zipUrl
},
"progress": {
"weight": 20,
"caption": "Installing WordPress site"
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, even better:
features: {
networking: true,
},
preferredVersions: {
wp: playground.zipUrl,
php: playground.phpVersion
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some notes on how to lean more on Blueprints core, but nothing blocking. LGTM 👍
Thanks! Both make sense and we will need to do it as part of enabling imports in Playground. |
Fixes #213 #208
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
playground.php