• Resolved kstadden

    (@kstadden)


    On a site I designed over a decade ago by creating a Twenty Eleven child theme, I’m suddenly seeing a cascade of “deprecated” PHP errors in functions.php, which I assume is what’s killing theme preview, which is the main symptom, as well as causing some other weird behavior. While troubleshooting, I turned off all plugins, as well as trying several other recommended fixes to bring back preview. I thought maybe 2011 is really at fault–just too old– until I started reading this forum.

    Can you give me any ideas?

    Thanks!

    Here’s a sample:

    Mar 07, 15:41:35
    Deprecated: Function add_object_page is <strong>deprecated</strong> since version 4.5.0! Use add_menu_page() instead. in /home/afcakaunpw8h/public_html/bvr/wp-includes/functions.php on line 5383

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Kathryn Presner

    (@zoonini)

    Hi @kstadden

    • What version of WordPress are you using?
    • What version of PHP is your server running, and was it updated recently by you or your host?
    • Is the issue present with a default classic theme like Twenty Twenty-One? You can use the Health Check plugin’s troubleshooting mode for this, which will not change your live site.
    Function add_object_page is <strong>deprecated</strong> since version 4.5.0! Use add_menu_page() instead. in /home/afcakaunpw8h/public_html/bvr/wp-includes/functions.php on line 5383

    This function is coming from WordPress core, not the theme. Do any errors have Twenty Eleven (twentyeleven) in the file path?

    Thread Starter kstadden

    (@kstadden)

    Thank you for responding, Kathryn!

    I’ll check all of those and get back to you tomorrow (Wednesday).

    Ken

    Moderator Kathryn Presner

    (@zoonini)

    Sounds good, let me know how it goes whenever you’re ready!

    Thread Starter kstadden

    (@kstadden)

    Kathryn,

    1. WordPress is the latest version, 6.1.1.
    2.  PHP is 7.4, on Godaddy’s “PHP selector.”  No idea if they updated it recently. (On the selector dropdown, there are two newer versions available, 8.0 and 8.1.)
    3. The issue is still present with Twenty Twenty One, i.e., no preview available when looking at themes, and many PHP errors. Here’s the latest:?
    •  Mar 15, 11:30:04
      Notice: Function wp_register_style was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. This notice was triggered by the <code>moztheme2011</code> handle.
    1. Two further issues have now occurred: trying to enter Health Check troubleshooting mode did not work, and now the theme selector won’t let me switch to any other theme than Twenty Twenty-One. (This is not a disaster because it’s just a small club site and my friend is very tolerant of troubleshooting-caused issues.)
       
    2. None of the errors prior to theme switch had the theme in the file path..
    Moderator Kathryn Presner

    (@zoonini)

    Thanks for all these details @kstadden, they’re helpful.

    Since you’re still getting errors when another theme is active, it doesn’t look to me like these issues are being caused by Twenty Eleven.

    trying to enter Health Check troubleshooting mode did not work

    This is sounding more and more like your core WordPress installation is corrupted or that something is conflicting.

    This part of the error may provide a clue: This notice was triggered by the moztheme2011 handle.

    Can you check whether you’re running a plugin calledmoztheme2011 or that has a similar name, like Twenty Eleven Theme Extensions? I’d suggest you try turning this plugin off to see if that causes the errors to go away. If you can’t access your dashboard, you can deactivate the plugin by connecting to your site via FTP and changing that plugin’s folder name to something like moztheme2011TEST.

    Let me know how it goes.

    Thread Starter kstadden

    (@kstadden)

    P.S. Many of the errors have this, though: This notice was triggered by the <code>moztheme2011</code> handle.

    Thread Starter kstadden

    (@kstadden)

    Well, yes! Twenty Eleven Theme Extensions is in my list of plugins, however it’s not active. There. I just deleted it. Still the same issue with not being able to switch themes, and still no theme preview. However, no new PHP errors have appeared as a result of this latest action. What do you suggest I do next?

    Moderator Kathryn Presner

    (@zoonini)

    @kstadden Did you see my response above? Our replies may have overlapped. ?? moztheme2011 is not part of the Twenty Eleven theme itself. I searched and found this plugin, which I’m guessing is what your site is running. Please try deactivating it and let me know how it goes!

    Thread Starter kstadden

    (@kstadden)

    Kathryn,

    Paused a bit for a bite of food. When I logged back into WP admin, voila, my old 2011 child theme was back in charge! So the website looks fine. Also, no new PHP errors! Yay!

    Still no theme preview, but immediate crisis averted, and I’m going to revisit the preview issue tomorrow. Thanks so much for paying attention to this! You helped me slay the PHP errors.

    Ken

    Moderator Kathryn Presner

    (@zoonini)

    Hi @kstadden Glad you got the PHP errors sorted!

    In terms of theme previews not working, I’d suggest checking for a plugin conflict first:

    Is the issue present with all your plugins temporarily deactivated? You can use the Health Check plugin‘s troubleshooting mode for this, which will not change your live site. If the problem goes away, reactivate your plugins one by one (while still in troubleshooting mode) to find the culprit.

    I’m going to mark this as resolved, since this isn’t an issue with Twenty Eleven. If you need further help with troubleshooting, feel free to post in Fixing WordPress. Cheers!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Cacade of PHP errors makes me wonder if 2011 is outdated’ is closed to new replies.