Skip to content

Comments

Add Live Preview Blueprint for WordPress.org#4080

Open
adamziel wants to merge 1 commit intojohngodley:trunkfrom
adamziel:add-wordpress-playground-blueprint
Open

Add Live Preview Blueprint for WordPress.org#4080
adamziel wants to merge 1 commit intojohngodley:trunkfrom
adamziel:add-wordpress-playground-blueprint

Conversation

@adamziel
Copy link

Hi! I noticed that Redirection doesn't have a Live Preview button on its WordPress.org page yet, so I created a blueprint configuration for it.

About Live Preview

The Live Preview feature allows users to try plugins directly in their browser without installing anything, powered by WordPress Playground. This can significantly increase user engagement and conversions.

Learn more:

What's Included

This PR adds .wordpress-org/blueprints/blueprint.json which configures the preview to:

  • Install and activate Redirection
  • Log users in automatically
  • Direct them to the Redirection management page
  • Import demo redirects (301 and 302 examples)
  • Create target pages to demonstrate working redirects

Testing the Blueprint

You can test this blueprint right now in WordPress Playground (before merging):

Try it in Playground

This lets you see exactly how users will experience the Live Preview!

How to Enable

After merging this PR and syncing to your WordPress.org SVN repository at /assets/blueprints/blueprint.json:

  1. Log in to your WordPress.org account
  2. Go to your plugin's Advanced page
  3. Scroll to "Toggle Live Preview"
  4. Set the preview to "public"

The Live Preview button will then appear on your plugin page!

You can also test before enabling publicly by adding ?preview=1 to your plugin URL: https://wordpress.org/plugins/redirection/?preview=1

Note on SVN Deployment

Since this repository uses a build process, you'll need to ensure the .wordpress-org directory is deployed to SVN's /assets directory. This can be done by either:

  1. Option A (Recommended): Update the release script in package.json to include the .wordpress-org directory: bash cp -R .wordpress-org release/

  2. Option B: Manually copy .wordpress-org to the SVN assets/ directory after running yarn dist:svn: bash yarn dist:svn cd svn mkdir -p assets/blueprints cp ../../../.wordpress-org/blueprints/blueprint.json assets/blueprints/ svn add assets/blueprints/blueprint.json svn ci

Customization

Feel free to customize the blueprint to better showcase your plugin's features. You can:

  • Change the landing page
  • Add demo content or sample data
  • Configure specific PHP/WordPress versions
  • Add setup steps

See the Blueprint documentation for all available options.


Let me know if you'd like any adjustments to better showcase Redirection!

Hi! I noticed that Redirection doesn't have a Live Preview button on its WordPress.org page yet, so I created a blueprint configuration for it.

## About Live Preview

The [Live Preview feature](https://developer.wordpress.org/plugins/wordpress-org/previews-and-blueprints/) allows users to try plugins directly in their browser without installing anything, powered by [WordPress Playground](https://playground.wordpress.net/). This can significantly increase user engagement and conversions.

**Learn more:**
- [Plugin Handbook - Previews and Blueprints](https://developer.wordpress.org/plugins/wordpress-org/previews-and-blueprints/)
- [WordPress Playground Documentation](https://wordpress.github.io/wordpress-playground/)

## What's Included

This PR adds `.wordpress-org/blueprints/blueprint.json` which configures the preview to:
- Install and activate Redirection
- Log users in automatically
- Direct them to the Redirection management page
- Import demo redirects (301 and 302 examples)
- Create target pages to demonstrate working redirects

## Testing the Blueprint

You can test this blueprint right now in WordPress Playground (before merging):

**[▶️ Try it in Playground](https://playground.wordpress.net/?blueprint-url=https%3A%2F%2Fraw.githubusercontent.com%2Fjohngodley%2Fredirection%2Fadd-wordpress-playground-blueprint%2F.wordpress-org%2Fblueprints%2Fblueprint.json)**

This lets you see exactly how users will experience the Live Preview!

## How to Enable

After merging this PR and syncing to your WordPress.org SVN repository at `/assets/blueprints/blueprint.json`:

1. Log in to your WordPress.org account
2. Go to [your plugin's Advanced page](https://wordpress.org/plugins/redirection/advanced/)
3. Scroll to **"Toggle Live Preview"**
4. Set the preview to **"public"**

The Live Preview button will then appear on your plugin page!

You can also test before enabling publicly by adding `?preview=1` to your plugin URL:
https://wordpress.org/plugins/redirection/?preview=1

## Note on SVN Deployment

Since this repository uses a build process, you'll need to ensure the `.wordpress-org` directory is deployed to SVN's `/assets` directory. This can be done by either:

1. **Option A (Recommended):** Update the `release` script in `package.json` to include the `.wordpress-org` directory:
   ```bash
   cp -R .wordpress-org release/
   ```

2. **Option B:** Manually copy `.wordpress-org` to the SVN `assets/` directory after running `yarn dist:svn`:
   ```bash
   yarn dist:svn
   cd svn
   mkdir -p assets/blueprints
   cp ../../../.wordpress-org/blueprints/blueprint.json assets/blueprints/
   svn add assets/blueprints/blueprint.json
   svn ci
   ```

## Customization

Feel free to customize the blueprint to better showcase your plugin's features. You can:
- Change the landing page
- Add demo content or sample data
- Configure specific PHP/WordPress versions
- Add setup steps

See the [Blueprint documentation](https://wordpress.github.io/wordpress-playground/blueprints-api/index) for all available options.

---

Let me know if you'd like any adjustments to better showcase Redirection!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant