-
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
fix: admin notification after guest email verified #1320
fix: admin notification after guest email verified #1320
Conversation
Issue-2: Scenario: |
…cation_after_guest_email_verified
…cation_after_guest_email_verified
WalkthroughThe pull request introduces several modifications across multiple classes. It adds the Changes
Possibly related PRs
Poem
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 using PR comments)
Other keywords and placeholders
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: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- includes/Admin/Forms/Form.php (1 hunks)
- includes/Ajax/Frontend_Form_Ajax.php (2 hunks)
- includes/Frontend/Frontend_Form.php (3 hunks)
Additional comments not posted (4)
includes/Frontend/Frontend_Form.php (2)
332-377
: LGTM!The changes in the
publish_guest_post
function look good:
- It correctly verifies the email before proceeding.
- Handles the payment flow as expected.
- Triggers an action hook for extensibility after successful email verification.
494-531
: LGTM!The new
send_mail_to_admin_after_guest_mail_verified
function looks good:
- It is correctly hooked to the
wpuf_guest_post_email_verified
action.- Retrieves necessary data and loads form settings and fields.
- Prevents sending duplicate notifications by checking email verification status.
- Prepares the email content using the
prepare_mail_body
helper function.- Updates user meta to mark the email as verified.
includes/Ajax/Frontend_Form_Ajax.php (2)
23-27
: LGTM!The new
$form_fields
property is a useful addition to theFrontend_Form_Ajax
class. It will help manage form data more effectively.
163-167
: Good catch on using strict comparisons!Switching from loose equality (
==
) to strict equality (===
) is a best practice. It improves the reliability of the conditional checks by ensuring that both the value and type are considered.
Issue not solved. Not getting Post notification emails for guest post. Ref Video: link |
…cation_after_guest_email_verified
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.
@@ -21,7 +21,7 @@ | |||
/** | |||
* @var array|\WP_Post|null | |||
*/ | |||
private $data; | |||
public $data; |
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.
Revert the visibility change of the $data
property.
I strongly agree with the previous review comment. Changing the visibility of the $data
property from private
to public
violates the principle of encapsulation and can lead to several issues:
- It allows uncontrolled access and modification of the
$data
property from outside the class. - This can result in unexpected behavior and make the code harder to maintain and reason about.
- It increases the risk of introducing bugs or security vulnerabilities.
- It goes against best practices in object-oriented design.
Unless there is a compelling and well-documented reason for this change, it is strongly recommended to revert the visibility of the $data
property back to private
.
Apply this diff to revert the change:
- public $data;
+ private $data;
If there is a specific need to access this property from outside the class, consider implementing getter and setter methods instead of making the property public. This would allow for controlled access and potential validation of the data.
📝 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.
public $data; | |
private $data; |
fix 494
Description: When an unregistered user proceeds to submit a guest post filling in name, email, and guest post fields, etc. when submit button is clicked confirmation email is sent for confirming the account. Then:
The confirmation email comes to the admin inbox but the post that was submitted along with the registration doesn't come.
How to reproduce:
Go to WPUF>Post Form>Cretae form>Settings>Submission Restriction> Check Enable Guest Post, Require Name and Email address, and Require Email Verification for Guests
Got to the page where the above post form is enabled> Fill the form with name, email, and necessary fields> Click Create post button
Summary by CodeRabbit
New Features
Bug Fixes
Refactor