Crashes when activating users
-
Hi there,
I just updated a site from WooCommerce 9.0 to the latest 9.3.3. Afterwards, a very specific function stopped working: The activation-step after creating a new user, ie when the newly invited user gets a mail with a link to wp-activate.php:
[27-Sep-2024 07:12:13 UTC] PHP Fatal error: Uncaught Error: Class 'WC_Order' not found in /home/website/public_html/wp-content/plugins/woocommerce-quickpay/classes/woocommerce-quickpay-order.php:13
Stack trace:
#0 /home/website/public_html/wp-content/plugins/woocommerce-quickpay/woocommerce-quickpay.php(88): require_once()
#1 /home/website/public_html/wp-includes/class-wp-hook.php(324): init_quickpay_gateway('')
#2 /home/website/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#3 /home/website/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#4 /home/website/public_html/wp-settings.php(555): do_action('plugins_loaded')
#5 /home/website/public_html/wp-config.php(99): require_once('/home/websit...')
#6 /home/website/public_html/wp-load.php(50): require_once('/home/websit...')
#7 /home/website/public_html/wp-activate.php(12): require('/home/websit...')
#8 {main}
thrown in /home/website/public_html/wp-content/plugins/woocommerce-quickpay/classes/woocommerce-quickpay-order.php on line 13The site in question is a WordPress multisite, but WooCommerce is active on the subsites. Furthermore it runs PHP 7.4.
I solved the issue by adding this quickfix:
function init_quickpay_gateway() {
if (basename($_SERVER['SCRIPT_NAME']) === 'wp-activate.php') return;At line 39 of woocommerce-quickpay.php.
It’s not the pretties workaround, but it gets the job done – I don’t see any reason why Quickpay needs to initialize itself during user activation anyway.
Kind regards,
Morten
- You must be logged in to reply to this topic.