The Plugin that Killed Your WordPress Blog
You’re going along, working on your WordPress blog. Everything is going great! You make some updates on your system, update some plugins, then move along.
The next day, you just so happen to notice your website is painstakingly slow. Or, worse yet, you get a dreaded 404, 500 internal server error, or a Error Connecting to Database error.
This actually happened to me two days ago.
I noticed my new blog post was not automatically posted on LinkedIn and Twitter as usual (here’s how I do that). So I sent a request to my web host.
I didn’t get a response back within some hours, so I dug a little deeper. The following describes my debug process, how I “fixed” it, and how I might make this better in the future.
Why Did My Blog Get So Slow?
I’ve seen problems like this before with a previous WordPress Site. One of the main culprits, based on Google searching, is plugins.
For those of you unfamiliar with WordPress, there’s a specific folder that holds all the plugins (I believe it is named wp-plugins or something similar). By simply renaming that folder, you effectively “turn off” all your plugins.
Once I did that and refreshed my page, it was extremely quick (less than a second). AHA! There’s a plugin that’s killing my site.
I proceeded to restore the plugins folder (renaming it back to its original name) and then moved all the plugin folders within it to a different location. By doing this, I was able to narrow it down to a specific plugin. (I’m not going to say which plugin specifically, because the purpose of this post is not blame… but rather learning.)
Unfortunately, preventing this kind of problem is going to be quite challenging. The best way I know to do this would be to have a staging site – another version of my WordPress blog – that updates first. I then test that site with all the updates. If it works fine, I move the staging site to the production site.
I’ve seen plugins that do this. I couldn’t get them to work. It got to the point where me trying to make everything ‘perfect’ was preventing me from writing content.
Having the perfect process cannot be an enemy of getting started. Don’t get me wrong – you need a process, and it needs to get better over time. But it can’t prevent you from taking any action. That’s a terrible place to be.
How Can I Make This Better?
I should start this off by saying I’m not planning on doing anything right now. Just been really busy with life lately. However, that doesn’t mean I can’t plan for what I think would help this situation.
For me, implementing the staging site I described above is ‘too much work’ for what I would gain from it. My site doesn’t currently generate revenue and is not mission critical for anything.
What I could do and plan to do is to have a separate server ping or get some content from my site at a regular interval.
Perhaps every 5 minutes I have my computer at my house attempt to download a picture or webpage from my site.
If it takes greater than, say, 3 seconds to get that content, that script can send me an email. I’ve already written Python scripts before that sent me emails based on certain criteria.
To be clear, this does not fix the problem. I still have a very real possibility of having a WordPress plugin make my site really slow or take it down completely. All this solution does is notify me of it quickly.
The added benefit of this approach is it will be really easy to implement.
Continuous improvement, agile, and automation tend to go together. This type of mindset comes from my working in agile environments. Maybe this solution is not perfect, but it is a step better than what I have now.
When things don’t go as expected at work – perhaps there’s a bug or something – take some extra time to reflect. How did that bug get in there? Is there a way it could have been prevented? Is there a better way to monitor for that error condition?
These things separate those who just accept a situation and those who are proactive to attempt to make things better. This is the type of thinking that’s able to get lots of work done and make big process improvement changes. If you don’t currently do this, consider it the next time you see something that isn’t so great in your opinion. You just might start the next big thing at your company or in your life.