-
Notifications
You must be signed in to change notification settings - Fork 27
Centralised Settings For Multisite #277
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: develop
Are you sure you want to change the base?
Conversation
|
Will take over reviewing this PR. |
|
@mchirag2002 Could you add screenshot or a video recording on what has changes where the new settings are ? |
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 adds multisite network support for the Google Login plugin, allowing network administrators to configure OAuth credentials and settings globally across all sites in a WordPress multisite installation.
Key Changes:
- Adds network-level settings management for multisite installations
- Implements
get_client_id()andget_client_secret()methods to retrieve credentials from network settings in multisite environments - Adds an "Apply Globally" option to enforce network settings across all subsites
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| src/Modules/Settings.php | Core changes implementing network settings registration, rendering, and saving functionality with UI toggle logic |
| src/Container.php | Updates GoogleClient instantiation to use the new getter methods instead of direct property access |
| readme.txt | Documents multisite configuration in the setup instructions |
| README.md | Adds multisite setup documentation explaining the network administrator workflow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 'client_secret' => '', | ||
| ]; | ||
|
|
||
| $settings = $_POST['wp_google_login_network_settings'] ?? []; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
Copilot
AI
Nov 6, 2025
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.
While the phpcs:ignore comment indicates intentional access to unsanitized input, the array keys should be validated using wp_unslash() before processing. Consider wrapping $_POST['wp_google_login_network_settings'] with wp_unslash() to handle escaped input properly: $settings = isset( $_POST['wp_google_login_network_settings'] ) ? wp_unslash( $_POST['wp_google_login_network_settings'] ) : [];
| $settings = $_POST['wp_google_login_network_settings'] ?? []; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized | |
| $settings = isset( $_POST['wp_google_login_network_settings'] ) ? wp_unslash( $_POST['wp_google_login_network_settings'] ) : []; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
@mi5t4n Updated the PR description to add the requested video. |
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.
All looks good, but WP member setting must be set, otherwise just checking Create New User on Network side settings.
| * Register the settings, section and fields. | ||
| * Retrieves the Google OAuth Client ID, always from the network settings in multisite. | ||
| * | ||
| * @return string |
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.
Do add @since n.e.x.t and replace n.e.x.t with plugin version during release.
Description
Network AdminsClient IDandClient Secretto the network level and removed them from subsitesOnetap,Onetap locations,Create New Users, andWhitelisted domainsneed to be configured from the individual sites.ToDo before making this release
Demo video for the changes implemented
https://drive.google.com/file/d/1UVpIxZGK58cSi3I7myc67eyPuBmZVzcO/view?usp=sharing
Fixes
Make the plugin multisite compatible (#119)