/** * Detect if this session should be excluded. * * @return bool */ protected function shouldBeExcluded() { $excluded = false; if ($this->hit->isBot()) { $excluded = true; Yii::info(Yii::t("app", "SearchBot detected.")); } elseif (!$this->hit->shouldBeRecorded()) { $excluded = true; Yii::info(Yii::t("app", "The parameter 'rec' was not found in the request.")); } elseif ($this->hit->hasIgnoreCookie()) { $excluded = true; Yii::info(Yii::t("app", "The ignore cookie was found.")); } elseif ($this->hit->hasPrefetchRequest()) { $excluded = true; Yii::info(Yii::t("app", "Prefetch request detected.")); } elseif ($this->hit->hasReferrerSpam()) { $excluded = true; Yii::info(Yii::t("app", "Referrer URL is a known spam.")); } elseif ($this->wasExcludedByIpAddress()) { $excluded = true; Yii::info("app", "The ip is in the exluded list for this form."); } elseif ($this->wasExcludedByUserAgent()) { $excluded = true; Yii::info(Yii::t("app", "The user agent is in the excluded list for this form.")); } return $excluded; }