- 
                Notifications
    
You must be signed in to change notification settings  - Fork 83
 
Refactor: Reorganize integration loader and Stream integration #2383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 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
There was a problem hiding this 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_Connectorclass toConnectorand moved it toActivitypub\Integration\Streamnamespace - Created new 
Streamclass 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_commentidshould be prefixed with\for consistency with other global function calls in this file (like\url_to_postidon line 216 and\get_commenton 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.
There was a problem hiding this 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?
| 
           Very much so :) It looks like GitHub Action Bot dismissed your review  | 
    
Proposed changes:
load.phpin alphabetical order for easier navigationstream/folder structure to compartmentalize related codeActivitypub\IntegrationtoActivitypub\Integration\Streamplugin_init()Other information:
Testing instructions:
npm run test:unit:phpChangelog entry
Changelog Entry Details
Significance
Type
Message
Reorganize integration loader and move Stream integration into dedicated folder structure.