From 7885d2324bd368ac9724f6a1b585536925027a89 Mon Sep 17 00:00:00 2001 From: Stefan Froemken Date: Tue, 15 Jul 2025 17:07:34 +0200 Subject: [PATCH 1/6] Remove leftovers of enableDebug --- Resources/Private/Language/ExtConf.xlf | 5 +---- Resources/Private/Language/de.ExtConf.xlf | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Resources/Private/Language/ExtConf.xlf b/Resources/Private/Language/ExtConf.xlf index fe4ec7c..3531bdc 100644 --- a/Resources/Private/Language/ExtConf.xlf +++ b/Resources/Private/Language/ExtConf.xlf @@ -9,12 +9,9 @@ Search Engine Endpoint: Define the index-now URL of searchengine which should be used to inform about modified content. Use ###URL### and ###APIKEY### for dynamic values. - - Enable debug mode: In case of problems it can help to activate the debug mode. In this case, additional information is displayed in the backend, such as the URL that is sent to the search engines. - Notify batch mode: if enabled, the search engine will be notified using batch mode. This means that modified URLs are sent in a single request. A maximum of 10,000 URLs can be sent per batch. - \ No newline at end of file + diff --git a/Resources/Private/Language/de.ExtConf.xlf b/Resources/Private/Language/de.ExtConf.xlf index b529021..5c40f90 100644 --- a/Resources/Private/Language/de.ExtConf.xlf +++ b/Resources/Private/Language/de.ExtConf.xlf @@ -11,14 +11,10 @@ Search Engine Endpoint: Define the index-now URL of searchengine which should be used to inform about modified content. Use ###URL### and ###APIKEY### for dynamic values. Endpunkt der Suchmaschine: Geben Sie hier die index-now URL zum Suchmaschinenanbieter an, um ihn über aktualisierte Inhalte zu informieren. Verwende ###URL### und ###APIKEY### als dynamische Werte. - - Enable debug mode: In case of problems it can help to activate the debug mode. In this case, additional information is displayed in the backend, such as the URL that is sent to the search engines. - Debug Modus aktivieren: Bei Problemen kann es helfen des Debug Modus zu aktivieren. In diesem Falle werden zusätzliche Informationen im Backend ausgegeben, wie z.B. die URL, die an die Suchmaschinen gesendet wird. - If this checkbox is enabled, the search engine will be notified using batch mode. This means that modified URLs are sent in a single request. A maximum of 10,000 URLs can be sent per batch. Benachrichtigung im Batch-Modus aktivieren: Wenn diese Checkbox aktiviert ist, wird die Suchmaschine im Batch-Modus benachrichtigt. Das bedeutet, dass geänderte URLs gesammelt in einer einzigen Anfrage gesendet werden. Pro Durchgang können maximal 10.000 URLs übermittelt werden. - \ No newline at end of file + From cb29f5546a5e2a4f9ce1091bd0fca1d4ce7367ed Mon Sep 17 00:00:00 2001 From: Stefan Froemken Date: Tue, 15 Jul 2025 17:08:26 +0200 Subject: [PATCH 2/6] Remove placeholders from ExtConf translation --- Resources/Private/Language/ExtConf.xlf | 2 +- Resources/Private/Language/de.ExtConf.xlf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/Private/Language/ExtConf.xlf b/Resources/Private/Language/ExtConf.xlf index 3531bdc..046a0f1 100644 --- a/Resources/Private/Language/ExtConf.xlf +++ b/Resources/Private/Language/ExtConf.xlf @@ -7,7 +7,7 @@ API Key: Each request needs an API key to identify your URLs. You can build one here: https://www.bing.com/indexnow - Search Engine Endpoint: Define the index-now URL of searchengine which should be used to inform about modified content. Use ###URL### and ###APIKEY### for dynamic values. + Search Engine Endpoint: Define the index-now URL of searchengine which should be used to inform about modified content. Notify batch mode: if enabled, the search engine will be notified using batch mode. This means that modified URLs are sent in a single request. A maximum of 10,000 URLs can be sent per batch. diff --git a/Resources/Private/Language/de.ExtConf.xlf b/Resources/Private/Language/de.ExtConf.xlf index 5c40f90..d17d98c 100644 --- a/Resources/Private/Language/de.ExtConf.xlf +++ b/Resources/Private/Language/de.ExtConf.xlf @@ -9,7 +9,7 @@ Search Engine Endpoint: Define the index-now URL of searchengine which should be used to inform about modified content. Use ###URL### and ###APIKEY### for dynamic values. - Endpunkt der Suchmaschine: Geben Sie hier die index-now URL zum Suchmaschinenanbieter an, um ihn über aktualisierte Inhalte zu informieren. Verwende ###URL### und ###APIKEY### als dynamische Werte. + Endpunkt der Suchmaschine: Geben Sie hier die index-now URL zum Suchmaschinenanbieter an, um ihn über aktualisierte Inhalte zu informieren. If this checkbox is enabled, the search engine will be notified using batch mode. This means that modified URLs are sent in a single request. A maximum of 10,000 URLs can be sent per batch. From 80020008d8ee94204f6f4a5aa00f3115b57bc577 Mon Sep 17 00:00:00 2001 From: Stefan Froemken Date: Tue, 15 Jul 2025 17:09:00 +0200 Subject: [PATCH 3/6] Remove enableDebug from ext_conf_template.txt --- ext_conf_template.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/ext_conf_template.txt b/ext_conf_template.txt index 14c7986..2fcecf5 100644 --- a/ext_conf_template.txt +++ b/ext_conf_template.txt @@ -2,7 +2,5 @@ apiKey = # cat=basic; type=string; label=LLL:EXT:indexnow/Resources/Private/Language/ExtConf.xlf:searchEngineEndpoint searchEngineEndpoint = https://www.bing.com/indexnow -# cat=basic; type=boolean; label=LLL:EXT:indexnow/Resources/Private/Language/ExtConf.xlf:enableDebug -enableDebug = 0 # cat=basic; type=boolean; label=LLL:EXT:indexnow/Resources/Private/Language/ExtConf.xlf:notifyBatchMode notifyBatchMode = 0 From 1ef2346c1154fc44df7cca3c263c7bb3e070e87e Mon Sep 17 00:00:00 2001 From: Stefan Froemken Date: Tue, 15 Jul 2025 17:22:01 +0200 Subject: [PATCH 4/6] Use count of StackStorage insteadof unavailable uid list --- Classes/Command/NotifySearchEngineCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Command/NotifySearchEngineCommand.php b/Classes/Command/NotifySearchEngineCommand.php index bd4789c..5ad13d5 100644 --- a/Classes/Command/NotifySearchEngineCommand.php +++ b/Classes/Command/NotifySearchEngineCommand.php @@ -60,8 +60,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->stackRepository->deleteByUid($stack->getUid()); } - $this->logger->info(sprintf('Batch sent (%d URLs), all entries deleted', count($uids))); - $output->writeln(sprintf('Batch sent (%d URLs), all entries deleted.', count($uids))); + $this->logger->info(sprintf('Batch sent (%d URLs), all entries deleted', $stackStorage->count())); + $output->writeln(sprintf('Batch sent (%d URLs), all entries deleted.', $stackStorage->count())); return self::SUCCESS; } From 7b7d79c492703732747017378d1ffd010b750e16 Mon Sep 17 00:00:00 2001 From: Stefan Froemken Date: Tue, 15 Jul 2025 17:23:53 +0200 Subject: [PATCH 5/6] Throw exception, if no API key --- Classes/Notifier/SearchEngineNotifier.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Classes/Notifier/SearchEngineNotifier.php b/Classes/Notifier/SearchEngineNotifier.php index 7273a35..33ccd80 100644 --- a/Classes/Notifier/SearchEngineNotifier.php +++ b/Classes/Notifier/SearchEngineNotifier.php @@ -105,18 +105,18 @@ protected function notifySingleStack(Stack $stack): bool return $isValidRequest; } + /** + * @throws ApiKeyNotAvailableException + */ protected function getUrlForSingleNotification(Stack $stack): string { + // Do not surround with try-catch. It should break in scheduler/cli + // if no API key is available to inform the user visually $uri = new Uri($this->extConf->getSearchEngineEndpoint()); - - try { - $uri = $uri->withQuery(HttpUtility::buildQueryString([ - 'url' => $stack->getUrl(), - 'key' => $this->extConf->getApiKey(), - ])); - } catch (ApiKeyNotAvailableException) { - return ''; - } + $uri = $uri->withQuery(HttpUtility::buildQueryString([ + 'url' => $stack->getUrl(), + 'key' => $this->extConf->getApiKey(), + ])); return (string)$uri; } From 304c1c9dfa1a205585c94e9cbcda18881bee7fe8 Mon Sep 17 00:00:00 2001 From: Stefan Froemken Date: Tue, 15 Jul 2025 17:24:18 +0200 Subject: [PATCH 6/6] Update version to 0.0.8 --- ext_emconf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext_emconf.php b/ext_emconf.php index dbf10a5..05df328 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -14,7 +14,7 @@ 'author' => 'Stefan Froemken', 'author_email' => 'sfroemken@jweiland.net', 'state' => 'experimental', - 'version' => '0.0.7', + 'version' => '0.0.8', 'constraints' => [ 'depends' => [ 'typo3' => '12.4.31-13.4.99',