Skip to content

Commit

Permalink
AMP integration
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemAnoshin committed Sep 13, 2023
1 parent b678627 commit 9fae2d3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions security-malware-firewall.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ function spbc_enqueue_scripts__public()
{
global $spbc;

if (spbc_is_amp_request()) {
return;
}

if ( ! $spbc->public_scripts_attached && $spbc->settings['data__set_cookies'] ) {
wp_enqueue_script('spbc_cookie', SPBC_PATH . '/js/spbc-cookie.min.js', array( 'jquery' ), SPBC_VERSION, false /*in header*/);
wp_localize_script(
Expand Down Expand Up @@ -2901,3 +2905,17 @@ function spbc_security_log_clear()

return true;
}

/**
* Check whether the request is AMP
*
* @return bool
*/
function spbc_is_amp_request()
{
if (function_exists('amp_is_request')) {
return amp_is_request();
}

return false;
}

0 comments on commit 9fae2d3

Please sign in to comment.