Skip to content

Commit f5e8b58

Browse files
committed
Upd. PublicScripts. Update bot detector script enqueueing to use wp_enqueue_script with proper parameters for improved performance and compatibility.
1 parent fa77bfb commit f5e8b58

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

inc/cleantalk-public.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,13 +1287,15 @@ function apbct_enqueue_and_localize_public_scripts()
12871287

12881288
// Bot detector
12891289
if ( $apbct->settings['data__bot_detector_enabled'] && ! apbct_bot_detector_scripts_exclusion()) {
1290-
ApbctEnqueue::getInstance()->custom(
1291-
'ct-bot-detector-wrapper',
1290+
wp_enqueue_script(
1291+
'ct_bot_detector',
12921292
'https://moderate.cleantalk.org/ct-bot-detector-wrapper.js',
1293-
array(),
1294-
null,
1295-
array(),
1296-
null
1293+
[],
1294+
APBCT_VERSION,
1295+
array(
1296+
'in_footer' => $in_footer,
1297+
'strategy' => 'defer'
1298+
)
12971299
);
12981300
}
12991301

0 commit comments

Comments
 (0)