We have been working very hard at my staging website to have the live website be able to migrate from 3.9 to 4.4. In the meantime I am testing a clone of the staging website to move from php 7.4 to 8.0 because my hosting will roll this out next month.
I get this error when I try to go from 7.4 to 8.0. Any idea what I can do? Thanks!
2022/09/01 08:19:12 [error] 73268#73268: *2625 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, no array or string given in /www/staging2_229/public/wp-includes/class-wp-hook.php:307
Text on that specific line 307 is: $value = call_user_func_array( $the_['function'], $args );
I was able to activate all plugins, except for Woocommerce. And even when ALL plugins were deactivated and I just activated Woocommerce I would get a blank page. Woocommerce says it is 8.0 ready. The plugin conflicts with something else. So I activated another theme and activated Woocommerce, now everything is fine. I could even activate all WPLMS plugins in Twenty Twenty Two theme and have php8.0. So it is definetely WPLMS theme related. Nothing else. or maybe an added action/hook somewhere...
This was Woocommerce response after explaining: With an error log like the one shared that indicates a `stack trace`, there's usually a few plugins and perhaps the theme or WordPress involved. If the site breaks before the theme could load in, it's certainly possible that the error couldn't be logged so it just won't show up.
This is what Kinst Hosting said:
You may reach theme developer, and provide them with the next error:
2022/09/01 09:12:45 [error] 73268#73268: *3215 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, no array or string given in /www/staging2_229/public/wp-includes/class-wp-hook.php:307 Stack trace: #0 /www/staging2_229/public/wp-includes/plugin.php(191): WP_Hook->apply_filters(true, Array) #1 /www/staging2_229/public/wp-content/plugins/woocommerce/src/Admin/Features/Features.php(159): apply_filters('woocommerce_adm...', false) #2 /www/staging2_229/public/wp-content/plugins/woocommerce/src/Admin/Features/Features.php(194): Automattic\WooCommerce\Admin\Features\Features::get_available_features() #3 /www/staging2_229/public/wp-content/plugins/woocommerce/src/Internal/Admin/Analytics.php(57): Automattic\WooCommerce\Admin\Features\Features::is_enabled('analytics') #4 /www/staging2_229/public/wp-content/plugins/woocommerce/src/Admin/Features/Features.php(139): Automattic\WooCommerce\Internal\Admin\Analytics->__construct() #5 /www/staging2_229/public/wp-includes/class-wp-hook.p" while reading response header from upstream, client: 5.204.47.30, server: staging2.kinsta.cloud, request: "GET /wp-admin/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php8.0-fpm-staging2.sock:", host: "staging2.kinsta.cloud:22671"
Could you see if something is wrong in maybe my wp-config file, etc? Or maybe an incorrect callback in some of my customcode? We created a lot over the years (footer code and in wplms customizer) You have my SFTP creds.
I created an extra staging website, deleted the woo plugin and installed a freshly downloaded zip from the woocommerce downloads section. I changed the theme to 2022 and updated php from 7.4 to 8. Everything works!
Then... I changed theme to wplms and had to run the setup wizard again. That went well.. And the website was also still active.
Then I looked at the website and noticed that a lot of code was missing. All of the WPLMS footer code, the customizer code. My menus were gone. Any idea how that is possible?
the widgets and customiser store data based on current active theme. If your main site has child theme active then your staging site should also have child theme active. Please verify, if you have a child theme on the main site.
Yes, my second staging website (php8.0) has a child theme active. And it is still working. It seems that the Woocommerce plugin was the issue, as Alex suggested. I deleted the plugin installed a fresh version from the woo site and I was able to change my staging website in WPLMS 4.4 to php 8.0 without issues.
Also interesting. I copied my live website (wplms 3.9) and did the same thing with the woocommerce plugin. I then changed php to 8.0 and also that website is still active but 2 minutes later I got this mail from the hosting. What does this mean?
Our monitoring systems detected that your site live2 (Live) is not available and displays the following PHP error:
2022/09/08 08:59:01 [error] 78188#78188: *3391 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, no array or string given in /www/live2_166/public/wp-includes/class-wp-hook.php:307
The string on line 307 is: $value = call_user_func_array( $the_['function'], $args );
And comes from this bit of code:
/** * Calls the callback functions that have been added to a filter hook. * * @since 4.7.0 * * @param mixed $value The value to filter. * @param array $args Additional parameters to pass to the callback functions. * This array is expected to include $value at index 0. * @return mixed The filtered value after all hooked functions are applied to it. */ public function apply_filters( $value, $args ) { if ( ! $this->callbacks ) { return $value; }
But Alex. The issue doesn't come when I use woocommerce with a different theme in php 8.0.0. It only occurs with WPLMS. Then it must be WPLMS right? And if it's Woocommerce, wouldn't more people have this issue?
PS: I also get a different error now; /www/staging2_343/public/wp-includes/functions.php on line 5831 Any idea what has changed?
Hello,
We have been working very hard at my staging website to have the live website be able to migrate from 3.9 to 4.4. In the meantime I am testing a clone of the staging website to move from php 7.4 to 8.0 because my hosting will roll this out next month.
I get this error when I try to go from 7.4 to 8.0. Any idea what I can do? Thanks!
2022/09/01 08:19:12 [error] 73268#73268: *2625 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, no array or string given in /www/staging2_229/public/wp-includes/class-wp-hook.php:307
Text on that specific line 307 is: $value = call_user_func_array( $the_['function'], $args );
I was able to activate all plugins, except for Woocommerce. And even when ALL plugins were deactivated and I just activated Woocommerce I would get a blank page. Woocommerce says it is 8.0 ready. The plugin conflicts with something else. So I activated another theme and activated Woocommerce, now everything is fine. I could even activate all WPLMS plugins in Twenty Twenty Two theme and have php8.0. So it is definetely WPLMS theme related. Nothing else. or maybe an added action/hook somewhere...
This was Woocommerce response after explaining: With an error log like the one shared that indicates a `stack trace`, there's usually a few plugins and perhaps the theme or WordPress involved. If the site breaks before the theme could load in, it's certainly possible that the error couldn't be logged so it just won't show up.
This is what Kinst Hosting said:
You may reach theme developer, and provide them with the next error:
2022/09/01 09:12:45 [error] 73268#73268: *3215 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, no array or string given in /www/staging2_229/public/wp-includes/class-wp-hook.php:307
Stack trace:
#0 /www/staging2_229/public/wp-includes/plugin.php(191): WP_Hook->apply_filters(true, Array)
#1 /www/staging2_229/public/wp-content/plugins/woocommerce/src/Admin/Features/Features.php(159): apply_filters('woocommerce_adm...', false)
#2 /www/staging2_229/public/wp-content/plugins/woocommerce/src/Admin/Features/Features.php(194): Automattic\WooCommerce\Admin\Features\Features::get_available_features()
#3 /www/staging2_229/public/wp-content/plugins/woocommerce/src/Internal/Admin/Analytics.php(57): Automattic\WooCommerce\Admin\Features\Features::is_enabled('analytics')
#4 /www/staging2_229/public/wp-content/plugins/woocommerce/src/Admin/Features/Features.php(139): Automattic\WooCommerce\Internal\Admin\Analytics->__construct()
#5 /www/staging2_229/public/wp-includes/class-wp-hook.p" while reading response header from upstream, client: 5.204.47.30, server: staging2.kinsta.cloud, request: "GET /wp-admin/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php8.0-fpm-staging2.sock:", host: "staging2.kinsta.cloud:22671"
And I found this discussion and this.
Could you see if something is wrong in maybe my wp-config file, etc? Or maybe an incorrect callback in some of my customcode? We created a lot over the years (footer code and in wplms customizer) You have my SFTP creds.
Please help,
Gijs
Hi please try deactivating your wplms customizer plugin maybe some code in there causing this issue .
Dear Alex,
I've tried that as well. Wasn't causing a problem. It's inside the WPLMS theme or its added code in footer that's conflicting with the theme...
Please share your ftp creds and switch to php 8.0
Please share the admin creds as well for this staging2 site
Well the error seems to be coming from woocommerce itself .IT seems woocommerce is old in that site please remove wooommerce plugin and reinstall.
I created an extra staging website, deleted the woo plugin and installed a freshly downloaded zip from the woocommerce downloads section. I changed the theme to 2022 and updated php from 7.4 to 8. Everything works!
Then... I changed theme to wplms and had to run the setup wizard again. That went well.. And the website was also still active.
Then I looked at the website and noticed that a lot of code was missing. All of the WPLMS footer code, the customizer code. My menus were gone. Any idea how that is possible?
the widgets and customiser store data based on current active theme. If your main site has child theme active then your staging site should also have child theme active. Please verify, if you have a child theme on the main site.
Dear Ripul,
Yes, my second staging website (php8.0) has a child theme active. And it is still working. It seems that the Woocommerce plugin was the issue, as Alex suggested. I deleted the plugin installed a fresh version from the woo site and I was able to change my staging website in WPLMS 4.4 to php 8.0 without issues.
Also interesting. I copied my live website (wplms 3.9) and did the same thing with the woocommerce plugin. I then changed php to 8.0 and also that website is still active but 2 minutes later I got this mail from the hosting. What does this mean?
Our monitoring systems detected that your site live2 (Live) is not available and displays the following PHP error:
2022/09/08 08:59:01 [error] 78188#78188: *3391 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, no array or string given in /www/live2_166/public/wp-includes/class-wp-hook.php:307
The string on line 307 is: $value = call_user_func_array( $the_['function'], $args );
And comes from this bit of code:
/**
* Calls the callback functions that have been added to a filter hook.
*
* @since 4.7.0
*
* @param mixed $value The value to filter.
* @param array $args Additional parameters to pass to the callback functions.
* This array is expected to include $value at index 0.
* @return mixed The filtered value after all hooked functions are applied to it.
*/
public function apply_filters( $value, $args ) {
if ( ! $this->callbacks ) {
return $value;
}
$nesting_level = $this->nesting_level++;
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// Avoid the array_slice() if possible.
if ( 0 == $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
$this->nesting_level--;
return $value;
}
What does it mean? And how to fix this?
Gijs
Please upgrade the php of server so issue can be replicated .
Well I checked everything , deactivated all plugins except woocommerce plugin .
The error is coming from woocommerce plugin itself .
You need to contact woocommerce plugin for this .
PS : you can also try to switch to 8.0.0 version of php .
But Alex. The issue doesn't come when I use woocommerce with a different theme in php 8.0.0. It only occurs with WPLMS. Then it must be WPLMS right? And if it's Woocommerce, wouldn't more people have this issue?
PS: I also get a different error now; /www/staging2_343/public/wp-includes/functions.php on line 5831 Any idea what has changed?
Gijs
Hi im not able to login : https://prnt.sc/1aIoxomvRv48
Not able to get to wp-admin : https://prnt.sc/b1sdA3EvLvmX
also we would need php 8.0 on server to replicate the issue .
I would also like to inform you that latest woocommerce works fine with wplms on php 8.0 at our end .
Its just your site which is not working , did you try deactivating your child theme and activate the main wplms theme ?
Custom child theme fixes are not covered in theme support .
these lines in your child theme
add_filter( 'woocommerce_admin_disabled', '__return_true' );
add_filter( 'woocommerce_admin_disabled', true );
functions.php file was crashing the site .
YOu helped with this by narrowing the issue to child theme .
SO I checked the code of your child theme and found the error in functions.php file .
Glad issue is resolved .
Cheers!
Haha! Let's leave it at that.
closing