Repository navigation
feat: move the debugger and DB viewer into a presence-debugger plugin - #760
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
🛝 WordPress PlaygroundsBuilt from df9aed9
|
There was a problem hiding this comment.
Thanks for picking this up. Keeping the hook names and load order means presence-scenes still works: in wp-env its assets load right after the debugger's, and Presence API keeps running with presence-debugger deactivated.
#732 also asks about the private functions. The debugger calls wp_presence_room_rows(), wp_presence_get_timeout(), wp_presence_has_table() and wp_presence_fragment_request(), and the DB viewer calls wp_presence_has_table(). Each needs a public equivalent, or a short note on why the call stays. The asset versions can keep WP_PRESENCE_VERSION.
.wp-env.json doesn't list ./plugins/presence-debugger, so npm run env:start no longer shows the debugger. phpcs.xml.dist and phpstan.neon.dist don't scan plugins/presence-debugger/ either. The moved files pass both, so add the path to each.
blueprint-scenes.json installs the preview-main zip, which won't carry the debugger after this merges, so the README's Presence Scenes demo would lose it along with the scene ticket. On your Playground question, please handle it here: zip plugins/presence-debugger in both playground workflows next to presence-api.zip, and install it as a second plugin in the preview blueprints and blueprint-scenes.json. The wordpress.org blueprint.json can wait for the next release.
In check-debug-exclusions.sh, .distignore has no includes/*.php lines left, so the distignore comparison can go instead of getting || true. The header needs updating too, since it says "two places" and then lists three. The comments added to the two workflows and make-pot.sh describe what used to happen. The workflow ones can go, and the make-pot.sh paragraph can go back to its first sentence.
Please add an AI disclosure to the description, or "None" if you didn't use any.
The WP_DEBUG-only admin-bar debugger and the ?presence-db=1 table viewer move out of Presence API into their own plugin, plugins/presence-debugger, following plugins/presence-scenes. The files move unchanged: presence-api drops its WP_DEBUG loader block and the new plugin's load.php registers the same hooks under the same WP_DEBUG + `Requires Plugins: presence-api` guard, so a normal site still loads nothing. - release-please: new presence-debugger package (0.1.0) and root exclude-path - coverage: the three exclusion lists (.distignore / phpunit.xml.dist / codecov.yml) and check-debug-exclusions.sh updated for the new location - presence-scenes' debugger test repointed to the moved file - Playground preview/main-build no longer inject the moved files Closes WordPress#732
…strap Matches the alphabetical order WordPress loads the plugins in, so the test environment mirrors a real site.
8227d3a to
df9aed9
Compare
|
Thanks for the thorough review — addressed all of it. Private functions. Kept the calls and documented each at the call site, since the public API doesn't cover what a debug tool needs:
Happy to promote any of these to the public API instead if you'd rather not have the debugger lean on internals. Tooling.
Stale comments. Removed from both playground workflows, and the Playground (done in this PR). Both workflows now build PR template. Added the AI disclosure section below. |
josephfusco
left a comment
There was a problem hiding this comment.
I pushed 1e0e259 to finish this off. Removing the debugger file from includes/ would have broken the WordPress.org demo in 0.16.0, so the demo now installs plugins/presence-debugger from the release tag, and sync-versions.sh moves that tag forward with each release. I also cut the comments about the move and shortened the private-function notes to one sentence each.
Closes #732. Builds on the split started in #558/#554 — this takes the debugger out of the bundle, as the issue describes.
Follows
plugins/presence-scenes: a newplugins/presence-debuggerplugin with its ownload.phpheader,Requires Plugins: presence-api, README,.distignore, and a release-please entry. The tools stayWP_DEBUG-only.What moved
The two files move unchanged (
git mv, 100% rename):includes/debugger-admin-bar.php→presence-debugger/debugger-admin-bar.phpincludes/db-viewer.php→presence-debugger/db-viewer.phptests/test-debugger-admin-bar.php→presence-debugger/tests/(only itsrequirepath changed)They keep the
presence-apitext domain they already had — those strings only show underWP_DEBUGand were deliberately kept out of the translation template, so the move adds no new domain for translators. There's nouninstall.php: neither tool writes an option, transient or cron event.Loader
presence-api.phpdrops itsWP_DEBUGblock. The newload.phpre-registers the exact same hooks, under the same guard, onplugins_loadedoncewp_get_presence()exists:Exclusion lists & release config
plugins/presence-api/.distignore,phpunit.xml.distcoverage, andcodecov.ymldrop the two oldincludes/*.phppaths;codecov.ymlnow ignoresplugins/presence-debugger/**.scripts/check-debug-exclusions.shnow checks that the two coverage lists agree (phpunit.xml.dist==codecov.yml) on the remaining always-excludedincludes/*.phpfiles; the.distignorecomparison is gone, since noincludes/*.phplines remain there.release-please-config.jsongets apresence-debuggerpackage (initial-version0.1.0) and the root package excludes its path;.release-please-manifest.jsonseeds0.1.0.scripts/sync-versions.shalready handles "every other package" generically, so it finds the newload.phpheader on its own.presence-scenes' debugger test is repointed to the new location; the test bootstrap loads the new plugin (beforepresence-scenes, matching plugin load order).Playground demo
Both
playground-previewandplayground-main-buildnow buildpresence-debugger.zipnext topresence-api.zipand publish it, and the four preview blueprints plusblueprint-scenes.jsoninstall it as a second plugin (the two multisite blueprints network-activate it afterpresence-api). The schema-validate step now requires exactly onepresence-debugger.zipalongsidepresence-api.zip, and the publish transform rewrites its URL too, so the preview demo and the README's Presence Scenes demo show the debugger again. The wordpress.orgblueprint.json(releasedpresence-api+ the debugger from the pinned tag) is untouched until the next release.Verification
Locally I ran
scripts/check-debug-exclusions.sh(passes) and validated the JSON. PHPUnit/PHPCS/PHPStan/php -lrun here in CI.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus
Used for: Working through this review — drafting the call-site notes that explain the debugger's use of presence-api internals, and the tooling and Playground wiring (phpcs/phpstan/wp-env, the exclusions check, the preview/main-build workflows and the blueprints). I reviewed the diff, ran the checks locally, and take responsibility for the result.