Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMP integration #247

Merged
merged 1 commit into from
Sep 21, 2023
Merged
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
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;
}
Loading