Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Addon Admin Tools / Access Blocker Support Thread

Access Blocker Support Thread

Started by lat9 on 2 Mar 2019, 3:14 PM · Views: 53,388

Results 121 to 135 of 135
6 Mar 2026, 6:44 PM
#121
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
741
Plugin Contributions:
0

Access Blocker Support Thread

Is is possible (whether in an upcoming version or just for us individually) to add a MESSAGE to a blocked user to inform them about the block?

Here's why. A lot of legitimate customers may be accessing the ZenCart store from a shared IP (like at University's or other public access points).

Many of these public access points might actually be banned due to malicious activity from other users. But the legit customer using that same network might not be aware of it.

So when a customer is sending us a message through the Contact Us page, the plugin gives the impression that their message was sent (which is by design), but the legit customer will have no idea that we never got it because it was blocked due to their IP.

I am wondering if we can just display a configurable message that says something like, "WARNING - Your message has NOT been delivered due to your network being BLOCKED for prior malicious activity."

Of course, being configurable, a store owner can choose to offer other ways to contact them to communicate, like calling a store phone number or emailing them directly from their email address, etc.

  • Jeff
8 Mar 2026, 1:42 PM
#122
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,137
Plugin Contributions:
56

Re: Access Blocker Support Thread

Jeff_Mash:

Is is possible (whether in an upcoming version or just for us individually) to add a MESSAGE to a blocked user to inform them about the block?

Here's why. A lot of legitimate customers may be accessing the ZenCart store from a shared IP (like at University's or other public access points).

Many of these public access points might actually be banned due to malicious activity from other users. But the legit customer using that same network might not be aware of it.

So when a customer is sending us a message through the Contact Us page, the plugin gives the impression that their message was sent (which is by design), but the legit customer will have no idea that we never got it because it was blocked due to their IP.

I am wondering if we can just display a configurable message that says something like, "WARNING - Your message has NOT been delivered due to your network being BLOCKED for prior malicious activity."

Of course, being configurable, a store owner can choose to offer other ways to contact them to communicate, like calling a store phone number or emailing them directly from their email address, etc.
Good idea. I've created a GitHub issue for tracking the change: https://github.com/lat9/access_blocker/issues/32

31 Mar 2026, 8:49 PM
#123
chadlly2003 avatar

chadlly2003

Totally Zenned

Join Date:
Jan 2015
Posts:
838
Plugin Contributions:
0

Re: Access Blocker Support Thread

I am looking to avoid spam on my forms and found this cool plugin.

I just want to make sure I understand how this module works. And if anyone has any recommendations on the settings.

Based on my settings below it should block all users based on "block by country" setting.
Does the ipData also block Users?

I do see that the ipData is active.

Does anyone have any recommendations on what countries to block?

My settings:

Enable Access Blocker?            True
ipData Service: API Key 		         xxxxxxxxxx
Use ipdata.co EU Endpoint?		 False
Totally restrict access on threats? 	 False
Block by Country:  			         ZW,MK,RU,UA,VN,BG,IR,GA,TR,IN,TH,PK,LY,SY,SD,CN
31 Mar 2026, 10:36 PM
#124
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,137
Plugin Contributions:
56

Re: Access Blocker Support Thread

chadlly2003:

I am looking to avoid spam on my forms and found this cool plugin.

I just want to make sure I understand how this module works. And if anyone has any recommendations on the settings.

Based on my settings below it should block all users based on "block by country" setting.
Does the ipData also block Users?

I do see that the ipData is active.

Does anyone have any recommendations on what countries to block?

My settings:

Enable Access Blocker? True
ipData Service: API Key xxxxxxxxxx
Use ipdata.co EU Endpoint? False
Totally restrict access on threats? False
Block by Country: ZW,MK,RU,UA,VN,BG,IR,GA,TR,IN,TH,PK,LY,SY,SD,CN

I don't understand the highlighted question.  Based on the above settings, any attempt to send a contact-us (or ask-a-question) email or create an account will be blocked from doing so, if their IP address points back to one of those countries.
25 Apr 2026, 2:46 PM
#125
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,137
Plugin Contributions:
56

Re: Access Blocker Support Thread

Access Blocker v2.0.3 is now available for download: [https://www.zen-cart.com/downloads.php?do=file&id=2237

](https://www.zen-cart.com/downloads.php?do=file&id=2237)This release contains changes for these GitHub issues:

#35: curl_close is deprecated in PHP 8.5; not needed for PHP 8.0 and later.
#34: Add company's ASN to the values that can be blocked when blocking by company.
#33: Ensure that OPC guest-checkout email-addresses are blocked, if configured.
#32: Add notifications to enable a message override when a threat is detected

30 May 2026, 8:51 PM
#126
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
741
Plugin Contributions:
0

Re: Access Blocker Support Thread

lat9:

Good idea. I've created a GitHub issue for tracking the change: https://github.com/lat9/access_blocker/issues/32

Cindy - You mentioned in this update that in order to display a message on the Contact Us page:

ask_a_question and contact_us pages: You'll need to check the above, since the access-blocker simply redirects to the page with 'action=success'

Can you explain more about that, and what we need to do to enable a message on the Contact Page when access is blocked?

The main reason for the initial feature was to notify customers on the Contact Us page that their message to us was NOT getting through (due to access blocking), so that they wouldn't think that we were ignoring them.

I just need to know what we should put in the code to redirect to a message instead of the zen_redirect(zen_href_link(FILENAME_CONTACT_US, 'action=success', 'SSL'));

  • Jeff
31 May 2026, 11:23 AM
#127
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,137
Plugin Contributions:
56

Re: Access Blocker Support Thread

Jeff_Mash:

Cindy - You mentioned in this update that in order to display a message on the Contact Us page:

Can you explain more about that, and what we need to do to enable a message on the Contact Page when access is blocked?

The main reason for the initial feature was to notify customers on the Contact Us page that their message to us was NOT getting through (due to access blocking), so that they wouldn't think that we were ignoring them.

I just need to know what we should put in the code to redirect to a message instead of the zen_redirect(zen_href_link(FILENAME_CONTACT_US, 'action=success', 'SSL'));

For both the contact_us and ask_a_question pages, the associated language file contains TEXT_SUCCESS, which defaults to "Your message has been successfully sent.". You'll need to make a template-override copy of the message file, e.g. /includes/languages/english/YOUR_TEMPLATE/lang.contact_us.php, and make your edits there.

1 Jun 2026, 4:39 PM
#128
dan4store avatar

dan4store

New Zenner

Join Date:
Apr 2025
Location:
NC
Posts:
31
Plugin Contributions:
0

Re: Access Blocker Support Thread

smcelligott:

disabled new account e-mail confirmations,
I'm running ZC 2.1.0 and I'm wondering how I disabled new account e-mail. In a perfect world I would like to be able to approve emails to be sent and not be auto generated for new customers.
This Access Blocker not work for my Scrip Kiddy cuz it is being generated from an AI source. IP address, country, domains are always different, My biggest problem is emails are being sent from my domain and that is effecting my emails credibility and I'm getting black listed. They are getting some good emails from somewhere

16 Jun 2026, 4:39 PM
#129
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
741
Plugin Contributions:
0

Re: Access Blocker Support Thread

lat9:

For both the contact_us and ask_a_question pages, the associated language file contains TEXT_SUCCESS, which defaults to "Your message has been successfully sent.". You'll need to make a template-override copy of the message file, e.g. /includes/languages/english/YOUR_TEMPLATE/lang.contact_us.php, and make your edits there.

Cindy - Wouldn't modifying the TEXT_SUCCESS simply display the same text for everyone though (successfully delivered messages to legit customers, and for access blocked messages)?

In other words, shouldn't there be a different message that you display for blocked messages (something like TEXT_BLOCKED) that would be defined in the language file?

It sounds like if I create an override file (in store/includes/languages/english/bootstrap) and modify the text for TEXT_SUCCESS, then that's going to still display the same "success" message for both blocked and non-blocked messages that were submitted.

Am I missing something here?

  • Jeff
16 Jun 2026, 5:28 PM
#130
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,137
Plugin Contributions:
56

Re: Access Blocker Support Thread

OK, I see your point. How about I make an update that uses a different "success" message on the ask-a-question and contact-us pages if the "successful" redirect is based on a blocked access?

GitHub tracking issue: https://github.com/lat9/access_blocker/issues/39

16 Jun 2026, 5:47 PM
#131
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
741
Plugin Contributions:
0

Re: Access Blocker Support Thread

lat9:

OK, I see your point. How about I make an update that uses a different "success" message on the ask-a-question and contact-us pages if the "successful" redirect is based on a blocked access?

GitHub tracking issue: https://github.com/lat9/access_blocker/issues/39

Yes, that is exactly what I was originally trying to (poorly) communicate. The point being that if a user's submitted message is blocked, then we want them to know that it was blocked. So upon a blocked access, we need a separate configurable define message so that we can inform them.....like "MESSAGE NOT DELIVERED: It looks like your location is being blocked from delivering messages to us, so we will not get your original message. If you think this is in error and need to reach us, send a separate email to us at [email protected] and let us know."

This is separate from the usual TEXT_SUCCESS message that will be displayed for messages submitted by non-blocked access.

Thanks for adding it to the repo!

  • Jeff
16 Jun 2026, 10:04 PM
#132
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,137
Plugin Contributions:
56

Re: Access Blocker Support Thread

Jeff_Mash:

Yes, that is exactly what I was originally trying to (poorly) communicate. The point being that if a user's submitted message is blocked, then we want them to know that it was blocked. So upon a blocked access, we need a separate configurable define message so that we can inform them.....like "MESSAGE NOT DELIVERED: It looks like your location is being blocked from delivering messages to us, so we will not get your original message. If you think this is in error and need to reach us, send a separate email to us at [email protected] and let us know."

This is separate from the usual TEXT_SUCCESS message that will be displayed for messages submitted by non-blocked access.

Thanks for adding it to the repo!
Of course, publishing that email address to someone who's possibly a threat just says that the email address could be heavily spammed ... which is the whole point of blocking the access. Perhaps have them phone instead?

17 Jun 2026, 4:09 PM
#133
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
741
Plugin Contributions:
0

Re: Access Blocker Support Thread

lat9:

Of course, publishing that email address to someone who's possibly a threat just says that the email address could be heavily spammed ... which is the whole point of blocking the access. Perhaps have them phone instead?

Of course.....Whatever works. Sometimes when publishing front-facing email addresses, we just use a generic "gmail.com" account that we create for the purpose of contacting us via email, something that we don't mind if it gets spammed or not (like OurDomainUnblockMe######################) But yes, a phone number also works. Since the message would be configurable, the store owner can modify it to whatever works best.

  • Jeff
7 Nov 2026, 4:23 PM
#134
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,137
Plugin Contributions:
56

Re: Access Blocker Support Thread

v2.1.0 of Access Blocker is now available for download: https://www.zen-cart.com/plugins/access-blocker-a-pseudo-recaptcha-vb2237

This release contains changes for these GitHub issues:

#36: Correct PHP Warning on spammy ask_a_question pages.
#37: Use zen_config to gather configuration settings; pre-staging for zc300 and later.
#38: Disregard empty elements of comma-separated lists.
#39: Add override messages for ask_a_question and contact_us pages.
#40: Don't process if required email-address variable is missing.

7 Nov 2026, 6:30 PM [edited]
#135
zippyh avatar

zippyh

Member

Join Date:
Nov 2026
Posts:
1
Plugin Contributions:
0

Re: Access Blocker Support Thread

Thank you for this one.
We get a lot of requests for urls that are so obviously attempts at going places to do naughty things like
'/account', '/admin', '/api', '/api-docs', '/api-keys etc
mostly these requests appear in batches trying many directories.
zencart does its thing and redirects the request to the home page so no harm done.
but its a) annoying and b) uses ipdata requests.
so i added some code to the __construct() in auto.access_blocker.php
i am using v2.0.3
mine now looks like this.

public function __construct()
{
    $this->chars_to_remove = [
        ' ',
        "\\n",
        "\\r",
        "\\t"
    ];
    if (defined('ACCESSBLOCK_ENABLED') && ACCESSBLOCK_ENABLED === 'true') {
        $this->debug = (ACCESSBLOCK_DEBUG === 'true');
        $this->logfile = DIR_FS_LOGS . '/accesses_blocked\_' . date('Y_m') . '.log';
        // =================================================================
		// START: DYNAMIC DIRECTORY BUSTER AUTO-BAN (SELF-BAN PROOF)
		// =================================================================
		if (!empty($\_SERVER['REMOTE_ADDR'])) {
			$user_ip = $\_SERVER['REMOTE_ADDR'];
			// If the IP is in the Access Blocker configuration whitelist, skip the trap entirely
			if ($this->isIpWhitelisted($user_ip) === true) {
			} else {
				$requested_uri = strtolower($\_SERVER['REQUEST_URI'] ?? '');		
				$bad_patterns = array(
					'/account', '/admin', '/api', '/api-docs', '/api-keys', 
					'/auth', '/billing', '/checkout', '/console', '/dashboard', 
					'/debug', '/graphql', '/integrations', '/internal', '/invite', 
					'/login', '/ngsw', '/onboarding', '/organization', '/playground', 
				    '/pricing', '/settings', '/swagger', '/v1', '/webhooks', 
				   '.env', 'wp-admin', 'wp-login'
				);		
				$is_malicious = false;
				foreach ($bad_patterns as $pattern) {
					if (strpos($requested_uri, $pattern) !== false) {
						$is_malicious = true;
						break;
					}
				}
				if ($is_malicious) {
					global $db;
					$user_ip = $\_SERVER['REMOTE_ADDR'];
					// VALIDATION FIX: Ensure it is a structurally valid IPv4 or IPv6 address
					if (empty($user_ip) || $user_ip === '.' || !filter_var($user_ip, FILTER_VALIDATE_IP)) {
						// Drop the connection immediately without updating the database list
						header('HTTP/1.1 404 Not Found');
						echo 'Access Denied.';
						exit;
					}
					$config_key = 'ACCESSBLOCK_BLOCKED_IPS';
					$check_config = $db->Execute("SELECT configuration_value FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '" . $config_key . "'");
					if (!$check_config->EOF) {
						$current_list = trim($check_config->fields['configuration_value']);
						$banned_ips = ($current_list == '') ? array() : explode(',', str_replace($this->chars_to_remove, '', $current_list));
						if (!in_array($user_ip, $banned_ips)) {
							$banned_ips[] = $user_ip;
							$new_list = implode(',', $banned_ips);
							$db->Execute("UPDATE " . TABLE_CONFIGURATION . " 
										  SET configuration_value = '" . $db->prepare_input($new_list) . "' 
										  WHERE configuration_key = '" . $config_key . "'");						
							if ($this->debug === true) {
								error_log(date('Y-m-d H:i:s') . ": Auto-Banned IP ($user_ip) for hitting trap path: $requested_uri" . PHP_EOL, 3, $this->logfile);
							}
							if (!defined('ACCESSBLOCK_BLOCKED_IPS')) {
								define('ACCESSBLOCK_BLOCKED_IPS', $new_list);
							}
							header('HTTP/1.1 404 Not Found');
							echo 'Access Denied.';
							exit;
						}
					}
				}
			}
		}
		// =================================================================
		// END: DYNAMIC DIRECTORY BUSTER AUTO-BAN
		// =================================================================

if anyone tries to access any url that matches $bad_patterns it adds their ip to the banned list ,sends a 404 not found header, records to the log file and then treats the ip as being banned before ipdata gets involved.
i hope this of use to others