如何将触发器限制在仅在产品发生任何变化时删除woo商店中的瞬态的操作?

I've developed a custom infinite scroll with transient and I set that transient to be deleted on create, update and delete of products. But, I don't want this to happen upon any other change to the orders or any normal posts. I'm expecting the transients to be deleted only upon either bulk or normal CRUD operations on products.Right now it doesn't work for the case of orders or bulk delete of posts. Here is my code ;-

function ga_delete_transients($post) {

  global $wpdb,$post;


 if(isset($post)&&$post->post_type=='product' || !isset($post)  ) {//doesn't work in case of bulk delete of posts



  $sql = "SELECT *  FROM ga_wp.wp_ga_options WHERE `option_name` LIKE ('%\_transient\_ga_loop_products_%')";
  $ga_transient_result = $wpdb->get_results($sql);
  if(!empty($ga_transient_result)){

      $wpdb->query( "DELETE   FROM ga_wp.wp_ga_options WHERE `option_name` LIKE ('%\_transient\_ga_loop_products_%')" );
  }

 }
 else{
   return;
 }

}

$all_actions = array('save_post','wp_delete_post','wp_trash_post');

foreach ($all_actions as $current_action) {

  add_action($current_action, 'ga_delete_transients',1);
}

I used global $post_type and returned if it's an order also checked if it's only product else returned. So, my transients get deleted if and only if it's any kind(bulk or normal) of CRUD operation on only products. So, my problem is solved. Here is my code:-

function ga_delete_transients($post) {

  global $wpdb,$post,$post_type;
  if($post_type == 'shop_order') {
    return;
   }

 if($post_type=='product' ) {



  $sql = "SELECT *  FROM ga_wp.wp_ga_options WHERE `option_name` LIKE ('%\_transient\_ga_loop_products_%')";
  $ga_transient_result = $wpdb->get_results($sql);
  if(!empty($ga_transient_result)){

      $wpdb->query( "DELETE   FROM ga_wp.wp_ga_options WHERE `option_name` LIKE ('%\_transient\_ga_loop_products_%')" );
  }

 }
 else{
   return;
 }

}

$all_actions = array('save_post','wp_delete_post','wp_trash_post');

foreach ($all_actions as $current_action) {

  add_action($current_action, 'ga_delete_transients',1);
}