diff --git a/packages/playground/blueprints/src/lib/steps/import-wxr.ts b/packages/playground/blueprints/src/lib/steps/import-wxr.ts index dc1de5ee5d..c796fb8d8c 100644 --- a/packages/playground/blueprints/src/lib/steps/import-wxr.ts +++ b/packages/playground/blueprints/src/lib/steps/import-wxr.ts @@ -42,6 +42,10 @@ export const importWxr: StepHandler> = async ( await playground.run({ code: ` 'Administrator') )[0]; $importer = new WXR_Importer( array( diff --git a/packages/playground/remote/src/lib/setup-fetch-network-transport.ts b/packages/playground/remote/src/lib/setup-fetch-network-transport.ts index 03acdd9e7a..52bc47f980 100644 --- a/packages/playground/remote/src/lib/setup-fetch-network-transport.ts +++ b/packages/playground/remote/src/lib/setup-fetch-network-transport.ts @@ -64,7 +64,11 @@ export async function setupFetchNetworkTransport(playground: UniversalPHP) { export async function handleRequest(data: RequestData, fetchFn = fetch) { const hostname = new URL(data.url).hostname; - const fetchUrl = ['w.org', 's.w.org'].includes(hostname) + const fetchUrl = [ + 'w.org', + 's.w.org', + 'wpthemetestdata.files.wordpress.com', + ].includes(hostname) ? `/plugin-proxy.php?url=${encodeURIComponent(data.url)}` : data.url; diff --git a/packages/playground/website/public/plugin-proxy.php b/packages/playground/website/public/plugin-proxy.php index f6da2c3e9e..ab8cf0159f 100644 --- a/packages/playground/website/public/plugin-proxy.php +++ b/packages/playground/website/public/plugin-proxy.php @@ -338,7 +338,7 @@ function ($curl, $body) use (&$extra_headers_sent, $default_response_headers) { // Proxy the current request to $_GET['url'] and return the response, // but only if the URL is allowlisted. $url = $_GET['url']; - $allowed_domains = ['api.wordpress.org', 'w.org', 'wordpress.org', 's.w.org']; + $allowed_domains = ['api.wordpress.org', 'w.org', 'wordpress.org', 's.w.org', 'wpthemetestdata.files.wordpress.com']; $parsed_url = parse_url($url); if (!in_array($parsed_url['host'], $allowed_domains)) { http_response_code(403);