Commit 5126dba
authored
Playground plugin: autologin fix, \n escaping, remove parent admin bar (#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` characters1 parent f3e719f commit 5126dba
File tree
4 files changed
+27
-6
lines changed- packages/playground
- assets
- css
- js
- src
4 files changed
+27
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 29 | | |
33 | 30 | | |
34 | 31 | | |
| |||
53 | 50 | | |
54 | 51 | | |
55 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
56 | 73 | | |
57 | | - | |
| 74 | + | |
58 | 75 | | |
59 | | - | |
| 76 | + | |
60 | 77 | | |
61 | 78 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
0 commit comments