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
2 changes: 2 additions & 0 deletions admin/partials/blocked-ips-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package WebDecoy
*/

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- This partial is included by blocked_ips_page(). Its variables stay in that method.

// Prevent direct access
if (!defined('ABSPATH')) {
exit;
Expand Down
2 changes: 2 additions & 0 deletions admin/partials/dashboard-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package WebDecoy
*/

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- This partial is included by render_dashboard_widget(). Its variables stay in that method.

// Prevent direct access
if (!defined('ABSPATH')) {
exit;
Expand Down
8 changes: 5 additions & 3 deletions admin/partials/detections-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package WebDecoy
*/

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- This partial is included by detections_page(). Its variables stay in that method.

// Prevent direct access
if (!defined('ABSPATH')) {
exit;
Expand Down Expand Up @@ -90,7 +92,7 @@
fputcsv($output, ['Date', 'IP Address', 'Score', 'Threat Level', 'Source', 'User Agent', 'Flags']);

$export_query = "SELECT * FROM {$table} WHERE {$where} ORDER BY created_at DESC";
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared -- Query built dynamically with safe table/column names
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter -- Filter SQL uses only literal clauses; every request value is bound by wpdb::prepare().
$export_results = $wpdb->get_results($wpdb->prepare($export_query, $params), ARRAY_A);

foreach ($export_results as $row) {
Expand All @@ -112,14 +114,14 @@

// Get total - always use prepare()
$total_query = "SELECT COUNT(*) FROM {$table} WHERE {$where}";
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared -- Query built dynamically with safe table/column names
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter -- Filter SQL uses only literal clauses; every request value is bound by wpdb::prepare().
$total = $wpdb->get_var($wpdb->prepare($total_query, $params));
$total_pages = ceil($total / $wd_per_page);

// Get detections - always use prepare()
$query = "SELECT * FROM {$table} WHERE {$where} ORDER BY created_at DESC LIMIT %d OFFSET %d";
$query_params = array_merge($params, [$wd_per_page, $offset]);
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared -- Query built dynamically with safe table/column names
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter -- Filter SQL uses only literal clauses; every request value is bound by wpdb::prepare().
$detections = $wpdb->get_results($wpdb->prepare($query, $query_params), ARRAY_A);

// Get stats
Expand Down
2 changes: 2 additions & 0 deletions admin/partials/page-cache-notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*
* @package WebDecoy
*/

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- This partial is included through statistics_page(). Its variables stay in that method.
if (!defined('ABSPATH')) {
exit;
}
Expand Down
2 changes: 2 additions & 0 deletions admin/partials/settings-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package WebDecoy
*/

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- This partial is included by settings_page(). Its variables stay in that method.

// Prevent direct access
if (!defined('ABSPATH')) {
exit;
Expand Down
2 changes: 2 additions & 0 deletions admin/partials/statistics-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package WebDecoy
*/

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- This partial is included by statistics_page(). Its variables stay in that method.

// Prevent direct access
if (!defined('ABSPATH')) {
exit;
Expand Down
2 changes: 2 additions & 0 deletions admin/partials/traffic-overview.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
/** Chart-first local traffic overview. @package WebDecoy */

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- This partial is included through statistics_page(). Its variables stay in that method.
if (!defined('ABSPATH')) {
exit;
}
Expand Down
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ if [ "$ORG_BUILD" = "1" ]; then
rm -rf "${BUILD_DIR}/${PLUGIN_SLUG}/cdn-files"
rm -f "${BUILD_DIR}/${PLUGIN_SLUG}/release.sh"
rm -rf "${BUILD_DIR}/${PLUGIN_SLUG}/bin"

# These documentation URLs are crawler metadata. Plugin Check also matches
# them as offsite resources, so annotate just these generated data lines.
registry="${BUILD_DIR}/${PLUGIN_SLUG}/sdk/src/registry/agents.generated.php"
sed -E -i '' \
"/^[[:space:]]*'(patterns|website)' => .*developers\.cloudflare\.com\/(security-center|browser-rendering\/rest-api\/crawl-endpoint)/s|$| // phpcs:ignore PluginCheck.CodeAnalysis.Offloading.OffloadedContent -- Crawler match or documentation metadata.|" \
"$registry"
fi

# Create ZIP file (folder inside is always the slug, as WordPress requires)
Expand Down
18 changes: 9 additions & 9 deletions includes/class-webdecoy-ai-referrals.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ class WebDecoy_AI_Referrals
private static bool $cloud = false;

/**
* The ai_referrals table name, prefixed and escaped for interpolation.
* The ai_referrals table name, including the current WordPress site prefix.
*/
public static function table(): string
{
global $wpdb;
return esc_sql($wpdb->prefix . 'webdecoy_ai_referrals');
return $wpdb->prefix . 'webdecoy_ai_referrals';
}

/** The local daily counts table name, prefixed and escaped for interpolation. */
/** The local daily counts table name, including the current WordPress site prefix. */
public static function days_table(): string
{
global $wpdb;
return esc_sql($wpdb->prefix . 'webdecoy_ai_referral_days');
return $wpdb->prefix . 'webdecoy_ai_referral_days';
}

/**
Expand Down Expand Up @@ -141,7 +141,7 @@ private static function recordDay(string $platform, string $path): void
return;
}
global $wpdb;
$table = self::days_table();
$table = esc_sql(self::days_table());
$day = self::day(time());
// phpcs:disable WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- table name from $wpdb->prefix
$known = (int) $wpdb->get_var($wpdb->prepare(
Expand Down Expand Up @@ -179,7 +179,7 @@ public static function summary(int $days): array
return self::summarize([]);
}
global $wpdb;
$table = self::days_table();
$table = esc_sql(self::days_table());
// phpcs:disable WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- table name from $wpdb->prefix
$rows = $wpdb->get_results($wpdb->prepare(
"SELECT platform, landing_path, SUM(referrals) AS referrals FROM {$table} WHERE day >= %s GROUP BY platform, landing_path",
Expand Down Expand Up @@ -235,7 +235,7 @@ public static function prune(): void
return;
}
global $wpdb;
$table = self::days_table();
$table = esc_sql(self::days_table());
// phpcs:ignore WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- table name from $wpdb->prefix
$wpdb->query($wpdb->prepare("DELETE FROM {$table} WHERE day < %s", self::day(time() - self::LOCAL_RETENTION_DAYS * DAY_IN_SECONDS)));
}
Expand Down Expand Up @@ -281,7 +281,7 @@ public static function landingPath(string $uri): string
private static function increment(string $platform, string $path): void
{
global $wpdb;
$table = self::table();
$table = esc_sql(self::table());
// phpcs:ignore WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- table name from $wpdb->prefix
$rows = (int) $wpdb->get_var("SELECT COUNT(*) FROM {$table}");
$key = sha1($platform . "\n" . $path);
Expand Down Expand Up @@ -316,7 +316,7 @@ public static function flush(string $apiKey): void
return;
}
global $wpdb;
$table = self::table();
$table = esc_sql(self::table());
// phpcs:ignore WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
$batch = (string) $wpdb->get_var("SELECT batch_id FROM {$table} WHERE batch_id <> '' LIMIT 1");
if ($batch === '') {
Expand Down
4 changes: 2 additions & 2 deletions includes/class-webdecoy-blocker.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ public function get_blocked_ips(array $args = []): array

$offset = ($args['page'] - 1) * $args['per_page'];

// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Filtered, paginated operator block list needs current entries after block/unblock actions.
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter -- The live block list uses an escaped table, a prepared time condition and allowlisted sort options.
$results = $wpdb->get_results($wpdb->prepare(
"SELECT * FROM {$table} WHERE {$where} ORDER BY {$orderby} {$order} LIMIT %d OFFSET %d",
$args['per_page'],
Expand All @@ -469,7 +469,7 @@ public function get_blocked_count(bool $include_expired = false): int
$where .= $wpdb->prepare(" AND (expires_at IS NULL OR expires_at > %s)", gmdate('Y-m-d H:i:s'));
}

// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Operator list pagination uses current plugin block counts, including time-dependent expirations.
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter -- The live count uses an escaped table and a prepared time condition.
return (int) $wpdb->get_var("SELECT COUNT(*) FROM {$table} WHERE {$where}");
}

Expand Down
10 changes: 5 additions & 5 deletions includes/class-webdecoy-crawler-visits.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ class WebDecoy_Crawler_Visits
private const SEARCH_CATEGORIES = ['search_crawler'];

/**
* The counters table name, prefixed and escaped for interpolation.
* The counters table name, including the current WordPress site prefix.
*/
public static function table(): string
{
global $wpdb;
return esc_sql($wpdb->prefix . 'webdecoy_crawler_visits');
return $wpdb->prefix . 'webdecoy_crawler_visits';
}

/**
Expand Down Expand Up @@ -99,7 +99,7 @@ public static function observe(string $userAgent, array $flags, bool $ipUnreliab
}

global $wpdb;
$table = self::table();
$table = esc_sql(self::table());
// phpcs:disable WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- table name from $wpdb->prefix
$wpdb->query($wpdb->prepare(
"INSERT INTO {$table} (bucket, agent_id, verification, hits) VALUES (%s, %s, %s, 1)
Expand Down Expand Up @@ -132,7 +132,7 @@ public static function summary(int $hours): array
return self::summarize([]);
}
global $wpdb;
$table = self::table();
$table = esc_sql(self::table());
// phpcs:disable WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- table name from $wpdb->prefix
$rows = $wpdb->get_results($wpdb->prepare(
"SELECT agent_id, verification, SUM(hits) AS hits FROM {$table} WHERE bucket >= %s GROUP BY agent_id, verification",
Expand Down Expand Up @@ -250,7 +250,7 @@ public static function prune(): void
return;
}
global $wpdb;
$table = self::table();
$table = esc_sql(self::table());
// phpcs:disable WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- table name from $wpdb->prefix
$wpdb->query($wpdb->prepare(
"DELETE FROM {$table} WHERE bucket < %s",
Expand Down
1 change: 1 addition & 0 deletions includes/class-webdecoy-llms-txt.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ private static function send(string $body): void
// Full-page caches (WP Super Cache, W3TC, WP Rocket, LiteSpeed) honour
// this: a cached copy would be served as HTML and stop crawler counts.
if (!defined('DONOTCACHEPAGE')) {
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound -- Full-page caches read this shared constant.
define('DONOTCACHEPAGE', true);
}
status_header(200);
Expand Down
5 changes: 5 additions & 0 deletions includes/class-webdecoy-page-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
if (defined('W3TC') && self::w3tc_page_cache_enabled()) {
return self::plugin('W3 Total Cache', 'w3tc', true);
}
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Read LiteSpeed Cache configuration through its published filter.
if (defined('LSCWP_V') && function_exists('apply_filters') && apply_filters('litespeed_conf', 'cache')) {
return self::plugin('LiteSpeed Cache', 'litespeed', true);
}
Expand Down Expand Up @@ -455,12 +456,14 @@
},
'wanted' => $same,
'read' => static function (): array {
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Read LiteSpeed Cache configuration through its published filter.
$list = apply_filters('litespeed_conf', self::LITESPEED_UA_KEY);
return is_array($list) ? array_values(array_map('strval', $list)) : [];
},
'write' => static function (array $list): bool {
// LiteSpeed's public API: saves the option and rewrites
// its .htaccess "no cache" rule for these agents.
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Invoke LiteSpeed Cache's settings action.
do_action('litespeed_save_conf', [self::LITESPEED_UA_KEY => $list]);
return true;
},
Expand All @@ -479,9 +482,11 @@
'write' => static function (array $list, array $old): bool {
// WP Super Cache's own add and remove for plugin files it loads.
foreach (array_diff($old, $list) as $file) {
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Invoke WP Super Cache's own cache-plugin registration action.
do_action('wpsc_delete_plugin', $file);
}
foreach (array_diff($list, $old) as $file) {
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Invoke WP Super Cache's own cache-plugin registration action.
do_action('wpsc_add_plugin', $file);
}
return true;
Expand All @@ -506,7 +511,7 @@
if (function_exists('flush_rocket_htaccess')) {
flush_rocket_htaccess();
}
rocket_generate_config_file();

Check failure on line 514 in includes/class-webdecoy-page-cache.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Function rocket_generate_config_file not found.
return true;
},
],
Expand All @@ -519,7 +524,7 @@
private static function w3tc_read(): array
{
try {
return array_values(array_map('strval', (array) \W3TC\Dispatcher::config()->get_array('pgcache.reject.ua')));

Check failure on line 527 in includes/class-webdecoy-page-cache.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Call to static method config() on an unknown class W3TC\Dispatcher.
} catch (\Throwable $e) {
return [];
}
Expand All @@ -534,17 +539,17 @@
private static function w3tc_write(array $list): bool
{
try {
$current = \W3TC\Dispatcher::config();

Check failure on line 542 in includes/class-webdecoy-page-cache.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Call to static method config() on an unknown class W3TC\Dispatcher.
$new = new \W3TC\Config();

Check failure on line 543 in includes/class-webdecoy-page-cache.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Instantiated class W3TC\Config not found.
$new->set('pgcache.reject.ua', $list);

Check failure on line 544 in includes/class-webdecoy-page-cache.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Call to method set() on an unknown class W3TC\Config.
\W3TC\Util_Admin::config_save($current, $new);

Check failure on line 545 in includes/class-webdecoy-page-cache.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Call to static method config_save() on an unknown class W3TC\Util_Admin.
} catch (\Throwable $e) {
return false;
}
try {
// What W3TC runs on its own admin pages: rewrites .htaccess and
// nginx.conf rules (Disk: Enhanced) for the new list now.
\W3TC\Dispatcher::component('Root_Environment')->fix_in_wpadmin($new);

Check failure on line 552 in includes/class-webdecoy-page-cache.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Call to static method component() on an unknown class W3TC\Dispatcher.
} catch (\Throwable $e) {
unset($e); // W3TC retries on its next admin page and reports there.
}
Expand Down
8 changes: 4 additions & 4 deletions includes/class-webdecoy-request-counts.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static function matches_response(string $outcome, int $status): bool
public static function table(): string
{
global $wpdb;
return esc_sql($wpdb->prefix . 'webdecoy_request_counts');
return $wpdb->prefix . 'webdecoy_request_counts';
}

/** Final response accounting cannot interfere with the protection response. */
Expand All @@ -97,7 +97,7 @@ public static function flush(): void
if (!self::ready()) {
return;
}
$table = self::table();
$table = esc_sql(self::table());
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Plugin-owned outcome counters; writes/retention must persist and setup/status summaries deliberately read current receipt totals.
$wpdb->query($wpdb->prepare(
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Identifier derives only from the trusted WordPress table prefix; values remain prepared.
Expand Down Expand Up @@ -162,7 +162,7 @@ public static function summary(int $days): array
return $result;
}
global $wpdb;
$table = self::table();
$table = esc_sql(self::table());
$detections = esc_sql($wpdb->prefix . 'webdecoy_detections');
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Plugin-owned outcome counters; writes/retention must persist and setup/status summaries deliberately read current receipt totals.
$rows = $wpdb->get_results($wpdb->prepare(
Expand All @@ -188,7 +188,7 @@ public static function prune(): void
return;
}
global $wpdb;
$table = self::table();
$table = esc_sql(self::table());
$window = self::window(self::RETENTION_DAYS);
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Table identifier comes only from the trusted WordPress prefix; cutoff is prepared.
$wpdb->query($wpdb->prepare("DELETE FROM {$table} WHERE bucket < %s", $window['from']));
Expand Down
4 changes: 2 additions & 2 deletions includes/class-webdecoy-traffic-report.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ public static function read(int $days): array
$referral_ready = version_compare($version, WebDecoy_AI_Referrals::SINCE_DB_VERSION, '>=');
// phpcs:disable WordPress.DB.DirectDatabaseQuery -- Admin-only aggregates cached for 60 seconds below.
if ($crawler_ready) {
$table = WebDecoy_Crawler_Visits::table();
$table = esc_sql(WebDecoy_Crawler_Visits::table());
$crawler_rows = $wpdb->get_results($wpdb->prepare(
"SELECT DATE(bucket) AS day, agent_id, verification, SUM(hits) AS hits FROM {$table} WHERE bucket >= %s GROUP BY DATE(bucket), agent_id, verification", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Escaped plugin-owned table name.
$start . ' 00:00:00'
), ARRAY_A);
$crawler_ready = is_array($crawler_rows);
}
if ($referral_ready) {
$table = WebDecoy_AI_Referrals::days_table();
$table = esc_sql(WebDecoy_AI_Referrals::days_table());
$referral_rows = $wpdb->get_results($wpdb->prepare(
"SELECT day, platform, landing_path, SUM(referrals) AS referrals FROM {$table} WHERE day >= %s GROUP BY day, platform, landing_path", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Escaped plugin-owned table name.
$start
Expand Down
2 changes: 1 addition & 1 deletion includes/class-webdecoy-violation-reporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private static function acquire_drain_lock(): bool
private static function drain_locked(string $apiKey): void
{
global $wpdb;
$table = $wpdb->prefix . 'webdecoy_violation_queue';
$table = esc_sql($wpdb->prefix . 'webdecoy_violation_queue');

// Enforce the hard cap first: discard the oldest overflow so a prolonged
// ingest outage can't grow the table without bound.
Expand Down
2 changes: 1 addition & 1 deletion includes/wpsc-crawler-bypass.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function webdecoy_wpsc_cache_init(): void
require_once __DIR__ . '/class-webdecoy-page-cache.php';

if (WebDecoy_Page_Cache::ua_matches($ua, WebDecoy_Page_Cache::crawler_tokens())) {
$cache_enabled = false; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- WP Super Cache's own per-request switch.
$cache_enabled = false; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited, WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WP Super Cache's own per-request switch.
}
}

Expand Down
5 changes: 1 addition & 4 deletions sdk/src/AgentRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ private static function table(): array
if (self::$table === null) {
$loaded = require __DIR__ . '/registry/agents.generated.php';
if (!is_array($loaded) || (int) ($loaded['schema'] ?? 0) !== self::SCHEMA) {
throw new \RuntimeException(
'WebDecoy agent registry schema mismatch: expected ' . self::SCHEMA
. ', found ' . (string) ($loaded['schema'] ?? 'none')
);
throw new \RuntimeException('WebDecoy agent registry schema mismatch. Rebuild the plugin with a compatible registry.');
}
self::$table = $loaded;
}
Expand Down
Loading
Loading