
By Samuel Torres — Software & Cloud Engineer. 23+ production sites.
Card testing is when a bot uses your WooCommerce checkout to try stolen cards one after another, and Black Friday (Friday, November 27) is when it has the most traffic to hide in. I run 23+ production WordPress sites on AlmaLinux + WHM/cPanel; this guide is what I would check and switch on in a store before that date: logs, failed orders, a per-IP limit on declined payments and a staging test.
This article is designed for owners and administrators of enterprise-level WooCommerce stores in Mexico. We will explore how to identify card testing attacks in your logs and failed orders, how to implement a payment attempt limit per IP, and how to test the protection before Black Friday. It also covers captcha, coupons and account creation, the other doors bots use on the same dates.
What is card testing and why it spikes during Black Friday
Card testing is a tactic that cybercriminals use to validate stolen credit cards. During Black Friday, bots attempt to make payments with stolen cards on online stores to verify if they work. If the payment is declined, the card is marked as invalid; if it's approved, the card is considered valid and can be used for further fraudulent purchases.
In your WooCommerce store, this issue manifests through an increase in failed orders and POST requests to the checkout. These bursts of payment attempts can overload your server and affect your site's performance, as well as expose you to fraud. It's important to be prepared to identify and mitigate these attacks, as they can impact your business and customers' trust.
This is not an off-season theoretical risk. Netsa's ecommerce security checklist for Black Friday lists three abuses that show up during discount campaigns: bots testing stolen cards at checkout, bots trying to break into accounts, and coupon abuse. And fraud around the season is industrial: Revista Ciberseguridad, citing the Norton Insights Report 2026, reports that Gen's systems blocked more than 526,000 fake-store domains before the season. The dates that matter this year: Black Friday on Friday, November 27, and Cyber Monday on Monday, November 30.
How It Appears in Your Logs: Bursts of POST Requests to Checkout
Bots that test stolen cards on your WooCommerce store leave traces in your server logs. These bots attempt to make fraudulent payments in bursts, which can overwhelm your systems and affect the experience of your legitimate customers. In your access logs, you will see a pattern of multiple POST requests to the checkout endpoint, where payments are processed. This pattern may be evident if the same IP address makes multiple failed payment attempts within a short period.
To detect this behavior, you can review the logs of your cPanel account. Here is a script that will help you identify IPs with more POST requests to the checkout and detect bursts of payment attempts:
#!/bin/bash
# IPs with more POST requests to checkout in the cPanel account log
LOG=/home/usuario/access-logs/tutienda.mx-ssl_log
# Total of POST requests to checkout per IP
grep -E '"POST /(\?wc-ajax=checkout|checkout/)' "$LOG" \
| awk '{print $1}' | sort | uniq -c | sort -nr | head -10
# Bursts: same IP, same minute
grep -E '"POST /(\?wc-ajax=checkout|checkout/)' "$LOG" \
| awk '{print $1, substr($4,2,17)}' | sort | uniq -c | sort -nr | head -10
This script first searches for all POST entries to the checkout endpoint in your log. It then counts how many times each IP has attempted to make a payment and displays the top 10 IPs with the most attempts. It also identifies bursts of payment attempts, i.e., multiple attempts from the same IP in the same minute.
⚠️ Before applying in production: take a backup and test the rollback.
If you find suspicious IPs, you can take additional steps to protect your store, such as limiting payment attempts per IP, which I will explain in a later section. Remember that identifying these patterns is only the first step to protect yourself against fraud during Black Friday. An IP with dozens of checkout POSTs in the same minute is not an undecided customer: no human fills in the payment form that many times in a row.
Failed Orders in Series: The Signal Within WooCommerce
Bots that test stolen cards in your WooCommerce store leave a clear trail: a series of failed orders that do not complete and are registered as failed in your system. These failed orders can be an indicator of suspicious activity, especially if you observe multiple payment attempts from the same IP address.
To identify these failed orders and detect bursts of payment attempts from the same IP, you can use the command line on your server. Here is a script that allows you to list failed orders from the start of the day, along with the customer's IP address and the payment method used. The second part counts failures per IP. It uses the WooCommerce API, so it works the same with or without HPOS.
⚠️ Before applying it in production: take a backup and test the rollback.
# Failed orders from the start of the day, with the customer's IP address
cd /home/usuario/public_html
wp wc shop_order list --user=1 --status=failed \
--after="$(date +%Y-%m-%dT00:00:00)" \
--fields=id,date_created,customer_ip_address,payment_method \
--format=table
# How many failures per IP
wp wc shop_order list --user=1 --status=failed --per_page=100 \
--field=customer_ip_address | sort | uniq -c | sort -nr
This script provides you with a clear view of the failed orders and helps you identify bursts of payment attempts from the same IP. If you notice a significant number of failed orders from the same IP, it is possible that you are being attacked by bots attempting to process stolen cards. Early detection of these patterns can help you take preventive measures and mitigate the impact of fraud on your store.
In addition to reviewing failed orders, it is important to review your store's configuration to ensure you are protected against this type of attack. For example, you can consider implementing a mu-plugin that limits failed payment attempts per IP, as explained in the next section. It is also recommended to review your payment gateway configuration to ensure you are using all available fraud protection tools.
Payment Attempt Limit by IP with a mu-plugin
When bots test stolen cards on your WooCommerce store, one of the most evident issues is the increase in failed payment attempts. These attempts not only overload your system but also generate a high volume of failed orders that you need to review manually. To mitigate this, you can implement a payment attempt limit by IP using a mu-plugin. This method allows you to limit the number of failed attempts from the same IP, which can help reduce the load from bots.
The mu-plugin I propose counts the number of failed payments by IP and blocks the checkout from that IP for an hour after reaching 5 failed attempts. This approach is effective because it limits bots' ability to send multiple requests from the same IP without affecting legitimate users who are not making failed payments.
Here is the code for the mu-plugin you can use:
<?php
// wp-content/mu-plugins/payment-limit-ip.php
add_action('woocommerce_order_status_failed', function ($order_id) {
$order = wc_get_order($order_id);
$ip = $order ? $order->get_customer_ip_address() : '';
if (!$ip) return;
$key = 'fallos_pago_' . md5($ip);
set_transient($key, (int) get_transient($key) + 1, HOUR_IN_SECONDS);
});
add_action('woocommerce_checkout_process', function () {
$key = 'fallos_pago_' . md5(WC_Geolocation::get_ip_address());
if ((int) get_transient($key) >= 5) {
wc_add_notice('Too many declined payments. Try again in one hour.', 'error');
}
});
This code counts orders that move to the "failed" status and increments a per-IP counter stored in a transient. It does not call exit: wc_add_notice with the error type is enough for WooCommerce to stop the checkout and show the notice. If the gateway rejects a payment without creating a failed order, the counter does not increase, so it's important to also enable fraud protection on your payment gateway.
⚠️ Before applying it in production: make a backup and test the rollback.
To deactivate this mu-plugin, simply delete the payment-limit-ip.php file from the wp-content/mu-plugins directory. Remember that it's a good practice to apply such changes incrementally, first on a staging site and then in production, following the principle I've applied in migrations like the one for 61 domains to PHP 8.3, one by one, with automatic backup and rollback. This ensures that the change is implemented safely and that you have a way to revert if something goes wrong.
This mu-plugin is an additional security measure that can help protect your WooCommerce store during Black Friday and Cyber Monday, when traffic and fraudulent activities tend to increase. It is not a complete fix: a bot that rotates its IP on every attempt never reaches 5 failures per IP, which is why the gateway's fraud protection is still needed.
Captcha, Coupons, and Accounts: The Other Gates
When it comes to protecting your WooCommerce store, captcha, coupons, and account management are three areas you can't afford to overlook. In normal situations, these elements might seem excessive, but during events like Black Friday, additional security can make the difference between a successful operation and one flooded with fraud.
Captcha: Selective Protection
Captcha can be an effective barrier against bots, but it's not a universal solution. Putting it on every page punishes real buyers on the day they buy the most. My recommendation is to use captcha only at critical points: registration, login, and checkout, especially when you detect bursts of suspicious activity.
To see whether someone is creating accounts in bulk, count customer sign-ups per day; a sharp jump before Black Friday is the signal to turn on captcha at registration:
# New customer accounts per day (last 7 days with sign-ups)
cd /home/usuario/public_html
wp user list --role=customer --field=user_registered \
| cut -c1-10 | sort | uniq -c | tail -7
⚠️ Before applying it in production: make a backup and test the rollback.
Coupons: Restrictions and Expiry
Coupons are an excellent tool to incentivize sales, but they can also be a vector for fraud if not managed properly. A coupon with no limits gets shared on forums and redeemed by bot-created accounts. To avoid this, make sure each coupon has a usage limit per user and an expiry date. This can be configured in the "Restrictions/Usage Limits" tab of the coupon in WooCommerce.
Accounts: Disable Creation at Checkout
Creating accounts at checkout can be convenient for customers, but it can also facilitate fraud. If you don't need customers to create accounts during the purchase process, disable this option. This reduces the attack surface and makes it harder for bots to create fake accounts.
In summary, these measures may seem small, but together they form a solid barrier against fraud. Remember that security is an ongoing process, and every small step counts.
Test Everything Before November 27
To ensure everything works correctly, it's essential to test the changes in a staging environment before implementing them in production. This will allow you to identify and correct any issues without affecting the operation of your live store. Here’s a list of steps to test the mu-plugin that limits payment attempts by IP and how to verify that it works correctly.
- Upload the mu-plugin to staging: Ensure you have a staging environment set up with the same version of WooCommerce and the same configurations as your live store. Upload the
payment-limit-ip.phpfile to thewp-content/mu-pluginsdirectory in your staging environment.
- Force rejected payments: Use the test rejection card provided by your payment gateway to force 5 consecutive failed payment attempts. This simulates bot activity trying to test stolen cards.
- Verify the lockout notice: Attempt a sixth payment with the test rejection card. You should see an error message indicating that there are too many rejected payments and that you should try again in an hour.
- Clear the counter: to test again, run
wp transient delete --allon staging. It deletes every transient, including the per-IP counter; don't run it in production in the middle of Black Friday.
- Verify that payment works again: After deleting the transient, attempt a payment with a test approved card to ensure the payment process works correctly.
⚠️ Before applying it to production: take a backup and test the rollback.
The real case
I'll be straight: I don't have a documented card-testing case on the sites I run, and I'm not going to make one up. What I do have is the method I would use to roll this out, because I've already used it at scale.
I run 23+ production WordPress sites on AlmaLinux + WHM/cPanel, and I migrated 61 domains to PHP 8.3 one at a time, with automatic backup and rollback. The principle is the same one I recommend for the mu-plugin: one change at a time, on one site, with a tested way back. If you manage several stores, deploy it to one first, run the staging test from the previous section, check the failed orders the next day, and only then roll it out to the rest. If anything breaks, deleting payment-limit-ip.php switches it off instantly.
[FALTA CAPTURA: the mu-plugin in staging's wp-content/mu-plugins and the lockout notice at checkout after 5 declined payments]
What I Wouldn't Do
I wouldn't implement a captcha across the entire site during Black Friday. At the peak of sales, every second counts for customers to complete their purchases. A captcha on every page can be an unnecessary barrier that may deter legitimate buyers. Instead, I recommend using the captcha only at critical points such as registration, login, and checkout, especially when you detect bursts of failed payment attempts. This will allow you to maintain security without impacting the purchasing experience of your legitimate customers.
I also wouldn't block entire countries without a detailed review of sales. This approach can be too aggressive and result in losing legitimate customers. Instead, I suggest reviewing failed orders and IPs with suspicious activity. If you identify fraud patterns from certain countries, then you can consider more specific measures for those cases, but always with caution to not affect genuine customers.
Nor would I enable the mu-plugin on every store at once. One first, then the rest.
Let's Review It Together
If after reviewing these steps you still feel unsure about how to protect your WooCommerce store from card testing bots during Black Friday, a security audit may be the best option. As part of the audit, I will evaluate your site's configuration, test the effectiveness of the implemented measures, and provide you with personalized recommendations to keep your store secure. Don't leave anything to chance; schedule a security audit for your WooCommerce store before Black Friday at contact and ensure everything is in order by following the WordPress Security Audit Checklist.
About the author
Samuel Torres is a Software & Cloud Engineer at Conqr Digital Agency (Mexico City). He runs 23+ production WordPress sites and processed 80,000 documents with OCR + LLM. More at /en/about. Get a quote on WhatsApp in 2 min


