# etechflow/module-page-speed-optimizer-premium

> Magento 2 Page Speed Optimizer Premium — adds Infinite Scroll for category pages, advanced bulk-sweep image optimization via cron, detailed optimization logging, per-device JS merging. Requires ETechFlow Page Speed Optimizer Pro. Full Amasty Page Speed Optimizer Premium ($599) alternative at $499.

`composer require etechflow/module-page-speed-optimizer-premium`

Canonical URL: https://packagento.com/etechflow/module-page-speed-optimizer-premium

## At a glance

- **Vendor**: etechflow (https://packagento.com/etechflow.md)
- **Latest version**: 1.0.3 — 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-page-speed-optimizer-premium 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-page-speed-optimizer-premium:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Magento 2 Page Speed Optimizer Premium — adds Infinite Scroll for category pages, advanced bulk-sweep image optimization via cron, detailed optimization logging, per-device JS merging. Requires ETechFlow Page Speed Optimizer Pro. Full Amasty Page Speed Optimizer Premium ($599) alternative at $499.

## README

Adds Premium-tier features on top of the [ETechFlow Page Speed Optimizer Pro](https://github.com/etechflow/module-page-speed-optimizer) module. Together they form the full Amasty Page Speed Optimizer Premium ($599) alternative at $499.

### What this module adds

| Feature | Status |
|---|---|
| **Infinite Scroll** for category + search-result pages | ✅ v1.0 |
| **Auto-optimize EXISTING images in folders** via cron | ✅ v1.0 |
| **Detailed image-optimization logging** | ✅ v1.0 |
| **AJAX Shopping Cart** popup | 🛠 v1.1 |
| **Per-device JS merging** | 🛠 v1.1 |

### Install

```bash
composer require etechflow/module-page-speed-optimizer-premium:^1.0
bin/magento module:enable ETechFlow_PageSpeedOptimizerPremium
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
```

Requires the Pro module (`etechflow/module-page-speed-optimizer ^2.3`) — Composer pulls it automatically if not installed.

### Verify

```bash
bin/magento etechflow:pso-premium:verify
```

### Compatibility

- Magento Open Source / Adobe Commerce 2.4.4 – 2.4.8
- PHP 8.1 – 8.4
- Hyvä Theme + Hyvä Checkout
- Mage-OS

### Pricing

- **PSO Pro** alone — $179 (full Amasty Pro $199 alternative)
- **PSO Premium** (this module + Pro) — $499 (full Amasty Premium $599 alternative)

### Support

info@etechflow.com

## Changelog

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

---

### [1.0.1] — 2026-06-04 — Portal licensing + in-admin purchase

#### Added

**Hybrid portal licensing (eTechFlow Store Portal)**
- `SP-XXXX` subscription keys are now validated live against the eTechFlow licensing portal with strict domain + server-IP binding (no offline grace). Per-module HMAC keys and the shared bundle key continue to work for offline activation.
- Plan-level feature gating: `Config::isInfiniteScrollEnabled()`, `isBulkSweepEnabled()`, and `isDetailedLoggingEnabled()` now also honour the active subscription's `infinite_scroll` / `bulk_sweep` / `detailed_logging` flags, so each feature can be toggled per plan from the portal.
- New License config: portal URL, issued-key, and bundle-key fields; `Production Environment` toggle for dev/staging bypass.

**In-admin License & Plans page + Stripe checkout**
- New admin route `etechflow_psopremium/license/gate` with Weekly / Monthly / Yearly plan cards.
- `Checkout` controller creates a Stripe Checkout session; `Activated` controller fetches the issued key from the portal and saves it automatically.
- Payment settings group (Stripe secret/publishable key, currency).

#### Fixed
- **Infinite Scroll selector** — the product-grid container selector did not match Luma's `<ol class="products list items product-items">` (the `products wrapper grid products-grid` classes sit on the parent `<div>`, not a nested element), so infinite scroll silently bailed. Now targets the list element directly; works on category + search pages.

---

### [1.0.0] — 2026-05-21 — Initial Premium tier release

First commercial release of the **Premium** add-on module. Pairs with PSO Pro to form a complete Amasty Page Speed Optimizer Premium ($599) alternative at $499.

#### Added

**Infinite Scroll for category + search pages**
- Vanilla-JS IntersectionObserver-based "load more on scroll" behaviour.
- AJAX controller renders next paginated product page server-side and returns just the new products + updated pagination meta.
- Loading indicator + "Back to top" button after N pages scrolled.
- Admin config: enable per page type (Category / Search Results), scroll threshold (px before bottom), products per fetch.
- Hyvä-compatible — no jQuery dependency.

**Bulk-sweep image optimization via cron**
- `SweepFoldersCommand` CLI + cron job walks the configured media dirs and enqueues any UN-optimized images into PSO Pro's existing `etechflow_pso_view_queue`. Pro's `QueueProcessor` cron drains the queue normally.
- Different from Pro's "auto-on-upload" observer: that only catches new uploads. This catches ALL existing folder content.
- Useful for stores migrating from another optimizer or for retroactive optimization after enabling PSO.

**Detailed image-optimization logging**
- Adds per-step logging to the optimization pipeline. Each cron run produces a detailed log file at `var/log/etechflow_pso_premium_optimization_YYYY-MM-DD.log`.
- Captures: source path, engines used, bytes-before/after, savings %, duration ms, status.
- Audit trail for agencies + ops teams managing multi-store catalogs.

#### Premium tier feature parity with Amasty Premium ($599)

| Amasty Premium feature | PSO Premium v1.0 |
|---|---|
| PSO Pro included | ✅ (via composer dependency) |
| Back Forward Cache | ✅ (in Pro) |
| **Infinite Scroll** | **✅ NEW** |
| AJAX Shopping Cart | 🛠 v1.1 |
| **Image optimization by Cron (bulk-sweep)** | **✅ NEW** |
| JS merging for particular devices | 🛠 v1.1 |
| **Auto-optimize EXISTING images in folders** | **✅ NEW** |
| **Detailed optimization logging** | **✅ NEW** |

**4 of 6 Premium-only features in v1.0. AJAX Cart + per-device JS merging in v1.1.**

#### Hardening (the v1.7.0 lesson)

_(Changelog truncated for .md surface. Full history on https://packagento.com/etechflow/module-page-speed-optimizer-premium.)_

## Recent Versions

| Version | Released |
|---|---|
| 1.0.3 | 2026-06-06 |
| 1.0.2 | 2026-06-06 |
| 1.0.1 | 2026-06-04 |
| 1.0.0 | 2026-05-30 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| etechflow/module-page-speed-optimizer | ^2.3 |
| magento/framework | ^103.0\|\|^104.0 |
| magento/module-backend | ^102.0\|\|^103.0 |
| magento/module-catalog | ^104.0\|\|^105.0 |
| magento/module-catalog-search | ^102.0\|\|^103.0 |
| magento/module-store | ^101.1\|\|^102.0 |
| php | ~8.1.0\|\|~8.2.0\|\|~8.3.0\|\|~8.4.0 |

## Quality

Latest release (1.0.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 | – | 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 | 77 | 1 error, 76 warnings (ruleset: Magento2) — 21 auto-fixable with phpcbf |
| PHPMD | Warning | 13 | 13 rule violations (NPathComplexity:5, MissingImport:3, CyclomaticComplexity:3, UnusedFormalParameter:1, ExcessiveClassComplexity:1) |
| 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 | 30 | 30 | – | – |
| 2.4.8 | – | 30 | 30 | – |
| 2.4.9 | – | – | 30 | 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-page-speed-optimizer-premium"],
  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.

