r/WordpressPlugins • u/Dunzan • 2d ago
Help [HELP] How can I test this domain blocking plugin?
I installed the plugin Restrict Usernames Emails Characters V 5.1 because a few hours ago I received a flurry of new user registrations all from @ DomainToBeBlocked.
I made two minor configuration updates. Then to activate, it forced me to check "Anyone Can Register" in Settings/General. It was previously unchecked, which is one reason the underlying situation is odd.
The second reason is there is nowhere on my site where a new user can simply register. New users are added only by making a purchase.
And a third reason is my site traffic does not show any pages were visited as many times as the number of new users created.
So I don't see how or where the registrations were created, and I don't see how I can proactively try to create a new user with their domain as a test of the plugin.
The registrations have stopped since I activated the plugin so maybe that's the best test of all. But I would still like to determine how and where the new users were generated so I can address that vulnerability. Thanks for your input.
1
u/Dunzan 1d ago
Hey u/TopSydeWP and u/thomas-at-caseproof thanks to you both. Testing the plugin on the default register page showed it did work there, but I woke up to a handful more registrations from the domain I want to block. So I unticked Anyone Can Register, removed the plugin, and deleted the latest new users. None of them had made any purchases.
Turning to the Woo Accounts & Privacy settings, I see "Enable guest checkout (recommended)" was the only box ticked. I just unticked it. I've added a tick to "Enable log-in during checkout." I've left the two boxes under "Account creation" unticked, and the two boxes under "Account creation options" are both unticked plus greyed out. Is all that OK?
u/TopSydeWP said to "put Cloudflare Turnstile on registration and checkout" while u/thomas-at-caseproof provided what I think is a PHP snippet, yes? Should I be considering implementing either/or or both/and? Thanks.
1
u/TopSydeWP 2d ago
We'd uncheck Anyone Can Register again, even if that plugin stops working, because with it on, wp-login.php?action=register takes signups from anyone. Bots post straight to forms without loading pages, so your analytics never counted them. On WooCommerce, check Settings > Accounts & Privacy for account creation on the account page, and put Cloudflare Turnstile on registration and checkout. We're TopSyde, a managed WordPress host, and we see these bursts of bot accounts on WooCommerce stores we look after too.
1
u/thomas-at-caseproof 2d ago
I'd bet on WooCommerce for the batch too. Anyone Can Register only governs core's form at wp-login.php. Woo's My Account registration form and account creation at checkout run on their own settings, so accounts can keep appearing with that box unchecked.
To find the actual door, sort Users by registration date and see whether any of the new accounts placed an order. Then search the raw server access log (not analytics, since bots don't bother running JavaScript) around those timestamps for POSTs to /my-account/ or ?wc-ajax=checkout. No orders attached usually means the My Account form, and if you don't need it, untick "Allow customers to create an account on the My account page" under WooCommerce > Settings > Accounts & Privacy.
When you test the blocker, try the blocked domain on that Woo form in a private window, not only on wp-login.php. A plugin that hooks core registration may never see Woo's.
I also wouldn't leave Anyone Can Register on just to keep one plugin happy, since it reopens wp-login.php?action=register as a second door. A few lines on Woo's own registration filter block the domain with the setting off (PHP 8+):
1
u/DavidMunozCabrisas 1d ago
el caso perfecto para probar Draco Insomnis – WordPress plugin | WordPress.org
1
u/WP_Dev_Studio 1d ago
The plugin forcing "Anyone can register" on is normal, since it hooks into the registration process. That doesn't mean a public form exists on your site, though. A few places registrations can come from:
• WooCommerce. Check WooCommerce > Settings > Accounts & Privacy. If "Allow customers to create an account on the checkout / My Account page" is on, bots can create accounts that way.
• Direct endpoints. wp-login.php?action=register and the REST API can accept signups even if no page links to them.
• Bots don't show up in analytics. Tools like GA only count visitors who run JavaScript. Check your raw server access logs for POST requests to those endpoints instead.
To test the plugin, open an incognito window, register (or check out) with an email at the blocked domain, and see if it's rejected. Since the spam stopped after you activated it, it's probably working. I'd also add a CAPTCHA and a security plugin like Wordfence to close the hole itself.