Skip to content

Add SCRIPT_DEBUG and WP_ENVIRONMENT_TYPE toggles to site debug settings #4333

Description

@ryanwelcher

Summary

Studio already lets you toggle WP_DEBUG_LOG and WP_DEBUG_DISPLAY from a site's settings (added in #2553). I'd like to request two more debug-related constants be exposed in the same place:

  • SCRIPT_DEBUGdocs
  • WP_ENVIRONMENT_TYPEdocs

Motivation

Today you can toggle the debug log and error display from the UI, but to change SCRIPT_DEBUG you have to manually edit wp-config.php. That's a problem for a couple of reasons:

  • It's essential for JavaScript block editor work. With SCRIPT_DEBUG enabled, WordPress loads the un-minified/dev builds of core scripts, which surfaces proper, readable React errors (component stack traces, dev warnings) instead of the minified production noise. Anyone developing blocks or working in the editor needs this on regularly.
  • Manual wp-config.php edits aren't reliably picked up. Studio manages wp-config.php, and hand-editing it doesn't always get reflected/persisted, so it's fragile compared to a first-class setting.

WP_ENVIRONMENT_TYPE is similarly useful to control from the UI — it lets you set the site to development/local/staging/production, which affects wp_get_environment_type() and the behavior of plugins/themes that branch on it. (Note the closed #165, where WP_ENVIRONMENT_TYPE being unset defaulted sites to production.)

Being able to toggle these in the same settings panel as the existing debug options — with Studio owning the config change — would be much more reliable than editing the file by hand.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions