PHPackages                             hryvinskyi/magento2-module-detector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hryvinskyi/magento2-module-detector

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

hryvinskyi/magento2-module-detector
===================================

Magento 2 Module Detector - Identifies potentially unused modules for security and performance optimization

1.0.0(11mo ago)2180↓33.3%MITPHPPHP &gt;=8.1

Since Jul 11Pushed 11mo agoCompare

[ Source](https://github.com/hryvinskyi/magento2-module-detector)[ Packagist](https://packagist.org/packages/hryvinskyi/magento2-module-detector)[ RSS](/packages/hryvinskyi-magento2-module-detector/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Magento 2 Module Detector
=========================

[](#magento-2-module-detector)

A comprehensive Magento 2 module for detecting potentially unused modules in your Magento installation. This security-focused tool helps identify modules that may be safely removed to improve performance and reduce security surface area.

Features
--------

[](#features)

### **Comprehensive Analysis**

[](#comprehensive-analysis)

- **Database Usage Detection**: Analyzes declared tables, row counts, and EAV attributes
- **Configuration Analysis**: Checks for system configuration usage
- **File System Inspection**: Examines controllers, models, blocks, and other components
- **Dependency Tracking**: Identifies modules that depend on the analyzed module
- **Risk Assessment**: Provides risk levels (HIGH, MEDIUM, LOW, VERY\_LOW) for safe removal

### **Dual Interface**

[](#dual-interface)

- **CLI Command**: Perfect for automation and CI/CD pipelines
- **Admin Panel**: User-friendly web interface with real-time analysis

 Demo admin[![magento_admin1.jpg](docs/images/magento_admin1.jpg)](docs/images/magento_admin1.jpg)

\## Installation 1. **Install via Composer**:

    ```
    composer require hryvinskyi/magento2-module-detector
    ```
2. **Enable the module**:

    ```
    ddev magento module:enable Hryvinskyi_ModuleDetector
    ddev magento setup:upgrade
    ddev magento setup:di:compile
    ddev magento cache:flush
    ```
3. **Verify installation**:

    ```
    ddev magento module:status Hryvinskyi_ModuleDetector
    ```

Usage
-----

[](#usage)

### CLI Command

[](#cli-command)

#### Basic Analysis

[](#basic-analysis)

```
ddev magento hryvinskyi:module:analyze-unused
```

#### Verbose Output

[](#verbose-output)

```
ddev magento hryvinskyi:module:analyze-unused --verbose
```

#### JSON Output (for automation)

[](#json-output-for-automation)

```
ddev magento hryvinskyi:module:analyze-unused --json
```

### Admin Panel

[](#admin-panel)

1. Navigate to **Admin Panel → System → Tools → Module Analysis**
2. Click **"Run Analysis"** to start the detection process
3. Review results organized by risk level
4. Use the detailed information to make informed decisions

Analysis Criteria
-----------------

[](#analysis-criteria)

### Module Status

[](#module-status)

- Enabled/disabled status in `app/etc/config.php`
- Frontend output status in admin configuration

### Database Usage

[](#database-usage)

- Empty or missing database tables
- Unused EAV attributes
- Table row counts and data analysis

### Configuration Usage

[](#configuration-usage)

- System configuration entries
- `system.xml` declarations vs actual usage

### File System Analysis

[](#file-system-analysis)

- Controllers, blocks, models, observers
- Last modification timestamps
- Code complexity indicators

### Dependencies

[](#dependencies)

- Modules that depend on the analyzed module
- Composer and `module.xml` dependencies

Risk Levels
-----------

[](#risk-levels)

Risk LevelIconColorDescriptionRecommendation**🟢 Safe to Remove**🟢GreenModule is disabled, has no data, and no dependenciesCan be safely deleted**🟡 Probably Unused**🟡YellowModule shows minimal usage but appears inactiveReview and likely safe to remove**🟠 Review Needed**🟠OrangeModule has mixed signals - some usage detectedCarefully analyze before making decisions**🔴 Keep Module**🔴RedModule is actively used or has critical dependenciesShould NOT be removed### Risk Assessment Criteria

[](#risk-assessment-criteria)

The risk level is calculated based on multiple factors:

**🟢 Safe to Remove (Score: 12+)**

- Module is disabled in configuration
- No database records or empty tables
- No configuration entries
- No active files or components

**🟡 Probably Unused (Score: 6-11)**

- Minimal database usage
- Few or no configuration entries
- Limited file activity
- No recent modifications

**🟠 Review Needed (Score: 0-5)**

- Some database activity detected
- Has configuration or files present
- Mixed usage indicators
- Requires manual review

**🔴 Keep Module (Score: &lt;0)**

- Other modules depend on this module
- Recently modified files
- Active EAV attributes in use
- Clear signs of being needed

Safety Recommendations
----------------------

[](#safety-recommendations)

⚠️ **Always test in development environment first**

1. **Backup your system** before removing any modules
2. **Run analysis regularly** to track module usage over time
3. **Check dependencies** - other modules may rely on the analyzed module
4. **Test thoroughly** after module removal
5. **Monitor logs** for any related errors

Output Examples
---------------

[](#output-examples)

### CLI Output

[](#cli-output)

```
📊 UNUSED MODULES DETECTION REPORT
================================================================================
Found 3 potentially unused modules:
  • Safe to Remove: 1 modules
  • Probably Unused: 2 modules

🟢 SAFE TO REMOVE (1)
----------------------------------------

📦 Vendor_UnusedModule (v1.0.0)
   ❌ Module is disabled in app/etc/config.php
   ❌ All declared database tables are empty or missing
   📊 Database: 2 tables, 0 rows total

💡 RECOMMENDATIONS:
• 🟢 SAFE TO REMOVE: These modules can be safely deleted
• 🟡 PROBABLY UNUSED: Review these modules - likely safe to remove
• 🟠 REVIEW NEEDED: Carefully analyze before making decisions
• 🔴 KEEP MODULE: These modules should NOT be removed

```

### Admin Panel Features

[](#admin-panel-features)

- Real-time analysis progress
- Color-coded risk levels
- Expandable module details
- Export capabilities
- Responsive design

Technical Details
-----------------

[](#technical-details)

### Requirements

[](#requirements)

- **PHP**: 8.1 or higher
- **Magento**: 2.4.6 or higher
- **Extensions**: Standard Magento requirements

### Architecture

[](#architecture)

- **Service Contracts**: Proper API interfaces
- **Dependency Injection**: Full DI container support
- **Type Safety**: Strict typing throughout
- **PSR Standards**: Follows PSR-4 autoloading

### Performance

[](#performance)

- **Optimized Queries**: Efficient database analysis
- **Memory Management**: Handles large module sets
- **Caching**: Smart caching of repeated operations

### Contributing

[](#contributing)

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request

License
-------

[](#license)

Copyright (c) 2025. Volodymyr Hryvinskyi. All rights reserved.

This module is released under the MIT License. See LICENSE file for details.

Support
-------

[](#support)

For issues, questions, or contributions:

- **Email**:
- **GitHub**: Create an issue in the repository

Changelog
---------

[](#changelog)

### Version 1.0.0

[](#version-100)

- Initial release
- CLI command implementation
- Admin panel interface
- Comprehensive module analysis
- Risk assessment system
- Security features and ACL

---

**⚠️ Disclaimer**: This tool provides analysis to help identify potentially unused modules. Always test thoroughly in a development environment before making changes to production systems. The authors are not responsible for any issues that may arise from module removal.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance51

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

348d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9294098?v=4)[Volodymyr Hryvinskyi](/maintainers/hryvinskyi)[@hryvinskyi](https://github.com/hryvinskyi)

---

Top Contributors

[![hryvinskyi](https://avatars.githubusercontent.com/u/9294098?v=4)](https://github.com/hryvinskyi "hryvinskyi (1 commits)")

### Embed Badge

![Health badge](/badges/hryvinskyi-magento2-module-detector/health.svg)

```
[![Health](https://phpackages.com/badges/hryvinskyi-magento2-module-detector/health.svg)](https://phpackages.com/packages/hryvinskyi-magento2-module-detector)
```

###  Alternatives

[baldwin/magento2-module-url-data-integrity-checker

Magento 2 module which can find potential url related problems in your catalog data

282806.2k](/packages/baldwin-magento2-module-url-data-integrity-checker)[mollie/magento2

Mollie Payment Module for Magento 2

1121.8M12](/packages/mollie-magento2)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

68353.9k](/packages/run-as-root-magento2-prometheus-exporter)[loki/magento2-components

Core module for defining Alpine.js components with advanced AJAX features

1010.0k22](/packages/loki-magento2-components)[magepal/magento2-form-field-manager

Customer and Address Form Fields Manager for Magento2

273.9k](/packages/magepal-magento2-form-field-manager)[mage-os/module-admin-activity-log

The Admin Activity extension makes it easy to track all admin activity with comprehensive audit logging.

293.3k](/packages/mage-os-module-admin-activity-log)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
