yireo / magento2-tablerate-commands

yireo/magento2-tablerate-commands

N/A

magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Fail Tests: Fail Security: Pass OSL-3.0

Yireo_TablerateCommands

Magento version
PHP version
License
Latest Version

A Magento 2 module offering CLI commands to manipulate table rates

Installation

composer require yireo/magento2-tablerate-commands
bin/magento module:enable Yireo_TablerateCommands

Usage

List all existing tablerates (optionally only those of website ID 1):

bin/magento yireo_tablerates:list
bin/magento yireo_tablerates:list --website_id=1

Export all existing tablerates with website ID 1:

bin/magento yireo_tablerates:export 1 test.csv
bin/magento yireo_tablerates:export 1 test.csv --overwrite

Import tablerates with website ID 1:

bin/magento yireo_tablerates:import 1 test.csv
bin/magento yireo_tablerates:import 1 test.csv --overwrite

Notes:

  • The CSV file must have the extension .csv. The export refuses to write into pub/ or app/etc/.
  • With --overwrite (or --overwrite=1), the import replaces all existing tablerates of the website.
  • The import validates all rows first (country, region, postcode and numbers). If any row is invalid, nothing is changed.
  • Text columns of the export are escaped against spreadsheet formula injection.

Current status

Static Tests
Unit Tests
Integration Tests
Playwright
DI Compilation

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

  • Add a --website_id option to filter the output of the table rate list command
  • Support PHP 8.5

Changed

  • Drop PHP 8.1 support and require Magento framework 103 and league/csv 9.27+
  • Declare all used Magento module and library dependencies in composer.json
  • Load table rates in batches when listing them

Fixed

  • Fix SQL injection through the website ID in the import command
  • Validate all CSV rows before importing, so a failing row no longer leaves a website without table rates
  • Reject unknown countries, regions, too long postcodes and non-numeric values in imports (an unknown region no longer silently becomes the wildcard)
  • Make a bare --overwrite flag work in the import command
  • Restrict the export path: require a .csv file, refuse symbolic links and writes into pub/ and app/etc/, and never overwrite existing files
  • Escape spreadsheet formulas in exported CSV files (CSV injection)
  • Escape console markup and strip terminal control characters in the list output

[0.0.2] - 22 October 2025

Fixed

  • Add PHP 8.4
  • Fix license
  • Remove debugging

[0.0.1] - 5 March 2025

Added

  • Initial release
Versions
Version Stability QA Status Compatibility Released
0.0.3 stable Pass Magento 2.4.7-2.4.9 Details 2026-11-25 16:52:28
0.0.2 stable Fail Not yet tested Details 2025-10-22 11:17:17
0.0.1 stable Not tested Not yet tested Details 2025-03-05 10:55:06

Requires 9

Package Constraint
ext-pcre *
league/csv ^9.27.0
magento/framework ^103.0
magento/module-directory ^100.4
magento/module-offline-shipping ^100.4
magento/module-store ^101.1
php >=8.2 <8.6
psr/log ^1.0 || ^2.0 || ^3.0
symfony/console ^5.0 | ^6.0 | ^7.0

Requires-dev 2

Package Constraint
phpunit/phpunit ^10.5
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.

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 Warning 21 21 warnings (ruleset: Magento2)
PHPMD Warning 4 4 rule violations (MissingImport:2, CyclomaticComplexity:1, NPathComplexity: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.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Error Error
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 Error Error
2.4.8 Pass Pass
2.4.9 Pass Pass

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

More from yireo

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.