yireo / magento2-tablerate-commands
N/A
Yireo_TablerateCommands
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 intopub/orapp/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
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_idoption 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
--overwriteflag 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
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.
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
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 yireo
View vendorReplace bundled third party packages from Magento
N/A
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.