Damn Good Content To Grow Your Business In The Digital World
Insights, Ideas and Innovations from the brains of the Saucal NERDS.
WooCommerce Subscriptions and Payment Gateways, Who Manages What?
We had a question come through, followed by a tweet. The tweet went on it’s own tangent talking about things not previously discussed, however it did raise a good question about payment gateways and WooCommerce Subscriptions.
I was always under the impression that in Subscriptions, it does not set up a recurring profile on the payment provider, rather Subscriptions sends single charges each month to the payment gateway1. I know at least it’s that way in Stripe. But I had a guy come through, and said I was wrong for PayPal.
You are right for almost all gateways. With PayPal Standard (and one or two other gateways, like WorldPay), the only option is to create a subscription at the payment provider. With all other gateways, including PayPal Reference Transactions (also built into Subscriptions, but requires special approval from PayPal’s end before it can be used) we just need a payment token, and can do everything else ourselves2. Although that said, for PayPal Reference Transactions, the “token” is actually a billing agreement, so the custom can still cancel/suspend that billing agreement at PayPal. AFAIK, there is no PayPal product which does not allow the customer to also manage the recurring payments. Something like PayPal Pro, which is just a credit card gateway, might do that though. But in those cases, you’d just want to use Stripe or something better anyway.
So there you have it. If you’re using PayPal Standard, or 1 or 2 other gateways, the subscription is managed on their platform. Otherwise, it’s managed within Subscriptions directly. And by “manage” I don’t mean it’s storing credit card data locally.
I hope that clears things up. Cheers to the team at Prospress for the answer. 😉
By no means are we implying storing credit card data on the local server. This is a question of using a token and where and when charges are authorized from. This is explained in the answer. ↩
Okay, maybe you’re not as familiar with the last two, but you should be – especially if you run an e-commerce business.
See, the only way to make sure that your website is performing well is to track your analytics. You need to know how well your sales funnel is doing, whether people are buying certain products over others, and how many people are visiting your site on a regular basis.
All these metrics are important, so you need the best insight tools to provide you with that data. If you’re looking for the cream of the crop, however, there are three big insight tools that currently hold a lion’s share of the market: Google Analytics, Kissmetrics, and Mixpanel.
If you’re looking to gather more marketing data for your site, consider this an honest-to-goodness overview of the biggest contenders. But just so we don’t play favorites, we’re also including four more insight tools you might not want to overlook.
Check out this quiz for more info: What Insight Tool Best Fits My Needs?
Here’s a general breakdown of the three titans of analytics. In case you’re thinking that they all do the same thing, know that while they all will give you valuable insight into how your website functions, each has it’s own specialty that may benefit certain businesses more than others. Let’s take a look.
Google Analytics is probably the most well-known solution, and thanks to its popularity there are plenty of guides out there that can turn any greenhorn into an analytics expert. It’s also easily integrated with many different e-commerce platforms, including WooCommerce.
The biggest plus for Google Analytics is its ability to measure traffic. If one of the focuses of your marketing strategy is to bring unique visitors to your page, this is a great tool for tracking that information. It’s also fairly easy to setup, and you can start pulling data right away.
Google Analytics can also measure funnels, which it calls “goals”. For the uninitiated, funnels measure things like the success of your sign-up flow (how many users land on your website, how many click to sign up, how many enter their email address, etc.).
When you set up funnels, you can view data going forward only, which means that you won’t be able to view data that happened before the funnel was set up.
Some have argued that Google Analytics’ funnels are less accurate than, say, Kissmetrics, but for businesses that want a general overview for their primary funnels, it’s not a deal breaker.
The one downside is that while it has the ability to track events, the setup process can be cumbersome unless you really know what you’re doing, and again, the data may not be as robust as you need it to be depending on your goals. It does have a feature to view real-time stats, but it won’t break down the stats any further than a general counter number on your dashboard.
Best for: Analyzing Traffic Worst for: Tracking Events Setup – Easy Cost – Free and Premium – Premium provides higher data limits with more custom variables
WordPress has a WooCommerce/Google Analytics integration app that you can find here.
Kissmetrics is another highly popular and comprehensive analytic solution. While Google Analytics can be used with any business, Kissmetrics really has an edge when it comes to e-commerce.
Funnel and event tracking are strong points for Kissmetrics, both of which can help you increase customer acquisition rates and improve customer retention. It also has an advantage when it comes to building intuitive reports. Kissmetrics is more funnel-focused, allowing you to edit and tweak funnels much easier than other tools.
Unlike Google Analytics, Kissmetrics funnels can retrieve historical data. For example, you can set up a sign-up funnel and then view how it’s been performing over previous months.
Kissmetrics also has a feature that many other insight tools like Mixpanel lack: The ability to show retention from a first time event to a repeat of that event.
Say, for example, that a customer clicks on a certain product page, but decides not to buy it in that moment. If they come back to your site and click on that page again, you’ll be able to track that event.
Best for: Measuring Funnels Worst for: Analyzing Traffic Setup – Moderate Cost – Multi-tiered pricing starting at $29/month
WooCommerce has step by step instructions for integrating with Kissmetrics here.
Mixpanel is similar to Kissmetrics in many ways, but Mixpanel is a step up in terms of being developer-friendly. In other words, you will probably get the same if not more functionality out of Mixpanel than Kissmetrics, but you have to know what you’re doing.
A few upsides to Mixpanel that make it a good alternative to the above include real-time analytics and opportunities for things like running your own front-end analytics. This can be very practical for de-bugging and catching errors as they happen, especially for new, buggy products.
In addition to event tracking, Mixpanel also lets you to segment your retention reports by additional properties, giving you more detailed data should you need it.
The downside is that some developers claim that the process to measure funnels isn’t as good as Kissmetrics or other similar insight tools. Mixpanel does support chronological funnels similar to Google Analytics. However, Celso Pinto, Founder and CEO of SimpleTax, wrote an article about why Mixpanel is still a better option over Kissmetrics for some developers.
Best for: Tracking Events Worst for: Measuring Funnels Setup – Difficult Cost – Free and Multi-tiered pricing starting at $99/month
WooCommerce has step by step instructions for integrating with Mixpanel here.
WordPressIntegrations also has an infographic with comparisons between Google Analytics, Kissmetrics and Mixpanel with a breakdown of page authority, social metrics, and other metrics.
Other Insight Tools to Consider
Of course, we’d be remiss if we didn’t talk about some other options available. Here are four great alternatives if you’re not really sure you want to buy into the three listed above.
RetentionGrid is frequently mentioned in the same space as Kissmetrics, and for good reason. It’s an app that provides similar data reports in easy to understand, color-coded graphs. It also provides suggestions to help with marketing strategies based on that data, which makes it a good solution for those who want some of the main features of Kissmetrics but don’t have a lot of experience as a developer. They also have the option of running abandoned cart campaigns (as well as other campaigns), which can come in handy for businesses that struggle with retention.
While they were originally created for BigCommerce, they also have an open API that is compatible with WooCommerce.
Best for: Measuring Funnels/Campaigns Worst for: Tracking Events Setup – Easy Cost – Free to download
Clicky is another real-time analytics tool similar to Mixpanel, only far more user-friendly. No matter how experienced you are, you’ll be able to navigate the dashboard with relative ease. It’s a great option for those who still want detailed analytics without the stress of complicated setup.
Best for: Analyzing Traffic Worst for: Measuring Funnels Setup – Easy Cost – Free and Multi-tiered pricing starting at $9.99/month
Adobe Marketing Cloud
Adobe Marketing Cloud is another powerful analytical tool often used by large e-commerce stores. The only reason it’s not included in the top three is that it takes a significant amount of knowledge to setup and use properly. While it’s perhaps one of the best out there in terms of analytics, it’s also not for the faint of heart. Adobe Marketing Cloud consist of six solutions.
Adobe Experience Manager
Adobe Media Optimizer
You can run campaigns, track events, create content to targeted audiences, and much more, The only other downside is that it’s expensive, as each solution comes with its own individual pricing. So if you want all the benefits of the cloud, you’ll need to lay down some serious dough.
Best for: Analyzing Traffic Worst for: Cost savings Setup – Difficult Cost – Single subscriptions start at $99/month
Like Google Analytics, Crazy Egg isn’t necessarily an analytics tool targeted to e-commerce, but that doesn’t mean it’s not a great option. It offers equally comprehensive and user-friendly graphs, including heat maps that can tell you which areas of your website to focus on (or alternatively, which are being ignored).
Best for: Tracking Events Worst for: Measuring Funnels Setup – Easy Cost – Multi-tiered pricing starting at $9/month
Still not sure what to pick? Take our Insight Tool Quiz to help you decide.
There are a couple things to keep in mind when selecting an analytics tool.
Make sure that you know how much data you actually need to collect. While having detailed funnel graphs and traffic reports can be good if you know what you’re doing, you may not need all that fancy information. Don’t pay extra for features you’re not going to use because you don’t need them (or you don’t know how to use them).
Finally, if you’ve committed to an analytic solution but you don’t know how to use all the features to their best ability, find someone who can either teach you how to use them (or read the data) or find someone whose job it is to put that data into practice.
Bundling is exactly what it sounds like: Combining similar products together into one kick-ass product.
The reason bundling is so appealing from a consumer perspective is that customers are inherently greedy. They want the most value for the least amount of money, which bundling gives them.
They’re essentially receiving way more value for their single purchases than they would by buying each product individually, and they usually save a bit of money in the process. They also don’t have to waste time searching for other products that they may need, which means they’re more likely to return to your store to find what they’re looking for in the future.
From a business perspective, bundling is great because you’re making more money on the total value of the order. Sure, you may lose some margin here if you’re offering an extreme discount, but you also have the potential of selling more products.
But how exactly do you bundle? Maybe your products don’t readily lend themselves to bundling, or you’re not exactly sure which products to combine with others. Well, take a deep breath.
There are several ways you can approach it.
Bundling Techniques to Try
If one bundling strategy won’t work for your products, chances are that another will. Here are a few options you can try to maximize your earning potential.
Pure bundling is where you offer certain products that are only available in a bundle. Customers either won’t be able to find them separately, or wouldn’t necessarily need or want to purchase them separately.
A real life example of this would be cable providers bundling their channels together, or how Adobe or Microsoft bundle their software services together in one suite. The plus side is that customers purchase products they would otherwise never consider.
If you have several products that work really well together (or really don’t work well without each other), consider packaging them together as one offering. You can even use subscription pricing with pure-bundled products, like how Microsoft Office 365 uses a month-to-month subscription.
Mixed bundling is similar to pure bundling except customers can also purchase the products individually. This is probably the most popular type of bundling out there, and for good reason. Mixed bundling gives customers the option to purchase products individually, so even if they can’t decide on your bundle, you’re still more likely to make a sale.
The goal here is to:
Choose products that are already best sellers, so you can charge a special price to package them together
Choose products that are okay sellers individually, but would be a better deal for the customer if sold together
Choose one product that sells well and another that doesn’t sell well, so that you can sell more of both products
The nice thing about mixed bundling is that shoppers often can’t resist a great deal. If they’re already paying for something they want, and they get a little something extra along with it, they’re more than happy to spend a few extra dollars.
If you’ve ever shopped on Amazon, you’ve seen an example of cross-sell bundling. They usually have a section on each product page with items that are “Frequently Purchased Together” featuring the original product along with other recommended products.
This can work well for many online shops depending on what you sell. But, even if you don’t necessarily have products that are “frequently purchased together,” you can use data and analytics to bundle products that could be purchased together.
By analyzing customer data and tracking product performance, you can create “recommendations” based on other products you think would benefit the customer. You can also create groups of users who may be more interested than others in purchasing your bundle, and target them specifically.
If you have two or more products that could benefit from being used together, or you have products that could benefit a single user group, consider cross-promoting them as a bundled offering.
Product Bundles – Where you can create combos of bundled products
Chained Products – Where you can gift other products to customers when they make a purchase
Forced Sells – Where you can required certain items to be bundled, like a service and a part, for example
Grouped Products – Where customers can directly add items to their cart from a range of products
Mix and Match Products – Where you can bundle up products based on customer preference, like picking the different fruit they want in a fruit basket, for example
Composite Products – Where customers can select between different, compatible product alternatives and adjust quantities as needed
WooCommerce also has documentation, tips, and additional tricks for helping you bundle your products together here. (Of course, if you need more help with specific bundling advice, we’re always available to help.)
If and when you’re ready to start bundling, there are a few other details you may want to keep in mind.
Focus on customer experience. As much as possible, tailor the experience to your customer’s needs and wants. Give them options to customize, add, remove, or edit products from your base bundles if possible. This will make the buying process more satisfying overall.
Mitigate decision exhaustion. Customers are a fickle bunch, and while they love choices, they don’t want to be overwhelmed by a million options all at once. So even though they want the ability to customize their bundles, you shouldn’t necessarily provide them with every option out there.
Make sure you direct customers toward choices you think would be beneficial, and eliminate anything that would confuse them or otherwise keep them from buying the bundle outright. The best way to do this is by recommending bundled options. You get the benefit of eliminating decision-making from customers while also being seen as the “authority” on what products go best together.
Use customer feedback to drive confidence. It’s important to let the customer drive his or her own experience. You certainly don’t want to force them to purchase a bundle if they don’t want to (that’s why mixed bundling is more popular than pure bundling).
You can also use customer feedback to help with this while first starting out. If your bundling endeavor is a success, you can also use feedback to help drive confidence for other customers considering purchasing bundled items.
Get advice on pricing your bundles with these 5 tips.
Bundling can be a great solution to improve your bottom line while giving something of value to your customers.
Remember that not all of your products need to be bundled together, but if you have some products that you believe really should be purchased together, offer them as a bundle at a competitive price. (This also works for products that aren’t selling as well as they should.)
You can choose from any type of bundling to fit you and your customer’s needs, just remember to get feedback during the process to see what works and what doesn’t work. Use that feedback to create better bundles and to boost confidence for customers looking for a good deal.
And a big part of that success is about communication. Namely, what you say (or don’t say) to them can mean the difference between getting everything you want or simply getting a door slammed in your face.
So, here’s what you need to know to make every developer adore you.
See our list of 7 tips for getting the most out of your dev team.
Sometimes it’s easy to assume that when you say one thing, your dev team is hearing it the way you meant it. But a lot of times, client requests – especially those from non-technical clients – get lost in translation. Here are few ways to tweak your words to make sure you’re understood.
Here’s the best advice we can give: devs can’t read your mind, so don’t pretend they can. You have to say what you want and say it very clearly. Draw a diagram. Over explain. Don’t treat them like children, obviously, but make sure you can show exactly why you want a project developed the way you do.
Are you trying to meet a certain goal? Do you have a specific target audience you’re trying to reach? Give your devs as much information as you can up front instead of just complaining about the project halfway through. It saves both of you headaches and hassle.
Do say: “This is what I want, and here’s why…”
DON’T say: “I want you to copy this exactly”
As they say, there’s nothing new under the sun. While a lot of what you see out there on the web will follow a basic formula or template, there is some really cool, innovative stuff being created every day by devs all around the world.
If you’re hiring a dev team to build you something amazing, don’t sell yourself short by asking them to carbon copy another site. Take some inspiration, show them some examples, but then step back and give your team some room to run with it.
Do say: “Here are some examples of things I like. How close can you get to this while still being original?”
DON’T say: “Just do it how I asked you to do it”
If, however, you’re not a dev yourself, it’s better to ask what the best solution is to get what you want. Chances are your team has some great experience or recommendations for building the site or app of your dreams.
Do say: “Here is what I would prefer. Is this the best way to build it?”
DON’T say: “Can you get this done faster?”
Everyone loves a panicked time crunch, right? Not so much. Dev teams are notorious for putting in long hours problem solving, so making more demands of their time is the fastest way to get on their grouchy side. If you have a specific timeline in mind, and it needs to be met, then find out what you can do to make the process easier on them.
Do they need your approval on projects quickly? Will they need certain files or content from you in order to move to the next step? Make sure you can keep pace with them so they can keep pace with your deadlines.
Do say: “Here is our projected timeline. What do you need from me to get this done?”
DON’T say: “Here’s my budget, make it work”
Unless you’re Tim Gunn, you probably shouldn’t go around demanding that your team “make it work” if you’re not paying them to work. Your goal here is to hire the best, not the cheapest, because you do ultimately get what you pay for. If you’re on a limited budget, pick one or two projects you know that the team will do exceptionally well, and worry about upgrading the rest as you go.
Do say: “Here is what I want you to focus on, is that doable for now?”
The key to successful communication is to ask questions and be open to suggestions. There’s a level of trust that goes into working with any team. But, the more trust and freedom you give the team, the better they’ll respond (if they’re worth their salt, anyway).
What Devs Really Want You to Know
At the end of the day, devs have your best intentions at heart. If they could tell you anything about working with them, it’d probably be these things:
We really do want your project to succeed. We’re not just here to eat pizza and code. Okay, maybe some of us are, but we like accomplishing things, too.
We’re not designers. Well, sometimes we do both, but most developers just code. If you want both, make sure you ask. Don’t assume we can Photoshop you a pretty picture just because we know HTML (or vice versa).
We want to speak your language, but it can be hard. We’re technical people, and if you’re not, we’ll have to try to explain some complicated terms to you. We’re not always the best at it, but we try.
We’re on a timetable, too. We want to get things done as quickly as you do, but sometimes problems need to be solved or other pieces need to fall into place first. If we’re not getting things done fast enough, there’s probably a legitimate reason.
We want to do cool things. Building websites or apps the way everyone else does pays the bills, sure, but we really want to tackle new and exciting challenges. If you have some cool ideas, throw them our way and we’ll see what we can do.
We hate bugs. Yes, crawly bugs are pretty gross, but so are bugs in our codes – which is why we spend so much time testing and retesting. Websites and apps go through numerous tests, so keep that in mind when making your deadlines.
We don’t mind feedback. Though we should add, “As long as it’s productive.” Feedback can be very helpful, but we often deal with a lot of complexities, so we need that feedback to be as specific as possible. Instead of saying, “No, I don’t like this,” give us a detailed list.
We’re experts, so trust us. We’ve been doing this a long time, and the worst feeling in the world is to think that you’re not confident in what we do. Take a breath, sit back, relax, and trust that we’re going to build you something great.
Get 7 free tips that will make your outsourced dev team love you.
Working with a team of devs, whether in-house or outsourced, can be a great way to implement some new, creative strategies into your business. But the last thing you want is to stress out the team trying to get things done.
Be sure to communicate as clearly (and as often) as possible. Provide feedback, give us suggestions, and show us what you like (or don’t like). Just make sure that you’re not micromanaging or expecting things to be done at lightning speed.
Give us your timeframe, set expectations, and then sit back and watch us go to work. You’ll be surprised at what we can accomplish when you give us a little room to run.
This is When You Know It’s Time to Stop Developing In-House
To keep things in-house, or not to keep things in-house?
That’s the question every business owner who needs to hire a developer has asked.
While in-house dev teams can be great, they’re also not your only option. In fact, outsourcing to a third-party dev team may be a better solution not only for your time and energy, but also for the quality of your projects.
But do you really need to hire out? And will it really solve all your problems?
Well, here’s what you should know…
Here are 5 questions to ask before you decide to outsource
Maybe “outsource” isn’t the right word, because we’re not necessarily talking about packing up your operations and shipping them overseas. What we’re really suggesting is using a third-party service to help lighten the load (though that team could be from any country… like somewhere in North America… hint hint).
Maybe you don’t feel quite ready for that, though. You might be thinking that your team isn’t that stressed, or that you’re not sure you can afford outside help quite yet.
But there are many, many benefits to hiring a dev team outside of your company. To name a few:
You’re building a new application and your current dev team just doesn’t have the expertise
You want to build something new and you already have a great dev team, but they’re swamped with other projects
You need to get things done faster and your deadlines aren’t being met
You’re trying to hire an in-house team but it’s taking longer than you thought
You have big problems that need solutions, and those solutions are outside your wheelhouse
You have concerns about the quality of your developer’s work, and you need an outside eye
Or maybe your current team is bugging you and you want to get back at them by threatening to hire out (no judgments). Either way, if any of the above situations sound familiar, you may want to consider looking into a third-party development team.
No But Really, Do I Need This?
Look, we’re not wizards who can predict the future. We can’t say with 100% certainty that third-party will help you accomplish all your goals. But we do know there are things third-party services can do for you that in-house teams simply can’t.
You’re Hiring for Experience
You may be thinking, “Well everyone who’s anyone has their own in-house team!” But that’s not entirely true. In fact, there are several big companies out there that were built using third party dev teams, including Slack, Skype, and GitHub. Even Basecamp outsourced their dev team, and their whole company is built on being a third-party resource.
While each company has its own reasons for outsourcing, one of the biggest benefits that they have in common is the idea is that you’re hiring a ready-made team of experts who know what they’re doing.
You don’t have to spend days, weeks, months, or even years sorting through resumes trying to find the perfect team to build one project. Besides, what will you do with your specialized task force of developers when a new, totally unrelated project comes along?
Third-party teams often specialize in certain areas, so even if you don’t want to hire out every single project, you can still find teams with the experience you need to build the project you want.
Even if you’ve had a bad experience in the past with incompetent third-party teams, know that not every team is that way, and you can always keep looking to find the right fit.
You’re Hiring for Time
Some dev teams run really efficiently, but others not so much. If your team falls into that latter category and you find yourself constantly running against the clock, then you should be at least considering hiring out to some degree.
Remember, third-party teams are designed to handle the projects you will throw at them. That’s why they exist. If you haven’t found one you love, keep looking. They’re out there.
You’re Hiring for Consistency
At some point you will probably have to deal with turnover. It’s an inevitable part of any traditional business. What happens when your best developer accepts another job offer in the middle of the project? What happens if someone falls ill during a tight deadline?
What happens if your whole team quits because someone keeps bringing the wrong type of bagels to the meeting?
If you’re not prepared to handle any of these situations as is, hiring out is a great solution.
But Am I Ready?
Boy, you ask a lot of questions, but that’s okay.
Trust us, if you’ve resonated with anything we’ve said so far, you’re probably ready to outsource. But we know that sometimes finding the right team can be difficult, or maybe you want to avoid negative outcomes so you feel a little cautious.
Here are a few things you can do to successfully find the right third-party team:
If you think you can’t afford it… Take a good look at the projected cost of having an in-house team versus the value you’re receiving for keeping them around. A lot of people will turn their nose up at hiring out-of-house, but you can actually save quite a bit of money by outsourcing. The average in-house developer’s salary hovers around $100k per year, whereas by outsourcing you can find a team of people to work for you at much lower costs.
If you’re worried about consistency… By hiring a team of people as opposed to a freelancer or two, you’ll have a full skill set at your disposal without having to constantly search for new talent. You get one team, and they stick with you. Over time, they become familiar with your product and your workflow, and you get all the same benefits of an in-house team with half the hassle.
If you’re worried about your timeline… Sometimes creative types dance to their own rhythm, and your definition of when the project is “done” may differ from an outsider’s perspective. But you can easily overcome this by setting clear expectations both before and during the project, and by remembering that you have all the power here. If they’re not meeting your needs, you can walk. It’s also important to look for teams that have a track record of getting things done on time, so if you’re unsure, ask around.
Still not sure? Here are 5 questions you can ask to help you decide
We’re not saying that outsourcing is right for everyone, but speaking from experience (we are a third-party dev team, after all), there are a great many benefits to resourcing outside of your current pool of talent.
Maybe you have a great dev team but they’re overloaded, or you want them to focus on some specific projects. Hiring out lets you keep the burden off your team so you can build cool things without sacrificing your current talent.
Or maybe you don’t have a dev team at all and you were going to do everything yourself. To that we say, “Don’t do it!” Third-party dev teams are designed to help you, and if you find yourself needing a helping hand, don’t hesitate to ask.
And if you’re in need of a great WooCommerce site, our team of experts here at Saucal can help. Our team has been doing this for years, and we do it well, so don’t be shy about contacting us here. You won’t regret it.
We’ve recently experienced some serious issues with WooCommerce search on eCommerce sites that process a large number of orders. The postmeta table needs to be queried when looking for a specific meta_value, which causes a major slowdown. For example, querying the “my orders” section would take 5s or possibly even more, depending on the server environment. To make matters worse, performing searches on the “Orders” screen for orders belonging to a specific email or person can take 30s or more (due to the involvement of extra JOINs on the postmeta table).
Both of the above examples are unacceptable for a website with high amount of traffic and had to be addressed.
Current Solutions And Associated Limitations
After doing some research, we’ve found that these issues are currently handled in one of two ways:
using a secondary index table within the same site database.
The ElasticSearch solution sounds good in theory, but our experience leads us to believe that it is not a good thing to integrate with WordPress. This is due to the huge number of differences between the base WP datasource (which is MySQL tables) and the ElasticSearch indexes.
While ElasticSearch performs partial searches very well and is pretty good at “guessing” what you intend to write in the search query, these minor benefits are definitely not outweighed by the downsides of integrating these two data sources:
latency between the ElasticSearch instance and your hosting provider (note that this won’t be an issue if you have ElasticPress installed on the same server as your PHP environment, but this is not a common scenario with today’s managed WordPress hosting solutions), and
the number of orders covered in each result (across all pages) is narrowed down to just a couple hundred.
In this case, we would need to query the ElasticSearch instance and then pass on the matched post IDs to WP_Query (while adhering to the max length of the SQL query being sent to MySQL). This breaks the workflow for wide range searches, and could potentially provide a misleading number of total results to the store manager searching the Orders screen.
Now, onto the secondary index table. The original solution was presented to us by Patrick Garman, a fellow WordPress developer. He originally intended to just improve the “My Orders” section of WooCommerce, but we thought that this fell a bit short for our needs.
We know that his current implementation is just meant to be a temporary fix until the release of WooCommerce 3.0 and the huge database revamp that is planned for it (which will fix the issues we are discussing in this post). We also know that WC 3.0 is not slated to be released until mid-2017, and since we need to make our customers happy before then, we forked Patrick’s implementation.
Our Proposed Solution
The original implementation of the order index only indexes the Order IDs and the Customer IDs in a secondary table (which is what Patrick set out to fix). His solution is to modify the “My Orders” WP_Query to use his index.
We extended this in a couple of ways:
We’ve included the customer emails (both the billing email on the order and the customer email which is derived from the customer assigned to the order). Whenever you search an email in the orders view of the admin section, we trigger the use of the index instead of postmeta.
We’ve included the customer names (billing, shipping, and display name of the assigned customer).
Here we come across an issue; we don’t want to completely remove WooCommerce’s existing search features, but we need to have some way of using the index conditionally for faster searches. This is because our index doesn’t support Address search, for example, and WooCommerce functionality covers that.
In order to achieve this, we’ve included a parameter like search. Whenever your search parameter is “name:John D,” we return all orders with names that match John D using a wildcard search. You could search for the Order ID in WooCommerce but we felt we could make it easier, so with our solution, you can just enter the search term “#1456” and have order 1456 returned to you.
The only complication at the moment is that you need access to WP-CLI to create the initial index. We’re working on enabling an AJAX interface which will allow you to build the index without WP-CLI.
For now, after you enable the plugin, you need to open up your WP-CLI interface and enter the command “wp wc_coi reset_index” for it to start generating the index for you. The time this process takes will vary depending on the number of orders you have on your site.
How Things Have Changed
With the use of this plugin, we have been able to vastly improve the performance of our customers’ large stores. Here above you can see an example where the time was up to almost 40 seconds. In one of our worst performing cases, email search on WP-Admin was taking over 50 seconds.
Using this plugin, we reduced the search time to less than 5 seconds, improving it by 867%!
Wrapping Things Up
We tried the ElasticSearch solution for one of our customers and it had too many moving parts for our liking. We prefer something that stays within the scope of WordPress and doesn’t require our customers to sign up for any external services.
To be clear, this is not a problem of ElasticSearch as a technology. It’s just that it’s too different from how WordPress works, so integrating the two created a few downsides that for us were deal breakers considering what we were trying to achieve. Additionally, we had to rely on a complex third party plugin (10up’s ElasticPress).
We iterated on Patrick’s approach and extended it to fulfill our customer’s most common needs. As a trusted WordPress agency, we know that this is not the prettiest solution since it duplicates a lot of the data. We just want to provide our customers with a solid workaround until WooCommerce 3.0 is released and renders this solution unnecessary.
Would you have done something different? Feel free to send us a pull request on our repository, we’d love to see alternatives!
High fives to our lead developer Matias for helping me with this article.