IP & Country Blocking, Visitor Control: setup and help

Quick start

  1. Upload and install the mprvisitorcontrol ZIP through Module Manager.
  2. Click Configure to open General Settings, review the options, then save.
  3. Open IP Whitelist and save your trusted test or office IP under IP Address with a Label.
  4. Log in to a test customer on the storefront, keep the page open for the collector, then inspect that customer in the Back Office.
  5. Open Visitor Bans and add a rule for a separate test address. Choose Ban Type, Active and a temporary Expiry Date.
  6. From the matching test address, open an affected page and confirm a 403 response and the intended message.
  7. Deactivate the test rule and confirm access returns. Use Module Manager to disable the module if you need to stop all collection and blocking.

Requires PrestaShop 1.6.1 or later and PHP 7.1 or later.

Setup manual

Install and first configuration

Follow the steps in Quick start.

Review settings before use

The module installs collection, guest tracking, visitor banning and order panels as enabled. Retention is installed as 90 days. Its Configure action opens General Settings.

Saving General Settings applies the collection, guest tracking, banning, order-panel and retention choices. Default Ban Message is saved for each language and used when a matched rule has no custom message.

Set Enable Data Collection or Enable Visitor Banning to No and save to stop the corresponding function. Disable the module in Module Manager to stop both. Manage individual ban and whitelist rows through their dedicated screens.

Form label Installed value Current behavior
Enable Data Collection Yes Browser requests and login/account-creation information are collected. Set No and save to stop collection.
Track Guest Visitors Yes Visitors who are not logged in are included, with their guest ID when available. Set No and save to collect only logged-in customers.
Enable Visitor Banning Yes Active ban rules are enforced before storefront pages load. Set No and save to stop blocking.
Show Info on Orders Yes The customer visitor panel appears on supported admin order pages. Set No and save to hide this panel.
Log Retention (days) 90 Automatically remove records older than the saved number of days. Enter a non-negative whole number; 0 keeps records indefinitely.
Default Ban Message English restriction message seeded for every language Save the fallback message for each language. A matched rule's custom message takes precedence.

The installed English message is:

Your access to this website has been restricted. If you believe this is an error, please contact the store administrator.

Operating system, browser, screen and raw user-agent tracking are enabled at installation. The main merchant form has no separate controls for them. Each collected record includes the IP address.

Add trusted addresses

Open IP Whitelist. Enter IP Address or CIDR Range and a Label, then save. Example entries:

IP Address: 203.0.113.10
Label: Office IP
CIDR Range: 198.51.100.0/24
Label: Agency VPN

Replace these documentation addresses with your real trusted addresses. Whitelist matching happens before every ban check. A whitelisted address bypasses country, user-agent and customer bans too. Avoid broader ranges than you intend to allow. Entries are checked for the current shop or all shops where applicable.

Create and maintain ban rules

Open Visitor Bans and add a Ban Rule. Fill at least one target. Use one target per rule when you want a predictable test: multiple target fields are alternative matches, not an all-conditions requirement.

Field New-rule default How to use it
IP Address Empty, unless prefilled Enter an exact IP, an IPv4 wildcard such as 192.168.1.*, or a dash range such as 192.168.1.1-192.168.1.255.
CIDR Range Empty Enter an IPv4 subnet such as 192.168.1.0/24. Do not fill both this and IP Address.
Country None Select a country to match its detected country code.
User Agent Pattern Empty Enter a case-insensitive text substring or a regular expression beginning and ending with /.
Customer ID 0 Enter the registered customer ID. It is checked only when that customer is logged in.
Ban Type Full Block - Entire Store Choose the scope described below.
Reason Empty Internal note; it is not shown to the visitor.
Custom Ban Message Empty Override the default for this rule. The template renders this content as HTML.
Active Yes Set No to stop enforcing the rule.
Expiry Date Empty Leave empty for a permanent rule, or enter an expiry date. Expired active rows are deactivated when active bans are loaded.

For user-agent regexes, use /(curl|wget|python-requests)/. The matcher only recognizes a regex when its final character is /. An example ending in /i is treated as plain text in this revision. Plain text matching is already case-insensitive. User-agent strings can be changed by the visitor, so they do not establish identity.

Choose the scope

Ban Type Stored value Affected controller request values
Full Block - Entire Store full Every front-office request reaching the enforcement hook
Checkout Only checkout order, orderopc, cart, supercheckout, onepagecheckout, checkout
Login/Authentication Only auth authentication, my-account, identity, registration, password

Blocking runs through actionDispatcher for native front-office controllers; module front-controller requests are skipped. The module reads the request's controller value for scoped blocking. Test your checkout and account routes, especially with custom controllers. A full-store match is checked before the narrower scope. An IP change, such as a VPN connection, can bypass an IP-only rule when the new address is outside the rule.

Examples

For a full-store test, enter the test address under IP Address, keep Ban Type as Full Block - Entire Store, enter an internal Reason, and choose a near-term Expiry Date.

For a subnet restricted to checkout, use CIDR Range 192.168.1.0/24 and Ban Type Checkout Only. For a logged-in account rule, enter Customer ID 123 and leave other targets empty. Replace sample values with the intended test data.

For a per-rule message, enter:

<p>Your access to checkout is temporarily restricted. Please contact support if you believe this is an error.</p>

Import CSV rules

Use CSV Import > Import ban rules from CSV above the bans list, choose a CSV file and click Import. Columns are positional:

ip_address,ban_type,reason
192.168.1.1,full,Fraud attempt
192.168.1.0/24,checkout,Suspicious checkout traffic
203.0.113.10,auth,Fake account attempts

The first row can be ip_address or ip headers. Slash-containing addresses go into the CIDR field. Imported rows are active, permanent and assigned to the current shop context. An unsupported ban type becomes full; an empty address is skipped. The importer does not comprehensively validate address formats. Check the resulting rows rather than treating the imported count as a successful blocking test.

Collect and inspect visitor data

The collector is added through displayHeader. After DOM readiness it waits about 1.5 seconds, then requests the generated collect URL with sw and sh from the browser's screen dimensions. With friendly routes a URL can look like:

/module/mprvisitorcontrol/collect?sw=1920&sh=1080

The browser uses the session-storage key mprvc_collected to avoid repeating the request in the same session. When storage is unavailable, collection can repeat. A fulfilled HTTP request marks the browser session even when the JSON response reports a disabled/error state. Check the actual response during testing.

The server stores IP, country, user-agent, operating system, browser/version, screen dimensions, device type, customer ID, guest ID, shop ID and record date. Login and account creation also collect through actionAuthentication and actionCustomerAccountAdd.

Collection suppresses a new row for the same customer or guest and IP when a record exists within the preceding hour. It can update screen resolution on that recent row. The data is not a complete page-view log, and Visits counts stored records rather than every page view.

Country detection uses the Cloudflare HTTP_CF_IPCOUNTRY header, then PrestaShop GeoIP, then the country cookie. The country can be empty. IP detection validates REMOTE_ADDR and accepts Cloudflare client-IP headers only from a direct Cloudflare peer. For other reverse proxies, configure the web server to restore the client address in REMOTE_ADDR.

Customer and order panels

The module renders through displayAdminCustomers and displayAdminOrder. The panel appears only when a customer has a stored record. It shows the latest IP, country, browser, operating system, screen resolution when available, device type and record date. The order page shows the customer's latest visitor record, not necessarily a snapshot from the order's creation.

With multiple stored IP addresses, IP History shows country, record count, first seen, last seen and a quick ban action. Warnings cover shared IPs, more than three countries, more than three device types and more than ten distinct IPs. Review them as indicators, not automatic bans. The customer and order panels are account-based; guest-only rows do not create a customer panel.

Check the address recorded behind a proxy

The module takes the visitor IP from PrestaShop's Tools::getRemoteAddr(); its own CF-Connecting-IP, X-Real-IP and X-Forwarded-For fallback is not used on supported PrestaShop versions. Behind Cloudflare or another proxy, configure the server to pass the real visitor address to PHP, then compare the stored visitor IP with a known test connection before relying on an IP ban.

Verify and troubleshoot

Use a separate test address for a ban. Confirm that the matching page returns HTTP 403 and displays Access Restricted with the rule message or fallback. Confirm that an unaffected page remains available for scoped rules and that deactivation restores access.

If no visitor data appears, check that the module is enabled, the collector hook and request are present, and the endpoint returns {"status":"ok"}. Use a new browser session when the session flag already exists. Allow for the one-hour server deduplication. A very short visit can end before screen collection runs.

Confirm the saved General Settings values before testing collection, blocking or retention. If a ban does not match, check Active, expiry, shop, whitelist precedence, actual IP/country/user-agent and the selected scope. CIDR and dash ranges support IPv4. IPv6 addresses can be matched individually by their exact text.

The first storefront request after 24 hours triggers removal of records older than the active retention period, when that period is positive. You do not configure a system cron job for this daily cleanup. With no requests, cleanup waits until the next visit.

Disable or uninstall

Set Enable Data Collection or Enable Visitor Banning to No and save to stop collection or blocking separately. Disable the module in Module Manager to stop both. For one rule, set Active to No instead.

Use Uninstall in Module Manager to remove it. Uninstall drops mprvc_info, mprvc_banned and mprvc_whitelist and removes this module's shared configuration and menu entries. Retain a database backup first if you need visitor history, bans or whitelist data.

Questions

1

Does Visitor Control wait for a consent banner before collecting visitor data?

No. It collects IP, country, user-agent and device information without checking a consent banner. Set Enable Data Collection to No and save in General Settings to stop collection. Disable the module in Module Manager to stop all its collection and blocking.

Known Issues

6

Single-address ban rules

ResolvedUpdated:
Fixed in: 1.0.15
Fixed saving a rule for a single IP address failing when the network range is left empty.

Save and stay

ResolvedUpdated:
Fixed in: 1.0.15
Fixed Save and stay so it validates the rule and keeps the form open after saving.

Security hardening

ResolvedUpdated:
Fixed in: 1.0.15
Security hardening.

PHP 7.1 compatibility

ResolvedUpdated:
Fixed in: 1.0.11
Restored module loading on shops running PHP 7.1.

Merchant ban list enforcement

ResolvedUpdated:
Fixed in: 1.0.10
Fixed merchant-defined visitor bans being skipped when another firewall integration is active.

Visitor block page routing

ResolvedUpdated:
Fixed in: 1.0.5
Fixed visitor control pages failing to open on case-sensitive installations.

Feature Requests

3

Implemented

IPv4 range blocking with CIDR notation

Implemented
Blocks entire IPv4 ranges entered in CIDR notation, so a range can be banned without adding each address separately.

One-click module updates

Implemented
Install module updates directly from the back office.

Firewall coordination

Implemented
Coordinate visitor blocking with other supported firewall integrations.

Changelog

v1.0.52026-05-22

  • Addedcomplete FR/DE/ES/IT/PL translations
  • FixedCertify visitor control install integrity
Older releases

v1.3.02026-04-20

  • Addedadmin menu management via MenuInstaller for streamlined module setup
  • AddedLicense management tab with key management and renewal options
  • Addedself-healing integrity checks for automatic diagnostics and repair
  • Addedcomplete FR/DE/ES/IT/PL translations
  • Improvedadmin list columns with visual badge indicators and multiselect filters

v1.2.02026-02-09

  • AddedPS 9 / Hummingbird theme compatibility
  • Addeduser-agent-based blocking with wildcard pattern support
  • Improvedvisitor intelligence panel with device-type and browser breakdown
  • Optimized IP-country lookup using MaxMind GeoLite2 binary database for sub-millisecond queries
  • Fixedcountry-block rule not applying to AJAX cart-add requests

v1.0.02025-08-12

  • Initialrelease: visitor intelligence and access control for PrestaShop
  • InitialReal-time visitor information: IP, device type, browser, country
  • InitialIP and country block rules with redirect or 403 response
  • InitialCompatible with PS 1.7.x and PS 8.x

v1.1.02025-05-12

  • Addedtemporary IP ban with expiry timer
  • Addedcountry allowlist mode — whitelist-only access control
  • Improveddevice detection accuracy for current iOS and Android user-agent strings

Demo

Test the full module before you buy

Buy a licence later and keep your settings.

  • Your 30-day demo Test it on your own shop for 30 days from the first install.
  • Ready demo shop Explore a ready demo shop in your browser.
  • No registration No account, email or store domain needed.
Launch demo shop

By downloading, you accept the demo terms and privacy policy.

By opening this demo you accept the demo terms and the privacy policy.

Loading...
Back to top