This week we released version 7.10.0 of the Abandoned Cart Pro plugin for WooCommerce.
Over the duration of the last few months, we had a few clients come in and tell us about how our plugin was slowing down their sites.
We applied a few patches here and there, but while we were doing that, we realized this was not going to help us or our clients in the long run. The plugin needed some major overhauling especially keeping in mind our long term plans for the plugin. Yes! We had been thinking of adding new cart recovery methods then, and if we wanted our plugin to survive that 😉 and our clients to enjoy it, the plugin needed a makeover.
So, while we continued with our original plans of adding new cart recovery methods (SMS and FB notifications are now live, yay!!), we also focused on improving the plugin performance and concentrated our efforts on ensuring our clients would continue to enjoy our plugin.
Performance up to v7.9.2
Until version 7.9.2, all of our performance tests showed that sql queries occupied a major time in the cron job leading to increased site load times.
Originally, the plugin relied on WP-Cron to send reminder emails to clients. So, each time the site was accessed, WP-Cron would run and at set intervals the Abandoned Cart Plugin would step in and send reminder emails for abandoned carts.
As simple as the process sounds, it works fine for low to medium traffic sites. But for high traffic sites, the number of carts increase proportionately, along with the data that needs to be processed, which resulted in slow running sites 🙁
As you can see in the graph above, WP-Cron results in a spike. This is where the plugin was sending reminder emails etc. to the abandoned carts. This resulted in more usage of memory and server resources.
WP Background Processing
The library creates a queue system that’s efficient, reliable and compatible with WordPress. The best part is that we do not need to create batch limits.
Each batch continues to process items while PHP memory remains and the total execution time does not exceed 20 seconds. When a batch reaches either the PHP memory or timeout limit it saves the queue state and instantly dispatches the next batch. This completely negates the need to wait for cron to tick, which means multiple batches can complete, opposed to just 1 batch using the WordPress cron approach.
Queues are synchronous, meaning only one process will work on the queue at any given time. This ensures that background processing doesn’t eat up our server resources by spawning multiple queue workers.
This was just what we needed. Something that was efficient and did not eat up server resources. Since it runs in the background, it does not affect the site performance.
We have created batches for each of reminder types i.e. a batch for reminder emails, another for SMS and a third one for FB notifications. So now, each of these will run in the background.
So now on the front end, the plugin will simply continue to monitor and track the carts. The process of sending reminders to the abandoned cart users will be done completely in the background.
Performance in v7.10.0
As you can see in the above screenshot, once we upgraded the site to v7.10.0, the resources used by WP-Cron have reduced significantly. Even though there are transactions, they are run using AJAX and run in the background.
Earlier, the time taken by WP-Cron averages to around 25%, which has now been reduced to less than 5%. The server resources are now optimized and used wisely. We’re going to continue to monitor these changes and modify the plugin code to improve the performance further.
If you are facing performance issues on your site, we urge you to update to the latest version of Abandoned Cart Pro for WooCommerce. Don’t forget to let us know how it goes, by dropping us an email.
Here is a list of changes we made in this release.
As usual, we appreciate your feedback and will try to implement any changes that you suggest at the earliest.