Performance Optimizer for Magento 2
Add eligible missing image dimensions, iframe loading attributes and font-display rules to Magento layout output. Review the bounded changes against the store’s existing markup.
- Free
- Themes listed: Hyvä + Luma
composer require mage2kishan/module-performance-optimizer
- Package requirementsRead the source documentation
- Developer profileView Upwork profile
- Themes listedHyvä + Luma
- PHP versions listed8.1, 8.2, 8.3, 8.4
- Installation questionsDiscuss your store setup
What it does for your store
The main features, as listed in the module documentation.
-
Missing image dimensions
Resolve eligible local images and fill supported missing width or height values.
-
Iframe loading attributes
Add loading=lazy when eligible iframe markup has no loading attribute.
-
Inline font-display rules
Add swap to eligible inline font-face rules that lack a font-display declaration.
-
Optional x-cloak style
Output the x-cloak hiding rule when the relevant switch is enabled.
Installation
Example commands from the Magento root. Follow the package instructions and your staging and deployment process.
- 1Check the releaseMatch Magento, PHP, theme and dependency requirements.
- 2Install on stagingReview Composer changes and follow the package instructions.
- 3Configure and verifyUse the documented settings and test the affected features.
$ composer require mage2kishan/module-performance-optimizer $ bin/magento setup:upgrade $ bin/magento setup:di:compile $ bin/magento setup:static-content:deploy -f $ bin/magento cache:clean
Listed requirements
These are the details supplied in this listing. Confirm the selected release supports your Magento edition, PHP and storefront.
| Magento versions listed | 2.4.6, 2.4.7, 2.4.8 |
|---|---|
| PHP versions listed | 8.1, 8.2, 8.3, 8.4 |
| Themes listed | Hyvä, Luma |
| Composer package | mage2kishan/module-performance-optimizer |
Documentation
Product details and setup guidance. Check the package repository for release-specific instructions.
Overview
Panth Performance Optimizer applies a small set of changes to Magento layout output: missing image dimensions, iframe loading attributes and eligible inline font rules. It can also emit an x-cloak hiding style for compatible markup. Start with the specific output problem you need to address.
What you get
- Missing image width/height values from eligible local files.
- Lazy loading added to iframes without an existing loading attribute.
- font-display:swap added to eligible inline font-face rules.
- An optional x-cloak style.
Magento 2 Performance Optimizer
This page describes published mage2kishan/module-performance-optimizer 1.0.12. It does not implement third-party script deferral, image conversion or cache warming. The performance catalogue distinguishes packages by task; an assessed performance service covers commissioned investigation and implementation.
Features
The plugin changes supported markup while retaining existing values where its rules require that. The effect depends on the page and its assets. No package setting guarantees a Lighthouse score, a Core Web Vitals pass or a ranking change.
Usage
Use representative product, category and content pages to check the configured behaviour. Test enabled and disabled states, existing attributes and interactions with other extensions before widening a rollout.
Third-party script deferral
The helper and configuration still contain deferral-related keys, but the shipped template and plugin do not implement third-party script deferral. Do not treat those keys as an active deferral feature.
font-display: swap
The layout rewrite adds font-display:swap to a simple inline @font-face rule only when it has no font-display text. It does not fetch or edit external CSS. Check the resulting font behaviour and any content security policy requirements.
x-cloak style
When enabled, the frontend template emits [x-cloak]{display:none!important}. This expects a compatible component lifecycle to remove x-cloak; the style alone does not initialize Alpine or repair component logic.
Server-side rewriting
The plugin processes layout output before it reaches the browser. It skips comments and protected script, template, textarea and similar contents; eligible inline style content is handled for font rules. Test the output boundaries of the actual theme instead of assuming every fragment or external asset is rewritten.
Image dimensions
The registry resolves eligible root-relative or matching-host image paths to readable files under pub and caches the result. It does not download external images. With neither dimension present, the plugin adds both; with one positive integer dimension, it derives the other using the file ratio. Existing width and height together are left unchanged. Unsupported, unreadable and data-URL images are skipped.
Iframe lazy loading
Inspect embeds in both initial HTML and any client-rendered content. The server plugin only sees the layout output it processes; later JavaScript insertion needs its own loading policy. Check that important visible embeds remain usable.
Documentation
Use the pinned release README alongside the owning helper, template and plugin code. Later main-branch documentation can differ from this release.
Changelog
Read the package release notes before changing versions and compare them with the Composer version and source reference. Check dependency and configuration changes before upgrading.
Compatibility
The 1.0.12 manifest declares PHP ~8.1.0||~8.2.0||~8.3.0||~8.4.0 and the Magento component requirements in the release source. These dependency declarations and upstream theme statements are not a tested edition/version/theme matrix. The README table partly cites this product page, so it is not independent compatibility evidence. Match your platform to Adobe's version-specific system requirements and test your actual combination.
Requirements
Composer requires mage2kishan/module-core:^1.0 and the Magento components listed in this release's manifest. Review the declared PHP extensions and the relevant frontend integrations before installation. A successful dependency resolution does not replace functional testing.
Installation
Choose the package version you intend to deploy and install it on a staging copy first. The commands below identify the module; compile and static asset steps depend on your deployment mode. Follow Adobe's extension workflow and your project release process.
composer require mage2kishan/module-performance-optimizer
bin/magento module:enable Panth_Core Panth_PerformanceOptimizer
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean
bin/magento module:status Panth_PerformanceOptimizer
Configuration
Select the intended default, website or store view scope, then review the relevant controls below. Change one capability at a time and compare the generated output or request results with the original behaviour.
General Settings
The master switch is panth_performance/general/enabled and defaults to Yes. Review the feature switches on a staging copy before deploying this release into a store with existing optimization modules.
Font Optimization
The font-display switch defaults to Yes. Eligible inline style rules lacking font-display can receive swap. Existing font-display declarations remain, and external stylesheets are not rewritten by this plugin.
Layout Stability (CLS Prevention)
Image-dimension insertion and the x-cloak style default to Yes. They address specific layout mechanisms; they do not prevent every source of layout shift. Review image ratios, responsive sizing and Alpine lifecycle behaviour in the actual page.
Iframe Lazy Loading
The iframe lazy-loading switch defaults to Yes. The plugin adds loading=lazy only when an eligible iframe tag has no loading attribute. Existing loading values are preserved.
Uninstallation
Review dependants and capture rollback data before disabling or removing the package. Removing code does not by itself establish that settings, stored logs or generated/cache data have been removed. Follow the exact release notes and a reviewed removal plan.
bin/magento module:disable Panth_PerformanceOptimizer
composer remove mage2kishan/module-performance-optimizer
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean
License
This published release declares MIT and includes the MIT notice. Keep that notice when redistributing the software; see the release licence. This statement does not apply current terms to older releases or promise future updates, support or performance results.
Developer Notes
The module is Panth_PerformanceOptimizer. Plugin/Layout/InjectImageDimensionsPlugin performs the bounded rewrite, while Service/ImageDimensionRegistry looks up local sizes. Browser collection belongs to Core Web Vitals Monitor and image loading strategy belongs to Image Optimizer.
| Module Category | Performance |
|---|---|
| Best For | All Sizes |
Questions before you install?
Send me your composer.json and I will check for conflicts first. Free. Installation is +$45, custom work is quoted first.