Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 12 additions & 6 deletions admin/partials/settings-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,9 @@
$wd_plan_slug = isset($options['plan']) ? (string) $options['plan'] : '';
$wd_plan_label = WebDecoy_Cloud_Connect::plan_label($wd_plan_slug);
$wd_digest_on = !empty($wd_entitlements['digest']['enabled']);
$wd_alerts_on = !empty($wd_entitlements['features']['alerts']);
// The entitlement says configuration and delivery are available;
// it does not say that either channel is configured or active.
$wd_alerts_available = !empty($wd_entitlements['features']['alerts']);
?>
<div class="webdecoy-connected-card">
<div class="webdecoy-connected-head">
Expand Down Expand Up @@ -1090,11 +1092,15 @@
// it would get, without either having to guess.
?>
<p class="webdecoy-alerts-status">
<span class="dashicons <?php echo esc_attr($wd_alerts_on ? 'dashicons-bell' : 'dashicons-lock'); ?>"></span>
<?php if ($wd_alerts_on) : ?>
<?php esc_html_e('Slack and webhook alerts: On.', 'webdecoy'); ?>
<a href="https://app.webdecoy.com/enforcement/actions" target="_blank" rel="noopener">
<?php esc_html_e('Configure them in your dashboard', 'webdecoy'); ?>
<span class="dashicons <?php echo esc_attr($wd_alerts_available ? 'dashicons-bell' : 'dashicons-lock'); ?>"></span>
<?php if ($wd_alerts_available) : ?>
<?php esc_html_e('Slack and webhook alerts are available with your plan.', 'webdecoy'); ?>
<a href="https://app.webdecoy.com/integrations/slack" target="_blank" rel="noopener">
<?php esc_html_e('Configure Slack', 'webdecoy'); ?>
</a>
<span aria-hidden="true">&middot;</span>
<a href="https://app.webdecoy.com/integrations/webhooks" target="_blank" rel="noopener">
<?php esc_html_e('Configure webhooks', 'webdecoy'); ?>
</a>
<?php else : ?>
<?php esc_html_e('Slack and webhook alerts: available on Pro. Detection, blocking and the monthly report stay free.', 'webdecoy'); ?>
Expand Down
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
= 2.17.0 - 2026-11-27 =
* New: while your site is not connected to WebDecoy Cloud, administrators see one notice offering a free connection, with what WebDecoy counted on the site this week. Choose Connect free, Not now (hides it for 14 days) or Don't show again. Nothing leaves your site until you click Connect.
* Changed: uninstalling also removes the review and connect notice settings.
* Fixed: the Cloud tab now describes Slack and webhook alerts as available with an eligible plan instead of claiming they are already on, and links to each channel's actual configuration page.

= 2.16.4 - 2026-11-25 =
* Improved: Resolved WordPress Plugin Check errors and warnings in the directory build.
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ The bundled good-bot list (sdk/src/GoodBotList.php) stores a documentation URL f
= 2.17.0 =
* New: while your site is not connected to WebDecoy Cloud, administrators see one notice offering a free connection, with what WebDecoy counted on the site this week. Choose Connect free, Not now (hides it for 14 days) or Don't show again. Nothing leaves your site until you click Connect.
* Changed: uninstalling also removes the review and connect notice settings.
* Fixed: the Cloud tab describes Slack and webhook alerts as available with an eligible plan instead of claiming they are already on, and links to each channel's configuration page.

= 2.16.4 =
* Improved: Resolved WordPress Plugin Check errors and warnings in the directory build.
Expand Down
41 changes: 41 additions & 0 deletions tests/CloudAlertsTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

/**
* Cloud alert entry points describe entitlement separately from delivery.
*
* The plugin receives features.alerts, which answers only whether the plan may
* configure and deliver alerts. It receives no Slack/webhook configuration
* state, so claiming that alerts are "On" would invent operational status.
*/

echo "\nCloud alert entry points\n";

$settings = (string) file_get_contents(dirname(__DIR__) . '/admin/partials/settings-page.php');

TestRunner::test('an alert entitlement is presented as availability, not delivery state', function () use ($settings) {
TestRunner::assertTrue(
strpos($settings, 'Slack and webhook alerts are available with your plan.') !== false,
'the paid state should say the channels are available'
);
TestRunner::assertTrue(
strpos($settings, 'Slack and webhook alerts: On.') === false,
'features.alerts cannot prove that either channel is configured or delivering'
);
});

TestRunner::test('Slack and webhook links reach their separate configuration surfaces', function () use ($settings) {
TestRunner::assertTrue(
strpos($settings, 'https://app.webdecoy.com/integrations/slack') !== false,
'Slack is an integration, not a response-action type'
);
TestRunner::assertTrue(
strpos($settings, 'https://app.webdecoy.com/integrations/webhooks') !== false,
'webhooks link to their integration configuration'
);
TestRunner::assertTrue(
strpos($settings, 'Configure Slack') !== false && strpos($settings, 'Configure webhooks') !== false,
'each channel has an explicit link label'
);
});
Loading