We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b9629bb + 2648cb0 commit 7b87ab0Copy full SHA for 7b87ab0
wp-slimstat.php
@@ -1095,7 +1095,10 @@ public static function enqueue_tracker()
1095
// Add dependencies for consent integrations (e.g., WP Consent API)
1096
$dependencies = [];
1097
if ((self::$settings['consent_integration'] ?? '') === 'wp_consent_api') {
1098
- $dependencies[] = 'wp-consent-api';
+ // Only add dependency if the WP Consent API script is actually registered
1099
+ if (wp_script_is('wp-consent-api', 'registered') || wp_script_is('wp-consent-api', 'enqueued')) {
1100
+ $dependencies[] = 'wp-consent-api';
1101
+ }
1102
}
1103
1104
// Register the correct script for adblock bypass, CDN, or default
0 commit comments