Support » Plugin: Ban Hammer » Can I block specific partial? (I've read the FAQ)

  • Resolved Mayeenul Islam

    (@wzislam)


    I’ve checked that I can save partials like .pl, but I know this will block some.pl@email.com.

    That’s why I’m asking, is it possible blocking with a pattern like this:
    @*.pl?

    I hope this kind of pattern can block all the domains with any prefixes.

    Suppose I want to stop:

    @katowice.pl
    @nazdrowko.katowice.pl
    @o2.pl

    https://wordpress.org/plugins/ban-hammer/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    No, not at this time. Blocking an entire gTLD seems a bit excessive as well, but the code to do that would be this:

    function wzislam_disable_tld( $user_login, $user_email, $errors ) {
        if ( strpos( $user_email, '.pl' ) != -1 ) {
            $errors->add( 'bad_email_domain', '<strong>ERROR</strong>: This email domain is not allowed.' );
        }
    }
    add_action( 'register_post', 'wzislam_disable_tld', 10, 3 );

    This is asked for often enough that I may have to add it in. I’m leery for it, since it means I’d have to stop using the blacklist like I do (or use something in addition to it) and the elegance of blocking comments and registrations is something I love 🙂

    Hi Mayeenul (and Ipstenu)
    I have noticed that longer partials – could be
    .katowice.pl (without the @ but . instead) exludes any subdomain like

    @nazdrowko.katowice.pl
    @nizdrowko.katowice.pl

    this might be used to ban spammer servers like remailled.com or com-retain.com that uses multiple sub domains for registration:

    @alpine.com-retain.com
    @alpha.com-retain.com
    @apple.com-retain.com
    etc. which I now totally ban in just two lines

    @com-retain.com
    .com-retain.com

    Happy when I found out 🙂

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Yeah that will work. I just caution you because if you put in .com you’ll block a lot of people :/ and the problem with .pl is that’s way too broad spectrum.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can I block specific partial? (I've read the FAQ)’ is closed to new replies.