Repository navigation
feat: switch presence recording on and off from Settings and WP-CLI - #442
Conversation
🛝 WordPress PlaygroundsBuilt from 2701390
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #442 +/- ##
============================================
- Coverage 96.36% 96.34% -0.03%
- Complexity 240 251 +11
============================================
Files 19 20 +1
Lines 2835 2899 +64
============================================
+ Hits 2732 2793 +61
- Misses 103 106 +3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
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. |
There was a problem hiding this comment.
Pull request overview
Adds administrator-accessible controls for presence recording while preserving filter overrides and multisite precedence.
Changes:
- Adds site and network recording settings.
- Adds WP-CLI
recording get|setcommands. - Updates cleanup, tests, and documentation.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
uninstall.php |
Removes recording options during uninstall. |
includes/settings.php |
Implements site and network settings controls. |
includes/functions.php |
Uses stored options as recording filter defaults. |
includes/cli/class-wp-presence-cli-command.php |
Adds recording CLI operations. |
presence-api.php |
Loads and registers settings functionality. |
tests/test-settings.php |
Tests settings rendering and persistence. |
tests/test-functions.php |
Tests option and filter precedence. |
tests/test-cli-command.php |
Tests site-level CLI behavior. |
tests/test-cli-network-command.php |
Tests network-level CLI behavior. |
tests/class-wp-presence-unittestcase.php |
Cleans recording options between tests. |
README.md |
Documents settings, filters, and CLI usage. |
readme.txt |
Updates user-facing recording guidance. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The recording filters shipped in #429 with no way to reach them without writing PHP.
Fixes #441
wp presence recording get|set on|off [--network]The stored options are passed as the two filters' defaults, so a filter still has the last word over whatever an administrator has chosen, and strictest-wins precedence between the site and network switches is unchanged.
wp_presence_network_aggregation_enabledstays code-only. It answers write concentration rather than policy, so it has no checkbox.Notes:
'1'or'0'rather than booleans. A booleanfalseis indistinguishable from an absent option, soupdate_option()discards it as unchanged and recording stays on.TRUNCATEin the base test case.TRUNCATEcommits andautocommitis off, so a statement after it lands in a fresh transaction and is rolled back.Testing:
npm test— 426 tests, 713 assertions, 106 skippednpm run test:multisite— 426 tests, 920 assertions, 3 expected skipsnpm run test:scripts— 79 passedcomposer validate --no-check-publish --no-interaction— passed./vendor/bin/phpcs --standard=phpcs.xml.dist --report=summary— passed./vendor/bin/phpstan analyse --configuration=phpstan.neon.dist --memory-limit=2G --no-progress— passedUse of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: Assisting with the implementation, tests, and documentation. The final change and results were reviewed by me before submission.