diff --git a/Classes/Controller/FrontendController.php b/Classes/Controller/FrontendController.php index 63840c29..d90e099b 100644 --- a/Classes/Controller/FrontendController.php +++ b/Classes/Controller/FrontendController.php @@ -27,6 +27,7 @@ use In2code\Lux\Exception\EmailValidationException; use In2code\Lux\Exception\FakeException; use In2code\Lux\Utility\BackendUtility; +use In2code\Lux\Utility\ConfigurationUtility; use Psr\EventDispatcher\EventDispatcherInterface; use Psr\Http\Message\ResponseInterface; use Psr\Log\LoggerInterface; @@ -456,11 +457,13 @@ protected function getError(Throwable $exception): array { $this->eventDispatcher->dispatch(new AfterTrackingEvent(new Visitor(), 'error', ['error' => $exception])); if (BackendUtility::isBackendAuthentication() === false) { - // Log error to var/log/typo3_[hash].log - $this->logger->warning('Error in FrontendController happened', [ - 'code' => $exception->getCode(), - 'message' => $exception->getMessage(), - ]); + if (ConfigurationUtility::isExceptionLoggingActivated()) { + // Log error to var/log/typo3_[hash].log + $this->logger->warning('Error in FrontendController happened', [ + 'code' => $exception->getCode(), + 'message' => $exception->getMessage(), + ]); + } $exception = new FakeException('Error happened', 1680200937); } return [ diff --git a/Classes/Domain/Tracker/StopTracking.php b/Classes/Domain/Tracker/StopTracking.php index ee217e8e..de05d7d0 100644 --- a/Classes/Domain/Tracker/StopTracking.php +++ b/Classes/Domain/Tracker/StopTracking.php @@ -10,7 +10,7 @@ /** * Class StopTracking * - * to stop the initial tracking for some reasons: + * to stop the initial tracking for some reason: * - If useragent is empty (seems to be not a normal visitor) * - If useragent contains stop words (e.g. lighthouse, sistrix) * - If useragent turns out to be a blacklisted browser (e.g. "Googlebot") @@ -35,17 +35,48 @@ class StopTracking * @var array */ protected array $blacklistedUa = [ - 'googlebot', - 'pinterestbot', - 'linkedinbot', - 'bingbot', + 'adidxbot', + 'ahrefsbot', + 'alexabot', + 'amazonbot', + 'applebot', 'archive.org_bot', - 'yandexbot', - 'sistrix', + 'baiduspider', + 'bingbot', + 'blexbot', + 'cookieradar', + 'curl', + 'discordbot', + 'dotbot', + 'duckduckbot', + 'exabot', + 'facebookexternalhit', + 'googlebot', + 'headlesschrome', + 'ia_archiver', 'lighthouse', + 'linkedinbot', + 'mauibot', + 'msnbot', + 'phantomjs', + 'pingdom', + 'pinterestbot', + 'python-requests', + 'rogerbot', + 'selenium', + 'semrushbot', 'sistrix', - 'cookieradar', - 'HeadlessChrome', + 'skypebot', + 'slackbot', + 'slurp', + 'sogou', + 'telegrambot', + 'twitterbot', + 'uptimerobot', + 'wget', + 'whatsapp', + 'yacybot', + 'yandexbot', ]; /** diff --git a/Classes/UserFunc/EnableStatus.php b/Classes/UserFunc/EnableStatus.php index 85a9ef46..4426cc8d 100644 --- a/Classes/UserFunc/EnableStatus.php +++ b/Classes/UserFunc/EnableStatus.php @@ -5,8 +5,8 @@ use Doctrine\DBAL\Exception as ExceptionDbal; use In2code\Lux\Domain\Model\Visitor; -use In2code\Lux\Utility\ConfigurationUtility; use In2code\Lux\Utility\DatabaseUtility; +use In2code\Lux\Utility\EnvironmentUtility; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; @@ -23,8 +23,8 @@ class EnableStatus public function showEnableStatus(): string { $variables = [ - 'status' => ConfigurationUtility::isComposerMode() && ExtensionManagementUtility::isLoaded('lux'), - 'composerMode' => ConfigurationUtility::isComposerMode(), + 'status' => EnvironmentUtility::isComposerMode() && ExtensionManagementUtility::isLoaded('lux'), + 'composerMode' => EnvironmentUtility::isComposerMode(), 'enabled' => [ 'lux' => ExtensionManagementUtility::isLoaded('lux'), 'luxenterprise' => ExtensionManagementUtility::isLoaded('luxenterprise'), diff --git a/Classes/Utility/ConfigurationUtility.php b/Classes/Utility/ConfigurationUtility.php index 5ec3e9ee..27457f65 100644 --- a/Classes/Utility/ConfigurationUtility.php +++ b/Classes/Utility/ConfigurationUtility.php @@ -208,15 +208,21 @@ public static function isAnalysisModuleDisabled(): bool * @throws ExtensionConfigurationExtensionNotConfiguredException * @throws ExtensionConfigurationPathDoesNotExistException */ - public static function isWorkflowModuleDisabled(): bool + public static function isExceptionLoggingActivated(): bool { $extensionConfig = self::getExtensionConfiguration(); - return $extensionConfig['disableWorkflowModule'] === '1'; + return $extensionConfig['enbaleExceptionLogging'] === '1'; } - public static function isComposerMode(): bool + /** + * @return bool + * @throws ExtensionConfigurationExtensionNotConfiguredException + * @throws ExtensionConfigurationPathDoesNotExistException + */ + public static function isWorkflowModuleDisabled(): bool { - return defined('TYPO3_COMPOSER_MODE'); + $extensionConfig = self::getExtensionConfiguration(); + return $extensionConfig['disableWorkflowModule'] === '1'; } /** diff --git a/Classes/Utility/EnvironmentUtility.php b/Classes/Utility/EnvironmentUtility.php index 87a5e2d6..1be95fc4 100644 --- a/Classes/Utility/EnvironmentUtility.php +++ b/Classes/Utility/EnvironmentUtility.php @@ -38,4 +38,9 @@ public static function isCli(): bool { return Environment::isCli(); } + + public static function isComposerMode(): bool + { + return defined('TYPO3_COMPOSER_MODE'); + } } diff --git a/Documentation/Technical/Changelog/Index.md b/Documentation/Technical/Changelog/Index.md index a557649b..3767b9fd 100644 --- a/Documentation/Technical/Changelog/Index.md +++ b/Documentation/Technical/Changelog/Index.md @@ -31,6 +31,7 @@ Double check if you have cleared all caches after installing a new LUX version t | Version | Date | State | TYPO3 | Description | |------------|------------|----------|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 36.2.0 | 2024-08-05 | Task | `11.5 + 12.4` | Add main configuration to stop/enable exception logging, extend lists of bots/spider user agent to prevent unneeded tracking | | 36.1.1 | 2024-08-01 | Bugfix | `11.5 + 12.4` | Use site.identifier instead of websiteTitle in all filters, fix possible exception on CLI commands, increase field size of attribute.value, fix small typo in docs | | 36.1.0 | 2024-07-31 | Task | `11.5 + 12.4` | Add a bunch of onetime mail domains to configuration, rename virtual page request to event tracking requests | | 36.0.0 | 2024-07-28 | Feature | `11.5 + 12.4` | Add push service for virtual page visits or search usage (via JavaScript) | diff --git a/Tests/Unit/Utility/EnvironmentUtilityTest.php b/Tests/Unit/Utility/EnvironmentUtilityTest.php new file mode 100644 index 00000000..9ebc18e7 --- /dev/null +++ b/Tests/Unit/Utility/EnvironmentUtilityTest.php @@ -0,0 +1,48 @@ + 'Living User Experience - LUX - the Marketing Automation tool for TYPO3. Turn your visitors to leads. Identification and profiling of your visitors within your TYPO3 website.', 'category' => 'plugin', - 'version' => '36.1.1', + 'version' => '36.2.0', 'author' => 'Alex Kellner', 'author_email' => 'alexander.kellner@in2code.de', 'author_company' => 'in2code.de',