Skip to content

Add banner about updating default email address to email action#2239

Open
AbdiTolesa wants to merge 24 commits into
masterfrom
issue-5453-add_banner_about_updating_default_email_address_to_email_action
Open

Add banner about updating default email address to email action#2239
AbdiTolesa wants to merge 24 commits into
masterfrom
issue-5453-add_banner_about_updating_default_email_address_to_email_action

Conversation

@AbdiTolesa
Copy link
Copy Markdown
Contributor

@AbdiTolesa AbdiTolesa commented Feb 3, 2025

Fix https://github.com/Strategy11/formidable-pro/issues/5453
Design: https://www.figma.com/design/QnMV8Njb7k5hDSdgrvNveY/Form-Actions-(Explorations)?node-id=6-207&t=Y9cwZI7PmScrnuVF-0

image

Test procedure

  1. Go to form actions tab of your form and open an email action.
  2. Confirm that a banner is implemented as per the design in the url above.
  3. Confirm that clicking Got it dismisses the banner and it would never be displayed for that user again, even after form reload.
  4. Confirm that Setup emails redirects user to the email setup page.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 3, 2025

Warning

Rate limit exceeded

@AbdiTolesa has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 28 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d297f0a and 2224ba3.

📒 Files selected for processing (1)
  • js/admin/settings.js (3 hunks)

Walkthrough

Adds a dismissible admin notice warning when a form action’s To and From emails may be the same, styles that notice, registers and implements an AJAX endpoint to persist dismissal in user meta, and adds delegated JS to send the dismissal request and remove the notice client-side.

Changes

Cohort / File(s) Change Summary
View / Notice
classes/views/frm-form-actions/_action_inside.php
Inserted conditional block that renders a dismissible warning about using the same To/From email when the new controller check returns true.
Styling (CSS/SCSS)
css/frm_admin.css, resources/scss/admin/components/form/_form-actions.scss
Added .frm_default_email_message styling (background, padding, border-radius) and responsive layout adjustments.
AJAX hook registration
classes/controllers/FrmHooksController.php
Registered wp_ajax_frm_dismiss_default_email_message to route to the controller handler.
Controller AJAX handler
classes/controllers/FrmFormsController.php
Added dismiss_default_email_message() to validate nonce/permission, set user meta frm_dismiss_default_email_message, and return JSON success/error.
Show-condition logic
classes/controllers/FrmFormActionsController.php
Added should_show_notice_about_using_the_same_to_from_email($form_action) to compute whether to show the notice (checks settings, action type, and user dismissal meta).
Admin JS
js/admin/settings.js
Added delegated click handler handleClickDismissDefaultEmailMessage and event routing in handleClickEvent, sends frm_dismiss_default_email_message via AJAX and removes the notice on success.
Other JS/CSS edits
js/*.js (multiple), css/admin/frm-settings-components.css, css/frm_testing_mode.css, js/formidable_blocks.js
Various non-functional JS formatting/wrapper tweaks; one exported symbol rename in js/formidable_blocks.js; duplicated large CSS block added in frm-settings-components.css; duplicated/malformed tooltip block in frm_testing_mode.css (potential parse issue).

Sequence Diagram(s)

sequenceDiagram
  participant Browser as Admin UI (browser)
  participant JS as js/admin/settings.js
  participant AJAX as admin-ajax.php
  participant Controller as FrmFormsController
  participant DB as wp_usermeta

  Browser->>JS: Click "Got it" (dismiss)
  JS->>JS: build FormData (action=frm_dismiss_default_email_message + nonce)
  JS->>AJAX: POST ajax request
  AJAX->>Controller: route to dismiss_default_email_message()
  Controller->>Controller: verify permission/nonce
  alt permission OK
    Controller->>DB: update_user_meta(current_user, frm_dismiss_default_email_message, 1)
    Controller-->>AJAX: JSON success
    AJAX-->>JS: JSON success
    JS->>Browser: remove .frm_default_email_message from DOM
  else permission failed
    Controller-->>AJAX: JSON error (403)
    AJAX-->>JS: JSON error
    JS->>Browser: log/display error
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Files/areas needing extra attention:
    • css/frm_testing_mode.css — duplicated/malformed tooltip/comment may cause CSS parse errors.
    • css/admin/frm-settings-components.css — duplicated large block likely unintentional; check redundancy.
    • classes/controllers/FrmFormsController::dismiss_default_email_message — nonce/permission handling and JSON response shape.
    • js/admin/settings.js — delegated selector correctness and correct DOM node removal.
    • classes/controllers/FrmFormActionsController::should_show_notice_about_using_the_same_to_from_email — correctness of settings comparison and dismissal logic.

Possibly related PRs

Suggested labels

action: needs qa

Suggested reviewers

  • Crabcyborg
  • truongwp
  • lauramekaj1

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 1.83% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a banner about updating the default email address for email actions in the form actions tab.
Description check ✅ Passed The description is directly related to the changeset, providing context via issue/design links, a screenshot, and clear test procedures for verifying the banner implementation and functionality.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
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: 0

🧹 Nitpick comments (3)
classes/views/frm-form-actions/_action_inside.php (2)

14-14: Remove empty style attribute.

The <p> tag contains an empty style attribute that should be removed.

-	<p class="frm10" style="">
+	<p class="frm10">

13-22: Improve semantic HTML structure and error handling.

The notice should use more semantic HTML elements and include error handling for translation functions.

-<div class="frm_grid_container frm_no_p_margin frm_default_email_notice">
-	<p class="frm10">
-		<b><?php esc_html_e( 'Heads up!', 'formidable' ); ?></b>
-		<?php esc_html_e( 'Using the same \'To\' and \'From\' email address can sometimes cause delivery issues. We recommend updating your default email addresses to maximize deliverability.', 'formidable' ); ?>
-	</p>
-	<p class="frm2">
+<div class="frm_grid_container frm_no_p_margin frm_default_email_notice" role="alert">
+	<div class="frm10">
+		<h4 class="frm_warning_heading">
+			<?php 
+			$heading = esc_html__( 'Heads up!', 'formidable' );
+			if ( false === $heading ) {
+				$heading = 'Heads up!'; // Fallback if translation fails
+			}
+			echo $heading;
+			?>
+		</h4>
+		<?php
+		$message = esc_html__( 'Using the same \'To\' and \'From\' email address can sometimes cause delivery issues. We recommend updating your default email addresses to maximize deliverability.', 'formidable' );
+		if ( false === $message ) {
+			$message = 'Please update your email settings to ensure proper delivery.'; // Fallback if translation fails
+		}
+		echo $message;
+		?>
+	</div>
+	<div class="frm2">
css/frm_admin.css (1)

5447-5451: Consider adding a hover/focus state for better interactivity.

If this notice contains any interactive elements like buttons or links, consider adding hover/focus states to provide visual feedback.

.frm_email_settings .frm_default_email_notice {
    background-color: var(--primary-25);
    padding:var(--gap-sm) var(--gap-md);
    border-radius:var(--small-radius);
+   transition: background-color 0.2s ease;
}

+.frm_email_settings .frm_default_email_notice:hover {
+   background-color: var(--primary-50);
+}

+.frm_email_settings .frm_default_email_notice:focus-within {
+   outline: 2px solid var(--primary-500);
+   outline-offset: 2px;
+}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cf5222c and 5a4b1a8.

📒 Files selected for processing (2)
  • classes/views/frm-form-actions/_action_inside.php (1 hunks)
  • css/frm_admin.css (1 hunks)
🔇 Additional comments (4)
classes/views/frm-form-actions/_action_inside.php (2)

10-24: LGTM! Well-placed notice block.

The placement of the email notice block at the beginning of the form action settings is appropriate and follows a logical flow.


19-20: ⚠️ Potential issue

Add click handlers and improve accessibility for buttons.

The buttons have href="#" but no JavaScript handlers to process the clicks. Additionally, they need ARIA labels for better accessibility.

-		<a href="#" class="button frm-button-secondary"><?php esc_html_e( 'Got it', 'formidable' ); ?></a>
-		<a href="#" class="button frm-button-primary"><?php esc_html_e( 'Setup emails', 'formidable' ); ?></a>
+		<a href="#" 
+			class="button frm-button-secondary" 
+			onclick="frmDismissEmailNotice(this); return false;" 
+			aria-label="<?php esc_attr_e( 'Dismiss email setup notice', 'formidable' ); ?>">
+			<?php esc_html_e( 'Got it', 'formidable' ); ?>
+		</a>
+		<a href="#" 
+			class="button frm-button-primary" 
+			onclick="frmShowEmailSetup(this); return false;" 
+			aria-label="<?php esc_attr_e( 'Open email setup configuration', 'formidable' ); ?>">
+			<?php esc_html_e( 'Setup emails', 'formidable' ); ?>
+		</a>

Please ensure the JavaScript functions frmDismissEmailNotice and frmShowEmailSetup are defined in your JS files:

css/frm_admin.css (2)

5447-5451: LGTM! The styling for the default email notice is well-structured.

The new CSS rule for .frm_email_settings .frm_default_email_notice uses appropriate variables for consistent styling and follows best practices:

  • Uses the primary color variable for background
  • Applies consistent padding using gap variables
  • Uses border-radius variable for rounded corners

5447-5451: Verify the background color contrast meets accessibility standards.

The background color uses var(--primary-25) which appears to be a light blue. Let's verify that this provides sufficient contrast with the text color for accessibility.

Copy link
Copy Markdown
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: 0

🧹 Nitpick comments (1)
classes/controllers/FrmFormsController.php (1)

2528-2537: LGTM! The implementation looks secure and follows WordPress best practices.

The function properly verifies the AJAX nonce before updating user meta. However, the @since version tag is not defined yet.

Update the @since x.x version number to the actual version this feature will be released in.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22e4d5f and d5a82af.

📒 Files selected for processing (2)
  • classes/controllers/FrmFormsController.php (1 hunks)
  • classes/controllers/FrmHooksController.php (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • classes/controllers/FrmHooksController.php
🔇 Additional comments (1)
classes/controllers/FrmFormsController.php (1)

2549-2576: LGTM! The validation logic is thorough and handles different action types appropriately.

The function properly validates:

  • Redirect URLs through the frm_redirect_url filter
  • Page existence and status for page actions

@Crabcyborg Crabcyborg requested a review from truongwp February 14, 2025 18:04
@Crabcyborg Crabcyborg added this to the 6.19 milestone Feb 14, 2025
Comment thread classes/controllers/FrmFormsController.php Outdated
Comment thread classes/views/frm-form-actions/_action_inside.php Outdated
Comment thread classes/views/frm-form-actions/_action_inside.php Outdated
@AbdiTolesa AbdiTolesa requested a review from truongwp February 18, 2025 07:43
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 18, 2025

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 26.85%. Comparing base (047c6ef) to head (aebe6d4).
Report is 422 commits behind head on master.

Files with missing lines Patch % Lines
classes/controllers/FrmFormsController.php 25.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2239      +/-   ##
============================================
+ Coverage     26.82%   26.85%   +0.02%     
- Complexity     8320     8361      +41     
============================================
  Files           129      129              
  Lines         27488    27626     +138     
============================================
+ Hits           7375     7418      +43     
- Misses        20113    20208      +95     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@truongwp
Copy link
Copy Markdown
Contributor

@AbdiTolesa The buttons don't display well in my laptop. Can you fix it?

Screenshot 2025-02-20 at 22 43 54

@AbdiTolesa AbdiTolesa requested review from truongwp and removed request for truongwp February 24, 2025 09:08
@truongwp
Copy link
Copy Markdown
Contributor

@AbdiTolesa My last styling issue hasn't been fixed. You can check with the screen width less than 1700px.

@AbdiTolesa
Copy link
Copy Markdown
Contributor Author

@AbdiTolesa My last styling issue hasn't been fixed. You can check with the screen width less than 1700px.

@truongwp I think my new commit fixes that for you.

@truongwp
Copy link
Copy Markdown
Contributor

@AbdiTolesa Now this is what I see on iPad pro:
Screenshot 2025-02-26 at 22 18 32

@AbdiTolesa
Copy link
Copy Markdown
Contributor Author

AbdiTolesa commented Feb 27, 2025

@AbdiTolesa Now this is what I see on iPad pro:

@truongwp I originally wanted it to stack vertically if it must be responsive and I think you didn't like that on your laptop size. Should we stop forcing it to be side by side and make it stack vertically based on the screen size? So if there is no enough room to show it side by side (like in your previous comment) even if it is desktop size. The last resort would be defining a new media query in frm_admin.css and writing a style for responsive design which I believe isn't worth it. Not everything looks perfect on smaller devices in our admin pages actually.

@truongwp
Copy link
Copy Markdown
Contributor

@AbdiTolesa In my opinion, displaying them vertically doesn't look good. Can you make them horizontal in the bottom of the message? I also want to hear from @tuguirazvan.

@AbdiTolesa AbdiTolesa requested a review from Crabcyborg March 7, 2025 07:11
Comment thread js/admin/settings.js Outdated
Comment thread classes/views/frm-form-actions/_action_inside.php Outdated
@Crabcyborg Crabcyborg modified the milestones: 6.19, 6.20 Mar 7, 2025
Copy link
Copy Markdown
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: 0

🧹 Nitpick comments (3)
classes/controllers/FrmFormActionsController.php (1)

432-445: Update the version placeholder and consider using get_current_user_id()

The @since x.x should be updated with the actual version number. Also, consider using get_current_user_id() instead of wp_get_current_user()->ID for better performance and consistency with WordPress coding standards.

-  * @since x.x
+  * @since 6.17 /* or whatever the actual version is */

Also, in line 444:

- return $form_action->post_excerpt === 'email' && ! get_user_meta( wp_get_current_user()->ID, 'frm_dismiss_default_email_message', true );
+ return $form_action->post_excerpt === 'email' && ! get_user_meta( get_current_user_id(), 'frm_dismiss_default_email_message', true );
classes/controllers/FrmFormsController.php (1)

2527-2542: Update the version placeholder and add permission check

Similar to the previous file, the @since x.x should be updated with the actual version number.

Additionally, while there is a nonce check for CSRF protection, it would be more secure to explicitly check if the user has the permission to edit forms using current_user_can('frm_edit_forms').

-  * @since x.x
+  * @since 6.17 /* or whatever the actual version is */

   public static function dismiss_default_email_message() {
       $permission_error = FrmAppHelper::permission_nonce_error( 'frm_edit_forms', 'nonce', 'frm_ajax' );

       if ( $permission_error !== false ) {
           wp_send_json_error( $permission_error, 403 );
       }
+      if ( ! current_user_can( 'frm_edit_forms' ) ) {
+          wp_send_json_error( __( 'You do not have permission to perform this action.', 'formidable' ), 403 );
+      }
       update_user_meta( get_current_user_id(), 'frm_dismiss_default_email_message', 1 );
       wp_send_json_success();
   }
js/admin/settings.js (1)

25-39: Add missing semicolon in the .then() callback

The code for handling the dismiss default email message click event is well structured, but there's a missing semicolon after the callback function in the .then() method.

   doJsonPost( 'dismiss_default_email_message', formData ).then( () => {
-      e.target.closest( '.frm_default_email_message' ).remove();
+      e.target.closest( '.frm_default_email_message' ).remove();
   }

Also, consider enhancing the error handling to provide user feedback rather than just logging to the console.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aebe6d4 and ffce5eb.

📒 Files selected for processing (4)
  • classes/controllers/FrmFormActionsController.php (1 hunks)
  • classes/controllers/FrmFormsController.php (1 hunks)
  • classes/views/frm-form-actions/_action_inside.php (1 hunks)
  • js/admin/settings.js (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • classes/views/frm-form-actions/_action_inside.php
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: PHP 8 tests in WP trunk
  • GitHub Check: PHP 7.4 tests in WP trunk
  • GitHub Check: Run PHP Syntax inspection (8.3)
  • GitHub Check: Cypress
🔇 Additional comments (2)
js/admin/settings.js (2)

3-4: Good code structure for importing Ajax functionality

The explicit import of doJsonPost from frmDom.ajax is a good practice for clarity and maintainability.


8-8: Well-integrated event listener

The addition of the click event listener follows the existing pattern in the file, making it consistent with the rest of the code.

@AbdiTolesa AbdiTolesa requested a review from Crabcyborg March 10, 2025 09:05
@Crabcyborg Crabcyborg modified the milestones: 6.20, 6.21 Apr 2, 2025
@Crabcyborg Crabcyborg removed the request for review from lauramekaj1 May 2, 2025 14:58
@Crabcyborg Crabcyborg modified the milestones: 6.21, 6.22 May 9, 2025
@Crabcyborg Crabcyborg modified the milestones: 6.22, 6.23 Jun 9, 2025
@Crabcyborg Crabcyborg removed this from the 6.22.1 milestone Jul 7, 2025
Comment thread js/admin/settings.js Outdated
@AbdiTolesa AbdiTolesa requested a review from Crabcyborg July 27, 2025 20:25
Copy link
Copy Markdown
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: 2

🧹 Nitpick comments (2)
css/admin/frm-settings-components.css (1)

1-1: Avoid duplicating the formidable-styles block

This entire .formidable_page_formidable-styles rule set appears to be a copy of an existing block, which bloats the CSS and risks the two copies drifting apart later. If this came from the build pipeline, it’s worth fixing at the source or removing the duplicate from this file.

classes/views/frm-form-actions/_action_inside.php (1)

11-24: Notice markup correctly wires to controller/JS, minor nits only

The conditional around FrmFormActionsController::should_show_notice_about_using_the_same_to_from_email() and the banner markup (copy, links, classes) all look correct for the intended behavior. The inline styles on the <b> and button container are small deviations but consistent with this template’s existing use of inline styles.

If you revisit this later, you might consider:

  • Moving the color/whitespace rules into the .frm_default_email_message CSS.
  • Using a <button> for “Got it” to better reflect its behavior (pure UI) instead of href="#".
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0d9d969 and 613957b.

📒 Files selected for processing (15)
  • classes/controllers/FrmFormActionsController.php (1 hunks)
  • classes/controllers/FrmFormsController.php (1 hunks)
  • classes/controllers/FrmHooksController.php (1 hunks)
  • classes/views/frm-form-actions/_action_inside.php (1 hunks)
  • css/admin/frm-settings-components.css (1 hunks)
  • css/frm_testing_mode.css (1 hunks)
  • js/addons-page.js (1 hunks)
  • js/admin/settings.js (2 hunks)
  • js/formidable-settings-components.js (1 hunks)
  • js/formidable_blocks.js (1 hunks)
  • js/formidable_dashboard.js (1 hunks)
  • js/formidable_overlay.js (1 hunks)
  • js/formidable_styles.js (1 hunks)
  • js/frm_testing_mode.js (1 hunks)
  • js/onboarding-wizard.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • classes/controllers/FrmFormsController.php
  • classes/controllers/FrmHooksController.php
🧰 Additional context used
🧬 Code graph analysis (6)
js/frm_testing_mode.js (1)
js/src/frm_testing_mode.js (1)
  • frmDom (34-34)
classes/views/frm-form-actions/_action_inside.php (1)
classes/controllers/FrmFormActionsController.php (2)
  • FrmFormActionsController (6-736)
  • should_show_notice_about_using_the_same_to_from_email (474-480)
js/formidable_overlay.js (2)
js/src/admin/admin.js (41)
  • e (8264-8264)
  • t (718-718)
  • t (743-743)
  • t (9045-9045)
  • t (10236-10236)
  • frmDom (241-241)
  • frmDom (242-242)
  • frmDom (243-243)
  • a (3091-3091)
  • i (440-440)
  • i (1798-1798)
  • i (2276-2276)
  • i (3028-3028)
  • i (3043-3043)
  • i (3115-3115)
  • i (3133-3133)
  • i (3147-3150)
  • i (3173-3181)
  • i (3211-3211)
  • i (3220-3220)
  • i (3481-3487)
  • i (3623-3626)
  • i (5470-5470)
  • i (5539-5540)
  • i (5614-5616)
  • c (723-723)
  • c (748-748)
  • c (7302-7302)
  • c (9121-9121)
  • s (276-276)
  • s (8270-8270)
  • s (9021-9021)
  • s (9098-9098)
  • f (9060-9060)
  • v (3387-3387)
  • v (3407-3407)
  • v (6939-6939)
  • v (7306-7306)
  • v (7857-7857)
  • v (7873-7873)
  • v (7889-7889)
js/src/admin/addon-state.js (2)
  • frmDom (3-3)
  • a (200-200)
js/admin/settings.js (2)
js/src/form-templates/events/favoriteButtonListener.js (2)
  • frmDom (143-143)
  • formData (142-142)
square/js/frontend.js (1)
  • formData (136-136)
js/formidable-settings-components.js (1)
js/src/admin/addon-state.js (2)
  • frmDom (3-3)
  • a (200-200)
js/onboarding-wizard.js (1)
js/src/admin/addon-state.js (2)
  • a (200-200)
  • ajaxurl (12-12)
🪛 Biome (2.1.2)
js/frm_testing_mode.js

[error] 2-2: This case is falling through to the next case.

Add a break or return statement to the end of this case to prevent fallthrough.

(lint/suspicious/noFallthroughSwitchClause)


[error] 2-2: Do not use the t variable name as a label

The variable is declared here

Creating a label with the same name as an in-scope variable leads to confusion.

(lint/suspicious/noLabelVar)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)

js/formidable_overlay.js

[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)

js/formidable_blocks.js

[error] 1-1: Unsafe usage of 'return'.

'return' in 'finally' overwrites the control flow statements inside 'try' and 'catch'.

(lint/correctness/noUnsafeFinally)


[error] 1-1: Unsafe usage of 'throw'.

'throw' in 'finally' overwrites the control flow statements inside 'try' and 'catch'.

(lint/correctness/noUnsafeFinally)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)

css/frm_testing_mode.css

[error] 3-3: Unexpected shorthand property background after background-color

(lint/suspicious/noShorthandPropertyOverrides)


[error] 3-3: Duplicate properties can lead to unexpected behavior and may override previous declarations unintentionally.

text-align is already defined here.

Remove or rename the duplicate property to ensure consistent styling.

(lint/suspicious/noDuplicateProperties)


[error] 3-3: Duplicate properties can lead to unexpected behavior and may override previous declarations unintentionally.

min-width is already defined here.

Remove or rename the duplicate property to ensure consistent styling.

(lint/suspicious/noDuplicateProperties)


[error] 3-3: Duplicate properties can lead to unexpected behavior and may override previous declarations unintentionally.

border-radius is already defined here.

Remove or rename the duplicate property to ensure consistent styling.

(lint/suspicious/noDuplicateProperties)

js/formidable-settings-components.js

[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)

js/addons-page.js

[error] 1-1: Unsafe usage of 'throw'.

'throw' in 'finally' overwrites the control flow statements inside 'try' and 'catch'.

(lint/correctness/noUnsafeFinally)


[error] 1-1: Unsafe usage of 'return'.

'return' in 'finally' overwrites the control flow statements inside 'try' and 'catch'.

(lint/correctness/noUnsafeFinally)


[error] 1-1: Unsafe usage of 'throw'.

'throw' in 'finally' overwrites the control flow statements inside 'try' and 'catch'.

(lint/correctness/noUnsafeFinally)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: Do not use the t variable name as a label

The variable is declared here

Creating a label with the same name as an in-scope variable leads to confusion.

(lint/suspicious/noLabelVar)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)

js/formidable_dashboard.js

[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)

js/formidable_styles.js

[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 1-1: Do not use the t variable name as a label

The variable is declared here

Creating a label with the same name as an in-scope variable leads to confusion.

(lint/suspicious/noLabelVar)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)

js/onboarding-wizard.js

[error] 2-2: This case is falling through to the next case.

Add a break or return statement to the end of this case to prevent fallthrough.

(lint/suspicious/noFallthroughSwitchClause)


[error] 2-2: Unsafe usage of 'throw'.

'throw' in 'finally' overwrites the control flow statements inside 'try' and 'catch'.

(lint/correctness/noUnsafeFinally)


[error] 2-2: This case is falling through to the next case.

Add a break or return statement to the end of this case to prevent fallthrough.

(lint/suspicious/noFallthroughSwitchClause)


[error] 2-2: This case is falling through to the next case.

Add a break or return statement to the end of this case to prevent fallthrough.

(lint/suspicious/noFallthroughSwitchClause)


[error] 2-2: This case is falling through to the next case.

Add a break or return statement to the end of this case to prevent fallthrough.

(lint/suspicious/noFallthroughSwitchClause)


[error] 2-2: This case is falling through to the next case.

Add a break or return statement to the end of this case to prevent fallthrough.

(lint/suspicious/noFallthroughSwitchClause)


[error] 2-2: This case is falling through to the next case.

Add a break or return statement to the end of this case to prevent fallthrough.

(lint/suspicious/noFallthroughSwitchClause)


[error] 2-2: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 2-2: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 2-2: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 2-2: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 2-2: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 2-2: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 2-2: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 2-2: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)

🔇 Additional comments (9)
js/formidable_dashboard.js (1)

1-1: Minified build output - LGTM.

This is a minified JavaScript bundle with no functional changes per the AI summary. The static analysis warnings (variable hoisting, function reassignment patterns) are expected artifacts of minification/transpilation and are not actionable at this level—any issues would need to be addressed in the source files before bundling.

js/addons-page.js (1)

1-1: Minified build output - LGTM.

No functional changes detected. The static analysis warnings are expected patterns in minified/transpiled JavaScript and do not indicate actual issues in the source code.

js/formidable_styles.js (1)

1-1: Minified build output - LGTM.

No functional changes detected per the AI summary. Static analysis warnings are expected for minified JavaScript bundles.

js/formidable-settings-components.js (1)

1-1: Minified build output - LGTM.

No functional changes detected. The static analysis warnings are standard patterns produced by JavaScript bundlers/minifiers and do not require action.

js/formidable_overlay.js (1)

1-1: Minified build output - LGTM.

No semantic changes detected. Static analysis warnings are expected artifacts of the minification process.

js/frm_testing_mode.js (1)

1-2: Minified build output - LGTM.

No functional changes detected per the AI summary. The static analysis warnings (including the switch fallthrough) are expected patterns in minified/transpiled JavaScript—the fallthrough is likely from transpiled async/generator functions using regenerator-runtime.

css/frm_testing_mode.css (1)

2-3: Minified Bootstrap tooltip block looks OK despite lints

The /*! … */.tooltip { … } pattern is valid for minified vendor CSS, and the duplicate properties Biome flags are typical of Bootstrap’s fallback layering. I wouldn’t try to “clean” this further unless you plan to replace the vendor block wholesale.

js/formidable_blocks.js (1)

1-1: Export rename within bundle is self‑consistent

The CSS module now exports Ay and all internal references at the bottom of the bundle use Ie.Ay, with no leftover references to the old name. This looks fine for a compiled asset.

js/onboarding-wizard.js (1)

2-2: Compiled onboarding bundle changes appear non‑behavioral

This IIFE/regenerator wrapper diff doesn’t introduce new logic; structure and side effects (wizard navigation, AJAX calls) remain the same, and the lints are against transpiled helper code. Nothing to block here.

return false;
}
return $form_action->post_excerpt === 'email' && ! get_user_meta( wp_get_current_user()->ID, 'frm_dismiss_default_email_message', true );
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Helper logic is sound; update @since and consider using shared settings helper

The new should_show_notice_about_using_the_same_to_from_email() correctly gates the banner on:

  • Defaults still unset/same (default_email empty or equal to from_email),
  • Action type being email,
  • User not having frm_dismiss_default_email_message set.

Two small follow‑ups:

  • Replace @since x.x with the actual release version before ship.
  • For consistency with the rest of the codebase, consider fetching settings via FrmAppHelper::get_settings() instead of instantiating FrmSettings directly.
🤖 Prompt for AI Agents
In classes/controllers/FrmFormActionsController.php around lines 467 to 480,
update the docblock @since from "x.x" to the actual release version being
shipped and refactor the settings retrieval to use the shared helper instead of
instantiating FrmSettings directly: replace new FrmSettings() with
FrmAppHelper::get_settings() (or the project’s equivalent shared settings
accessor) and ensure the rest of the logic uses that $settings object unchanged.

Comment thread js/admin/settings.js
sendTestEmailModal: null
};

const { doJsonPost } = frmDom.ajax;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Duplicate handleClickEvent definitions break the new dismiss behavior

You now have two top‑level function handleClickEvent declarations:

  • Lines 34–49: handles .frm_dismiss_default_email_message.
  • Lines 55–69: existing handler for email styles / test email.

Because function declarations are hoisted, the second definition (lines 55–69) overwrites the first. The document click listener wired in addEventListeners() will call only the second version, so clicks on the “Got it” link never trigger the dismiss AJAX call.

This effectively disables the new banner dismissal.

I’d suggest merging the logic into a single handleClickEvent:

-	function handleClickEvent( e ) {
-		if ( ! e.target.classList.contains( 'frm_dismiss_default_email_message' ) ) {
-			return;
-		}
-		e.preventDefault();
-		const formData = new FormData();
-		formData.append( 'action', 'frm_dismiss_default_email_message' );
-		formData.append( 'nonce', frmGlobal.nonce );
-		doJsonPost( 'dismiss_default_email_message', formData )
-		.then( () => {
-			e.target.closest( '.frm_default_email_message' ).remove();
-		})
-		.catch( error => {
-			console.error( error );
-		});
-	}
-
-	function handleClickEvent( e ) {
+	function handleClickEvent( e ) {
+		// Dismiss default email notice.
+		if ( e.target.classList.contains( 'frm_dismiss_default_email_message' ) ) {
+			e.preventDefault();
+
+			const formData = new FormData();
+			// If `doJsonPost` already appends action/nonce, you can omit these two lines.
+			formData.append( 'action', 'frm_dismiss_default_email_message' );
+			formData.append( 'nonce', frmGlobal.nonce );
+
+			doJsonPost( 'dismiss_default_email_message', formData )
+				.then( () => {
+					const notice = e.target.closest( '.frm_default_email_message' );
+					if ( notice ) {
+						notice.remove();
+					}
+				} )
+				.catch( error => {
+					// Keep failure non‑fatal for the settings page.
+					console.error( error );
+				} );
+			return;
+		}
+
 		if ( 'BUTTON' === e.target.nodeName && 'choose' === e.target.dataset.action && e.target.closest( '.frm-email-style' ) ) {
 			handleClickChooseEmailStyle( e );
 			return;
 		}
@@
 		if ( 'frm-send-test-email' === e.target.id ) {
 			showSendTestEmailModal( e );
 			return;
 		}
@@
 		if ( 'frm-send-test-email-btn' === e.target.id ) {
 			handleClickSendTestEmailBtn( e );
 		}
 	}

Optionally, you could also switch the send_test_email call at the bottom to use the same doJsonPost alias for consistency.

Also applies to: 34-49, 55-69

🤖 Prompt for AI Agents
In js/admin/settings.js (conflicting function declarations at lines 34-49 and
55-69), there are two top-level function handleClickEvent definitions where the
second overwrites the first, preventing the new banner dismiss AJAX from firing;
fix this by merging both handlers into a single handleClickEvent function that
tests the clicked element for both cases (the .frm_dismiss_default_email_message
dismiss link and the existing email-style/test-email targets) and executes the
appropriate doJsonPost call for each branch, remove the duplicate declaration so
only one function exists, ensure addEventListeners() binds that single handler,
and optionally replace the send_test_email call at the bottom to use the
doJsonPost alias for consistency.

Copy link
Copy Markdown
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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b8e852 and d297f0a.

📒 Files selected for processing (1)
  • js/admin/settings.js (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
js/admin/settings.js (1)
js/src/form-templates/events/favoriteButtonListener.js (2)
  • frmDom (143-143)
  • formData (142-142)
🪛 GitHub Check: Run ESLint
js/admin/settings.js

[failure] 48-48:
There must be a space before this paren


[failure] 48-48:
Expected indentation of 3 tabs but found 2


[failure] 47-47:
Expected indentation of 4 tabs but found 3


[failure] 46-46:
Expected indentation of 3 tabs but found 2


[failure] 45-45:
There must be a space before this paren


[failure] 45-45:
Expected indentation of 3 tabs but found 2


[failure] 44-44:
Expected indentation of 4 tabs but found 3


[failure] 43-43:
Expected indentation of 3 tabs but found 2


[failure] 71-71:
Unnecessary return statement


[failure] 71-71:
Remove this redundant jump

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Cypress
  • GitHub Check: PHP 8 tests in WP trunk
  • GitHub Check: PHP 7.4 tests in WP trunk
🔇 Additional comments (1)
js/admin/settings.js (1)

8-9: LGTM: Import follows established pattern.

The destructured import of doJsonPost is consistent with the pattern used elsewhere in the codebase (e.g., favoriteButtonListener.js).

Comment thread js/admin/settings.js
Comment on lines +34 to +49
function handleClickDismissDefaultEmailMessage( e ) {
if ( ! e.target.classList.contains( 'frm_dismiss_default_email_message' ) ) {
return;
}
e.preventDefault();
const formData = new FormData();
formData.append( 'action', 'frm_dismiss_default_email_message' );
formData.append( 'nonce', frmGlobal.nonce );
doJsonPost( 'dismiss_default_email_message', formData )
.then( () => {
e.target.closest( '.frm_default_email_message' ).remove();
})
.catch( error => {
console.error( error );
});
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find where handleClickDismissDefaultEmailMessage is called from
rg -n 'handleClickDismissDefaultEmailMessage' --type=js -B 3 -A 3

Repository: Strategy11/formidable-forms

Length of output: 751


🏁 Script executed:

#!/bin/bash
# Find doJsonPost implementation and usage patterns
rg -n 'doJsonPost\s*[:=]' --type=js -A 15

Repository: Strategy11/formidable-forms

Length of output: 927


🏁 Script executed:

#!/bin/bash
# Also check all doJsonPost calls to understand the pattern
rg -n 'doJsonPost\s*\(' --type=js -B 2 -A 2

Repository: Strategy11/formidable-forms

Length of output: 6584


🏁 Script executed:

#!/bin/bash
# Check how FormData with 'action' field is typically handled in WordPress
# Let's see if there are other patterns where action is appended to FormData
rg -n "formData\.append\(\s*['\"]action['\"]" --type=js -B 5 -A 5

Repository: Strategy11/formidable-forms

Length of output: 2570


🏁 Script executed:

#!/bin/bash
# Read more context from settings.js around the test email handler for comparison
sed -n '100,130p' js/admin/settings.js | cat -n

Repository: Strategy11/formidable-forms

Length of output: 1256


🏁 Script executed:

#!/bin/bash
# Look for ESLint config to understand the violations
fd -e '.eslintrc*' -e 'eslint.config*' --type=f

Repository: Strategy11/formidable-forms

Length of output: 53


🏁 Script executed:

#!/bin/bash
# Check if there's a package.json with ESLint config
cat package.json 2>/dev/null | grep -A 20 '"eslint'

Repository: Strategy11/formidable-forms

Length of output: 53


Based on my verification, I can now provide the rewritten review comment with confirmed findings.


Remove redundant class check, redundant FormData fields, and add defensive null check.

This function duplicates checks and appends unnecessary FormData fields:

  1. Redundant class check (lines 35-37): The caller at line 69 already verifies the target has class frm_dismiss_default_email_message before invoking this function.

  2. Redundant FormData fields (lines 40-41):

    • Line 41 (nonce): doJsonPost internally appends nonce at line 125 of js/admin/dom.js. Appending it here creates a duplicate.
    • Line 40 (action): The action parameter passed to doJsonPost is used for URL construction (?action=frm_dismiss_default_email_message), not FormData. Other functions using doJsonPost (e.g., test email handler at line 115) don't append the action to FormData.
  3. Missing defensive null check (line 44): .closest() can return null if the DOM structure changes. Add a null check before calling .remove().

  4. Silent error handling (lines 47-48): Unlike the test email handler (lines 117-119) which provides user-facing feedback, errors here are only logged to console. Consider consistent error messaging.

Apply this diff:

 function handleClickDismissDefaultEmailMessage( e ) {
-	if ( ! e.target.classList.contains( 'frm_dismiss_default_email_message' ) ) {
-		return;
-	}
 	e.preventDefault();
+
 	const formData = new FormData();
-	formData.append( 'action', 'frm_dismiss_default_email_message' );
-	formData.append( 'nonce', frmGlobal.nonce );
+
 	doJsonPost( 'dismiss_default_email_message', formData )
-	.then( () => {
-		e.target.closest( '.frm_default_email_message' ).remove();
-	})
-	.catch( error => {
-		console.error( error );
-	});
+		.then( () => {
+			const notice = e.target.closest( '.frm_default_email_message' );
+			if ( notice ) {
+				notice.remove();
+			}
+		} )
+		.catch( error => {
+			console.error( error );
+		} );
 }
📝 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
function handleClickDismissDefaultEmailMessage( e ) {
if ( ! e.target.classList.contains( 'frm_dismiss_default_email_message' ) ) {
return;
}
e.preventDefault();
const formData = new FormData();
formData.append( 'action', 'frm_dismiss_default_email_message' );
formData.append( 'nonce', frmGlobal.nonce );
doJsonPost( 'dismiss_default_email_message', formData )
.then( () => {
e.target.closest( '.frm_default_email_message' ).remove();
})
.catch( error => {
console.error( error );
});
}
function handleClickDismissDefaultEmailMessage( e ) {
e.preventDefault();
const formData = new FormData();
doJsonPost( 'dismiss_default_email_message', formData )
.then( () => {
const notice = e.target.closest( '.frm_default_email_message' );
if ( notice ) {
notice.remove();
}
} )
.catch( error => {
console.error( error );
} );
}
🧰 Tools
🪛 GitHub Check: Run ESLint

[failure] 48-48:
There must be a space before this paren


[failure] 48-48:
Expected indentation of 3 tabs but found 2


[failure] 47-47:
Expected indentation of 4 tabs but found 3


[failure] 46-46:
Expected indentation of 3 tabs but found 2


[failure] 45-45:
There must be a space before this paren


[failure] 45-45:
Expected indentation of 3 tabs but found 2


[failure] 44-44:
Expected indentation of 4 tabs but found 3


[failure] 43-43:
Expected indentation of 3 tabs but found 2

🤖 Prompt for AI Agents
In js/admin/settings.js around lines 34 to 49, remove the redundant class check
at the top (the caller already ensures the target has
'frm_dismiss_default_email_message'), stop appending both 'action' and 'nonce'
to the FormData (doJsonPost builds the URL with the action and appends nonce
internally), add a defensive null check before calling .remove() on
e.target.closest('.frm_default_email_message'), and replace the silent
console.error with the same user-facing error handling used by the test email
handler (e.g., surface an error message to the user) so failures are visible.

Comment thread js/admin/settings.js
Comment on lines +69 to +72
if ( e.target.classList.contains( 'frm_dismiss_default_email_message' ) ) {
handleClickDismissDefaultEmailMessage( e );
return;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove unnecessary return statement.

ESLint correctly flags line 71 as an unnecessary return statement since this is the last condition in the function. Additionally, this check duplicates the class verification that currently exists inside handleClickDismissDefaultEmailMessage (lines 35-37).

Apply this diff:

 	if ( e.target.classList.contains( 'frm_dismiss_default_email_message' ) ) {
 		handleClickDismissDefaultEmailMessage( e );
-		return;
 	}
 }

As per static analysis tools, the redundant return should be removed. Based on the earlier comment about removing the redundant class check from handleClickDismissDefaultEmailMessage, this routing logic becomes the single point where the class is verified.

📝 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
if ( e.target.classList.contains( 'frm_dismiss_default_email_message' ) ) {
handleClickDismissDefaultEmailMessage( e );
return;
}
if ( e.target.classList.contains( 'frm_dismiss_default_email_message' ) ) {
handleClickDismissDefaultEmailMessage( e );
}
🧰 Tools
🪛 GitHub Check: Run ESLint

[failure] 71-71:
Unnecessary return statement


[failure] 71-71:
Remove this redundant jump

🤖 Prompt for AI Agents
In js/admin/settings.js around lines 69 to 72, remove the unnecessary `return;`
after calling handleClickDismissDefaultEmailMessage since this is the last
conditional in the function, and also remove the duplicate class verification
inside handleClickDismissDefaultEmailMessage (lines 35-37) so the routing logic
is the single place that checks `frm_dismiss_default_email_message`; keep only
the routing check and a direct call to handleClickDismissDefaultEmailMessage.

@AbdiTolesa AbdiTolesa requested review from Crabcyborg and removed request for Crabcyborg November 27, 2025 14:31
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.

4 participants