Menu Editing - HTTP ERROR 500 - Pro Theme

Hi,

When I 'm trying to access the menu editor at the backend, I get the following error at the browser end:

The error log shows the following error:
Feb 14 21:54:49 192.168.205.15 apache2[4406]: [u1880] [lumenis37.onpressidium.com] [84.108.12.120] [error] [pid 4406:rid JlXmtLnqZCA:tid 140273539368704] mod_proxy_fcgi.c(673): [client 192.168.178.240:46634] AH01071: Got error 'PHP message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 65465304 bytes) in /lumenis37-www/wp-content/themes/pro/cornerstone/includes/menu-item-custom-fields/menu-item-custom-fields-walker.php on line 45\n'

Our hosting provider has raised the memory limit several times but it keeps happening. Can you please provide a solution?

P.S.

  1. Editing the menu is possible through the frontend WP customize screen.
  2. Activating the default WP theme instead of pro fixes the issue

Hello Amir,

Thanks for writing in! You seem to have exhausted your PHP memory limit. ​We recommend that you increase your memory allocated to PHP. To increase it, please edit your wp-config.php file and insert these lines:

define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

You can add it before the line
/*That's all, stop editing! Happy Blogging. */

And also please make sure that you increase your POST max input limit. This is helpful when you have several numbers of menu items. Please check out this thread:

We would loved to know if this has work for you. Thank you.

Thanks RueNel,

  1. The memory limit is already higher than 256mb. It is set to 268mb. Adding to that additional 65mb does not help as well.
  2. You did not refer to the fact that this problem is not happening with the default WP theme.
  3. The error is tracked to a specific theme location: /lumenis37-www/wp-content/themes/pro/cornerstone/includes/menu-item-custom-fields/menu-item-custom-fields-walker.php on line 45\n’.

Don’t you think there is an issue with the theme?

Hello Amir,

It appears that it is because you have several number of menu items. Please install the WP File Manager plugin then create a php.ini file in your wp-admin folder.

After that insert this line in the php.ini:

max_input_vars = 3000;

If it doesn’t help, would you mind providing us with login credentials(by clicking on the Secure Note button at the bottom) so we can take a closer look? To do this, you can make a post with the following info:

  • Link login to your site
  • WordPress Admin username / password

Thanks.

Thank you Thai.
Important update, our enterprise WP hosting provider increased the memory several times until the error didn’t show.
The problem now is that the menu editor at https://journey.lumenis-staging.com/wp-admin/nav-menus.php is extremely slow and unworkable. Deactivating all plugins did not solve it. Switching the pro theme immediate solves the problem.
I’m not facing any issue with menu items limit. Not sure how increasing the limit will solve the problem?

Thanks.

Additional update - our hosting provider added max_input_vars = 3000; and it did not fix/improve the issue.

Hello Amir,

I have logged in and I can confirm that there is a fatal error in Appearance > Menus. Would you mind providing us the ftp login credentials so we can take a closer look?

To do this, you can make a post with the following info:

  • FTP Hostname
  • FTP Username
  • FTP Password

Thank you.

Please find FTP details in the secured note.

Hi Amir,

I was unable to login to your FTP account.

Could you please double check?

Thank you.

Odd…I just used the credentials above and have successfully connected to it with FileZilla.
Can you please check?

Hey Amir,

Please contact your web host to increase the max_input_vars to the maximum they allow. If it’s still does not help, you’ll need to resort to the workaround I’ve mentioned in my reply to a similar thread. See https://theme.co/apex/forum/t/editing-wp-menus-very-very-sticky-and-slow/52919/8?u=christian_y

Thanks.

Hi Christian,
We tried to increase again the value, did not make a change.
I’ve carefully looked at the link you added. Please note that even for smaller menus, the editing experience is very very slow.

As I understand, the custom fields of the menu are causing this issue? Can you please further explain how to apply the workaround below?
“Deactivate Cornerstone temporarily every time you want to change your menu items.”

Also, as it is a major usability issue of the theme, Is this going to be properly fixed?

Thanks!

Hello Amir,

Thanks for updating the thread.

From Plugins > Installed Plugins deactivate Cornerstone. After that you can proceed to make the changes in menu items.

Thanks.

I’m not familiar with the Cornerstone plugin, nor it is installed on our website.
We are talking about the Pro theme, right?

Sorry for the confusion, Amir. In the other thread, I said “If you’re using X” you deactivate Cornerstone if you’re going to edit the menu. Since you’re using Pro, you don’t have Cornerstone as a separate plugin so it can’t be deactivated. Cornerstone’s integrated in Pro so the workaround isn’t applicable for you.

I also said that if you’re using Pro, you should follow this workaround: https://theme.co/apex/forum/t/x-menu-js-error/39960/15. Insert the code in your child theme’s functions.php.

Our development team is aware of this case where the menu custom field is causing a performance issue when you have lots of menu items. This does not happen if you only have like 10 menu items. I haven’t tested the limits as this is also connected to server limitations which varies from site to site.

Thanks.

Thank you Christian, I do hope your development team would sort this out asap as it seems to be affecting more and more theme.co users.
Regarding the workaround, will it have an impact on the WP core? Or will it just affect theme functionalities?
Also, you mentioned in the other thread that it is not an issue with the theme, I’m quite puzzled here, what is it with then? When I activate different themes, this is fixed.

Thanks!

You’re welcome. The code removes Pro’s menu custom fields only.

Regarding your other question:

This is a bit of gray area because server limitations and how menu custom fields are handled in WordPress are also involved in this case. When you switch themes, they most probably don’t have menu custom fields which our themes use to display a specific icon for the Navigation elements.

Also, only a small percentage of users setup 20 and above menu items. Most sites only have 5 to 10 menus so this was probably not taken into account when the menu custom fields were added. That is just a guess. I am not involved in product development but it would make sense to develop for what’s standard or common.

Personally, I have experienced setting up 70 menu items in a popular managed WP host using a popular theme (not our theme) and UberMenu and Appearance > Menus struggles to load. With that said, this issue is not entirely an issue with our theme. This is a general issue with WordPress’ menu custom fields and some servers can handle a lot and some don’t.

But, there might be a way in the future to officially get around this like deactivating the custom fields when not in use. That’s just an example and not to be taken as a guarantee.

Thanks.

Thank you for your detailed response and again, I hope it will get sorted out/worked around.
Thanks,
Amir.

You are most welcome. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.