Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #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.

    #1376504

    Hey 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,
    Rikard

    #1376548
    This reply has been marked as private.
    #1376555

    wp-includes is part of WordPress – have you tested to update the php8.x by deactivating all plugins?

    #1376562

    Thanks. 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.

    #1376570

    Hi,

    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,
    Rikard

    #1376572

    Hi,
    So what do you suggest? I should re-install WP or what could be the solution?

    All the best,
    Matth

    #1376582

    Hi,

    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,
    Rikard

    #1376592

    Hi 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,
    Matth

    #1376603

    It’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.php

    Function 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.php

    What do you think?

    #1376606

    Hi,

    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,
    Rikard

    #1376640

    Hi 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.
    #1376760

    Hi,

    There’s always the Navigation Menu widget, or maybe there’s an alternative plugin which you could use?

    Best regards,
    Rikard

    #1376784

    Hi 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,
    Matth

    #1376828

    Hi,

    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,
    Rikard

    #1376850

    Hi Rikard,
    Yes, you can close it.

    ATB,
    Matth

    #1376856

    Hi,

    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

Viewing 17 posts - 1 through 17 (of 17 total)
  • The topic ‘PHP 8 Error’ is closed to new replies.