Join our new community forum for support & discussion

Join Now

Home Support General HivePress No-Bot Registration

No-Bot Registration

  • Author
    Posts
  • LINKOZ.RU

    Hello dear developer :). Please tell me how you can make these plugins: (No-Bot Registration or Email Registration Blacklist | Domain Blacklist and Whitelist Plugin) work with pop-up registration forms on the site?

    Or maybe you have a special code for this, which can be inserted into a child theme!

    ihor developer

    Yes, it may be easier with a code snippet, do you mean just blocking some specific email domains from logging in and registration?

    LINKOZ.RU

    Yes, that’s right! 🙂 Can you tell me how this can be done?

    LINKOZ.RU

    I want to ban certain domains from registering in the system. And allow for example: gmail.com , yandex.ru etc. In fact, we do not need a blacklist, but only a White one, in order to make it possible to register only with addresses from the white list.

    LINKOZ.RU

    With one Whitelist, everything will be easier! 😉 Since you can specify the domains that are needed (allowed). And all those domains that are not on the White list, let them be blocked and are not allowed to register in the system.

    ihor developer

    You can try this snippet:

    add_filter(
    	'hivepress/v1/forms/user_register/errors',
    	function( $errors, $form ) {
    		$email = $form->get_value( 'email' );
    
    		if ( $email && ! in_array(
    			hp\get_last_array_value( explode( '@', $email ) ),
    			[
    				'gmail.com',
    				'yahoo.com',
    			],
    			true
    		) ) {
    			$errors[] = 'error text here';
    		}
    
    		return $errors;
    	}
    );

    Please note that it’s not tested.

    LINKOZ.RU

    After inserting this code, when you try to register with any domain name, a notification pops up: Please check your email to activate your account. The notification shows that the registration has passed, but in fact it is not. Because the user was not added to the site.

    This code does not allow registration even with Emails that are in the white list:(

    ihor developer

    You can try this one instead:

    add_filter(
    	'hivepress/v1/forms/user_register/errors',
    	function( $errors, $form ) {
    		$email = $form->get_value( 'email' );
    
    		if ( $email && ! in_array(
    			hivepress()->helper->get_last_array_value( explode( '@', $email ) ),
    			[
    				'gmail.com',
    				'yahoo.com',
    			],
    			true
    		) ) {
    			$errors[] = 'error text here';
    		}
    
    		return $errors;
    	}
    );

    Please consider hiring someone for custom work if your website requires customizations, or you can try some third-party plugins if they implement the required options.

    LINKOZ.RU

    This code doesn’t work either. 🙁

    The thing is that third-party plugins refuse to work with your pop-up forms.

    Okay, thanks for that, too.

    LINKOZ.RU

    После долгих поисков нашел отличный плагин который решает все эти проблемы. Теперь все работает как надо. 😉

    LINKOZ.RU

    After a long search, I found a great plugin that solves all these problems. Now everything works as it should. 😉

    ihor developer

    Thanks for sharing! If possible post a link to this plugin in case if someone has the same issue.

    LINKOZ.RU

    Here is a link to a plugin that solves the problem of registering bots and one-time Email addresses. – Antideo Email Validator

Viewing 13 posts - 1 through 13 (of 13 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.