Picture of Paul Silver

Paul Silver

Making websites for companies and helping advertise them

Case Study: Ecommerce store re-write for Wemoto

Summary: re-writing a large, bespoke ecommerce store into modern code and documenting the code for pass over to internal programming team.

Wemoto logo

This complicated project started with a simple brief: the client had a large online shop selling thousands of motorcycle parts, written in PHP over approx 12 years. They wished to re-write it in a way that would make it easier to work on, and to start using version control to allow them to decide what code to put live and rollback when necessary. I was to advise on the re-write and mentor their senior developer, who had written the majority of the current version of the website.

This changed a few months into the project when the senior programmer left for a role at a local agency. I was asked to take on the re-write as they only had enough internal resources to maintain the site and cover existing IT tasks. This turned into a multi-year project with me working 5-10 days a month on the re-write. The re-write would integrate in a new design, but not change the URLs of pages and much of the content in order to not affect their existing good search engine optimisation (SEO) wherever possible.

The original codebase was undocumented, had very few comments within the code, and was written in a mainly procedural way with some functions re-used across the site, often large, unwieldy code that was difficult to pick apart. The database could be added to, but existing columns and data could not be changed to optimise it as two other in-house systems integrated with it and they were not part of the project - which was fine as the project was more than large enough without them.

My work was best summarised as:

  • Go through existing code with a fine toothed comb
  • Document the existing way of running the site
  • Re-write the code into more modern PHP, using the Laravel framework
  • Comment the code for future developers
  • Make changes to the code to allow the new features on pages to work correctly
  • Optimise the code so new page features would run quickly

This was a long, very difficult project. The code provided was very messy as it had been built in fits and starts over a long period, the "technical debt" was deep. The developer who wrote it firmly believed he could hold the entire project in his head, so did not understand the use of comments in helping coworkers (or your future self) work on code you had written at an earlier point in time. As I found several parts which replicated existing code, I have reason to doubt his self-belief of understanding the whole project at one time. Due to complexity in the site and data, I could not run a copy of the existing site myself and it was years before I was able to get a test version of the existing site set up within the client's network so I could investigate it more easily.

Wemoto site before new launch in 2018
Previous Wemoto site
Wemoto new site at launch in 2018
New build

Hardest problems tackled:

  • Reverse engineering a whole, complicated shop as no staff knew how it all worked
  • Integration with three versions of Paypal and one of another, obscure payment gateway. Paypal's documentation was poor and unhelpful, and one of the integrations could not go live when the site did as Paypal had retired the version before we went live
  • Becoming project manager for the front end developers
  • Communicating highly technical problems in laymans terms for the project manager who took over internally for the last quarter of the project after the technical head left

Most satisfying moments:

  • Seeing the site go live after a very long, hard development process
  • Optimising key pages that initially took over a minute to appear so they showed to visitors in less than a second
  • Seeing sales value per basket increase by many percent with the new site, meaning the new design had worked as intended
  • The excitement of one staff member at getting a full commented codebase to work from having spent a few months with the old code

Teammates


More case studies

© 2024 Paul Silver & Silver Web Services Ltd