honl / magento2-import

honl/magento2-import

magento2-module Compatibility: 2.4.7 Code Quality: Fail Tests: N/A Security: Pass

Magento 2 Importing library

Import library to create an array-interface for importing products/categories. Ho_Import is build on top
of Magento's internal Import/Export modules.

The goal of the library is to be a swiss army knife for importing products in Magento 2. Features include:

  • Stream XML over HTTP and from disk
  • Download files from HTTP(s)/FTP
  • Map items from source file to Magento format
  • Lot's of RowModifiers
  • Fixed importer core bugs

ExampleProfile.php

Installation

composer config repositories.honl/magento2-import vcs [email protected]:ho-nl/magento2-Ho_Import.git
composer require honl/magento2-import

Goals

Performance: Since building imports is (really) hard and requires a lot of feedback loops to get your data right (change, check, change, check), it is absolutely essential that is as fast as possible. A developer can't work if he has to wait 10 minutes after each change. So only having to wait only a few seconds to be able to see what is going into Magento is essential.

Ease of use: The API should be clear that a developer is only limited by their knowledge of Magento it's self. No junior developer should have to thing about streaming files, performance and memory usage.

Extensible: It should be very easy to extend and customize a import

Maintainable: The library should have a stable API (currently not stable yet) so that we can upgrade imports that are build a year ago without having to worry that everything will break.

Getting the abstraction right

With Ho_Import for Magento 1, we created a custom DSL to map external files to a Magento compatible format. This worked, but we soon discovered that we needed a lot of basic PHP functionality in the importer. We caught ourselves implementing PHP functionality in Ho_Import compatible wrappers...

The alternative was working bare with Avs_FastSimpleImport gave no abstraction other than, 'you can fill this array'. Although this was a huge leap forward from 'create your own csv file', it didn't offer any tools to make building imports easier more robust and faster.

Now, writing a new import library for Magento 2 and having to start from scratch, it was a good moment to create a new abstraction. Assuming that people who need to build imports at least know the basics of Magento 2 programming we can create an import that doesn't rely on 'nice abstractions', but does offer the tools to get an import quickly up and running.

  1. Create a single class file to create a fully functional import. If the class is too complex, the developer can decide to spit the logic them selves.
  2. Use RowModifiers to modify data and make it easy for other developers to create new

The core concept of the new import library is based around RowModifiers.

What are RowModifiers?

A RowModifier can update items, add items, delete items, add new values, rewrite values, validate rows, etc.

Example usage of the \Ho\Import\RowModifier\ItemMapper

$items = [ ... ]; //Array of all products

/** @var \Ho\Import\RowModifier\ItemMapper $itemMapper */
$itemMapper = $this->itemMapperFactory->create([
    'mapping' => [
        'store_view_code' => \Ho\Import\RowModifier\ItemMapper::FIELD_EMPTY,
        'sku' => function ($item) {
             return $item['ItemCode'];
         }
        'name' => function ($item) {
            return $item['NameField'] . $item['ColorCode'];
        }
    ]
]);
$itemMapper->setItems($items);
$itemMapper->process($items); //The items array is modified with new values.

RowModifies all inherit from \Ho\Import\RowModifier\AbstractRowModifier

General Assumptions

  • People writing imports are programmers or at least have basic programming knowledge.
  • Magento's importer is limited and certainly doesn't Just Work(tm), we need to build abstractions on top to be able to actually focus on the import instead of all the 'stuff' that comes with an import.

Technical assumptions

  • PHP's array format is memory efficient enough that it can hold all products needing to be imported in memory. e.g. 50k products requires more memory, but is usually ran on a beefy server.

Contibutors

Here at H&O we've created many imports for clients, we have exstenbuild Ho_Import, core contributor to Avs_FastSimpleImport

that mapped source files to Magento compatible formats, but was never
intended to solve problems with url rewrites, creating configurables. All that functionality

This library builds on top of Magento's internal Import/Export module

Console commands

ho:import:run profileName

Run an import script directly (not recommended on live environments, might cause deadlocks).

cron:schedule jobName

Schedule a job to run immediately.

Credits

The module is written by Paul Hachmang (twitter: @paales, email: [email protected]) and build for Reach Digital. We make Magento Webshops (website: https://www.reachdigital.nl/, email: [email protected], twitter: @ho_nl).

No changelog yet

The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.

Versions
Version Stability QA Status Compatibility Released
1.4.1 stable Fail Magento 2.4.7 Details 2026-05-29 09:17:32
1.4.0 stable Not tested Not yet tested Details 2026-05-29 08:54:29
1.3.9 stable Not tested Not yet tested Details 2026-05-05 08:03:55
1.3.8 stable Not tested Not yet tested Details 2026-04-29 12:40:58
1.3.7 stable Not tested Not yet tested Details 2026-04-29 11:45:39
1.3.6 stable Not tested Not yet tested Details 2025-11-20 13:47:12
1.3.5 stable Not tested Not yet tested Details 2024-10-23 14:34:21
1.3.4 stable Not tested Not yet tested Details 2023-08-30 07:27:09
1.3.3 stable Not tested Not yet tested Details 2023-08-15 11:02:25
1.3.2 stable Not tested Not yet tested Details 2023-06-20 12:17:16
1.3.1 stable Not tested Not yet tested Details 2023-02-16 13:23:33
1.3.0 stable Not tested Not yet tested Details 2023-02-16 13:02:00
1.2.0 stable Not tested Not yet tested Details 2022-10-17 12:50:22
1.1.2 stable Not tested Not yet tested Details 2022-04-26 08:45:21
1.1.1 stable Not tested Not yet tested Details 2022-03-21 14:29:37
1.1.0 stable Not tested Not yet tested Details 2022-02-17 11:39:12
1.0.4 stable Not tested Not yet tested Details 2022-02-15 10:50:22
1.0.5 stable Not tested Not yet tested Details 2022-02-15 10:50:22
1.0.3 stable Not tested Not yet tested Details 2022-02-14 11:28:25
1.0.2 stable Not tested Not yet tested Details 2022-01-21 13:22:31
1.0.1 stable Not tested Not yet tested Details 2021-09-21 12:57:30
1.0.0 stable Not tested Not yet tested Details 2021-09-21 12:19:10
0.4.0 stable Not tested Not yet tested Details 2016-11-15 14:26:14

Requires 11

Package Constraint
php ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.1 || ~8.2 || ~8.3 || ~8.4
guzzlehttp/guzzle ^7
prewk/xml-string-streamer ^1.2
prewk/xml-string-streamer-guzzle ^1.2
kevinrob/guzzle-cache-middleware ^4
ho-nl-fork/magento-psr6-bridge ^0.2
symfony/stopwatch ^6.2 || ^7.0
ho-nl-fork/psr7-csv-factory ^1.0
league/csv ^9.1
monolog/monolog ^2.8 || ^3.0
ext-mbstring *

Suggests 1

Package Reason
openspout/openspout Required for Ho\Import\Streamer\FileXlsx — streaming XLSX reader (PHP 8.3+). Install via `composer require openspout/openspout`.

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 Fail di error not tested
2.4.9 not tested not tested

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 Fail 184 12 errors, 172 warnings (ruleset: Magento2) — 57 auto-fixable with phpcbf
PHPMD Warning 49 49 rule violations (MissingImport:21, UnusedFormalParameter:5, CyclomaticComplexity:5, NPathComplexity:4, IfStatementAssignment:3)
Cpd Warning 1 1 duplicated chunk spanning 95 total lines (min-lines=5, min-tokens=70)
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. Cell → details modal.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 1 1
2.4.8 1 1
2.4.9 1 1

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

No license declared

This package's composer.json doesn't declare a license, homepage, or authors. Check the source repository for terms of use.

More from honl

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.