-
-
Notifications
You must be signed in to change notification settings - Fork 64
And more options for email verification #196
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2433,7 +2433,7 @@ public function save() { | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| // Set trial status if needed | ||||||||||||||||||||||||||||||||
| if ($this->get_status() === Membership_Status::PENDING && $this->is_trialing() && ! $this->get_last_pending_payment()) { | ||||||||||||||||||||||||||||||||
| if ( ! wu_get_setting('enable_email_verification', true) || $this->get_customer()->get_email_verification() !== 'pending') { | ||||||||||||||||||||||||||||||||
| if ($this->get_customer()->get_email_verification() !== 'pending') { | ||||||||||||||||||||||||||||||||
| $this->set_status(Membership_Status::TRIALING); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
Comment on lines
2435
to
2439
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainNull-guard customer before checking email verification; keep gating consistent with tri‑state logic
Apply this minimal guard: - if ($this->get_customer()->get_email_verification() !== 'pending') {
- $this->set_status(Membership_Status::TRIALING);
- }
+ $customer = $this->get_customer();
+ if ($customer && $customer->get_email_verification() !== 'pending') {
+ $this->set_status(Membership_Status::TRIALING);
+ }Follow‑up:
🏁 Script executed: #!/bin/bash
# Locate get_customer() in the Membership model to inspect its return type and docblock
grep -R -nC3 "function get_customer" inc/models/class-membership.php
# Check where get_email_verification() is defined/used in the Membership class
grep -R -nC3 "get_email_verification" -n inc/models/class-membership.php
# Search for any centralized helper around email-verification logic
grep -R -nC3 "verification" inc/modelsLength of output: 8337 🏁 Script executed: #!/bin/bash
# Find definition of wu_get_customer to inspect its return behavior
grep -R "function wu_get_customer" -n .
# Find all references and where it's defined
grep -R "wu_get_customer(" -n .Length of output: 3552 🏁 Script executed: #!/bin/bash
# Print the wu_get_customer implementation to determine return behavior (can it return null/false?)
sed -n '1,80p' inc/functions/customer.phpLength of output: 1520 Guard inc/models/class-membership.php
@@ -2436,3 +2436,6 @@ if ($this->get_status() === Membership_Status::PENDING && $this->is_trialing() && ! $this->get_last_pending_payment()) {
- if ($this->get_customer()->get_email_verification() !== 'pending') {
- $this->set_status(Membership_Status::TRIALING);
- }
+ $customer = $this->get_customer();
+ if ($customer && $customer->get_email_verification() !== 'pending') {
+ $this->set_status(Membership_Status::TRIALING);
+ }
}Ensure the signup flow or a shared helper sets and evaluates 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.