Conflict causing GeneratePress Layout options to break when SmartCrawl is enabled

When SmartCrawl is enabled, the GeneratePress layout options disappear on Post/Page edit screens and the following errors are logged to the Google Chrome DevTools JS Console.

metabox.js:192 Uncaught ReferenceError: wp is not defined
at HTMLDocument.<anonymous> (metabox.js:192)
at i (load-scripts.php:2)
at Object.fireWith [as resolveWith] (load-scripts.php:2)
at Function.ready (load-scripts.php:2)
at HTMLDocument.K (load-scripts.php:2)
post.php?post=23&action=edit:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)

There may be a conflict with the ecwid or smart slider 3 pro plugins but my test were not consistent.

  • Jordan

    Hey Gem,

    Here is a quote from Predrag which might help diagnose the issue:

    Hi Jordan,

    Hope you're doing well today :slight_smile:

    I can see the issue on your installation but I'm afraid that I can't replicate it on my test site using Divi and SmartCrawl so it seems that it's something specific on your installation causing this.

    I do see 500 error in console when I edit the page but the error doesn't tell us much on its own so we should check if there's anything in the debug log that could tell us what's going on.

    Can you enable debug log in your wp-config.php file (located in root WP folder) by replacing define('WP_DEBUG', false); with this code:

    // Enable WP_DEBUG mode
    define('WP_DEBUG', true);
    // Enable Debug logging to the /wp-content/debug.log file
    define('WP_DEBUG_LOG', true);
    // Disable display of errors and warnings
    define('WP_DEBUG_DISPLAY', false);
    @ini_set( 'display_errors', 0 );

    Edit your page so that the editor breaks and this should create debug.log file in your wp-content folder that could tell us what is going on.
    Can you please save it as .txt file and attach it here so we can check it out.

    Best regards,

    While your case is different the way to diagnose the issue using the DEBUG will be the same. Once you've enabled the debug repeat the steps taken that causes the error, then send over the debug as a .txt file or just paste the contents.


  • Jordan

    Forgot to include, in my case the steps mentioned by Predrag here resolved the issue:

    Hi Jordan,

    Thanks for checking that out, this does tell us where the issue is.
    It fails when it starts loading mb_detect_encoding function and that's because you probably don't have mb_string enabled on your site, which is required for this function to work.

    Can you please get in touch with your hosting provider and ask them to enable both mb_string and GD library, after that the issue should be gone.

    Let us know how it goes and if you need any further assistance with this.

    Best regards,

    If you are using cPanel for your web host they may allow you to edit the PHP settings. Login, go to 'Select PHP Version' and then make sure 'gd' and 'mb_string' is selected.

    Hope this helps, credits to Predrag! :slight_smile:

  • Predrag Dubajic

    Hi Gem,

    Hope you're doing well :slight_smile:

    If you don't have mb_string active on your server it would be useful to follow the second response from Jordan and enable it on your server.

    If the issue is still there after that you can then follow the first response in order to get the debug log which should tell us what's causing that 500 error on your site.

    And of course thanks for jumping in here Jordan :slight_smile:

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.