yireo / magento2-clean-modules
Magento 2 module to remove invalid entries from app/etc/config.php
Yireo_CleanModules
This Magento 2 module adds a CLI command
yireo:modules:cleanto remove non-existing modules fromapp/etc/config.php
Installation
Install this package via composer:
composer require yireo/magento2-clean-modules
Next, enable this module:
bin/magento module:enable Yireo_CleanModules
Usage
bin/magento yireo:modules:check # Lists enabled modules that do not exist (exit code 1 if any)
bin/magento yireo:modules:clean --dry-run # Shows which modules would be disabled
bin/magento yireo:modules:clean # Asks for confirmation, backs up app/etc/config.php and disables missing modules
bin/magento yireo:modules:clean --force # Skips the confirmation and the safety check on core modules or more than 10 modules
Current status
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[Unreleased]
[0.0.3] - 25 November 2026
Added
yireo:modules:cleanhas a--dry-runoption to preview which modules would be disabled, and a--forceoption to skip the confirmation and safety checks
Changed
yireo:modules:cleannow asks for confirmation, refuses to disableMagento_core modules or more than 10 modules at once without--force, and writes a backup ofapp/etc/config.phpbefore changing ityireo:modules:checknow exits with a failure code when modules are missing
Removed
- Support for PHP 8.1 and Magento framework versions older than 103.0.6 (now requires PHP 8.2 to 8.5)
Fixed
- Storefront CSP violation reports, including full page URLs with password reset tokens, were sent to a third-party uriports.com endpoint
- Google, Google Tag Manager and PayPal hosts were globally allowed in the storefront CSP policy
app/etc/config.phpcould get corrupted, because it was read withincludeand rewritten by string replacement instead of through Magento's deployment config- Missing modules are now detected via the component registrar and module names are escaped in console output
[0.0.1] - 10 April 2025
Fixed
- Initial release
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 0.0.4 | stable | Pass | Magento 2.4.7-2.4.9 Details | 2026-11-26 14:44:05 |
| 0.0.3 | stable | Pass | Magento 2.4.7-2.4.9 Details | 2026-11-25 19:03:38 |
| 0.0.2 | stable | Pass | Not yet tested Details | 2025-07-24 09:17:27 |
| 0.0.1 | stable | Not tested | Not yet tested Details | 2025-04-10 09:19:00 |
Requires 2
| Package | Constraint |
|---|---|
| magento/framework | ^103.0.6|^104.0 |
| php | >=8.2 <8.6 |
Requires-dev 1
| Package | Constraint |
|---|---|
| yireo/magento2-integration-test-helper | ~0.0 |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. 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 | 8 | 8 warnings (ruleset: Magento2), 6 auto-fixable with phpcbf |
| PHPMD | Warning | 4 | 4 rule violations (UnusedFormalParameter:1, CyclomaticComplexity:1, NPathComplexity:1, TooManyPublicMethods:1) |
| Cpd | Pass | 0 | |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
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 |
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
More from yireo
View vendorReplace bundled third party packages from Magento
N/A
Turn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.