-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhance: inconsistent format in email templates #1475
enhance: inconsistent format in email templates #1475
Conversation
WalkthroughThe update introduces changes to the placeholder syntax in message templates across various components of the WordPress plugin. It transitions from using percentage signs to curly braces for dynamic content, enhancing consistency in the formatting of messages and notification emails. Additionally, it includes a new migration function for form settings to standardize notifications. Changes
Assessment against linked 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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
includes/upgrades/upgrade-4.0.11.php (1)
58-58
: Remove or clarify the commented-out code.The commented-out
error_log
line seems to be leftover debugging code. If not needed, consider removing it to keep the code clean.- // error_log( print_r( $form_settings, true ) );
Tools
GitHub Check: Run PHPCS inspection
[warning] 58-58:
This comment is 54% valid code; is this commented out code?
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (11)
- includes/Admin/Forms/Post/Templates/Post_Form_Template_Events_Calendar.php (2 hunks)
- includes/Admin/Forms/Post/Templates/Post_Form_Template_Post.php (2 hunks)
- includes/Admin/Forms/Post/Templates/Post_Form_Template_WooCommerce.php (2 hunks)
- includes/Admin/Upgrades.php (4 hunks)
- includes/Ajax/Frontend_Form_Ajax.php (1 hunks)
- includes/Free/Form_Element.php (2 hunks)
- includes/Frontend/Frontend_Form.php (1 hunks)
- includes/upgrades/upgrade-4.0.11.php (1 hunks)
- languages/wp-user-frontend.pot (12 hunks)
- wpuf-functions.php (1 hunks)
- wpuf.php (2 hunks)
Files skipped from review due to trivial changes (2)
- languages/wp-user-frontend.pot
- wpuf-functions.php
Additional context used
GitHub Check: Run PHPCS inspection
includes/upgrades/upgrade-4.0.11.php
[warning] 58-58:
This comment is 54% valid code; is this commented out code?
Additional comments not posted (14)
includes/upgrades/upgrade-4.0.11.php (1)
3-78
: LGTM!The migration function is well-implemented and effectively updates the placeholder formats in the database.
Tools
GitHub Check: Run PHPCS inspection
[warning] 58-58:
This comment is 54% valid code; is this commented out code?includes/Admin/Upgrades.php (3)
27-27
: LGTM! Added support for version 4.0.11.The addition of the new version entry is correct and aligns with the upgrade path.
94-94
: Improved maintainability with dynamic version key retrieval.Using
wpuf()->get_db_version_key()
instead of a hardcoded string enhances flexibility and maintainability.
120-121
: Enhanced security with proper HTML escaping.Replacing
esc_attr__
withesc_html__
ensures that HTML entities are properly escaped, preventing potential XSS vulnerabilities.includes/Admin/Forms/Post/Templates/Post_Form_Template_Post.php (2)
151-151
: LGTM! Standardized placeholder format in update message.The placeholder format change improves consistency and aligns with the new templating standard.
163-181
: LGTM! Consistent placeholder format in email body.The changes to the email body placeholders enhance readability and maintain consistency across templates.
includes/Admin/Forms/Post/Templates/Post_Form_Template_Events_Calendar.php (1)
Line range hint
185-216
: Consistent placeholder format applied.The placeholders in the update message and email notifications have been successfully standardized to
{placeholder}
format, aligning with the PR objectives.wpuf.php (2)
26-26
: Version update is correct.The version constant
WPUF_VERSION
has been correctly updated to '4.0.11', reflecting the changes made in this PR.
375-384
: New methodget_db_version_key
is well-implemented.The method
get_db_version_key
is a useful addition for retrieving the database version key, aiding in compatibility checks or migrations.includes/Admin/Forms/Post/Templates/Post_Form_Template_WooCommerce.php (1)
Line range hint
193-223
: Consistent placeholder format applied.The placeholders in the update message and email notifications have been successfully standardized to
{placeholder}
format, aligning with the PR objectives.includes/Frontend/Frontend_Form.php (1)
128-128
: Ensure consistent placeholder usage.The placeholder format has been updated from
%link%
to{link}
. Ensure that this new format is used consistently throughout the codebase.Run the following script to verify the consistent usage of the
{link}
placeholder:Verification successful
Consistent Placeholder Usage Verified
The
{link}
placeholder is used consistently throughout the codebase, as confirmed by the search results. The following files were checked and found to use the{link}
format:
includes/Admin/Forms/Post/Templates/Post_Form_Template_WooCommerce.php
includes/Admin/Forms/Post/Templates/Post_Form_Template_Post.php
includes/upgrades/upgrade-4.0.11.php
includes/Admin/Forms/Post/Templates/Post_Form_Template_Events_Calendar.php
includes/Frontend/Frontend_Form.php
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistent usage of the `{link}` placeholder. # Test: Search for the placeholder usage. Expect: Only occurrences of the new format `{link}`. rg --type php -A 5 $'{link}'Length of output: 111
Script:
#!/bin/bash # Description: Verify consistent usage of the `{link}` placeholder. # Test: Search for the placeholder usage. Expect: Only occurrences of the new format `{link}`. rg --type php -A 5 '\{link\}'Length of output: 3363
includes/Free/Form_Element.php (2)
291-297
: Ensure consistent placeholder usage in help text.The placeholders in the help text have been updated to use curly braces. Ensure that this new format is used consistently throughout the codebase.
Run the following script to verify the consistent usage of the curly brace placeholders in help text:
Verification successful
Curly Brace Placeholder Format is Consistent
The placeholders in the help text and other parts of the codebase consistently use the curly brace format, as requested. No inconsistencies were found.
- Files checked include
wpuf-functions.php
,includes/upgrades/upgrade-4.0.11.php
,includes/Admin/Admin_Subscription.php
, among others.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistent usage of curly brace placeholders in help text. # Test: Search for the placeholder usage. Expect: Only occurrences of the new format `{placeholder}`. rg --type php -A 5 $'{post_title}'Length of output: 123
Script:
#!/bin/bash # Description: Verify consistent usage of curly brace placeholders in help text. # Test: Search for the placeholder usage. Expect: Only occurrences of the new format `{placeholder}`. rg --type php -A 5 '\{post_title\}'Length of output: 8594
197-204
: Ensure consistent placeholder usage in email content.The placeholders in the email content have been updated to use curly braces. Ensure that this new format is used consistently throughout the codebase.
Run the following script to verify the consistent usage of the curly brace placeholders:
Verification successful
Consistent Placeholder Usage Verified
The curly brace placeholder format
{placeholder}
is used consistently throughout the codebase in email content and related functionality. No inconsistencies were found.
- Files such as
wpuf-functions.php
,includes/upgrades/upgrade-4.0.11.php
,includes/Admin/Forms/Post/Templates/Post_Form_Template_Post.php
, and others consistently use the{placeholder}
format.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistent usage of curly brace placeholders in email content. # Test: Search for the placeholder usage. Expect: Only occurrences of the new format `{placeholder}`. rg --type php -A 5 $'{post_title}'Length of output: 123
Script:
#!/bin/bash # Description: Verify consistent usage of curly brace placeholders in email content. # Test: Search for the placeholder usage. Expect: Only occurrences of the new format `{placeholder}`. rg --type php -A 5 '\{[a-zA-Z_]+\}'Length of output: 20846
includes/Ajax/Frontend_Form_Ajax.php (1)
627-638
: Ensure consistent placeholder usage in mail body preparation.The placeholders in the mail body preparation have been updated to use curly braces. Ensure that this new format is used consistently throughout the codebase.
Run the following script to verify the consistent usage of the curly brace placeholders in mail body preparation:
Verification successful
Consistent Placeholder Usage Verified
The placeholders in the mail body preparation are consistently using the curly brace format
{placeholder}
throughout the codebase. No inconsistencies were found.
- Verified usage in files such as
wpuf-functions.php
,includes/upgrades/upgrade-4.0.11.php
,includes/Free/Form_Element.php
, and various template files.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistent usage of curly brace placeholders in mail body preparation. # Test: Search for the placeholder usage. Expect: Only occurrences of the new format `{placeholder}`. rg --type php -A 5 $'{post_title}'Length of output: 123
Script:
#!/bin/bash # Description: Verify consistent usage of curly brace placeholders in mail body preparation. # Test: Search for the placeholder usage. Expect: Only occurrences of the new format `{placeholder}`. rg --type php -A 5 '\{post_title\}'Length of output: 8594
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- includes/Admin/Forms/Post/Templates/Post_Form_Template_Events_Calendar.php (2 hunks)
- includes/Admin/Forms/Post/Templates/Post_Form_Template_Post.php (2 hunks)
- includes/Admin/Forms/Post/Templates/Post_Form_Template_WooCommerce.php (2 hunks)
- includes/Free/Form_Element.php (2 hunks)
- includes/upgrades/upgrade-4.0.11.php (1 hunks)
Files skipped from review due to trivial changes (3)
- includes/Admin/Forms/Post/Templates/Post_Form_Template_Events_Calendar.php
- includes/Admin/Forms/Post/Templates/Post_Form_Template_Post.php
- includes/Free/Form_Element.php
Files skipped from review as they are similar to previous changes (2)
- includes/Admin/Forms/Post/Templates/Post_Form_Template_WooCommerce.php
- includes/upgrades/upgrade-4.0.11.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- includes/Ajax/Frontend_Form_Ajax.php (2 hunks)
- wpuf.php (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- includes/Ajax/Frontend_Form_Ajax.php
- wpuf.php
Description: In WP Dashboard > WPUF > Registration Form > Settings > Notification, the help text format are inconsistent. Some uses {placeholder_text} and some uses %placeholder_texts%
fixes #589
Summary by CodeRabbit
New Features
Bug Fixes
Chores