-
AuthorPosts
-
December 16, 2022 at 2:26 pm #1376415
My hoster wants me to switch to PHP 8.0 or 8.1 for good reasons very soon, because they are updating PHP. However, when I switched to 8.0 or 8.1 I got the following error message:
“Too few arguments to function WP_Widget::__construct(), 0 passed in /home/www/wp.mywebsite.com/wp-includes/class-wp-widget-factory.php on line 61 and at least 2 expected”
This error crashes my website in the frontend and in the backend I cannot sign anymore into WP. So I need to switch back to 7.4 in order to get the system running again.
What’s wrong with WP_Widget::__construct()? Do I need this widget at all? Or could you make it running on PHP 8? WP and all plugins are updated so only this widget seems to crash the system.
I’m running Enfold without a child theme.
Thanks for your support.
December 17, 2022 at 6:52 pm #1376504Hey MatthSp,
Are you getting the same error when another theme is active? If you need further help, then please include admin WordPress login details in private.
Best regards,
RikardDecember 18, 2022 at 1:18 am #1376548This reply has been marked as private.December 18, 2022 at 9:21 am #1376555wp-includes is part of WordPress – have you tested to update the php8.x by deactivating all plugins?
December 18, 2022 at 12:09 pm #1376562Thanks. Let me figure out whether one of my plugins is using this Widget. However, I’m surprised that WordPress 6.1.1 is not completely prepared for PHP 8, at least wp-includes.
December 18, 2022 at 12:29 pm #1376570Hi,
Thanks for the update. I’m pretty sure this is a local problem with your installation, not a general WordPress problem. Please let us know if you should need any further help on the topic, or if we can close it.
Best regards,
RikardDecember 18, 2022 at 12:34 pm #1376572Hi,
So what do you suggest? I should re-install WP or what could be the solution?All the best,
MatthDecember 18, 2022 at 1:46 pm #1376582Hi,
You could try to reinstall WordPress, but I don’t think WordPress core is to blame for this. Are you sure that this is not caused by a plugin for example?
Best regards,
RikardDecember 18, 2022 at 2:21 pm #1376592Hi Rikard,
That’s what they discuss in some forums as well but nobody really seems to know which plugin does use this widget at all.ATB,
MatthDecember 18, 2022 at 5:47 pm #1376603It’s probably the vertical menu widget causing the error. I made some analysis and found this:
Invalid Date
The called constructor method for WP_Widget class in vert_menu_widget is deprecated since version 4.3.0! Use__construct()
instead.
Type: PHP Deprecated
Line: 5476
/home/www/wp.mywebsite.com/wp-includes/functions.phpFunction WP_User_Query::query was called incorrectly. User queries should not be run before the
plugins_loaded
hook. Please see Debugging in WordPress for more information. (This message was added in version 6.1.1.)
Type: PHP Notice
Line: 5835
/home/www/wp.mywebsite.com/wp-includes/functions.phpWhat do you think?
December 18, 2022 at 8:10 pm #1376606Hi,
I’m not sure to be honest with you, is that a plugin which you are currently running? If so, then you can simply try to deactivate it, to see if the warnings go away after that.
Best regards,
RikardDecember 19, 2022 at 12:23 am #1376640Hi Rikard,
Thanks. It seems to work now stable without the vertical menu widget on PHP 8.Do you have an idea how I could set-up a sidebar menu without that widget?
All the best,
Matth- This reply was modified 2 years ago by MatthSp.
December 19, 2022 at 6:53 pm #1376760Hi,
There’s always the Navigation Menu widget, or maybe there’s an alternative plugin which you could use?
Best regards,
RikardDecember 19, 2022 at 7:57 pm #1376784Hi Rikard,
Thanks. Now I fixed it with the Navigation Menu widget and everything is perfect as I want it. Don’t know why I ever used this other widget.Thanks again for your support.
Al lthe best,
MatthDecember 20, 2022 at 9:41 am #1376828Hi,
Great, I’m glad that you got things working again. Please let us know if you should need any further help on the topic, or if we can close it.
Best regards,
RikardDecember 20, 2022 at 11:24 am #1376850Hi Rikard,
Yes, you can close it.ATB,
MatthDecember 20, 2022 at 12:02 pm #1376856Hi,
Thanks for letting us know, I’ll close this thread for now then. Please open a new thread if you should have any further questions or problems.
Best regards,
Rikard -
AuthorPosts
- The topic ‘PHP 8 Error’ is closed to new replies.