-
Notifications
You must be signed in to change notification settings - Fork 34
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
Improve Onboarding #2042
base: master
Are you sure you want to change the base?
Improve Onboarding #2042
Conversation
WalkthroughThe pull request introduces significant changes to the onboarding process within the application. It replaces the existing action hook for onboarding setup email with a new hook for consent tracking, modifies the onboarding wizard steps, and introduces new files for handling consent tracking and unsuccessful steps. Several existing files related to the onboarding process have been removed or modified, reflecting a streamlined approach to user interactions and data handling. Additionally, CSS and JavaScript updates enhance the visual and functional aspects of the onboarding wizard. Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 15
🧹 Outside diff range and nitpick comments (16)
js/src/onboarding-wizard/events/consentTrackingButtonListener.js (1)
17-22
: LGTM: Well-structured event handling setup.The
addConsentTrackingButtonEvents
function is clear and concise. It uses centralized element retrieval and prevents default button behavior, which are good practices.Consider adding a check for the existence of
consentTrackingButton
before attaching the event listener to improve robustness:function addConsentTrackingButtonEvents() { const { consentTrackingButton } = getElements(); + if (consentTrackingButton) { // Attach click event listener onClickPreventDefault( consentTrackingButton, onConsentTrackingButtonClick ); + } }js/src/onboarding-wizard/events/index.js (1)
Line range hint
1-46
: Overall approval with recommendations for testing.The changes in this file represent a significant refactoring of the onboarding process, aligning with the PR objectives to improve the onboarding experience. The removal of several event listeners and the addition of consent tracking suggest a more streamlined and privacy-focused approach.
However, given the scope of these changes:
- Ensure comprehensive end-to-end testing of the new onboarding flow.
- Verify that all necessary steps are still included and functional in the wizard.
- Consider updating documentation to reflect these changes in the onboarding process.
- If not already done, consider adding unit tests for the new
addConsentTrackingButtonEvents
function.classes/views/onboarding-wizard/index.php (1)
14-24
: LGTM: Well-structured onboarding rootline addedThe new rootline provides a clear visual representation of the onboarding steps. The structure is consistent, and the use of data attributes facilitates easy JavaScript interaction.
Consider adding aria-label attributes to the list items to improve accessibility. For example:
- <li class="frm-rootline-item" data-step="consent-tracking"> + <li class="frm-rootline-item" data-step="consent-tracking" aria-label="Consent tracking step">js/src/onboarding-wizard/ui/rootline.js (1)
14-22
: Consider enhancing the function documentation.The JSDoc comments provide a good overview of the function's purpose and parameter. However, it might be beneficial to add more details about the return value.
Consider updating the @return tag as follows:
- * @return {void} + * @return {void} This function doesn't return a value, it updates the DOM directly.classes/views/onboarding-wizard/steps/success-step.php (2)
20-20
: Approved: Improved congratulatory message with a minor suggestion.The updated message is more concise and directly acknowledges the completion of the onboarding process, which is great. It's properly escaped and ready for localization.
Consider adding a brief call-to-action or next step in the message. For example:
- <?php esc_html_e( 'Congratulations on completing the onboarding process! We hope you enjoy using Formidable Forms.', 'formidable' ); ?> + <?php esc_html_e( 'Congratulations on completing the onboarding process! We hope you enjoy using Formidable Forms. Ready to create your first form?', 'formidable' ); ?>This addition could provide a smoother transition to the "Create a Form" button below.
Line range hint
1-39
: Overall: Positive improvements to the onboarding success step.The changes in this file enhance the visual appeal and user experience of the onboarding success step. The updated logo, congratulatory message, and button text align well with the PR objectives of improving the onboarding process. The modifications maintain good coding practices, including proper escaping and localization support.
To further improve the onboarding experience, consider the following suggestions:
- Add analytics tracking to measure the effectiveness of the onboarding process.
- Implement A/B testing for different variations of the success message to optimize user engagement.
- Consider adding a brief survey or feedback mechanism at this step to gather user input on the onboarding process.
classes/views/onboarding-wizard/steps/unsuccessful-step.php (2)
12-22
: LGTM: Well-structured HTML with proper escaping.The HTML structure is well-formed, uses appropriate classes for styling, and provides clear information about the error. The use of escaping functions (esc_attr, esc_url, esc_html) is good for security.
Consider adding a more specific class to the main section element for easier targeting in CSS:
- <section id="frm-onboarding-unsuccessful-step" class="frm-onboarding-step frm-card-box frmcenter frm_hidden" data-step-name="<?php echo esc_attr( $step ); ?>"> + <section id="frm-onboarding-unsuccessful-step" class="frm-onboarding-step frm-onboarding-unsuccessful-step frm-card-box frmcenter frm_hidden" data-step-name="<?php echo esc_attr( $step ); ?>">
24-37
: LGTM: Good use of helper function for footer generation.The use of
FrmOnboardingWizardHelper::print_footer
promotes code reusability. The options passed to the function are well-structured and provide clear information about the buttons. The use ofadmin_url()
for generating URLs is good practice.Consider extracting the array of options into a separate variable for better readability:
+ $footer_options = array( + 'footer-class' => 'frm-justify-center frm-mt-2xl', + 'display-back-button' => false, + 'primary-button-text' => __( 'Go to Dashboard', 'formidable' ), + 'primary-button-href' => admin_url( 'admin.php?page=' . FrmDashboardController::PAGE_SLUG ), + 'primary-button-role' => false, + 'secondary-button-text' => __( 'Install Manually', 'formidable' ), + 'secondary-button-href' => admin_url( 'plugin-install.php' ), + 'secondary-button-role' => false, + 'secondary-button-skip-step' => false, + ); - FrmOnboardingWizardHelper::print_footer( - array( - 'footer-class' => 'frm-justify-center frm-mt-2xl', - 'display-back-button' => false, - 'primary-button-text' => __( 'Go to Dashboard', 'formidable' ), - 'primary-button-href' => admin_url( 'admin.php?page=' . FrmDashboardController::PAGE_SLUG ), - 'primary-button-role' => false, - 'secondary-button-text' => __( 'Install Manually', 'formidable' ), - 'secondary-button-href' => admin_url( 'plugin-install.php' ), - 'secondary-button-role' => false, - 'secondary-button-skip-step' => false, - ) - ); + FrmOnboardingWizardHelper::print_footer( $footer_options );js/src/onboarding-wizard/dataUtils/setupUsageData.js (1)
36-43
: Improved logic for handling completed steps. Consider further optimization.The changes improve the function's logic by:
- Including both successful and unsuccessful steps.
- Preventing duplicate entries in
processedSteps
.These modifications enhance the robustness of the onboarding process tracking.
Consider simplifying the logic further:
if ( STEPS.SUCCESS === nextStepName || STEPS.UNSUCCESSFUL === nextStepName ) { const { processedSteps } = getState(); - if ( processedSteps.length > 1 ) { - if ( ! processedSteps.includes( nextStepName ) ) { - processedSteps.push( nextStepName ); - } + if ( processedSteps.length > 0 && !processedSteps.includes( nextStepName ) ) { + processedSteps.push( nextStepName ); formData = new FormData(); formData.append( 'processed_steps', processedSteps.join( ',' ) ); formData.append( 'completed_steps', true ); } }This change reduces nesting and combines the conditions, making the code more readable and efficient.
js/src/onboarding-wizard/utils/navigateToStep.js (2)
43-49
: LGTM: Refactoring and rootline updateThe changes improve the code structure by extracting
onboardingWizardPage
fromgetElements()
. The addition ofupdateRootline(stepName)
enhances the UI feedback during navigation.Consider adding a comment explaining the purpose of
updateRootline
for better code documentation.setQueryParam( 'step', stepName, updateMethod ); + // Update the rootline UI to reflect the current step updateRootline( stepName );
77-77
: LGTM: Added usage data trackingThe addition of
setupUsageData(processedStep, nextStepName)
enhances the onboarding process by tracking user progress. This is in line with the PR objectives.Consider adding error handling for the
setupUsageData
call to ensure robustness:- setupUsageData( processedStep, nextStepName ); + try { + setupUsageData( processedStep, nextStepName ); + } catch (error) { + console.error('Failed to setup usage data:', error); + // Optionally, you can add analytics or error reporting here + }css/admin/onboarding-wizard.css (3)
53-64
: LGTM: Improved dropdown styling with a minor suggestionThe new styles for
.frm-dropdown-menu
and related elements improve the dropdown's appearance and behavior. The removal of default positioning and transform, along with the full-width setting, should enhance usability.Consider adding a transition property to the
.frmsvg
rotation for a smoother animation:.dropdown .frm-dropdown-toggle .frmsvg { transition: transform 0.3s ease; }This will create a smoother rotation effect when the dropdown is toggled.
69-80
: LGTM: Consistent tooltip styling with a suggestionThe updates to the tooltip styles ensure consistency with the "Install Formidable Add-ons" step, as mentioned in the comment. This improves the overall visual coherence of the onboarding wizard.
Consider using a CSS variable for the new tooltip color (
#545f6e
) to maintain consistency and ease future updates::root { --tooltip-bg-color: #545f6e; } .tooltip-inner { background-color: var(--tooltip-bg-color); } .bs-tooltip-top .arrow::before { border-top-color: var(--tooltip-bg-color); } .bs-tooltip-bottom .arrow::before { border-bottom-color: var(--tooltip-bg-color); }This approach would make it easier to update the tooltip color across all instances if needed in the future.
82-132
: LGTM: Well-implemented step indicator with a suggestion for accessibilityThe new styles for
.frm-rootline
and related elements create a visually appealing and functional step indicator for the onboarding process. The use of flexbox for layout and pseudo-elements for the connecting line is a good approach. The different states (completed, current) are styled appropriately, and the consistent use of CSS variables for colors and spacing is commendable.To improve accessibility, consider adding
aria-current="step"
to the current step item in the HTML and then styling it in CSS. This will help screen readers identify the current step. Add the following CSS:.frm-rootline-item[aria-current="step"] { background-color: #fff; border-color: var(--primary-500); }This approach provides both visual and programmatic indication of the current step, enhancing the user experience for all users, including those using assistive technologies.
classes/views/onboarding-wizard/steps/install-addons-step.php (2)
14-14
: LGTM! Consider adding width and height attributes.The replacement of the icon with the Formidable logo improves the visual representation of the onboarding step. The use of
esc_url()
andesc_attr()
functions ensures proper escaping.Consider adding
width
andheight
attributes to the<img>
tag to improve Cumulative Layout Shift (CLS) performance:- <img class="frm-onboarding-logo" src="<?php echo esc_url( FrmAppHelper::plugin_url() ); ?>/images/logo.svg" alt="<?php esc_attr_e( 'Formidable Onboarding Wizard Logo', 'formidable' ); ?>" /> + <img class="frm-onboarding-logo" src="<?php echo esc_url( FrmAppHelper::plugin_url() ); ?>/images/logo.svg" alt="<?php esc_attr_e( 'Formidable Onboarding Wizard Logo', 'formidable' ); ?>" width="200" height="40" />Replace
200
and40
with the actual dimensions of your logo.
75-85
: LGTM! Consider adding aria-label to the icon.The addition of the footer section for Pro users is a good improvement, providing clear guidance on how to connect their account. The code is well-structured and properly escaped.
Consider adding an
aria-label
to the icon for better accessibility:- <?php FrmAppHelper::icon_by_class( 'frmfont frm_arrowup8_icon' ); ?> + <?php FrmAppHelper::icon_by_class( 'frmfont frm_arrowup8_icon', array( 'aria-label' => __( 'External link', 'formidable' ) ) ); ?>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (3)
images/icons.svg
is excluded by!**/*.svg
,!**/*.svg
images/logo.svg
is excluded by!**/*.svg
,!**/*.svg
images/onboarding-wizard/onboarding-bg.svg
is excluded by!**/*.svg
,!**/*.svg
📒 Files selected for processing (34)
- classes/controllers/FrmHooksController.php (1 hunks)
- classes/controllers/FrmOnboardingWizardController.php (3 hunks)
- classes/helpers/FrmOnboardingWizardHelper.php (3 hunks)
- classes/views/onboarding-wizard/footer.php (1 hunks)
- classes/views/onboarding-wizard/index.php (1 hunks)
- classes/views/onboarding-wizard/steps/consent-tracking-step.php (1 hunks)
- classes/views/onboarding-wizard/steps/default-email-address-step.php (0 hunks)
- classes/views/onboarding-wizard/steps/install-addons-step.php (4 hunks)
- classes/views/onboarding-wizard/steps/install-formidable-pro-step.php (0 hunks)
- classes/views/onboarding-wizard/steps/license-management-step.php (0 hunks)
- classes/views/onboarding-wizard/steps/success-step.php (2 hunks)
- classes/views/onboarding-wizard/steps/unsuccessful-step.php (1 hunks)
- classes/views/onboarding-wizard/steps/welcome-step.php (0 hunks)
- css/admin/onboarding-wizard.css (3 hunks)
- css/frm_admin.css (12 hunks)
- js/onboarding-wizard.js (1 hunks)
- js/src/onboarding-wizard/dataUtils/setupUsageData.js (1 hunks)
- js/src/onboarding-wizard/elements/elements.js (1 hunks)
- js/src/onboarding-wizard/events/backButtonListener.js (0 hunks)
- js/src/onboarding-wizard/events/checkProInstallationButtonListener.js (0 hunks)
- js/src/onboarding-wizard/events/consentTrackingButtonListener.js (1 hunks)
- js/src/onboarding-wizard/events/index.js (2 hunks)
- js/src/onboarding-wizard/events/saveLicenseButtonListener.js (0 hunks)
- js/src/onboarding-wizard/events/setupEmailStepButtonListener.js (0 hunks)
- js/src/onboarding-wizard/events/skipProInstallationButtonListener.js (0 hunks)
- js/src/onboarding-wizard/events/skipStepButtonListener.js (0 hunks)
- js/src/onboarding-wizard/index.js (0 hunks)
- js/src/onboarding-wizard/shared/constants.js (1 hunks)
- js/src/onboarding-wizard/shared/pageState.js (0 hunks)
- js/src/onboarding-wizard/ui/index.js (1 hunks)
- js/src/onboarding-wizard/ui/rootline.js (1 hunks)
- js/src/onboarding-wizard/ui/setupInitialView.js (4 hunks)
- js/src/onboarding-wizard/ui/showError.js (0 hunks)
- js/src/onboarding-wizard/utils/navigateToStep.js (3 hunks)
💤 Files with no reviewable changes (13)
- classes/views/onboarding-wizard/steps/default-email-address-step.php
- classes/views/onboarding-wizard/steps/install-formidable-pro-step.php
- classes/views/onboarding-wizard/steps/license-management-step.php
- classes/views/onboarding-wizard/steps/welcome-step.php
- js/src/onboarding-wizard/events/backButtonListener.js
- js/src/onboarding-wizard/events/checkProInstallationButtonListener.js
- js/src/onboarding-wizard/events/saveLicenseButtonListener.js
- js/src/onboarding-wizard/events/setupEmailStepButtonListener.js
- js/src/onboarding-wizard/events/skipProInstallationButtonListener.js
- js/src/onboarding-wizard/events/skipStepButtonListener.js
- js/src/onboarding-wizard/index.js
- js/src/onboarding-wizard/shared/pageState.js
- js/src/onboarding-wizard/ui/showError.js
🧰 Additional context used
🪛 Biome
js/onboarding-wizard.js
[error] 2-2: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.(lint/suspicious/noRedundantUseStrict)
[error] 2-2: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 2-2: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 2-2: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 2-2: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 2-2: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 2-2: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 2-2: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
[error] 2-2: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
🔇 Additional comments (53)
js/src/onboarding-wizard/ui/index.js (1)
1-2
: Verify the impact of export changes on the onboarding processThe changes in this file align with the PR objective of improving the onboarding process. The removal of the
showError
export and the addition of therootline
export suggest a shift in focus from error handling to guiding users through the onboarding steps.However, we should ensure that the removal of the
showError
export doesn't negatively impact error handling in other parts of the application that might have been using it.Let's verify that the
showError
functionality is not needed elsewhere in the codebase:If these searches return results, we may need to update those files to handle errors differently or import error handling from a new location.
js/src/onboarding-wizard/shared/constants.js (2)
8-9
: Approve changes to STEPS object and verify new UNSUCCESSFUL step implementation.The changes to the
STEPS
object, including the addition of theUNSUCCESSFUL
step, appear to improve the onboarding process by accounting for both successful and unsuccessful scenarios. This aligns well with the PR objective of enhancing the onboarding experience.To ensure proper implementation of the new
UNSUCCESSFUL
step, please run the following script:#!/bin/bash # Description: Verify the implementation of the new UNSUCCESSFUL step # Test 1: Search for usage of the new UNSUCCESSFUL step echo "Searching for UNSUCCESSFUL step usage:" rg --type js 'STEPS\.UNSUCCESSFUL' # Test 2: Search for any error handling or unsuccessful scenario logic echo "Searching for error handling related to unsuccessful onboarding:" rg --type js -i 'onboarding.*(?:error|fail|unsuccessful)'Ensure that the
UNSUCCESSFUL
step is properly handled in the onboarding flow, including appropriate error messages or recovery options for users.
1-1
: Verify the impact of removed constants on the codebase.The constants
proIsIncluded
andWELCOME_STEP_ID
have been removed. While this aligns with improving the onboarding process, we should ensure that these removals don't cause issues elsewhere in the codebase.Run the following script to check for any remaining usage of the removed constants:
If any matches are found, please update those occurrences to align with the new onboarding flow.
✅ Verification successful
Removed constants
proIsIncluded
andWELCOME_STEP_ID
are no longer used in the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for usage of removed constants in the codebase # Test 1: Search for proIsIncluded usage echo "Searching for proIsIncluded usage:" rg --type js 'proIsIncluded' # Test 2: Search for WELCOME_STEP_ID usage echo "Searching for WELCOME_STEP_ID usage:" rg --type js 'WELCOME_STEP_ID'Length of output: 27953
js/src/onboarding-wizard/events/consentTrackingButtonListener.js (2)
1-10
: LGTM: Imports are well-organized and appropriate.The imports are clearly separated into external and internal dependencies, which is a good practice. The imported functions seem relevant to the file's purpose.
35-35
: LGTM: Clear and appropriate default export.The default export of
addConsentTrackingButtonEvents
is appropriate for this module, as it's the main function that sets up the event handling.classes/views/onboarding-wizard/footer.php (4)
14-14
: Improved back button stylingThe addition of the
frm_large
class to the back button is a good improvement. This change likely makes the button more prominent and easier to interact with, enhancing the overall user experience of the onboarding wizard.
24-26
: Enhanced security for primary button textGood job on using
esc_html()
to output the primary button text. This change improves security by preventing potential XSS attacks, ensuring that any HTML in the button text is properly escaped before being rendered.
27-30
: New icon option for primary buttonThe addition of an optional icon to the primary button is a nice touch that can enhance visual cues for users. The implementation looks good, using a conditional block and the
FrmAppHelper::icon_by_class()
method for consistency.A few points to consider:
- The icon uses several CSS classes for styling, including rotation and positioning.
- The
aria-hidden
attribute is correctly set for accessibility.To ensure the icon displays correctly and enhances the user experience as intended, please verify the visual appearance of the button with the icon enabled. Consider checking the alignment and spacing between the text and the icon across different screen sizes.
14-30
: Overall improvements to the Onboarding Wizard footerThe changes made to the Onboarding Wizard footer align well with the PR objectives of improving the onboarding process. Here's a summary of the improvements:
- Enhanced back button styling for better visibility.
- Improved security for the primary button text rendering.
- Added flexibility with an optional icon for the primary button.
These changes contribute to a better user experience and maintain good coding practices. The modifications are consistent with the goal of enhancing the Formidable Forms plugin's onboarding process.
Great job on these improvements! They should positively impact the user's onboarding experience.
js/src/onboarding-wizard/events/index.js (2)
26-26
: Approve changes, but verify impact on onboarding flow.The addition of
addConsentTrackingButtonEvents()
aligns with modern data protection practices and the PR's goal to improve the onboarding process. However, the removal of several other event listeners (setup email, license management, pro installation) represents a significant change in the onboarding flow.Please confirm that the removal of these event listeners doesn't negatively impact the user experience. Let's verify the changes in the onboarding steps:
#!/bin/bash # Description: Verify changes in onboarding steps and related components # Test 1: Check for references to removed steps in other files echo "Checking for references to removed steps:" rg -i "setup.*email|license.*management|pro.*installation" --type js # Test 2: Verify the implementation of consent tracking echo "Checking consent tracking implementation:" rg -i "consent.*tracking" --type js # Test 3: Look for any TODO comments related to these changes echo "Checking for related TODO comments:" rg -i "TODO.*onboarding" --type js
12-12
: LGTM! Verify the new consent tracking file.The addition of the
addConsentTrackingButtonEvents
import aligns with the PR objective to improve the onboarding process. The import follows the existing pattern for button event listeners.Let's verify the existence and content of the new file:
✅ Verification successful
LGTM! The consent tracking functionality has been successfully added and verified.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence and content of the consentTrackingButtonListener file # Test 1: Check if the file exists fd consentTrackingButtonListener.js # Test 2: If the file exists, display its content fd consentTrackingButtonListener.js -x catLength of output: 29173
Script:
#!/bin/bash # Description: Verify the existence and content of consentTrackingButtonListener.js # Test 1: Check if the specific file exists fd 'consentTrackingButtonListener.js' # Test 2: If the file exists, display its content fd 'consentTrackingButtonListener.js' -x catLength of output: 1075
classes/views/onboarding-wizard/index.php (3)
12-12
: LGTM: Updated initial step in onboarding processThe change from "welcome" to "consent-tracking" as the initial step aligns with the new onboarding structure and appears to be an intentional improvement to the process.
33-33
: LGTM: Improved clarity in exit link textThe change from "Go to dashboard" to "Exit Onboarding" provides a clearer description of the link's action. This improvement enhances user understanding and aligns well with the overall focus on refining the onboarding process.
Line range hint
1-42
: Overall: Improved onboarding wizard structure and clarityThe changes to this file effectively enhance the onboarding process by:
- Updating the initial step to focus on consent tracking.
- Adding a clear visual rootline of the onboarding steps.
- Improving the clarity of the exit link.
These modifications align well with the PR objectives of improving the onboarding experience. The code is well-structured and consistent. Consider the minor suggestion for improving accessibility in the rootline items.
js/src/onboarding-wizard/ui/rootline.js (2)
1-12
: LGTM: Imports and constant definition are appropriate.The imports and constant definition are well-structured and relevant to the file's purpose. The use of both external and internal dependencies is clear and the constant
COMPLETED_STEP_CLASS
is defined with an intuitive name.
23-34
: Clarify the handling of the 'unsuccessful' step.The current implementation sets the
currentStep
toSTEPS.SUCCESS
when it'sSTEPS.UNSUCCESSFUL
. This seems counterintuitive and might lead to confusion. Could you please explain the reasoning behind this decision?If this is intentional, consider adding a comment explaining why an unsuccessful step is treated as a success step in this context.
classes/views/onboarding-wizard/steps/success-step.php (2)
14-14
: LGTM: Logo update enhances visual appeal and maintains accessibility.The replacement of the circular icon with an SVG logo is a positive change. SVG format ensures scalability across different screen sizes and resolutions. The alt text is properly set, maintaining accessibility, and the URL is correctly escaped for security.
29-29
: Approved: Button text updates with a note on escaping.The button text changes are appropriate and align well with their respective actions. The change from
esc_html__
to__
is generally acceptable in this context, as button text is typically not directly output and thus doesn't require HTML escaping.However, let's verify how these button texts are used to ensure the removal of escaping doesn't introduce any security issues:
If the results show that the texts are passed directly to HTML output without escaping, consider reverting to
esc_html__
for added security.Also applies to: 32-32
✅ Verification successful
Verified: Button text updates maintain proper escaping.
The
__( 'Go to Dashboard', 'formidable' )
function insuccess-step.php
is appropriately handled byFrmOnboardingWizardHelper::print_footer
, which appliesesc_html__
. This ensures that button texts remain securely escaped.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check how the button texts are used in the codebase # Search for uses of FrmOnboardingWizardHelper::print_footer rg --type php -A 10 "FrmOnboardingWizardHelper::print_footer" | grep -E "primary-button-text|secondary-button-text"Length of output: 1038
Script:
#!/bin/bash # Description: Inspect how FrmOnboardingWizardHelper::print_footer handles and outputs button texts to ensure proper escaping # Search for the definition of the print_footer method ast-grep --lang php --pattern $'class FrmOnboardingWizardHelper { $$$ function print_footer($_$) { $$$ } $$$ }' # Additionally, check how the button texts are used within the print_footer method rg --type php "function print_footer" -A 20 classes/helpers/FrmOnboardingWizardHelper.php | grep -E "echo|print|esc_html"Length of output: 453
classes/views/onboarding-wizard/steps/unsuccessful-step.php (2)
1-10
: LGTM: Proper file header and security check.The file header provides clear information about the purpose of the file, and the security check prevents direct access to the file, which is a good security practice.
1-39
: LGTM: Well-structured and complete implementation of the unsuccessful step.The file is well-organized and contains all necessary elements for displaying the unsuccessful step in the onboarding process. It follows a logical flow: security check, HTML structure, content, and footer. This implementation aligns well with the PR objectives of improving the onboarding process.
js/src/onboarding-wizard/dataUtils/setupUsageData.js (2)
Line range hint
1-62
: Overall improvements to onboarding process trackingThe changes in this file enhance the onboarding process by:
- Improving the handling of both successful and unsuccessful completions.
- Streamlining data processing by removing email-related functionality.
These modifications align with the PR objective of improving the onboarding experience. However, please ensure that:
- The removal of email-related functionality is intentional and doesn't negatively impact user communication or data collection for other parts of the system.
- The changes align with any analytics or reporting systems that may have depended on the previous data structure.
Consider documenting these changes in the project's technical documentation to ensure that other team members are aware of the new onboarding data structure and processing logic.
To verify the alignment with project objectives, please run the following script:
This script will help ensure that the changes are consistent with the project's goals and that no unintended side effects are introduced.
Line range hint
1-35
: Verify the impact ofprocessDataForStep
changes onsetupUsageData
While there are no direct changes to
setupUsageData
, the modifications inprocessDataForStep
affect its behavior. Ensure that:
- The function correctly handles both successful and unsuccessful onboarding completions.
- The removal of email-related data processing doesn't negatively impact any dependent systems or analytics.
To verify these changes, run the following script:
This script will help ensure that the changes are consistent across the onboarding process and that no email-related functionality was unintentionally left behind.
✅ Verification successful
Verification Complete:
setupUsageData
Functionality is CorrectThe shell script results confirm that:
- No email-related code exists in the onboarding process.
- The
setupUsageData
function properly handles both SUCCESS and UNSUCCESSFUL onboarding steps.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any references to email processing in the onboarding process # Test 1: Search for email-related functions or variables in the onboarding files echo "Searching for email-related code in onboarding files:" rg --type js -i '(email|mail)' js/src/onboarding-wizard # Test 2: Check for any remaining usage of email data in the setupUsageData function echo "Checking for email data usage in setupUsageData:" ast-grep --lang javascript --pattern $'function setupUsageData($_) { $$$ email $$$ }' # Test 3: Verify that both SUCCESS and UNSUCCESSFUL steps are handled echo "Verifying handling of SUCCESS and UNSUCCESSFUL steps:" ast-grep --lang javascript --pattern $'if ( STEPS.SUCCESS === $_ || STEPS.UNSUCCESSFUL === $_ ) { $$$ }'Length of output: 1740
js/src/onboarding-wizard/utils/navigateToStep.js (1)
13-13
: LGTM: New import for updateRootlineThe addition of the
updateRootline
import is consistent with the changes made in thenavigateToStep
function. This named import follows good module-based JavaScript practices.css/admin/onboarding-wizard.css (5)
18-18
: LGTM: Good use of CSS variable for background colorUsing a CSS variable for the background color is a good practice. It enhances maintainability and consistency across the stylesheet.
29-29
: LGTM: Consistent use of CSS variable for paddingThe use of a CSS variable for padding is consistent with the earlier changes and follows best practices for maintainable CSS.
37-37
: Verify the reduced top marginThe top margin for
#frm-onboarding-return-dashboard
has been reduced fromvar(--gap-xl)
tovar(--gap-lg)
. Please confirm that this change is intentional and doesn't negatively impact the layout or spacing in the onboarding wizard.
48-51
: LGTM: Consistent logo sizingThe addition of specific dimensions for
.frm-onboarding-logo
ensures consistent logo presentation throughout the onboarding wizard. This is a good practice for maintaining visual coherence.
152-152
: LGTM: Proper file endingAdding an empty line at the end of the file follows best practices and can prevent issues with certain tools and version control systems.
classes/views/onboarding-wizard/steps/install-addons-step.php (2)
Line range hint
46-55
: LGTM! Class order change noted.The modification in the class order for the banner title span is acceptable. The content remains properly escaped and internationalized.
Line range hint
1-98
: Overall, good improvements to the onboarding wizard.The changes in this file enhance the user interface and provide clearer guidance for both new and Pro users of Formidable Forms. The addition of the Formidable logo and the new footer section for Pro users are particularly noteworthy improvements. The code generally follows good practices for escaping and internationalization.
A few minor suggestions have been made to further improve accessibility and security:
- Adding width and height attributes to the logo image.
- Adding an aria-label to the external link icon.
- Using
esc_html__()
instead of__()
for the button text.These small changes will help to create a more robust and accessible onboarding experience.
classes/helpers/FrmOnboardingWizardHelper.php (3)
Line range hint
1-138
: Summary of changes to FrmOnboardingWizardHelperThe changes made to this file are focused on improving the onboarding wizard's functionality and appearance, which aligns with the PR objectives. Key modifications include:
- Changing the default behavior for displaying the back button.
- Adding a new argument for primary button icon support (currently unused).
- Updating CSS classes for both primary and secondary buttons.
While these changes seem to enhance the onboarding process, it's crucial to thoroughly test the wizard to ensure these modifications don't introduce any unintended side effects or break existing functionality. Pay special attention to the navigation flow and button styling across different steps of the wizard.
110-110
: Verify new button classes 'frm-sharp frm_large'The classes 'frm-sharp frm_large' have been added to both primary and secondary buttons. While this likely improves consistency in button styling across the onboarding wizard, it's important to ensure these classes exist in your CSS and provide the intended styling.
To verify the existence and usage of these classes, you can run the following script:
#!/bin/bash # Search for 'frm-sharp' and 'frm_large' in CSS files echo "Searching for 'frm-sharp' in CSS files:" rg --type css "frm-sharp" echo "\nSearching for 'frm_large' in CSS files:" rg --type css "frm_large"This will help confirm that these classes are defined and used as intended in your stylesheets.
Also applies to: 125-125
90-90
: Verify the impact of changing 'display-back-button' default to falseThe default value for 'display-back-button' has been changed from true to false. This might affect the navigation flow in the onboarding wizard. Please ensure this change is intentional and doesn't break existing functionality or user experience.
To verify the impact, you can run the following script:
This will help identify any potential issues with existing calls to
print_footer
that might be affected by this change.classes/controllers/FrmHooksController.php (1)
221-221
: LGTM! Verify related changes inFrmOnboardingWizardController
.The change from
frm_onboarding_setup_email_step
tofrm_onboarding_consent_tracking
aligns with the PR objectives to improve the onboarding process. This modification suggests a shift towards user privacy and GDPR compliance, which is a positive improvement.Please ensure that the corresponding
ajax_consent_tracking
method has been implemented in theFrmOnboardingWizardController
class. You can verify this with the following script:✅ Verification successful
Verified: The
ajax_consent_tracking
method is implemented inFrmOnboardingWizardController
, ensuring the change is properly integrated.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for the implementation of ajax_consent_tracking method # Search for the ajax_consent_tracking method in FrmOnboardingWizardController rg --type php "function ajax_consent_tracking" -g "*FrmOnboardingWizardController*"Length of output: 189
js/src/onboarding-wizard/elements/elements.js (5)
9-9
: Import statement added correctlyThe import of
PREFIX
from'../shared'
ensures that the prefix is consistently used throughout the file.
16-18
: Element selectors are appropriately definedThe elements
steps
,skipStepButtons
, andbackButtons
are correctly selected usingquerySelectorAll
with the appropriate class selectors.
20-21
: New buttons are correctly initializedThe
consentTrackingButton
andinstallAddonsButton
elements are properly retrieved using their respective IDs with thePREFIX
.
23-23
: Hidden license key input is correctly referencedThe
hiddenLicenseKeyInput
is correctly selected using its ID'frm-license-key'
, which appears to be a legacy or globally recognized identifier.
15-15
: Verify the usage of 'rootline'The element
rootline
is being selected withdocument.getElementById(
${PREFIX}-rootline)
. The term 'rootline' is uncommon; please confirm that this is the intended ID and not a typo.To check where and how 'rootline' is used in the codebase, you can run:
✅ Verification successful
Verification of 'rootline' Usage Confirmed
The usage of
rootline
has been confirmed to be intentional and correctly implemented. No typos or inconsistencies were found regarding the selection and usage of therootline
element.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Search for all occurrences of 'rootline' to verify its usage. # Test: Recursively search for 'rootline' in JavaScript files. rg 'rootline' --type js --type jsx -A 2 -B 2Length of output: 72
Script:
#!/bin/bash # Description: Search for all occurrences of 'rootline' to verify its usage. # Test: Recursively search for 'rootline' in JavaScript and JSX files. rg 'rootline' --type javascript --type javascriptreact -A 2 -B 2Length of output: 99
Script:
#!/bin/bash # Description: Search for all occurrences of 'rootline' to verify its usage. # Test: Recursively search for 'rootline' in .js and .jsx files using glob patterns. rg 'rootline' --glob "*.js" --glob "*.jsx" -A 2 -B 2Length of output: 29112
js/src/onboarding-wizard/ui/setupInitialView.js (3)
10-10
: LGTM!Importing
STEPS
from'../shared'
is essential for step navigation throughout the onboarding process.
58-58
: LGTM!Defaulting to
STEPS.INITIAL
when nostep
query parameter is present ensures the onboarding starts correctly.
79-81
: LGTM!Fading in the container enhances the user experience by providing a smooth visual transition.
classes/views/onboarding-wizard/steps/consent-tracking-step.php (1)
56-56
: Verify escaping of translated strings in tooltipsIn lines 56, 76, and 107, the
__()
function is used to retrieve translated strings passed toFrmAppHelper::tooltip_icon()
. Please ensure thattooltip_icon()
properly escapes the content when outputting to prevent potential security issues. If it doesn't handle escaping, consider usingesc_html__()
to escape the strings before passing them to the function.Also applies to: 76-76, 107-107
classes/controllers/FrmOnboardingWizardController.php (4)
82-82
: Update INITIAL_STEP constant to 'consent-tracking'The
INITIAL_STEP
constant has been correctly updated to'consent-tracking'
, aligning with the new initial step in the onboarding process.
282-285
: Add new steps to the $step_parts arrayThe addition of
'consent-tracking'
and'unsuccessful'
steps to the$step_parts
array ensures that these steps are included in the onboarding wizard sequence.
396-396
: Include INITIAL_STEP in JavaScript variablesAdding
'INITIAL_STEP'
to the JavaScript variables allows the frontend script to access the initial step value, ensuring consistency between PHP and JavaScript.
305-306
: Confirm the use of 'rest_sanitize_boolean'The
update_setting
method is updating the'tracking'
setting withtrue
, using'rest_sanitize_boolean'
for sanitization. Ensure that'rest_sanitize_boolean'
is the appropriate callback for sanitizing this setting in your context.Run the following script to check if
'rest_sanitize_boolean'
is a valid callable function:css/frm_admin.css (6)
1905-1907
: Gap property defined correctly for.frm-gap-2xs
.The
.frm-gap-2xs
class appropriately sets thegap
tovar(--gap-2xs)
, which enhances layout spacing.
1974-1976
: Transformation applied correctly in.frm-rotate-90
.The
.frm-rotate-90
class correctly usestransform: rotate(90deg);
to rotate elements by 90 degrees.
1978-1980
: Cursor style set appropriately in.frm-cursor-pointer
.The
cursor: pointer;
property is correctly applied, indicating clickable elements.
2469-2474
:.frm-card-box
styles are implemented correctly.The class defines a card component with appropriate max-width, background, border-radius, padding, and border, enhancing the UI consistency.
7785-7788
: SVG icon dimensions set correctly in.frmsvg.frm_svg9
.The class appropriately sets the width and height to
9px
, ensuring consistent icon sizing.
9486-9496
: Styles for.frm-cta-footer
are correctly defined.The
.frm-cta.frm-cta-border .frm-cta-footer
class has proper styling for background, padding, borders, border-radius, and margins, which should render the footer as intended.
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- css/frm_admin.css (12 hunks)
🧰 Additional context used
🔇 Additional comments (7)
css/frm_admin.css (7)
1615-1618
: LGTM: Color utility classes added.These new utility classes for text colors are a good addition. They provide flexibility for styling text in different shades of grey.
1694-1696
: LGTM: New margin utility class added.The addition of this margin utility class enhances the flexibility of the styling system.
1698-1700
: LGTM: Additional margin utility class added.This new margin utility class further expands the options for fine-tuning layouts.
1766-1769
: LGTM: New padding utility class added.The addition of this padding utility class provides more options for controlling element spacing.
7785-7789
: LGTM: New SVG size class added.This new class for 9x9 SVG icons adds to the existing set of icon size options, maintaining consistency in the styling system.
Line range hint
1-9789
: Overall assessment: Good additions with minor suggestions for improvement.The changes in this file primarily involve the addition of new utility classes for margins, padding, text colors, and SVG sizes. These additions enhance the flexibility and maintainability of the styling system.
Two instances of
!important
usage were flagged for reconsideration to improve long-term maintainability.Consider implementing the suggested changes to avoid potential specificity issues in the future.
1319-1322
: 🛠️ Refactor suggestionConsider removing
!important
from border-radius declaration.The use of
!important
here may make it difficult to override this style if needed in the future. Consider if this level of specificity is necessary, or if the same effect can be achieved through more specific selectors..frm-button-primary.frm-sharp, .frm-button-secondary.frm-sharp { - border-radius: 12px !important; + border-radius: 12px; }Likely invalid or redundant comment.
.frm-button-primary.frm_large, | ||
.frm-button-secondary.frm_large { | ||
height: auto !important; | ||
padding: 9px 18px !important; | ||
padding: 12px 16px !important; |
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.
🛠️ Refactor suggestion
Avoid using !important
for button styles.
Using !important
can lead to specificity issues and make styles harder to maintain. Consider increasing the specificity of the selector or restructuring the CSS to avoid the need for !important
.
.frm-button-primary.frm_large,
.frm-button-secondary.frm_large {
- height: auto !important;
- padding: 12px 16px !important;
+ height: auto;
+ padding: 12px 16px;
}
If these styles are being overridden elsewhere, consider using a more specific selector or restructuring the CSS hierarchy to achieve the desired effect without !important
.
📝 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.
.frm-button-primary.frm_large, | |
.frm-button-secondary.frm_large { | |
height: auto !important; | |
padding: 9px 18px !important; | |
padding: 12px 16px !important; | |
.frm-button-primary.frm_large, | |
.frm-button-secondary.frm_large { | |
height: auto; | |
padding: 12px 16px; |
* @return {void} | ||
*/ | ||
export function updateRootline( currentStep ) { | ||
if (currentStep === STEPS.UNSUCCESSFUL) { |
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.
We haven't gotten linting set up yet, but I'd generally try to have spaces inside of these braces.
<?php | ||
echo esc_html( $args['primary-button-text'] ); | ||
|
||
if ( $args['primary-button-with-icon'] === true ) { |
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 we expect other values here other than true
and false
? If $args['primary-button-with-icon']
is consistently a boolean, I'd generally opt to not include the === true
which seems redundant.
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.
I haven't looked much into the actual changes to onboarding yet, but the code looks good.
I left some pretty minor comments.
I'll test this out soon. Thanks Sherv!
* | ||
* @since 6.9 | ||
* | ||
* @return void | ||
*/ | ||
public static function ajax_setup_email_step() { | ||
public static function ajax_consent_tracking() { |
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.
@shervElmi As far as I understand, we want to also subscribe to ActiveCampaign at this step?
The "Get key updates, tips, and occasional offers to enhance your WordPress experience." part of this onboarding isn't related to the consent.
We'll need to figure this out still.
PR Description
This PR enhances and updates the existing Formidable Forms Onboarding Wizard for improved functionality and user experience.
Demo Video
https://share.cleanshot.com/2L0v82hf