WPIntell

Source evidence

Critical error when creating orders

Order Splitter for WooCommerce · support · 2024-07-04T18:59:00+00:00

neutralsentiment
highseverity
0.7relevance
5replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 32 rows with source links

15.6% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

27 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
mhanisch resolved
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] 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);

Comments

5 shown
mhanisch 2024-07-04T19:02:00+00:00

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

Fahad Mahmood 2024-07-04T23:10:00+00:00

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.

mhanisch 2024-07-05T08:53:00+00:00

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

mhanisch 2024-07-17T07:17:00+00:00

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; } }

Fahad Mahmood 2024-07-17T09:45:00+00:00

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);