woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
234 stars 206 forks source link

Php fatal error 8.0 #2967

Open pimihel opened 8 months ago

pimihel commented 8 months ago

PHP Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in /www/xxxxxxx/public/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-gateway-stripe.php:661

galbaras commented 7 months ago

This seems weird, considering that $gateways contains the Stripe gateway reference as a minimum, and the function is called via a core WC hook. Maybe you can try to isolate this further by looking for other messages that could be related and performing a plugin/theme isolation test.

Also, it'll be helpful to provide environment information, like PHP version, web server information, WordPress version and the versions of WooCommerce and the Stripe Gateway plugin.

marcus-abrahamsson commented 7 months ago

Same issue here.

Checked the logs and the only errors are this. All plugins and theme is up to date.

PHP: 8.1.27 Webserver: NGINX 1.25.4 WordPress: 6.4.3 Stripe Gateway: 8.1

NOTICE: PHP message: PHP Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in /var/www/html/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-gateway-stripe.php:661 Stack trace:

0 /var/www/html/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-gateway-stripe.php(661): array_keys()

1 /var/www/html/wp-includes/class-wp-hook.php(324): WC_Gateway_Stripe->reorder_available_payment_gateways()

2 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters()

3 /var/www/html/wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php(333): apply_filters()

4 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/WcPayWelcomePage.php(391): WC_Payment_Gateways->get_available_payment_gateways()

5 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/WcPayWelcomePage.php(80): Automattic\WooCommerce\Internal\Admin\WcPayWelcomePage->get_incentive()

galbaras commented 7 months ago

When does this happen? How can it be reproduced? What are the plugin settings (except the secret bits)?

marcus-abrahamsson commented 7 months ago

When trying to access wp admin. No matter what page in admin. Get wp critical error message. Haven’t changed any settings before or after update. Default settings.

galbaras commented 7 months ago

The function reorder_available_payment_gateways() is called by the woocommerce_available_payment_gateways filter hook in the function get_available_payment_gateways(), where the first line ensures that the filter function always gets an array, so again, I really wonder how this is happening.

Can you perhaps download the plugin and reinstall it?

Also, can you compare the contents of wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-gateway-stripe.php on your server the Github version?

github-actions[bot] commented 2 months ago

Hi, This issue has gone 150 days (5 months) without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest version, you can help the project by responding to confirm the problem and by providing any updated reproduction steps. Thanks for helping out.

github-actions[bot] commented 4 weeks ago

This issue has gone 180 days (6 months) without any activity.