Skip to content

Conversation

fellyph
Copy link
Collaborator

@fellyph fellyph commented Jul 7, 2025

Motivation for the change, related issues

Issue #2332 identified a scenario where additional steps are required to mount WP-CLI with a mounted playground. This pull request adds a guide for the user to run WP-CLI command successfully with WordPress Playground.

Implementation details

  • Adds a new troubleshooting section to /blueprints/troubleshoot-and-debug detailing how to resolve "Error establishing a database connection".
  • Includes a corresponding Blueprint example in /blueprints/examples for quick reference.

Testing Instructions (or ideally a Blueprint)

  • Download the branch adding-blueprints-tips.
  • Install the node dependencies.
  • Run the documentation npm run dev:docs

@fellyph fellyph requested a review from bgrgicak July 7, 2025 09:37
@adamziel
Copy link
Collaborator

adamziel commented Jul 7, 2025

Lovely, thank you @fellyph! I wonder if we could recognize that type of error and link to the doc page from the error message 🤔

@@ -11,6 +11,54 @@ When you build Blueprints, you might run into issues. Here are tips and tools to

- Require `wp-load`: to run a WordPress PHP function using the `runPHP` step, you’d need to require [wp-load.php](https://github.com/WordPress/WordPress/blob/master/wp-load.php). So, the value of the `code` key should start with `"<?php require_once('wordpress/wp-load.php'); REST_OF_YOUR_CODE"`.
- Enable `networking`: to access wp.org assets (themes, plugins, blocks, or patterns), or load a stylesheet using [add_editor_style()](https://developer.wordpress.org/reference/functions/add_editor_style/) (say, when [creating a custom block style](https://developer.wordpress.org/news/2023/02/creating-custom-block-styles-in-wordpress-themes)), you’d need to enable the `networking` option: `"features": {"networking": true}`.
-
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above, the way this is worded makes it sound like you can run WP-CLI from non-mounted sites, which I don't think you can. (Happy to be proven wrong). My experience was that I needed to mount /wordpress/ locally to get WP-CLI working, so the documentation should rather be reframed around "How to get WP-CLI working with Playground"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonathanbossenger does it read better now? I saw @fellyph added a relevant commit after this interaction

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, reads better know, thanks folks

Copy link
Collaborator

@adamziel adamziel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, let's just address that one outstanding comment

Copy link
Collaborator

@adamziel adamziel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left one more question but other than that we're good to go

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.

4 participants