Conversation
supportSince 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]
Here’s the screenshot because I couldn’t include it in the post earlier
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.
I have now set the memory as follows, but the problem persists define(‘WP_MEMORY_LIMIT’, ‘1024M’); define(‘WP_MAX_MEMORY_LIMIT’, ‘1536M’);
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; } }
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);
Here’s the screenshot because I couldn’t include it in the post earlier
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.
I have now set the memory as follows, but the problem persists define(‘WP_MEMORY_LIMIT’, ‘1024M’); define(‘WP_MAX_MEMORY_LIMIT’, ‘1536M’);
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; } }
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);