- 
                Notifications
    You must be signed in to change notification settings 
- Fork 0
Feature: auto multisite detection/configurations #23
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
base: main
Are you sure you want to change the base?
Conversation
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 introduces comprehensive multisite support for the OneDesign plugin, enabling automatic detection and configuration of sites within a WordPress multisite network. The key enhancement is the governing site selection workflow that allows administrators to designate a primary site for managing shared patterns and templates across the network.
Key Changes:
- Automatic multisite detection and configuration upon network activation
- Governing site selection modal with REST API endpoints for site management
- API key synchronization across network sites
- Enhanced UI components for multisite brand site management
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description | 
|---|---|
| inc/classes/rest/class-multisite.php | New REST API endpoints for governing site management and site configuration | 
| inc/classes/plugin-configs/class-secret-key.php | Added hook to trigger API key sync in multisite environments | 
| inc/classes/plugin-configs/class-constants.php | Added constant for multisite governing site option | 
| inc/classes/class-utils.php | New utility functions for multisite checks and site information retrieval | 
| inc/classes/class-rest.php | Conditionally loads multisite REST routes | 
| inc/classes/class-plugin.php | Conditionally loads multisite functionality | 
| inc/classes/class-multisite.php | Core multisite functionality including modal rendering and API key synchronization | 
| inc/classes/class-assets.php | Enqueues multisite setup script and passes multisite data to JavaScript | 
| assets/src/js/constants.js | Exports multisite-related constants for frontend use | 
| assets/src/components/SiteTable.js | Integrated multisite brand site management UI | 
| assets/src/components/MultiSites.js | New component for managing multisite network sites | 
| assets/src/admin/settings/index.js | Passes additional props to SiteTable for multisite support | 
| assets/src/admin/patterns/components/BasePatternsTab.js | Updated button to use isBusy prop for consistent loading states | 
| assets/src/admin/patterns/components/AppliedPatternsTab.js | Updated button and improved confirmation message | 
| assets/src/admin/multisite-plugin/index.js | New multisite governing site selection interface | 
Comments suppressed due to low confidence (1)
inc/classes/rest/class-multisite.php:1
- The constant Constants::ONEDESIGN_MULTISITE_GOVERNING_SITEis used on line 128 and 158, but here a hardcoded string is used instead. Use the constant for consistency.
<?php
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Utsav Patel <[email protected]> Co-authored-by: Copilot <[email protected]>
…es/webpack configs
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
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Utsav Patel <[email protected]> Co-authored-by: Copilot <[email protected]>
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
Copilot reviewed 20 out of 20 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
assets/src/admin/multisite-plugin/index.js:1
- Corrected contraction 'won't' - the backslash escape is unnecessary in template literals and makes the text harder to read. Use: won'tinstead ofwon\\'t
/**
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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
Copilot reviewed 32 out of 32 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Utsav Patel <[email protected]> Co-authored-by: Copilot <[email protected]>
Key Changes
Auto Multisite Configuration:
When the plugin is network-activated, it now automatically detects and configures all sites within the same multisite network.
Governing Site Selection Modal:
Introduced a one-time modal that appears after network activation, allowing administrators to select the governing site for managing patterns, templates, and shared resources.
Multisite REST Routes:
Added required REST API endpoints to handle multisite configurations, site data synchronization, and governing site updates.
Auto API Key Update:
Implemented automatic API key updates during multisite setup for seamless communication between network sites.
Utility Enhancements:
Added helper functions and constants to manage options and streamline multisite-related logic.
Pattern/Template Improvements:
Asset Management:
Enqueued necessary JS files and defined constants to support modal interactions and multisite logic.
Closes