• Hello, I get:

    504 Gateway Time-out
    The server didn’t respond in time.

    If I go to /wp-admin/nav-menus.php

    When I deactivate the plugin, I can visit that URL with no problem.

    What’s going on and how can we fix this?

Viewing 12 replies - 1 through 12 (of 12 total)
  • I have the same issue. It has started since the WordPreess 6.8.3 update.

    Same issue here. Is an update or fix planned? Is the plugin still maintained?

    Lets hope its still maintained.

    The problem with 504 Gateway Time-out is related to a call to this URL:

    https://layered.market/get-plan?site=https%3A%2F%2Fyourdomain.com&for=if-menu&_nonce=690e010979566&licenseKey=

    Even on the free version of the plugin, it checks for a license on that URL. The https://layered.market/ domain takes forever to respond and then throws a Cloudflare error, and that’s why we get the Gateway Time-out.

    I was able to identify the problem by increasing the timeout on my cloud server. After a few minutes I was able to access my menus and found the culprit with Query Monitor.

    I’m switching to another plugin.

    Any recommendations on an equivalent plugin to use?

    If you want a quick workaround, you can comment line 342 on the if-menu.php file inside the plugin folder:

    $request = wp_remote_get(‘https://layered.market/get-plan?site=’ . urlencode(site_url()) . ‘&for=if-menu&_nonce=’ . self::apiNonce(‘plan-check’) . ‘&licenseKey=’ . get_option(‘if-menu-license-key’), array(‘timeout’ => 60));

    This will temporarily fix the problem.

    I was using this plugin to restrict menu items to specific user roles, so I found this alternative:
    https://wordpress.org/plugins/user-menus/

    It lacks a lot of conditions, compared to If Menu.

    Cheers, appreciate that temporary fix

    Thread Starter rodricus

    (@rodricus)

    Thanks for the temporary fix.

    Thanks @streetdog1971!

    But, commenting out this row will result in the error that $request is not defined:

    if (isset($_REQUEST['if-menu-recheck-plan']) || false === ($plan = get_transient('if-menu-plan'))) {

    $plan = false;

    // $request = wp_remote_get('https://layered.market/get-plan?site=' . urlencode(site_url()) . '&for=if-menu&_nonce=' . self::apiNonce('plan-check') . '&licenseKey=' . get_option('if-menu-license-key'), array('timeout' => 60));

    if (!is_wp_error($request)) {

    $data = json_decode(wp_remote_retrieve_body($request), true);

    if (isset($data['plans'])) {

    $plan = $data['plans']['if-menu'];

    set_transient('if-menu-plan', $plan, 500);

    }

    }

    }

    Comment the entire block of code (or remove it) and set $plan to false. Like this:

    $plan = false;

    /*

    if (isset($_REQUEST['if-menu-recheck-plan']) || false === ($plan = get_transient('if-menu-plan'))) {

    $plan = false;

    $request = wp_remote_get('https://layered.market/get-plan?site=' . urlencode(site_url()) . '&for=if-menu&_nonce=' . self::apiNonce('plan-check') . '&licenseKey=' . get_option('if-menu-license-key'), array('timeout' => 60));

    if (!is_wp_error($request)) {

    $data = json_decode(wp_remote_retrieve_body($request), true);

    if (isset($data['plans'])) {

    $plan = $data['plans']['if-menu'];

    set_transient('if-menu-plan', $plan, 500);

    }

    }

    }

    */

    return $plan;
    one3rdnerd

    (@one3rdnerd)

    I’m sure Johan’s method works fine too but if you don’t want to edit the plugin files, running the external php function I shared on https://wordpress.org/support/topic/if-menu-blocks-appearance-menus/#post-18739474 fixes this issue too. IMO, it’s easier to add it this way and not touch the plugin files.

    @one3rdnerd, you’re totally right! Didn’t see that thread.

    one3rdnerd

    (@one3rdnerd)

    @jonkastonka No worries, I literally posted that solution a few minutes before I shared it here.

    I was going to open a new thread and saw several with what seemed like the same issue. Solved it, shared on one and then posted the links to the others, so everyone got the notification.

Viewing 12 replies - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.