Skip to content

Commit 3804d4f

Browse files
adamzielironnysh
andauthored
Docs: Update WordPress versions used in the documentation, document using older releases (#1235)
Ensures WordPress 5.9 and 6.0 are no longer referenced in the documentation as they are no longer supported. Also, provides instructions for people who still need to use them: <img width="300" src="https://github.com/WordPress/wordpress-playground/assets/205419/f93937d9-d6b1-4cd2-a2f7-56f84e69896b"> Closes #994 This is a quick stab at it, feel free to take over @ironnysh, I gave you write permissions to the repo so you could update this PR. Closes #994 Co-authored-by: Ronny Shani <[email protected]>
1 parent e05126d commit 3804d4f

File tree

6 files changed

+91
-29
lines changed

6 files changed

+91
-29
lines changed

packages/docs/site/docs/02-start-using/01-index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Compatibility testing with so many WordPres and PHP versions was always a pain.
8989

9090
You can also use the `wp` and `php` query parameters to open Playground with the right versions already loaded:
9191

92-
- https://playground.wordpress.net/?wp=5.9
92+
- https://playground.wordpress.net/?wp=6.5
9393
- https://playground.wordpress.net/?php=7.4
9494
- https://playground.wordpress.net/?php=8.2&wp=6.2
9595

packages/docs/site/docs/08-query-api/01-index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You can go ahead and try it out. The Playground will automatically install the t
2424
| Option | Default Value | Description |
2525
| ---------------------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2626
| `php` | `8.0` | Loads the specified PHP version. Supported values: `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `8.0`, `8.1`, `8.2`, `8.3`, `latest` |
27-
| `wp` | `latest` | Loads the specified WordPress version. Supported values: `6.0`, `6.1`, `6.2`, `6.3`, `6.4`, `latest`, `nightly`, `beta` |
27+
| `wp` | `latest` | Loads the specified WordPress version. Supported values: The last three major WordPress versions. As of April 4, 2024, that's `6.3`, `6.4`, `6.5`. You can also use these values: `latest`, `nightly`, `beta` |
2828
| `blueprint-url` | | The URL of the Blueprint that will be used to configure this Playground instance. |
2929
| `php-extension-bundle` | | Loads a bundle of PHP extensions. Supported bundles: `kitchen-sink` (for finfo, gd, mbstring, iconv, openssl, libxml, xml, dom, simplexml, xmlreader, xmlwriter), `light` (saves 6MB of downloads, loads none of the above extensions) |
3030
| `networking` | `yes` or `no` | Enables or disables the networking support for Playground. Defaults to `no` |

packages/docs/site/docs/09-blueprints-api/02-using-blueprints.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ For example, to create a Playground with specific versions of WordPress and PHP
2020
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
2121
"preferredVersions": {
2222
"php": "7.4",
23-
"wp": "5.9"
23+
"wp": "6.5"
2424
}
2525
}
2626
```
2727

2828
And then you would go to
29-
`https://playground.wordpress.net/#{"preferredVersions": {"php":"7.4", "wp":"5.9"}}`.
29+
`https://playground.wordpress.net/#{"preferredVersions": {"php":"7.4", "wp":"6.5"}}`.
3030

3131
You won't have to paste links to follow along. We'll use code examples with a "Try it out" button that will automatically run the examples for you:
3232

3333
<BlueprintExample justButton={true} blueprint={{
3434
"preferredVersions": {
3535
"php": "7.4",
36-
"wp": "5.9"
36+
"wp": "6.5"
3737
}
3838
}} />
3939

packages/docs/site/docs/09-blueprints-api/03-data-format.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import BlueprintExample from '@site/src/components/Blueprints/BlueprintExample.m
1919
"landingPage": "/wp-admin/",
2020
"preferredVersions": {
2121
"php": "7.4",
22-
"wp": "5.9"
22+
"wp": "6.5"
2323
},
2424
"phpExtensionBundles": ["kitchen-sink"],
2525
"features": {
@@ -50,8 +50,8 @@ JSON files can be tedious to write and easy to get wrong. To help with that, Pla
5050

5151
The `preferredVersions` property, unsurprisingly, declares the preferred of PHP and WordPress versions to use. It can contain the following properties:
5252

53-
- `php` (string): The preferred PHP version to use. Defaults to 'latest'. Only accepts major versions like "7.4" or "8.0". Minor versions like "7.4.1" are not supported.
54-
- `wp` (string): The preferred WordPress version to use. Defaults to 'latest'. Only accepts major versions like "5.9" or "6.0". Minor versions like "5.9.1" are not supported.
53+
- `php` (string): The preferred PHP version to use. Defaults to "latest". Only accepts major versions, like "7.4" or "8.0". Minor versions like "7.4.1" are not supported.
54+
- `wp` (string): Loads the specified WordPress version. Supported values: The last three major WordPress versions—minor versions, like `6.5.1`, are not supported. As of April 4, 2024, that's `6.3`, `6.4`, `6.5`. You can also use these values: `latest` (default), `nightly`, or `beta`.
5555

5656
## PHP extensions
5757

packages/docs/site/docs/09-blueprints-api/08-examples.md

+42
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,45 @@ Use the `writeFile` step to add code to a mu-plugin that runs on every request.
181181
}} />
182182

183183
You can share your own Blueprint examples in [this dedicated wiki](https://github.com/WordPress/wordpress-playground/wiki/Blueprint-examples).
184+
185+
## Load an older WordPress version
186+
187+
Playground only ships with a few recent WordPress releases. If you need to use an older version, this Blueprint can help you: change the version number in `"url": "https://playground.wordpress.net/plugin-proxy.php?url=https://wordpress.org/wordpress-5.9.9.zip"` from `5.9.9` to the release you want to load.
188+
189+
**Note:** the oldest supported WordPress version is `5.9.9`, following the SQLite integration plugin.
190+
191+
<BlueprintExample blueprint={{
192+
"landingPage": "/wp-admin",
193+
"steps": [
194+
{
195+
"step": "writeFile",
196+
"path": "/tmp/wordpress.zip",
197+
"data": {
198+
"resource": "url",
199+
"url": "https://playground.wordpress.net/plugin-proxy.php?url=https://wordpress.org/wordpress-5.9.9.zip",
200+
"caption": "Downloading the WordPress Release"
201+
}
202+
},
203+
{
204+
"step": "importWordPressFiles",
205+
"wordPressFilesZip": {
206+
"resource": "vfs",
207+
"path": "/tmp/wordpress.zip"
208+
},
209+
"pathInZip": "/wordpress",
210+
"progress": {
211+
"weight": 20,
212+
"caption": "Importing the WordPress release"
213+
}
214+
},
215+
{
216+
"step": "runPHP",
217+
"code": "<?php $_GET['step'] = 'upgrade_db'; require '/wordpress/wp-admin/upgrade.php'; "
218+
},
219+
{
220+
"step": "login",
221+
"username": "admin",
222+
"password": "password"
223+
}
224+
]
225+
}} />

packages/playground/website/src/components/playground-configuration-group/form.tsx

+41-21
Original file line numberDiff line numberDiff line change
@@ -312,29 +312,49 @@ export function PlaygroundConfigurationForm({
312312
>
313313
WordPress Version
314314
</label>
315-
<select
316-
id="wp-version"
317-
value={wp}
318-
className={forms.largeSelect}
319-
onChange={(
320-
event: React.ChangeEvent<HTMLSelectElement>
321-
) => {
322-
setWp(event.target.value as string);
315+
<div
316+
style={{
317+
display: 'flex',
318+
gap: '0.5rem',
319+
flexDirection: 'column',
323320
}}
324321
>
325-
{/*
326-
* Without an empty option, React sometimes says
327-
* the current selected version is "nightly" when
328-
* `wp` is actually "6.4".
329-
*/}
330-
<option value="">-- Select a version --</option>
331-
{Object.keys(supportedWPVersions).map((version) => (
332-
<option key={version} value={version}>
333-
WordPress {supportedWPVersions[version]}
334-
&nbsp;&nbsp;
335-
</option>
336-
))}
337-
</select>
322+
<select
323+
id="wp-version"
324+
value={wp}
325+
className={forms.largeSelect}
326+
onChange={(
327+
event: React.ChangeEvent<HTMLSelectElement>
328+
) => {
329+
setWp(event.target.value as string);
330+
}}
331+
>
332+
{/*
333+
* Without an empty option, React sometimes says
334+
* the current selected version is "nightly" when
335+
* `wp` is actually "6.4".
336+
*/}
337+
<option value="">-- Select a version --</option>
338+
{Object.keys(supportedWPVersions).map(
339+
(version) => (
340+
<option key={version} value={version}>
341+
WordPress{' '}
342+
{supportedWPVersions[version]}
343+
&nbsp;&nbsp;
344+
</option>
345+
)
346+
)}
347+
</select>
348+
<br />
349+
<a
350+
href="https://wordpress.github.io/wordpress-playground/blueprints-api/examples#load-an-older-wordpress-version"
351+
target="_blank"
352+
rel="noreferrer"
353+
style={{ fontSize: '0.9em' }}
354+
>
355+
Need an older version?
356+
</a>
357+
</div>
338358
</div>
339359
<div className={forms.submitRow}>
340360
<Button type="submit" variant="primary" size="large">

0 commit comments

Comments
 (0)