# etechflow/module-account-links-manager

> Hide unwanted links from the customer My Account sidebar without editing any templates or layout XML. Multi-select admin config, Hyvä + Magento Open Source + Adobe Commerce compatible.

`composer require etechflow/module-account-links-manager`

Canonical URL: https://packagento.com/etechflow/module-account-links-manager

## At a glance

- **Vendor**: etechflow (https://packagento.com/etechflow.md)
- **Latest version**: 1.2.0 — released 2026-06-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/etechflow/module-account-links-manager 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 etechflow/module-account-links-manager:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Hide unwanted links from the customer My Account sidebar without editing any templates or layout XML. Multi-select admin config, Hyvä + Magento Open Source + Adobe Commerce compatible.

## README

Hide unwanted links from the customer **My Account** sidebar in Magento without editing templates or layout XML. Pure admin config, zero frontend assets, Hyvä-safe by design.

Commercial eTechFlow module. Per-domain HMAC license or eTechFlow bundle key activates the module on your production host. Dev / staging / `*.magento.cloud` / `localhost` etc. auto-detect and bypass licensing.

### What it does

Two modes:

| Mode | Behaviour |
|---|---|
| **Hide selected links** | Every link picked is hidden from the customer sidebar; the rest stays visible. |
| **Show only selected links** | Only the picked links remain; everything else is hidden. |

Standard Magento + Adobe Commerce link names are in the multi-select. For third-party extension links, use the **Extra block names** textarea — list any layout block name and the module manages it.

### Features

| | |
|---|---|
| Hide individual customer dashboard links | ✓ |
| Inverse mode (show only the picked ones) | ✓ |
| Configure entirely from admin — zero coding | ✓ |
| Works on Magento Open Source + Adobe Commerce + Hyvä | ✓ |
| Per-store-view configuration | ✓ |
| Custom-extension links via the textarea | ✓ |
| Per-domain HMAC licensing + bundle key support | ✓ |
| Tideways span instrumentation (`ETechFlow_ALM_FilterNav`) | ✓ |
| Verify CLI (`etechflow:alm:verify`) | ✓ |
| No DB tables, no frontend JS, no CSS | ✓ |

### Compatibility

| Platform | Status |
|---|---|
| Magento Open Source 2.4.4 – 2.4.8 | ✓ |
| Adobe Commerce 2.4.4 – 2.4.8 | ✓ (includes Reward Points, Gift Card, RMA, Store Credit, Recurring Payments, Invitations) |
| Hyvä-themed storefronts | ✓ (Hyvä keeps the same `Html\Links` block class) |
| PHP 8.1 / 8.2 / 8.3 / 8.4 | ✓ |

### Installation

```bash
## Option A — Composer
composer require etechflow/module-account-links-manager:^1.0
bin/magento module:enable ETechFlow_AccountLinksManager
bin/magento setup:upgrade
bin/magento setup:di:compile      # production mode only
bin/magento cache:flush

## Option B — Manual drop-in
cp -r ETechFlow/AccountLinksManager app/code/ETechFlow/AccountLinksManager
bin/magento module:enable ETechFlow_AccountLinksManager
bin/magento setup:upgrade
bin/magento setup:di:compile      # production mode only
bin/magento cache:flush
```

No database tables are created — settings live in `core_config_data`.

### Configuration

**Admin → Stores → Configuration → eTechFlow → Customer Dashboard Links Manager**

| Field | Description |
|---|---|
| **License → Production Environment** | Yes for live sites, No for dev/staging on non-standard domains. |
| **License → License Key** | Paste your per-domain key (or bundle key under any eTechFlow module). |
| **General → Enable Module** | Master switch — turns the filtering on/off without uninstalling. |
| **General → Action** | Hide selected / Show only selected. |
| **General → Links** | Multi-select of standard Magento + Adobe Commerce links. |
| **General → Extra block names** | Newline-separated block names for third-party extension links. |

Per-store-view configuration is supported.

### Smoke test

```bash
bin/magento etechflow:alm:verify
```

Should print `✅ ALL CHECKS PASSED. v1.0.0 verified.`

### How it works

The module registers a plugin on `Magento\Framework\View\Element\Html\Links::beforeToHtml()` (frontend-scoped DI). When the customer-account navigation block is about to render:

1. Check the module is enabled + licensed.
2. Read the configured action mode + managed block-name list.
3. For each child link block, decide if it should be removed (based on mode).
4. Remove via `Layout::unsetChild()` — the same mechanism `<referenceBlock remove="true"/>` uses in layout XML.

Result: the link never renders. No HTML rewriting, no CSS hiding.

### Why Hyvä-safe

Hyvä replaces storefront templates and JS but keeps the PHP block classes. The customer-account navigation is still rendered by a class extending `Magento\Framework\View\Element\Html\Links`. Our plugin hooks the parent class and guards by `getNameInLayout() === 'customer_account_navigation'` — works on every theme, doesn't touch footer or other Links blocks.

The module ships zero frontend assets: no JS, no CSS, no `.phtml` overrides. Nothing for Hyvä to clash with.

### Uninstall

```bash
bin/magento module:disable ETechFlow_AccountLinksManager
bin/magento cache:flush

## Composer:
composer remove etechflow/module-account-links-manager
## Manual:
rm -rf app/code/ETechFlow/AccountLinksManager
bin/magento setup:upgrade
bin/magento cache:flush
```

Optional cleanup of leftover config entries:

```sql
DELETE FROM core_config_data WHERE path LIKE 'etechflow_accountlinks/%';
```

### License

Proprietary — see `LICENSE.txt`. Commercial licenses available at <https://etechflow.com>.

## Changelog

All notable changes to this module. Adheres to [Semantic Versioning](https://semver.org/).

---

### [1.1.0] — 2026-05-29

#### Security & Licensing

- **Fixed critical bypass bug**: `isLocallyIssuedKey()` previously recreated the 48-hour grace cache on every `cache:flush`, allowing the local fast-path to bypass IP validation indefinitely. The grace period is now tracked via an `issued_at` config timestamp written once by `Callback.php` at purchase time — no longer resettable by a cache flush.
- **Added `isExplicitlyRevoked()`**: A `revoked = 1` config flag (set by `Revoke.php`) now short-circuits all other checks including dev-mode bypass, ensuring suspended licenses are immediately deactivated.
- **Added `BlockSaveWithoutLicense` plugin**: Hooks `Magento\\Config\\Model\\Config::save()` to block saving `etechflow_accountlinks` config without a valid license, preventing settings from being applied without activation.

#### Admin UX

- **License Gate page**: Full dark-navy admin UI at `Stores → Settings → Account Links Manager` showing plan cards, subscription status, and in-Magento Stripe Checkout flow (no external portal redirect required).
- **In-Magento Stripe payment**: `CreateSession` controller builds a Stripe Checkout session server-side; `Callback` (frontend) receives the session and activates the SP-XXXX key.
- **Success page**: Post-purchase success screen shows the activated key with copy button.
- **Fixed form_key injection**: Admin AJAX for Stripe session now uses server-side rendered form key instead of `window.FORM_KEY` fallback.

#### Navigation Enforcement

- **NavigationPlugin license check**: `beforeToHtml` now returns early if `LicenseValidator::isValid()` is false — the module is fully dormant when unlicensed.

---

### [1.0.0] — 2026-05-19

#### Initial commercial release

Hide unwanted links from the customer **My Account** sidebar without editing templates or layout XML. Two modes:

- **Hide selected links** — every link picked is hidden.
- **Show only selected links** — only the picked links remain.

##### Added

- **Admin config**: `Stores → Configuration → eTechFlow → Customer Dashboard Links Manager`. Enable toggle, mode dropdown, multi-select of standard + Adobe Commerce link names, plus an "Extra block names" textarea for third-party extension links.
- **Per-installation HMAC license** with bundle-key support. Same pattern as every other eTechFlow module.
- **Profiler instrumentation** — wraps the navigation filter in an `ETechFlow_ALM_FilterNav` Tideways span.
- **Verify CLI** — `bin/magento etechflow:alm:verify`.
- **Hyvä-safe** — hooks the parent `Magento\Framework\View\Element\Html\Links` class so Hyvä's re-skinned navigation works without changes.
- **Frontend-only DI registration** — `etc/frontend/di.xml` so the plugin only runs where it matters.

##### Compatibility

- Magento Open Source 2.4.4 – 2.4.8
- Adobe Commerce 2.4.4 – 2.4.8 (includes link names for Reward Points, Gift Card, Gift Registries, RMA, Store Credit, Recurring Payments, Invitations)
- PHP 8.1 / 8.2 / 8.3 / 8.4
- All Hyvä child themes

## Recent Versions

| Version | Released |
|---|---|
| 1.2.0 | 2026-06-06 |
| 1.1.0 | 2026-05-29 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | ^103.0\|\|^104.0 |
| magento/module-backend | ^102.0\|\|^103.0 |
| magento/module-config | ^101.2\|\|^102.0 |
| magento/module-customer | ^103.0\|\|^104.0 |
| magento/module-store | ^101.1\|\|^102.0 |
| php | ~8.1.0\|\|~8.2.0\|\|~8.3.0\|\|~8.4.0 |

### Suggest

| Package | Constraint |
|---|---|
| etechflow/module-next-day-eligibility | Part of the eTechFlow module bundle — one bundle key activates every eTechFlow module. |

## Quality

Latest release (1.2.0) 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 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | not tested |


### 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 | Fail | 607 | 4 errors, 603 warnings (ruleset: Magento2) — 315 auto-fixable with phpcbf |
| PHPMD | Warning | 21 | 21 rule violations (NPathComplexity:6, UnusedFormalParameter:4, CyclomaticComplexity:3, MissingImport:3, ExcessiveMethodLength:3) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |

#### 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 | 13 | 13 | – | – |
| 2.4.8 | – | 13 | 13 | – |
| 2.4.9 | – | – | 13 | N/A |


### 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=["etechflow/module-account-links-manager"],
  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

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

