Skip to content
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: make the email check case-insensitive #4025

Closed
4 of 6 tasks
Benunc opened this issue Feb 28, 2019 · 1 comment
Closed
4 of 6 tasks

fix: make the email check case-insensitive #4025

Benunc opened this issue Feb 28, 2019 · 1 comment
Assignees

Comments

@Benunc
Copy link
Member

Benunc commented Feb 28, 2019

Bug Report

User Story

As a donor, I want to be able to donate with mail@example.com and MAIL@example.COM and have them associated with the same donor/user.

Current Behavior

Currently if a donor is logged into an account with the email registered as mail@example.com and attempts a donation as MAIL@example.com they get this error:

Error: You are logged in as mail@example.com, and are submitting a donation as MAIL@example.com, which is an existing donor. To ensure that the email address is tied to the correct donor, please submit this donation from a logged-out browser, or choose another email address.

screen shot 2019-02-28 at 1 46 28 pm

Expected Behavior

I expect email addresses to be case insensitive.

Bug Type

  • This bug describes functionality that once worked as expected in version X.X.X.
  • This bug describes functionality that never worked as expected.
  • I am not sure whether this functionality ever worked as expected.

Steps to Reproduce

  1. Make a wordpress user mail@example.com and create donations with that user.
  2. While logged in as that user, make a new donation as MAIL@example.com
  3. You'll get an error.

Related

https://wordpress.org/support/topic/existing-donor/#post-11260369

Acceptance Criteria

  • When a new donor is created (Kevin@example.com), we store the email address in the exact case in which it was entered by the user.
  • When the same donor makes a donation with email, we perform a case-insensitive match when validating the email. This means that the entered email kevin@example.com should be considered valid if the stored email is Kevin@example.com. If matched, then the stored email is used for the donation and it is allowed to proceed.
  • There should be no possibility in which a donor has two emails stored that are the same except for case. This means the same donor should never have both Kevin@example.com and kevin@example.com in their donor profile.

Environment

WordPress System Info ### WordPress Environment ###

Home URL: https://livegive.wpsteward.com
Site URL: https://livegive.wpsteward.com
WP Version: 5.1
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: ✔
WP Cron: ✔
Language: en_US
Permalink Structure: /%year%/%monthnum%/%day%/%postname%/
Show on Front: posts
Table Prefix Length: wp_8138bfdc07_
Table Prefix Length: 14
Table Prefix Status: Acceptable
Admin AJAX: Accessible
Registered Post Statuses: publish, future, draft, pending, private, trash, auto-draft, inherit, request-pending, request-confirmed, request-failed, request-completed, refunded, failed, revoked, cancelled, abandoned, processing, preapproval, give_subscription

Server Environment

Hosting Provider: DBH: localhost, SRV: livegive.wpsteward.com
TLS Connection: Connection uses TLS 1.2
TLS Connection: Probably Okay
Server Info: Apache/2.4.38 (Unix) OpenSSL/1.0.1f
PHP Version: 7.3.2
PHP Post Max Size: 1 GB
PHP Time Limit: 30
PHP Max Input Vars: 5000
PHP Max Upload Size: 512 MB
cURL Version: ❌ 7.35.0, OpenSSL/1.0.1f - We recommend a minimum cURL version of 7.40.
SUHOSIN Installed: –
MySQL Version: ❌ 5.5.62 - We recommend a minimum MySQL version of 5.6. See: WordPress Requirements
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
gzip: ✔
GD Graphics Library: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Give Configuration

Give Version: 2.4.1
Give Cache: Enabled
Database Updates: All DB Updates Completed.
Database Tables: ✔ wp_8138bfdc07_give_donors - 1.0✔ wp_8138bfdc07_give_donormeta - 1.0✔ wp_8138bfdc07_give_comments - 1.0✔ wp_8138bfdc07_give_commentmeta - 1.0✔ wp_8138bfdc07_give_sessions - 1.0✔ wp_8138bfdc07_give_logs - 1.0✔ wp_8138bfdc07_give_logmeta - 1.0✔ wp_8138bfdc07_give_formmeta - 1.0✔ wp_8138bfdc07_give_sequential_ordering - 1.0✔ wp_8138bfdc07_give_donationmeta - 1.0
Give Cache: Enabled
Give Cache: ✔New Donation❌Donation Receipt❌New Offline Donation❌Offline Donation Instructions❌New User Registration❌User Registration Information❌Donor Note✔Email access❌Renewal Receipt Email❌Renewal Receipt Email❌Subscription Cancelled Email❌Subscription Cancelled Email❌Subscription Completed Email✔Subscription Reminder Email✔Subscriptions Email Access
Upgraded From: 2.4.0
Test Mode: Enabled
Currency Code: USD
Currency Position: Before
Decimal Separator: .
Thousands Separator: ,
Success Page: https://livegive.wpsteward.com/donation-confirmation/
Failure Page: –
Donation History Page: https://livegive.wpsteward.com/donation-history/
Give Forms Slug: /donations/
Enabled Payment Gateways: Test Donation, Stripe - Credit Card, PayPal Payments Pro, Stripe + Plaid, PayPal Standard, Authorize.net, Authorize.net eCheck (ACH), Mollie Gateway
Default Payment Gateway: Stripe - Credit Card
PayPal IPN Verification: Disabled
PayPal IPN Notifications: IPN received for #1626 ( 7G231521RB710244C ) on 12/28/2018 at 19:40. Status N/A
Donor Email Access: Enabled

Active Give Add-ons

Give - Authorize.net Gateway: ❌ Unlicensed – by GiveWP – 1.4.5
Give - Currency Switcher: ❌ Unlicensed – by GiveWP – 1.3.1
Give - Fee Recovery: ❌ Unlicensed – by GiveWP – 1.7.4
Give - Form Field Manager: ❌ Unlicensed – by GiveWP – 1.4.1
Give - Google Analytics Donation Tracking: ❌ Unlicensed – by GiveWP – 1.2.2
Give - MailChimp: ❌ Unlicensed – by GiveWP – 1.4.3
Give - Manual Donations: ❌ Unlicensed – by GiveWP – 1.4.3
Give - Mollie Gateway: ❌ Unlicensed – by GiveWP – 1.2.1
Give - PayPal Pro Gateway: ❌ Unlicensed – by GiveWP – 1.2.1
Give - PDF Receipts: ❌ Unlicensed – by GiveWP – 2.3.3
Give - Recurring Donations: ❌ Unlicensed – by GiveWP – 1.8.7
Give - Stripe Gateway: ❌ Unlicensed – by GiveWP – 2.1.4
Give - Tributes: ❌ Unlicensed – by GiveWP – 1.5.2
Give - Zapier: ✔ Licensed – by WordImpress – 1.2.1

Other Active Plugins

Ben's Helper Functions: by BenUNC –
Better Click To Tweet: by Ben Meredith – 5.8.0
Better Click To Tweet UTM Tags: by Ben Meredith – 1.0.0
Disable Gutenberg: by Jeff Starr – 1.6
Google Analytics for WordPress by MonsterInsights: by MonsterInsights – 7.4.2
Shortcode in Menus: by Gagan Deep Singh – 3.5
User Switching: by John Blackbourn & contributors – 1.4.2
WP Crontrol: by John Blackbourn & contributors – 1.6.2

Inactive Plugins

Email Cop: by Ashfame – 0.1.1
Give - AmeriCloud Payments: by AmeriCloud Solutions, Inc. – 1.3.1
Give - Database HealthCheck: by WordImpress – 0.0.2
Give - Email Reports: by WordImpress – 1.1.2
Give - Recurring Donations: by GiveWP – 1.8.5
Hello Dolly: by Matt Mullenweg – 1.6
Loco Translate: by Tim Whitlock – 2.2.0
Query Monitor: by John Blackbourn – 3.3.1
WordPress Event Ticketing: by Tickera.com – 3.3.2

Active MU Plugins

api-hacks.php: by –
per-form-currency.php: by –

Theme

Name: Twenty Seventeen
Version: 2.1
Author URL: https://wordpress.org/
Child Theme: No – If you're modifying Give on a parent theme you didn't build personally, then we recommend using a child theme. See: How to Create a Child Theme

@kevinwhoffman
Copy link
Contributor

kevinwhoffman commented Feb 28, 2019

@ravinderk This is the condition that needs updated: https://github.com/impress-org/give/blob/bc08fb851b6b7a856ce6ea0936713a59b64490f6/includes/process-donation.php#L233-L234

Example

  1. I make my first donation with Kevin@example.com. Give should store Kevin@example.com as the donor email in the database. Let's not mess with the case when first saving the email.
  2. I make my second donation with kevin@example.com. This should not throw an error as Ben described above. Instead Give should match the submitted email to the donor email through a case-insensitive comparison.
  3. If a match is found, process the donation using the existing donor email (Kevin@example.com) so as not to add another version of that email (kevin@example.com) to the donor's profile.

Related

From https://webmasters.stackexchange.com/a/34058:

If you are storing email addresses then you probably should store them in their original case (the recipient at least) to be safe. However, always compare them case-insensitively in order to avoid duplicates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants