• Resolved mhanisch

    (@mhanisch)


    Since the plugin was installed we have been getting critical errors when creating orders in the backend.

    Here is the error message in the backend:

    And here is the error message from the debug.log:
    [04-Jul-2024 18:54:39 UTC] PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/shop/wp-content/plugins/woo-order-splitter/inc/wos-essentials.php on line 45

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter mhanisch

    (@mhanisch)

    Here’s the screenshot because I couldn’t include it in the post earlier

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    But this error is about the memory, line number 45 is about the array_unique PHP function. Nothing is clear but the memory needs to be increased through wp-config.php.

    Thread Starter mhanisch

    (@mhanisch)

    I have now set the memory as follows, but the problem persists
    define(‘WP_MEMORY_LIMIT’, ‘1024M’);
    define(‘WP_MAX_MEMORY_LIMIT’, ‘1536M’);

    Thread Starter mhanisch

    (@mhanisch)

    This solved the problem:
    /woo-order-splitter/inc/wos-essentials.php Line 37

                      if (is_object($order)) {
                                if (!$order->customer_id > 0){
                                        $order = $order_id;
                                }
                        } else {
                                if (is_numeric($order_id)) {
                                        $oder = $order_id;
                                }
                        }
    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    I have updated it in the upcoming version, you will get it in the next release.

            if(is_object($order)){
                if (!($order->customer_id>0)){
                    $order = $order_id;
                }
            } else {
                if (is_numeric($order_id)) {
                    $order = $order_id;
                }
            }
    
            $order = (is_object($order)?$order:(is_numeric($order)?wc_get_order($order):0));
            $order_id = (is_object($order)? (method_exists($order, 'get_id')?$order->get_id():$order->get_order_number()) : $order_id);
Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.