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

Version Description

  • Fixed bug for url parameters check
  • Added support for reCaptcha v3 score check (Pro only)
  • 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.7.17
Comparing to
See all releases

Code changes from version 2.7.16 to 2.7.17

ad-inserter.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  /*
4
  Plugin Name: Ad Inserter
5
- Version: 2.7.16
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/
@@ -17,6 +17,11 @@ Requires PHP: 5.6
17
 
18
  Change Log
19
 
 
 
 
 
 
20
  Ad Inserter 2.7.16 - 2022-06-23
21
  - Added support for adb redirection page with url queries
22
  - Added support for tcf-no-google shortcut
@@ -3890,6 +3895,10 @@ function ai_wp_footer_hook () {
3890
  $ai_wp_data [AI_CONTEXT] = AI_CONTEXT_FOOTER;
3891
  $footer_code = '';
3892
 
 
 
 
 
3893
  $footer = $block_object [AI_FOOTER_OPTION_NAME];
3894
  $footer->clear_code_cache ();
3895
 
@@ -6083,6 +6092,12 @@ function filter_option ($option, $value, $delete_escaped_backslashes = true){
6083
  $value = str_replace (array ("http://", "https://", ":". "\"", "<", ">", "[", "]"), "", $value);
6084
  $value = esc_html ($value);
6085
  }
 
 
 
 
 
 
6086
  elseif (
6087
  $option == 'MAXMIND_LICENSE_KEY' ||
6088
  $option == 'GEO_DB'
@@ -6127,6 +6142,9 @@ function ai_ajax () {
6127
  if (isset ($_GET ["cookie_check"]) && $_GET ["cookie_check"] == 1) {
6128
  $block->client_side_cookie_check = true;
6129
  }
 
 
 
6130
  if (isset ($_GET ["hide-debug-labels"]) && $_GET ["hide-debug-labels"] == 1) {
6131
  $block->hide_debug_labels = true;
6132
  }
@@ -7191,8 +7209,8 @@ a.ai-debug-center {text-align: center; cursor: default; font-size: 10px; text-de
7191
 
7192
  .ai-debug-bar {margin: 0; padding: 1px 0 1px 5px; color: white; font-size: 12px; font-family: arial; font-weight: normal; line-height: 20px; text-align: center; overflow: hidden; word-break: break-word;}
7193
 
7194
- .ai-debug-bar .ai-debug-text-left {float: left; text-align: left;}
7195
- .ai-debug-bar .ai-debug-text-right {float: right; text-align: right; padding-right: 3px;}
7196
  .ai-debug-bar .ai-debug-text-center {text-align: center;}
7197
 
7198
  .ai-debug-lists .ai-debug-text-left, .ai-debug-viewport-invisible .ai-debug-text-left, .ai-debug-filter .ai-debug-text-left {min-width: 40%;}
@@ -11574,7 +11592,6 @@ $ai_wp_data [AI_PARALLAX] = false;
11574
  $ai_wp_data [AI_PHP_PROCESSING] = ai_php_enabled ();
11575
  $ai_wp_data [AI_UNFILTERED_HTML] = !(defined ('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML);
11576
 
11577
-
11578
  ai_load_settings ();
11579
 
11580
  if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0)
2
 
3
  /*
4
  Plugin Name: Ad Inserter
5
+ Version: 2.7.17
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/
17
 
18
  Change Log
19
 
20
+ Ad Inserter 2.7.17 - 2022-07-06
21
+ - Fixed bug for url parameters check
22
+ - Added support for reCaptcha v3 score check (Pro only)
23
+ - Few minor bug fixes, cosmetic changes and code improvements
24
+
25
  Ad Inserter 2.7.16 - 2022-06-23
26
  - Added support for adb redirection page with url queries
27
  - Added support for tcf-no-google shortcut
3895
  $ai_wp_data [AI_CONTEXT] = AI_CONTEXT_FOOTER;
3896
  $footer_code = '';
3897
 
3898
+ if (function_exists ('add_footer_scripts')) {
3899
+ add_footer_scripts ();
3900
+ }
3901
+
3902
  $footer = $block_object [AI_FOOTER_OPTION_NAME];
3903
  $footer->clear_code_cache ();
3904
 
6092
  $value = str_replace (array ("http://", "https://", ":". "\"", "<", ">", "[", "]"), "", $value);
6093
  $value = esc_html ($value);
6094
  }
6095
+ elseif (
6096
+ $option == 'RECAPTCHA_THRESHOLD'
6097
+ ) {
6098
+ $value = str_replace (array (":". "\"", "<", ">", "[", "]"), "", $value);
6099
+ $value = esc_html ($value);
6100
+ }
6101
  elseif (
6102
  $option == 'MAXMIND_LICENSE_KEY' ||
6103
  $option == 'GEO_DB'
6142
  if (isset ($_GET ["cookie_check"]) && $_GET ["cookie_check"] == 1) {
6143
  $block->client_side_cookie_check = true;
6144
  }
6145
+ if (isset ($_GET ["cookie_check_url"]) && $_GET ["cookie_check_url"] == 1) {
6146
+ $block->client_side_cookie_check_url = true;
6147
+ }
6148
  if (isset ($_GET ["hide-debug-labels"]) && $_GET ["hide-debug-labels"] == 1) {
6149
  $block->hide_debug_labels = true;
6150
  }
7209
 
7210
  .ai-debug-bar {margin: 0; padding: 1px 0 1px 5px; color: white; font-size: 12px; font-family: arial; font-weight: normal; line-height: 20px; text-align: center; overflow: hidden; word-break: break-word;}
7211
 
7212
+ .ai-debug-bar .ai-debug-text-left {float: left; text-align: left; margin-top: 3px;}
7213
+ .ai-debug-bar .ai-debug-text-right {float: right; text-align: right; padding-right: 3px; margin-top: 3px;}
7214
  .ai-debug-bar .ai-debug-text-center {text-align: center;}
7215
 
7216
  .ai-debug-lists .ai-debug-text-left, .ai-debug-viewport-invisible .ai-debug-text-left, .ai-debug-filter .ai-debug-text-left {min-width: 40%;}
11592
  $ai_wp_data [AI_PHP_PROCESSING] = ai_php_enabled ();
11593
  $ai_wp_data [AI_UNFILTERED_HTML] = !(defined ('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML);
11594
 
 
11595
  ai_load_settings ();
11596
 
11597
  if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0)
class.php CHANGED
@@ -23,6 +23,7 @@ abstract class ai_BaseCodeBlock {
23
  var $additional_code_before_block; // For clint-side manual insertion set to auto
24
  var $counters;
25
  var $client_side_cookie_check;
 
26
  var $hide_debug_labels;
27
  var $demo_debugging;
28
  var $hidden_viewports;
@@ -105,6 +106,7 @@ abstract class ai_BaseCodeBlock {
105
  $this->additional_code_before_block = '';
106
  $this->counters = '';
107
  $this->client_side_cookie_check = false;
 
108
  $this->hide_debug_labels = false;
109
  $this->demo_debugging = false;
110
  $this->hidden_viewports = '';
@@ -704,6 +706,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
704
  $this->wp_options [AI_OPTION_BLOCK_BACKGROUND_COLOR] = AD_EMPTY_DATA;
705
  $this->wp_options [AI_OPTION_LAZY_LOADING] = AI_DISABLED;
706
  $this->wp_options [AI_OPTION_WAIT_FOR_INTERACTION] = AI_DISABLED;
 
707
  $this->wp_options [AI_OPTION_PROTECTED] = AI_DISABLED;
708
  $this->wp_options [AI_OPTION_MANUAL_LOADING] = AI_MANUAL_LOADING_DISABLED;
709
  $this->wp_options [AI_OPTION_IFRAME] = AI_DISABLED;
@@ -916,6 +919,12 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
916
  return $protected;
917
  }
918
 
 
 
 
 
 
 
919
  public function get_manual_loading (){
920
  $manual_loading = isset ($this->wp_options [AI_OPTION_MANUAL_LOADING]) ? $this->wp_options [AI_OPTION_MANUAL_LOADING] : AI_MANUAL_LOADING_DISABLED;
921
  if ($manual_loading == '') $manual_loading = AI_MANUAL_LOADING_DISABLED;
@@ -3373,6 +3382,10 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
3373
  $iframe_parameters .= '&cookie_check=1';
3374
  }
3375
 
 
 
 
 
3376
  if ($this->hide_debug_labels) {
3377
  $iframe_parameters .= '&hide-debug-labels=1';
3378
  }
@@ -4328,7 +4341,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
4328
  $referers = base64_encode ($referers_raw);
4329
  $clients = base64_encode (html_entity_decode ($clients_raw));
4330
 
4331
- if (($this->client_side_cookie_check && $url_parameters != '') || ($this->client_side_cookie_check && $cookies != '') || $referers != '' || $clients != '' || $scheduling_type !== null) {
4332
  switch ($dynamic_blocks) {
4333
  case AI_DYNAMIC_BLOCKS_CLIENT_SIDE_SHOW:
4334
  case AI_DYNAMIC_BLOCKS_CLIENT_SIDE_INSERT:
@@ -4380,11 +4393,11 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
4380
  }
4381
  }
4382
 
4383
- if ($this->client_side_cookie_check && $url_parameters != '') $url_parameter_attributes = " parameter-list='$url_parameters' parameter-list-type='$url_parameter_list_type'"; else $url_parameter_attributes = '';
4384
- if ($this->client_side_cookie_check && $cookies != '') $cookie_attributes = " cookie-list='$cookies' cookie-list-type='$cookie_list_type'"; else $cookie_attributes = '';
4385
- if ( $referers != '') $referer_attributes = " referer-list='$referers' referer-list-type='$referer_list_type'"; else $referer_attributes = '';
4386
- if ( $clients != '') $client_attributes = " client-list='$clients' client-list-type='$client_list_type'"; else $client_attributes = '';
4387
- if ($scheduling_type !== null ) $scheduling_attributes = " scheduling-start='$scheduling_start_time' scheduling-end='$scheduling_end_time' scheduling-days='$scheduling_days_in_week' scheduling-type='$scheduling_type_code' gmt='$gmt' scheduling-fallback='$fallback_block_data' fallback_level='$fallback_level' fallback-tracking='$fallback_tracking_data'"; else $scheduling_attributes = '';
4388
 
4389
 
4390
  // Deprecated
@@ -4447,13 +4460,13 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
4447
  $processed_code = $debug_processed_code . $processed_code;
4448
  }
4449
 
4450
- if ($this->client_side_cookie_check && ($url_parameters != '')) $url_parameter_attributes_dbg = sprintf (__ ("parameters='%s' type='%s'", 'ad-inserter'), $url_parameters_raw, $url_parameter_list_type); else $url_parameter_attributes_dbg = '';
4451
 
4452
- if ($this->client_side_cookie_check && ($cookies != '')) $cookie_attributes_dbg = sprintf (__ ("cookies='%s' type='%s'", 'ad-inserter'), $cookies_raw, $cookie_list_type); else $cookie_attributes_dbg = '';
4453
  // translators: %s: list parameters and type
4454
- if ( $referers != '') $referer_attributes_dbg = sprintf (__ ("referers='%s' type='%s'", 'ad-inserter'), $referers_raw, $referer_list_type); else $referer_attributes_dbg = '';
4455
  // translators: %s: list parameters and type
4456
- if ( $clients != '') $client_attributes_dbg = sprintf (__ ("clients='%s' type='%s'", 'ad-inserter'), $clients_raw, $client_list_type); else $client_attributes_dbg = '';
4457
 
4458
  if ($url_parameter_attributes_dbg != '' || $cookie_attributes_dbg != '' || $referer_attributes_dbg != '' || $client_attributes_dbg) {
4459
  $debug_list = new ai_block_labels ('ai-debug-lists');
@@ -4505,7 +4518,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
4505
  $this->w3tc_code .= ' if ($ai_enabled) {$ai_enabled = check_client_list (base64_decode (\''.$clients.'\'), '.($client_list_type == AI_WHITE_LIST ? 'true':'false').');'.$w3tc_status.'};';
4506
  }
4507
 
4508
- if ($this->client_side_cookie_check) {
4509
  if ($url_parameters != '') {
4510
  if ($ai_wp_data [AI_W3TC_DEBUGGING]) {
4511
  $this->w3tc_code .= ' if ($ai_enabled) ai_w3tc_log_run (\' URL PARAMETERS: \\\'\' . base64_decode (\'' . $url_parameters . '\').\'\\\' ' . ($url_parameter_list_type == AI_WHITE_LIST ? 'W':'B'). '\');';
@@ -4514,7 +4527,9 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
4514
 
4515
  $this->w3tc_code .= ' if ($ai_enabled) {$ai_enabled = check_cookie_list (base64_decode (\''.$url_parameters.'\'), '.($url_parameter_list_type == AI_WHITE_LIST ? 'true':'false').');'.$w3tc_status.'};';
4516
  }
 
4517
 
 
4518
  if ($cookies != '') {
4519
  if ($ai_wp_data [AI_W3TC_DEBUGGING]) {
4520
  $this->w3tc_code .= ' if ($ai_enabled) ai_w3tc_log_run (\' COOKIES: \\\'\' . base64_decode (\'' . $cookies . '\').\'\\\' ' . ($cookie_list_type == AI_WHITE_LIST ? 'W':'B'). '\');';
@@ -5037,6 +5052,33 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
5037
  $processed_code = $this->regenerate_w3tc_code ($processed_code);
5038
  }
5039
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5040
  }
5041
 
5042
 
@@ -9201,10 +9243,9 @@ echo '</body>
9201
  default:
9202
  $url_parameter_found = false;
9203
  $url_parameter_list_pass = check_url_parameter_list ($this->get_url_parameter_list(), $this->get_url_parameter_list_type() == AI_WHITE_LIST, $url_parameter_found);
9204
-
9205
  if ($url_parameter_found && !$url_parameter_list_pass) return false;
9206
 
9207
- if (!$url_parameter_found) $this->client_side_cookie_check = true;
9208
  break;
9209
  }
9210
 
23
  var $additional_code_before_block; // For clint-side manual insertion set to auto
24
  var $counters;
25
  var $client_side_cookie_check;
26
+ var $client_side_cookie_check_url;
27
  var $hide_debug_labels;
28
  var $demo_debugging;
29
  var $hidden_viewports;
106
  $this->additional_code_before_block = '';
107
  $this->counters = '';
108
  $this->client_side_cookie_check = false;
109
+ $this->client_side_cookie_check_url = false;
110
  $this->hide_debug_labels = false;
111
  $this->demo_debugging = false;
112
  $this->hidden_viewports = '';
706
  $this->wp_options [AI_OPTION_BLOCK_BACKGROUND_COLOR] = AD_EMPTY_DATA;
707
  $this->wp_options [AI_OPTION_LAZY_LOADING] = AI_DISABLED;
708
  $this->wp_options [AI_OPTION_WAIT_FOR_INTERACTION] = AI_DISABLED;
709
+ $this->wp_options [AI_OPTION_CHECK_RECAPTCHA_SCORE] = AI_DISABLED;
710
  $this->wp_options [AI_OPTION_PROTECTED] = AI_DISABLED;
711
  $this->wp_options [AI_OPTION_MANUAL_LOADING] = AI_MANUAL_LOADING_DISABLED;
712
  $this->wp_options [AI_OPTION_IFRAME] = AI_DISABLED;
919
  return $protected;
920
  }
921
 
922
+ public function get_check_recaptcha_score (){
923
+ $check_recaptcha_score = isset ($this->wp_options [AI_OPTION_CHECK_RECAPTCHA_SCORE]) ? $this->wp_options [AI_OPTION_CHECK_RECAPTCHA_SCORE] : AI_DISABLED;
924
+ if ($check_recaptcha_score == '') $check_recaptcha_score = AI_DISABLED;
925
+ return $check_recaptcha_score;
926
+ }
927
+
928
  public function get_manual_loading (){
929
  $manual_loading = isset ($this->wp_options [AI_OPTION_MANUAL_LOADING]) ? $this->wp_options [AI_OPTION_MANUAL_LOADING] : AI_MANUAL_LOADING_DISABLED;
930
  if ($manual_loading == '') $manual_loading = AI_MANUAL_LOADING_DISABLED;
3382
  $iframe_parameters .= '&cookie_check=1';
3383
  }
3384
 
3385
+ if ($this->client_side_cookie_check_url) {
3386
+ $iframe_parameters .= '&cookie_check_url=1';
3387
+ }
3388
+
3389
  if ($this->hide_debug_labels) {
3390
  $iframe_parameters .= '&hide-debug-labels=1';
3391
  }
4341
  $referers = base64_encode ($referers_raw);
4342
  $clients = base64_encode (html_entity_decode ($clients_raw));
4343
 
4344
+ if (($this->client_side_cookie_check_url && $url_parameters != '') || ($this->client_side_cookie_check && $cookies != '') || $referers != '' || $clients != '' || $scheduling_type !== null) {
4345
  switch ($dynamic_blocks) {
4346
  case AI_DYNAMIC_BLOCKS_CLIENT_SIDE_SHOW:
4347
  case AI_DYNAMIC_BLOCKS_CLIENT_SIDE_INSERT:
4393
  }
4394
  }
4395
 
4396
+ if ($this->client_side_cookie_check_url && $url_parameters != '') $url_parameter_attributes = " parameter-list='$url_parameters' parameter-list-type='$url_parameter_list_type'"; else $url_parameter_attributes = '';
4397
+ if ($this->client_side_cookie_check && $cookies != '') $cookie_attributes = " cookie-list='$cookies' cookie-list-type='$cookie_list_type'"; else $cookie_attributes = '';
4398
+ if ( $referers != '') $referer_attributes = " referer-list='$referers' referer-list-type='$referer_list_type'"; else $referer_attributes = '';
4399
+ if ( $clients != '') $client_attributes = " client-list='$clients' client-list-type='$client_list_type'"; else $client_attributes = '';
4400
+ if ($scheduling_type !== null ) $scheduling_attributes = " scheduling-start='$scheduling_start_time' scheduling-end='$scheduling_end_time' scheduling-days='$scheduling_days_in_week' scheduling-type='$scheduling_type_code' gmt='$gmt' scheduling-fallback='$fallback_block_data' fallback_level='$fallback_level' fallback-tracking='$fallback_tracking_data'"; else $scheduling_attributes = '';
4401
 
4402
 
4403
  // Deprecated
4460
  $processed_code = $debug_processed_code . $processed_code;
4461
  }
4462
 
4463
+ if ($this->client_side_cookie_check_url && ($url_parameters != '')) $url_parameter_attributes_dbg = sprintf (__ ("parameters='%s' type='%s'", 'ad-inserter'), $url_parameters_raw, $url_parameter_list_type); else $url_parameter_attributes_dbg = '';
4464
 
4465
+ if ($this->client_side_cookie_check && ($cookies != '')) $cookie_attributes_dbg = sprintf (__ ("cookies='%s' type='%s'", 'ad-inserter'), $cookies_raw, $cookie_list_type); else $cookie_attributes_dbg = '';
4466
  // translators: %s: list parameters and type
4467
+ if ( $referers != '') $referer_attributes_dbg = sprintf (__ ("referers='%s' type='%s'", 'ad-inserter'), $referers_raw, $referer_list_type); else $referer_attributes_dbg = '';
4468
  // translators: %s: list parameters and type
4469
+ if ( $clients != '') $client_attributes_dbg = sprintf (__ ("clients='%s' type='%s'", 'ad-inserter'), $clients_raw, $client_list_type); else $client_attributes_dbg = '';
4470
 
4471
  if ($url_parameter_attributes_dbg != '' || $cookie_attributes_dbg != '' || $referer_attributes_dbg != '' || $client_attributes_dbg) {
4472
  $debug_list = new ai_block_labels ('ai-debug-lists');
4518
  $this->w3tc_code .= ' if ($ai_enabled) {$ai_enabled = check_client_list (base64_decode (\''.$clients.'\'), '.($client_list_type == AI_WHITE_LIST ? 'true':'false').');'.$w3tc_status.'};';
4519
  }
4520
 
4521
+ if ($this->client_side_cookie_check_url) {
4522
  if ($url_parameters != '') {
4523
  if ($ai_wp_data [AI_W3TC_DEBUGGING]) {
4524
  $this->w3tc_code .= ' if ($ai_enabled) ai_w3tc_log_run (\' URL PARAMETERS: \\\'\' . base64_decode (\'' . $url_parameters . '\').\'\\\' ' . ($url_parameter_list_type == AI_WHITE_LIST ? 'W':'B'). '\');';
4527
 
4528
  $this->w3tc_code .= ' if ($ai_enabled) {$ai_enabled = check_cookie_list (base64_decode (\''.$url_parameters.'\'), '.($url_parameter_list_type == AI_WHITE_LIST ? 'true':'false').');'.$w3tc_status.'};';
4529
  }
4530
+ }
4531
 
4532
+ if ($this->client_side_cookie_check) {
4533
  if ($cookies != '') {
4534
  if ($ai_wp_data [AI_W3TC_DEBUGGING]) {
4535
  $this->w3tc_code .= ' if ($ai_enabled) ai_w3tc_log_run (\' COOKIES: \\\'\' . base64_decode (\'' . $cookies . '\').\'\\\' ' . ($cookie_list_type == AI_WHITE_LIST ? 'W':'B'). '\');';
5052
  $processed_code = $this->regenerate_w3tc_code ($processed_code);
5053
  }
5054
  }
5055
+
5056
+
5057
+ // CHECK RECAPTCHA SCORE
5058
+ if (function_exists ('get_recaptcha_site_key')) {
5059
+ if ($this->get_check_recaptcha_score () && !$ai_wp_data [AI_WP_AMP_PAGE] && trim (get_recaptcha_site_key ()) != '' && trim (get_recaptcha_secret_key ()) != '' && is_numeric (get_recaptcha_threshold ())) {
5060
+
5061
+ if ($this->w3tc_code != '') {
5062
+ if ($ai_wp_data [AI_W3TC_DEBUGGING]) {
5063
+ $this->w3tc_debug []= 'PROCESS CHECK FOR RECAPTCHA SCORE';
5064
+ }
5065
+ }
5066
+
5067
+ $manual_code = $this->base64_encode_w3tc ($processed_code);
5068
+ $wrapper_class = base64_encode (get_block_class_name (true));
5069
+ $processed_code = '<div class="ai-check-recaptcha-score ai-check-recaptcha-score-' . $this->number . '" data-code="'.$manual_code.'" data-class="'.$wrapper_class.'"></div>'."\n";
5070
+
5071
+ if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_BLOCKS) != 0 && !$this->hide_debug_labels) {
5072
+ $debug_label = new ai_block_labels ('ai-debug-script');
5073
+ $processed_code = $debug_label->bar ('reCAPTCHA score threshold = '.get_recaptcha_threshold (), '', '<span class="ai-recaptcha-result"></span>', 'reCAPTCHA score: <span class="ai-recaptcha-score"></span>') . $processed_code;
5074
+ }
5075
+
5076
+ // Recreate W3TC code
5077
+ if ($this->w3tc_code != '') {
5078
+ $processed_code = $this->regenerate_w3tc_code ($processed_code);
5079
+ }
5080
+ }
5081
+ }
5082
  }
5083
 
5084
 
9243
  default:
9244
  $url_parameter_found = false;
9245
  $url_parameter_list_pass = check_url_parameter_list ($this->get_url_parameter_list(), $this->get_url_parameter_list_type() == AI_WHITE_LIST, $url_parameter_found);
 
9246
  if ($url_parameter_found && !$url_parameter_list_pass) return false;
9247
 
9248
+ if (!$url_parameter_found) $this->client_side_cookie_check_url = true;
9249
  break;
9250
  }
9251
 
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.7.16');
35
 
36
  if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
37
  define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
@@ -77,6 +77,7 @@ define ('AI_OPTION_BLOCK_BACKGROUND_COLOR', 'block-background-color');
77
  define ('AI_OPTION_LAZY_LOADING', 'lazy_loading');
78
  define ('AI_OPTION_WAIT_FOR_INTERACTION', 'wait_for_interaction');
79
  define ('AI_OPTION_PROTECTED', 'protected');
 
80
  define ('AI_OPTION_MANUAL_LOADING', 'manual_loading');
81
  define ('AI_OPTION_IFRAME', 'iframe');
82
  define ('AI_OPTION_IFRAME_WIDTH', 'iframe_width');
@@ -970,6 +971,7 @@ define ('DEFAULT_BACKGROUND_SIZE', AI_BACKGROUND_SIZE_DEFAULT);
970
  define ('DEFAULT_SET_BODY_BACKGROUND', AI_DISABLED);
971
  define ('DEFAULT_REMOTE_MANAGEMENT', AI_DISABLED);
972
  define ('DEFAULT_MANAGEMENT_IP_CHECK', AI_DISABLED);
 
973
 
974
  define ('AI_ADBLOCKING_DETECTION', true);
975
  define ('AI_NORMAL_HEADER_STYLES', true);
31
  define ('AD_INSERTER_NAME', 'Ad Inserter');
32
 
33
  if (!defined( 'AD_INSERTER_VERSION'))
34
+ define ('AD_INSERTER_VERSION', '2.7.17');
35
 
36
  if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
37
  define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
77
  define ('AI_OPTION_LAZY_LOADING', 'lazy_loading');
78
  define ('AI_OPTION_WAIT_FOR_INTERACTION', 'wait_for_interaction');
79
  define ('AI_OPTION_PROTECTED', 'protected');
80
+ define ('AI_OPTION_CHECK_RECAPTCHA_SCORE', 'check_recaptcha_score');
81
  define ('AI_OPTION_MANUAL_LOADING', 'manual_loading');
82
  define ('AI_OPTION_IFRAME', 'iframe');
83
  define ('AI_OPTION_IFRAME_WIDTH', 'iframe_width');
971
  define ('DEFAULT_SET_BODY_BACKGROUND', AI_DISABLED);
972
  define ('DEFAULT_REMOTE_MANAGEMENT', AI_DISABLED);
973
  define ('DEFAULT_MANAGEMENT_IP_CHECK', AI_DISABLED);
974
+ define ('DEFAULT_RECAPTCHA_THRESHOLD', '0.5');
975
 
976
  define ('AI_ADBLOCKING_DETECTION', true);
977
  define ('AI_NORMAL_HEADER_STYLES', true);
css/ai-settings.css CHANGED
@@ -1,5 +1,5 @@
1
  #ai-data {
2
- font-family: "2.7.16"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
1
  #ai-data {
2
+ font-family: "2.7.17"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
js/ad-inserter.js CHANGED
@@ -1,4 +1,4 @@
1
- var javascript_version = "2.7.16"
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
1
+ var javascript_version = "2.7.17"
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
js/ad-inserter.min.js CHANGED
@@ -1,4 +1,4 @@
1
- var javascript_version="2.7.16",ignore_key=!0,start=1,end=16,active_tab=1,active_tab_0=0,tabs_to_configure=[],debug=!1,debug_title=!1,save_enabled=!0,current_tab=0,next_tab=0,syntax_highlighting=!1,settings_page="",dateFormat="yy-mm-dd",timeFormat="H:i:s",list_search_reload=!1,website_list_search_reload=!1,AI_DISABLED=0,AI_BEFORE_POST=1,AI_AFTER_POST=2,AI_BEFORE_CONTENT=3,AI_AFTER_CONTENT=4,AI_BEFORE_PARAGRAPH=5,AI_AFTER_PARAGRAPH=6,AI_BEFORE_EXCERPT=7,AI_AFTER_EXCERPT=8,AI_BETWEEN_POSTS=9,AI_BEFORE_COMMENTS=
2
  10,AI_BETWEEN_COMMENTS=11,AI_AFTER_COMMENTS=12,AI_FOOTER=13,AI_ABOVE_HEADER=14,AI_BEFORE_HTML_ELEMENT=15,AI_AFTER_HTML_ELEMENT=16,AI_INSIDE_HTML_ELEMENT=17,AI_BEFORE_IMAGE=18,AI_AFTER_IMAGE=19,AI_ALIGNMENT_DEFAULT=0,AI_ALIGNMENT_LEFT=1,AI_ALIGNMENT_RIGHT=2,AI_ALIGNMENT_CENTER=3,AI_ALIGNMENT_FLOAT_LEFT=4,AI_ALIGNMENT_FLOAT_RIGHT=5,AI_ALIGNMENT_NO_WRAPPING=6,AI_ALIGNMENT_CUSTOM_CSS=7,AI_ALIGNMENT_STICKY_LEFT=8,AI_ALIGNMENT_STICKY_RIGHT=9,AI_ALIGNMENT_STICKY_TOP=10,AI_ALIGNMENT_STICKY_BOTTOM=11,AI_ALIGNMENT_STICKY=
3
  12,AI_ADB_ACTION_NONE=0,AI_ADB_ACTION_MESSAGE=1,AI_ADB_ACTION_REDIRECTION=2,AI_ADB_BLOCK_ACTION_DO_NOTHING=0,AI_ADB_BLOCK_ACTION_REPLACE=1,AI_ADB_BLOCK_ACTION_SHOW=2,AI_ADB_BLOCK_ACTION_HIDE=3,AI_CODE_UNKNOWN=100,AI_CODE_BANNER=0,AI_CODE_ADSENSE=1,AI_CODE_AMAZON=2,AI_ADSENSE_STANDARD=0,AI_ADSENSE_LINK=1,AI_ADSENSE_IN_ARTICLE=2,AI_ADSENSE_IN_FEED=3,AI_ADSENSE_MATCHED_CONTENT=4,AI_ADSENSE_SIZE_FIXED=0,AI_ADSENSE_SIZE_RESPONSIVE=1,AI_ADSENSE_SIZE_FIXED_BY_VIEWPORT=2,AI_HTML_INSERTION_CLIENT_SIDE=0,AI_HTML_INSERTION_SEREVR_SIDE=
4
  2,AI_STICK_TO_THE_LEFT=0,AI_STICK_TO_THE_CONTENT_LEFT=1,AI_STICK_HORIZONTAL_CENTER=2,AI_STICK_TO_THE_CONTENT_RIGHT=3,AI_STICK_TO_THE_RIGHT=4,AI_STICK_TO_THE_TOP=0,AI_STICK_VERTICAL_CENTER=1,AI_SCROLL_WITH_THE_CONTENT=2,AI_STICK_TO_THE_BOTTOM=3,AI_ANIMATION_NONE=0,AI_BACKGROUND_REPEAT_DEFAULT=0,AI_BACKGROUND_REPEAT_NO=1,AI_BACKGROUND_REPEAT_YES=2,AI_BACKGROUND_REPEAT_HORIZONTALY=3,AI_BACKGROUND_REPEAT_VERTICALLY=4,AI_BACKGROUND_REPEAT_SPACE=5,AI_BACKGROUND_REPEAT_ROUND=6,AI_BACKGROUND_SIZE_DEFAULT=
1
+ var javascript_version="2.7.17",ignore_key=!0,start=1,end=16,active_tab=1,active_tab_0=0,tabs_to_configure=[],debug=!1,debug_title=!1,save_enabled=!0,current_tab=0,next_tab=0,syntax_highlighting=!1,settings_page="",dateFormat="yy-mm-dd",timeFormat="H:i:s",list_search_reload=!1,website_list_search_reload=!1,AI_DISABLED=0,AI_BEFORE_POST=1,AI_AFTER_POST=2,AI_BEFORE_CONTENT=3,AI_AFTER_CONTENT=4,AI_BEFORE_PARAGRAPH=5,AI_AFTER_PARAGRAPH=6,AI_BEFORE_EXCERPT=7,AI_AFTER_EXCERPT=8,AI_BETWEEN_POSTS=9,AI_BEFORE_COMMENTS=
2
  10,AI_BETWEEN_COMMENTS=11,AI_AFTER_COMMENTS=12,AI_FOOTER=13,AI_ABOVE_HEADER=14,AI_BEFORE_HTML_ELEMENT=15,AI_AFTER_HTML_ELEMENT=16,AI_INSIDE_HTML_ELEMENT=17,AI_BEFORE_IMAGE=18,AI_AFTER_IMAGE=19,AI_ALIGNMENT_DEFAULT=0,AI_ALIGNMENT_LEFT=1,AI_ALIGNMENT_RIGHT=2,AI_ALIGNMENT_CENTER=3,AI_ALIGNMENT_FLOAT_LEFT=4,AI_ALIGNMENT_FLOAT_RIGHT=5,AI_ALIGNMENT_NO_WRAPPING=6,AI_ALIGNMENT_CUSTOM_CSS=7,AI_ALIGNMENT_STICKY_LEFT=8,AI_ALIGNMENT_STICKY_RIGHT=9,AI_ALIGNMENT_STICKY_TOP=10,AI_ALIGNMENT_STICKY_BOTTOM=11,AI_ALIGNMENT_STICKY=
3
  12,AI_ADB_ACTION_NONE=0,AI_ADB_ACTION_MESSAGE=1,AI_ADB_ACTION_REDIRECTION=2,AI_ADB_BLOCK_ACTION_DO_NOTHING=0,AI_ADB_BLOCK_ACTION_REPLACE=1,AI_ADB_BLOCK_ACTION_SHOW=2,AI_ADB_BLOCK_ACTION_HIDE=3,AI_CODE_UNKNOWN=100,AI_CODE_BANNER=0,AI_CODE_ADSENSE=1,AI_CODE_AMAZON=2,AI_ADSENSE_STANDARD=0,AI_ADSENSE_LINK=1,AI_ADSENSE_IN_ARTICLE=2,AI_ADSENSE_IN_FEED=3,AI_ADSENSE_MATCHED_CONTENT=4,AI_ADSENSE_SIZE_FIXED=0,AI_ADSENSE_SIZE_RESPONSIVE=1,AI_ADSENSE_SIZE_FIXED_BY_VIEWPORT=2,AI_HTML_INSERTION_CLIENT_SIDE=0,AI_HTML_INSERTION_SEREVR_SIDE=
4
  2,AI_STICK_TO_THE_LEFT=0,AI_STICK_TO_THE_CONTENT_LEFT=1,AI_STICK_HORIZONTAL_CENTER=2,AI_STICK_TO_THE_CONTENT_RIGHT=3,AI_STICK_TO_THE_RIGHT=4,AI_STICK_TO_THE_TOP=0,AI_STICK_VERTICAL_CENTER=1,AI_SCROLL_WITH_THE_CONTENT=2,AI_STICK_TO_THE_BOTTOM=3,AI_ANIMATION_NONE=0,AI_BACKGROUND_REPEAT_DEFAULT=0,AI_BACKGROUND_REPEAT_NO=1,AI_BACKGROUND_REPEAT_YES=2,AI_BACKGROUND_REPEAT_HORIZONTALY=3,AI_BACKGROUND_REPEAT_VERTICALLY=4,AI_BACKGROUND_REPEAT_SPACE=5,AI_BACKGROUND_REPEAT_ROUND=6,AI_BACKGROUND_SIZE_DEFAULT=
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: ads, adsense, ad rotation, ad manager, amp, amazon, ad blocking detection,
6
  Requires at least: 4.9
7
  Tested up to: 6.0
8
  Requires PHP: 5.6
9
- Stable tag: 2.7.16
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
@@ -129,7 +129,9 @@ It's all about the [settings](https://adinserter.pro/documentation).
129
  * A/B testing - discover adverts and settings that perform best
130
  * Frequency capping - limit impressions or clicks
131
  * Click fraud protection
132
- * Lazy loading
 
 
133
  * [Sticky ads](https://adinserter.pro/documentation/sticky-ads) with optional close button
134
  * Sticky sidebar ads (stick to the screen or to the content)
135
  * Floating slide-in banner adverts
@@ -359,6 +361,11 @@ If you are not happy to reveal this information and you have opted in, simply di
359
 
360
  == Changelog ==
361
 
 
 
 
 
 
362
  = 2.7.16 =
363
  - Added support for adb redirection page with url queries
364
  - Added support for tcf-no-google shortcut
@@ -658,6 +665,11 @@ For the changelog of earlier versions, please refer to the separate changelog.tx
658
 
659
  == Upgrade Notice ==
660
 
 
 
 
 
 
661
  = 2.7.16 =
662
  Added support for adb redirection page with url queries
663
  Added support for tcf-no-google shortcut
6
  Requires at least: 4.9
7
  Tested up to: 6.0
8
  Requires PHP: 5.6
9
+ Stable tag: 2.7.17
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
129
  * A/B testing - discover adverts and settings that perform best
130
  * Frequency capping - limit impressions or clicks
131
  * Click fraud protection
132
+ * reCaptcha v3 score check to hide ads from invalid traffic
133
+ * Delayed loading of ad scripts until user interacts with the website
134
+ * Lazy loading - delayed loading of ad scripts until the page is scrolled
135
  * [Sticky ads](https://adinserter.pro/documentation/sticky-ads) with optional close button
136
  * Sticky sidebar ads (stick to the screen or to the content)
137
  * Floating slide-in banner adverts
361
 
362
  == Changelog ==
363
 
364
+ = 2.7.17 =
365
+ - Fixed bug for url parameters check
366
+ - Added support for reCaptcha v3 score check (Pro only)
367
+ - Few minor bug fixes, cosmetic changes and code improvements
368
+
369
  = 2.7.16 =
370
  - Added support for adb redirection page with url queries
371
  - Added support for tcf-no-google shortcut
665
 
666
  == Upgrade Notice ==
667
 
668
+ = 2.7.17 =
669
+ Fixed bug for url parameters check;
670
+ Added support for reCaptcha v3 score check (Pro only);
671
+ Few minor bug fixes, cosmetic changes and code improvements
672
+
673
  = 2.7.16 =
674
  Added support for adb redirection page with url queries
675
  Added support for tcf-no-google shortcut
settings.php CHANGED
@@ -672,9 +672,11 @@ function generate_settings_form (){
672
  if ($parallax_options) break;
673
  }
674
 
 
 
675
  $display_options =
676
  $obj->get_block_width () != '' || $obj->get_block_height () != '' || $obj->get_block_background_color () != '' || $obj->get_show_label () ||
677
- $obj->get_lazy_loading () || $obj->get_wait_for_interaction () || $obj->get_protected () || $obj->get_manual_loading () != AI_MANUAL_LOADING_DISABLED ||
678
  $obj->get_close_button () || $obj->get_auto_close_time () || $obj->get_stay_closed_time () ||
679
  $obj->get_delay_time () || $obj->get_delay_showing () || $obj->get_show_every () ||
680
  $obj->get_iframe () ||
@@ -2735,6 +2737,8 @@ function generate_settings_form (){
2735
  </table>
2736
  </div>
2737
 
 
 
2738
  <div class="rounded">
2739
  <table class="ai-settings-table" style="width: 100%;">
2740
  <tr>
672
  if ($parallax_options) break;
673
  }
674
 
675
+ $recaptcha_vaild = function_exists ('get_recaptcha_site_key') && trim (get_recaptcha_site_key ()) != '' && trim (get_recaptcha_secret_key ()) != '' && is_numeric (get_recaptcha_threshold ());
676
+
677
  $display_options =
678
  $obj->get_block_width () != '' || $obj->get_block_height () != '' || $obj->get_block_background_color () != '' || $obj->get_show_label () ||
679
+ $obj->get_lazy_loading () || $obj->get_wait_for_interaction () || $obj->get_protected () || ($recaptcha_vaild && $obj->get_check_recaptcha_score ()) ||$obj->get_manual_loading () != AI_MANUAL_LOADING_DISABLED ||
680
  $obj->get_close_button () || $obj->get_auto_close_time () || $obj->get_stay_closed_time () ||
681
  $obj->get_delay_time () || $obj->get_delay_showing () || $obj->get_show_every () ||
682
  $obj->get_iframe () ||
2737
  </table>
2738
  </div>
2739
 
2740
+ <?php if (function_exists ('ai_general_settings_3')) ai_general_settings_3 (); ?>
2741
+
2742
  <div class="rounded">
2743
  <table class="ai-settings-table" style="width: 100%;">
2744
  <tr>