Skip to content

Start working on change log for v6.10#1753

Merged
Crabcyborg merged 7 commits into
masterfrom
update_readme_6.10
May 29, 2024
Merged

Start working on change log for v6.10#1753
Crabcyborg merged 7 commits into
masterfrom
update_readme_6.10

Conversation

@Crabcyborg
Copy link
Copy Markdown
Contributor

No description provided.

@Crabcyborg Crabcyborg marked this pull request as ready for review May 29, 2024 12:44
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2024

Walkthrough

The updates focus on enhancing compatibility and performance for the Formidable Forms plugin. Key changes include updating the minimum PHP version to 7.0, introducing improved field data storage, enhancing XML import functionalities, fixing various bugs, and removing deprecated functions. These updates aim to improve efficiency, ensure compatibility with newer PHP versions, and streamline the plugin's codebase.

Changes

Files/Paths Change Summary
.github/workflows/syntax.yml Updated PHP versions used in the workflow from 5.6 and 8.1 to 7.0 and 8.3.
changelog.txt Documented version 6.10 changes, including new features, bug fixes, and deprecated functions.
classes/helpers/FrmAppHelper.php Updated php_version_notice function to check for PHP version 7.0 instead of 5.6.
readme.txt Updated compatibility info, introduced new features, fixed bugs, and removed deprecated functions.

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 9d23e5c and e36edcb.
Files selected for processing (4)
  • .github/workflows/syntax.yml (1 hunks)
  • changelog.txt (1 hunks)
  • classes/helpers/FrmAppHelper.php (1 hunks)
  • readme.txt (3 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/syntax.yml
Additional Context Used
LanguageTool (20)
readme.txt (20)

Near line 28: This word is normally spelled as one.
Context: ...ptions like an email subscription form, multi-page form, file upload form, quiz grading, o...
Rule ID: EN_COMPOUNDS_MULTI_PAGE


Near line 28: For a more polite and respectful tone, consider rephrasing with ‘please’.
Context: ...onships, and cascading dropdown fields. Don't forget the calculated fields, front-end form e...
Rule ID: DONT_FORGET


Near line 88: This word is normally spelled as one.
Context: ...idable's rich array of features include multi-page forms, save-and-continue options, casca...
Rule ID: EN_COMPOUNDS_MULTI_PAGE


Near line 105: Consider using a more formal and expressive alternative to ‘awesome’.
Context: ...Form Solution == > Formidable Forms is an awesome professional form builder. There is muc...
Rule ID: AWESOME


Near line 105: Did you mean “too”?
Context: ...rofessional form builder. There is much to like about Formidable Forms. From the d...
Rule ID: WAY_TOO


Near line 113: This word is normally spelled as one.
Context: ...i-Step Forms**: Boost conversions with [multi-step forms](https://formidableforms.com/feat...
Rule ID: EN_COMPOUNDS_MULTI_STEP


Near line 182: The verb “Double-check” is spelled with a hyphen.
Context: ...emails, try the following steps: 1. Double check the email address in your Email action ...
Rule ID: DOUBLE_HYPHEN


Near line 187: Consider using a different verb for a more formal wording.
Context: ...P settings. 6. If these steps do not fix the problem and other WP signup emails ...
Rule ID: FIX_RESOLVE


Near line 264: Try using a synonym here to strengthen your writing.
Context: ...tm_campaign=liteversion). A Pro license gives you access to the full version of Formidabl...
Rule ID: GIVE_PROVIDE


Near line 289: The expression “come in handy” is rather colloquial. Consider replacing it to add a more formal tone to your writing.
Context: ...f our advanced premium fields that will come in handy: * File Upload * Rich Text * Date * Ti...
Rule ID: COME_IN_HANDY


Near line 326: Possible missing comma found.
Context: ...mport from other WordPress contact form plugins such as [Gravity Forms](https://wordpre...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA


Near line 345: Possible missing comma found.
Context: ...your website with over 5,000+ marketing apps including: * SendInBlue * Zoho CRM * Z...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA


Near line 375: The phrase ‘a lot of’ might be wordy and overused. Consider using an alternative.
Context: ...e load speed improvement for forms with a lot of fields. * New: XML import has been upda...
Rule ID: A_LOT_OF


Near line 377: Using ‘plenty’ without ‘of’ is considered to be informal.
Context: ...cimal separator would have an incorrect amount value when the amount value had a single deci...
Rule ID: PLENTY_OF_NOUNS


Near line 377: Using ‘plenty’ without ‘of’ is considered to be informal.
Context: ...have an incorrect amount value when the amount value had a single decimal point like 11,5. *...
Rule ID: PLENTY_OF_NOUNS


Near line 387: Consider a shorter alternative to avoid wordiness.
Context: ...ings is now stored in memory and reused in order to significantly improve performance in th...
Rule ID: IN_ORDER_TO_PREMIUM


Near line 387: The phrase ‘a lot of’ might be wordy and overused. Consider using an alternative.
Context: ...ance in the form builder for forms with a lot of fields. * Fix: Rootline and progress ba...
Rule ID: A_LOT_OF


Near line 390: ‘by mistake’ might be wordy. Consider a shorter alternative.
Context: ...ix: Submit button fields were appearing by mistake in WooCommerce products. * The parser f...
Rule ID: EN_WORDINESS_PREMIUM_BY_MISTAKE


Near line 396: When ‘set-up’ is used as a noun or modifier, it needs to be hyphenated.
Context: ... been added to help improve the initial set up process. * New: Submit buttons can now ...
Rule ID: VERB_NOUN_CONFUSION


Near line 403: Consider using a different verb for a more formal wording.
Context: ...leted now after an action is deleted to fix an issue with old floating tooltips. =...
Rule ID: FIX_RESOLVE

Additional comments not posted (16)
readme.txt (3)

6-6: Update to "Tested up to: 6.5.3" reflects the plugin's compatibility with the latest WordPress version.


7-7: Update to "Requires PHP: 7.0" aligns with the new minimum PHP version requirement.


8-8: Update to "Stable tag: 6.10" correctly indicates the new stable version of the plugin.

classes/helpers/FrmAppHelper.php (1)

Line range hint 387-406: Review the handling of special characters to ensure all edge cases are covered, especially for internationalization support.

Verification successful

Line range hint 387-406: Review the handling of special characters to ensure all edge cases are covered, especially for internationalization support.


The output from the shell script indicates that special characters, including emojis, are correctly handled by the JSON encoding process. The JSON object was successfully parsed and displayed with the special character intact.

Given this result, it appears that the method prepare_and_encode handles special characters appropriately. However, to ensure comprehensive verification, it would be prudent to check the actual implementation of the prepare_and_encode method within the codebase to confirm that it uses json_encode or a similar mechanism that supports special characters.


Line range hint 387-406: Review the handling of special characters to ensure all edge cases are covered, especially for internationalization support.


The output from the shell script indicates that special characters, including emojis, are correctly handled by the JSON encoding process. The JSON object was successfully parsed and displayed with the special character intact.

Given this result, it appears that the method prepare_and_encode handles special characters appropriately. However, to ensure comprehensive verification, it would be prudent to check the actual implementation of the prepare_and_encode method within the codebase to confirm that it uses json_encode or a similar mechanism that supports special characters.


The ast-grep command failed because PHP is not supported. To proceed, we need to use an alternative method to locate the prepare_and_encode function in the codebase.


Line range hint 387-406: Review the handling of special characters to ensure all edge cases are covered, especially for internationalization support.


The output from the shell script indicates that special characters, including emojis, are correctly handled by the JSON encoding process. The JSON object was successfully parsed and displayed with the special character intact.

Given this result, it appears that the method prepare_and_encode handles special characters appropriately. However, to ensure comprehensive verification, it would be prudent to check the actual implementation of the prepare_and_encode method within the codebase to confirm that it uses json_encode or a similar mechanism that supports special characters.


The ast-grep command failed because PHP is not supported. To proceed, we need to use an alternative method to locate the prepare_and_encode function in the codebase.


The ripgrep command successfully located the prepare_and_encode method in the classes/helpers/FrmAppHelper.php file. Now, we need to review the implementation of this method to verify its handling of special characters.


The prepare_and_encode method in classes/helpers/FrmAppHelper.php handles special characters by replacing problematic characters and using json_encode to convert the array to JSON format. It also adds extra slashes for certain characters to ensure they are not stripped by WordPress.

The method appears to handle special characters, including those that could affect internationalization, appropriately.

  • The method replaces " with " and then later with \\" to ensure quotes are correctly encoded.
  • It uses json_encode to convert the array, which supports special characters like emojis.
  • It adds extra slashes for characters like \r, \n, \u, and \t to prevent them from being stripped.

Based on this review, the method prepare_and_encode seems to handle special characters correctly.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check if special characters like emojis or right-to-left languages are handled correctly.
echo "Testing JSON encoding with special characters"
echo '{"text":"This is a test 😊"}' | jq .

Length of output: 179



Script:

#!/bin/bash
# Check if special characters like emojis or right-to-left languages are handled correctly.
echo "Testing JSON encoding with special characters"
echo '{"text":"This is a test 😊"}' | jq .

Length of output: 179


Script:

#!/bin/bash
# Locate the implementation of the `prepare_and_encode` method to verify its handling of special characters.
ast-grep --lang php --pattern 'function prepare_and_encode($_) {
  $$$
}'

Length of output: 182



Script:

#!/bin/bash
# Check if special characters like emojis or right-to-left languages are handled correctly.
echo "Testing JSON encoding with special characters"
echo '{"text":"This is a test 😊"}' | jq .

Length of output: 179


Script:

#!/bin/bash
# Locate the implementation of the `prepare_and_encode` method to verify its handling of special characters.
ast-grep --lang php --pattern 'function prepare_and_encode($_) {
  $$$
}'

Length of output: 182


Script:

#!/bin/bash
# Use ripgrep to locate the implementation of the `prepare_and_encode` method in the codebase.
rg 'function prepare_and_encode' --type php

Length of output: 140



Script:

#!/bin/bash
# Check if special characters like emojis or right-to-left languages are handled correctly.
echo "Testing JSON encoding with special characters"
echo '{"text":"This is a test 😊"}' | jq .

Length of output: 179


Script:

#!/bin/bash
# Locate the implementation of the `prepare_and_encode` method to verify its handling of special characters.
ast-grep --lang php --pattern 'function prepare_and_encode($_) {
  $$$
}'

Length of output: 182


Script:

#!/bin/bash
# Use ripgrep to locate the implementation of the `prepare_and_encode` method in the codebase.
rg 'function prepare_and_encode' --type php

Length of output: 140


Script:

#!/bin/bash
# Display the implementation of the `prepare_and_encode` method in the `classes/helpers/FrmAppHelper.php` file.
rg -A 20 'function prepare_and_encode' classes/helpers/FrmAppHelper.php

Length of output: 826

changelog.txt (12)

3-3: New feature for storing field data in memory is well-documented.


4-4: XML import enhancements are clearly outlined.


5-5: Fix for currency decimal issues is crucial for international users.


6-6: Standardization of field error elements will improve consistency.


7-7: Addressing Stripe redirect issues is an important fix for user experience.


8-8: Updating the minimum supported PHP version aligns with modern standards.


9-9: Relocation of the frm_summary_email_content_args hook is well-noted.


10-10: Removal of deprecated PHP functions is a good practice for maintainability.


11-11: Removal of deprecated front-end JavaScript functions will help in reducing maintenance overhead.


12-12: Dropping support for Internet Explorer is a significant step towards modernizing the codebase.


13-13: Improvements in form builder performance are beneficial for large forms.


13-13: Fix for rootline and progress bar elements addresses specific UI issues.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

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

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

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

Documentation and Community

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

@Crabcyborg Crabcyborg merged commit 6aa3f11 into master May 29, 2024
@Crabcyborg Crabcyborg deleted the update_readme_6.10 branch May 29, 2024 12:48
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Outside diff range and nitpick comments (4)
classes/helpers/FrmAppHelper.php (4)

Line range hint 352-370: Ensure tooltips are accessible by adding aria-label or similar attributes.

+ echo ' aria-label="' . esc_attr( $tooltips[ $name ] ) . '"';

Line range hint 372-385: Consider refactoring to improve testability by encapsulating global variable access.

- global $hook_suffix;
+ $hook_suffix = $this->get_hook_suffix(); // Assume this method is added to handle the global state internally.

Line range hint 408-418: Ensure version comparison logic is robust and handles edge cases such as beta or RC versions.

Consider adding unit tests to cover different version formats (e.g., 1.0.0-beta, 1.0-RC1).


Line range hint 420-438: Refactor to separate concerns: extract license expiration check into a separate method.

- $expired = FrmAddonsController::is_license_expired();
+ $expired = $this->check_license_expired(); // This new method encapsulates the license check.

Comment thread readme.txt
Comment on lines +374 to +384
= 6.10 =
* New: Field data for shortcodes is now stored in memory and reused on the settings page and form builder page for a significant page load speed improvement for forms with a lot of fields.
* New: XML import has been updated to support mapping field ID changes when importing a map view and new calendar view settings.
* Fix: Payments using a currency that uses a comma as the decimal separator would have an incorrect amount value when the amount value had a single decimal point like 11,5.
* Fix: Field error elements would inconsistently use either IDs or field keys in their ID values. An update has been made to use always use field keys.
* Fix: In some cases, a Stripe redirect would happen after failing to create an entry, resulting in an unexpected redirect to stripe.com.
* The minimum supported PHP version has been updated to 7.0, ending official support for PHP 5.6.
* The frm_summary_email_content_args hook has been moved to where it is now filtered for all types of email summaries.
* Several deprecated PHP functions have been removed including FrmFormsHelper::template_install_html, FrmFormsHelper::available_count, FrmFormsHelper::builder_submit_button, FrmFieldsHelper::get_shortcode_tag, FrmFieldsController::include_single_field, and FrmFormsController::new_form.
* Several deprecated front end JavaScript functions have been removed including frmFrontForm.goingToPreviousPage, frmFrontForm.hideOrShowFields, frmFrontForm.hidePreviouslyHiddenFields, frmFrontForm.checkDependentDynamicFields, frmFrontForm.checkDependentLookupFields, and frmFrontForm.loadGoogle.
* Some front end JavaScript code for supporting Internet Explorer has been dropped, helping to reduce the size of JavaScript required on the front end.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The verification process has revealed that while the deprecated PHP functions have been successfully removed, several deprecated JavaScript functions still exist in the codebase, specifically within js/formidable.min.js.

  • frmFrontForm.goingToPreviousPage
  • frmFrontForm.hideOrShowFields
  • frmFrontForm.hidePreviouslyHiddenFields
  • frmFrontForm.checkDependentDynamicFields
  • frmFrontForm.checkDependentLookupFields
  • frmFrontForm.loadGoogle

These functions are marked as deprecated but are still present in the minified JavaScript file.

Analysis chain

Changelog for version 6.10:

  • New features like improved field data storage and XML import functionality are beneficial for performance and flexibility.
  • Fixes for currency decimal issues and field error elements enhance reliability.
  • Updates related to PHP version and deprecated functions improve security and future-proofing.
  • Removal of Internet Explorer-specific JavaScript optimizes front-end performance.

Ensure all deprecated functions are removed from the codebase and update documentation accordingly.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that all deprecated functions are removed from the codebase.

# Test: Search for deprecated functions. Expect: No occurrences.
rg --type php 'FrmFormsHelper::template_install_html|FrmFormsHelper::available_count|FrmFormsHelper::builder_submit_button|FrmFieldsHelper::get_shortcode_tag|FrmFieldsController::include_single_field|FrmFormsController::new_form'

Length of output: 231



Script:

#!/bin/bash
# Description: Verify that all deprecated functions are removed from the codebase.

# Test: Search for deprecated PHP functions. Expect: No occurrences.
rg --type php 'FrmFormsHelper::template_install_html|FrmFormsHelper::available_count|FrmFormsHelper::builder_submit_button|FrmFieldsHelper::get_shortcode_tag|FrmFieldsController::include_single_field|FrmFormsController::new_form'

# Test: Search for deprecated JavaScript functions. Expect: No occurrences.
rg --type js 'frmFrontForm.goingToPreviousPage|frmFrontForm.hideOrShowFields|frmFrontForm.hidePreviouslyHiddenFields|frmFrontForm.checkDependentDynamicFields|frmFrontForm.checkDependentLookupFields|frmFrontForm.loadGoogle'

Length of output: 2217

private static function php_version_notice() {
$message = array();
if ( version_compare( phpversion(), '5.6', '<' ) ) {
if ( version_compare( phpversion(), '7.0', '<' ) ) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fix the syntax error due to the stray character.

Committable suggestion was skipped due low confidence.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant