1

I am a junior developer and I have been asked to work on a wordpress site that has previously been using All Import plugin to upload products. The problem is, this is not functioning properly, and is very slow. (often throws an error 524). My question is, where do I start with writing the script needed to use wp-cli to import products instead? do I need to write it as a plugin? or just use the wp-cli commands. I have wp-cli installed locally on a windows machine, and it is working. i have been researching this for a week now and i can't find any definitive direction with it.

any help would be appreciated.

  • Why do you need wp-cli ? Do you know SQL? Do you need to import the products through the woocommerce API or can you load them directly into the appropriate table? – mozboz Aug 10 at 13:50
  • The site uses woocommerce so I assume they need to take that into account. The reason i believe I need to use wp-cli, is due to the slow and heavy process that the All Import plugin uses, which has been a problem for the company. I am just not sure where to start, and how to set it up. – Vba-new Aug 10 at 13:56
  • The point of my question is that you need to start by importing one product, then do that lots of times. If you don't know how to do that, you need to find out – mozboz Aug 10 at 13:58
  • I know how to import a product. my question is whether it is common practice for developers to use wp-cli for importing (bulk) simple and variable products, and whether it needs to be a plugin or do I need to just use specific commands within the shell – Vba-new Aug 10 at 14:01
  • 1
    I think you should ask an additional but separate question on the site, how to write a WP CLI command, a basic hello world. That will help you a lot. Otherwise this question is a very big question that's intimidating and unlikely to get an answer as a result, it's too much! Split it up into smaller nicer questions that people can answer :) You don't have to ask them all at once either. I can think of several: How do i write a basic WP CLI command? How do I pass parameters to a WP CLI command? How do I create posts in code? etc – Tom J Nowell Aug 10 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.