diff --git a/packages/docs/site/docs/blueprints/03-data-format.md b/packages/docs/site/docs/blueprints/03-data-format.md index 2a0d86944b..5f317c79f1 100644 --- a/packages/docs/site/docs/blueprints/03-data-format.md +++ b/packages/docs/site/docs/blueprints/03-data-format.md @@ -70,12 +70,12 @@ The `preferredVersions` property declares your preferred PHP and WordPress versi You can use the `features` property to turn on or off certain features of the Playground instance. It can contain the following properties: -- `networking`: Defaults to `false`. Enables or disables the networking support for Playground. If enabled, [`wp_safe_remote_get`](https://developer.wordpress.org/reference/functions/wp_safe_remote_get/) and similar WordPress functions will actually use `fetch()` to make HTTP requests. If disabled, they will immediately fail instead. You will need this property enabled if you want the user to be able to install plugins or themes. +- `networking`: Defaults to `true`. Enables or disables the networking support for Playground. If enabled, [`wp_safe_remote_get`](https://developer.wordpress.org/reference/functions/wp_safe_remote_get/) and similar WordPress functions will actually use `fetch()` to make HTTP requests. If disabled, they will immediately fail instead. You will need this property enabled if you want the user to be able to install plugins or themes. ```js { "features": { - "networking": true + "networking": false }, } ``` diff --git a/packages/docs/site/docs/developers/06-apis/query-api/01-index.md b/packages/docs/site/docs/developers/06-apis/query-api/01-index.md index 1a085fd6fc..6c2bcf161d 100644 --- a/packages/docs/site/docs/developers/06-apis/query-api/01-index.md +++ b/packages/docs/site/docs/developers/06-apis/query-api/01-index.md @@ -26,7 +26,7 @@ You can go ahead and try it out. The Playground will automatically install the t | `php` | `8.0` | Loads the specified PHP version. Accepts `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `8.0`, `8.1`, `8.2`, `8.3`, `8.4` or `latest`. | | `wp` | `latest` | Loads the specified WordPress version. Accepts the last three major WordPress versions. As of June 1, 2024, that's `6.3`, `6.4`, or `6.5`. You can also use the generic values `latest`, `nightly`, or `beta`. | | `blueprint-url` | | The URL of the Blueprint that will be used to configure this Playground instance. | -| `networking` | `no` | Enables or disables the networking support for Playground. Accepts `yes` or `no`. | +| `networking` | `yes` | Enables or disables the networking support for Playground. Accepts `yes` or `no`. | | `plugin` | | Installs the specified plugin. Use the plugin name from the WordPress Plugins Directory URL. For example, if the URL is `https://wordpress.org/plugins/wp-lazy-loading/`, the plugin name would be `wp-lazy-loading`. You can pre-install multiple plugins by saying `plugin=coblocks&plugin=wp-lazy-loading&…`. Installing a plugin automatically logs the user in as an admin. | | `theme` | | Installs the specified theme. Use the theme name from the WordPress Themes Directory URL. For example, if the URL is `https://wordpress.org/themes/disco/`, the theme name would be `disco`. Installing a theme automatically logs the user in as an admin. | | `url` | `/wp-admin/` | Load the specified initial WordPress page in this Playground instance. | diff --git a/packages/docs/site/docs/developers/23-architecture/02-wasm-php-overview.md b/packages/docs/site/docs/developers/23-architecture/02-wasm-php-overview.md index dfda576f01..9950f1387b 100644 --- a/packages/docs/site/docs/developers/23-architecture/02-wasm-php-overview.md +++ b/packages/docs/site/docs/developers/23-architecture/02-wasm-php-overview.md @@ -24,4 +24,7 @@ When it comes to networking, WebAssembly programs are limited to calling JavaScr In Node.js, the answer involves a WebSocket to TCP socket proxy, [Asyncify](https://emscripten.org/docs/porting/asyncify.html), and patching deep PHP internals like php_select. It's complex, but there's a reward. The Node.js-targeted PHP build can request web APIs, install composer packages, and even connect to a MySQL server. -In the browser, networking is supported to a limited extent. Network calls initiated using `wp_safe_remote_get`, like the ones in the plugin directory or the font library, are translated into `fetch()` calls and succeed if the remote server sends the correct CORS headers. However, a full support for arbitrary HTTPS connection involves opening a raw TCP socket which is not possible in the browser. There is an [open GitHub issue](https://github.com/WordPress/wordpress-playground/issues/85) that explores possible ways of addressing this problem. +In the browser, networking is supported in two ways: + +- A fast transport for `wp_safe_remote_get` to translate them into `fetch()` calls. +- A slower transport for all other network calls that [parses the TLS transmission](https://github.com/WordPress/wordpress-playground/pull/1926) initiated by PHP and translates it to a `fetch()` call. diff --git a/packages/docs/site/docs/main/about/index.md b/packages/docs/site/docs/main/about/index.md index 76c545e8f3..2fa00bd169 100644 --- a/packages/docs/site/docs/main/about/index.md +++ b/packages/docs/site/docs/main/about/index.md @@ -48,8 +48,6 @@ The WordPress you see when you open Playground in your browser is a WordPress th The loading screen and progress bar you see on Playground includes both the streaming of those foundational technologies to your browser and configuration steps from [WordPress Blueprints](/blueprints) (see [examples](/blueprints/examples)), so that a full server, WordPress software, Theme & Plugin solutions and configuration instructions can be streamed over-the-wire. -While many WordPress solutions may require internet connectivity to interact with social networks, live feeds, and other internet services, those connections [could be limited in Playground](/developers/architecture/wasm-php-overview#networking-support-varies-between-platforms). However, by enabling network connectivity in the Customize Playground settings modal [(example URL w/ query parameter)](https://playground.wordpress.net/?networking=yes), you can mostly wire up internet connectivity to WordPress in Playground. - ## What makes Playground different from running WordPress on a web server or local desktop app? Web applications like WordPress have long relied on server technologies [to run logic](/developers/architecture/wasm-php-overview) and [store data](/developers/architecture/wordpress#sqlite). diff --git a/packages/docs/site/i18n/ja/docusaurus-plugin-content-docs/current/main/about/index.md b/packages/docs/site/i18n/ja/docusaurus-plugin-content-docs/current/main/about/index.md index 2dad26546c..2831029c37 100644 --- a/packages/docs/site/i18n/ja/docusaurus-plugin-content-docs/current/main/about/index.md +++ b/packages/docs/site/i18n/ja/docusaurus-plugin-content-docs/current/main/about/index.md @@ -132,12 +132,6 @@ Playground に表示される読み込み画面と進行状況バーには、ブ The loading screen and progress bar you see on Playground includes both the streaming of those foundational technologies to your browser and configuration steps from [WordPress Blueprints](/blueprints) (see [examples](/blueprints/examples)), so that a full server, WordPress software, Theme & Plugin solutions and configuration instructions can be streamed over-the-wire. --> -多くの WordPress ソリューションでは、ソーシャルネットワーク、ライブフィード、その他のインターネットサービスと連携するためにインターネット接続が必要になりますが、[Playground ではこれらの接続が制限される可能性があります](/developers/architecture/wasm-php-overview#networking-support-varies-between-platforms)。ただし、Playground のカスタマイズ設定モーダル[クエリパラメータ付き URL の例](https://playground.wordpress.net/?networking=yes)でネットワーク接続を有効にすると、Playground 内で WordPress へのインターネット接続をほぼ確実に確立できます。 - - - ## Playground は、Web サーバーまたはローカル デスクトップ アプリで WordPress を実行することと何が違うのでしょうか?