• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

500 error on 5.0 upgrade caused by Genesis calls in mu-plugin

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › 500 error on 5.0 upgrade caused by Genesis calls in mu-plugin

This topic is: resolved

Tagged: 500 error, mu-plugin, plugin, upgrade, Wordpress 5.0

  • This topic has 2 replies, 2 voices, and was last updated 6 years, 6 months ago by codeshim.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • December 7, 2018 at 12:32 pm #224887
    codeshim
    Participant

    Hey all,
    Posted this question in the WordPress forums and was told "those are all Genesis-specific function calls", go ask at Studiopress. So here I am! 🙂

    I found a way around this, so this is more of a why did this happen/best practices question.

    I experienced a 500 error during upgrade to WordPress 5.0. It affected only the backend/admin area; the front end was still accessible. This happened first in local dev environment/Valet, but repeated itself in other hosting environments. During troubleshooting, I found that disabling the following specific lines of widgets-init code in my site specific mu-plugin fixed the problem:

    function tm_genesis_emc_widgets() {	
    	genesis_register_sidebar( array(
    	'id'          => 'get_quote',
    	'name'        => __( 'EMC Get Quote area', 'genesischild' ),
    	'description' => __( 'Adds HTML to last menu item', 'genesischild' ),
    	) );
    
    	genesis_register_sidebar( array(
    	'id'          => 'woodgrain_social',
    	'name'        => __( 'EMC Woodgrain Social area', 'genesischild' ),
    	'description' => __( 'Adds HTML to bar under front page 1 area', 'genesischild' ),
    	) );
    
    	genesis_register_sidebar( array(
    	'id'          => 'menu_page_sidebar',
    	'name'        => __( 'Menu Page Floating Sidebar', 'genesischild' ),
    	'description' => __( 'Adds an overlay sidebar area to Menu page', 'genesischild' ),
    	) );
    }
    add_action( 'widgets_init', 'tm_genesis_emc_widgets' );

    If I comment out this section of code, the upgrade runs as expected. If I uncomment this code after upgrade, everything continues to run as expected.

    Can anyone help me understand why this caused a 500 error during upgrade, and what I should have done differently to prevent it and make my code more robust?

    I have updated WordPress core many times before with this mu-plugin activated, but the 5.0 update was the first time this happened.

    All plugins and themes are at latest versions. Disabling all other plugins (besides the mu-plugin) did not fix the problem. Genesis theme is at latest version.

    Any thoughts? Thanks!

    December 7, 2018 at 1:12 pm #224889
    Victor Font
    Moderator

    First, thanks for posting, but this forum is a community volunteer forum. Please understand that by posting here you're not asking StudioPress anything. We're end users just like you with no affiliation with StudioPress. To ask StudioPress a question, you have to go through their support channel.

    The error you experienced is most likely a timing issue. A 500 error is non-descript and can be caused by many different problems. Knowing exactly which one is often not possible.

    I say timing, because during the upgrade, the Genesis Framework probably wasn't fully loaded yet when widgets_init tried to call genesis_register_sidebar. WordPress loads themes after plugins. By using that code as a plugin, you probably triggered a timing mismatch.

    If that were my plugin, I would put a check in it to make sure the genesis() function exists before calling the genesis_register_sidebar function. This way if genesis hasn't fully loaded yet, you can return out of it without any issue.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    December 7, 2018 at 1:18 pm #224890
    codeshim
    Participant

    Victor, thanks for your input!

    Using that check is a great idea; I'll add that. I also think next time I will place code that uses Genesis functions into the child theme's functions.php file instead. I was already using the mu-plugin for other customizations and just added my code there for convenience, but since it depends on the Genesis theme being active, it's probably better placed in the child theme anyway.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘500 error on 5.0 upgrade caused by Genesis calls in mu-plugin’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble