Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ slug: /developers/architecture/browser-service-workers

# Service Workers

[A Service Worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers) is used to handle the HTTP traffic using the in-browser PHPRequestHandler.
[A Service Worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers) is used to handle the HTTP traffic using the in-browser [`PHPRequestHandler`](/developers/architecture/browser-concepts).

Imagine your PHP script renders the following page [in the iframe viewport](#iframe-based-rendering):
Imagine your PHP script renders the following page [in the iframe viewport](/developers/architecture/browser-iframe-rendering):

```html
<html>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A self-hosted Playground can be embedded as an iframe.
<iframe src="https://my-playground.com"></iframe>
```

Or dynamically loaded by passing the remote URL to the Playground Client.
Or dynamically loaded by passing the remote URL to the [Playground Client](/developers/apis/javascript-api/playground-api-client).

```ts
import { startPlaygroundWeb } from '@wp-playground/client';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ As Playground [streams rather than serves](/about#streamed-not-served) WordPress

### Iframe quirks

Playground renders WordPress in an `iframe` so clicking links with `target="_top"` will reload the page you’re working on.
Playground renders WordPress in an [`iframe`](/developers/architecture/browser-iframe-rendering) so clicking links with `target="_top"` will reload the page you’re working on.
Also, JavaScript popups originating in the `iframe` may not always display.

### Run WordPress PHP functions
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/site/docs/main/contributing/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Like all WordPress projects, Playground uses GitHub to manage code and track iss

:::info Contribute to Playground Tools

This guide includes links to the main repository, but all the steps and options apply for both. If you're interested in the plugins or local development tools—start there.
This guide includes links to the main repository, but all the steps and options apply for both. If you're interested in the plugins or [local development](/developers/local-development/) tools—start there.

:::

Expand Down
4 changes: 2 additions & 2 deletions packages/docs/site/docs/main/contributing/coding-standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ slug: /contributing/coding-standards

## Error messages

A good error message informs the user of the following steps to take. Any ambiguity in errors thrown by Playground public APIs will prompt the developers to open issues.
A good error message informs the user of the following steps to take. Any ambiguity in errors thrown by Playground [Public APIs](/developers/apis/) will prompt the developers to open issues.

Consider a network error, for example—can we infer the type of error and display a relevant message summarizing the next steps?

Expand All @@ -27,7 +27,7 @@ Public APIs are easy to add and hard to remove. It only takes one PR to introduc

## Blueprints

Blueprints are the primary way to interact with Playground. These JSON files describe a set of steps that Playground executes in order.
[Blueprints](/blueprints/getting-started) are the primary way to interact with Playground. These JSON files describe a set of steps that Playground executes in order.

### Guidelines

Expand Down
4 changes: 2 additions & 2 deletions packages/docs/site/docs/main/contributing/contributor-day.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The [Visual Studio Code Playground extension](https://marketplace.visualstudio.c

### @wp-playground/cli NPM package

`@wp-playground/cli` is a CLI tool that allows you to spin up a WordPress site with a single command. No Docker, MySQL, or Apache are required.
[`@wp-playground/cli`](/developers/local-development/wp-playground-cli) is a CLI tool that allows you to spin up a WordPress site with a single command. No Docker, MySQL, or Apache are required.

#### Prerequisites

Expand Down Expand Up @@ -88,7 +88,7 @@ npx @wp-playground/cli@latest server --auto-mount

#### Test a Gutenberg PR with Playground in the browser

You don’t need a local development environment to test Gutenberg PRs—use Playground to do it directly in the browser.
You don’t need a [local development environment](/developers/local-development/) to test Gutenberg PRs—use Playground to do it directly in the browser.

1. Copy the ID of the PR you’d like to test (pick one from the [list of open Pull Requests](https://github.com/WordPress/gutenberg/pulls)).
2. Open Playground’s [Gutenberg PR Previewer](https://playground.wordpress.net/gutenberg.html) and paste the ID you copied.
Expand Down
2 changes: 2 additions & 0 deletions packages/docs/site/docs/main/contributing/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ You can contribute by [opening an issue in the project repository](https://githu

If you feel up to it, write the content in the issue description, and the project contributors will take care of the rest.

Would you like to see the documentation in your language? Check the [Translation section](/contributing/translations).

### Forking the repo, edit files locally and opening Pull Requests

If you are familiar with markdown, you can [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) the `wordpress-playground` repo and propose changes and new documentation pages by submitting a Pull Request.
Expand Down
1 change: 1 addition & 0 deletions packages/docs/site/docs/main/contributing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ WordPress Playground is an open-source project that welcomes contributors of all
- Documentation? See the [documentation section](/contributing/documentation).
- Reporting bugs? Open a [new issue](https://github.com/WordPress/wordpress-playground/issues/new) in the main GitHub repository, or in [Playground Tools](https://github.com/WordPress/playground-tools/issues/new).
- Ideas, designs, or anything else? Open a [GitHub discussion](https://github.com/WordPress/wordpress-playground/discussions), and let's talk!
- Translation? see the [translation section](/contributing/translations).

## Guidelines

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/site/docs/main/contributing/translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ slug: /contributing/translations

# Contributions to translations

You can help translate the Playground documentation into any language. This page provides a comprehensive guide on how to contribute to the translation of Playground docs.
You can help translate the Playground [documentation](/contributing/documentation) into any language. This page provides a comprehensive guide on how to contribute to the translation of Playground docs.

## How can I contribute to translations?

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/site/docs/main/guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_class_name: navbar-build-item

# Guides

In this section we present a selection of guides that will help you to both work with, and to better understand, a variety of topics related to WordPress Playground.
In this section we present a selection of guides that will help you to both work with, and to better understand, a variety of topics related to [WordPress Playground](/).

## [How to ship a real WordPress site in a native iOS app via Playground?](/guides/wordpress-native-ios-app)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Another way of generating content for your theme or plugin is via the `wp-cli` s

[<kbd> &nbsp; Run Blueprint &nbsp; </kbd>](https://playground.wordpress.net/builder/builder.html#{%22landingPage%22:%22/wp-admin/edit.php%22,%22login%22:true,%22steps%22:[{%22step%22:%22wp-cli%22,%22command%22:%22wp%20post%20generate%20--count=20%20--post_type=post%20--post_date=1999-01-04%22}]})

You can also use the `wp-cli` step in combination with the `writeFile` step to create posts based on existing content and to import images to the Playground instance:
You can also use the [`wp-cli` step](/blueprints/steps#WPCliStep) in combination with the [`writeFile` step](/blueprints/steps#WriteFileStep) to create posts based on existing content and to import images to the Playground instance:

```json
{
Expand Down Expand Up @@ -192,7 +192,7 @@ Check the ["Use wp-cli to add a post with image"](https://github.com/WordPress/b

## `runPHP`

With the [`runPHP` step](https://wordpress.github.io/wordpress-playground/blueprints/steps#runPHP) you can run any PHP code you require to insert info into your WordPress installation, for example by using the [`wp_insert_post` function](https://developer.wordpress.org/reference/functions/wp_insert_post/).
With the [`runPHP` step](/blueprints/steps#runPHP) you can run any PHP code you require to insert info into your WordPress installation, for example by using the [`wp_insert_post` function](https://developer.wordpress.org/reference/functions/wp_insert_post/).

```json
{
Expand Down
6 changes: 4 additions & 2 deletions packages/docs/site/docs/main/quick-start-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,16 @@ Compatibility testing with so many WordPress and PHP versions was always a pain.

:::

You can also use the `wp` and `php` query parameters to open Playground with the right versions already loaded:
You can also use the `wp` and `php` [query parameters](/developers/apis/query-api) to open Playground with the right versions already loaded:

- https://playground.wordpress.net/?wp=6.5
- https://playground.wordpress.net/?php=8.3
- https://playground.wordpress.net/?php=8.2&wp=6.2

<ThisIsQueryApi />

To learn more about preparing content for demos, see the [providing content for your demo guide](/guides/providing-content-for-your-demo).

:::info Major versions only

You can specify major versions like `wp=6.2` or `php=8.1` and expect the most recent release in that line. You cannot, however, request older minor versions so neither `wp=6.1.2` nor `php=7.4.9` will work.
Expand All @@ -109,6 +111,6 @@ This is different from the import feature described above. The import feature ex

## Build apps with WordPress Playground

WordPress Playground is programmable which means you can build WordPress apps, setup plugin demos, and even use it as a zero-setup local development environment.
WordPress Playground is programmable, which means you can [build WordPress apps](/developers/build-your-first-app), setup plugin demos, and even use it as a zero-setup [local development environment](/developers/local-development/).

To learn more about developing with WordPress Playground, check out the [development quick start](/developers/build-your-first-app) section.