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

Plugin proxy: Allow requests to WordPress.org #1154

Merged
merged 1 commit into from
Mar 29, 2024
Merged

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented Mar 29, 2024

This change enables testing older WordPress releases with the following 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"
        }
    ]
}

Click here to test

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

This change enables testing older WordPress releases with the following 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"
        }
    ]
}
```

[Click here to test](https://playground.wordpress.net/#eyJsYW5kaW5nUGFnZSI6Ii93cC1hZG1pbiIsInN0ZXBzIjpbeyJzdGVwIjoid3JpdGVGaWxlIiwicGF0aCI6Ii90bXAvd29yZHByZXNzLnppcCIsImRhdGEiOnsicmVzb3VyY2UiOiJ1cmwiLCJ1cmwiOiJodHRwczovL3BsYXlncm91bmQud29yZHByZXNzLm5ldC9wbHVnaW4tcHJveHkucGhwP3VybD1odHRwczovL3dvcmRwcmVzcy5vcmcvd29yZHByZXNzLTUuOS45LnppcCIsImNhcHRpb24iOiJEb3dubG9hZGluZyB0aGUgV29yZFByZXNzIFJlbGVhc2UifX0seyJzdGVwIjoiaW1wb3J0V29yZFByZXNzRmlsZXMiLCJ3b3JkUHJlc3NGaWxlc1ppcCI6eyJyZXNvdXJjZSI6InZmcyIsInBhdGgiOiIvdG1wL3dvcmRwcmVzcy56aXAifSwicGF0aEluWmlwIjoiL3dvcmRwcmVzcyIsInByb2dyZXNzIjp7IndlaWdodCI6MjAsImNhcHRpb24iOiJJbXBvcnRpbmcgdGhlIFdvcmRQcmVzcyByZWxlYXNlIn19LHsic3RlcCI6InJ1blBIUCIsImNvZGUiOiI8P3BocCAkX0dFVFsnc3RlcCddID0gJ3VwZ3JhZGVfZGInOyByZXF1aXJlICcvd29yZHByZXNzL3dwLWFkbWluL3VwZ3JhZGUucGhwJzsgIn0seyJzdGVwIjoibG9naW4iLCJ1c2VybmFtZSI6ImFkbWluIiwicGFzc3dvcmQiOiJwYXNzd29yZCJ9XX0=)
@adamziel adamziel merged commit 8ce6087 into trunk Mar 29, 2024
4 checks passed
@adamziel adamziel deleted the allow-wp-org-requests branch March 29, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant