Permalink
Browse files

bail on AMP

  • Loading branch information...
1 parent 6806a7c commit 121e5a66820c548d9a92689afa30ec95f844a630 @futtta committed on GitHub Oct 24, 2016
Showing with 14 additions and 3 deletions.
  1. +14 −3 wp-donottrack.php
View
@@ -4,7 +4,7 @@
Plugin URI: http://blog.futtta.be/wp-donottrack/
Description: Stop plugins and themes from inserting 3rd party tracking code and cookies.
Author: Frank Goossens (futtta)
-Version: 0.8.6
+Version: 0.8.7
Author URI: http://blog.futtta.be/
Text Domain: wp-donottrack
Domain Path: /languages
@@ -13,7 +13,7 @@
$debug=false;
if (!$debug) {
- $dnt_version="0.8.6";
+ $dnt_version="0.8.7";
$dnt_file="donottrack-min.js";
} else {
$dnt_version=rand()/1000;
@@ -223,8 +223,19 @@ function wp_donottrack_csp() {
add_action('init', 'wp_donottrack_csp', 10, 0);
*/
+/** is_amp, but I shouldn't have to do this, should I? */
+if ( !function_exists("is_amp") ) {
+ function is_amp() {
+ if ((strpos($_SERVER['REQUEST_URI'],'?amp')!==false) || (strpos($_SERVER['REQUEST_URI'],'/amp/')!==false)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+}
+
if ($agressive!=="0") {
- if (!is_admin()) {
+ if ( !is_admin() && !is_amp() ) {
add_action('wp', 'wp_donottrack_ob_setup', 10, 0);
} else {
add_action('wp_print_scripts', 'wp_donottrack_config');

0 comments on commit 121e5a6

Please sign in to comment.