/**
  * Removes the experiment from AppEngine, as well as any local information it created.
  *
  * @param int $id   the ID of the experiment we want to remove.
  * @param int $type the type of the experiment we want to remove.
  *
  * @throws Exception `EXPERIMENT_ID_NOT_FOUND`
  *                   This exception is thrown if the experiment was not
  *                   found in AppEngine.
  *
  * @see NelioABExperiment::remove
  *
  * @since 1.0.10
  */
 public static function remove_experiment_by_id($id, $type)
 {
     $exp = self::get_experiment_by_id($id, $type);
     $exp->remove();
     if (self::CACHE_ALL_EXPERIMENTS) {
         $exps = self::get_experiments();
         for ($i = 0; count($exps); ++$i) {
             /** @var NelioABExperiment $exp */
             $exp = $exps[$i];
             if ($exp->get_id() == $id && $exp->get_type() == $type) {
                 unset($exps[$i]);
             }
         }
         self::$experiments = array_values($exps);
         update_option('nelioab_experiments', self::$experiments);
     }
 }