Skip to content

Use nodeinfo_discovery hook instead of deprecated wellknown_nodeinfo_data#3347

Merged
pfefferle merged 2 commits into
trunkfrom
fix/nodeinfo-discovery-hook
Jun 1, 2026
Merged

Use nodeinfo_discovery hook instead of deprecated wellknown_nodeinfo_data#3347
pfefferle merged 2 commits into
trunkfrom
fix/nodeinfo-discovery-hook

Conversation

@pfefferle
Copy link
Copy Markdown
Member

Proposed changes:

The standalone NodeInfo plugin deprecated its wellknown_nodeinfo_data filter in v3.0.0 in favor of nodeinfo_discovery. Our NodeInfo integration still registered its callback on the old hook name, so on sites running NodeInfo 3.x a PHP deprecation notice was logged on every /.well-known/nodeinfo discovery request:

PHP Deprecated: The hook wellknown_nodeinfo_data is deprecated since version 3.0.0! Use nodeinfo_discovery instead.
  • Switch the add_filter() registration in integration/class-nodeinfo.php from wellknown_nodeinfo_data to nodeinfo_discovery. The new hook passes the same array( 'links' => … ) discovery document, so the callback that appends the Application link is unchanged.
  • Update the integration tests to assert on the new hook name.

Because nothing in the plugin hooks wellknown_nodeinfo_data anymore, NodeInfo's backwards-compat shim short-circuits (has_filter() is false) and the notice stops.

Note: sites still running NodeInfo < 3.0.0 (which predates nodeinfo_discovery) will no longer have the Application link added to their discovery document. NodeInfo 3.0.0 has been available for a while, so this is considered acceptable.

Other information:

  • Have you written new tests for your changes, if applicable?

Updated the existing Test_Nodeinfo integration tests (20 tests, 99 assertions, all passing) to cover the new hook.

Testing instructions:

  1. Install and activate both the ActivityPub plugin and the NodeInfo plugin (v3.0.0 or later).
  2. Enable WP_DEBUG and WP_DEBUG_LOG.
  3. Request /.well-known/nodeinfo (or /wp-json/... discovery), e.g. curl https://example.com/.well-known/nodeinfo.
  4. Before this change, wp-content/debug.log shows a wellknown_nodeinfo_data is deprecated notice for each request. After this change, no such notice appears.
  5. Confirm the discovery document still contains the ActivityPub Application link (rel https://www.w3.org/ns/activitystreams#Application).

Changelog entry

A changelog entry is included at .github/changelog/fix-nodeinfo-discovery-deprecation.

…data

The standalone NodeInfo plugin deprecated the wellknown_nodeinfo_data
filter in v3.0.0 in favor of nodeinfo_discovery. Because the integration
still registered a callback on the old name, NodeInfo 3.x emitted a PHP
deprecation notice on every /.well-known/nodeinfo request.

Switch the registration to nodeinfo_discovery (same data shape, so the
callback is unchanged) and update the integration tests accordingly.
Copilot AI review requested due to automatic review settings June 1, 2026 15:21
@pfefferle pfefferle added the Bug Something isn't working label Jun 1, 2026
@pfefferle pfefferle self-assigned this Jun 1, 2026
@pfefferle pfefferle requested a review from a team June 1, 2026 15:21
@pfefferle pfefferle added the Bug Something isn't working label Jun 1, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the ActivityPub plugin’s NodeInfo integration to avoid triggering a deprecation notice in NodeInfo plugin v3.x by registering on the replacement discovery hook.

Changes:

  • Switch the NodeInfo discovery filter registration from the deprecated wellknown_nodeinfo_data hook to nodeinfo_discovery.
  • Update integration tests to assert the new hook is registered and exercised.
  • Add a changelogger entry documenting the deprecation-notice fix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
integration/class-nodeinfo.php Registers the integration callback on nodeinfo_discovery instead of the deprecated hook.
tests/phpunit/tests/integration/class-test-nodeinfo.php Updates hook registration assertions and integration hook test to use nodeinfo_discovery.
.github/changelog/fix-nodeinfo-discovery-deprecation Documents the fix for deprecation notices when NodeInfo is active.

Comment thread tests/phpunit/tests/integration/class-test-nodeinfo.php Outdated
@github-actions github-actions Bot added [Focus] Compatibility Ensuring the plugin plays well with other plugins [Tests] Includes Tests labels Jun 1, 2026
The nodeinfo_discovery filter always receives a document that already
contains a links array, so reflect that in the integration test input.
@pfefferle pfefferle merged commit 8e65a1d into trunk Jun 1, 2026
10 checks passed
@pfefferle pfefferle deleted the fix/nodeinfo-discovery-hook branch June 1, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working [Focus] Compatibility Ensuring the plugin plays well with other plugins [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants