title: Create programmatically a variable product and two new attributes in WooCommerce
body: <p>I would like to programmatically create a variable product ("parent" product) with two new variante attributes - all that from a WordPress plugin (so no HTTP Request to an API).</p>
  
  <p>These two variante attributes should also be created on the fly.</p>
  
  <p>How can this be done ?</p>
  
  <p>(with WooCommerce version 3)</p>
  
  <hr>
  
  <p>Update : I have written more lines of codes on this that I wished, and tried many things to solve it, using wooCommerce objects, and added missing data about terms, termmeta, the relationship from term with post, in the database using the WordPress database object - but nothing has sufficed to make it work. And I couldn't pin-point where I went wrong - that is why I couldn't provide a narrower problem - things for which stackoverflow is more made for.</p>