diff --git a/security-malware-firewall.php b/security-malware-firewall.php index 905e23f96..b515bd96f 100644 --- a/security-malware-firewall.php +++ b/security-malware-firewall.php @@ -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( @@ -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; +}