# d3p1/module-geo-ip

> Geo IP

`composer require d3p1/module-geo-ip`

Canonical URL: https://packagento.com/d3p1/module-geo-ip

## At a glance

- **Vendor**: d3p1 (https://packagento.com/d3p1.md)
- **Latest version**: v1.1.3 — released 2026-05-06
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/d3p1/module-geo-ip and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require d3p1/module-geo-ip:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Geo IP

## README

<div align=center>

## [MAGENTO 2 - GEO IP]

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![code consistency: php_code_sniffer](https://img.shields.io/badge/code_consistency-php_code_sniffer-blue.svg)](https://github.com/PHPCSStandards/PHP_CodeSniffer)
[![code consistency: php_cs_fixer](https://img.shields.io/badge/code_consistency-php_cs_fixer-purple.svg)](http://github.com/PHP-CS-Fixer/PHP-CS-Fixer)

</div>

### Introduction

A [Magento 2](https://business.adobe.com/products/magento/magento-commerce.html)
tiny implementation that allows the redirection of the customers to the
respective version of your store considering its geolocalization.

> [!IMPORTANT]
> To be able to use this implementation, it is necessary that your store is
> integrated with [Cloudflare](https://www.cloudflare.com/) using
> the
[IP geolocation feature](https://support.cloudflare.com/hc/en-us/articles/200168236-Configuring-IP-geolocation).

### Installation

To proceed with the installation of your module, you need to go to
the [document root of your Magento installation](https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/tutorials/docroot.html)
and run the following commands:

```
composer require d3p1/module-geo-ip
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
bin/magento cache:clean
bin/magento cache:flush
```

> [!NOTE]
> To execute `bin/magento setup:static-content:deploy` you need to list all the
> languages of your store/s using the
> [ISO-639 format](http://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).
> Also, if you are using a platform mode different than
`production`, you need to execute the command
> using the `-f` flag: [
`bin/magento setup:static-content:deploy -f`](https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-static-view.html).

> [!NOTE]
> The command `bin/magento cache:flush`
> is
[optional](https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cache.html#config-cli-subcommands-cache-clean).

### Changelog

Detailed changes for each release are documented in [
`CHANGELOG.md`](./CHANGELOG.md).

### License

This work is published under [MIT License](./LICENSE).

### Author

Always happy to receive a greeting on:

- [LinkedIn](https://www.linkedin.com/in/cristian-marcelo-de-picciotto/)
- [Web](https://d3p1.dev/)

## Changelog

#### Bug Fixes

* improve code style [[#1](https://github.com/d3p1/magento2-geo-ip/issues/1)] ([9c5301f](https://github.com/d3p1/magento2-geo-ip/commit/9c5301f64f57ca195ec6a48d474b6c799dd60bac))

### [1.1.2](https://github.com/d3p1/magento2-geo-ip/compare/v1.1.1...v1.1.2) (2026-05-06)


#### Bug Fixes

* improve code style [[#1](https://github.com/d3p1/magento2-geo-ip/issues/1)] ([0c1f23a](https://github.com/d3p1/magento2-geo-ip/commit/0c1f23af582c0be0efa8197fe7b40d132fda64a9))

### [1.1.1](https://github.com/d3p1/magento2-geo-ip/compare/v1.1.0...v1.1.1) (2026-05-05)


#### Bug Fixes

* adjust coding style guidelines [[#1](https://github.com/d3p1/magento2-geo-ip/issues/1)] ([aeafc81](https://github.com/d3p1/magento2-geo-ip/commit/aeafc814006a6b25eb7661c86d6aa4ed934177c3))

## [1.1.0](https://github.com/d3p1/magento2-geo-ip/compare/v1.0.0...v1.1.0) (2026-04-28)


#### Features

* improve composer definition [[#1](https://github.com/d3p1/magento2-geo-ip/issues/1)] ([5fea85c](https://github.com/d3p1/magento2-geo-ip/commit/5fea85c7fac8633609fec89937ef7b43176a64e2))

## 1.0.0 (2026-04-28)


#### Bug Fixes

* improve package version, author, license and dependencies [[#1](https://github.com/d3p1/magento2-geo-ip/issues/1)] ([39b5364](https://github.com/d3p1/magento2-geo-ip/commit/39b5364537ada1f9fd13184eff6251cfde1bb94e))


#### Features

* improve module folder structure [[#1](https://github.com/d3p1/magento2-geo-ip/issues/1)] ([441e6c9](https://github.com/d3p1/magento2-geo-ip/commit/441e6c97ff94c4c369d15ab96df1c8a098d745fc))
* update vendor namespace [[#1](https://github.com/d3p1/magento2-geo-ip/issues/1)] ([6fa8555](https://github.com/d3p1/magento2-geo-ip/commit/6fa85553bdd33f8bb88140e2d21df7b87fb702fe))

## Recent Versions

| Version | Released |
|---|---|
| v1.1.3 | 2026-05-06 |
| v1.1.2 | 2026-05-06 |
| v1.1.1 | 2026-05-05 |
| v1.1.0 | 2026-04-28 |
| v1.0.0 | 2026-04-28 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| ipinfo/ipinfo | ^2.0 |
| magento/framework | ~101.0\|\|~102.0\|\|~103.0 |
| magento/module-store | ~101.0 |
| php | ^7.0.10\|\|^8.0.0 |

## Quality

Latest release (v1.1.3) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | 1 | 1 | – |
| 2.4.9 | – | – | 1 | 1 |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — 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.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 14 | 14 warnings (ruleset: Magento2) — 9 auto-fixable with phpcbf |
| PHPMD | Warning | 4 | 4 rule violations (IfStatementAssignment:3, ExcessiveParameterList:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Pass | 0 |  |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 6 | 6 | – | – |
| 2.4.8 | – | 6 | 7 | – |
| 2.4.9 | – | – | 7 | 7 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| 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

| 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

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["d3p1/module-geo-ip"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

d3p1 is a Magento 2 vendor on Packagento. See https://packagento.com/d3p1.md for their full catalogue.

