Ad Inserter – WordPress Ads Management with AdSense Header Integration - Version 2.6.11

Version Description

  • Added support for IAB Transparency & Consent Framework 2.0
  • Added support for taxonomy for primary category
  • Added support for taxonomy for post meta data
  • Added support to invert contain/do not contain text condition for paragraph counting
  • Few minor bug fixes, cosmetic changes and code improvements
Download this release

Release Info

Developer spacetime
Plugin Icon 128x128 Ad Inserter – WordPress Ads Management with AdSense Header Integration
Version 2.6.11
Comparing to
See all releases

Code changes from version 2.6.10 to 2.6.11

ad-inserter.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  /*
4
  Plugin Name: Ad Inserter
5
- Version: 2.6.10
6
  Description: Ad management with many advanced advertising features to insert ads at optimal positions
7
  Author: Igor Funa
8
  Author URI: http://igorfuna.com/
@@ -15,6 +15,13 @@ Domain Path: /languages
15
 
16
  Change Log
17
 
 
 
 
 
 
 
 
18
  Ad Inserter 2.6.10 - 2020-06-25
19
  - Added user taxonomy items for logged-in and not logged-in users
20
  - Added option to define tab setup delay (for the plugin settings page)
@@ -818,6 +825,7 @@ function remove_debug_parameters_from_url ($url = false) {
818
  AI_URL_DEBUG_AD_BLOCKING,
819
  AI_URL_DEBUG_AD_BLOCKING_STATUS,
820
  AI_URL_DEBUG_COUNTRY,
 
821
 
822
  AI_URL_DEBUG_DISABLE_CSS_CODE,
823
  AI_URL_DEBUG_DISABLE_JS_CODE,
@@ -3753,8 +3761,10 @@ function ai_amp_footer_hook () {
3753
  }
3754
 
3755
  if (!isset ($ai_wp_data [AI_AMP_CSS])) {
3756
- ai_amp_css_hook_style ();
3757
- $ai_wp_data [AI_AMP_CSS] = 'AMP FOOTER STYLE';
 
 
3758
  }
3759
 
3760
  if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_POSITIONS) != 0) {
@@ -3903,7 +3913,7 @@ function ai_write_debug_info ($write_processing_log = false) {
3903
  }
3904
  }
3905
  echo 'PARENT CATEGORIES: ', implode (', ', $categories), "\n";
3906
-
3907
  $tag_data = wp_get_post_tags (get_the_ID());
3908
  $tags = array ();
3909
  foreach ($tag_data as $tag) {
@@ -3935,14 +3945,16 @@ function ai_write_debug_info ($write_processing_log = false) {
3935
  }
3936
  echo 'PARENT TAXONOMIES: ', implode (', ', $taxonomies), "\n";
3937
 
3938
- $post_meta = get_post_meta (get_the_ID());
3939
- $meta_string = array ();
3940
- foreach ($post_meta as $key => $post_meta_field) {
3941
- foreach ($post_meta_field as $post_meta_field_item) {
3942
- $meta_string []= $key . ':' . $post_meta_field_item;
 
 
3943
  }
 
3944
  }
3945
- // echo 'POST META: ', str_replace (array ("<!--", "-->", "\n", "\r"), array ("[!--", "--]", "*n", "*r"), implode (', ', $meta_string)), "\n";
3946
  break;
3947
  case AI_PT_CATEGORY:
3948
  $category_data = get_the_category();
@@ -4008,7 +4020,7 @@ function ai_write_debug_info ($write_processing_log = false) {
4008
  $action = get_hook_action ($hook);
4009
  if (get_hook_enabled ($hook) /*&& $name != '' && $action != ''*/) {
4010
  $priority = get_hook_priority ($hook);
4011
- echo 'CUSTOM HOOK ', $hook, ': ', sprintf ("%-30s %-35s %d %s", $name, $action, $priority, !in_array ($action, $enabled_custom_hooks) ? 'INVALID' : ''), "\n";
4012
  }
4013
  }
4014
  echo 'BLOCK CLASS NAME: ', get_block_class_name (), "\n";
@@ -7310,6 +7322,9 @@ function ai_content_hook ($content = '') {
7310
  $meta_value = ai_get_post_meta ();
7311
 
7312
  $selected_blocks = explode (",", $meta_value);
 
 
 
7313
  } else $selected_blocks = array ();
7314
 
7315
  $ai_last_check = AI_CHECK_NONE;
@@ -9437,11 +9452,42 @@ function ai_ampforwp_check_disabled () {
9437
  }
9438
 
9439
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9440
  function ai_yoast_primary_category () {
 
9441
  $category = get_the_category ();
9442
  // If post has a category assigned.
9443
  if ($category) {
9444
- $primary_category = '';
9445
  if (class_exists ('WPSEO_Primary_Term')) {
9446
  // Show the post's 'Primary' category, if this Yoast feature is available, & one is set
9447
  $wpseo_primary_term = new WPSEO_Primary_Term ('category', get_the_id ());
@@ -9463,6 +9509,18 @@ function ai_yoast_primary_category () {
9463
  return $primary_category;
9464
  }
9465
 
 
 
 
 
 
 
 
 
 
 
 
 
9466
  function ai_is_page_builder () {
9467
  // echo $_SERVER ['HTTP_HOST'], ' ', $_SERVER ['REQUEST_URI'], "<br />\n";
9468
  // global $ai_wp_data;
@@ -9545,7 +9603,8 @@ function ai_strip_js_markers ($code) {
9545
 
9546
  function ai_strip_w3tc_markers ($code) {
9547
  if (defined ('W3TC_DYNAMIC_SECURITY')) {
9548
- $code = preg_replace ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->(.+?)<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#s', '', $code);
 
9549
  }
9550
 
9551
  return ($code);
@@ -9646,8 +9705,11 @@ function ai_w3tc_execute_php ($code, &$ai_index, &$ai_fallback) {
9646
 
9647
  if (strpos ($code, '<!-- mfunc') === false) return $code;
9648
 
9649
- preg_match_all ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->(.*?)<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', $code, $php_codes);
9650
- $html_codes = explode ('[?#?]', preg_replace ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->(.*?)<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', '[?#?]', $code));
 
 
 
9651
 
9652
  ob_start ();
9653
 
@@ -10374,6 +10436,7 @@ if (!get_option (AI_INSTALL_NAME)) {
10374
  update_option (AI_INSTALL_NAME, time ());
10375
  }
10376
 
 
10377
  if (defined ('AI_PLUGIN_TRACKING') && AI_PLUGIN_TRACKING) {
10378
 
10379
  add_action ('plugins_loaded', 'ai_install_dst');
2
 
3
  /*
4
  Plugin Name: Ad Inserter
5
+ Version: 2.6.11
6
  Description: Ad management with many advanced advertising features to insert ads at optimal positions
7
  Author: Igor Funa
8
  Author URI: http://igorfuna.com/
15
 
16
  Change Log
17
 
18
+ Ad Inserter 2.6.11 - 2020-07-23
19
+ - Added support for IAB Transparency & Consent Framework 2.0
20
+ - Added support for taxonomy for primary category
21
+ - Added support for taxonomy for post meta data
22
+ - Added support to invert contain/do not contain text condition for paragraph counting
23
+ - Few minor bug fixes, cosmetic changes and code improvements
24
+
25
  Ad Inserter 2.6.10 - 2020-06-25
26
  - Added user taxonomy items for logged-in and not logged-in users
27
  - Added option to define tab setup delay (for the plugin settings page)
825
  AI_URL_DEBUG_AD_BLOCKING,
826
  AI_URL_DEBUG_AD_BLOCKING_STATUS,
827
  AI_URL_DEBUG_COUNTRY,
828
+ AI_URL_DEBUG_IP_ADDRESS,
829
 
830
  AI_URL_DEBUG_DISABLE_CSS_CODE,
831
  AI_URL_DEBUG_DISABLE_JS_CODE,
3761
  }
3762
 
3763
  if (!isset ($ai_wp_data [AI_AMP_CSS])) {
3764
+ if (ai_amp_plugin_custom_css ()) {
3765
+ ai_amp_css_hook_style ();
3766
+ $ai_wp_data [AI_AMP_CSS] = 'AMP FOOTER STYLE';
3767
+ }
3768
  }
3769
 
3770
  if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_POSITIONS) != 0) {
3913
  }
3914
  }
3915
  echo 'PARENT CATEGORIES: ', implode (', ', $categories), "\n";
3916
+ echo 'PRIMARY CATEGORY: ', ai_primary_category (), "\n";
3917
  $tag_data = wp_get_post_tags (get_the_ID());
3918
  $tags = array ();
3919
  foreach ($tag_data as $tag) {
3945
  }
3946
  echo 'PARENT TAXONOMIES: ', implode (', ', $taxonomies), "\n";
3947
 
3948
+ if (isset ($_GET [AI_URL_DEBUG_META])) {
3949
+ $post_meta = get_post_meta (get_the_ID());
3950
+ $meta_string = array ();
3951
+ foreach ($post_meta as $key => $post_meta_field) {
3952
+ foreach ($post_meta_field as $post_meta_field_item) {
3953
+ $meta_string []= $key . ':' . $post_meta_field_item;
3954
+ }
3955
  }
3956
+ echo 'POST META: ', str_replace (array ("<!--", "-->", "\n", "\r"), array ("[!--", "--]", "*n", "*r"), implode (', ', $meta_string)), "\n";
3957
  }
 
3958
  break;
3959
  case AI_PT_CATEGORY:
3960
  $category_data = get_the_category();
4020
  $action = get_hook_action ($hook);
4021
  if (get_hook_enabled ($hook) /*&& $name != '' && $action != ''*/) {
4022
  $priority = get_hook_priority ($hook);
4023
+ echo 'CUSTOM HOOK ', sprintf ("%2d", $hook), ': ', sprintf ("%-30s %-35s %d %s", $name, $action, $priority, !in_array ($action, $enabled_custom_hooks) ? 'INVALID' : ''), "\n";
4024
  }
4025
  }
4026
  echo 'BLOCK CLASS NAME: ', get_block_class_name (), "\n";
7322
  $meta_value = ai_get_post_meta ();
7323
 
7324
  $selected_blocks = explode (",", $meta_value);
7325
+
7326
+ ai_log ("INDIVIDUAL EXCEPTIONS [" . $meta_value . ']');
7327
+
7328
  } else $selected_blocks = array ();
7329
 
7330
  $ai_last_check = AI_CHECK_NONE;
9452
  }
9453
 
9454
 
9455
+ function ai_amp_plugin_custom_css () {
9456
+ if (is_multisite()) {
9457
+ $option_active_plugins = array_merge (array_flip (get_site_option ('active_sitewide_plugins', array ())), get_option ('active_plugins', array ()));
9458
+ } else $option_active_plugins = get_option ('active_plugins');
9459
+
9460
+ // echo "<pre>";
9461
+ // print_r ($option_active_plugins);
9462
+ // echo "</pre>";
9463
+
9464
+ foreach ($option_active_plugins as $option_active_plugin) {
9465
+ if ($option_active_plugin == 'amp-wp/amp-wp.php') {
9466
+ return true;
9467
+ }
9468
+ if ($option_active_plugin == 'better-amp/better-amp.php') {
9469
+ return true;
9470
+ }
9471
+ }
9472
+
9473
+ return false;
9474
+ }
9475
+
9476
+ function ai_primary_category () {
9477
+ $primary_category = ai_rank_math_primary_category ();
9478
+ if ($primary_category != '') {
9479
+ return $primary_category;
9480
+ }
9481
+ // Returns the first category if primary category is not defined
9482
+ $primary_category = ai_yoast_primary_category ();
9483
+ return $primary_category;
9484
+ }
9485
+
9486
  function ai_yoast_primary_category () {
9487
+ $primary_category = '';
9488
  $category = get_the_category ();
9489
  // If post has a category assigned.
9490
  if ($category) {
 
9491
  if (class_exists ('WPSEO_Primary_Term')) {
9492
  // Show the post's 'Primary' category, if this Yoast feature is available, & one is set
9493
  $wpseo_primary_term = new WPSEO_Primary_Term ('category', get_the_id ());
9509
  return $primary_category;
9510
  }
9511
 
9512
+ function ai_rank_math_primary_category () {
9513
+ $primary_category = '';
9514
+ if (class_exists ('RankMath')) {
9515
+ $primary_cat_id = get_post_meta (get_the_id (), 'rank_math_primary_category', true);
9516
+ if ($primary_cat_id) {
9517
+ $category = get_term ($primary_cat_id, 'category');
9518
+ $primary_category = $category->slug;
9519
+ }
9520
+ }
9521
+ return $primary_category;
9522
+ }
9523
+
9524
  function ai_is_page_builder () {
9525
  // echo $_SERVER ['HTTP_HOST'], ' ', $_SERVER ['REQUEST_URI'], "<br />\n";
9526
  // global $ai_wp_data;
9603
 
9604
  function ai_strip_w3tc_markers ($code) {
9605
  if (defined ('W3TC_DYNAMIC_SECURITY')) {
9606
+ // $code = preg_replace ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->(.+?)<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#s', '', $code);
9607
+ $code = preg_replace ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' (.+?) --><!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#s', '', $code);
9608
  }
9609
 
9610
  return ($code);
9705
 
9706
  if (strpos ($code, '<!-- mfunc') === false) return $code;
9707
 
9708
+ // preg_match_all ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->(.*?)<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', $code, $php_codes);
9709
+ // $html_codes = explode ('[?#?]', preg_replace ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->(.*?)<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', '[?#?]', $code));
9710
+
9711
+ preg_match_all ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' (.*?) --><!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', $code, $php_codes);
9712
+ $html_codes = explode ('[?#?]', preg_replace ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' (.*?) --><!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', '[?#?]', $code));
9713
 
9714
  ob_start ();
9715
 
10436
  update_option (AI_INSTALL_NAME, time ());
10437
  }
10438
 
10439
+
10440
  if (defined ('AI_PLUGIN_TRACKING') && AI_PLUGIN_TRACKING) {
10441
 
10442
  add_action ('plugins_loaded', 'ai_install_dst');
class.php CHANGED
@@ -1431,9 +1431,6 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1431
 
1432
  // Limitation of AOS
1433
  if ($delay > 3000) $delay = 3000;
1434
-
1435
- echo $delay;
1436
-
1437
  $sticky_parameters .= ' data-aos-delay="'.$delay.'"';
1438
  }
1439
 
@@ -2456,9 +2453,11 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
2456
  }
2457
 
2458
  return (
2459
- '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->' . $code .
2460
- ' if (!isset ($ai_enabled) || $ai_enabled) echo $ai_code; else {echo ai_extract_debug_bar ($ai_code);}' .
2461
- '<!-- /mfunc '. W3TC_DYNAMIC_SECURITY.' -->'
 
 
2462
  );
2463
  }
2464
 
@@ -2482,8 +2481,11 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
2482
  $this->w3tc_debug []= ' REGENERATE W3TC';
2483
  }
2484
 
2485
- preg_match_all ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->(.*?)<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', $code, $php_codes);
2486
- $html_codes = explode ('[?#?]', preg_replace ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->(.*?)<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', '[?#?]', $code));
 
 
 
2487
 
2488
  $w3tc_code = 'ob_start (); $ai_enabled = true;';
2489
 
@@ -2513,9 +2515,13 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
2513
  $this->w3tc_debug []= ' BASE64 ENCODE W3TC';
2514
  }
2515
 
2516
- $base64_code = '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
 
 
 
 
2517
  $base64_code .= $this->w3tc_code . ' if (!isset ($ai_enabled) || $ai_enabled) echo base64_encode ($ai_code);';
2518
- $base64_code .= '<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
2519
 
2520
  return ($base64_code);
2521
  }
@@ -2525,10 +2531,14 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
2525
  $this->w3tc_debug []= ' BASE64 ENCODE FROM HTML';
2526
  }
2527
 
2528
- preg_match_all ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->(.*?)<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', $code, $php_codes);
2529
- $html_codes = explode ('[?#?]', preg_replace ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->(.*?)<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', '[?#?]', $code));
 
 
 
2530
 
2531
- $base64_code = '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
 
2532
  $base64_code .= 'ob_start ();';
2533
 
2534
  foreach ($html_codes as $index => $html_code) {
@@ -2541,7 +2551,8 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
2541
  }
2542
 
2543
  $base64_code .= 'echo base64_encode (ob_get_clean());';
2544
- $base64_code .= '<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
 
2545
 
2546
  return ($base64_code);
2547
  }
@@ -3367,6 +3378,9 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
3367
  if ($groups) {
3368
  $ad_index_code = ' global $ai_groups; $ai_index = 0; if (isset ($ai_groups) && count ($ai_groups) != 0) {foreach ($ai_groups as $group_name) {foreach (unserialize (base64_decode (\''.
3369
  base64_encode (serialize ($version_groups)).'\')) as $index => $version_group) {if ($version_group == trim ($group_name)) {$ai_index = $index + 1; break 2;}}}}';
 
 
 
3370
  }
3371
  elseif ($shares) {
3372
  $ad_index_code = ' $ai_random_threshold = mt_rand (0, 100); $ai_thresholds = unserialize (\''.
@@ -4516,9 +4530,13 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
4516
 
4517
  $this->w3tc_code .= ' $ai_code = str_replace ("[#AI_CODE#]", base64_encode ($ai_code), base64_decode ("'. base64_encode (ai_strip_js_markers ($serverside_insertion_code)) . '"));';
4518
 
4519
- $serverside_insertion_code = '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
 
 
 
 
4520
  $serverside_insertion_code .= $this->w3tc_code.' if ($ai_enabled) echo $ai_code;';
4521
- $serverside_insertion_code .= '<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
4522
 
4523
  } else {
4524
  // if ($this->w3tc_fallback_code != '' && $dynamic_blocks_w3tc) {
@@ -5549,6 +5567,7 @@ echo '</body>
5549
  $ai_last_check = AI_CHECK_PARAGRAPHS_AFTER_MIN_MAX_WORDS;
5550
  if (array_sum ($active_paragraph_positions) == 0) return $content;
5551
 
 
5552
  $paragraph_texts = explode (",", html_entity_decode ($this->get_paragraph_text()));
5553
  if ($this->get_paragraph_text() != "" && count ($paragraph_texts) != 0) {
5554
 
@@ -5574,36 +5593,78 @@ echo '</body>
5574
  foreach ($paragraph_texts as $paragraph_text) {
5575
  if (trim ($paragraph_text) == '') continue;
5576
 
 
 
 
 
 
 
 
 
5577
  if ($multibyte) {
5578
- if (mb_stripos ($paragraph_code, trim ($paragraph_text)) === false) {
 
 
 
 
 
 
5579
  $found = false;
5580
  break;
5581
  }
5582
  } else {
5583
- if (stripos ($paragraph_code, trim ($paragraph_text)) === false) {
 
 
 
 
 
 
5584
  $found = false;
5585
  break;
5586
  }
5587
  }
5588
  }
 
5589
  if (!$found) $active_paragraph_positions [$index] = 0;
5590
  } elseif ($paragraph_text_type == AI_DO_NOT_CONTAIN) {
5591
  $found = false;
5592
  foreach ($paragraph_texts as $paragraph_text) {
5593
  if (trim ($paragraph_text) == '') continue;
5594
 
 
 
 
 
 
 
 
 
5595
  if ($multibyte) {
5596
- if (mb_stripos ($paragraph_code, trim ($paragraph_text)) !== false) {
 
 
 
 
 
 
5597
  $found = true;
5598
  break;
5599
  }
5600
  } else {
5601
- if (stripos ($paragraph_code, trim ($paragraph_text)) !== false) {
 
 
 
 
 
 
5602
  $found = true;
5603
  break;
5604
  }
5605
  }
5606
  }
 
5607
  if ($found) $active_paragraph_positions [$index] = 0;
5608
  }
5609
  }
@@ -6391,7 +6452,6 @@ echo '</body>
6391
  }
6392
  }
6393
 
6394
-
6395
  // Nothing to do
6396
  $ai_last_check = AI_CHECK_PARAGRAPHS_AFTER_MIN_MAX_WORDS;
6397
  if (array_sum ($active_paragraph_positions) == 0) return $content;
@@ -6422,33 +6482,72 @@ echo '</body>
6422
  foreach ($paragraph_texts as $paragraph_text) {
6423
  if (trim ($paragraph_text) == '') continue;
6424
 
 
 
 
 
 
 
 
 
6425
  if ($multibyte) {
6426
- if (mb_stripos ($paragraph_code, trim ($paragraph_text)) === false) {
 
 
 
 
 
 
6427
  $found = false;
6428
  break;
6429
  }
6430
  } else {
6431
- if (stripos ($paragraph_code, trim ($paragraph_text)) === false) {
 
 
 
 
 
 
6432
  $found = false;
6433
  break;
6434
  }
6435
  }
6436
-
6437
  }
6438
- // if (!$found) $filtered_paragraph_positions [] = $active_paragraph_positions [$index] = 0;
6439
  if (!$found) $active_paragraph_positions [$index] = 0;
6440
  } elseif ($paragraph_text_type == AI_DO_NOT_CONTAIN) {
6441
  $found = false;
6442
  foreach ($paragraph_texts as $paragraph_text) {
6443
  if (trim ($paragraph_text) == '') continue;
6444
 
 
 
 
 
 
 
 
 
6445
  if ($multibyte) {
6446
- if (mb_stripos ($paragraph_code, trim ($paragraph_text)) !== false) {
 
 
 
 
 
 
6447
  $found = true;
6448
  break;
6449
  }
6450
  } else {
6451
- if (stripos ($paragraph_code, trim ($paragraph_text)) !== false) {
 
 
 
 
 
 
6452
  $found = true;
6453
  break;
6454
  }
@@ -7167,7 +7266,7 @@ echo '</body>
7167
  global $ai_wp_data;
7168
 
7169
  if ($taxonomies === null) {
7170
- $taxonomies = trim (strtolower ($this->get_ad_block_taxonomy()));
7171
  $taxonomy_type = $this->get_ad_block_taxonomy_type();
7172
  }
7173
 
@@ -7175,11 +7274,10 @@ echo '</body>
7175
 
7176
  if ($taxonomy_type == AI_BLACK_LIST) {
7177
 
7178
- // if ($taxonomies == AD_EMPTY_DATA) return true;
7179
-
7180
  $taxonomies_listed = explode (",", $taxonomies);
7181
  foreach ($taxonomies_listed as $taxonomy_disabled) {
7182
- $taxonomy_disabled = trim ($taxonomy_disabled);
 
7183
 
7184
  if (strpos ($taxonomy_disabled, 'user:') === 0) {
7185
  $current_user = wp_get_current_user();
@@ -7213,6 +7311,10 @@ echo '</body>
7213
  $terms = explode (':', $taxonomy_disabled);
7214
  if ($terms [1] == $post_type) return false;
7215
  }
 
 
 
 
7216
  elseif (strpos ($taxonomy_disabled, 'yoast-primary-category:') === 0) {
7217
  $primary_category = explode (':', $taxonomy_disabled);
7218
  if ($primary_category [1] == ai_yoast_primary_category ()) return false;
@@ -7224,6 +7326,14 @@ echo '</body>
7224
  if (get_current_blog_id () == $site_id [1]) return false;
7225
  } else return true;
7226
  }
 
 
 
 
 
 
 
 
7227
 
7228
  $taxonomy_names = get_post_taxonomies ();
7229
  foreach ($taxonomy_names as $taxonomy_name) {
@@ -7274,12 +7384,10 @@ echo '</body>
7274
  return true;
7275
 
7276
  } else {
7277
-
7278
- // if ($taxonomies == AD_EMPTY_DATA) return false;
7279
-
7280
  $taxonomies_listed = explode (",", $taxonomies);
7281
  foreach ($taxonomies_listed as $taxonomy_enabled) {
7282
- $taxonomy_enabled = trim ($taxonomy_enabled);
 
7283
 
7284
  if (strpos ($taxonomy_enabled, 'user:') === 0) {
7285
  $current_user = wp_get_current_user();
@@ -7313,6 +7421,10 @@ echo '</body>
7313
  $terms = explode (':', $taxonomy_enabled);
7314
  if ($terms [1] == $post_type) return true;
7315
  }
 
 
 
 
7316
  elseif (strpos ($taxonomy_enabled, 'yoast-primary-category:') === 0) {
7317
  $primary_category = explode (':', $taxonomy_enabled);
7318
  if ($primary_category [1] == ai_yoast_primary_category ()) return true;
@@ -7324,6 +7436,14 @@ echo '</body>
7324
  if (get_current_blog_id () == $site_id [1]) return true;
7325
  } else return false;
7326
  }
 
 
 
 
 
 
 
 
7327
 
7328
  $taxonomy_names = get_post_taxonomies ();
7329
  foreach ($taxonomy_names as $taxonomy_name) {
1431
 
1432
  // Limitation of AOS
1433
  if ($delay > 3000) $delay = 3000;
 
 
 
1434
  $sticky_parameters .= ' data-aos-delay="'.$delay.'"';
1435
  }
1436
 
2453
  }
2454
 
2455
  return (
2456
+ // '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->' . $code .
2457
+ // ' if (!isset ($ai_enabled) || $ai_enabled) echo $ai_code; else {echo ai_extract_debug_bar ($ai_code);}' .
2458
+ // '<!-- /mfunc '. W3TC_DYNAMIC_SECURITY.' -->'
2459
+
2460
+ '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' ' . $code . ' if (!isset ($ai_enabled) || $ai_enabled) echo $ai_code; else {echo ai_extract_debug_bar ($ai_code);}' . ' --><!-- /mfunc '. W3TC_DYNAMIC_SECURITY.' -->'
2461
  );
2462
  }
2463
 
2481
  $this->w3tc_debug []= ' REGENERATE W3TC';
2482
  }
2483
 
2484
+ // preg_match_all ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->(.*?)<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', $code, $php_codes);
2485
+ // $html_codes = explode ('[?#?]', preg_replace ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->(.*?)<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', '[?#?]', $code));
2486
+
2487
+ preg_match_all ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' (.*?) --><!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', $code, $php_codes);
2488
+ $html_codes = explode ('[?#?]', preg_replace ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' (.*?) --><!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', '[?#?]', $code));
2489
 
2490
  $w3tc_code = 'ob_start (); $ai_enabled = true;';
2491
 
2515
  $this->w3tc_debug []= ' BASE64 ENCODE W3TC';
2516
  }
2517
 
2518
+ // $base64_code = '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
2519
+ // $base64_code .= $this->w3tc_code . ' if (!isset ($ai_enabled) || $ai_enabled) echo base64_encode ($ai_code);';
2520
+ // $base64_code .= '<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
2521
+
2522
+ $base64_code = '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' ';
2523
  $base64_code .= $this->w3tc_code . ' if (!isset ($ai_enabled) || $ai_enabled) echo base64_encode ($ai_code);';
2524
+ $base64_code .= ' --><!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
2525
 
2526
  return ($base64_code);
2527
  }
2531
  $this->w3tc_debug []= ' BASE64 ENCODE FROM HTML';
2532
  }
2533
 
2534
+ // preg_match_all ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->(.*?)<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', $code, $php_codes);
2535
+ // $html_codes = explode ('[?#?]', preg_replace ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->(.*?)<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', '[?#?]', $code));
2536
+
2537
+ preg_match_all ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' (.*?) --><!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', $code, $php_codes);
2538
+ $html_codes = explode ('[?#?]', preg_replace ('#<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' (.*?) --><!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->#', '[?#?]', $code));
2539
 
2540
+ // $base64_code = '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
2541
+ $base64_code = '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' ';
2542
  $base64_code .= 'ob_start ();';
2543
 
2544
  foreach ($html_codes as $index => $html_code) {
2551
  }
2552
 
2553
  $base64_code .= 'echo base64_encode (ob_get_clean());';
2554
+ // $base64_code .= '<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
2555
+ $base64_code .= ' --><!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
2556
 
2557
  return ($base64_code);
2558
  }
3378
  if ($groups) {
3379
  $ad_index_code = ' global $ai_groups; $ai_index = 0; if (isset ($ai_groups) && count ($ai_groups) != 0) {foreach ($ai_groups as $group_name) {foreach (unserialize (base64_decode (\''.
3380
  base64_encode (serialize ($version_groups)).'\')) as $index => $version_group) {if ($version_group == trim ($group_name)) {$ai_index = $index + 1; break 2;}}}}';
3381
+ // Fix to prevent converting && into &amp;&amp; and > into &gt; on AMP pages
3382
+ // $ad_index_code = ' global $ai_groups; $ai_index = 0; if (isset ($ai_groups)) if (count ($ai_groups) != 0) {foreach ($ai_groups as $group_name) {foreach (unserialize (base64_decode (\''.
3383
+ // base64_encode (serialize ($version_groups)).'\')) as $index => $version_group) {if ($version_group == trim ($group_name)) {$ai_index = $index + 1; break 2;}}}}';
3384
  }
3385
  elseif ($shares) {
3386
  $ad_index_code = ' $ai_random_threshold = mt_rand (0, 100); $ai_thresholds = unserialize (\''.
4530
 
4531
  $this->w3tc_code .= ' $ai_code = str_replace ("[#AI_CODE#]", base64_encode ($ai_code), base64_decode ("'. base64_encode (ai_strip_js_markers ($serverside_insertion_code)) . '"));';
4532
 
4533
+ // $serverside_insertion_code = '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
4534
+ // $serverside_insertion_code .= $this->w3tc_code.' if ($ai_enabled) echo $ai_code;';
4535
+ // $serverside_insertion_code .= '<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
4536
+
4537
+ $serverside_insertion_code = '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' ';
4538
  $serverside_insertion_code .= $this->w3tc_code.' if ($ai_enabled) echo $ai_code;';
4539
+ $serverside_insertion_code .= ' --><!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
4540
 
4541
  } else {
4542
  // if ($this->w3tc_fallback_code != '' && $dynamic_blocks_w3tc) {
5567
  $ai_last_check = AI_CHECK_PARAGRAPHS_AFTER_MIN_MAX_WORDS;
5568
  if (array_sum ($active_paragraph_positions) == 0) return $content;
5569
 
5570
+
5571
  $paragraph_texts = explode (",", html_entity_decode ($this->get_paragraph_text()));
5572
  if ($this->get_paragraph_text() != "" && count ($paragraph_texts) != 0) {
5573
 
5593
  foreach ($paragraph_texts as $paragraph_text) {
5594
  if (trim ($paragraph_text) == '') continue;
5595
 
5596
+ $paragraph_text = trim ($paragraph_text);
5597
+
5598
+ $invert = false;
5599
+ if ($paragraph_text [0] == '^') {
5600
+ $paragraph_text = substr ($paragraph_text, 1);
5601
+ $invert = true;
5602
+ }
5603
+
5604
  if ($multibyte) {
5605
+ $paragraph_text_found = mb_stripos ($paragraph_code, $paragraph_text) !== false;
5606
+
5607
+ if ($invert) {
5608
+ $paragraph_text_found = !$paragraph_text_found;
5609
+ }
5610
+
5611
+ if (!$paragraph_text_found) {
5612
  $found = false;
5613
  break;
5614
  }
5615
  } else {
5616
+ $paragraph_text_found = stripos ($paragraph_code, $paragraph_text) !== false;
5617
+
5618
+ if ($invert) {
5619
+ $paragraph_text_found = !$paragraph_text_found;
5620
+ }
5621
+
5622
+ if (!$paragraph_text_found) {
5623
  $found = false;
5624
  break;
5625
  }
5626
  }
5627
  }
5628
+
5629
  if (!$found) $active_paragraph_positions [$index] = 0;
5630
  } elseif ($paragraph_text_type == AI_DO_NOT_CONTAIN) {
5631
  $found = false;
5632
  foreach ($paragraph_texts as $paragraph_text) {
5633
  if (trim ($paragraph_text) == '') continue;
5634
 
5635
+ $paragraph_text = trim ($paragraph_text);
5636
+
5637
+ $invert = false;
5638
+ if ($paragraph_text [0] == '^') {
5639
+ $paragraph_text = substr ($paragraph_text, 1);
5640
+ $invert = true;
5641
+ }
5642
+
5643
  if ($multibyte) {
5644
+ $paragraph_text_found = mb_stripos ($paragraph_code, $paragraph_text) !== false;
5645
+
5646
+ if ($invert) {
5647
+ $paragraph_text_found = !$paragraph_text_found;
5648
+ }
5649
+
5650
+ if ($paragraph_text_found) {
5651
  $found = true;
5652
  break;
5653
  }
5654
  } else {
5655
+ $paragraph_text_found = stripos ($paragraph_code, $paragraph_text) !== false;
5656
+
5657
+ if ($invert) {
5658
+ $paragraph_text_found = !$paragraph_text_found;
5659
+ }
5660
+
5661
+ if ($paragraph_text_found) {
5662
  $found = true;
5663
  break;
5664
  }
5665
  }
5666
  }
5667
+
5668
  if ($found) $active_paragraph_positions [$index] = 0;
5669
  }
5670
  }
6452
  }
6453
  }
6454
 
 
6455
  // Nothing to do
6456
  $ai_last_check = AI_CHECK_PARAGRAPHS_AFTER_MIN_MAX_WORDS;
6457
  if (array_sum ($active_paragraph_positions) == 0) return $content;
6482
  foreach ($paragraph_texts as $paragraph_text) {
6483
  if (trim ($paragraph_text) == '') continue;
6484
 
6485
+ $paragraph_text = trim ($paragraph_text);
6486
+
6487
+ $invert = false;
6488
+ if ($paragraph_text [0] == '^') {
6489
+ $paragraph_text = substr ($paragraph_text, 1);
6490
+ $invert = true;
6491
+ }
6492
+
6493
  if ($multibyte) {
6494
+ $paragraph_text_found = mb_stripos ($paragraph_code, $paragraph_text) !== false;
6495
+
6496
+ if ($invert) {
6497
+ $paragraph_text_found = !$paragraph_text_found;
6498
+ }
6499
+
6500
+ if (!$paragraph_text_found) {
6501
  $found = false;
6502
  break;
6503
  }
6504
  } else {
6505
+ $paragraph_text_found = stripos ($paragraph_code, $paragraph_text) !== false;
6506
+
6507
+ if ($invert) {
6508
+ $paragraph_text_found = !$paragraph_text_found;
6509
+ }
6510
+
6511
+ if (!$paragraph_text_found) {
6512
  $found = false;
6513
  break;
6514
  }
6515
  }
 
6516
  }
6517
+
6518
  if (!$found) $active_paragraph_positions [$index] = 0;
6519
  } elseif ($paragraph_text_type == AI_DO_NOT_CONTAIN) {
6520
  $found = false;
6521
  foreach ($paragraph_texts as $paragraph_text) {
6522
  if (trim ($paragraph_text) == '') continue;
6523
 
6524
+ $paragraph_text = trim ($paragraph_text);
6525
+
6526
+ $invert = false;
6527
+ if ($paragraph_text [0] == '^') {
6528
+ $paragraph_text = substr ($paragraph_text, 1);
6529
+ $invert = true;
6530
+ }
6531
+
6532
  if ($multibyte) {
6533
+ $paragraph_text_found = mb_stripos ($paragraph_code, $paragraph_text) !== false;
6534
+
6535
+ if ($invert) {
6536
+ $paragraph_text_found = !$paragraph_text_found;
6537
+ }
6538
+
6539
+ if ($paragraph_text_found) {
6540
  $found = true;
6541
  break;
6542
  }
6543
  } else {
6544
+ $paragraph_text_found = stripos ($paragraph_code, $paragraph_text) !== false;
6545
+
6546
+ if ($invert) {
6547
+ $paragraph_text_found = !$paragraph_text_found;
6548
+ }
6549
+
6550
+ if ($paragraph_text_found) {
6551
  $found = true;
6552
  break;
6553
  }
7266
  global $ai_wp_data;
7267
 
7268
  if ($taxonomies === null) {
7269
+ $taxonomies = trim ($this->get_ad_block_taxonomy ());
7270
  $taxonomy_type = $this->get_ad_block_taxonomy_type();
7271
  }
7272
 
7274
 
7275
  if ($taxonomy_type == AI_BLACK_LIST) {
7276
 
 
 
7277
  $taxonomies_listed = explode (",", $taxonomies);
7278
  foreach ($taxonomies_listed as $taxonomy_disabled) {
7279
+ $taxonomy_disabled_org = trim ($taxonomy_disabled);
7280
+ $taxonomy_disabled = strtolower ($taxonomy_disabled_org);
7281
 
7282
  if (strpos ($taxonomy_disabled, 'user:') === 0) {
7283
  $current_user = wp_get_current_user();
7311
  $terms = explode (':', $taxonomy_disabled);
7312
  if ($terms [1] == $post_type) return false;
7313
  }
7314
+ elseif (strpos ($taxonomy_disabled, 'primary-category:') === 0) {
7315
+ $primary_category = explode (':', $taxonomy_disabled);
7316
+ if ($primary_category [1] == ai_primary_category ()) return false;
7317
+ }
7318
  elseif (strpos ($taxonomy_disabled, 'yoast-primary-category:') === 0) {
7319
  $primary_category = explode (':', $taxonomy_disabled);
7320
  if ($primary_category [1] == ai_yoast_primary_category ()) return false;
7326
  if (get_current_blog_id () == $site_id [1]) return false;
7327
  } else return true;
7328
  }
7329
+ elseif (strpos ($taxonomy_disabled_org, 'meta:') === 0) {
7330
+ $meta_data = explode (':', str_replace ('meta:', '', $taxonomy_disabled_org));
7331
+ if (count ($meta_data) == 2) {
7332
+ if (get_post_meta (get_the_id (), $meta_data [0], true) == $meta_data [1]) return false;
7333
+ } else {
7334
+ if (get_post_meta (get_the_id (), $meta_data [0], true) != '') return false;
7335
+ }
7336
+ }
7337
 
7338
  $taxonomy_names = get_post_taxonomies ();
7339
  foreach ($taxonomy_names as $taxonomy_name) {
7384
  return true;
7385
 
7386
  } else {
 
 
 
7387
  $taxonomies_listed = explode (",", $taxonomies);
7388
  foreach ($taxonomies_listed as $taxonomy_enabled) {
7389
+ $taxonomy_enabled_org = trim ($taxonomy_enabled);
7390
+ $taxonomy_enabled = strtolower ($taxonomy_enabled_org);
7391
 
7392
  if (strpos ($taxonomy_enabled, 'user:') === 0) {
7393
  $current_user = wp_get_current_user();
7421
  $terms = explode (':', $taxonomy_enabled);
7422
  if ($terms [1] == $post_type) return true;
7423
  }
7424
+ elseif (strpos ($taxonomy_enabled, 'primary-category:') === 0) {
7425
+ $primary_category = explode (':', $taxonomy_enabled);
7426
+ if ($primary_category [1] == ai_primary_category ()) return true;
7427
+ }
7428
  elseif (strpos ($taxonomy_enabled, 'yoast-primary-category:') === 0) {
7429
  $primary_category = explode (':', $taxonomy_enabled);
7430
  if ($primary_category [1] == ai_yoast_primary_category ()) return true;
7436
  if (get_current_blog_id () == $site_id [1]) return true;
7437
  } else return false;
7438
  }
7439
+ elseif (strpos ($taxonomy_enabled_org, 'meta:') === 0) {
7440
+ $meta_data = explode (':', str_replace ('meta:', '', $taxonomy_enabled_org));
7441
+ if (count ($meta_data) == 2) {
7442
+ if (get_post_meta (get_the_id (), $meta_data [0], true) == $meta_data [1]) return true;
7443
+ } else {
7444
+ if (get_post_meta (get_the_id (), $meta_data [0], true) != '') return true;
7445
+ }
7446
+ }
7447
 
7448
  $taxonomy_names = get_post_taxonomies ();
7449
  foreach ($taxonomy_names as $taxonomy_name) {
constants.php CHANGED
@@ -31,7 +31,7 @@ if (!defined( 'AD_INSERTER_NAME'))
31
  define ('AD_INSERTER_NAME', 'Ad Inserter');
32
 
33
  if (!defined( 'AD_INSERTER_VERSION'))
34
- define ('AD_INSERTER_VERSION', '2.6.10');
35
 
36
  if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
37
  define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
@@ -1173,9 +1173,11 @@ define ('AI_URL_DEBUG_TAGS', 'ai-debug-tags');
1173
  define ('AI_URL_DEBUG_POSITIONS', 'ai-debug-positions');
1174
  define ('AI_URL_DEBUG_NO_INSERTION', 'ai-debug-no-insertion');
1175
  define ('AI_URL_DEBUG_COUNTRY', 'ai-debug-country');
 
1176
  define ('AI_URL_DEBUG_AD_BLOCKING' , 'ai-debug-adb');
1177
  define ('AI_URL_DEBUG_AD_BLOCKING_STATUS', 'ai-debug-adb-status');
1178
  define ('AI_URL_DEBUG_JAVASCRIPT', 'ai-debug-js');
 
1179
 
1180
  define ('AI_URL_DEBUG_DISABLE_CSS_CODE', 'ai-debug-disable-css-code');
1181
  define ('AI_URL_DEBUG_DISABLE_JS_CODE', 'ai-debug-disable-js-code');
31
  define ('AD_INSERTER_NAME', 'Ad Inserter');
32
 
33
  if (!defined( 'AD_INSERTER_VERSION'))
34
+ define ('AD_INSERTER_VERSION', '2.6.11');
35
 
36
  if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
37
  define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
1173
  define ('AI_URL_DEBUG_POSITIONS', 'ai-debug-positions');
1174
  define ('AI_URL_DEBUG_NO_INSERTION', 'ai-debug-no-insertion');
1175
  define ('AI_URL_DEBUG_COUNTRY', 'ai-debug-country');
1176
+ define ('AI_URL_DEBUG_IP_ADDRESS', 'ai-debug-ip-address');
1177
  define ('AI_URL_DEBUG_AD_BLOCKING' , 'ai-debug-adb');
1178
  define ('AI_URL_DEBUG_AD_BLOCKING_STATUS', 'ai-debug-adb-status');
1179
  define ('AI_URL_DEBUG_JAVASCRIPT', 'ai-debug-js');
1180
+ define ('AI_URL_DEBUG_META', 'ai-debug-meta');
1181
 
1182
  define ('AI_URL_DEBUG_DISABLE_CSS_CODE', 'ai-debug-disable-css-code');
1183
  define ('AI_URL_DEBUG_DISABLE_JS_CODE', 'ai-debug-disable-js-code');
css/ai-settings.css CHANGED
@@ -1,5 +1,5 @@
1
  #ai-data {
2
- font-family: "2.6.10"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
1
  #ai-data {
2
+ font-family: "2.6.11"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
images/contextual-1.gif DELETED
Binary file
images/contextual-2.jpg DELETED
Binary file
images/contextual-3.png DELETED
Binary file
images/contextual-4.gif DELETED
Binary file
images/contextual-5.png DELETED
Binary file
images/contextual-6.gif DELETED
Binary file
images/contextual-7.gif DELETED
Binary file
images/contextual-8.gif DELETED
Binary file
images/contextual-9.jpg DELETED
Binary file
includes/js/ai-lists.js CHANGED
@@ -94,14 +94,16 @@ jQuery (function ($) {
94
  ai_list_blocks = ai_list_blocks.filter ('.ai-list-data');
95
  }
96
 
 
 
 
 
 
97
  if (!ai_list_blocks.length) return;
98
 
99
  // Mark lists as processed
100
  ai_list_blocks.removeClass ('ai-list-data');
101
 
102
- var ai_debug = typeof ai_debugging !== 'undefined'; // 2
103
- // var ai_debug = false;
104
-
105
  var cookies = document.cookie.split (";");
106
 
107
  cookies.forEach (function (cookie, index) {
@@ -191,68 +193,71 @@ jQuery (function ($) {
191
  if (ai_debug) console.log ("AI LISTS list pass", enable_block);
192
  }
193
 
194
- var client_list = $(this).attr ("client-list");
195
- if (typeof client_list != "undefined" && typeof md !== "undefined") {
196
- var client_list_array = b64d (client_list).split (",");
197
- var clients_list_type = $(this).attr ("client-list-type");
198
-
199
- if (ai_debug) console.log ("AI LISTS client: ", window.navigator.userAgent);
200
- if (ai_debug) console.log ("AI LISTS client list:", b64d (client_list), clients_list_type);
 
 
 
 
 
 
 
 
 
 
 
201
 
202
- found = false;
203
- $.each (client_list_array, function (index, list_client) {
204
- if (list_client == '') return true;
 
 
 
 
205
 
206
- if (list_client.charAt (0) == "*") {
207
- if (list_client.charAt (list_client.length - 1) == "*") {
208
- list_client = list_client.substr (1, list_client.length - 2).toLowerCase ();
209
- if (user_agent_lc.indexOf (list_client) != - 1) {
 
 
 
 
210
  if (ai_debug) console.log ("AI LISTS FOUND:", list_client);
211
 
212
  found = true;
213
  return false;
214
  }
215
- } else {
216
- list_client = list_client.substr (1).toLowerCase ();
217
- if (user_agent_lc.substr (- list_client.length) == list_client) {
218
- if (ai_debug) console.log ("AI LISTS FOUND:", list_client);
219
-
220
- found = true;
221
- return false;
222
- }
223
- }
224
- }
225
- else if (list_client.charAt (list_client.length - 1) == "*") {
226
- list_client = list_client.substr (0, list_client.length - 1).toLowerCase ();
227
- if (user_agent_lc.indexOf (list_client) == 0) {
228
  if (ai_debug) console.log ("AI LISTS FOUND:", list_client);
229
 
230
  found = true;
231
  return false;
232
  }
233
- }
234
- else if (md.is (list_client)) {
235
- if (ai_debug) console.log ("AI LISTS FOUND:", list_client);
236
 
237
- found = true;
238
- return false;
 
 
 
 
 
239
  }
240
- });
241
 
242
- switch (clients_list_type) {
243
- case "B":
244
- if (found) enable_block = false;
245
- break;
246
- case "W":
247
- if (!found) enable_block = false;
248
- break;
249
  }
250
-
251
- if (ai_debug) console.log ("AI LISTS list found", found);
252
- if (ai_debug) console.log ("AI LISTS list pass", enable_block);
253
  }
254
 
255
  var url_parameters_manual_loading = false;
 
256
  if (enable_block) {
257
  var parameter_list = $(this).attr ("parameter-list");
258
  if (typeof parameter_list != "undefined") {
@@ -280,6 +285,7 @@ jQuery (function ($) {
280
  if (ai_debug) console.log ("AI LISTS COOKIE ARRAY", cookie_array);
281
 
282
  var found = false;
 
283
  $.each (parameter_list_array, function (index, list_parameter) {
284
 
285
  if (list_parameter.indexOf ('=') != - 1) {
@@ -290,6 +296,63 @@ jQuery (function ($) {
290
 
291
  var list_parameter_data = list_parameter.split ("=");
292
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  if (ai_structured_data (cookie_array, list_parameter_data [0], list_parameter_data [1])) {
294
  found = true;
295
  return false;
@@ -331,6 +394,13 @@ jQuery (function ($) {
331
  }
332
  }
333
 
 
 
 
 
 
 
 
334
  var debug_bar = $(this).prevAll ('.ai-debug-bar.ai-debug-lists');
335
  var referrer_text = referrer == '' ? '#' : referrer;
336
  debug_bar.find ('.ai-debug-name.ai-list-info').text (referrer_text).attr ('title', user_agent);
94
  ai_list_blocks = ai_list_blocks.filter ('.ai-list-data');
95
  }
96
 
97
+ var ai_debug = typeof ai_debugging !== 'undefined'; // 2
98
+ // var ai_debug = false;
99
+
100
+ // if (ai_debug) console.log ('AI LISTS', ai_list_blocks.length, 'BLOCKS');
101
+
102
  if (!ai_list_blocks.length) return;
103
 
104
  // Mark lists as processed
105
  ai_list_blocks.removeClass ('ai-list-data');
106
 
 
 
 
107
  var cookies = document.cookie.split (";");
108
 
109
  cookies.forEach (function (cookie, index) {
193
  if (ai_debug) console.log ("AI LISTS list pass", enable_block);
194
  }
195
 
196
+ if (enable_block) {
197
+ var client_list = $(this).attr ("client-list");
198
+ if (typeof client_list != "undefined" && typeof md !== "undefined") {
199
+ var client_list_array = b64d (client_list).split (",");
200
+ var clients_list_type = $(this).attr ("client-list-type");
201
+
202
+ if (ai_debug) console.log ("AI LISTS client: ", window.navigator.userAgent);
203
+ if (ai_debug) console.log ("AI LISTS client list:", b64d (client_list), clients_list_type);
204
+
205
+ found = false;
206
+ $.each (client_list_array, function (index, list_client) {
207
+ if (list_client == '') return true;
208
+
209
+ if (list_client.charAt (0) == "*") {
210
+ if (list_client.charAt (list_client.length - 1) == "*") {
211
+ list_client = list_client.substr (1, list_client.length - 2).toLowerCase ();
212
+ if (user_agent_lc.indexOf (list_client) != - 1) {
213
+ if (ai_debug) console.log ("AI LISTS FOUND:", list_client);
214
 
215
+ found = true;
216
+ return false;
217
+ }
218
+ } else {
219
+ list_client = list_client.substr (1).toLowerCase ();
220
+ if (user_agent_lc.substr (- list_client.length) == list_client) {
221
+ if (ai_debug) console.log ("AI LISTS FOUND:", list_client);
222
 
223
+ found = true;
224
+ return false;
225
+ }
226
+ }
227
+ }
228
+ else if (list_client.charAt (list_client.length - 1) == "*") {
229
+ list_client = list_client.substr (0, list_client.length - 1).toLowerCase ();
230
+ if (user_agent_lc.indexOf (list_client) == 0) {
231
  if (ai_debug) console.log ("AI LISTS FOUND:", list_client);
232
 
233
  found = true;
234
  return false;
235
  }
236
+ }
237
+ else if (md.is (list_client)) {
 
 
 
 
 
 
 
 
 
 
 
238
  if (ai_debug) console.log ("AI LISTS FOUND:", list_client);
239
 
240
  found = true;
241
  return false;
242
  }
243
+ });
 
 
244
 
245
+ switch (clients_list_type) {
246
+ case "B":
247
+ if (found) enable_block = false;
248
+ break;
249
+ case "W":
250
+ if (!found) enable_block = false;
251
+ break;
252
  }
 
253
 
254
+ if (ai_debug) console.log ("AI LISTS list found", found);
255
+ if (ai_debug) console.log ("AI LISTS list pass", enable_block);
 
 
 
 
 
256
  }
 
 
 
257
  }
258
 
259
  var url_parameters_manual_loading = false;
260
+ var url_parameters_need_tcData = false;
261
  if (enable_block) {
262
  var parameter_list = $(this).attr ("parameter-list");
263
  if (typeof parameter_list != "undefined") {
285
  if (ai_debug) console.log ("AI LISTS COOKIE ARRAY", cookie_array);
286
 
287
  var found = false;
288
+ var block_div = $(this);
289
  $.each (parameter_list_array, function (index, list_parameter) {
290
 
291
  if (list_parameter.indexOf ('=') != - 1) {
296
 
297
  var list_parameter_data = list_parameter.split ("=");
298
 
299
+ if (list_parameter_data [0].indexOf ('euconsent-v2') == 0 && list_parameter_data [0].indexOf ('[') != - 1) {
300
+
301
+ // IAB Europe Transparency and Consent Framework (TCF v2)
302
+ if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: IAB TCF 2.0");
303
+
304
+ if (typeof ai_tcData == 'object') {
305
+ if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: ai_tcData set");
306
+
307
+ var indexes = list_parameter_data [0].replace (/]| /gi, '').split ('[');
308
+ // Remove cookie name (euconsent-v2)
309
+ indexes.shift ();
310
+
311
+ if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: tcData", ai_tcData);
312
+
313
+ if (ai_structured_data_item (indexes, ai_tcData, list_parameter_data [1])) {
314
+
315
+ if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: FOUND");
316
+
317
+ found = true;
318
+ return false;
319
+ }
320
+ } else {
321
+ if (typeof __tcfapi == 'function') {
322
+ if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi function exists");
323
+
324
+ if (typeof ai_tcData_requested == 'undefined') {
325
+ ai_tcData_requested = true;
326
+
327
+ if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: getTCData");
328
+
329
+ __tcfapi ('getTCData', 2, function (tcData, success) {
330
+ if (success) {
331
+ if (tcData.eventStatus == 'tcloaded' || tcData.eventStatus == 'useractioncomplete') {
332
+ ai_tcData = tcData;
333
+ setTimeout (function () {ai_process_lists ();}, 10);
334
+
335
+ if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi getTCData", ai_tcData);
336
+ } else {
337
+ if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi getTCData, invalid status", tcData.eventStatus);
338
+ }
339
+ } else {
340
+ if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi getTCData failed");
341
+ }
342
+ });
343
+ } else {
344
+ if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: tcData already requested");
345
+ }
346
+
347
+ // Mark this list as unprocessed - will be processed later when __tcfapi callback function is called
348
+ block_div.addClass ('ai-list-data');
349
+ url_parameters_need_tcData = true;
350
+ } else {
351
+ if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi function not found");
352
+ }
353
+ }
354
+ } else
355
+
356
  if (ai_structured_data (cookie_array, list_parameter_data [0], list_parameter_data [1])) {
357
  found = true;
358
  return false;
394
  }
395
  }
396
 
397
+ // Url parameters needs tcData
398
+ if (url_parameters_need_tcData) {
399
+ if (ai_debug) console.log ("AI LISTS NEED tcData, NO ACTION");
400
+ return; // Continue each
401
+ }
402
+
403
+
404
  var debug_bar = $(this).prevAll ('.ai-debug-bar.ai-debug-lists');
405
  var referrer_text = referrer == '' ? '#' : referrer;
406
  debug_bar.find ('.ai-debug-name.ai-list-info').text (referrer_text).attr ('title', user_agent);
includes/js/ai-lists.min.js CHANGED
@@ -1,14 +1,15 @@
1
- var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$jscomp.createTemplateTagFirstArgWithRaw=function(a,g){a.raw=g;return a};$jscomp.arrayIteratorImpl=function(a){var g=0;return function(){return g<a.length?{done:!1,value:a[g++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var g="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return g?g.call(a):$jscomp.arrayIterator(a)};
2
- jQuery(function(a){function g(a){a=a.match(d);return null!=a&&1<a.length&&"string"===typeof a[1]&&0<a[1].length?a[1].toLowerCase():null}function p(a){try{var e=Date.parse(a);isNaN(e)&&(e=null)}catch(u){e=null}return e}Array.prototype.includes||(Array.prototype.includes=function(a){return!!~this.indexOf(a)});var d=/:\/\/(.[^/:]+)/i;ai_process_lists=function(d){function e(a,c,k){if(0==a.length)return"!@!"==k?!0:c==k;if("object"!=typeof c&&"array"!=typeof c)return!1;var f=a[0];a=a.slice(1);if("*"==f)for(c=
3
- $jscomp.makeIterator(Object.entries(c)),f=c.next();!f.done;f=c.next()){if(f=$jscomp.makeIterator(f.value),f.next(),f=f.next().value,e(a,f,k))return!0}else if(f in c)return e(a,c[f],k);return!1}function u(a,c,k){if("object"!=typeof a||-1==c.indexOf("["))return!1;c=c.replace(/]| /gi,"").split("[");return e(c,a,k)}d=null==d?a("div.ai-list-data"):d.filter(".ai-list-data");if(d.length){d.removeClass("ai-list-data");var t=document.cookie.split(";");t.forEach(function(a,c){t[c]=a.trim()});var m=getAllUrlParams(window.location.search);
4
- if(null!=m.referrer)var n=m.referrer;else n=document.referrer,""!=n&&(n=g(n));var v=window.navigator.userAgent,w=v.toLowerCase();if("undefined"!==typeof MobileDetect)var z=new MobileDetect(v);d.each(function(){var d=a(this).closest("div.AI_FUNCT_GET_BLOCK_CLASS_NAME"),c=!0,k=a(this).attr("referer-list");if("undefined"!=typeof k){k=b64d(k).split(",");var f=a(this).attr("referer-list-type"),h=!1;a.each(k,function(a,b){if(""==b)return!0;if("*"==b.charAt(0))if("*"==b.charAt(b.length-1)){if(b=b.substr(1,
5
- b.length-2),-1!=n.indexOf(b))return h=!0,!1}else{if(b=b.substr(1),n.substr(-b.length)==b)return h=!0,!1}else if("*"==b.charAt(b.length-1)){if(b=b.substr(0,b.length-1),0==n.indexOf(b))return h=!0,!1}else if("#"==b){if(""==n)return h=!0,!1}else if(b==n)return h=!0,!1});switch(f){case "B":h&&(c=!1);break;case "W":h||(c=!1)}}k=a(this).attr("client-list");if("undefined"!=typeof k&&"undefined"!==typeof z)switch(k=b64d(k).split(","),f=a(this).attr("client-list-type"),h=!1,a.each(k,function(a,b){if(""==b)return!0;
6
- if("*"==b.charAt(0))if("*"==b.charAt(b.length-1)){if(b=b.substr(1,b.length-2).toLowerCase(),-1!=w.indexOf(b))return h=!0,!1}else{if(b=b.substr(1).toLowerCase(),w.substr(-b.length)==b)return h=!0,!1}else if("*"==b.charAt(b.length-1)){if(b=b.substr(0,b.length-1).toLowerCase(),0==w.indexOf(b))return h=!0,!1}else if(z.is(b))return h=!0,!1}),f){case "B":h&&(c=!1);break;case "W":h||(c=!1)}k=!1;if(c&&(f=a(this).attr("parameter-list"),"undefined"!=typeof f)){f=b64d(f).split(",");var e=a(this).attr("parameter-list-type"),
7
- g=[];t.forEach(function(a){a=a.split("=");try{var b=JSON.parse(decodeURIComponent(a[1]))}catch(B){b=decodeURIComponent(a[1])}g[a[0]]=b});h=!1;a.each(f,function(a,b){if(-1!=b.indexOf("=")){if(-1!=t.indexOf(b))return h=!0,!1;var c=b.split("=");if(u(g,c[0],c[1]))return h=!0,!1}else if(t.forEach(function(a){a=a.split("=");if(b==a[0])return h=!0,!1}),u(g,b,"!@!"))return h=!0,!1});switch(e){case "B":h&&(c=!1);break;case "W":h||(c=!1)}!c&&a(this).hasClass("ai-list-manual")?(k=!0,a(this).addClass("ai-list-data")):
8
- a(this).removeClass("ai-list-manual")}var l=a(this).prevAll(".ai-debug-bar.ai-debug-lists");f=""==n?"#":n;l.find(".ai-debug-name.ai-list-info").text(f).attr("title",v);l.find(".ai-debug-name.ai-list-status").text(c?ai_front.visible:ai_front.hidden);f=!1;if(c){var m=a(this).attr("scheduling-start");l=a(this).attr("scheduling-end");var q=a(this).attr("scheduling-days");if("undefined"!=typeof m&&"undefined"!=typeof l&&"undefined"!=typeof q){f=!0;var x=parseInt(a(this).attr("scheduling-fallback"));e=
9
- parseInt(a(this).attr("gmt"));var r=p(b64d(m))+e;l=p(b64d(l))+e;m=b64d(q).split(",");q=a(this).attr("scheduling-type");var y=(new Date).getTime()+e,A=new Date(y);e=A.getDay();0==e?e=6:e--;r=y>=r&&y<l&&m.includes(e.toString());switch(q){case "B":r=!r}r||(c=!1);q=A.toISOString().split(".")[0].replace("T"," ");l=a(this).prevAll(".ai-debug-bar.ai-debug-scheduling");l.find(".ai-debug-name.ai-scheduling-info").text(q+" "+e);l.find(".ai-debug-name.ai-scheduling-status").text(c?ai_front.visible:ai_front.hidden);
10
- c||0==x||(l.removeClass("ai-debug-scheduling").addClass("ai-debug-fallback"),l.find(".ai-debug-name.ai-scheduling-status").text(ai_front.fallback+"="+x))}}k||(a(this).css({visibility:"",position:"",width:"",height:"","z-index":""}),c?(d.css({visibility:""}),d.hasClass("ai-remove-position")&&d.css({position:""}),"undefined"!=typeof a(this).data("code")&&(c=b64d(a(this).data("code")),a(this).append(c),ai_process_element(this))):f&&!r&&0!=x?(d.css({visibility:""}),d.hasClass("ai-remove-position")&&d.css({position:""}),
11
- a(this).next(".ai-fallback").removeClass("ai-fallback"),"undefined"!=typeof a(this).data("fallback-code")?(c=b64d(a(this).data("fallback-code")),a(this).append(c),ai_process_element(this)):a(this).hide(),c=d.attr("data-ai"),"undefined"!==typeof c&&!1!==c&&(c=a(this).attr("fallback-tracking"),"undefined"!==typeof c&&!1!==c&&d.attr("data-ai",c))):(a(this).hide(),d.removeAttr("data-ai").removeClass("ai-track"),d.find(".ai-debug-block").length?(d.css({visibility:""}).removeClass("ai-close"),d.hasClass("ai-remove-position")&&
12
- d.css({position:""})):d.hide()),a(this).attr("data-code",""),a(this).attr("data-fallback-code",""),d.removeClass("ai-list-block"))})}};a(document).ready(function(a){setTimeout(function(){ai_process_lists()},5)})});
 
13
  function ai_process_element(a){setTimeout(function(){"function"==typeof ai_process_rotations_in_element&&ai_process_rotations_in_element(a);"function"==typeof ai_process_lists&&ai_process_lists(jQuery("div.ai-list-data",a));"function"==typeof ai_process_ip_addresses&&ai_process_ip_addresses(jQuery("div.ai-ip-data",a));"function"==typeof ai_adb_process_blocks&&ai_adb_process_blocks(a)},5)}
14
- function getAllUrlParams(a){var g=a?a.split("?")[1]:window.location.search.slice(1);a={};if(g){g=g.split("#")[0];g=g.split("&");for(var p=0;p<g.length;p++){var d=g[p].split("="),m=void 0,e=d[0].replace(/\[\d*\]/,function(a){m=a.slice(1,-1);return""});d="undefined"===typeof d[1]?"":d[1];e=e.toLowerCase();d=d.toLowerCase();a[e]?("string"===typeof a[e]&&(a[e]=[a[e]]),"undefined"===typeof m?a[e].push(d):a[e][m]=d):a[e]=d}}return a};
1
+ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$jscomp.createTemplateTagFirstArgWithRaw=function(a,l){a.raw=l;return a};$jscomp.arrayIteratorImpl=function(a){var l=0;return function(){return l<a.length?{done:!1,value:a[l++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var l="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return l?l.call(a):$jscomp.arrayIterator(a)};
2
+ jQuery(function(a){function l(f){f=f.match(n);return null!=f&&1<f.length&&"string"===typeof f[1]&&0<f[1].length?f[1].toLowerCase():null}function v(f){try{var h=Date.parse(f);isNaN(h)&&(h=null)}catch(y){h=null}return h}Array.prototype.includes||(Array.prototype.includes=function(f){return!!~this.indexOf(f)});var n=/:\/\/(.[^/:]+)/i;ai_process_lists=function(f){function h(d,c,k){if(0==d.length)return"!@!"==k?!0:c==k;if("object"!=typeof c&&"array"!=typeof c)return!1;var e=d[0];d=d.slice(1);if("*"==e)for(c=
3
+ $jscomp.makeIterator(Object.entries(c)),e=c.next();!e.done;e=c.next()){if(e=$jscomp.makeIterator(e.value),e.next(),e=e.next().value,h(d,e,k))return!0}else if(e in c)return h(d,c[e],k);return!1}function y(d,c,k){if("object"!=typeof d||-1==c.indexOf("["))return!1;c=c.replace(/]| /gi,"").split("[");return h(c,d,k)}f=null==f?a("div.ai-list-data"):f.filter(".ai-list-data");if(f.length){f.removeClass("ai-list-data");var z=document.cookie.split(";");z.forEach(function(d,c){z[c]=d.trim()});var G=getAllUrlParams(window.location.search);
4
+ if(null!=G.referrer)var p=G.referrer;else p=document.referrer,""!=p&&(p=l(p));var B=window.navigator.userAgent,C=B.toLowerCase();if("undefined"!==typeof MobileDetect)var H=new MobileDetect(B);f.each(function(){var d=a(this).closest("div.AI_FUNCT_GET_BLOCK_CLASS_NAME"),c=!0,k=a(this).attr("referer-list");if("undefined"!=typeof k){k=b64d(k).split(",");var e=a(this).attr("referer-list-type"),g=!1;a.each(k,function(r,b){if(""==b)return!0;if("*"==b.charAt(0))if("*"==b.charAt(b.length-1)){if(b=b.substr(1,
5
+ b.length-2),-1!=p.indexOf(b))return g=!0,!1}else{if(b=b.substr(1),p.substr(-b.length)==b)return g=!0,!1}else if("*"==b.charAt(b.length-1)){if(b=b.substr(0,b.length-1),0==p.indexOf(b))return g=!0,!1}else if("#"==b){if(""==p)return g=!0,!1}else if(b==p)return g=!0,!1});switch(e){case "B":g&&(c=!1);break;case "W":g||(c=!1)}}if(c&&(k=a(this).attr("client-list"),"undefined"!=typeof k&&"undefined"!==typeof H))switch(k=b64d(k).split(","),e=a(this).attr("client-list-type"),g=!1,a.each(k,function(r,b){if(""==
6
+ b)return!0;if("*"==b.charAt(0))if("*"==b.charAt(b.length-1)){if(b=b.substr(1,b.length-2).toLowerCase(),-1!=C.indexOf(b))return g=!0,!1}else{if(b=b.substr(1).toLowerCase(),C.substr(-b.length)==b)return g=!0,!1}else if("*"==b.charAt(b.length-1)){if(b=b.substr(0,b.length-1).toLowerCase(),0==C.indexOf(b))return g=!0,!1}else if(H.is(b))return g=!0,!1}),e){case "B":g&&(c=!1);break;case "W":g||(c=!1)}var I=k=!1;if(c&&(e=a(this).attr("parameter-list"),"undefined"!=typeof e)){e=b64d(e).split(",");var q=a(this).attr("parameter-list-type"),
7
+ D=[];z.forEach(function(r){r=r.split("=");try{var b=JSON.parse(decodeURIComponent(r[1]))}catch(t){b=decodeURIComponent(r[1])}D[r[0]]=b});g=!1;var L=a(this);a.each(e,function(r,b){if(-1!=b.indexOf("=")){if(-1!=z.indexOf(b))return g=!0,!1;var t=b.split("=");if(0==t[0].indexOf("euconsent-v2")&&-1!=t[0].indexOf("["))if("object"==typeof ai_tcData){var J=t[0].replace(/]| /gi,"").split("[");J.shift();if(h(J,ai_tcData,t[1]))return g=!0,!1}else"function"==typeof __tcfapi&&("undefined"==typeof ai_tcData_requested&&
8
+ (ai_tcData_requested=!0,__tcfapi("getTCData",2,function(u,M){!M||"tcloaded"!=u.eventStatus&&"useractioncomplete"!=u.eventStatus||(ai_tcData=u,setTimeout(function(){ai_process_lists()},10))})),L.addClass("ai-list-data"),I=!0);else if(y(D,t[0],t[1]))return g=!0,!1}else if(z.forEach(function(u){u=u.split("=");if(b==u[0])return g=!0,!1}),y(D,b,"!@!"))return g=!0,!1});switch(q){case "B":g&&(c=!1);break;case "W":g||(c=!1)}!c&&a(this).hasClass("ai-list-manual")?(k=!0,a(this).addClass("ai-list-data")):a(this).removeClass("ai-list-manual")}if(!I){var m=
9
+ a(this).prevAll(".ai-debug-bar.ai-debug-lists");e=""==p?"#":p;m.find(".ai-debug-name.ai-list-info").text(e).attr("title",B);m.find(".ai-debug-name.ai-list-status").text(c?ai_front.visible:ai_front.hidden);e=!1;if(c){var A=a(this).attr("scheduling-start");m=a(this).attr("scheduling-end");var w=a(this).attr("scheduling-days");if("undefined"!=typeof A&&"undefined"!=typeof m&&"undefined"!=typeof w){e=!0;var E=parseInt(a(this).attr("scheduling-fallback"));q=parseInt(a(this).attr("gmt"));var x=v(b64d(A))+
10
+ q;m=v(b64d(m))+q;A=b64d(w).split(",");w=a(this).attr("scheduling-type");var F=(new Date).getTime()+q,K=new Date(F);q=K.getDay();0==q?q=6:q--;x=F>=x&&F<m&&A.includes(q.toString());switch(w){case "B":x=!x}x||(c=!1);w=K.toISOString().split(".")[0].replace("T"," ");m=a(this).prevAll(".ai-debug-bar.ai-debug-scheduling");m.find(".ai-debug-name.ai-scheduling-info").text(w+" "+q);m.find(".ai-debug-name.ai-scheduling-status").text(c?ai_front.visible:ai_front.hidden);c||0==E||(m.removeClass("ai-debug-scheduling").addClass("ai-debug-fallback"),
11
+ m.find(".ai-debug-name.ai-scheduling-status").text(ai_front.fallback+"="+E))}}k||(a(this).css({visibility:"",position:"",width:"",height:"","z-index":""}),c?(d.css({visibility:""}),d.hasClass("ai-remove-position")&&d.css({position:""}),"undefined"!=typeof a(this).data("code")&&(c=b64d(a(this).data("code")),a(this).append(c),ai_process_element(this))):e&&!x&&0!=E?(d.css({visibility:""}),d.hasClass("ai-remove-position")&&d.css({position:""}),a(this).next(".ai-fallback").removeClass("ai-fallback"),"undefined"!=
12
+ typeof a(this).data("fallback-code")?(c=b64d(a(this).data("fallback-code")),a(this).append(c),ai_process_element(this)):a(this).hide(),c=d.attr("data-ai"),"undefined"!==typeof c&&!1!==c&&(c=a(this).attr("fallback-tracking"),"undefined"!==typeof c&&!1!==c&&d.attr("data-ai",c))):(a(this).hide(),d.removeAttr("data-ai").removeClass("ai-track"),d.find(".ai-debug-block").length?(d.css({visibility:""}).removeClass("ai-close"),d.hasClass("ai-remove-position")&&d.css({position:""})):d.hide()),a(this).attr("data-code",
13
+ ""),a(this).attr("data-fallback-code",""),d.removeClass("ai-list-block"))}})}};a(document).ready(function(f){setTimeout(function(){ai_process_lists()},5)})});
14
  function ai_process_element(a){setTimeout(function(){"function"==typeof ai_process_rotations_in_element&&ai_process_rotations_in_element(a);"function"==typeof ai_process_lists&&ai_process_lists(jQuery("div.ai-list-data",a));"function"==typeof ai_process_ip_addresses&&ai_process_ip_addresses(jQuery("div.ai-ip-data",a));"function"==typeof ai_adb_process_blocks&&ai_adb_process_blocks(a)},5)}
15
+ function getAllUrlParams(a){var l=a?a.split("?")[1]:window.location.search.slice(1);a={};if(l){l=l.split("#")[0];l=l.split("&");for(var v=0;v<l.length;v++){var n=l[v].split("="),f=void 0,h=n[0].replace(/\[\d*\]/,function(y){f=y.slice(1,-1);return""});n="undefined"===typeof n[1]?"":n[1];h=h.toLowerCase();n=n.toLowerCase();a[h]?("string"===typeof a[h]&&(a[h]=[a[h]]),"undefined"===typeof f?a[h].push(n):a[h][f]=n):a[h]=n}}return a};
js/ad-inserter.js CHANGED
@@ -1,4 +1,4 @@
1
- var javascript_version = "2.6.10";
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
@@ -5442,6 +5442,9 @@ jQuery(document).ready (function($) {
5442
 
5443
  $('#ai-tab-container').on ('tabsbeforeactivate', function (event, ui) {
5444
  var tab_block = ui.newTab.attr ("id");
 
 
 
5445
  tab_block = parseInt (tab_block.replace ("ai-tab",""));
5446
  active_tab = tab_block;
5447
 
1
+ var javascript_version = "2.6.11";
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
5442
 
5443
  $('#ai-tab-container').on ('tabsbeforeactivate', function (event, ui) {
5444
  var tab_block = ui.newTab.attr ("id");
5445
+
5446
+ if (!tab_block.includes ('ai-tab')) return;
5447
+
5448
  tab_block = parseInt (tab_block.replace ("ai-tab",""));
5449
  active_tab = tab_block;
5450
 
readme.txt CHANGED
@@ -4,9 +4,9 @@ Contributors: adinserter, spacetime
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4
5
  Tags: ads, adsense, ad rotation, ad manager, amp, amazon, ad blocking detection, header code, banners, adverts, sticky fixed widgets, dfp
6
  Requires at least: 4.6
7
- Tested up to: 5.4
8
  Requires PHP: 5.6
9
- Stable tag: 2.6.10
10
  License: GPLv3
11
 
12
  Manage Google AdSense, Media.net, Amazon banners, ads.txt, ad rotation, sticky widgets, AMP ads, DFP, tracking, AdSense header and footer code
@@ -332,6 +332,13 @@ If you are not happy to reveal this information and you have opted in, simply di
332
 
333
  == Changelog ==
334
 
 
 
 
 
 
 
 
335
  = 2.6.10 =
336
  - Added user taxonomy items for logged-in and not logged-in users
337
  - Added option to define tab setup delay (for the plugin settings page)
@@ -505,6 +512,13 @@ For the changelog of earlier versions, please refer to the separate changelog.tx
505
 
506
  == Upgrade Notice ==
507
 
 
 
 
 
 
 
 
508
  = 2.6.10 =
509
  Added user taxonomy items for logged-in and not logged-in users;
510
  Added option to define tab setup delay (for the plugin settings page);
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4
5
  Tags: ads, adsense, ad rotation, ad manager, amp, amazon, ad blocking detection, header code, banners, adverts, sticky fixed widgets, dfp
6
  Requires at least: 4.6
7
+ Tested up to: 5.5
8
  Requires PHP: 5.6
9
+ Stable tag: 2.6.11
10
  License: GPLv3
11
 
12
  Manage Google AdSense, Media.net, Amazon banners, ads.txt, ad rotation, sticky widgets, AMP ads, DFP, tracking, AdSense header and footer code
332
 
333
  == Changelog ==
334
 
335
+ = 2.6.11 =
336
+ - Added support for IAB Transparency & Consent Framework 2.0
337
+ - Added support for taxonomy for primary category
338
+ - Added support for taxonomy for post meta data
339
+ - Added support to invert contain/do not contain text condition for paragraph counting
340
+ - Few minor bug fixes, cosmetic changes and code improvements
341
+
342
  = 2.6.10 =
343
  - Added user taxonomy items for logged-in and not logged-in users
344
  - Added option to define tab setup delay (for the plugin settings page)
512
 
513
  == Upgrade Notice ==
514
 
515
+ = 2.6.11 =
516
+ Added support for IAB Transparency & Consent Framework 2.0;
517
+ Added support for taxonomy for primary category;
518
+ Added support for taxonomy for post meta data;
519
+ Added support to invert contain/do not contain text condition for paragraph counting;
520
+ Few minor bug fixes, cosmetic changes and code improvements
521
+
522
  = 2.6.10 =
523
  Added user taxonomy items for logged-in and not logged-in users;
524
  Added option to define tab setup delay (for the plugin settings page);
settings.php CHANGED
@@ -4741,6 +4741,7 @@ function generate_list_options ($options) {
4741
  echo " <option value='{$taxonomy}'>{$taxonomy} ({$taxonomy_name})</option>\n"; else
4742
  echo " <option value='{$taxonomy}'>{$taxonomy}</option>\n";
4743
  }
 
4744
  break;
4745
 
4746
  case 'id':
@@ -4930,7 +4931,7 @@ function ai_check_page ($options) {
4930
  function sidebar_addense_alternative () { ?>
4931
 
4932
  <?php
4933
- switch (rand (1, 12)) {
4934
  case 1:
4935
  ?>
4936
  <div class="ai-form header rounded">
@@ -5165,7 +5166,6 @@ function sidebar_help () { ?>
5165
  function sidebar_pro () {
5166
  $version = rand (0, 3);
5167
 
5168
- $version = 3;
5169
  ?>
5170
 
5171
  <div class="ai-form rounded no-select feature-list" style="background: #fff;">
@@ -5178,8 +5178,8 @@ function sidebar_pro () {
5178
  <!-- <a href='https://adinserter.pro/documentation/code-preview' class="clear-link" title="<?php _e ('Code preview with visual CSS editor', 'ad-inserter'); ?>" target="_blank"><img id="ai-preview" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-preview-250.png" /></a>-->
5179
  <a href='https://www.infolinks.com/publishers/?kid=3114832&loc=2' class="clear-link" title="<?php _e ('Use Infolinks ads with Adsense to earn more', 'ad-inserter'); ?>" target="_blank"><img id="ai-info-3" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>info-3.jpg" /></a>
5180
  <?php break; case 1: ?>
5181
- <!-- <a href='https://adinserter.pro/documentation/ad-blocking-detection' class="clear-link" title="<?php _e ('Ad blocking detection and content protection', 'ad-inserter'); ?>" target="_blank"><img id="ai-adb" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-adb.png" /></a>-->
5182
- <a href='https://www.media.net/program?ha=e9Pw4uwo2Uw/5xjjsB3lnYZZWUI+hzRSONzDaYA9EwX+3jg/PJYwFshOFEjop5NH2wRNDfr357ZTY1zlhCk7zw%3D%3D&loc=2' class="clear-link" title="<?php _e ('Looking for AdSense alternative?', 'ad-inserter'); ?>" target="_blank"><img id="ai-media-9" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>contextual-9.jpg" /></a>
5183
  <?php break; case 2: ?>
5184
  <a href="https://adinserter.pro/documentation/ad-impression-and-click-tracking" class="clear-link" title="<?php _e ('A/B testing - Track ad impressions and clicks', 'ad-inserter'); ?>" target="_blank"><img id="ai-pro-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-charts-250.png" /></a>
5185
  <!-- <a href='https://www.media.net/program?ha=e9Pw4uwo2Uw/5xjjsB3lnYZZWUI+hzRSONzDaYA9EwX+3jg/PJYwFshOFEjop5NH2wRNDfr357ZTY1zlhCk7zw%3D%3D&loc=2' class="clear-link" title="<?php _e ('Looking for AdSense alternative?', 'ad-inserter'); ?>" target="_blank"><img id="ai-media-9" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>contextual-9.jpg" /></a>-->
@@ -5206,8 +5206,8 @@ function sidebar_pro () {
5206
  <?php break;
5207
  case 3:
5208
  ?>
5209
- <!-- <a href='https://adinserter.pro/documentation/ad-blocking-detection' class="clear-link" title="<?php _e ('Ad blocking detection and content protection', 'ad-inserter'); ?>" target="_blank"><img id="ai-adb" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-adb.png" /></a>-->
5210
- <a href='https://www.media.net/program?ha=e9Pw4uwo2Uw/5xjjsB3lnYZZWUI+hzRSONzDaYA9EwX+3jg/PJYwFshOFEjop5NH2wRNDfr357ZTY1zlhCk7zw%3D%3D&loc=2' class="clear-link" title="<?php _e ('Looking for AdSense alternative?', 'ad-inserter'); ?>" target="_blank"><img id="ai-media-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>contextual-2.jpg" /></a>
5211
  <?php break;
5212
  } ?>
5213
  </div>
@@ -5221,8 +5221,8 @@ function sidebar_pro () {
5221
  <a href="https://adinserter.pro/documentation/black-and-white-lists#geo-targeting" class="clear-link" title="Geotargeting - black/white-list countries" target="_blank"><img id="ai-pro-3" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-countries-250.png" /></a>
5222
  <!-- <a href='https://www.media.net/program?ha=e9Pw4uwo2Uw/5xjjsB3lnYZZWUI+hzRSONzDaYA9EwX+3jg/PJYwFshOFEjop5NH2wRNDfr357ZTY1zlhCk7zw%3D%3D&loc=2' class="clear-link" title="<?php _e ('Looking for AdSense alternative?', 'ad-inserter'); ?>" target="_blank"><img id="ai-media-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>contextual-2.jpg" /></a>-->
5223
  <?php break; case 2: ?>
5224
- <!-- <a href="https://adinserter.pro/documentation/black-and-white-lists#geo-targeting" class="clear-link" title="Geotargeting - black/white-list countries" target="_blank"><img id="ai-pro-3" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-countries-250.png" /></a>-->
5225
- <a href='https://www.media.net/program?ha=e9Pw4uwo2Uw/5xjjsB3lnYZZWUI+hzRSONzDaYA9EwX+3jg/PJYwFshOFEjop5NH2wRNDfr357ZTY1zlhCk7zw%3D%3D&loc=2' class="clear-link" title="<?php _e ('Looking for AdSense alternative?', 'ad-inserter'); ?>" target="_blank"><img id="ai-media-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>contextual-2.jpg" /></a>
5226
  <?php break; case 3: ?>
5227
  <!-- <a href="https://adinserter.pro/documentation/black-and-white-lists#geo-targeting" class="clear-link" title="Geotargeting - black/white-list countries" target="_blank"><img id="ai-pro-3" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-countries-250.png" /></a>-->
5228
  <a href='https://www.infolinks.com/publishers/?kid=3114832&loc=2' class="clear-link" title="<?php _e ('Use Infolinks ads with Adsense to earn more', 'ad-inserter'); ?>" target="_blank"><img id="ai-info-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>info-2.jpg" /></a>
@@ -5234,9 +5234,9 @@ function sidebar_pro () {
5234
  <?php switch ($version) {
5235
  case 0:
5236
  ?>
5237
- <!-- <a href="https://adinserter.pro/documentation/ad-impression-and-click-tracking" class="clear-link" title="<?php _e ('A/B testing - Track ad impressions and clicks', 'ad-inserter'); ?>" target="_blank"><img id="ai-pro-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-charts-250.png" /></a>-->
5238
  <!-- <a href="https://adinserter.pro/" class="clear-link" title="Automate ad placement on posts and pages" target="_blank"><img id="ai-pro-1" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>icon-256x256.jpg" /></a>-->
5239
- <a href='https://www.media.net/program?ha=e9Pw4uwo2Uw/5xjjsB3lnYZZWUI+hzRSONzDaYA9EwX+3jg/PJYwFshOFEjop5NH2wRNDfr357ZTY1zlhCk7zw%3D%3D&loc=2' class="clear-link" title="<?php _e ('Looking for AdSense alternative?', 'ad-inserter'); ?>" target="_blank"><img id="ai-media-8" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>contextual-8.gif" /></a>
5240
  <?php break;
5241
  case 1:
5242
  ?>
4741
  echo " <option value='{$taxonomy}'>{$taxonomy} ({$taxonomy_name})</option>\n"; else
4742
  echo " <option value='{$taxonomy}'>{$taxonomy}</option>\n";
4743
  }
4744
+
4745
  break;
4746
 
4747
  case 'id':
4931
  function sidebar_addense_alternative () { ?>
4932
 
4933
  <?php
4934
+ switch (rand (5, 12)) {
4935
  case 1:
4936
  ?>
4937
  <div class="ai-form header rounded">
5166
  function sidebar_pro () {
5167
  $version = rand (0, 3);
5168
 
 
5169
  ?>
5170
 
5171
  <div class="ai-form rounded no-select feature-list" style="background: #fff;">
5178
  <!-- <a href='https://adinserter.pro/documentation/code-preview' class="clear-link" title="<?php _e ('Code preview with visual CSS editor', 'ad-inserter'); ?>" target="_blank"><img id="ai-preview" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-preview-250.png" /></a>-->
5179
  <a href='https://www.infolinks.com/publishers/?kid=3114832&loc=2' class="clear-link" title="<?php _e ('Use Infolinks ads with Adsense to earn more', 'ad-inserter'); ?>" target="_blank"><img id="ai-info-3" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>info-3.jpg" /></a>
5180
  <?php break; case 1: ?>
5181
+ <a href='https://adinserter.pro/documentation/ad-blocking-detection' class="clear-link" title="<?php _e ('Ad blocking detection and content protection', 'ad-inserter'); ?>" target="_blank"><img id="ai-adb" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-adb.png" /></a>
5182
+ <!-- <a href='https://www.media.net/program?ha=e9Pw4uwo2Uw/5xjjsB3lnYZZWUI+hzRSONzDaYA9EwX+3jg/PJYwFshOFEjop5NH2wRNDfr357ZTY1zlhCk7zw%3D%3D&loc=2' class="clear-link" title="<?php _e ('Looking for AdSense alternative?', 'ad-inserter'); ?>" target="_blank"><img id="ai-media-9" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>contextual-9.jpg" /></a>-->
5183
  <?php break; case 2: ?>
5184
  <a href="https://adinserter.pro/documentation/ad-impression-and-click-tracking" class="clear-link" title="<?php _e ('A/B testing - Track ad impressions and clicks', 'ad-inserter'); ?>" target="_blank"><img id="ai-pro-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-charts-250.png" /></a>
5185
  <!-- <a href='https://www.media.net/program?ha=e9Pw4uwo2Uw/5xjjsB3lnYZZWUI+hzRSONzDaYA9EwX+3jg/PJYwFshOFEjop5NH2wRNDfr357ZTY1zlhCk7zw%3D%3D&loc=2' class="clear-link" title="<?php _e ('Looking for AdSense alternative?', 'ad-inserter'); ?>" target="_blank"><img id="ai-media-9" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>contextual-9.jpg" /></a>-->
5206
  <?php break;
5207
  case 3:
5208
  ?>
5209
+ <a href='https://adinserter.pro/documentation/ad-blocking-detection' class="clear-link" title="<?php _e ('Ad blocking detection and content protection', 'ad-inserter'); ?>" target="_blank"><img id="ai-adb" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-adb.png" /></a>
5210
+ <!-- <a href='https://www.media.net/program?ha=e9Pw4uwo2Uw/5xjjsB3lnYZZWUI+hzRSONzDaYA9EwX+3jg/PJYwFshOFEjop5NH2wRNDfr357ZTY1zlhCk7zw%3D%3D&loc=2' class="clear-link" title="<?php _e ('Looking for AdSense alternative?', 'ad-inserter'); ?>" target="_blank"><img id="ai-media-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>contextual-2.jpg" /></a>-->
5211
  <?php break;
5212
  } ?>
5213
  </div>
5221
  <a href="https://adinserter.pro/documentation/black-and-white-lists#geo-targeting" class="clear-link" title="Geotargeting - black/white-list countries" target="_blank"><img id="ai-pro-3" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-countries-250.png" /></a>
5222
  <!-- <a href='https://www.media.net/program?ha=e9Pw4uwo2Uw/5xjjsB3lnYZZWUI+hzRSONzDaYA9EwX+3jg/PJYwFshOFEjop5NH2wRNDfr357ZTY1zlhCk7zw%3D%3D&loc=2' class="clear-link" title="<?php _e ('Looking for AdSense alternative?', 'ad-inserter'); ?>" target="_blank"><img id="ai-media-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>contextual-2.jpg" /></a>-->
5223
  <?php break; case 2: ?>
5224
+ <a href="https://adinserter.pro/documentation/black-and-white-lists#geo-targeting" class="clear-link" title="Geotargeting - black/white-list countries" target="_blank"><img id="ai-pro-3" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-countries-250.png" /></a>
5225
+ <!-- <a href='https://www.media.net/program?ha=e9Pw4uwo2Uw/5xjjsB3lnYZZWUI+hzRSONzDaYA9EwX+3jg/PJYwFshOFEjop5NH2wRNDfr357ZTY1zlhCk7zw%3D%3D&loc=2' class="clear-link" title="<?php _e ('Looking for AdSense alternative?', 'ad-inserter'); ?>" target="_blank"><img id="ai-media-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>contextual-2.jpg" /></a>-->
5226
  <?php break; case 3: ?>
5227
  <!-- <a href="https://adinserter.pro/documentation/black-and-white-lists#geo-targeting" class="clear-link" title="Geotargeting - black/white-list countries" target="_blank"><img id="ai-pro-3" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-countries-250.png" /></a>-->
5228
  <a href='https://www.infolinks.com/publishers/?kid=3114832&loc=2' class="clear-link" title="<?php _e ('Use Infolinks ads with Adsense to earn more', 'ad-inserter'); ?>" target="_blank"><img id="ai-info-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>info-2.jpg" /></a>
5234
  <?php switch ($version) {
5235
  case 0:
5236
  ?>
5237
+ <a href="https://adinserter.pro/documentation/ad-impression-and-click-tracking" class="clear-link" title="<?php _e ('A/B testing - Track ad impressions and clicks', 'ad-inserter'); ?>" target="_blank"><img id="ai-pro-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-charts-250.png" /></a>
5238
  <!-- <a href="https://adinserter.pro/" class="clear-link" title="Automate ad placement on posts and pages" target="_blank"><img id="ai-pro-1" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>icon-256x256.jpg" /></a>-->
5239
+ <!-- <a href='https://www.media.net/program?ha=e9Pw4uwo2Uw/5xjjsB3lnYZZWUI+hzRSONzDaYA9EwX+3jg/PJYwFshOFEjop5NH2wRNDfr357ZTY1zlhCk7zw%3D%3D&loc=2' class="clear-link" title="<?php _e ('Looking for AdSense alternative?', 'ad-inserter'); ?>" target="_blank"><img id="ai-media-8" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>contextual-8.gif" /></a>-->
5240
  <?php break;
5241
  case 1:
5242
  ?>