Fatal Error on latest Woocommerce
-
Hi, I had a fatal error caused by the plugin:
PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "_multusre_fallback_new_user" not found or invalid function name in /var/www/vhosts/example.com/html/wp-includes/class-wp-hook.php:326
Stack trace:
#0 /var/www/vhosts/example.com/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#1 /var/www/vhosts/example.com/html/wp-includes/plugin.php(
517): WP_Hook->do_action()
#2 /var/www/vhosts/example.com/html/wp-includes/user.php(2621): do_action()
#3 /var/www/vhosts/example.com/html/wp-includes/user.php(2916): wp_insert_user()
#4 /var/www/vhosts/example.com/html/wp-includes/ms-functions.php(1356): wp_create_user()
#5 /var/www/vhosts/example.com/html/wp-includes/ms-functions.php(1219): wpmu_create_user()
#6 /var/www/vhosts/example.com/html/wp-admin/user-new.php(244): wpmu_activate_signup()
#7 {main}
thrown in /var/www/vhosts/example.com/html/wp-includes/class-wp-hook.php on line 326Here is the fix suggested:
The bug: The plugin had mismatched callback function names in add_action() calls. It referenced functions with a leading underscore (e.g., _multusre_fallback_new_user) but the actual functions were defined without the underscore (e.g., multusre_fallback_new_user). Additionally, since the plugin uses a PHP namespace, the callbacks needed the full namespace path.
Fixes applied:Line 24: ‘_multusre_fallback_new_user’ → NAMESPACE . ‘\multusre_fallback_new_user’
Line 82: ‘_multusre_handle_new_user’ → NAMESPACE . ‘\multusre_handle_new_user’
Line 142: ‘_multusre_notify_existing_user’ → NAMESPACE . ‘\multusre_notify_existing_user’
Line 195: ‘_multusre_settings_page’ → NAMESPACE . ‘\multusre_settings_page’ (also fixed a parameter order issue in add_submenu_page)
The topic ‘Fatal Error on latest Woocommerce’ is closed to new replies.