Skip to content
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

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Improve Onboarding #2042

wants to merge 16 commits into from

Conversation

shervElmi
Copy link
Contributor

@shervElmi shervElmi commented Oct 11, 2024

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

@shervElmi shervElmi self-assigned this Oct 14, 2024
@shervElmi shervElmi marked this pull request as ready for review October 17, 2024 15:58
Copy link
Contributor

coderabbitai bot commented Oct 17, 2024

Walkthrough

The 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

File Path Change Summary
classes/controllers/FrmHooksController.php Modified action hook from onboarding setup email to consent tracking.
classes/controllers/FrmOnboardingWizardController.php Updated INITIAL_STEP, renamed ajax_setup_email_step to ajax_consent_tracking, modified step parts, and removed email settings parameters.
classes/helpers/FrmOnboardingWizardHelper.php Changed default argument values in print_footer method.
classes/views/onboarding-wizard/footer.php Added CSS class to back button and conditional check for icon in primary button.
classes/views/onboarding-wizard/index.php Changed data-current-step attribute and added rootline list.
classes/views/onboarding-wizard/steps/consent-tracking-step.php New file created for consent tracking step with structured interface.
classes/views/onboarding-wizard/steps/default-email-address-step.php File deleted.
classes/views/onboarding-wizard/steps/install-addons-step.php Updated icon to image and clarified CTA for Pro version.
classes/views/onboarding-wizard/steps/install-formidable-pro-step.php File deleted.
classes/views/onboarding-wizard/steps/license-management-step.php File deleted.
classes/views/onboarding-wizard/steps/success-step.php Replaced icon with SVG logo and updated success text.
classes/views/onboarding-wizard/steps/unsuccessful-step.php New file created for unsuccessful step of onboarding wizard.
classes/views/onboarding-wizard/steps/welcome-step.php File deleted.
css/admin/onboarding-wizard.css CSS modifications for visual structure, including new classes.
css/frm_admin.css Extensive CSS updates for styles and responsive design.
js/onboarding-wizard.js Restructured class and enhanced event handling with new utility functions.
js/src/onboarding-wizard/dataUtils/setupUsageData.js Expanded conditions for appending completed steps and removed email step data logic.
js/src/onboarding-wizard/elements/elements.js Removed multiple elements related to onboarding wizard.
js/src/onboarding-wizard/events/backButtonListener.js Simplified onBackButtonClick function signature.
js/src/onboarding-wizard/events/checkProInstallationButtonListener.js File deleted.
js/src/onboarding-wizard/events/consentTrackingButtonListener.js New file for managing events related to consent tracking button.
js/src/onboarding-wizard/events/index.js Updated to replace several event listeners with the new consent tracking event.
js/src/onboarding-wizard/events/saveLicenseButtonListener.js File deleted.
js/src/onboarding-wizard/events/setupEmailStepButtonListener.js File deleted.
js/src/onboarding-wizard/events/skipProInstallationButtonListener.js File deleted.
js/src/onboarding-wizard/events/skipStepButtonListener.js Simplified onSkipStepButtonClick function signature.
js/src/onboarding-wizard/index.js Removed comment line; functionality unchanged.
js/src/onboarding-wizard/shared/constants.js Removed several constants and updated STEPS object.
js/src/onboarding-wizard/shared/pageState.js Removed emailStepData property from exported object.
js/src/onboarding-wizard/ui/index.js Modified export statements to focus on rootline functionalities.
js/src/onboarding-wizard/ui/rootline.js New function updateRootline introduced.
js/src/onboarding-wizard/ui/setupInitialView.js Removed functions related to progress indicators and email form handling.
js/src/onboarding-wizard/ui/showError.js File deleted.
js/src/onboarding-wizard/utils/navigateToStep.js Modified to call updateRootline after updating URL query parameter.

Possibly related PRs

  • Add Default from address setting #1967: This PR modifies the ajax_setup_email_step method in the FrmOnboardingWizardController class, which is directly related to the changes made in the main PR regarding the onboarding process and email handling.
  • Update Default Form Styling #1640: Although primarily focused on styling, this PR may indirectly relate to the onboarding process as it updates the default form styling, which could affect the visual presentation of the onboarding steps.
  • New Add-Ons Page #1802: This PR includes changes to the FrmHooksController class, which is also modified in the main PR, indicating a connection in how hooks are managed during the onboarding process.
  • Issue fixes/ff style update #1974: This PR updates various styles and components, which could impact the user interface of the onboarding wizard, making it relevant to the changes in the main PR.
  • Fix some add-ons icons appearing greyed out #2031: This PR addresses visual issues with add-on icons, which may relate to the onboarding experience when users are introduced to add-ons during the setup process.

Suggested reviewers

  • Crabcyborg
  • garretlaxton

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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:

  1. Ensure comprehensive end-to-end testing of the new onboarding flow.
  2. Verify that all necessary steps are still included and functional in the wizard.
  3. Consider updating documentation to reflect these changes in the onboarding process.
  4. 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 added

The 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:

  1. Add analytics tracking to measure the effectiveness of the onboarding process.
  2. Implement A/B testing for different variations of the success message to optimize user engagement.
  3. 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 of admin_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:

  1. Including both successful and unsuccessful steps.
  2. 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 update

The changes improve the code structure by extracting onboardingWizardPage from getElements(). The addition of updateRootline(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 tracking

The 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 suggestion

The 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 suggestion

The 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 accessibility

The 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() and esc_attr() functions ensures proper escaping.

Consider adding width and height 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 and 40 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

📥 Commits

Files that changed from the base of the PR and between 2689641 and 0fb2f1a.

⛔ 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 process

The changes in this file align with the PR objective of improving the onboarding process. The removal of the showError export and the addition of the rootline 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 the UNSUCCESSFUL 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 and WELCOME_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 and WELCOME_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 styling

The 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 text

Good 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 button

The 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:

  1. The icon uses several CSS classes for styling, including rotation and positioning.
  2. 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 footer

The 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:

  1. Enhanced back button styling for better visibility.
  2. Improved security for the primary button text rendering.
  3. 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 cat

Length 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 cat

Length of output: 1075

classes/views/onboarding-wizard/index.php (3)

12-12: LGTM: Updated initial step in onboarding process

The 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 text

The 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 clarity

The changes to this file effectively enhance the onboarding process by:

  1. Updating the initial step to focus on consent tracking.
  2. Adding a clear visual rootline of the onboarding steps.
  3. 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 to STEPS.SUCCESS when it's STEPS.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 in success-step.php is appropriately handled by FrmOnboardingWizardHelper::print_footer, which applies esc_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 tracking

The changes in this file enhance the onboarding process by:

  1. Improving the handling of both successful and unsuccessful completions.
  2. Streamlining data processing by removing email-related functionality.

These modifications align with the PR objective of improving the onboarding experience. However, please ensure that:

  1. The removal of email-related functionality is intentional and doesn't negatively impact user communication or data collection for other parts of the system.
  2. 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 of processDataForStep changes on setupUsageData

While there are no direct changes to setupUsageData, the modifications in processDataForStep affect its behavior. Ensure that:

  1. The function correctly handles both successful and unsuccessful onboarding completions.
  2. 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 Correct

The 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 updateRootline

The addition of the updateRootline import is consistent with the changes made in the navigateToStep 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 color

Using 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 padding

The 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 margin

The top margin for #frm-onboarding-return-dashboard has been reduced from var(--gap-xl) to var(--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 sizing

The 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 ending

Adding 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:

  1. Adding width and height attributes to the logo image.
  2. Adding an aria-label to the external link icon.
  3. 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 FrmOnboardingWizardHelper

The 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:

  1. Changing the default behavior for displaying the back button.
  2. Adding a new argument for primary button icon support (currently unused).
  3. 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 false

The 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 in FrmOnboardingWizardController.

The change from frm_onboarding_setup_email_step to frm_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 the FrmOnboardingWizardController class. You can verify this with the following script:

✅ Verification successful

Verified: The ajax_consent_tracking method is implemented in FrmOnboardingWizardController, 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 correctly

The import of PREFIX from '../shared' ensures that the prefix is consistently used throughout the file.


16-18: Element selectors are appropriately defined

The elements steps, skipStepButtons, and backButtons are correctly selected using querySelectorAll with the appropriate class selectors.


20-21: New buttons are correctly initialized

The consentTrackingButton and installAddonsButton elements are properly retrieved using their respective IDs with the PREFIX.


23-23: Hidden license key input is correctly referenced

The 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 with document.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 the rootline 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 2

Length 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 2

Length 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 2

Length 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 no step 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 tooltips

In lines 56, 76, and 107, the __() function is used to retrieve translated strings passed to FrmAppHelper::tooltip_icon(). Please ensure that tooltip_icon() properly escapes the content when outputting to prevent potential security issues. If it doesn't handle escaping, consider using esc_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 array

The 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 variables

Adding '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 with true, 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 the gap to var(--gap-2xs), which enhances layout spacing.


1974-1976: Transformation applied correctly in .frm-rotate-90.

The .frm-rotate-90 class correctly uses transform: 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.

js/src/onboarding-wizard/ui/rootline.js Show resolved Hide resolved
js/src/onboarding-wizard/ui/rootline.js Show resolved Hide resolved
classes/helpers/FrmOnboardingWizardHelper.php Show resolved Hide resolved
css/frm_admin.css Show resolved Hide resolved
css/frm_admin.css Show resolved Hide resolved
css/frm_admin.css Show resolved Hide resolved
css/frm_admin.css Show resolved Hide resolved
css/frm_admin.css Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Files that changed from the base of the PR and between 0fb2f1a and 80f621f.

📒 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 suggestion

Consider 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.

Comment on lines +1419 to +1422
.frm-button-primary.frm_large,
.frm-button-secondary.frm_large {
height: auto !important;
padding: 9px 18px !important;
padding: 12px 16px !important;
Copy link
Contributor

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.

Suggested change
.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) {
Copy link
Contributor

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 ) {
Copy link
Contributor

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.

Copy link
Contributor

@Crabcyborg Crabcyborg left a 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() {
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants