rrennick/network-wide-menu

Issue when installing with WP Engine Hosting

Closed this issue · 9 comments

Hi Ron Rennick

I had implemented you network wide menu plugins without fail on a dev server located at site5 hostings. It works flawlessly as you can see here: northernphoto.ca and store.northernphoto.ca

But once I had migrated the site to the production server which is being hosted on WP-Engine I couldn't get the menu to work properly.

I followed all instructions you have. I contacted WP Engine Support and they reviewed all the code on the there server and also reviewed the site on the dev server located on site5 hosting.

They couldn't find any problem with the my installation of the plugin but also couldn't tell me why it wasn't firing on there server either.

The only solution they gave me was to contact you and see if you could resolve the issue with them as then they could triage the issue with them… 

Here is the main site on WP Engine
http://artwolfe.wpengine.com/

Here is what the main site looks like in a screenshot:
http://cl.ly/image/44161m0m2s42

Here is the sub-site with the error.
http://store.artwolfe.wpengine.com/

And a screenshot of the error.
http://cl.ly/image/1l110j2v3X21

I can help you out anyway possible. Server access if needed to see the bug.

My guess would be the caching in the production environment is preventing/overriding the menu replacement.

I'm not familiar with their caching system so I don't have a recommendation for adjusting the plugin so it works in their environment.

However, the plugin is about 25 lines of code so a developer familiar with the caching might be able recommend filter priority changes that would allow it to work.

Hi Ron

Here is the reply I got my WP-Engine.

Unfortunately, yes, it seems like you may need to reach out to the author of that plugin to get clarification on which paths or files need to be excluded from our caching system in order for it to work.

So if your are able to pitch in a help great! You'll be paid for your work. Otherwise I am off to find a developer who is familiar with WordPress, Caching and WP-Engine.

clarification on which paths or files need to be excluded from our caching system

There aren't any paths or files (as far as this plugin goes). I was referring to caching internal to WP.

So if your are able to pitch in a help great!

Thanks for the offer but I work full time and don't take side projects.

Again I thank you for you time Ron.

So I found and confirmed an issue with the plugin after finally getting it working on WP-Engine. It has to do with the custom menu widgets.

  1. Create a menu in the menu admin area. I called my test.
  2. Add it to a sub site via custom menu widget
  3. Menu then takes on appearance of the global menu.

I tried this on http://store.northernphoto.ca (The dev site)

and

http://store.artwolfe.wpengine.com/

(On the wpengine site we actually have two widget menus that both should be displaying different menus on the bottom but they are the same menu)

Create an empty menu that you use on the sub site for the first menu location (the NWM is going to replace). Don't use that menu elsewhere on the subsite.

// Add menu features 
function awi_register_menus() {
    register_nav_menus( array(
        'global'  => 'Global Navigation Menu',
        'submenu' => 'Submenu',
    ) );
}

So do I need to put the submenu above the global menu in the function. As I have created the submenu and haven't specified it with any menu in the admin. See Screen Capture:

http://cl.ly/image/3g3M1Z3D3L09

Whether you add another menu location or not depends on your implementation.

What I meant above is create an empty menu in the menu screen and assign it to the first menu location created by your theme (on the sub site). Create a second menu in the menu screen for use in your widgets.

We decided to write our own plugin that has a UI interface that would show an error if the user decided to change something. It is the only way we could make this fail safe.