Repository navigation
fix: gate the network column renderers on the network capability - #467
Merged
josephfusco merged 2 commits intoSep 4, 2026
Merged
Conversation
Both render callbacks returned network-wide data to any caller: the users column named the sites a user is online on, the sites column drew the avatar stack and count. Only the column registration was gated, which holds as long as nothing else can put a column called presence_online on those screens. Also states on the wp_presence_network_capability filter what a lowered value grants, since a site-level capability there hands every holder presence for sites they are not a member of.
The site boundary was true by construction while every read was scoped by table prefix, so nothing asserted it. Covers the two halves the audit asks for: an editor is denied the admin room on a site they are not a member of, and a row written on one site is not readable from another. test_users_column_shows_a_dash_for_an_offline_user() called the renderer with no capability and passed because the user was offline rather than because anything gated it. It becomes a network admin now, which is what it always meant to assert.
Contributor
|
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. |
Contributor
🛝 WordPress PlaygroundsBuilt from 774fa21
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #467 +/- ##
============================================
+ Coverage 95.89% 95.96% +0.07%
Complexity 255 255
============================================
Files 21 21
Lines 3047 3052 +5
============================================
+ Hits 2922 2929 +7
+ Misses 125 123 -2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #137
Both Network Admin render callbacks returned network-wide presence to any caller, since only the column registration was gated. That holds while ours is the only thing that can put a column called
presence_onlineon those screens, which is not a property this plugin controls. Called as a subscriber:wp_presence_render_network_users_column( '', 'presence_online', $editor )localhost:8891/testpath0000025/$outputuntouchedwp_presence_render_network_sites_column( 'presence_online', $blog_id )Notes:
test_users_column_shows_a_dash_for_an_offline_usercalled the renderer uncapped and passed because the user was offline. It becomes a network admin first, which is what it always meant to assert.wp_presence_network_capabilitydocblock now says what a lowered value grants.Testing:
npm run test:multisite: 466 tests, 986 assertions, 3 skipped.npm test: 466 tests, 739 assertions, 131 skipped.composer phpcs: clean.$wpdb->base_prefixfails the isolation test, deleting either gate fails that column's test, and nothing else moves.do_not_allowand registering its ownpresence_onlinecolumn, which is the third-plugin case above. Onmainthat viewer sees the avatar stacks and the site names; on this branch both columns are empty. A super admin sees no change either way.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: Drafting the gate, the tests and this description. I ran the measurements, the mutation checks and the browser comparison, and reviewed what landed.