Skip to content
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

Document loading older WordPress versions with a Blueprint #994

Closed
dartiss opened this issue Feb 2, 2024 · 8 comments · Fixed by #1235
Closed

Document loading older WordPress versions with a Blueprint #994

dartiss opened this issue Feb 2, 2024 · 8 comments · Fixed by #1235
Labels

Comments

@dartiss
Copy link

dartiss commented Feb 2, 2024

As a developer, the Playground is a great way to test things out quickly. However, I have a specific need for one of my plugins to be able to test on back levels of WordPress (pre Block Editor) and would love to see Playground supporting this (to an extend - probably don't need it running WordPress v1!!).

Would it be possible to implement older releases of WordPress?

@WordPress WordPress deleted a comment Feb 2, 2024
@WordPress WordPress deleted a comment Feb 2, 2024
@adamziel
Copy link
Collaborator

@dartiss I would love the PHP Blueprint library to support arbitrary .zip files as the WordPress version – you will then be able to start Playground with WordPress 4.5 :-) Just curious, what's the first WordPress version your plugin supports? And what's the plugin?

@dartiss
Copy link
Author

dartiss commented Feb 29, 2024

@adamziel my Transient Cleaner plugin only works on WordPress 5.8 or below.

@adamziel adamziel added this to the Innovative Developer Tools milestone Mar 4, 2024
@eliot-akira
Copy link
Collaborator

eliot-akira commented Mar 8, 2024

running WordPress v1

The other day I was curious and found the earliest tagged version of WordPress 1.5 from 2005. It's interesting to see the basic folder/file structure has been the same all these years.

https://github.com/WordPress/wordpress-develop/tree/004508b63f772b3c976f2ce4b36e151c69234e26

It would be amusing to re-animate such a historic snapshot of WordPress. (The readme says "PHP version 4.1 or higher".) Even if it doesn't go so far back, Playground would be the perfect "retro emulator" for running older WordPress versions.

@acketon
Copy link

acketon commented Mar 27, 2024

This would be ideal, when I first started using the https://playground.wordpress.net/ site there were older versions of WP in it, I believe 5.8 or 5.9 but they have since been removed. I hoped it was just removed from the UI so I tried modifying the URL to load 5.9 but it seemed to ignore that and load it in 6.4.

It would be really helpful if it was possible to load older versions... or at least if you stopped removing versions as new ones were added to the list. At our offices we are running different versions of WP and are usually behind several versions due to how large our environment is. The playground tool is super useful for quick tests or even just checking which features were released in which version of WordPress and seeing it evolve from version to version.

@adamziel
Copy link
Collaborator

adamziel commented Mar 29, 2024

I'd rather not put these WordPress versions to the UI as:

  • Most Playground users won't need them
  • It would mean building Playground would require processing and supporting more and more WordPress bundles.

I still acknowledge they would be highly useful for you, so here's the next best approach.

With #1154, you're now able to load older WordPress releases using a custom Blueprint:

{
    "landingPage": "/wp-admin",
    "steps": [
        {
            "step": "writeFile",
            "path": "/tmp/wordpress.zip",
            "data": {
                "resource": "url",
                "url": "https://playground.wordpress.net/plugin-proxy.php?url=https://wordpress.org/wordpress-5.9.9.zip",
                "caption": "Downloading the WordPress Release"
            }
        },
        {
            "step": "importWordPressFiles",
            "wordPressFilesZip": {
                "resource": "vfs",
                "path": "/tmp/wordpress.zip"
            },
            "pathInZip": "/wordpress",
            "progress": {
                "weight": 20,
                "caption": "Importing the WordPress release"
            }
        },
        {
            "step": "runPHP",
            "code": "<?php $_GET['step'] = 'upgrade_db'; require '/wordpress/wp-admin/upgrade.php'; "
        },
        {
            "step": "login",
            "username": "admin",
            "password": "password"
        }
    ]
}

Just need to switch "url": "https://playground.wordpress.net/plugin-proxy.php?url=https://wordpress.org/wordpress-5.9.9.zip", for the WordPress.org-hosted WordPress ZIP release you want to use.

Click here to test

The next steps in this issue would be either of these:

  • Adding these older WordPress versions to the version picker. I'm less excited about this one as we'd have a single select box with two different effects – it would either download a Playground-optimized WP release or a large ZIP bundle of an official WP release. Instead, I'd rather...
  • Document how to use the above Blueprint to load older WordPress releases. Perhaps even link to that doc page from the UI, e.g. "Need an older WordPress version?"

The oldest WordPress version that worked for me this way is 5.9.9 – I don't think the SQLite integration plugin works with WordPress versions <= 5.8.

I have no plans to work on adding that support as there's a lot of foundational work to make sure Playground is stable, well documented etc. If SQLite on WordPress <= 5.8 is something you could use, you can make it happen by contributing to the SQLite integration plugin – I'm sure @aristats will value your inputs.

adamziel added a commit that referenced this issue Mar 29, 2024
This change enables testing older WordPress releases with the following
Blueprint:

```json
{
    "landingPage": "/wp-admin",
    "steps": [
        {
            "step": "writeFile",
            "path": "/tmp/wordpress.zip",
            "data": {
                "resource": "url",
                "url": "https://playground.wordpress.net/plugin-proxy.php?url=https://wordpress.org/wordpress-5.9.9.zip",
                "caption": "Downloading the WordPress Release"
            }
        },
        {
            "step": "importWordPressFiles",
            "wordPressFilesZip": {
                "resource": "vfs",
                "path": "/tmp/wordpress.zip"
            },
            "pathInZip": "/wordpress",
            "progress": {
                "weight": 20,
                "caption": "Importing the WordPress release"
            }
        },
        {
            "step": "runPHP",
            "code": "<?php $_GET['step'] = 'upgrade_db'; require '/wordpress/wp-admin/upgrade.php'; "
        },
        {
            "step": "login",
            "username": "admin",
            "password": "password"
        }
    ]
}
```

[Click here to
test](https://playground.wordpress.net/#eyJsYW5kaW5nUGFnZSI6Ii93cC1hZG1pbiIsInN0ZXBzIjpbeyJzdGVwIjoid3JpdGVGaWxlIiwicGF0aCI6Ii90bXAvd29yZHByZXNzLnppcCIsImRhdGEiOnsicmVzb3VyY2UiOiJ1cmwiLCJ1cmwiOiJodHRwczovL3BsYXlncm91bmQud29yZHByZXNzLm5ldC9wbHVnaW4tcHJveHkucGhwP3VybD1odHRwczovL3dvcmRwcmVzcy5vcmcvd29yZHByZXNzLTUuOS45LnppcCIsImNhcHRpb24iOiJEb3dubG9hZGluZyB0aGUgV29yZFByZXNzIFJlbGVhc2UifX0seyJzdGVwIjoiaW1wb3J0V29yZFByZXNzRmlsZXMiLCJ3b3JkUHJlc3NGaWxlc1ppcCI6eyJyZXNvdXJjZSI6InZmcyIsInBhdGgiOiIvdG1wL3dvcmRwcmVzcy56aXAifSwicGF0aEluWmlwIjoiL3dvcmRwcmVzcyIsInByb2dyZXNzIjp7IndlaWdodCI6MjAsImNhcHRpb24iOiJJbXBvcnRpbmcgdGhlIFdvcmRQcmVzcyByZWxlYXNlIn19LHsic3RlcCI6InJ1blBIUCIsImNvZGUiOiI8P3BocCAkX0dFVFsnc3RlcCddID0gJ3VwZ3JhZGVfZGInOyByZXF1aXJlICcvd29yZHByZXNzL3dwLWFkbWluL3VwZ3JhZGUucGhwJzsgIn0seyJzdGVwIjoibG9naW4iLCJ1c2VybmFtZSI6ImFkbWluIiwicGFzc3dvcmQiOiJwYXNzd29yZCJ9XX0=)

The oldest WordPress version that worked for me this way is `5.9.9` – I
don't think the SQLite integration plugin works with WordPress versions
<= 5.8.

Related to #994
@adamziel adamziel changed the title Enhancement: Add older WordPress versions Document loading older WordPress versions with a Blueprint Mar 29, 2024
@ironnysh
Copy link
Collaborator

ironnysh commented Apr 6, 2024

Document how to use the above Blueprint to load older WordPress releases. Perhaps even link to that doc page from the UI, e.g. "Need an older WordPress version?"

That's a good place for it.

Maybe this could also be a good opportunity to reorder the buttons inside the Additional actions pop-out menu?

Happy to take a shot at this in a PR :-)

BTW, an interesting tidbit: versions 5.9-6.5 cover 83% of the "market"

adamziel added a commit that referenced this issue Apr 12, 2024
…sing older releases

Ensures WordPress 5.9 and 6.0 are no longer referenced in the
documentation as they are no longer supported.

Provides instructions for people who still need to use them.

Closes #994

This is a quick stab at it, feel free to take over @ironnysh, I gave you
write permissions so you could update this PR.

cc @ironnysh
@adamziel
Copy link
Collaborator

@ironnysh yay! Let's continue the conversation in #1235.

adamziel added a commit that referenced this issue Apr 16, 2024
…sing 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]>
@jennydupuy
Copy link

Hi,

This blueprint (also available in playground documentation) don’t work anymore.

{
    "landingPage": "/wp-admin",
    "steps": [
        {
            "step": "writeFile",
            "path": "/tmp/wordpress.zip",
            "data": {
                "resource": "url",
                "url": "https://playground.wordpress.net/plugin-proxy.php?url=https://wordpress.org/wordpress-5.9.9.zip",
                "caption": "Downloading the WordPress Release"
            }
        },
        {
            "step": "importWordPressFiles",
            "wordPressFilesZip": {
                "resource": "vfs",
                "path": "/tmp/wordpress.zip"
            },
            "pathInZip": "/wordpress",
            "progress": {
                "weight": 20,
                "caption": "Importing the WordPress release"
            }
        },
        {
            "step": "runPHP",
            "code": "<?php $_GET['step'] = 'upgrade_db'; require '/wordpress/wp-admin/upgrade.php'; "
        },
        {
            "step": "login",
            "username": "admin",
            "password": "password"
        }
    ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
6 participants