Improve Onboarding#2042
Conversation
WalkthroughThe pull request introduces significant modifications to the onboarding process, primarily focusing on the transition from a welcome step to a consent tracking step. This includes changes to the 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.
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
addConsentTrackingButtonEventsfunction 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
consentTrackingButtonbefore 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
addConsentTrackingButtonEventsfunction.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_footerpromotes 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
onboardingWizardPagefromgetElements(). The addition ofupdateRootline(stepName)enhances the UI feedback during navigation.Consider adding a comment explaining the purpose of
updateRootlinefor 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
setupUsageDatacall 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-menuand 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
.frmsvgrotation 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-rootlineand 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
widthandheightattributes 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
200and40with 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-labelto 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.svgis excluded by!**/*.svg,!**/*.svgimages/logo.svgis excluded by!**/*.svg,!**/*.svgimages/onboarding-wizard/onboarding-bg.svgis 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
showErrorexport and the addition of therootlineexport suggest a shift in focus from error handling to guiding users through the onboarding steps.However, we should ensure that the removal of the
showErrorexport doesn't negatively impact error handling in other parts of the application that might have been using it.Let's verify that the
showErrorfunctionality 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
STEPSobject, including the addition of theUNSUCCESSFULstep, 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
UNSUCCESSFULstep, 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
UNSUCCESSFULstep 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
proIsIncludedandWELCOME_STEP_IDhave 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
proIsIncludedandWELCOME_STEP_IDare 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
addConsentTrackingButtonEventsis 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_largeclass 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-hiddenattribute 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
addConsentTrackingButtonEventsimport 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_CLASSis defined with an intuitive name.
23-34: Clarify the handling of the 'unsuccessful' step.The current implementation sets the
currentSteptoSTEPS.SUCCESSwhen 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.phpis 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 ofprocessDataForStepchanges onsetupUsageDataWhile there are no direct changes to
setupUsageData, the modifications inprocessDataForStepaffect 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:
setupUsageDataFunctionality is CorrectThe shell script results confirm that:
- No email-related code exists in the onboarding process.
- The
setupUsageDatafunction 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
updateRootlineimport is consistent with the changes made in thenavigateToStepfunction. 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-dashboardhas 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-logoensures 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_footerthat 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_steptofrm_onboarding_consent_trackingaligns 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_trackingmethod has been implemented in theFrmOnboardingWizardControllerclass. You can verify this with the following script:✅ Verification successful
Verified: The
ajax_consent_trackingmethod 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
PREFIXfrom'../shared'ensures that the prefix is consistently used throughout the file.
16-18: Element selectors are appropriately definedThe elements
steps,skipStepButtons, andbackButtonsare correctly selected usingquerySelectorAllwith the appropriate class selectors.
20-21: New buttons are correctly initializedThe
consentTrackingButtonandinstallAddonsButtonelements are properly retrieved using their respective IDs with thePREFIX.
23-23: Hidden license key input is correctly referencedThe
hiddenLicenseKeyInputis 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
rootlineis 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
rootlinehas been confirmed to be intentional and correctly implemented. No typos or inconsistencies were found regarding the selection and usage of therootlineelement.🏁 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
STEPSfrom'../shared'is essential for step navigation throughout the onboarding process.
58-58: LGTM!Defaulting to
STEPS.INITIALwhen nostepquery 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_STEPconstant 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_partsarray 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_settingmethod 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-2xsclass appropriately sets thegaptovar(--gap-2xs), which enhances layout spacing.
1974-1976: Transformation applied correctly in.frm-rotate-90.The
.frm-rotate-90class 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-boxstyles 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-footerare correctly defined.The
.frm-cta.frm-cta-border .frm-cta-footerclass 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.
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
!importantusage 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
!importantfrom border-radius declaration.The use of
!importanthere 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.
Crabcyborg
left a comment
There was a problem hiding this comment.
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!
…rmidable-forms into improve-onboarding
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (21)
css/frm_admin.css (20)
Line range hint
9-24: Consider grouping related variables together.The CSS variables are well-defined, but they could be organized better. Consider grouping related variables (e.g., all color variables, all size variables) for improved readability and maintenance.
Line range hint
95-130: Consider using more specific selectors for better performance.Some selectors like
.frm_wrap pare quite broad and might affect more elements than intended. Consider using more specific selectors to avoid unintended style applications and potential performance issues.
Line range hint
188-230: Consider using flexbox or grid for improved layout control.For some layout components, like
.frm_form_settings, consider using modern CSS layout techniques such as flexbox or grid. This can simplify the CSS and provide more flexible layouts.
Line range hint
282-350: Consider refactoring repeated styles.There are some repeated styles for different button types. Consider creating a base button class and then extending it for different variations to reduce code duplication.
Line range hint
402-450: Consider using CSS grid for improved layout control.For complex layouts like
.frm_grid_container, consider using CSS grid instead of floats. This can simplify the CSS and provide more flexible layouts.
Line range hint
502-550: Consider using CSS custom properties for transitions.For transitions, consider using CSS custom properties to define the duration and timing function. This would allow for easier global changes to animation styles.
Line range hint
602-650: Consider using more semantic class names.Some class names like
.frm_no_marginare not very semantic. Consider using more descriptive names that indicate the purpose rather than the style.
Line range hint
702-750: Consider using CSS grid for form builder layout.For the form builder layout, consider using CSS grid instead of absolute positioning. This can provide a more flexible and maintainable layout system.
Line range hint
802-850: Consider using CSS custom properties for z-index values.To manage z-index more effectively, consider using CSS custom properties to define a z-index scale. This can help prevent z-index conflicts and make it easier to maintain proper layering.
Line range hint
902-950: Consider using CSS grid for card layouts.For card layouts, consider using CSS grid instead of flexbox. This can provide more control over both row and column layouts.
Line range hint
1002-1050: Consider using CSS custom properties for box shadows.To maintain consistency in box shadows, consider using CSS custom properties to define a set of standard shadow styles.
Line range hint
1102-1150: Consider using CSS grid for form layout.For form layouts, especially multi-column forms, consider using CSS grid. This can provide more flexible and responsive layouts.
Line range hint
1202-1250: Consider using CSS custom properties for transition durations.To maintain consistency in animations, consider using CSS custom properties to define standard transition durations.
Line range hint
1302-1350: Consider using CSS grid for complex layouts.For complex layouts like
.frm_grid_container, consider using CSS grid instead of floats or flexbox. This can provide more control over both rows and columns.
Line range hint
1402-1450: Consider using CSS custom properties for color variations.To maintain consistency in color variations (like hover states), consider using CSS custom properties and HSL color values. This can make it easier to create and maintain a consistent color scheme.
Line range hint
1502-1550: Consider using CSS grid for form field layouts.For form field layouts, especially multi-column layouts, consider using CSS grid. This can provide more flexible and responsive layouts.
Line range hint
1602-1650: Consider using CSS custom properties for font sizes.To maintain consistency in typography, consider using CSS custom properties to define a typographic scale.
Line range hint
1702-1750: Consider using CSS grid for complex table layouts.For complex table layouts, especially responsive tables, consider using CSS grid. This can provide more flexible and responsive layouts.
Line range hint
1802-1850: Consider using CSS custom properties for spacing values.To maintain consistency in layout spacing, consider using CSS custom properties to define a spacing scale.
Line range hint
1902-1950: Consider using CSS grid for form field option layouts.For form field option layouts, especially multi-column layouts, consider using CSS grid. This can provide more flexible and responsive layouts.
classes/controllers/FrmOnboardingWizardController.php (1)
Line range hint
444-444: Update the@deprecatedannotation with the correct versionThe docblock for
is_onboarding_wizard_displayed()has an incomplete@deprecated x.xannotation. Please provide the appropriate version number when the method was deprecated.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
- classes/controllers/FrmOnboardingWizardController.php (3 hunks)
- classes/views/onboarding-wizard/footer.php (1 hunks)
- css/frm_admin.css (12 hunks)
- js/src/onboarding-wizard/ui/rootline.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- classes/views/onboarding-wizard/footer.php
- js/src/onboarding-wizard/ui/rootline.js
🧰 Additional context used
🔇 Additional comments (25)
css/frm_admin.css (22)
Line range hint
1-7: CSS variables are well-implemented for consistent theming.The use of CSS variables (custom properties) for colors, sizes, and spacing is a good practice. It allows for easy theme customization and maintains consistency throughout the stylesheet.
Line range hint
26-46: Font loading and styling is well-implemented.The use of
@font-facefor loading the Inter font and the fallback font stack is good. The-webkit-font-smoothingproperty for Safari is a nice touch for improved text rendering.
Line range hint
48-93: Good use of utility classes for spacing and typography.The utility classes for margins, paddings, and typography are well-defined and follow a consistent naming convention. This promotes reusability and helps maintain a consistent design system.
Line range hint
132-186: Responsive design is well-implemented.The use of media queries for responsive design is good. The file adjusts layouts and sizes for different screen widths, ensuring a good user experience across devices.
Line range hint
232-280: Good use of CSS for form styling.The form input styling is consistent and well-implemented. The use of
:focusstates improves usability.
Line range hint
352-400: Good use of SVG icons and styling.The implementation of SVG icons and their styling is well done. The use of
currentColorfor icon colors allows for easy theming.
Line range hint
452-500: Good implementation of modal styles.The modal styles are well-implemented, with good use of z-index for proper layering.
Line range hint
552-600: Good use of print styles.The print styles are well-implemented, hiding unnecessary elements and adjusting layouts for better print output.
Line range hint
652-700: Good implementation of RTL styles.The RTL (Right-to-Left) styles are well-implemented, ensuring proper layout for RTL languages.
Line range hint
752-800: Good use of CSS for accessibility.The focus styles and color contrasts seem to be well-implemented, which is good for accessibility.
Line range hint
852-900: Good implementation of tooltip styles.The tooltip styles are well-implemented, with good positioning and appearance.
Line range hint
952-1000: Good use of CSS for form validation styles.The form validation styles are well-implemented, providing clear visual feedback for users.
Line range hint
1052-1100: Good implementation of responsive table styles.The responsive table styles are well-implemented, ensuring good display on smaller screens.
Line range hint
1152-1200: Good use of CSS for accessibility in form elements.The focus and hover states for form elements are well-implemented, which is good for accessibility.
Line range hint
1252-1300: Good implementation of modal overlay styles.The modal overlay styles are well-implemented, providing a good user experience for modal dialogs.
Line range hint
1352-1400: Good use of CSS for form builder UI elements.The styles for form builder UI elements are well-implemented, providing a good user experience for form creation.
Line range hint
1452-1500: Good implementation of responsive design for admin pages.The responsive design for admin pages is well-implemented, ensuring a good user experience across different device sizes.
Line range hint
1552-1600: Good use of CSS for accessibility in interactive elements.The focus and hover states for interactive elements are well-implemented, which is good for accessibility.
Line range hint
1652-1700: Good implementation of styles for form preview.The styles for form preview are well-implemented, providing a good representation of the final form appearance.
Line range hint
1752-1800: Good use of CSS for accessibility in form elements.The focus and hover states for form elements are well-implemented, which is good for accessibility.
Line range hint
1852-1900: Good implementation of styles for form builder UI.The styles for the form builder UI are well-implemented, providing a good user experience for form creation.
Line range hint
1952-2000: Good use of CSS for accessibility in interactive elements.The focus and hover states for interactive elements are well-implemented, which is good for accessibility.
classes/controllers/FrmOnboardingWizardController.php (3)
82-82: INITIAL_STEP updated to 'consent-tracking'The
INITIAL_STEPconstant has been set to'consent-tracking', aligning with the updated starting point of the onboarding process.
282-285: Added 'unsuccessful' step to the onboarding flowIncluding
'unsuccessful'in the$step_partsarray ensures that the wizard can handle scenarios where onboarding is not successful.
428-428: Added 'INITIAL_STEP' to JavaScript variablesIncluding
INITIAL_STEPin the JavaScript variables ensures that the client-side code correctly initializes with the updated onboarding step.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- classes/controllers/FrmOnboardingWizardController.php (3 hunks)
🧰 Additional context used
🔇 Additional comments (6)
classes/controllers/FrmOnboardingWizardController.php (6)
Line range hint
1-701: Overall assessment of changes to FrmOnboardingWizardControllerThe changes to this file significantly alter the onboarding process for Formidable Forms, shifting the focus to consent tracking as the initial step and integrating ActiveCampaign subscription. Key points:
- The initial step has been changed to 'consent-tracking'.
- The onboarding steps structure has been updated accordingly.
- AJAX handling for consent tracking has been implemented.
- A new method for ActiveCampaign subscription has been added, though it needs some improvements.
- JavaScript variables have been simplified.
- An outdated method has been properly deprecated.
These changes should improve the user onboarding experience and align the process with current consent and tracking practices. However, ensure that all suggested verifications are performed to maintain code consistency and functionality across the codebase.
282-285: Updated onboarding steps structureThe $step_parts array has been revised to include the new consent-tracking step and an unsuccessful step. This change aligns with the updated INITIAL_STEP constant.
Verify the existence of the new step files with the following script:
#!/bin/bash # Check if the new step files exist for step in "consent-tracking-step.php" "unsuccessful-step.php"; do if [ -f "classes/views/onboarding-wizard/steps/$step" ]; then echo "$step exists" else echo "$step does not exist" fi done
298-314: Updated consent tracking AJAX handlerThe method has been renamed and simplified to focus on consent tracking. The addition of ActiveCampaign subscription aligns with the new consent-based approach.
To ensure the ActiveCampaign subscription is working correctly, you may want to add logging or testing. Here's a script to check for any existing logs or tests:
#!/bin/bash # Search for ActiveCampaign related logs or tests rg -i "activecampaign" --type php
429-431: Simplified JavaScript variablesThe
proIsIncludedvariable has been removed from theget_js_variablesmethod. This simplification is good, assuming the variable is no longer needed in the frontend.To ensure this removal doesn't affect any frontend functionality, run the following script to check for any remaining references to
proIsIncluded:#!/bin/bash # Search for any remaining references to 'proIsIncluded' in JS files rg -i "proIsIncluded" --type js
Line range hint
695-701: Deprecated is_onboarding_wizard_displayed methodThe
is_onboarding_wizard_displayedmethod has been correctly deprecated. This change helps maintain code cleanliness by marking outdated functionality.To ensure there are no remaining calls to this deprecated method, run the following script:
✅ Verification successful
Deprecated
is_onboarding_wizard_displayedmethod verifiedThe deprecation of the
is_onboarding_wizard_displayedmethod has been correctly implemented, and there are no remaining calls to this method in the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for any remaining calls to 'is_onboarding_wizard_displayed' rg -i "is_onboarding_wizard_displayed" --type phpLength of output: 162
82-82: Initial step changed to consent trackingThe INITIAL_STEP constant has been updated from 'welcome' to 'consent-tracking'. This change shifts the focus of the onboarding process to start with consent tracking, which may impact the user's first interaction with the wizard.
To ensure this change is consistently applied throughout the codebase, run the following script:
|
@shervElmi I tested through this and the only thing I noticed after upgrading it to PRO was this:
|
There was a problem hiding this comment.
Actionable comments posted: 3
📜 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 (11)
css/frm_admin.css (11)
1319-1322: Previous comment still applies regarding the use of!important.As previously noted, the use of
!importantin CSS declarations can make the stylesheet harder to maintain and override. Please consider refactoring to avoid using!important, possibly by increasing selector specificity.
1419-1422: Previous comment still applies regarding the use of!important.The
!importantrule is still present in these declarations, which can lead to specificity issues. Consider restructuring the CSS to eliminate the need for!important.
1694-1696: Previous comment still applies regarding the use of!important.Using
!importantcan cause maintenance challenges. It's recommended to use CSS specificity or adjust the CSS cascade to achieve the desired styles without!important.
1698-1700: Previous comment still applies regarding the use of!important.Avoid overusing
!importantin CSS declarations to prevent specificity conflicts and improve maintainability.
1766-1769: Previous comment still applies regarding the use of!important.Reconsider the use of
!importantin padding declarations. It can override the natural cascade and make the CSS harder to maintain.
1615-1617: Utility class.frm-text-grey-500is defined correctly.The class is consistently named and follows established conventions.
1863-1865: Definition of.frm-inline-flexis correct.The class applies
display: inline-flex;appropriately and is consistent with coding standards.
1905-1907: Utility class.frm-gap-2xsis defined appropriately.The class correctly sets the
gapproperty and adheres to naming conventions.
1974-1976: Definition of.frm-rotate-90is acceptable.The class properly applies a 90-degree rotation using
transform: rotate(90deg);.
1978-1980: Utility class.frm-cursor-pointeris defined correctly.The class sets
cursor: pointer;, enhancing usability when applied to interactive elements.
9453-9455: Definition of.frm-cta-green.frm-cta-border .frm-cta-footeris acceptable.The border color is correctly set, enhancing the visual consistency of the component.
|
Hi @lauramekaj1, Thanks for the feedback, I addressed that issue. Could you confirm my solution? |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Outside diff range and nitpick comments (5)
classes/controllers/FrmOnboardingWizardController.php (3)
298-314: Update method docblock and consider error handling.The changes to this method align well with the new consent-tracking step. However, there are two areas for improvement:
- The method's docblock still refers to the old "Never miss an important update" step and should be updated.
- Consider adding error handling for the ActiveCampaign subscription process.
Update the docblock to reflect the new purpose:
/** - * Handle AJAX request to setup the "Never miss an important update" step. + * Handle AJAX request for the consent tracking step and ActiveCampaign subscription. * * @since 6.9 * * @return void */Consider adding error handling for the ActiveCampaign subscription:
self::subscribe_to_active_campaign(); + +// Check if subscription was successful +if ( ! did_action( 'frm_active_campaign_subscribed' ) ) { + wp_send_json_error( array( 'message' => 'Failed to subscribe to ActiveCampaign' ) ); +} // Send response. wp_send_json_success();
317-346: Improve ActiveCampaign subscription methodThe new
subscribe_to_active_campaignmethod has been added to handle user subscriptions. However, there are a few areas for improvement:
- The
@sincetag is incomplete. Please update it with the correct version number.- Add error handling for the
wp_remote_postrequest to ensure reliability.- Consider using a configuration constant for the subscription URL to easily switch between sandbox and production environments.
Here's a suggested improvement for the method:
/** * When the user consents to receiving news of updates, subscribe their email to ActiveCampaign. * - * @since x.x + * @since 6.9 * * @return void */ private static function subscribe_to_active_campaign() { $user = wp_get_current_user(); if ( empty( $user->user_email ) ) { return; } - wp_remote_post( + $response = wp_remote_post( 'https://sandbox.formidableforms.com/api/wp-admin/admin-ajax.php?action=frm_forms_preview&form=subscribe-onboarding', array( 'body' => http_build_query( array( 'form_key' => 'subscribe-onboarding', 'frm_action' => 'create', 'form_id' => 5, 'item_key' => '', 'item_meta[0]' => '', 'item_meta[15]' => $user->user_email, 'item_meta[17]' => 'Source - FF Lite Plugin Onboarding', ) ), ) ); + if ( is_wp_error( $response ) ) { + error_log( 'ActiveCampaign subscription failed: ' . $response->get_error_message() ); + } elseif ( wp_remote_retrieve_response_code( $response ) !== 200 ) { + error_log( 'ActiveCampaign subscription failed with status code: ' . wp_remote_retrieve_response_code( $response ) ); + } }Consider defining a constant for the subscription URL:
const ACTIVE_CAMPAIGN_SUBSCRIPTION_URL = 'https://sandbox.formidableforms.com/api/wp-admin/admin-ajax.php?action=frm_forms_preview&form=subscribe-onboarding';Then use this constant in the
subscribe_to_active_campaignmethod. This will make it easier to switch between sandbox and production environments.
Line range hint
1-731: Overall improvements to the Onboarding WizardThe changes made to the
FrmOnboardingWizardControllerclass significantly enhance the onboarding process for Formidable Forms. Key improvements include:
- Introduction of a consent tracking step, improving user privacy management.
- Integration with ActiveCampaign for user subscriptions.
- More comprehensive and flexible add-on management, including handling of Pro-specific add-ons and integration with third-party plugins like Gravity Forms.
- Deprecation of outdated methods, suggesting ongoing refactoring efforts.
These changes should result in a more streamlined, user-friendly, and feature-rich onboarding experience. However, thorough testing is recommended to ensure all new features and integrations work as expected across different scenarios (e.g., with/without Pro, with/without specific plugins).
Consider implementing a comprehensive test suite for the onboarding process to ensure reliability across various user scenarios and plugin configurations. This could include unit tests for individual methods and integration tests for the entire onboarding flow.
classes/models/FrmInstallPlugin.php (2)
88-120: Ensure proper error handling during plugin installationThe installation process lacks handling for scenarios where the plugin download URL might not be available or the plugin package could be corrupted. Consider adding checks to handle these exceptions gracefully.
156-167: Update the docblock with the correct versionIn the docblock for
is_plugin_installed(), the@sincetag has a placeholderx.x. This should be updated to reflect the actual version number in which this method is introduced.Apply this diff to update the docblock:
- * @since x.x + * @since 6.9
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (5)
- classes/controllers/FrmOnboardingWizardController.php (6 hunks)
- classes/helpers/FrmOnboardingWizardHelper.php (4 hunks)
- classes/models/FrmInstallPlugin.php (2 hunks)
- js/onboarding-wizard.js (1 hunks)
- js/src/onboarding-wizard/events/installAddonsButtonListener.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- classes/helpers/FrmOnboardingWizardHelper.php
🧰 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 (9)
classes/controllers/FrmOnboardingWizardController.php (6)
Line range hint
726-731: LGTM. Update references to deprecated method.The deprecation of the
is_onboarding_wizard_displayedmethod is approved. This change likely reflects updates in how the onboarding wizard's state is managed.Please ensure that any code still referencing this deprecated method is updated. Run the following script to check for any remaining references:
#!/bin/bash # Search for any remaining references to the deprecated method rg "is_onboarding_wizard_displayed" --type phpIf any references are found, they should be updated to use the new method for determining the onboarding wizard's display status.
671-684: LGTM. Verify Gravity Forms integration.The addition of the Gravity Forms Migrator add-on is a valuable feature for users transitioning from Gravity Forms. This change enhances the onboarding process by offering relevant migration tools.
To ensure the Gravity Forms Migrator add-on is correctly integrated, please run the following tests:
- Test with Gravity Forms installed and active.
- Test without Gravity Forms installed.
You can use the following script to check the Gravity Forms status and the availability of the migrator add-on:
#!/bin/bash # Check if Gravity Forms is installed and active if wp plugin is-active gravityforms; then echo "Gravity Forms is active" # Check if Gravity Forms Migrator is available in the add-ons list if grep -q "Gravity Forms Migrator" classes/views/onboarding-wizard/steps/install-addons-step.php; then echo "Gravity Forms Migrator is available in the add-ons list" else echo "Gravity Forms Migrator is not available in the add-ons list" fi else echo "Gravity Forms is not active" # Check that Gravity Forms Migrator is not in the add-ons list if ! grep -q "Gravity Forms Migrator" classes/views/onboarding-wizard/steps/install-addons-step.php; then echo "Gravity Forms Migrator is correctly not available in the add-ons list" else echo "Error: Gravity Forms Migrator is in the add-ons list when Gravity Forms is not active" fi fiThis script will help verify that the Gravity Forms Migrator add-on is correctly included or excluded based on the presence of Gravity Forms.
82-82: LGTM. Verify related changes for the new initial step.The change from 'welcome' to 'consent-tracking' as the INITIAL_STEP is approved. This shift in the onboarding process could improve user privacy and preference management.
Please ensure that the 'consent-tracking' step is properly implemented and that all references to the initial step have been updated accordingly. Run the following script to check for any remaining references to the old 'welcome' step:
#!/bin/bash # Search for any remaining references to the 'welcome' step rg "'welcome'" --type php rg '"welcome"' --type php rg "INITIAL_STEP" --type php
282-285: LGTM. Verify implementation of new steps.The updates to the $step_parts array align with the new initial step and introduce an 'unsuccessful' step. This change improves the onboarding flow and error handling.
Please ensure that the new 'consent-tracking' and 'unsuccessful' steps are properly implemented. Run the following script to check for the existence and content of these new step files:
✅ Verification successful
Verified the implementation of the new 'consent-tracking' and 'unsuccessful' steps.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for the existence and content of new step files echo "Checking consent-tracking-step.php:" cat classes/views/onboarding-wizard/steps/consent-tracking-step.php echo "\nChecking unsuccessful-step.php:" cat classes/views/onboarding-wizard/steps/unsuccessful-step.phpLength of output: 7283
Line range hint
567-670: LGTM. Comprehensive update to add-on management.The extensive changes to the
set_available_addonsmethod significantly improve the flexibility and comprehensiveness of add-on management during the onboarding process. The new logic handles various scenarios, including Pro installation status and the presence of specific plugins like SMTP and Gravity Forms.To ensure the new add-on management logic works as expected, please run the following tests:
- Test with Pro installed and not installed.
- Test with and without the SMTP plugin.
- Test with and without Gravity Forms installed.
You can use the following script to check the current plugin status:
This script will help verify that the
set_available_addonsmethod correctly identifies the installed plugins and sets up the available add-ons accordingly.
429-431: LGTM. Verify related frontend changes.The removal of 'proIsIncluded' from the JS variables is approved. This change likely reflects updates in how the onboarding process handles pro features.
Please ensure that any frontend JavaScript code that previously relied on the 'proIsIncluded' variable has been updated accordingly. Run the following script to check for any remaining references to 'proIsIncluded' in JavaScript files:
✅ Verification successful
Apologies for the error in the previous script. Please run the following corrected script to search for any remaining references to
'proIsIncluded'in JS files:
LGTM. Change verified successfully.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for any remaining references to 'proIsIncluded' in JS files rg "proIsIncluded" --type jsLength of output: 254
Script:
#!/bin/bash # Search for any remaining references to 'proIsIncluded' in JS files rg "proIsIncluded" --type jsLength of output: 28
js/src/onboarding-wizard/events/installAddonsButtonListener.js (1)
64-67: Docstring updated correctly for new parameters.The updated documentation accurately reflects the addition of the
isInstalledparameter, improving code clarity and maintainability.classes/models/FrmInstallPlugin.php (1)
105-107: Confirm the download URL is secure and allowedThe check using
FrmAddonsController::url_is_allowed( $api->versions['trunk'] )is crucial for security. Ensure that this method thoroughly validates the URL to prevent any unauthorized downloads.js/onboarding-wizard.js (1)
2-2: Previously identified issues are still presentThe issues flagged in earlier reviews, such as the redundant
'use strict'directive and assignments within expressions, remain in the code. Please address these to enhance code quality.🧰 Tools
🪛 Biome
[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)
Hi @shervElmi, I checked and seems that it's fixed now. Thank you! |
|
Thanks Laura! 🚀 |
PR Description
This PR enhances and updates the existing Formidable Forms Onboarding Wizard for improved functionality and user experience.
QA URL
https://qa.formidableforms.com/sherv/wp-admin/admin.php?page=formidable-onboarding-wizard
Demo Video
https://share.cleanshot.com/2L0v82hf
Onboarding.Wizard.mp4
To easily load the onboarding wizard after having already activated Formidable before is to load
/wp-admin/admin.php?page=formidable-onboarding-wizarddirectly