WordPress/wordpress-playground

Improve the networking disabled error message

ironnysh opened this issue · 4 comments

Hi,

When users try to install a theme or a plugin in a Playground instance whose networking feature is disabled (the default state), they get an error message, which could be more helpful.

Screenshot 2024-01-09 at 15 55 19

While the discussion in the GitHub issue is valuable, it doesn't provide a practical solution to the problem (namely, enabling networking 😀).

I'd suggest the following rewrite of the text here:

Note

Network access is an experimental opt-in feature, which means you need to enable it to allow Playground to access the Plugins/Themes directories.
You can enable global networking support using the Query API (for example, https://playground.wordpress.net/?networking=yes) or the Blueprint API (add "features": { "networking": true } to the JSON file).

Bonus: A unified error message for both the Themes and Plugins pages.

I'm happy to open a PR if the proposed changes are good to go.

A few additional comments:

  • There's no reference to the networking option in the Blueprints API documentation—only in the Blueprint JSON schema.
  • Should streamline the boolean value: yes in the Query API vs. "true" in the Blueprints API.
  • The error message includes a Try Again button, which does nothing.
  • The error message appears twice on the Featured plugins tab.
Screenshot 2024-01-09 at 15 56 04

This sounds fantastic @ironnysh! If you'd like to open a PR, I'll be happy to review and merge :)

Should streamline the boolean value: yes in the Query API vs. "true" in the Blueprints API.

That's a good note, we could make the Query API accept both yes and true, and perhaps even use true in the documentation.

This sounds fantastic @ironnysh! If you'd like to open a PR, I'll be happy to review and merge :)

Coolio, on it. Thanks!

we could make the Query API accept both yes and true, and perhaps even use true in the documentation.

I imagine most developers would associate boolean with true, but doesn't hurt to have options ;-)

BTW, I found a reference to networking in the documentation. I'll open a PR for this one as well to clarify common use cases covered by networking (there's also this issue).

Finally, can (or even should... 🤨) the Try Again button be used to regenerate the same Playground instance with networking enabled, or is it too much? :-)

Hmm, the button is part of core. Is there a way to hide it?