# magefan/module-speed-optimization

> Magefan Speed Optimization extension for Magento 2

`composer require magefan/module-speed-optimization`

Canonical URL: https://packagento.com/magefan/module-speed-optimization

## At a glance

- **Vendor**: magefan (https://packagento.com/magefan.md)
- **Latest version**: 2.0.4 — released 2026-03-24
- **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/magefan/module-speed-optimization 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 magefan/module-speed-optimization:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Magefan Speed Optimization extension for Magento 2

## README

<img align="right" width="120" height="120" src="https://cm.magefan.com/catalog/product/cache/28b407cef1668fd0bdd6f36db3e8e2f0/i/c/icon-google-page-speed-optimizer.jpg">

[Magento 2 Google Page Speed Optimizer](https://magefan.com/magento-2-google-page-speed-optimizer) is a solution to your speed optimization problems. It optimizer every little details that slow down your website: images, JS and CSS files, HTML code, database, cache and more.. 

Get into the Google Page Speed Insights green zone with little to no effort. Improve Magento loading speed and deliver better customer experience.

<img  align="right" width="120" height="70" src="https://magefan.com/media/wysiwyg/made_in_ukraine.jpg">

<a href="https://magefan.com/magento-2-google-page-speed-optimizer"><img width="190" height="70" src="https://cm.magefan.com/wysiwyg/products/download-magefan-extensions.png"></a>

### Useful Links
  * [User Guide](https://magefan.com/magento-2-google-page-speed-optimizer/documentation)
  * [Change Log](https://magefan.com/magento-2-google-page-speed-optimizer/change-log)
  * [FAQs](https://magefan.com/magento-2-google-page-speed-optimizer#pattr-faq)

### 🇺🇦 Stand with Ukraine! [How can you help?](https://magefan.com/blog/join-our-donations)

### Requirements
  * Magento Community 2.3.0-2.4.x (CE, EE, ECE, B2B)
  * [Magefan Community Extension](https://github.com/magefan/module-community) >= v2.1.30. Please install this extension first if you use installation via FTP.
  * **Note** that the extension is free only for the Magento Community (Open Source) Edition. For Magento EE, ECE, and B2B you need to purchase the license for [Base, Plus, or Extra](https://magefan.com/magento-2-google-page-speed-optimizer/pricing).

### Editions & Pricing
  
<a href="https://magefan.com/magento-2-google-page-speed-optimizer/pricing">
          <img
            src="https://cm.magefan.com/wysiwyg/products/google-page-speed-pricing-plans.png"
            alt="Plans and Pricing for Magento 2 Google Page Speed Optimizer" />
</a>
    
### Benefits

* Faster website loading speed
* Improved SEO ranking
* Optimised customer experience 

### Features
#### Speed Up Magento Speed for Good
Google analyses a lot of things when ranking your store in search. The most attention always goes to the loading speed which is the hardest to optimise.
But the struggle ends now.

Magento 2 Google Page Speed Optimizer covers the technical side of speed optimisation entirely. All the critical PageSpeed highlights are already optimised for high scores.

Improve your website performance on autopilot without spending a fortune

<p align="center">
  <img width="860" height="428" src="https://cm.magefan.com/mf_webp/png/media/wysiwyg/products/magento-2-speed-optimization.webp">
</p>

#### Defer JS and CSS Files Loading

Defer JS and CSS Files Loading
While not visible to website visitors, a lot of files need to load before the page is rendered. If there are too many of them, you lose customers. 

Are all files that load critical? Surely not. 

Make sure to load only critical files first to speed up page loading. Let our Magento 2 Google Page Speed Optimizer move non-critical CSS and JS files to the bottom and load them gradually. 

<p align="center">
  <img width="860" height="428" src="https://cm.magefan.com/mf_webp/png/media/wysiwyg/products/magento-2-deffer-js-css-loading.webp">
</p>

#### Use JS Bundling to Speed Things Up

Although you don’t see a significant part of the code your store is built with, it loads every time a page is loaded. This increases the size and loading time of a page.

Stop the excessive JS loading with JS bundling.
Use the Magento 2 Speed Optimization Extension to combine and load only required JS files.

Merge these required files into one to reduce the loading time even more.

<p align="center">
  <img width="860" height="428" src="https://cm.magefan.com/mf_webp/png/media/wysiwyg/products/magento-2-js-bundling.webp">
</p>

#### Minify JS, CSS and HTML Files

Although Magento 2 Google Page Speed Optimizer can load different JS and CSS files differently, the size of these files could still be a problem. 

But not in our case.

Reduce the extra spaces, block delimiters and comments from the CSS and HTML files to make them “lighter”. Combine JS files to reduce the file size and speed up their loading. 

<p align="center">
  <img width="860" height="428" src="https://cm.magefan.com/mf_webp/png/media/wysiwyg/products/minify-js-css-html-in-magento-2.webp">
</p>

#### Lazy Load All Images

Images take the biggest space on your disk, though you don’t even use all of them. Does this influence your website speed? No need to guess. 

Load only critical images and those within the visitors’ viewport to speed up Magento loading. 

Enable image lazy loading with the Magento 2 Google Page Speed Optimizer and make your speed optimization journey easier.
 

<p align="center">
  <img width="860" height="428" src="https://cm.magefan.com/mf_webp/png/media/wysiwyg/products/magento-2-image-lazy-load.webp">
</p>

#### Use Modern File Format

You can defer image loading for all your images, but it doesn’t make them less heavy. Only unless you use the modern file format - WebP - which is smaller and faster to load.

Convert all your website images and gifs to the WebP format with the Magento 2 Google Page Speed Optimizer. 

Let the module do the job automatically or upload your own WebP image to the Magento admin panel. The choice is yours. 

<p align="center">
  <img width="860" height="428" src="https://cm.magefan.com/mf_webp/png/media/wysiwyg/products/magento-2-webp-images.webp">
</p>

#### Keep Your Cache Warmed Up

When all the other page elements are optimized, the last thing that could be delaying the page load is the cache. Flushed cache to be exact.

Don’t make browsers load a page from scratch every time.

Make sure a fresh copy of your content is always cached with the Magento 2 Google Page Speed Optimizer.

_(README truncated for .md surface. Full README on https://packagento.com/magefan/module-speed-optimization.)_

## Recent Versions

| Version | Released |
|---|---|
| 2.0.4 | 2026-03-24 |
| 2.0.3 | 2025-05-08 |
| 2.0.2 | 2025-03-20 |
| 2.0.1 | 2025-02-04 |
| 2.0.0 | 2024-10-08 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magefan/module-community | >=2.3.4 |
| magefan/module-lazyload | >=2.1.7 |
| magefan/module-rocketjavascript | >=2.2.3 |

## Quality

Latest release (2.0.4) 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 | Pass |


### 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 | 35 | 35 warnings (ruleset: Magento2) — 10 auto-fixable with phpcbf |
| PHPMD | Warning | 13 | 13 rule violations (UnusedFormalParameter:6, UndefinedVariable:5, IfStatementAssignment:1, ExcessiveMethodLength:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 4 | valid; 4 advisory notes (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 | 87 | 87 | – | – |
| 2.4.8 | – | 96 | 96 | – |
| 2.4.9 | – | – | 96 | 96 |


### 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=["magefan/module-speed-optimization"],
  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

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

