hk2 / core
HK2 Core module - The foundational base module for all Magento 2 HK2 extensions.
HK2 Core
Overview
The HK2 Core module is the foundational base module for all Magento 2 HK2 extensions. It establishes standard administrative configurations, reusable backend blocks, and standardized headers for module configuration screens.
🎯 Use Cases
- Module Base: Required by all other HK2 extensions (AddBootstrap5, CSP, ScrollTop, etc.) to function correctly.
- Admin Consolidation: Consolidates HK2 module configurations into a single, organized tab in the Magento Admin Panel.
🚀 Features
- ⚙️ Registers a centralized "HK2 Extensions" configuration tab.
- 📂 Sets up a main admin menu item under System for HK2.
- 🔒 Implements a root ACL resource for all HK2 modules.
- 🎨 Provides a reusable
ModuleHeaderblock for consistent branding.
🏗 Architecture
- Core Module Components: Base adminhtml system configurations.
- Design Patterns: Standard Magento UI configuration implementations.
🧩 Magento Components
Blocks
HK2\Core\Block\Adminhtml\System\Config\ModuleHeader
Layout XML
HK2_Core::system/config/module_header.phtml
📦 Requirements
- Magento version: 2.4.4 - 2.4.9
- PHP requirements: 8.1 || 8.2 || 8.3 || 8.4
- Composer requirements:
magento/framework: ^103.0.0
⚙️ Installation
composer require hk2/corebin/magento module:enable HK2_Corebin/magento setup:upgradebin/magento setup:di:compilebin/magento cache:flush
🔧 Configuration
This module primarily provides configuration tabs for other modules. No specific configuration is required for the Core module itself.
Usage
This module works silently in the background. Once installed, navigating to Stores > Configuration will display a new "HK2" tab where dependent modules will render their settings.
🗄 Database Changes
Not Applicable
📂 Module Structure
Block/
├── Adminhtml/
│ └── System/
│ └── Config/
│ └── ModuleHeader.php
etc/
├── adminhtml/
│ ├── menu.xml
│ └── system.xml
├── acl.xml
└── module.xml
view/
└── adminhtml/
└── templates/
└── system/
└── config/
└── module_header.phtml
🧪 Testing
Not Applicable
📈 Performance Considerations
Not Applicable
🔐 Security Considerations
- ACL usage: Defines
HK2_Core::rootbase ACL for administrative access to HK2 configurations.
Compatibility
Reference: docs/compatibility.md
| Platform | Supported Versions |
|---|---|
| Magento | 2.4.4 - 2.4.9 |
| PHP | 8.1, 8.2, 8.3, 8.4 |
🔄 Upgrade Notes
Not Applicable
🛠 Troubleshooting
If HK2 tabs do not appear in the admin panel, ensure that the cache has been flushed and HK2_Core is enabled using bin/magento module:status.
🤝 Contributing
Contributions are welcome! If you'd like to improve the installer:
- ⭐ Star this repository (Helps others find it!)
- 🍴 Fork the project
- 🐛 Report bugs
- 💡 Suggest new features
- 🤝 Contribute improvements
Every ⭐ helps increase the visibility of the project and motivates further development.
⚖️ Disclaimer
The author provides this installation script "as is" without any warranties. Users are responsible for ensuring that running this script complies with their internal security and software requirements.
🤝 Support
For bug reports, feature requests, and general support:
- Author: Basant Mandal
- Email: [email protected]
- Website: https://www.basantmandal.in
License
This project is licensed under the OSL 3.0 License. See the LICENSE.txt file for details.
1.0.0 (2026-07-16)
⚠ BREAKING CHANGES
- add HK2 Core module with initial files and configurations
✨ Features
- add HK2 Core module with initial files and configurations (0a349e4)
Requires 2
| Package | Constraint |
|---|---|
| magento/framework | ^103.0.0 |
| php | ^8.1 || ^8.2 || ^8.3 || ^8.4 |
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.
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 |
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
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 hk2
View vendorMagento 2 Marketing Analytics: Google Analytics, Facebook Pixel, Product Feed & Conversion Tracking
Sanitizes Magento storefront search queries by removing suspicious SQL-related keywords and characters.
Magento 2 module to manage CSP whitelisted URLs
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.