QA feedback and appointment compatibility#687
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe PR extends Simple Calendar's Connect onboarding to support a third welcome context type: "appointment." It adds a detection helper for the Book an Appointment add-on, updates context-determination logic to switch between core/pro/appointment flows, and adjusts UI and sidebar progress calculations accordingly. ChangesAppointment Add-on Connect Flow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.1.54)PHP Warning: require(/vendor/composer/../guzzlehttp/promises/src/functions_include.php): Failed to open stream: No such file or directory in /vendor/composer/autoload_real.php on line 39 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
includes/functions/admin.php (1)
597-615:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPromote first-run appointment installs into the appointment context.
Line 598 defaults to
core, and this block only rewrites previously savedpro/appointmentvalues. On a fresh install with only Book an Appointment active,welcome_contextstayscore, thenconnect-controller.phpnormalizes that intopro, so users see the Pro welcome flow instead of the appointment-specific one.Suggested fix
$welcome_context = (string) get_option('simple_calendar_connect_welcome_context', ''); $welcome_context = $welcome_context ? $welcome_context : 'core'; @@ - if ('appointment' === $welcome_context && !$is_appointment_active) { + if ('core' === $welcome_context && $is_appointment_active && !$is_google_pro_active) { + $welcome_context = 'appointment'; + update_option('simple_calendar_connect_welcome_context', $welcome_context, false); + } elseif ('appointment' === $welcome_context && !$is_appointment_active) { $welcome_context = $is_google_pro_active ? 'pro' : 'core'; update_option('simple_calendar_connect_welcome_context', $welcome_context, false); } elseif ('pro' === $welcome_context && !$is_google_pro_active && $is_appointment_active) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@includes/functions/admin.php` around lines 597 - 615, The current logic defaults $welcome_context to 'core' and never promotes fresh installs where the saved option is empty to 'appointment', causing Book an Appointment-only installs to show the Pro flow; after computing $is_appointment_active, $is_google_pro_active and $is_pro_active, detect a first-run (option was empty/not set) or a default 'core' that came from no saved option and if $is_appointment_active is true, set $welcome_context to 'appointment' and call update_option('simple_calendar_connect_welcome_context', 'appointment', false); keep the existing other branch checks (the elseif blocks that rewrite saved 'pro'/'appointment') intact and still use simcal_is_google_calendar_pro_active and simcal_is_appointment_addon_active to decide availability.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@includes/admin/pages/connect/steps/welcome.php`:
- Around line 14-16: The welcome copy for the appointment flow is awkward and
contains capitalization/grammar issues; when $welcome_context === 'appointment'
update the $heading and $subtitle assignments so the heading reads "Welcome to
Simple Calendar — Book an Appointment" (correct capitalization and punctuation)
and the subtitle reads something like "You can book appointments on Google
Calendar using Simple Calendar" (fix pluralization and proper "Google Calendar"
casing). Locate the block that sets $heading and $subtitle for the 'appointment'
context and replace the current strings with the corrected versions.
---
Outside diff comments:
In `@includes/functions/admin.php`:
- Around line 597-615: The current logic defaults $welcome_context to 'core' and
never promotes fresh installs where the saved option is empty to 'appointment',
causing Book an Appointment-only installs to show the Pro flow; after computing
$is_appointment_active, $is_google_pro_active and $is_pro_active, detect a
first-run (option was empty/not set) or a default 'core' that came from no saved
option and if $is_appointment_active is true, set $welcome_context to
'appointment' and call update_option('simple_calendar_connect_welcome_context',
'appointment', false); keep the existing other branch checks (the elseif blocks
that rewrite saved 'pro'/'appointment') intact and still use
simcal_is_google_calendar_pro_active and simcal_is_appointment_addon_active to
decide availability.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d2b43df6-86e1-42d9-9517-18758017aff7
📒 Files selected for processing (4)
includes/admin/pages/connect-controller.phpincludes/admin/pages/connect/sidebar.phpincludes/admin/pages/connect/steps/welcome.phpincludes/functions/admin.php
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
includes/admin/pages/connect/steps/welcome.php (1)
81-81: ⚡ Quick winInclude the arrow in the translatable string.
The arrow
→is concatenated outside the__()call, which can cause layout issues in RTL languages and prevents translators from adjusting punctuation.Proposed fix
- <?php echo esc_html(__('Continue setup', 'google-calendar-events') . ' →'); ?> + <?php echo esc_html__('Continue setup →', 'google-calendar-events'); ?>🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@includes/admin/pages/connect/steps/welcome.php` at line 81, The concatenated arrow should be part of the translatable string so translators can move or remove it; update the call that renders esc_html(__('Continue setup', 'google-calendar-events') . ' →') to pass the arrow inside the translation function (e.g., __('Continue setup →', 'google-calendar-events')) and then escape and echo that result using esc_html; ensure you only modify the string passed to __() and leave esc_html/echo intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@includes/admin/pages/connect/steps/welcome.php`:
- Around line 16-20: Update the welcome copy by fixing title capitalization in
the $heading (change "Book An Appointment" to "Book an Appointment") and replace
the overly long $subtitle with a shorter, clearer line; edit the $subtitle
assignment to something concise like "Enable real-time Google Calendar bookings
and automatically block booked time slots to prevent double bookings" to improve
readability on the welcome screen (update the strings where $heading and
$subtitle are defined).
---
Nitpick comments:
In `@includes/admin/pages/connect/steps/welcome.php`:
- Line 81: The concatenated arrow should be part of the translatable string so
translators can move or remove it; update the call that renders
esc_html(__('Continue setup', 'google-calendar-events') . ' →') to pass the
arrow inside the translation function (e.g., __('Continue setup →',
'google-calendar-events')) and then escape and echo that result using esc_html;
ensure you only modify the string passed to __() and leave esc_html/echo intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: fc00c8cd-3177-43f1-92b9-c69b9d77de97
📒 Files selected for processing (17)
assets/js/admin.jsassets/scss/add-ons.scssassets/scss/connect.scssassets/scss/design-system.scssassets/scss/misc-settings.scssincludes/admin/pages.phpincludes/admin/pages/add-ons.phpincludes/admin/pages/components/progress.phpincludes/admin/pages/connect/layout.phpincludes/admin/pages/connect/partials/google-calendar-api-key-connect.phpincludes/admin/pages/connect/partials/helpful-links.phpincludes/admin/pages/connect/partials/oauth-via-simple-calendar.phpincludes/admin/pages/connect/partials/render-connect-fields.phpincludes/admin/pages/connect/sidebar.phpincludes/admin/pages/connect/steps/pro-credentials.phpincludes/admin/pages/connect/steps/welcome.phpincludes/post-types.php
✅ Files skipped from review due to trivial changes (7)
- includes/admin/pages/connect/partials/helpful-links.php
- includes/post-types.php
- includes/admin/pages/connect/partials/oauth-via-simple-calendar.php
- includes/admin/pages/connect/partials/google-calendar-api-key-connect.php
- includes/admin/pages.php
- assets/scss/add-ons.scss
- includes/admin/pages/add-ons.php
🚧 Files skipped from review as they are similar to previous changes (1)
- includes/admin/pages/connect/sidebar.php
| $heading = __('Welcome to Book An Appointment', 'google-calendar-events'); | ||
| $subtitle = __( | ||
| 'Explore the Simple Calendar addon that allows Google Calendar appointment bookings directly from your website in real-time, while automatically blocking booked time slots to prevent double bookings.', | ||
| 'google-calendar-events', | ||
| ); |
There was a problem hiding this comment.
Polish the appointment welcome copy before shipping.
The appointment heading uses inconsistent title-case ("Book An Appointment" should be "Book an Appointment"), and the subtitle is unusually long for a welcome screen—consider tightening it for better readability.
Suggested copy refinement
- $heading = __('Welcome to Book An Appointment', 'google-calendar-events');
+ $heading = __('Welcome to Book an Appointment', 'google-calendar-events');
$subtitle = __(
- 'Explore the Simple Calendar addon that allows Google Calendar appointment bookings directly from your website in real-time, while automatically blocking booked time slots to prevent double bookings.',
+ 'Let visitors book appointments in Google Calendar directly from your website, with automatic time-slot blocking to prevent double bookings.',
'google-calendar-events',
);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| $heading = __('Welcome to Book An Appointment', 'google-calendar-events'); | |
| $subtitle = __( | |
| 'Explore the Simple Calendar addon that allows Google Calendar appointment bookings directly from your website in real-time, while automatically blocking booked time slots to prevent double bookings.', | |
| 'google-calendar-events', | |
| ); | |
| $heading = __('Welcome to Book an Appointment', 'google-calendar-events'); | |
| $subtitle = __( | |
| 'Let visitors book appointments in Google Calendar directly from your website, with automatic time-slot blocking to prevent double bookings.', | |
| 'google-calendar-events', | |
| ); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@includes/admin/pages/connect/steps/welcome.php` around lines 16 - 20, Update
the welcome copy by fixing title capitalization in the $heading (change "Book An
Appointment" to "Book an Appointment") and replace the overly long $subtitle
with a shorter, clearer line; edit the $subtitle assignment to something concise
like "Enable real-time Google Calendar bookings and automatically block booked
time slots to prevent double bookings" to improve readability on the welcome
screen (update the strings where $heading and $subtitle are defined).
Description: I have push QA feedback suggestions fixes and also push appointment compatibility fixes for welcome page% setup progress
Summary by CodeRabbit
New Features
Improvements
Style