Skip to content

Conversation

@obenland
Copy link
Member

@obenland obenland commented Oct 28, 2025

Proposed changes:

  • Reorganize integrations in load.php in alphabetical order for easier navigation
  • Move Stream integration into dedicated stream/ folder structure to compartmentalize related code
  • Create Stream wrapper class following the same pattern as other integrations (Surge, LiteSpeed Cache)
  • Update Stream_Connector namespace from Activitypub\Integration to Activitypub\Integration\Stream
  • Consolidate BuddyPress initialization with other integrations in plugin_init()
  • Move stream registration and filter functions into Stream class methods

Other information:

  • Have you written new tests for your changes, if applicable? (Updated existing tests to use new namespace)

Testing instructions:

  • Install and activate the ActivityPub plugin
  • If you have the Stream plugin installed, verify that ActivityPub events are still being logged correctly
  • Check that all integrations load without errors (check for PHP errors in debug log)
  • Verify that Stream connector appears in Stream settings if Stream plugin is active
  • Run existing PHPUnit tests: npm run test:unit:php

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Reorganize integration loader and move Stream integration into dedicated folder structure.

- Reorganize integrations in load.php in alphabetical order
- Move Stream integration into dedicated stream/ folder structure
- Create Stream wrapper class to encapsulate Stream-related functionality
- Move Stream_Connector class to stream/class-connector.php with updated namespace
- Move stream registration and filter functions into Stream class methods
- Consolidate BuddyPress initialization with other integrations
- Update test file to use new Stream\Connector namespace
Copilot AI review requested due to automatic review settings October 28, 2025 17:16
@obenland obenland self-assigned this Oct 28, 2025
@obenland obenland requested a review from pfefferle October 28, 2025 17:16
@github-actions github-actions bot added [Focus] Compatibility Ensuring the plugin plays well with other plugins [Tests] Includes Tests labels Oct 28, 2025
Copy link

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

This PR refactors the Stream plugin integration by reorganizing code structure and improving namespace organization. The main changes move the Stream Connector into its own namespace and create a dedicated Stream integration class to handle registration logic.

  • Renamed Stream_Connector class to Connector and moved it to Activitypub\Integration\Stream namespace
  • Created new Stream class to centralize Stream plugin integration logic (connector registration and post type exclusion)
  • Updated all references in test files and integration loader to use the new namespace and class names

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

File Description
integration/stream/class-stream.php New file introducing the Stream class that handles Stream plugin integration initialization, connector registration, and post type exclusion
integration/stream/class-connector.php Renamed from Stream_Connector to Connector, moved to Activitypub\Integration\Stream namespace, and added consistent function escaping with backslashes
tests/phpunit/tests/integration/class-test-stream-connector.php Updated all class references and imports to use the new Activitypub\Integration\Stream\Connector namespace and updated @covers annotations to reference the new Stream::register_connector method
integration/load.php Refactored to call Stream\Stream::init() instead of standalone functions, and reorganized integration initialization order alphabetically
Comments suppressed due to low confidence (1)

integration/stream/class-connector.php:224

  • Missing backslash for global function call. The function url_to_commentid should be prefixed with \ for consistency with other global function calls in this file (like \url_to_postid on line 216 and \get_comment on line 226).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Move BuddyPress hook registration outside of plugin_init() to ensure
it's registered before bp_include fires. BuddyPress fires bp_include
on plugins_loaded:8, so registering it in plugin_init() (which runs at
plugins_loaded:10) would be too late.
pfefferle
pfefferle previously approved these changes Oct 30, 2025
Copy link
Member

@pfefferle pfefferle left a comment

Choose a reason for hiding this comment

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

pleasing your inner monk?

@obenland
Copy link
Member Author

Very much so :) It looks like GitHub Action Bot dismissed your review

@obenland obenland merged commit 07ab03c into trunk Nov 3, 2025
14 checks passed
@obenland obenland deleted the refactor/reorganize-integrations branch November 3, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[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.

4 participants