-
Notifications
You must be signed in to change notification settings - Fork 322
[Documentation] Adding troubleshooting sections for WP-CLI database connections #2333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
Lovely, thank you @fellyph! I wonder if we could recognize that type of error and link to the doc page from the error message 🤔 |
packages/docs/site/docs/blueprints/09-troubleshoot-and-debug-blueprints.md
Outdated
Show resolved
Hide resolved
@@ -85,6 +85,33 @@ blueprint={{ | |||
] | |||
}} /> | |||
|
|||
## Running WP-CLI on Mounted Sites |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question (asking because I'm not sure): Is this only relevant to mounted sites? What I mean is, can you run WP-CLI commands on a non-mounted site?
I don't think you can, so it might be useful to reframe this around how to run WP CLI commands on a playground instance, ie, you need to mount the /wordpress/ folder, and also configure the SQLite integration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the section. You are right, the point is how to connect the playground with the WP-CLI.
@@ -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}`. | |||
- |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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
@@ -85,6 +85,37 @@ blueprint={{ | |||
] | |||
}} /> | |||
|
|||
## How to work with WP-CLI on Playground | |||
|
|||
To run WP-CLI commands on a Playground instance, you need to set up two things: mount the `/wordpress/` directory to your local filesystem and ensure the SQLite database integration is correctly configured. These steps allow WP-CLI to recognize the site as a valid WordPress installation and connect to its database. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note you can run WP-CLI commands via a special Blueprint step. This section is specific to running WP-CLI commands from your terminal when the WordPress site was created via Playground CLI – let's explain that.
packages/docs/site/docs/blueprints/09-troubleshoot-and-debug-blueprints.md
Outdated
Show resolved
Hide resolved
…lueprints.md Co-authored-by: Adam Zieliński <[email protected]>
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
Testing Instructions (or ideally a Blueprint)
adding-blueprints-tips
.npm run dev:docs