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
6 changes: 3 additions & 3 deletions cdn-files/plugin-info.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
*** WebDecoy Bot Detection Changelog ***

= 2.17.3 - 2026-12-02 =
* Fixed: a site connected to WebDecoy Cloud stopped sending detections there after its settings were next saved, or within 12 hours of connecting. Cloud reporting now stays on and the connection is re-checked in the background.
* Fixed: the WebDecoy-Test/ check said a test detection was recorded even when it never reached WebDecoy Cloud, for the same reason.
* Changed: pages no longer carry a JavaScript verification token, and the plugin no longer reports each page view to WebDecoy Cloud for it. Cloud never received the reply it waited for, so the check could mark real visitors and search crawlers as scrapers.
* Improved: names 37 more bots and crawlers (440 in total), including Devin, BLEXBot, Siteimprove, ZoominfoBot, CriteoBot and the Library of Congress crawler.

= 2.17.2 - 2026-11-29 =
* Improved: Names 126 more bots, crawlers and AI agents (403 in total), including Google-Agent, Claude-Agent, Grok-Agent, DeepSeekBot and Amazon's AgentCore browser. With automatic robots.txt or crawler page-cache bypass on, the new crawlers in your chosen categories are included.
* Fixed: People using the NAVER app, the Ecosia browser, or Instagram and Threads on Redmi Note 12 Pro phones are no longer counted as bots.
Expand Down
15 changes: 15 additions & 0 deletions includes/class-webdecoy-cloud-connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,21 @@ public static function normalize_entitlements(array $raw, int $now): array
];
}

/**
* Whether a cached API status lets cloud features run (is_premium()).
*
* Only a confirmed refusal ('inactive') or a recent network failure
* ('error') turns them off. A missing status used to read as off, and
* nothing ever re-checked the key, so a connected site stopped reporting
* at the first settings save or within 12 hours of connecting at most.
*
* @param mixed $cached get_transient('webdecoy_api_status')
*/
public static function status_allows_cloud($cached): bool
{
return $cached === 'active' || $cached === false;
}

/**
* Constant-form hex check. `$length` of 0 means "any non-empty length".
*/
Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://webdecoy.com
Tags: ai crawlers, block ai bots, gptbot, bot detection, llms.txt
Requires at least: 6.1
Tested up to: 7.2
Stable tag: 2.17.2
Stable tag: 2.17.3
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -275,6 +275,12 @@ The bundled good-bot list (sdk/src/GoodBotList.php) stores a documentation URL f

== Changelog ==

= 2.17.3 =
* Fixed: a site connected to WebDecoy Cloud stopped sending detections there after its settings were next saved, or within 12 hours of connecting. Cloud reporting now stays on and the connection is re-checked in the background.
* Fixed: the WebDecoy-Test/ check said a test detection was recorded even when it never reached WebDecoy Cloud, for the same reason.
* Changed: pages no longer carry a JavaScript verification token, and the plugin no longer reports each page view to WebDecoy Cloud for it. Cloud never received the reply it waited for, so the check could mark real visitors and search crawlers as scrapers.
* Improved: names 37 more bots and crawlers (440 in total), including Devin, BLEXBot, Siteimprove, ZoominfoBot, CriteoBot and the Library of Congress crawler.

= 2.17.2 =
* Improved: Names 126 more bots, crawlers and AI agents (403 in total), including Google-Agent, Claude-Agent, Grok-Agent, DeepSeekBot and Amazon's AgentCore browser. With automatic robots.txt or crawler page-cache bypass on, the new crawlers in your chosen categories are included.
* Fixed: People using the NAVER app, the Ecosia browser, or Instagram and Threads on Redmi Note 12 Pro phones are no longer counted as bots.
Expand Down
20 changes: 20 additions & 0 deletions tests/CloudConnectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,23 @@
$same('https://app.webdecoy.com/onboarding/setup', WebDecoy_Cloud_Connect::setup_url_from(['setup_url' => $bad]), $bad);
}
});

echo "\nCloud Connect: cached API status\n";

$t('a missing status keeps cloud reporting on; only a refusal or network error turns it off', function () use ($same) {
$same(true, WebDecoy_Cloud_Connect::status_allows_cloud('active'));
$same(true, WebDecoy_Cloud_Connect::status_allows_cloud(false), 'expired, cleared or evicted is unknown, not inactive');
$same(false, WebDecoy_Cloud_Connect::status_allows_cloud('inactive'));
$same(false, WebDecoy_Cloud_Connect::status_allows_cloud('error'));
});

$t('a missing status schedules a re-check of the key, and the re-check is wired', function () use ($true) {
$src = (string) file_get_contents(dirname(__DIR__) . '/webdecoy.php');
$start = strpos($src, 'public function is_api_status_active(): bool');
$true($start !== false, 'is_api_status_active not found; this test is stale');
$body = substr($src, $start, (int) strpos($src, "\n }\n", $start) - $start);
$true(strpos($body, "wp_schedule_single_event(time(), 'webdecoy_check_api_status')") !== false, 'a missing status must schedule a re-check');
$true(strpos($body, 'WebDecoy_Cloud_Connect::status_allows_cloud(') !== false, 'the status must be read through status_allows_cloud');
$true(strpos($src, "add_action('webdecoy_check_api_status', [\$this, 'cron_check_api_status'])") !== false, 'the re-check hook must be registered');
$true(preg_match('/function cron_check_api_status\(\): void\s*\{\s*\$this->is_api_active\(true\);/', $src) === 1, 'the re-check must force a fresh validation');
});
22 changes: 19 additions & 3 deletions webdecoy.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WebDecoy – AI Crawler Analytics, Block AI Bots, Robots.txt & llms.txt
* Plugin URI: https://webdecoy.com/wordpress
* Description: Understand AI crawler visits and bot identity evidence in WordPress, with local analytics and protection against spam, login abuse, and WooCommerce card testing.
* Version: 2.17.2
* Version: 2.17.3
* Requires at least: 6.1
* Requires PHP: 7.4
* Author: WebDecoy
Expand Down Expand Up @@ -41,7 +41,7 @@ function str_starts_with(string $haystack, string $needle): bool
}

// Plugin constants
define('WEBDECOY_VERSION', '2.17.2');
define('WEBDECOY_VERSION', '2.17.3');
define('WEBDECOY_PLUGIN_FILE', __FILE__);
define('WEBDECOY_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('WEBDECOY_PLUGIN_URL', plugin_dir_url(__FILE__));
Expand Down Expand Up @@ -984,6 +984,9 @@ private function init_hooks(): void
// Clear API cache when settings are saved
add_action('update_option_webdecoy_options', [$this, 'clear_api_status_cache']);

// Re-check the API key when its cached status is gone.
add_action('webdecoy_check_api_status', [$this, 'cron_check_api_status']);

// Safety-net cron drain of the violation-report spool.
add_action('webdecoy_flush_violations', [$this, 'cron_flush_violations']);

Expand Down Expand Up @@ -3427,7 +3430,20 @@ public function is_api_status_active(): bool
// Only check the cache - don't make API calls during initialization
$cached = get_transient('webdecoy_api_status');

return $cached === 'active';
// No cached status (it expired, a settings save cleared it, or an
// object cache evicted it) is unknown, not inactive: re-check the key
// in the background instead of switching cloud reporting off for good.
if ($cached === false && !wp_next_scheduled('webdecoy_check_api_status')) {
wp_schedule_single_event(time(), 'webdecoy_check_api_status');
}

return WebDecoy_Cloud_Connect::status_allows_cloud($cached);
}

/** Background re-check of the API key, scheduled by is_api_status_active(). */
public function cron_check_api_status(): void
{
$this->is_api_active(true);
}

/**
Expand Down
Loading