Plugin Directory

Changeset 3336183


Ignore:
Timestamp:
07/29/2025 06:29:57 PM (8 months ago)
Author:
minicrmio
Message:

bugfix for An unexpected error occured while fetching orders for sync.

Location:
minicrm-woocommerce-sync/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • minicrm-woocommerce-sync/trunk/languages/minicrm-woocommerce-sync.pot

    r3335884 r3336183  
    44"Project-Id-Version: MiniCRM "
    55"WooCommerce Sync plugin "
    6 "v1.7.4\n"
     6"v1.7.5\n"
    77"POT-Creation-Date: 2022-05-30 "
    88"22:22+0200\n"
  • minicrm-woocommerce-sync/trunk/lib/Integration.php

    r3335884 r3336183  
    9393    public static function getProjectIds()
    9494    {
     95        // Increase PHP limits for this operation
     96        @ini_set('max_execution_time', 300); // 5 minutes
     97        @ini_set('memory_limit', '512M');
     98
    9599        // Try to get cached data first
    96100        if (self::isDebuggingEnabled() === false) {
     
    102106
    103107        $projectIds = [];
     108       
     109        // Get max orders limit from settings (0 = unlimited)
     110        $maxOrders = (int) self::getOption('max_orders_to_sync');
     111        $totalProcessed = 0;
    104112
    105113        $filters = [
     
    120128
    121129            foreach ($result->orders as $order) {
     130                // Check if we've reached the max orders limit
     131                if ($maxOrders > 0 && $totalProcessed >= $maxOrders) {
     132                    break 2; // Break out of both loops
     133                }
     134               
    122135                $projectId = Plugin::getOrderProjectId($order->get_id(), $order->get_customer_id());
    123136                if (!in_array($projectId, $projectIds)) {
    124137                    $projectIds[] = $projectId;
    125138                }
     139                $totalProcessed++;
    126140            }
    127141
     
    293307                'title' => __('Debug mode', 'woocommerce'),
    294308                'type'  => 'select',
     309            ],
     310            'max_orders_to_sync' => [
     311                'default'     => '0',
     312                'desc_tip'    => __(
     313                    'Maximum number of orders to process during full sync. Set to 0 for unlimited (default behavior). Use this setting to limit sync scope for debugging or performance reasons.',
     314                    'minicrm-woocommerce-sync'
     315                ),
     316                'placeholder' => __('eg. 1000', 'minicrm-woocommerce-sync'),
     317                'title'       => __('Max orders to sync (0 = unlimited)', 'minicrm-woocommerce-sync'),
     318                'type'        => 'number',
     319                'custom_attributes' => [
     320                    'min' => '0',
     321                    'step' => '1'
     322                ],
    295323            ],
    296324            'wc_mapping' => [
  • minicrm-woocommerce-sync/trunk/minicrm-woocommerce-sync.php

    r3335884 r3336183  
    1010 * Requires PHP: 8.0
    1111 * Text Domain: minicrm-woocommerce-sync
    12  * Version: 1.7.4
     12 * Version: 1.7.5
    1313 * WC requires at least: 4.0.0
    1414 * WC tested up to: 7.2
  • minicrm-woocommerce-sync/trunk/readme.txt

    r3335884 r3336183  
    55Requires at least: 4.9
    66Requires PHP: 8.0
    7 Stable tag: 1.7.4
     7Stable tag: 1.7.5
    88Tested up to: 6.2
    99WC requires at least: 4.0.0
Note: See TracChangeset for help on using the changeset viewer.