shipcloud / shipcloud-for-woocommerce

shipcloud for WooCommerce
GNU General Public License v3.0
6 stars 0 forks source link

:bug: Fix invalid argument for foreach, standardize indent #201

Closed kingkero closed 2 years ago

kingkero commented 2 years ago

When changing themes, the plugin currently produces the following notice:

Warning:  Invalid argument supplied for foreach() in /var/www/html/wp-content/plugins/shipcloud-for-woocommerce/woocommerce-shipcloud.php on line 534
Stack trace:
  1. {main}() /var/www/html/wp-admin/themes.php:0
  2. require_once() /var/www/html/wp-admin/themes.php:1158
  3. do_action($hook_name = 'admin_footer', ...$arg = variadic('')) /var/www/html/wp-admin/admin-footer.php:78
  4. WP_Hook->do_action($args = [0 => '']) /var/www/html/wp-includes/plugin.php:470
  5. WP_Hook->apply_filters($value = '', $args = [0 => '']) /var/www/html/wp-includes/class-wp-hook.php:327
  6. WooCommerce_Shipcloud::show_admin_notices('') /var/www/html/wp-includes/class-wp-hook.php:303

What has changed?

Common things:

andrecedik commented 2 years ago

Hey @kingkero,

thank you for the PR. We're currently working on the 2.0 release, which will have a completely new codebase. I'm not sure if we'll be doing another release before that.

kingkero commented 2 years ago

@andrecedik Sounds fair. Since this log is generated only very rarely, I don't really mind. Feel free to port the change over to v2.