I have the same challenge:
I’m using Nginx though but this looks to be a PHP 8+ issue due to the change highlighted on the manual page (https://www.php.net/manual/en/function.call-user-func-array.php), “args keys will now be interpreted as parameter names, instead of being silently ignored.”
FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object in /var/www/html/wp-includes/class-wp-hook.php:308 Stack trace: #0 /var/www/html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #1 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action() #2 /var/www/html/wp-content/plugins/easy-watermark-back/src/classes/Settings/Section.php(55): do_action() #3 /var/www/html/wp-content/plugins/easy-watermark-back/src/classes/Backup/Manager.php(69): EasyWatermark\Settings\Section->__construct() #4 /var/www/html/wp-includes/class-wp-hook.php(308): EasyWatermark\Backup\Manager->register_settings_section() #5 /var/www/html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #6 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action() #7 /var/www/html/wp-content/plugins/easy-watermark-back/src/classes/Settings/Settings.php(60): do_action() #8 /var/www/html/wp-cont” while reading response header from upstream
I’ve not had time to dig into this but I suspect that the section construct $this object the problem.
Thread Starter
frugan
(@frugan)
Thank you @prfryer27!
For now we no longer use the plugin, I still hope that the author of the plugin fixes the problem..
I have the same error using PHP 8.0.
I really like the plugin 🙂
Is there someone who will fix the issue?
Unfortunately I think the original author has abandoned the project now due to the lack of updates, as it’s not been certified for 3 major releases even the WordPress plugin site is showing it as probably abandoned.
Thank you for the info. I will see, maybe I could fix that and could provide it to others. This plugin is very cool and I need it.
Hi, we have that issue in our backlog already and it will be fixed in the future version
@kubitomakita thank you for the comment. Is it possible to get an understanding of the timeline? We all appreciate the hard work you have put into this but it’s rapidly becoming unusable for people as we all move to the latest versions of PHP.
Thank you so much for your hard work!
Thanks for the patience guys!
This is not related to PHP8+, but the ability to parse dochooks and references to objects (which are not stored and accessible, thus the fatal error)
We tested the plugin on PHP 8.2 and it works fine., so the issue is with something else.
We’d need to know what hosting are you using exactly.
The quick fix for that is to enable opcache comment loading:
opcache.load_comments=1
zend_optimizerplus.load_comments=1
Thank you for the feedback @kubitomakita !
I use a german hoster (alfahosting.de).
– Apache2
– Zend OPcache v7.4.30 (opcache.save_comments = On)
But I did not find the options (in phpinfo) you proposed and I think I am not allowed to enable this. I will ask the support for that. If they enable it and after testing I can report the result.
Thank you!
Updates from the alfahosting.de support:
It is not possible to set custom php-ini settings. So dare I cannot test it 🙁
Thread Starter
frugan
(@frugan)
Thanks @kubitomakita, I tried the opcache fix proposed with PHP 8.1 and 8.2, but the problem remains the same..
PHP message: PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, array callback has to contain indices 0 and 1 in /app/public/wp/wp-includes/class-wp-hook.php:310\nStack trace:\n#0 /app/public/wp/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()\n#1 /app/public/wp/wp-includes/plugin.php(517): WP_Hook->do_action()\n#2 /app/public/app/plugins/easy-watermark/src/classes/Settings/Section.php(55): do_action()\n#3 /app/public/app/plugins/easy-watermark/src/classes/Backup/Manager.php(69): EasyWatermark\Settings\Section->__construct()\n#4 /app/public/wp/wp-includes/class-wp-hook.php(310): EasyWatermark\Backup\Manager->register_settings_section()\n#5 /app/public/wp/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()\n#6 /app/public/wp/wp-includes/plugin.php(517): WP_Hook->do_action()\n#7 /app/public/app/plugins/easy-watermark/src/classes/Settings/Settings.php(60): do_action…
As @prfryer27 says, the problem would seem to be the use of $this with do_action().
The classes involved are:
src/classes/Placeholders/Resolver.php
src/classes/Settings/Section.php
src/classes/Settings/Settings.php
Other plugins (e.g. Elementor https://github.com/elementr/elementr/blob/main/app/app.php#L73 ) use $this with do_action(), but in our case the classes involved extend Micropackage\Singleton\Singleton: could this be the cause of the problem?
I’m also not convinced that the opcache fix is relevant, I believe that load_comments is not even an option, save-comments is the closest I can find and these are on by default as turning them off breaks quite a few frameworks.
https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.save-comments