Closed Aunshon closed 1 month ago
The changes involve modifications to various methods across multiple files to enhance error handling and prevent division by zero errors in calculations related to shipping amounts, commission rates, and migration progress. Key adjustments include ensuring that divisor values default to 1 when associated arrays or totals are empty or invalid. These updates improve the robustness of financial calculations and shipping distributions within the order processing and migration logic.
Files | Change Summary |
---|---|
includes/Helpers/MigrationHelper.php | Updated split_parent_order_shipping to prevent division by zero by ensuring $vendors_count defaults to 1. |
includes/Integrations/WcVendors/OrderMigrator.php | Modified commission rate calculation in get_dokan_order_data to default subtotal to 1 if empty or less than one. |
includes/Integrations/Wcfm/OrderMigrator.php | Enhanced commission rate calculation and shipping logic in get_dokan_order_data and process_refund for robustness. |
includes/Migrator/Manager.php | Adjusted migration progress calculation in migrate method to default total_count to 1 if empty, preventing division errors. |
dokan-migrator.php | Updated plugin metadata including Plugin URI , Author , and Author URI for clarity and consistency. |
readme.txt | Changed bug report and feature request link to the new GitHub repository for issue tracking. |
sequenceDiagram
participant User
participant OrderMigrator
participant MigrationHelper
participant Manager
User->>OrderMigrator: Request order data
OrderMigrator->>OrderMigrator: Calculate commission rate
OrderMigrator->>MigrationHelper: Split shipping costs
MigrationHelper->>OrderMigrator: Return shipping distribution
OrderMigrator->>User: Provide order data
User->>Manager: Start migration
Manager->>Manager: Calculate migration progress
Manager->>User: Update migration status
🐇 "In the meadow, changes bloom,
With careful code, we clear the gloom.
Division by zero, a thing of the past,
Robust and steady, our functions will last.
With shipping and commissions now safe and sound,
Hops of joy for improvements abound!" 🐰
…ed by zero, there can be a fatal.
Summary by CodeRabbit
New Features
Bug Fixes