Add banner about updating default email address to email action#2239
Add banner about updating default email address to email action#2239AbdiTolesa wants to merge 24 commits into
Conversation
|
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 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. 📒 Files selected for processing (1)
WalkthroughAdds 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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 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
📒 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 issueAdd 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
frmDismissEmailNoticeandfrmShowEmailSetupare 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_noticeuses 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.
There was a problem hiding this comment.
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
@sinceversion tag is not defined yet.Update the
@since x.xversion number to the actual version this feature will be released in.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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_urlfilter- Page existence and status for page actions
Codecov ReportAttention: Patch coverage is
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. 🚀 New features to boost your workflow:
|
|
@AbdiTolesa The buttons don't display well in my laptop. Can you fix it?
|
|
@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. |
|
@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 |
|
@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. |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
classes/controllers/FrmFormActionsController.php (1)
432-445: Update the version placeholder and consider usingget_current_user_id()The
@since x.xshould be updated with the actual version number. Also, consider usingget_current_user_id()instead ofwp_get_current_user()->IDfor 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 checkSimilar to the previous file, the
@since x.xshould 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() callbackThe 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
📒 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 functionalityThe explicit import of
doJsonPostfromfrmDom.ajaxis a good practice for clarity and maintainability.
8-8: Well-integrated event listenerThe addition of the click event listener follows the existing pattern in the file, making it consistent with the rest of the code.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
css/admin/frm-settings-components.css (1)
1-1: Avoid duplicating the formidable-styles blockThis entire
.formidable_page_formidable-stylesrule 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 onlyThe 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_messageCSS.- Using a
<button>for “Got it” to better reflect its behavior (pure UI) instead ofhref="#".
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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 lintsThe
/*! … */.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‑consistentThe CSS module now exports
Ayand all internal references at the bottom of the bundle useIe.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‑behavioralThis 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 ); | ||
| } |
There was a problem hiding this comment.
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_emailempty or equal tofrom_email), - Action type being
email, - User not having
frm_dismiss_default_email_messageset.
Two small follow‑ups:
- Replace
@since x.xwith the actual release version before ship. - For consistency with the rest of the codebase, consider fetching settings via
FrmAppHelper::get_settings()instead of instantiatingFrmSettingsdirectly.
🤖 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.
| sendTestEmailModal: null | ||
| }; | ||
|
|
||
| const { doJsonPost } = frmDom.ajax; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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
doJsonPostis consistent with the pattern used elsewhere in the codebase (e.g.,favoriteButtonListener.js).
| 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 ); | ||
| }); | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find where handleClickDismissDefaultEmailMessage is called from
rg -n 'handleClickDismissDefaultEmailMessage' --type=js -B 3 -A 3Repository: Strategy11/formidable-forms
Length of output: 751
🏁 Script executed:
#!/bin/bash
# Find doJsonPost implementation and usage patterns
rg -n 'doJsonPost\s*[:=]' --type=js -A 15Repository: 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 2Repository: 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 5Repository: 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 -nRepository: 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=fRepository: 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:
-
Redundant class check (lines 35-37): The caller at line 69 already verifies the target has class
frm_dismiss_default_email_messagebefore invoking this function. -
Redundant FormData fields (lines 40-41):
- Line 41 (nonce):
doJsonPostinternally appendsnonceat line 125 ofjs/admin/dom.js. Appending it here creates a duplicate. - Line 40 (action): The
actionparameter passed todoJsonPostis used for URL construction (?action=frm_dismiss_default_email_message), not FormData. Other functions usingdoJsonPost(e.g., test email handler at line 115) don't append the action to FormData.
- Line 41 (nonce):
-
Missing defensive null check (line 44):
.closest()can returnnullif the DOM structure changes. Add a null check before calling.remove(). -
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.
| 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.
| if ( e.target.classList.contains( 'frm_dismiss_default_email_message' ) ) { | ||
| handleClickDismissDefaultEmailMessage( e ); | ||
| return; | ||
| } |
There was a problem hiding this comment.
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.
| 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.


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
Test procedure
Got itdismisses the banner and it would never be displayed for that user again, even after form reload.Setup emailsredirects user to the email setup page.