• Resolved Gystark

    (@gystark)


    EXPLANATION OF THE ISSUE

    After modifying the WC_Validation class to only allow registration (Woocommerce, not stock WordPress) from certain domains, my changes are completely ignored by the stock Woocommerce registration form, ie it allows registration from all email addresses. I am quite sure that my code is ok, the problem is that the class-wp-validation.php/is_email function never gets called. Maybe it is because it is named the same as a core WordPress function.
    The modified function:

    public static function is_email( $email ) {
                    $domainend = substr(strrchr($email, "@"), 1);
                    echo $domainend; //To see if the function gets called.
                    $acceptedends = array('student.gla.ac.uk', 'glasgow.ac.uk')
                    if (in_array($domainend, $acceptedends)) {
    			return is_email( $email );
    	        } else {
                            return false;
                    }
            }

    STEPS TO REPRODUCE THE ISSUE

    Modify the function mentioned above with the code I provided and try to register with any email address with a let’s say gmail.com ending. Apologies if the issue is with my custom code, I’m still learning PHP but even the not working code should have an effect on registration. Link to site in the status report. The Woocommerce registration page is under the My account menu item.

    SYSTEM STATUS REPORT

    ### WordPress Environment ###
    
    Home URL: https://79.172.252.46/~rifehu/unistore-test
    Site URL: https://79.172.252.46/~rifehu/unistore-test
    WC Version: 2.5.5
    Log Directory Writable: ?
    WP Version: 4.4.2
    WP Multisite: –
    WP Memory Limit: 256 MB
    WP Debug Mode: –
    Language: en_GB
    
    ### Server Environment ###
    
    Server Info: Apache
    PHP Version: 7.0.3
    PHP Post Max Size: 8 MB
    PHP Time Limit: 30
    PHP Max Input Vars: 1000
    SUHOSIN Installed: –
    MySQL Version: 5.6.29
    Max Upload Size: 2 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Database ###
    
    WC Database Version: 2.5.5
    :
    woocommerce_sessions: ?
    woocommerce_api_keys: ?
    woocommerce_attribute_taxonomies: ?
    woocommerce_termmeta: ?
    woocommerce_downloadable_product_permissions: ?
    woocommerce_order_items: ?
    woocommerce_order_itemmeta: ?
    woocommerce_tax_rates: ?
    woocommerce_tax_rate_locations: ?
    
    ### Active Plugins (4) ###
    
    Contact Form DB: by Michael Simpson – 2.10.2
    Contact Form 7: by Takayuki Miyoshi – 4.4
    WooCommerce: by WooThemes – 2.5.5
    
    ### Settings ###
    
    Force SSL: –
    Currency: GBP (£)
    Currency Position: left_space
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    
    ### API ###
    
    API Enabled: ?
    API Version: 3.1.0
    
    ### WC Pages ###
    
    Shop Base: #10 - /
    Basket: #11 - /basket/
    Checkout: #12 - /checkout/
    My Account: #13 - /my-account/
    
    ### Taxonomies ###
    
    Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    ### Theme ###
    
    Name: Customizr
    Version: 3.4.19
    Author URL: https://presscustomizr.com/
    Child Theme: ? – If you're modifying WooCommerce on a parent theme you didn't build personally
    then we recommend using a child theme. See: How to create a child theme
    
    WooCommerce Support: ?
    
    ### Templates ###
    
    Overrides: –

    https://www.ads-software.com/plugins/woocommerce/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WC email validation never called?’ is closed to new replies.