hk2 / core

hk2/core

HK2 Core module - The foundational base module for all Magento 2 HK2 extensions.

magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Pass Tests: N/A Security: Pass OSL-3.0

Are you the maintainer of hk2?

Packagento pulls hk2's Composer packages from the public registry so buyers can find them here.

Claim the namespace to take ownership, publish new releases directly, and start charging for premium versions.

Claim this namespace →

HK2 Core

Version
License
Magento
PHP
Downloads

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 ModuleHeader block 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

  1. composer require hk2/core
  2. bin/magento module:enable HK2_Core
  3. bin/magento setup:upgrade
  4. bin/magento setup:di:compile
  5. bin/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::root base 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:

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)
Versions
Version Stability QA Status Compatibility Released
v1.0.0 stable Pass Magento 2.4.7-2.4.9 Details 2026-07-16 12:59:55

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.

Compatibility matrix (Magento × PHP)
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. 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.

Static analysis results
Tool Status Findings Summary
PHPCS Pass 0
PHPMD Pass 0
Cpd Pass 0
Composer validate Pass 0

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.

PHPStan results by Magento and PHP version
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

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

Unit tests results by Magento and PHP version
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

Integration tests results by Magento and PHP version
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.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
OSL-3.0
Authors

More from hk2

View vendor
Make it pay

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.