Automatically add attributes to woocommerce product?

add_action( 'save_post_product', 'create_product', 10 );
function create_product( $post_id, $post) {   
    // $post_id and $post are required
    if ( empty( $post_id ) || empty( $post ) ) {
        return;
    }

    // Dont' save meta boxes for revisions or autosaves
    if ( defined( 'DOING_AUTOSAVE' ) || is_int( wp_is_post_revision( $post ) ) || is_int( wp_is_post_autosave( $post ) ) ) {
        return;
    }

    // Check the nonce
    if ( empty( $_POST['woocommerce_meta_nonce'] ) || ! wp_verify_nonce( $_POST['woocommerce_meta_nonce'], 'woocommerce_save_data' ) ) {
        return;
    }

    // Check the post being saved == the $post_id to prevent triggering this call for other save_post events
    if ( empty( $_POST['post_ID'] ) || $_POST['post_ID'] != $post_id ) {
        return;
    }

    // Check user has permission to edit
    if ( ! current_user_can( 'edit_post', $post_id ) ) {
        return;
    }

    //Only if this is a new published product
    if ($post->post_date != $post->post_modified) {
        return;
    }

    // do stuff here...
}