Skip to content

refactor: replace hardcoded admin/online room string with helper - #176

Merged
josephfusco merged 1 commit into
WordPress:mainfrom
i-am-chitti:fix/154-admin-online-room-helper
Aug 7, 2026
Merged

refactor: replace hardcoded admin/online room string with helper#176
josephfusco merged 1 commit into
WordPress:mainfrom
i-am-chitti:fix/154-admin-online-room-helper

Conversation

@i-am-chitti

Copy link
Copy Markdown
Contributor

Description:

Adds wp_presence_admin_room(), mirroring wp_presence_post_room(), and uses it in place of the 'admin/online' literal across heartbeat.php, user-list.php, admin-bar.php, lifecycle.php, and the Who's Online widget (which also drops its own ROOM constant, since a class constant can't hold a function call's return value).

Related:

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5
Used for: Implementation across all six files; reviewed and verified by me.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props iamchitti.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

▶ Preview in WordPress Playground

Open in WordPress Playground

Boots a fresh WordPress with this PR's presence-api build, seeds 5 demo users, and drops you on the dashboard.

Stress-test variant: 40 demo users · Built from b1c4927cde56b94f36229b2d541f153cc5febb92. Auto-updates when you push.

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.11%. Comparing base (3406134) to head (b1c4927).
⚠️ Report is 31 commits behind head on main.

Files with missing lines Patch % Lines
includes/heartbeat.php 33.33% 2 Missing ⚠️
includes/user-list.php 0.00% 2 Missing ⚠️
includes/admin-bar.php 0.00% 1 Missing ⚠️
includes/functions.php 0.00% 1 Missing ⚠️
...s/widgets/class-wp-presence-widget-whos-online.php 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #176      +/-   ##
============================================
- Coverage     29.13%   29.11%   -0.02%     
  Complexity      164      164              
============================================
  Files            15       15              
  Lines          1840     1841       +1     
============================================
  Hits            536      536              
- Misses         1304     1305       +1     
Flag Coverage Δ
phpunit 29.11% <30.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@josephfusco josephfusco added [Type] Enhancement A suggestion for improvement of an existing feature [Area] Heartbeat Issues for the heartbeat subsystem php Pull requests that update php code labels Aug 6, 2026
@josephfusco
josephfusco merged commit 935760a into WordPress:main Aug 7, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Heartbeat Issues for the heartbeat subsystem php Pull requests that update php code [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants