Add WP_DEBUG_LOG and WP_DEBUG_DISPLAY toggles - #2553
Conversation
Add toggles for enabling WP_DEBUG_LOG and WP_DEBUG_DISPLAY in Site Settings. - New Developer tab in Edit Site modal with Xdebug, debug log, and debug display toggles - Grouped controls update appdata, trigger server restart, and inject Blueprint constants - WP_DEBUG auto-enabled when either debug setting is on - Full CLI support via 'studio site set --debug-log --debug-display'
📊 Performance Test ResultsComparing 3ae0fcc vs trunk site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
ivan-ottinger
left a comment
There was a problem hiding this comment.
This will be a nice improvement! Great work!
Despite disabling the logging settings, the debug.log file is still being created on a fresh site.
From what I have seen so far, this is likely related to Playground's default PHP error logging that is overriding our settings.
Another, but minor design thing I noticed is that the tabs line does not stretch to the sides in a way we have on other existing modal in the app:
Apart from the above, the UI looks clean to me and CLI commands run well too. 🙂
There was a discussion with the Playground team on reverting those to the default state. I removed those under WordPress/wordpress-playground#3131, which was closed, but @adamziel mentioned it was solved in another way. |
I am not sure why but I did not see this issue when testing: I tried with the new site and enabled and disabled it multiple times and the setting was reflected correctly 🤔 |
| @@ -138,9 +138,20 @@ export function ContentTabSettings( { selectedSite }: ContentTabSettingsProps ) | |||
| <span className="line-clamp-1 break-all">{ selectedSite.phpVersion }</span> | |||
| </div> | |||
| </SettingsRow> | |||
| <tr> | |||
| <th colSpan={ 2 } className="pb-4 ltr:text-left rtl:text-right"> | |||
| <h3 className="text-black text-sm font-semibold mt-4">{ __( 'Developer' ) }</h3> | |||
There was a problem hiding this comment.
I think we might want to remove the padding of 1rem for the General tab to make sure that the tab looks more aligned.
# Conflicts: # apps/studio/src/modules/site-settings/edit-site-details.tsx
|
@ivan-ottinger nice catch! The debug.log being created with settings off was caused by Playground’s 0-playground.php which unconditionally sets error_log to Fixed by adding a Studio mu-plugin ( The site behavior should now match the selected options. Let me know what you think. |
|
@bcotrim, can we check this with the Playground team? It seems like something that should be fixed on the Playground side. |
ivan-ottinger
left a comment
There was a problem hiding this comment.
The debug.log being created with settings off was caused by Playground’s 0-playground.php which unconditionally sets error_log to
wp-content/debug.logand haslog_errors=1in its default php.ini. Any PHP warning would create the file.Fixed by adding a Studio mu-plugin (
0-configure-error-logging.php) that sets ini_set('log_errors', '0') when WP_DEBUG_LOG is disabled. This runs after Playground’s setup but before any warnings get triggered.The site behavior should now match the selected options. Let me know what you think.
Thank you for the updates, Bernardo! The changes look good to me and work well. I did not observe any further major issues, just a tiny naming thing (please see the inline comment below) and a different styling for disabled elements when when saving:
CleanShot.2026-02-20.at.12.33.47.mp4
(xdebug checkbox is disabled differently)
I am aware of Wojtek's comment on fixing the override on the Playground side. I am approving this PR in case we decide to move forward with the current approach.
| className="w-full [&>[role=tabpanel]]:h-64 [&>[role=tabpanel]]:overflow-auto" | ||
| tabs={ [ | ||
| { name: 'general', title: __( 'General' ) }, | ||
| { name: 'developer', title: __( 'Debugging' ) }, |
There was a problem hiding this comment.
I think we could change the name here (and in related references) as well (to debugging).
There was a problem hiding this comment.
xdebug checkbox is disabled differently
I noted this as well while reviewing this PR, I think it looks better now with recent changes
Shared: p1771600191281759-slack-C09GMMV3T6J Meanwhile should we merge this PR or hold on to Playground and design feedback? |
katinthehatsite
left a comment
There was a problem hiding this comment.
I think this looks good, I tested this on my end once again and checked the code and did not see any regressions. 👍
UI looks solid, so I think we should be good to merge. We could consider changing the MU plugin to an NPM patch for the Playground package, so it will be easier to notice when the fix arrives in the Playground core and to clean up our hotfix. |
|
@bcotrim one more thing - looking at labels, it may be unclear for some users what happens behind those new controls. Would it make sense to update descriptions and say "[...] by setting WP_DEBUG constant"? |
# Conflicts: # apps/studio/src/ipc-types.d.ts # apps/studio/src/storage/user-data.ts



Related issues
Fixes STU-4 #23
Proposed Changes
studio site set --debug-log --debug-displaywith--no-variantsTesting Instructions
studio site set --path /path/to/site --debug-log --debug-displayPre-merge Checklist