• Resolved flcc

    (@flcc)


    Some people trying to sign-up are getting error message “invalid email address” when trying to sign-up with their regular email address.

    Have since updated to wordpress 4.8

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author DBAR Productions

    (@dbar-productions)

    My plugin uses the built-in WordPress is_email function to check if the address entered is a valid email. I looked at their code for that function, and the only change that was documented as being new for WP 4.8 was the they now do a check to see if the emails are less than 6 characters, as they have decided that is the minimum length for a valid email.

    The only other reason would be invalid characters in the email address, or invalid formatting.

    It’s still working just fine on my test site with WP 4.8. And, if you say that the error is only showing up for “some” emails, then there is something in those specific emails that the WordPress is_email function doesn’t like.

    These pages show details on the function I used to validate the emails:
    https://developer.www.ads-software.com/reference/functions/is_email/
    https://codex.www.ads-software.com/Function_Reference/is_email

    If it’s not a user error, and your users seem to have emails that are always shown as invalid, all you can do at this point is comment out (or delete) the lines in my code that checks if it’s a valid email. Currently those are lines 204 – 208 in the class-pta_sus_public.php file. They look like this:

    
                elseif ( !is_email( trim($_POST['signup_email']) ) )
                    {
                        $this->err++;
                        $this->errors .= '<p class="pta-sus error">'.apply_filters( 'pta_sus_public_output', __('Invalid Email!  Please try again.', 'pta_volunteer_sus'), 'email_error_message' ).'</p>';
                    }
    

    The only other option would be for me to add even more options/settings to allow the skipping of validation for the form fields (if you trust your users – even though the data would still be sanitized before saved in the database).

    Plugin Author DBAR Productions

    (@dbar-productions)

    Also, note that if you check out the is_email function in the WordPress codex, you will see that it has a bunch of filter hooks that you could tap into with code snippets to override any of the individual email tests it does, or even at the final value. So you could create a really simple snippet of code for your child theme’s functions.php file to tap into that final filter hook and to always return a value of true. Then you wouldn’t have to modify my plugin’s code directly.

    Thread Starter flcc

    (@flcc)

    What you say makes perfect sense. I’m going to get her to bring her laptop and watch her put in her email before I chase this any further. Thanks for your reply.
    J

    Plugin Author DBAR Productions

    (@dbar-productions)

    Marking this as resolved for now. Not really anything I could do with my plugin other than making an option to disable validation on the form before it is processed.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘“invalid email address”’ is closed to new replies.