Enforce empty line between end curl and var assignment#2624
Conversation
|
Warning Rate limit exceeded@Crabcyborg has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 5 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 ignored due to path filters (1)
📒 Files selected for processing (4)
WalkthroughThis PR contains widespread formatting improvements with blank line insertions across 60+ files alongside targeted functional enhancements. Key changes include style export filtering in XML generation, email fallback type normalization, array meta value cleanup, shortcode processing in validation, and UI data attribute population. A new PHP_CodeSniffer sniff enforces blank lines after closing braces. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Areas requiring extra attention:
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ 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: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
classes/helpers/FrmAppHelper.php (1)
3138-3145: Regex inget_formatted_timeuses an invalid quantifier
preg_match( '/^\d{1-2}\/\d{1-2}\/\d{4}$/', $date )is not a valid PCRE quantifier ({m,n}expects digits with a comma), so this pattern will never work as intended and may emit warnings. It looks like you meant “1 or 2 digits”.Consider updating to:
- if ( preg_match( '/^\d{1-2}\/\d{1-2}\/\d{4}$/', $date ) && self::pro_is_installed() ) { + if ( preg_match( '/^\d{1,2}\/\d{1,2}\/\d{4}$/', $date ) && self::pro_is_installed() ) {This is an existing issue, but it might be worth fixing while you’re in this file.
🧹 Nitpick comments (5)
classes/views/frm-forms/landing-page-preview-option.php (1)
6-16: Robust data-attribute building for upgrade link; consider light type guard.Generating
data-*attributes viaFrmAppHelper::get_landing_page_upgrade_data_params()andarray_to_html_params()is a clean way to expose metadata to JS, and centralizes escaping. To be extra defensive against unexpected filter output, you could coerce$datato an array beforearray_keys, e.g.:$data = (array) FrmAppHelper::get_landing_page_upgrade_data_params( 'landing-preview' );This avoids warnings if a filter ever returns
nullor a scalar.classes/views/frm-forms/mb_insert_fields.php (1)
6-12: Good pattern for exposing contextual shortcode metadata to JS.Using
FrmAppHelper::maybe_json_encode( FrmShortcodeHelper::get_contextual_codes() )andarray_to_html_params()is a clean, centralized way to push contextual data onto the container element. Ifget_contextual_codes()can ever return an empty array, you could optionally skip the attribute when the encoded string is empty, but this is not required.classes/models/FrmEmail.php (1)
559-585: Correct normalization formail()fallback; consider preserving original recipient for hooks.Normalizing
$headerto a CRLF-joined string and$recipientto a comma-separated string before callingmail()fixes incorrect parameter types in the fallback path and aligns with PHP’smail()signature. One small consideration:do_action( 'frm_notification', $recipient, ... )will now receive the normalized string even whensend_single()was originally passed an array. If any consumer relies on the pre-normalized type in this rare failure path, you could preserve it via an$original_recipientvariable:$original_recipient = $recipient; // ... if ( ! $sent ) { if ( is_array( $header ) ) { $header = implode( "\r\n", $header ); } $recipient = implode( ',', (array) $recipient ); $sent = mail( $recipient, $subject, $this->message, $header ); } do_action( 'frm_notification', $original_recipient, $subject, $this->message );Not mandatory, but slightly safer for backwards compatibility.
classes/controllers/FrmXMLController.php (1)
519-543: Styles export now constrained to styles actually used by selected forms.The
stylesbranch ingenerate_xml()now:
- Collects each selected form via
FrmForm::getOne( $form_id ).- Resolves the effective style ID per form, mapping
custom_style === 1to the default style ID.- Builds
$style_idsand, when non-empty, constrains thefrm_stylesquery withwhere['ID'] = $style_ids.This is a solid improvement over exporting all style posts. Two minor hardening suggestions:
- Guard against missing/invalid forms to avoid notices if an ID slips through:
foreach ( (array) $form_ids as $form_id ) { $form_data = FrmForm::getOne( $form_id ); if ( ! $form_data || empty( $form_data->options ) ) { continue; } // existing custom_style logic... }
- Optionally
array_unique( $style_ids )before using it in$whereto avoid redundant IDs.Both are small robustness tweaks; existing logic is otherwise sound.
classes/models/FrmEntryValidate.php (1)
841-878: Guest author name concatenation works, with a couple of robustness nitsThe new branch for
comment_authorcorrectly tries to build a full name from separate text fields labelled “Name” and “Last”, and using a cachedget_name_text_fields()call keeps it efficient.Two small refinements you might consider (not blockers):
- Tie the concatenation more tightly to the actual field being examined, e.g. only append the “Last” value when the current
$field_idmatches the “Name” field’sid, to avoid ever using an unrelated$valueas the first name purely because a Name/Last pair exists on the form.- Short‑circuit when
$form_idis falsy before callingget_name_text_fields()to avoid an unnecessary DB query in edge cases whereform_idisn’t present in the POST.Functionally this is an improvement over the previous behavior; these would just make the heuristic a bit more precise.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
phpcs-sniffs/Formidable/ruleset.xmlis excluded by!**/*.xmlphpcs.xmlis excluded by!**/*.xml
📒 Files selected for processing (64)
classes/controllers/FrmAddonsController.php(5 hunks)classes/controllers/FrmAppController.php(2 hunks)classes/controllers/FrmEmailStylesController.php(1 hunks)classes/controllers/FrmEntriesController.php(1 hunks)classes/controllers/FrmFormActionsController.php(1 hunks)classes/controllers/FrmFormsController.php(3 hunks)classes/controllers/FrmXMLController.php(5 hunks)classes/helpers/FrmApiHelper.php(2 hunks)classes/helpers/FrmAppHelper.php(6 hunks)classes/helpers/FrmCSVExportHelper.php(3 hunks)classes/helpers/FrmEntriesHelper.php(1 hunks)classes/helpers/FrmEntriesListHelper.php(2 hunks)classes/helpers/FrmFieldsHelper.php(4 hunks)classes/helpers/FrmFormsHelper.php(4 hunks)classes/helpers/FrmFormsListHelper.php(1 hunks)classes/helpers/FrmListHelper.php(3 hunks)classes/helpers/FrmStylesHelper.php(5 hunks)classes/helpers/FrmStylesPreviewHelper.php(1 hunks)classes/helpers/FrmSubmitHelper.php(1 hunks)classes/helpers/FrmXMLHelper.php(2 hunks)classes/models/FrmDb.php(3 hunks)classes/models/FrmEmail.php(1 hunks)classes/models/FrmEmailSummary.php(1 hunks)classes/models/FrmEntry.php(2 hunks)classes/models/FrmEntryFormatter.php(1 hunks)classes/models/FrmEntryMeta.php(3 hunks)classes/models/FrmEntryValidate.php(5 hunks)classes/models/FrmField.php(2 hunks)classes/models/FrmFieldFormHtml.php(1 hunks)classes/models/FrmForm.php(2 hunks)classes/models/FrmFormAction.php(1 hunks)classes/models/FrmFormApi.php(2 hunks)classes/models/FrmFormState.php(3 hunks)classes/models/FrmInbox.php(2 hunks)classes/models/FrmReviews.php(1 hunks)classes/models/FrmSolution.php(1 hunks)classes/models/fields/FrmFieldCaptcha.php(2 hunks)classes/models/fields/FrmFieldEmail.php(1 hunks)classes/models/fields/FrmFieldGdpr.php(1 hunks)classes/models/fields/FrmFieldTextarea.php(1 hunks)classes/models/fields/FrmFieldType.php(2 hunks)classes/models/fields/FrmFieldUrl.php(1 hunks)classes/views/frm-fields/front-end/gdpr/gdpr-field.php(1 hunks)classes/views/frm-fields/front-end/radio-field.php(1 hunks)classes/views/frm-form-actions/default_actions.php(1 hunks)classes/views/frm-forms/landing-page-preview-option.php(1 hunks)classes/views/frm-forms/mb_insert_fields.php(1 hunks)classes/views/frm-forms/spam-settings/antispam.php(1 hunks)classes/views/frm-settings/general.php(2 hunks)classes/views/frm-settings/payments.php(1 hunks)classes/views/shared/errors.php(1 hunks)classes/views/shared/mb_adv_info.php(1 hunks)classes/views/shared/upgrade_overlay.php(1 hunks)classes/views/styles/_style-options.php(1 hunks)phpcs-sniffs/Formidable/Sniffs/WhiteSpace/BlankLineAfterClosingBraceSniff.php(1 hunks)square/helpers/FrmSquareLiteConnectHelper.php(1 hunks)stripe/controllers/FrmStrpLiteActionsController.php(1 hunks)stripe/helpers/FrmStrpLiteConnectApiAdapter.php(1 hunks)stripe/helpers/FrmStrpLiteConnectHelper.php(2 hunks)stripe/helpers/FrmStrpLiteLinkRedirectHelper.php(1 hunks)stripe/helpers/FrmTransLiteAppHelper.php(2 hunks)stripe/models/FrmStrpLiteAuth.php(2 hunks)tests/phpunit/base/FrmUnitTest.php(2 hunks)tests/phpunit/entries/test_FrmShowEntryShortcode.php(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
classes/models/FrmEntryMeta.php (1)
classes/models/FrmDb.php (2)
FrmDb(6-852)prepend_and_or_where(637-657)
🪛 GitHub Check: PHPStan
phpcs-sniffs/Formidable/Sniffs/WhiteSpace/BlankLineAfterClosingBraceSniff.php
[failure] 137-137:
Access to property $fixer on an unknown class PHP_CodeSniffer\Files\File.
[failure] 130-130:
Call to method addFixableError() on an unknown class PHP_CodeSniffer\Files\File.
[failure] 124-124:
Constant T_CLOSE_CURLY_BRACKET not found.
[failure] 92-92:
Call to method findNext() on an unknown class PHP_CodeSniffer\Files\File.
[failure] 62-62:
Constant T_EQUAL not found.
[failure] 55-55:
Call to method findNext() on an unknown class PHP_CodeSniffer\Files\File.
[failure] 51-51:
Call to method getTokens() on an unknown class PHP_CodeSniffer\Files\File.
[failure] 50-50:
Parameter $phpcsFile of method Formidable\Sniffs\WhiteSpace\BlankLineAfterClosingBraceSniff::process() has invalid type PHP_CodeSniffer\Files\File.
[failure] 50-50:
Parameter $phpcsFile of method Formidable\Sniffs\WhiteSpace\BlankLineAfterClosingBraceSniff::process() has invalid type PHP_CodeSniffer\Files\File.
[failure] 31-31:
Class Formidable\Sniffs\WhiteSpace\BlankLineAfterClosingBraceSniff implements unknown interface PHP_CodeSniffer\Sniffs\Sniff.
⏰ 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). (6)
- GitHub Check: PHP 8 tests in WP trunk
- GitHub Check: PHP 7.4 tests in WP trunk
- GitHub Check: Cypress
- GitHub Check: Cypress
- GitHub Check: PHP 8 tests in WP trunk
- GitHub Check: PHP 7.4 tests in WP trunk
🔇 Additional comments (87)
classes/views/styles/_style-options.php (1)
5-5: LGTM!The blank line between the guard clause and variable assignments improves code organization and aligns perfectly with the PR objective to enforce empty lines after closing braces.
classes/models/fields/FrmFieldUrl.php (1)
103-103: Formatting aligns with PR objective.The blank line inserted after the foreach loop closing brace and before the variable assignment correctly enforces the formatting rule stated in the PR objective. The change maintains code readability and follows the PHP_CodeSniffer standard being introduced.
classes/models/FrmSolution.php (1)
645-665: Formatting change aligns with new PHP_CodeSniffer sniff.The blank line added after the foreach loop closing brace (line 658) and before the
$widthvariable assignment (line 659) correctly enforces the PR's style rule. No functional changes.classes/models/fields/FrmFieldCaptcha.php (1)
110-117: Formatting changes align with PR objectives.The blank lines inserted after closing braces (lines 116 and 351) appropriately enforce the coding standard of maintaining empty lines between closing braces and variable assignments. Both changes follow the pattern consistently and improve code readability without affecting functionality.
Also applies to: 346-356
classes/models/FrmFieldFormHtml.php (1)
538-543: LGTM! Formatting improvement aligns with PR objectives.The blank line insertion between the closing brace and the subsequent variable assignment (line 541) follows the PR's stated intent to enforce empty lines after closing braces. This improves code readability without affecting logic or functionality.
classes/views/frm-settings/payments.php (1)
27-27: LGTM!The blank line separation between the closing brace and the variable assignment improves code readability and aligns with the PHP_CodeSniffer sniff enforcement for this PR. No functional changes.
classes/models/fields/FrmFieldTextarea.php (1)
61-68: Formatting improvement aligns with PR objective.The blank line added at line 65 between the closing brace and the
$stylevariable assignment follows the PR's enforcement of blank lines after closing braces. This improves readability with no functional impact.classes/models/FrmForm.php (2)
709-713: Formatting change approved: blank line added after closing brace.The empty line added after the null-check conditional (line 711) and before the variable assignment (line 713) aligns with the PR objective and improves code readability by separating control flow from subsequent assignments.
1173-1179: Formatting change approved: blank line added after if-else block.The empty line added after the if-else block (line 1177) and before the variable assignment (line 1179) consistently applies the same formatting standard, enhancing visual separation between conditional logic and variable initialization.
classes/views/shared/upgrade_overlay.php (1)
34-42: Blank line insertion is fine and matches stated style goalThe added blank line between the
if/elseblock and the following$message = sprintf(...)keeps behavior unchanged and aligns with the PR’s formatting rule.classes/helpers/FrmEntriesListHelper.php (2)
215-221: Blank line correctly enforced after closing brace.The added blank line between the
ifblock and the$has_formvariable assignment aligns perfectly with the PR's style enforcement objective.
382-391: Blank line correctly enforced after closing brace.The added blank line between the
if-elseblock and the$r .= '</td>';statement maintains consistent code style per the PR's formatting improvements.classes/models/fields/FrmFieldGdpr.php (1)
102-108: Blank line after guard clause improves readability; no behavior changeThe added empty line cleanly separates the early-return guard from the main body of
show_primary_options, matching the new coding standard without affecting runtime behavior. Looks good as-is.classes/views/frm-forms/spam-settings/antispam.php (1)
5-6: LGTM! Formatting improvement aligns with coding standards.The added blank line correctly enforces spacing between the closing brace and variable assignment, consistent with the PR's objective to improve code readability.
classes/models/FrmFormAction.php (1)
680-682: Blank line separator added correctly.The blank line between the control structure's closing brace and the variable assignment improves code readability and aligns with the PR's formatting enforcement objective.
classes/helpers/FrmSubmitHelper.php (1)
204-214: LGTM! Formatting improvement aligns with PR objective.The empty line added after the if statement's closing brace improves readability by visually separating the conditional return from the subsequent variable assignment. This change is consistent with the PR's goal to enforce blank lines between closing braces and variable assignments.
classes/views/frm-fields/front-end/gdpr/gdpr-field.php (1)
11-11: LGTM! Formatting improvement aligns with PR objectives.The blank line improves readability by visually separating the ABSPATH security check from the variable assignments that follow.
classes/models/fields/FrmFieldType.php (2)
1441-1442: LGTM! Formatting improvement aligns with coding standards.The added blank line improves readability by visually separating the loop logic from the closing statement.
1669-1671: LGTM! Formatting improvement enhances code readability.The added blank line properly separates the guard clause from the main method logic.
classes/views/shared/mb_adv_info.php (1)
243-243: LGTM! Blank line improves readability.The blank line addition after the closing brace and before the variable assignment aligns with the PR objective and improves code organization.
classes/models/FrmFormApi.php (2)
249-267: LGTM!The blank line insertion after the
ifblock (line 253) aligns with the PR's formatting enforcement for spacing between closing braces and variable assignments.
407-424: LGTM!The blank line insertion after the
ifblock (line 411) is consistent with the formatting pattern being enforced in this PR.classes/views/frm-fields/front-end/radio-field.php (1)
38-51: LGTM!The blank line at line 49 properly separates the label rendering block from the
$checkedvariable assignment, improving readability.classes/helpers/FrmListHelper.php (3)
498-519: LGTM!The blank line at line 513 properly separates the
foreachloop from the subsequent string concatenation, consistent with the PR's formatting standard.
649-665: LGTM!The blank line at line 660 adds appropriate spacing between the conditional block and the
$html_total_pagesassignment.
684-690: LGTM!The blank line at line 688 properly separates the
ifblock from the$outputconcatenation statement.classes/helpers/FrmFormsListHelper.php (1)
443-453: LGTM!The blank line at line 448 properly separates the null/empty check block from the subsequent
ksessanitization call.square/helpers/FrmSquareLiteConnectHelper.php (1)
565-573: LGTM!The blank line at line 570 properly separates the early return conditional from the
$test_modevariable assignment.classes/views/frm-form-actions/default_actions.php (1)
140-154: LGTM!The blank line at line 149 properly separates the pro installation check block from the
$linkassignment.classes/models/FrmEmailSummary.php (1)
176-195: LGTM!The blank line at line 191 properly separates the content validation block from the subsequent variable assignments for
$subjectand$headers.classes/models/FrmEntry.php (2)
591-609: LGTM!The blank line at line 605 properly separates the
$whereconditional assignment block from the database query call.
759-771: LGTM!The blank line at line 766 properly separates the conditional block from the
$countcalculation.classes/models/fields/FrmFieldEmail.php (1)
48-57: LGTM!The blank line insertion after the early return block follows the new coding standard being enforced across the codebase.
classes/models/FrmEntryFormatter.php (1)
987-1000: LGTM!The blank line insertion after the if block containing the
<img>tag handling aligns with the coding standard enforcement.classes/helpers/FrmEntriesHelper.php (1)
279-286: LGTM!The blank line insertion after the separator-setting if block follows the new coding standard.
classes/models/FrmReviews.php (1)
109-120: LGTM!The blank line insertion after the entry-rounding if/else block is consistent with the coding standard being enforced.
classes/controllers/FrmEntriesController.php (1)
296-305: LGTM!The blank line insertion after the early return block aligns with the coding standard enforcement.
classes/helpers/FrmXMLHelper.php (2)
380-392: LGTM!The blank line insertion after the foreach loop in
get_form_fieldsfollows the coding standard.
1120-1135: LGTM!The blank line insertion after the early continue check in
clear_forms_style_cachesis consistent with the coding standard.classes/controllers/FrmEmailStylesController.php (1)
203-214: LGTM!The blank line insertion after the style-injection if block aligns with the coding standard enforcement.
classes/models/FrmDb.php (3)
97-117: LGTM!The blank line insertion after the nested where parsing block follows the coding standard.
141-161: LGTM!The blank line insertions within the LIKE array handling logic align with the coding standard enforcement.
270-281: LGTM!The blank line insertion after the foreach loop in
generate_cache_keyis consistent with the coding standard.classes/controllers/FrmFormActionsController.php (1)
575-580: LGTM! Formatting improvement enhances readability.The blank line added between the array_merge block and the array_diff call improves code readability without affecting functionality. This aligns with the PR's objective to enforce consistent blank line usage.
classes/models/FrmField.php (2)
506-510: LGTM! Improves code organization.The blank line added after the count check enhances readability by visually separating the validation logic from the subsequent variable assignments.
858-864: LGTM! Enhances visual clarity.The blank line before the database call improves readability by clearly separating the conditional logic from the database operation.
classes/controllers/FrmAppController.php (2)
86-90: LGTM! Formatting enhancement.The blank line added after the
wp_enqueue_stylecall provides better visual separation before the filter application, improving code readability.
787-792: LGTM! Improves code structure.The blank line added after the early return check clearly separates the validation logic from the subsequent variable assignment, enhancing readability.
classes/views/frm-settings/general.php (2)
2-6: LGTM! Consistent formatting.The blank line after the ABSPATH check follows a consistent pattern and improves visual separation between the security check and the main content.
62-67: LGTM! Enhances code organization.The blank line before the GDPR options wrapper variable definition improves readability by providing visual separation from the preceding conditional logic.
classes/helpers/FrmStylesPreviewHelper.php (1)
347-353: LGTM! Improves readability.The blank line added after the early return guard clause provides better visual separation before the main logic begins, making the code easier to scan.
classes/helpers/FrmApiHelper.php (2)
21-25: LGTM! Enhances code structure.The blank line after the early return provides better visual separation before the main conditional logic begins.
97-105: LGTM! Improves visual flow.The blank line added after the comment and conditional block enhances readability by clearly separating the different logical sections of the method.
classes/models/FrmInbox.php (2)
188-200: LGTM! Formatting improvement.The blank line before the filter application provides better visual separation at the end of the method, making the final filter hook more prominent.
409-415: LGTM! Enhances readability.The blank line added after the early return check provides clear visual separation before the main logic begins.
stripe/helpers/FrmTransLiteAppHelper.php (2)
204-210: LGTM! Improves code organization.The blank line added after the form object assignment provides better visual separation before the filter application.
584-590: LGTM! Enhances readability.The blank line before retrieving the currencies array improves visual separation between the select attributes configuration and the data retrieval logic.
classes/helpers/FrmStylesHelper.php (1)
157-182: Whitespace-only style adjustments look goodThe added blank lines between closing braces and subsequent assignments/returns are purely formatting and align with the new coding standard; no functional impact.
Also applies to: 418-441, 479-500, 714-745, 1114-1124
classes/helpers/FrmAppHelper.php (1)
823-856: Formatting-only updates align with new sniffAll touched regions here (request helpers, icon rendering, textarea escaping, human_time_diff, and form-data formatting) only add or move blank lines / comments; behavior, return values, and hooks remain unchanged.
Also applies to: 1350-1388, 2520-2533, 3196-3246, 3707-3728
classes/helpers/FrmCSVExportHelper.php (1)
349-371: CSV helper diffs are purely cosmeticThe only changes here are extra blank lines before filter calls/assignments in
field_headings,print_csv_row, andescape_csv. CSV structure and escaping semantics are unchanged.Also applies to: 773-813, 871-879
classes/controllers/FrmAddonsController.php (1)
511-522: Primary license lookup correctly restricted to Formidable Pro
get_primary_license_info()now reassigns$installed_addonsto only the'formidable_pro'entry before passing it intofill_update_addon_info(). This keeps the “primary” license checks (eg, inis_license_expired()) focused on the Pro license instead of any other installed add‑ons, which should avoid mixed/incorrect error states. The surrounding hunks are whitespace-only.Also applies to: 850-857, 866-878, 1273-1293
classes/models/FrmEntryMeta.php (2)
55-81:update_entry_metanow normalizes array values consistently withadd_entry_metaThe new block:
if ( is_array( $values['meta_value'] ) ) { $values['meta_value'] = array_filter( $values['meta_value'], 'FrmAppHelper::is_not_empty_value' ); } $meta_value = maybe_serialize( $values['meta_value'] );ensures that, on update, array meta values are stripped of strictly empty entries before serialization, just like
add_entry_meta()already does. This keeps create vs. update behavior consistent and avoids persisting empty slots in meta arrays, while preserving legitimate falsy values (e.g.,0,'0').Looks good and low risk.
466-487: Whitespace-only changes in query helpersThe tweaks in
should_join_fields_table()andsearch_entry_metas()are just added blank lines to satisfy the new style rule; the SQL generation and behavior are unchanged.Also applies to: 602-639
classes/controllers/FrmFormsController.php (1)
100-106: Whitespace-only formatting; behavior unchanged.The added blank lines in
list_form(),should_insert_form_popup(), andget_shortcode_opts()are purely stylistic and do not alter logic or side effects.Also applies to: 1096-1103, 1117-1139
classes/models/FrmFormState.php (1)
133-153: Formatting-only changes around state encryption; no functional impact.The added blank lines in
get_state_from_request(),render_state_field(), andget_state_string()do not change control flow or behavior.Also applies to: 158-168, 173-183
classes/helpers/FrmFieldsHelper.php (1)
606-615: Formatting-only tweaks; logic remains the same.The added blank lines in
run_wpautop(),trigger_shortcode_atts(), andswitch_ids_except_strings()are purely stylistic and do not affect how values are transformed or IDs are replaced.Also applies to: 1121-1133, 1846-1857
classes/views/shared/errors.php (1)
16-42: Newfrm_message_listfilter cleanly extends message rendering.Passing
$show_messagesthroughapply_filters( 'frm_message_list', $show_messages )before the existingis_array/countguard adds a useful extension point while keeping safety: non-array returns will simply result in no list being rendered, and each message is still run throughFrmAppHelper::kses()with a constrained tag set. This is a straightforward, low-risk way to let add‑ons adjust or aggregate messages.classes/controllers/FrmXMLController.php (2)
110-120: Whitespace-only adjustments; control flow unaffected.The added blank lines in
install_template(),get_posted_form(), andget_file_name()are cosmetic and do not alter error handling, JSON decoding, or filename generation logic.Also applies to: 150-158, 641-648
682-700: Addingset_time_limit(0)before CSV export reduces timeout risk.Calling
set_time_limit( 0 )(when available) ahead of the CSV export and then bumping memory viawp_raise_memory_limit()is appropriate for potentially large exports and is guarded withfunction_exists()to avoid fatal errors where the function is disabled. This should make long-running exports more reliable without altering query semantics.classes/helpers/FrmFormsHelper.php (4)
137-137: LGTM - Formatting improvementThe blank line addition improves readability by visually separating the conditional block from the subsequent assignment.
570-570: LGTM - Formatting improvementThe blank line appropriately separates the security filtering logic from the subsequent processing.
678-684: Verify the loop logic is correctThe assignment
$included = $plan === $plan_requirednow executes on every iteration after the break check. This means:
- If
$includedbecomestrue, the loop breaks on the next iteration (before reassigning)- The final value of
$includedwill be correctWhile this appears functionally equivalent to the previous implementation, please verify that this logic correctly handles all plan hierarchy scenarios, especially edge cases where the plan required comes after the license type in the array.
993-993: LGTM - Formatting improvementThe blank line improves readability by separating the conditional logic from the shortcode construction.
phpcs-sniffs/Formidable/Sniffs/WhiteSpace/BlankLineAfterClosingBraceSniff.php (1)
31-145: LGTM - Well-implemented sniff with good edge case handlingThe sniff correctly:
- Identifies variable assignments preceded by closing braces
- Handles edge cases (blank lines, non-assignments, etc.)
- Provides automatic fixing via
addNewlineBeforeThe static analysis warnings about unknown PHP_CodeSniffer classes are false positives and can be safely ignored, as PHP_CodeSniffer is a development dependency.
stripe/helpers/FrmStrpLiteConnectHelper.php (2)
470-470: LGTM - Formatting improvementThe blank line appropriately separates the mode normalization logic from the subsequent variable assignments.
662-662: LGTM - Formatting improvementThe blank line improves readability by separating the conditional check from the mode value retrieval.
stripe/controllers/FrmStrpLiteActionsController.php (1)
440-440: LGTM - Formatting improvementThe blank line enhances readability by separating the conditional suffix assignment from the script URL construction.
tests/phpunit/entries/test_FrmShowEntryShortcode.php (1)
832-832: LGTM - Formatting improvementThe blank line improves readability by separating the conditional class addition from the tag completion.
stripe/models/FrmStrpLiteAuth.php (2)
263-263: LGTM - Formatting improvementThe blank line appropriately separates the conditional check from the variable assignment and sanitization logic.
681-681: LGTM - Formatting improvementThe blank line improves readability by separating the early return check from the form object retrieval.
stripe/helpers/FrmStrpLiteConnectApiAdapter.php (1)
27-36: Important fix: Ensures customer_id is defined for non-admin flowThis change resolves a potential undefined variable issue. Previously, when a non-administrator cancelled a subscription,
$customer_idwas never assigned after retrieving the customer object, which would cause it to be undefined when passed toFrmStrpLiteConnectHelper::cancel_subscription().The addition of line 34 (
$customer_id = $customer->id;) ensures that the customer ID is properly extracted and passed to the downstream helper method, enabling non-admin users to successfully cancel their subscriptions.stripe/helpers/FrmStrpLiteLinkRedirectHelper.php (1)
105-105: LGTM - Formatting improvementThe blank line improves readability by separating the redirect path extraction logic from the final redirect URL construction.
tests/phpunit/base/FrmUnitTest.php (2)
234-234: LGTM! Formatting improvement aligns with PR objective.The blank line improves readability by separating the array initialization block from the subsequent variable assignments.
550-550: LGTM! Formatting improvement aligns with PR objective.The blank line improves code organization by visually separating the foreach loop from the query variable initialization.
classes/models/FrmEntryValidate.php (3)
326-338: Blank line after filter removal is fineThis is a purely formatting change between the conditional
remove_filterand$filtered_optionassignment. It has no behavioral impact and matches the intended style rule.
351-372: Shortcode normalization for dynamic options looks correctRunning
do_shortcode()on each option in both$values['options']and$field_object->optionsbefore comparison makes the “dynamic options based on hook” check operate on rendered values instead of raw shortcode strings, which is consistent with how users see labels. Given this path is only taken on a failed direct match, the extra shortcode processing should not be a hot‑path bottleneck.
502-529: Formatting around final regex assembly is safeThe added blank line before prefixing/suffixing the pattern is cosmetic only and does not alter the generated regular expression.
…nd_curl_and_var_assignment Enforce empty line between end curl and var assignment
No description provided.