If you provide WordPress services sooner or later you will run into a client that has had their site built on WordPress by someone and are now concerned with the website being slow and they want you to fix it.
You start looking into it and notice their hosting is a bit sucky and also their theme was poorly built or they’re using a “premium” theme that is isn’t all that great for performance.
It is a real challenge, how do you go about it?
1. Explain what is involved to the client
The client already did some investment on the website and they may not be very happy to invest a lot more. Try to reaffirm their purpose and then state what it will take to get there. Don’t compromise or settle for less simply because they already invested. It will be worse if they invest some more and keep the same problems. Establish your terms and what it will take for you to become the tech CO for their website. Because that is what you’re signing up for when you say yes.
2. Re-purpose the theme
Create a new blank theme and do a code review for each page, repurposing the needed code.
If your team isn’t doing code reviews then this is a good time to start. The basic principle is no code gets into the new theme without being peer-reviewed and approved by one or two developers. Assuming you’re using version control on either Bitbucket or Github there’s a feature that can help you. Add branch permission to the master branch so only code gets merged that is reviewed. What you’ll be looking for in the review is to enforce clean and efficient code so also you should install PHPCS with WordPress standards to make it easier. This is how the pros do it. See how WordPress VIP does this here.
3. Review used plugins
Check what plugins they are using and look for potential performance problems. Look at the dissallowed plugin list by WPEngine as a starting point. Use tools like Query Monitor to find what is slowing down your site.
4. Fix the hosting but don’t become the hosting
Use one of the best WordPress hosting companies and ask the client to sign up himself. Try and resist to becoming their hosting provider yourself. If the website goes down you don’t want them to be calling you, so establish a support procedure right from the start. Define who is in charge of first line support, what is their rate and times.
5. Establish a measurement framework
You can’t improve what you can’t measure so use tools to benchmark the website against others. A good goal to aim for is to have your TTFB in the order of 250ms-350ms or below. This is going to be up to the hosting to guarantee this – and if you’re using a host like Servebolt or Kinsta you can be sure it is, but you should check it. Learn about scalability, caching and transients to improve the general solution. A good guide is Mark Jaquith’s talk on speeding WordPress.
Tackling existing codebases can be quite daunting and it is definitely not for everyone. If you are starting from scratch, your project is going to be far from ideal. However, in the long run, it’s the smartest choice in most of the times. And hopefully, you can help the client make a profit on the project and build a long-standing relationship. Don’t go into it if you can’t create a positive reference though.
In the end, it is all about establishing yourself as a professional WordPress provider capable of tackling even the most challenging projects. There will always be work for a team like that.