A client contacted us because a critical part of their site was broken.
The problem
On the mobile version, the button for the main navigation was broken.
Normally, it should open the menu, but now If you pressed the button, nothing would happen at all.
This is a crucial piece of functionality. Without it, visitors are stuck on the homepage, or are forced to navigate the site via the limited links provided on the homepage.
Investigating the issue
The first thing I needed to confirm was if the menu source code was even there, and a quick inspection of the source code revealed that it was working just fine.
Since the HTML code was working, I assumed there was some problem with the style code (CSS) or the JavaScript. I logged in and poked around with the plugins and I found the source of the problem.
We helped this client improve their site’s load time a while ago. One of the techniques we used was to take all the separate CSS and JavaScript files, and mix them into one file each — this saves your computer time asking for file after file.
But, it can break some parts of the site! So you have to use this and other site speed features carefully.
Fixing the problem
Our client still needed the site speed optimization, so to fix the broken menu I tweaked the settings for CSS and JavaScript combination.
Why did this happen?
The site speed settings worked fine for quite a while, but then suddenly broke. This client is not using our Hoshu plan, so I had not logged in to check on their site for some time. As a result, I’m not sure what exactly caused the menu to break.
I did notice that the plugin we use to optimize their site speed had been recently updated. It’s possible that something about the CSS and JavaScript combination feature changed — leading to breakage.
The Takeaway
Here are two points you can take away from this:
- When performing updates, your site can and will occasionally break. When we perform updates for our Hoshu customers, we are always prepared to reverse any damage!
- Be careful with optimization plugins. They dig deep into your WordPress settings and can cause big problems. I also know of at least one that has a bad history with serious security issues.