Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Error on install #10

Closed
contemplate opened this issue Oct 11, 2022 · 1 comment
Closed

Fatal Error on install #10

contemplate opened this issue Oct 11, 2022 · 1 comment

Comments

@contemplate
Copy link

Installed this on a client's site after using it on other client sites with no issue. It created a fatal error that may have to do with a conflict with Jetpack:

[11-Oct-2022 02:40:33 UTC] PHP Fatal error: Uncaught TypeError: Argument 3 passed to BrianHenryIE\Checkout_Rate_Limiter\Admin\Plugins_Page::action_links() must be of the type array, null given, called in /chroot/home/server_name_removed/html/wp-includes/class-wp-hook.php on line 307 and defined in /chroot/home/server_name_removed/html/wp-content/plugins/bh-wc-checkout-rate-limiter/Admin/class-plugins-page.php:57 Stack trace: #0 /chroot/home/server_name_removed/html/wp-includes/class-wp-hook.php(307): BrianHenryIE\Checkout_Rate_Limiter\Admin\Plugins_Page->action_links(Array, 'bh-wc-checkout-...', NULL, 'all') #1 /chroot/home/server_name_removed/html/wp-includes/plugin.php(191): WP_Hook->apply_filters(Array, Array) #2 /chroot/home/server_name_removed/html/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php(380): apply_filters('plugin_action_l...', Array, 'bh-wc-checkout-...', NULL, 'all') #3 /chroot/home/server_name_removed/html/wp-includes/class-wp- in /chroot/home/server_name_removed/html/wp-content/plugins/bh-wc-checkout-rate-limiter/Admin/class-plugins-page.php on line 57

@BrianHenryIE
Copy link
Owner

I came across the same issue with other plugins I've written previously, but hadn't updated this since (obviously, I'm copying the same code for adding links on the plugins page). I use PHP 7.4's strict typing as widely as possible, and I typed the function with the expected types, then when JetPack invoked the action in its own code and used null rather than empty array/string values, the strict-ness caused this error. I've updated to make the function parameters optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants