mageplaza / module-geoip

mageplaza/module-geoip

magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Fail Tests: N/A Security: Pass proprietary

Are you the maintainer of mageplaza?

Packagento pulls mageplaza's Composer packages from the public registry so buyers can find them here.

Claim the namespace to take ownership, publish new releases directly, and start charging for premium versions.

Claim this namespace →

Magento 2 GeoIP Extension

GeoIP Library for Magento 2 provides stores with GeoIP Database, which supports to detect the current geolocation of customer using his IP address.

1. GeoIp Documentation

2. FAQs

Q: I got error: Mageplaza_Core has been already defined

A: Read solution here

Q: What is the library used for?

A: GeoIP library contains the GeoLite 2 geolocation database. Based on this, you can take advantage to build up other advanced functions such as auto-detect customer’ address to suggest stores, switch appropriate language storeview.

3. How to install GeoIP extension for Magento 2

Install via composer (recommend)

Run the following command in Magento 2 root folder:

composer require mageplaza/module-geoip
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy

4. Highlight features

The module is built based on the GeoLite 2 database, also the IP geolocation database. The GeoLite2 Country, City, and ASN databases are updated frequently.

In this free module, the store admin can download the library to get the Geolocation database. The database is the basement to power other advanced location functions (store switching, store locating)

With 2 simple steps, you can download the geodatabase library and enable the module to activate the library and come into usage.

Highlight features

GeoIP library is used to develop Magento 2 Store Switcher, Magento 2 Store Locator and Magento 2 Store Pickup by Mageplaza

5. How to configure the GeoIP module

From the Admin Panel, go to Stores > Configuration > Mageplaza Extension > Geo IP, choose Geo IP Configuration section.

Imgur

  • Enable Geo IP, please select Yes to turn on GeoIP module function which helps you define customers' countries then direct them to the related store views.

  • Download Library button: Click Download Library button to download Geo IP library before enabling it.

People also search:

  • geoip magento 2
  • magento 2 geo ip
  • magento 2 geoip extension
  • magento 2 geoip redirect
  • magento 2 geoip store switcher
  • magento 2 geolocation
  • magento 2 geoip currency switcher

Other free Magento 2 extensions on Github

Versions
Version Stability QA Status Compatibility Released
4.0.3 stable Fail Magento 2.4.7-2.4.9 Details 2025-07-28 08:53:18
4.0.2 stable Not tested Not yet tested Details 2025-04-17 09:27:03
1.0.8 stable Not tested Not yet tested Details 2021-08-19 06:59:46
1.0.7 stable Not tested Not yet tested Details 2021-07-09 10:02:09
4.0.1 stable Not tested Not yet tested Details 2021-07-09 09:58:48
4.0.0 stable Not tested Not yet tested Details 2020-10-01 03:33:23
1.0.6 stable Not tested Not yet tested Details 2020-06-02 09:19:20
1.0.5 stable Not tested Not yet tested Details 2019-12-30 10:45:28
1.0.4 stable Not tested Not yet tested Details 2019-05-28 07:20:57
1.0.3 stable Not tested Not yet tested Details 2019-01-31 11:47:39
1.0.2 stable Not tested Not yet tested Details 2019-01-09 08:19:52
1.0.1 stable Not tested Not yet tested Details 2018-12-18 02:39:47
1.0.0 stable Not tested Not yet tested Details 2018-12-05 09:23:09

Requires 2

Package Constraint
geoip2/geoip2 ^2.0 || ^3.0
mageplaza/module-core ^1.5.13

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Pass

Code Quality

Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. A phpcs finding can't make a module incompatible.

Static analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

Static analysis results
Tool Status Findings Summary
PHPCS Warning 37 37 warnings (ruleset: Magento2) — 14 auto-fixable with phpcbf
PHPMD Warning 2 2 rule violations (UnusedFormalParameter:1, IfStatementAssignment:1)
Cpd Pass 0
Composer validate Info 1 valid; 1 advisory note (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 58 58
2.4.8 58 58
2.4.9 56 56

Tests

Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Security

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
proprietary
Authors

More from mageplaza

View vendor
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.