-
Notifications
You must be signed in to change notification settings - Fork 83
Added tracking opt-in checkbox #507
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: development
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 pull request adds a tracking opt-in checkbox to the wizard's second step (subscribe step) to allow users to opt in to anonymous usage tracking. The plugin, which was rebranded from "WP Maintenance Mode" to "LightStart", can now collect telemetry data through the ThemeIsle SDK if users consent.
Changes:
- Added an opt-in checkbox UI component to the wizard subscribe step with accompanying label text
- Implemented JavaScript logic to capture the checkbox state and send it to the backend
- Added backend handling to save the user's opt-in preference as an option
- Implemented telemetry initialization that enables SDK tracking when the opt-in flag is set
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| views/wizard.php | Adds opt-in checkbox HTML with proper accessibility attributes and internationalized label text |
| assets/js/scripts-admin.js | Captures checkbox state and includes it in the AJAX subscription request |
| assets/css/style-wizard.css | Styles the opt-in container with flexbox layout and SVG checkbox positioning |
| includes/classes/wp-maintenance-mode-admin.php | Processes the opt_in parameter and stores the preference in database |
| includes/classes/wp-maintenance-mode.php | Initializes telemetry SDK integration when opt-in flag is enabled |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| if ( isset( $_POST['opt_in'] ) && $_POST['opt_in'] ) { | ||
| update_option( 'wp_maintenance_mode_logger_flag', 'yes' ); |
Copilot
AI
Feb 5, 2026
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.
When the checkbox is unchecked (opt_in is 0 or false), the code doesn't explicitly set the option to 'no' or delete it. This means if a user previously opted in and then unchecks the box, the telemetry will remain enabled. Consider adding an else clause to set the option to 'no' or delete it when the user opts out.
| update_option( 'wp_maintenance_mode_logger_flag', 'yes' ); | |
| update_option( 'wp_maintenance_mode_logger_flag', 'yes' ); | |
| } else { | |
| update_option( 'wp_maintenance_mode_logger_flag', 'no' ); |
Summary
Added an option for tracking opt-in.
Screenshots
Check before Pull Request is ready:
Closes #503