-
Notifications
You must be signed in to change notification settings - Fork 39
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
incorrect \n parsing. And missing adminbar/not loggedin #193
Comments
Ccing @bgrgicak |
@janw-me would you be able to share more details about this issue? |
@bgrgicak we just clicked the "Sandbox site" on Janw's local blog after installing the Playground plugin from GitHub releases. I wonder if something is off with stringifying data to INSERT queries – perhaps newline code points sometimes come across as two characters |
Thanks! This already helps. |
I can recreate the incorrect @janw-me are there any errors in the browser console when Playground is loaded? The missing adminbar makes me think that there is an error in the blueprint that prevents it from executing all steps (login is the last step). |
@bgrgicak could it be that a custom admin username or password would break the autologin process? |
Good catch! A custom password breaks login. I can fix both issues. |
@adamziel I see two solutions for the login issue. The first solution would be to add a user and password to Playground and use these credentials to login. It's simple to implement, but it modifies the DB data and could be hard to remove if we ever want to allow Playground to site syncing. Alternatively, we could programmatically login the user. I explored this but wasn't able to get it to work. I assume there are some issues with the way I'm setting cookies. Custom cookie example in
Using WordPress functions example in
|
@bgrgicak |
I tried adding the mu-plugin using a blueprint, but it didn't work. When I add the code to the 0-playground.php mu-plugin, login works.
|
@bgrgicak maybe some |
Looks like I'm late to the party. But just in case it helps, there are errors. I see 3 errors.
|
#199) Fixes #193 <!-- Thanks for contributing to WordPress Playground Tools! --> ## What? This PR fixes a few issues reported in #193. - Allows users to login if they don't use `admin/password` as login credentials. - Removes the parent admin bar from the sandbox page. - Removes `\n` escaping from the DB exporter ## Why? ### Login Users with custom usernames and passwords weren't automatically logged into Playground because the credentials didn't match. ### Admin bar We don't want the parent admin bar to be visible as it would be confusing. ### \n Initially, we decided to escape \n as a precaution, but it broke new lines in post content and started displaying them as characters on the page. Escaping isn't necessary and it breaks the export so we can remove it. ## How? ### Login By adding a mu-plugin using blueprints to programmatically login the current user using their id. ### Admin bar By hiding it with CSS on the Playground admin page. ### \n By removing the escaping code. ## Testing Instructions 1. Check out the branch. 2. Install the plugin on a local WordPress site or use `wp-env` 3. On the local site update your password to be different from _password_ 4. Start a sandbox (wp-admin > Tools > Start Sandbox) 5. Confirm that the sandbox loaded and that you are logged in 6. If you are using the default WP theme open the Sample page by clicking on the link in the header, if not open another page that has multiple paragraphs with line breaks between them. 7. Confirm that there are no `\n` characters
@janw-me we just released a new version of the Playground plugin that should fix your issues. Would you be able to update your plugin with the new version and let us know if everything works now? |
Viewed together with @adamziel yesterday at Cloudfest.
The text was updated successfully, but these errors were encountered: