wordpress.org – WooCommerce custom action button no longer works

Upgrading to version 3.5.5 and a custom command action button no longer work and have trouble finding the problem.

Seeing Invalid argument provided for foreach () in /wp-content/plugins/woocommerce/includes/admin/wc-admin-functions.php on line 330

The custom function is:

function add_ordertable_actions_button ($ actions, $ order) {
if (! $ order-> has_status (['completed'])) {
returns $ shares
}

$ items = $ order-> get_items ();
if (! count ($ items)) {
returns $ shares
}
$ pass = false;
$ meal_plans = ['OPTION1', 'OPTION2', 'OPTION3', 'OPTION4'];
foreach ($ items as $ item) {
$ product = wc_get_product ($ item['product_id'])
if (in_array ($ product-> get_sku (), $ meal_plans))) {
// Get the order ID (compatibility with all WC versions)
$ order_id = method_exists ($ order, & # 39; get_id & # 39;) $ order-> get_id (): $ order-> id;
$ shares['ordertable'] = [
        'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&document_type=ordertable&order_ids=' . $order_id), 'generate_wpo_wcpdf'),
        'name' => __('Order Table', 'woocommerce'),
        'action' => 'view ordertable',
      ];
return;
}
}
}

This is for a custom PDF template that works well, it's the button that no longer appears.