Skip to content

docs: document the existing Presence API extension points - #175

Merged
josephfusco merged 3 commits into
WordPress:mainfrom
i-am-chitti:issue-13
Aug 8, 2026
Merged

docs: document the existing Presence API extension points#175
josephfusco merged 3 commits into
WordPress:mainfrom
i-am-chitti:issue-13

Conversation

@i-am-chitti

Copy link
Copy Markdown
Contributor

Description

Currently, several extension points exist within the plugin but remain undocumented in the README.md file. Furthermore, the boundary between public stable APIs and internal private helpers needs to be explicitly defined to avoid developers relying on unstable functions.

Fixes

Proposed Changes

README.md

  • Added an "Extension Points" section documenting presence post type support (via register_post_type() or add_post_type_support()), the wp_presence_default_ttl filter and WP_PRESENCE_DEFAULT_TTL constant, the wp_presence_current_screen_key filter, and the wp_presence_screen_revision_bumped action.
  • Cross-referenced wp_presence_current_screen_key from the "Stale-screen detection" section, so the PHP opt-in and its JS counterpart wp.presence.markScreenStale() point at each other.
  • Refined the "PHP API" section to state the public/private boundary: the six listed functions are the stable contract; everything else in includes/functions.php is @access private and may change or be removed.

includes/functions.php

  • Marked wp_presence_parse_room() as @access private — it was neither public nor tagged, which made the README's boundary claim inaccurate. All its callers are internal.

How to Test / Verification

Documentation change; verify the README matches the code

Usage of AI

Use: Yes
Model: Claude Code Opus 5
For: help with wordings and draft PR description

@github-actions

github-actions Bot commented Aug 3, 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 3, 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 0b563e8ffe37bde9c12da05dd8dcf7d3941bfa11. Auto-updates when you push.

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.13%. Comparing base (3406134) to head (0b563e8).
⚠️ Report is 31 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #175   +/-   ##
=========================================
  Coverage     29.13%   29.13%           
  Complexity      164      164           
=========================================
  Files            15       15           
  Lines          1840     1840           
=========================================
  Hits            536      536           
  Misses         1304     1304           
Flag Coverage Δ
phpunit 29.13% <ø> (ø)

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] Documentation Documentation to be added or enhanced [Area] REST API Issues for the REST API subsystem labels Aug 6, 2026
@josephfusco josephfusco changed the title Docs: Document the existing Presence API extension points docs: Document the existing Presence API extension points Aug 7, 2026
@josephfusco josephfusco changed the title docs: Document the existing Presence API extension points docs: document the existing Presence API extension points Aug 7, 2026
@josephfusco
josephfusco merged commit 971f295 into WordPress:main Aug 8, 2026
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] REST API Issues for the REST API subsystem [Type] Documentation Documentation to be added or enhanced

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants