Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changelog

5.0.4 - 2026-01-05
- Updated Api timeout to 5 seconds and changed log level to info and debug

5.0.3 - 2025-11-10
- Updated cover image for marketplace
- Updated screenshot to not include extra plugins
Expand Down
2 changes: 1 addition & 1 deletion Slack.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ public function sendNewAlerts($triggeredAlerts): void
foreach ($groupedAlerts as $slackChannelId => $alert) {
if (!$slackApi->sendMessage(implode("\n", $alert['message']), $slackChannelId)) {
$logger = StaticContainer::get(LoggerInterface::class);
$logger->debug('Slack alert failed for following alerts: ' . implode("\n", $alert['name']));
$logger->info('Slack alert failed for following alerts: ' . implode("\n", $alert['name']));
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions SlackApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SlackApi
private const SLACK_COMPLETE_UPLOAD_EXTERNAL = 'https://slack.com/api/files.completeUploadExternal';
private const SLACK_POST_MESSAGE_URL = 'https://slack.com/api/chat.postMessage';

private const SLACK_TIMEOUT = 5000;
private const SLACK_TIMEOUT = 5;

public function __construct(
#[\SensitiveParameter]
Expand All @@ -60,7 +60,7 @@ public function uploadFile(string $subject, string $fileName, string $fileConten
return $this->completeUploadExternal($channel, $subject);
}

$this->logger->debug('Unable to send ' . $fileName . ' report to Slack');
$this->logger->info('Unable to send ' . $fileName . ' report to Slack');

return false;
}
Expand All @@ -87,7 +87,7 @@ public function getUploadURLExternal(string $fileName, int $fileLength): string
['Content-Type' => 'multipart/form-data']
);
} catch (\Exception $e) {
$this->logger->debug('Slack error getUploadURLExternal: ' . $e->getMessage());
$this->logger->error('Slack error getUploadURLExternal: ' . $e->getMessage());
return '';
}

Expand Down Expand Up @@ -120,7 +120,7 @@ public function sendFile(string $uploadURL, string $fileContents): bool
true
);
} catch (\Exception $e) {
$this->logger->debug('Slack error sendFile: ' . $e->getMessage());
$this->logger->error('Slack error sendFile: ' . $e->getMessage());
return false;
}

Expand Down Expand Up @@ -151,7 +151,7 @@ public function completeUploadExternal(string $channel, string $subject): bool
['Content-Type' => 'multipart/form-data']
);
} catch (\Exception $e) {
$this->logger->debug('Slack error completeUploadExternal:' . $e->getMessage());
$this->logger->error('Slack error completeUploadExternal:' . $e->getMessage());
return false;
}

Expand All @@ -171,7 +171,7 @@ public function completeUploadExternal(string $channel, string $subject): bool
public function sendMessage(string $message, string $channel): bool
{
if (empty($message) || empty($channel)) {
$this->logger->debug('Empty message or channel for sending message');
$this->logger->info('Empty message or channel for sending message');
return false;
}

Expand All @@ -187,7 +187,7 @@ public function sendMessage(string $message, string $channel): bool
['Content-Type' => 'multipart/form-data']
);
} catch (\Exception $e) {
$this->logger->debug('Slack error sendMessage:' . $e->getMessage());
$this->logger->error('Slack error sendMessage:' . $e->getMessage());
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Slack",
"description": "Send Matomo reports and alerts to Slack channels, keeping your team informed and ready to act in real time.",
"version": "5.0.3",
"version": "5.0.4",
"theme": false,
"require": {
"matomo": ">=5.0.0,<6.0.0-b1"
Expand Down