Using the early access version of Super Speedy Imports

One million products in 100 minutes sounds great, but how do you go about it?

Pre-requisites and assumptions

This is the very first version, so there are many limitations.

  • Products-only at the moment, more templates will follow
  • Some wp_posts fields cannot be set yet
  • Products are identified through their sku so your products should have unique SKUs
  • You have a CSV or TXT file. Super Speedy Imports currently supports text files with “” as qualifiers and comma (,), semi-colons (;) or tabs as separators.

Some weird ways of doing things so far

  • If importing heirarchical categories, they must be separated by > with spaces either side between the term names
  • There is no static field option yet, so if you need to enter a static text or numeric value, you need to currently use a function e.g:
    return function($data) {return 'external';};
    Above would give you the text value ‘external’ in your massaged data.

Some Interface Oddities

  • When you create an import you will need to refresh the page afterwards currently to select it and configure it.
  • If you wish to choose your PRODUCT TYPE, this goes in a taxonomy called Product Type and then you need a function which returns ‘external’ or ‘simple’ etc. I have not yet tested variable products, these will be possible but you’ll probably have to wait for a guide unless you know the underlying DB structure for these and can recreate yourself with this interface.
  • Functions only provide a single row, but they contain unlimited text. You can paste multiline functions in here and they will work.
  • To view the Import ID in order to run it through WP CLI you will need to inspect element on the Select Import select and check the relevant imports value

Migrating functions from WP All Import

If you are migrating from WP All Import, I have created a Chat GPT script you can use to get Chat GPT 3.5 to convert from your old function references to how Super Speedy Imports requires them.

First, if you used custom functions in WP All Import, you should copy these out of the WP All Import function editor and into our functions editor.

You also need to convert the way WP All Import handles function references. I have created a Custom GPT where you can paste in your WP All Import entries one at a time:

ChatGPT – Super Speedy Imports Assistant (openai.com)

If you cannot access the above for some reason, paste the following into Chat GPT (even 3.5) and then you will be able to paste in your function calls from WP All Import to convert them to our format.

From now on, convert whatever I paste into a callable PHP function with the following required format: 

return function($data, $h) { return $x; }; 

$x can be a variety of concatenated elements, e.g in the input I might paste: 

{aw_product_id[1]} 

When you see curly braces like this, reply with this (plus the function template) where $x would go in my template above: $data[$h['aw_product_id']] 

Additionally, if you see input like: 

{product_name[1]} by {brand_name[1]} 

Then the internals of the function you reply with should be: 

return $data[$h['product_name']] . ' by ' . $data[$h['brand_name']]; 

Finally, if you see WP All Import function references like in this example: 

[zeroprice({product_price_old[1]},{search_price[1]})] 

Then the return line inside the function template should be converted to this: 

return zero_price($data[$h['product_price_old']], $data[$h['search_price']]);

You must always return a single callable PHP function, even if I only paste in a number or text, and no matter how large a paste I give you.

Importing Product Attributes

Product Attributes are taxonomies. Super Speedy Imports currently only supports full taxonomies, specific to individual products.

If you are migrating from WP All Import, you will see something like this in your template:

And then in Super Speedy Imports, these would become something like this:

Running the Imports

To run the imports, we use WP CLI.

Log onto your server, navigate to your WordPress folder and then run the following command to run import number 3:

wp ssi 3

There are 9 stages to imports, if you wish to run a specific stage, you can do so. For example, to only run stage 1:

wp ssi 3 1

Stages List

The stages must be run in order, but possibly not all stages will be required, depending on what you need. Destination tables include wp_posts, wp_postmeta and the terms, taxonomy and term_relationships tables.

  • Stage 1 – import the CSV data to a staging table called wp_super_speedy_imports_batch_X where X is your import id. This stage does column mapping and runs functions to transform the data inserted to this staging table
  • Stage 2 – insert terms into wp_terms table if any are missing that exist in the staging table
  • Stage 3 – update the staging table with any matching post IDs based on the _SKU (this will be editable in future to identify existing content)
  • Stage 4 – update matching existing posts
  • Stage 5 – insert missing posts
  • Stage 6 – update staging table to add new postids from recently inserted posts
  • Stage 7 – update posts guid to ?p={id}
  • Stage 8 – insert missing postmeta, then update existing postmeta from join to staging table
  • Stage 9 – delete existing term_relationships then insert new relationships – note term_relationships for WooCommerce products should include product_type and product_cat as minimum. This runs first for hierarchical taxonomies and then flat taxonomies.

Debugging and Reporting Errors

Please post any issues you discover to the #super-speedy-imports channel. I’m aware this is early access code, there will be issues, do not attempt to use this on your live site yet!

From the CLI, if any errors occur, it will notify you of these.

Be the first to comment and we'll reply right away.

Leave a reply

Super Speedy Plugins
Logo