If you have the Fast WordPress Stack and the WPI Performance Plugin, you’ll be keen to load up millions of products to your site. One problem you are probably encountering is your import speed is not that fast however. The WPI Performance Plugin adds a useful index to speed up the type of wp_postmeta queries that import jobs perform in order to run their imports (they check for existing of products, existence of values etc) but if you’re using Datafeedr, more speed can be gained using this slightly altered plugin.
The types of performance gains you’ll get vary depending on your hosting, but something like a 10x speed boost is what you can expect.
Please feed back in the reviews what performance boosts you see.
Download the zip, extract the files, and upload them using SFTP/Filezilla and overwrite your existing datafeedr-product-sets folder (/wp-content/plugins/datafeedr-product-sets/)
Deactivate and delete your existing Datafeedr product sets plugin, then use Plugins->Add New->Upload Plugin and upload the zip file.
The plugin behaves in the same way to the official Datafeedr product sets plugin, just faster.
Overwriting the files will not delete your products or product sets! Your products and product sets are stored in the database. Still – follow best practices and run a backup before any new plugin. (I recommend UpdraftPlus)
When I was building out my massive demo site, the normal Datafeedr import speed was just too slow for me. I really can’t stand slowness, so I dived into the code to figure out where the performance drains were coming from. I found a few areas such as:
- A slow query which included functionality for when there are more than one type of product sets – since most people use it in conjunction with WooCommerce, I split this into two queries, one fast one for when we know there is only 1 type of product set, and then the original slower one for full compatibility
- A slow query to check for existing products
- A loop where no loop required (array_search in integration.php)
- A SELECT * where only SELECT ID, post_type was required
- An index added to post_meta since datafeedr checks for existence of values. wp_postmeta using a TEXT/BLOB, but you can still create an index on these if you specify a max limit.
- Not quite correct placement of the defer_counting function – this defer_counting function is useful for imports because it lets you count everything after your bulk import rather than keep counting after each individual item is added. Each count operation takes the same amount of time, so it’s better to do it once if possible.
You can view the differences here: https://bitbucket.org/davehilditch/faster-datafeedr-product-sets/commits/4f99af79819bbb75610f197bc7086cb69db12467
Obviously you should already be a Datafeedr customer and have the 3 plugins – API, Product Sets and WooCommerce Importer.
Additionally, you should have a REAL CRON job set up. If you’re still using WP CRON, you should stop doing that and set up a real cron job. Here’s a real cron setup guide on my other site.
This plugin does not have the latest 1.2.10 commit from the official version.
I’ve made a public Q & A category for this plugin.
The plugin on this page is technically version 1.2.9 whereas the official Datafeedr plugin is already up to 1.2.10 – so if you install this faster version, WordPress will keep telling you that an upgrade is required. If you upgrade, you will lose the performance boosts.
This plugin has been altered by me, so if you have any problems with it you should bother me and not Eric about it, although bearing in mind it’s free, support is through public Q & A only. Eric is working on integrating these performance boosts into his core. He has rigourous testing procedures, so I’m not sure when that will be.
This plugin is in use by me and about 10 of my clients, so it’s stable, but definitely you’re using it at your own risk.
Please report back in a review on this page what performance difference you experience so we can gather stats from various sized installations.