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

Version Description

  • Added constant to disable AdSense API
  • Fix for rotation code editor
  • Fix for advaced click tracker for banners (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.19
Comparing to
See all releases

Code changes from version 2.7.18 to 2.7.19

ad-inserter.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  /*
4
  Plugin Name: Ad Inserter
5
- Version: 2.7.18
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,12 @@ Requires PHP: 5.6
17
 
18
  Change Log
19
 
 
 
 
 
 
 
20
  Ad Inserter 2.7.18 - 2022-09-01
21
  - Added support to hide ad label when unfilled AdSense block is hidden
22
  - Simplified AdSense API authorization process
@@ -1461,6 +1467,8 @@ function ai_wp_hook () {
1461
 
1462
  ai_http_header ();
1463
 
 
 
1464
  if (($ai_wp_data [AI_WP_USER] & AI_USER_ADMINISTRATOR) != 0 && get_disable_caching ()) ai_disable_caching ();
1465
 
1466
  if (($ai_wp_data [AI_WP_USER] & AI_USER_ADMINISTRATOR) != 0) {
@@ -2111,15 +2119,24 @@ function ai_wp_enqueue_scripts_hook () {
2111
 
2112
  ai_set_footer_inline_scripts ();
2113
 
 
 
 
 
2114
  if ($ai_wp_data [AI_FOOTER_INLINE_SCRIPTS] ||
2115
  ($ai_wp_data [AI_WP_DEBUGGING] & (AI_DEBUG_POSITIONS | AI_DEBUG_BLOCKS)) != 0 ||
2116
  !empty ($_GET) ||
2117
  get_remote_debugging () || ($ai_wp_data [AI_WP_USER] & AI_USER_ADMINISTRATOR) != 0 ||
2118
  $ai_wp_data [AI_ANIMATION]) {
2119
 
2120
- // Load jQuery on frontend when needed
2121
- if (!get_wait_for_jquery () && isset ($wp_scripts->registered ['jquery'])) {
2122
- wp_enqueue_script ('jquery');
 
 
 
 
 
2123
  }
2124
 
2125
  if ($ai_wp_data [AI_HTML_ELEMENT_SELECTION]) {
@@ -2127,12 +2144,6 @@ function ai_wp_enqueue_scripts_hook () {
2127
  wp_enqueue_style ('ai-html-jquery-ui', plugins_url ('css/jquery-ui-1.10.3.custom.min.css', __FILE__), array (), null);
2128
  }
2129
 
2130
- // if (!$ai_wp_data [AI_WP_AMP_PAGE]) {
2131
- // wp_enqueue_script ('ai-jquery-js', plugins_url ('includes/js/ai-jquery.js', __FILE__), $jquery_required, $wp_version . '+' . AD_INSERTER_VERSION);
2132
-
2133
- // wp_localize_script ('ai-jquery-js', 'ai_front', $ai_front_translations);
2134
- // }
2135
-
2136
  if (!get_disable_css_code () && (get_remote_debugging () || ($ai_wp_data [AI_WP_USER] & AI_USER_ADMINISTRATOR) != 0)) {
2137
  wp_enqueue_style ('dashicons');
2138
 
@@ -2340,10 +2351,18 @@ function add_head_inline_styles () {
2340
  function ai_get_js ($js_name, $replace_js_data = true) {
2341
  global $ai_wp_data;
2342
 
 
 
 
 
 
2343
  if ($ai_wp_data [AI_FRONTEND_JS_DEBUGGING]) {
2344
  $script = @file_get_contents (AD_INSERTER_PLUGIN_DIR."includes/js/$js_name.js");
2345
  } else $script = @file_get_contents (AD_INSERTER_PLUGIN_DIR."includes/js/$js_name.min.js");
2346
 
 
 
 
2347
  if (!$replace_js_data) return $script;
2348
  return ai_replace_js_data ($script);
2349
  }
@@ -2851,7 +2870,7 @@ function add_footer_inline_scripts () {
2851
  echo "<script>\n";
2852
 
2853
  $client_side_dynamic_blocks = get_dynamic_blocks () == AI_DYNAMIC_BLOCKS_CLIENT_SIDE_SHOW || get_dynamic_blocks () == AI_DYNAMIC_BLOCKS_CLIENT_SIDE_INSERT;
2854
- $wait_for_jquery = get_wait_for_jquery () && !$ai_wp_data [AI_WP_AMP_PAGE];
2855
 
2856
  ob_start ();
2857
 
@@ -3660,7 +3679,9 @@ function ai_wp_head_hook () {
3660
  $ai_wp_data [AI_WP_DEBUGGING] = $ai_wp_debugging;
3661
  } else $code_for_insertion = '';
3662
 
3663
- $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " jQuery('body').prepend (\"" . get_code_debug_block (' ' . $block_name, '', __('Code for insertion', 'ad-inserter') . ' ' . strlen ($code_for_insertion) . ' ' . _n('character', 'characters', strlen ($code_for_insertion), 'ad-inserter') . ' ', $obj->ai_getCode (), $code_for_insertion, true) . "\");
 
 
3664
  ";
3665
  }
3666
  }
@@ -3670,12 +3691,14 @@ function ai_wp_head_hook () {
3670
  }
3671
 
3672
  if (!get_disable_js_code () && ($ai_wp_data [AI_WP_DEBUGGING] & (AI_DEBUG_POSITIONS | AI_DEBUG_BLOCKS)) != 0) {
3673
- $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= ' setTimeout (function(){jQuery(\'body\').prepend ("' . get_page_type_debug_info () . '");}, 1);
 
3674
  ';
3675
  }
3676
 
3677
  if (!get_disable_header_code () && isset ($_GET ['ai-debug-code']) && !defined ('AI_DEBUGGING_DEMO')) {
3678
- $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " jQuery('body').prepend (\"" . get_code_debug_block (' ' . __('Header code', 'ad-inserter') . ' ' . ($header->get_enable_manual () ? '' : ' ' . _x('DISABLED', 'Header code', 'ad-inserter')), '&lt;head&gt;...&lt;/head&gt;', strlen ($header_code) . ' ' . _n('character inserted', 'characters inserted', strlen ($header_code), 'ad-inserter') . ' ', $header->ai_getCode (), $header_code, true) . "\");
 
3679
  ";
3680
  }
3681
  }
@@ -3687,17 +3710,20 @@ function ai_wp_head_hook () {
3687
  if (defined ('AI_ADBLOCKING_DETECTION') && AI_ADBLOCKING_DETECTION) {
3688
  // No scripts on AMP pages
3689
  if (($ai_wp_data [AI_WP_DEBUGGING] & (AI_DEBUG_AD_BLOCKING_STATUS | AI_DEBUG_POSITIONS | AI_DEBUG_BLOCKS)) != 0 && $ai_wp_data [AI_ADB_DETECTION]) {
3690
- $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " jQuery('body').prepend (\"" . get_adb_status_debug_info () . "\");
 
3691
  ";
3692
  }
3693
  }
3694
 
3695
  if (($ai_wp_data [AI_WP_DEBUGGING] & (AI_DEBUG_AD_BLOCKING_STATUS | AI_DEBUG_BLOCKS)) != 0) {
3696
- $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " jQuery('body').prepend (\"<section id='ai-iab-tcf-bar' class='".AI_DEBUG_STATUS_CLASS."' style='cursor: pointer; display: none;' title='". __('Click to delete the cookie for the consents', 'ad-inserter') ."'><span id='ai-iab-tcf-status'>IAB TCF 2.0</span></section>\");
 
3697
  ";
3698
 
3699
  if (!$ai_wp_data [AI_UNFILTERED_HTML]) {
3700
- $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " jQuery('body').prepend (\"<section class='".AI_DEBUG_STATUS_CLASS." status-error'>".__('UNFILTERED HTML DISABLED', 'ad-inserter')."</section>\");
 
3701
  ";
3702
  }
3703
  }
@@ -3795,7 +3821,10 @@ function ai_amp_head_hook () {
3795
 
3796
 
3797
  function ai_front_translations_code () {
3798
- global $ai_front_translations;
 
 
 
3799
 
3800
  $object_name = 'ai_front';
3801
  $l10n = $ai_front_translations;
@@ -3961,11 +3990,11 @@ function ai_wp_footer_hook () {
3961
  echo $javascript_text, "\n";
3962
  echo get_page_type_debug_info () , "\n";
3963
 
3964
- if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0 && isset ($_GET [AI_URL_DEBUG_PROCESSING_FE]) && $_GET [AI_URL_DEBUG_PROCESSING_FE] != 0) {
3965
- echo "\n<pre class='ai-processing-log'>\n\n";
3966
- ai_write_debug_info (true);
3967
- echo "\n</pre>\n";
3968
- }
3969
  }
3970
  }
3971
 
@@ -3988,6 +4017,16 @@ function ai_wp_footer_hook () {
3988
  }
3989
  ai_log ("FOOTER HOOK END: ". number_format (1000 * (microtime (true) - $start_time), 2)." ms\n");
3990
  }
 
 
 
 
 
 
 
 
 
 
3991
  }
3992
 
3993
  function ai_amp_footer_hook () {
@@ -4353,9 +4392,12 @@ function ai_write_debug_info ($write_processing_log = false) {
4353
  if (defined ('AI_STICKY_SETTINGS') && AI_STICKY_SETTINGS) {
4354
  echo 'MAIN CONTENT: ', get_main_content_element (), "\n";
4355
  }
 
4356
  echo 'PLUGIN PRIORITY: ', get_plugin_priority (), "\n";
4357
  echo 'TAB SETUP DELAY: ', get_tab_setup_delay (), "\n";
4358
  echo 'ADMIN DISABLE CACHING: ', get_disable_caching () ? 'ENABLED' : 'DISABLED', "\n";
 
 
4359
  echo 'WAIT FOR JQUERY: ', get_wait_for_jquery () ? 'ENABLED' : 'DISABLED', "\n";
4360
  echo 'DO NOT CACHE CONSTANTS: ', defined ('DONOTCACHEPAGE') ? 'DONOTCACHEPAGE ' : '', defined ('DONOTCACHEOBJECT') ? 'DONOTCACHEOBJECT ' : '', defined ('DONOTCACHEDB') ? 'DONOTCACHEDB ' : '', "\n";
4361
  $virtual_ads_txt = get_option (AI_ADS_TXT_NAME);
@@ -4764,6 +4806,7 @@ function ai_write_debug_info ($write_processing_log = false) {
4764
  echo 'DISALLOW_FILE_EDIT: ', defined ('DISALLOW_FILE_EDIT') && DISALLOW_FILE_EDIT ? 'SET' : "NO", "\n";
4765
  echo 'DISALLOW_FILE_MODS: ', defined ('DISALLOW_FILE_MODS') && DISALLOW_FILE_MODS ? 'SET' : "NO", "\n";
4766
  echo 'DISALLOW_UNFILTERED_HTML:', defined ('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML ? 'SET' : "NO", "\n";
 
4767
 
4768
  echo "\n";
4769
 
2
 
3
  /*
4
  Plugin Name: Ad Inserter
5
+ Version: 2.7.19
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.19 - 2022-09-16
21
+ - Added constant to disable AdSense API
22
+ - Fix for rotation code editor
23
+ - Fix for advaced click tracker for banners (Pro only)
24
+ - Few minor bug fixes, cosmetic changes and code improvements
25
+
26
  Ad Inserter 2.7.18 - 2022-09-01
27
  - Added support to hide ad label when unfilled AdSense block is hidden
28
  - Simplified AdSense API authorization process
1467
 
1468
  ai_http_header ();
1469
 
1470
+ $ai_wp_data [AI_NO_JQUERY_CODE] = defined ('AI_NO_JQUERY') || (isset ($_GET [AI_URL_DEBUG_NO_JQUERY]) && !empty ($_GET [AI_URL_DEBUG_NO_JQUERY]));
1471
+
1472
  if (($ai_wp_data [AI_WP_USER] & AI_USER_ADMINISTRATOR) != 0 && get_disable_caching ()) ai_disable_caching ();
1473
 
1474
  if (($ai_wp_data [AI_WP_USER] & AI_USER_ADMINISTRATOR) != 0) {
2119
 
2120
  ai_set_footer_inline_scripts ();
2121
 
2122
+ if (!wp_script_is ('jquery', 'registered') && !wp_script_is ('jquery', 'printed')) {
2123
+ $ai_wp_data [AI_NO_JQUERY_CODE] = true;
2124
+ }
2125
+
2126
  if ($ai_wp_data [AI_FOOTER_INLINE_SCRIPTS] ||
2127
  ($ai_wp_data [AI_WP_DEBUGGING] & (AI_DEBUG_POSITIONS | AI_DEBUG_BLOCKS)) != 0 ||
2128
  !empty ($_GET) ||
2129
  get_remote_debugging () || ($ai_wp_data [AI_WP_USER] & AI_USER_ADMINISTRATOR) != 0 ||
2130
  $ai_wp_data [AI_ANIMATION]) {
2131
 
2132
+ // Need jQuery:
2133
+ // $ai_wp_data [AI_HTML_ELEMENT_SELECTION]
2134
+
2135
+ if (!$ai_wp_data [AI_NO_JQUERY_CODE]) {
2136
+ // Load jQuery on frontend when needed
2137
+ if (!get_wait_for_jquery () && isset ($wp_scripts->registered ['jquery'])) {
2138
+ wp_enqueue_script ('jquery');
2139
+ }
2140
  }
2141
 
2142
  if ($ai_wp_data [AI_HTML_ELEMENT_SELECTION]) {
2144
  wp_enqueue_style ('ai-html-jquery-ui', plugins_url ('css/jquery-ui-1.10.3.custom.min.css', __FILE__), array (), null);
2145
  }
2146
 
 
 
 
 
 
 
2147
  if (!get_disable_css_code () && (get_remote_debugging () || ($ai_wp_data [AI_WP_USER] & AI_USER_ADMINISTRATOR) != 0)) {
2148
  wp_enqueue_style ('dashicons');
2149
 
2351
  function ai_get_js ($js_name, $replace_js_data = true) {
2352
  global $ai_wp_data;
2353
 
2354
+ $jq_js_name = $js_name . '.jq';
2355
+ if (!$ai_wp_data [AI_NO_JQUERY_CODE] && file_exists (AD_INSERTER_PLUGIN_DIR."includes/js/{$jq_js_name}.js")) {
2356
+ $js_name = $jq_js_name;
2357
+ }
2358
+
2359
  if ($ai_wp_data [AI_FRONTEND_JS_DEBUGGING]) {
2360
  $script = @file_get_contents (AD_INSERTER_PLUGIN_DIR."includes/js/$js_name.js");
2361
  } else $script = @file_get_contents (AD_INSERTER_PLUGIN_DIR."includes/js/$js_name.min.js");
2362
 
2363
+ $debug_processing = ($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0;
2364
+ if ($debug_processing) ai_log ('LOADING JS CODE: '. $js_name);
2365
+
2366
  if (!$replace_js_data) return $script;
2367
  return ai_replace_js_data ($script);
2368
  }
2870
  echo "<script>\n";
2871
 
2872
  $client_side_dynamic_blocks = get_dynamic_blocks () == AI_DYNAMIC_BLOCKS_CLIENT_SIDE_SHOW || get_dynamic_blocks () == AI_DYNAMIC_BLOCKS_CLIENT_SIDE_INSERT;
2873
+ $wait_for_jquery = get_wait_for_jquery () && !$ai_wp_data [AI_WP_AMP_PAGE] /*&& !$ai_wp_data [AI_NO_JQUERY_CODE]*/;
2874
 
2875
  ob_start ();
2876
 
3679
  $ai_wp_data [AI_WP_DEBUGGING] = $ai_wp_debugging;
3680
  } else $code_for_insertion = '';
3681
 
3682
+ // $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " jQuery('body').prepend (\"" . get_code_debug_block (' ' . $block_name, '', __('Code for insertion', 'ad-inserter') . ' ' . strlen ($code_for_insertion) . ' ' . _n('character', 'characters', strlen ($code_for_insertion), 'ad-inserter') . ' ', $obj->ai_getCode (), $code_for_insertion, true) . "\");
3683
+ $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " document.querySelector ('body').insertAdjacentHTML ('afterbegin', \"" . get_code_debug_block (' ' . $block_name, '', __('Code for insertion', 'ad-inserter') . ' ' . strlen ($code_for_insertion) . ' ' . _n('character', 'characters', strlen ($code_for_insertion), 'ad-inserter') . ' ', $obj->ai_getCode (), $code_for_insertion, true) . "\");
3684
+
3685
  ";
3686
  }
3687
  }
3691
  }
3692
 
3693
  if (!get_disable_js_code () && ($ai_wp_data [AI_WP_DEBUGGING] & (AI_DEBUG_POSITIONS | AI_DEBUG_BLOCKS)) != 0) {
3694
+ // $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= ' setTimeout (function(){jQuery(\'body\').prepend ("' . get_page_type_debug_info () . '");}, 1);
3695
+ $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= ' setTimeout (function(){document.querySelector (\'body\').insertAdjacentHTML (\'afterbegin\', "' . get_page_type_debug_info () . '");}, 1);
3696
  ';
3697
  }
3698
 
3699
  if (!get_disable_header_code () && isset ($_GET ['ai-debug-code']) && !defined ('AI_DEBUGGING_DEMO')) {
3700
+ // $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " jQuery('body').prepend (\"" . get_code_debug_block (' ' . __('Header code', 'ad-inserter') . ' ' . ($header->get_enable_manual () ? '' : ' ' . _x('DISABLED', 'Header code', 'ad-inserter')), '&lt;head&gt;...&lt;/head&gt;', strlen ($header_code) . ' ' . _n('character inserted', 'characters inserted', strlen ($header_code), 'ad-inserter') . ' ', $header->ai_getCode (), $header_code, true) . "\");
3701
+ $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " document.querySelector ('body').insertAdjacentHTML ('afterbegin', \"" . get_code_debug_block (' ' . __('Header code', 'ad-inserter') . ' ' . ($header->get_enable_manual () ? '' : ' ' . _x('DISABLED', 'Header code', 'ad-inserter')), '&lt;head&gt;...&lt;/head&gt;', strlen ($header_code) . ' ' . _n('character inserted', 'characters inserted', strlen ($header_code), 'ad-inserter') . ' ', $header->ai_getCode (), $header_code, true) . "\");
3702
  ";
3703
  }
3704
  }
3710
  if (defined ('AI_ADBLOCKING_DETECTION') && AI_ADBLOCKING_DETECTION) {
3711
  // No scripts on AMP pages
3712
  if (($ai_wp_data [AI_WP_DEBUGGING] & (AI_DEBUG_AD_BLOCKING_STATUS | AI_DEBUG_POSITIONS | AI_DEBUG_BLOCKS)) != 0 && $ai_wp_data [AI_ADB_DETECTION]) {
3713
+ // $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " jQuery('body').prepend (\"" . get_adb_status_debug_info () . "\");
3714
+ $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " document.querySelector ('body').insertAdjacentHTML ('afterbegin', \"" . get_adb_status_debug_info () . "\");
3715
  ";
3716
  }
3717
  }
3718
 
3719
  if (($ai_wp_data [AI_WP_DEBUGGING] & (AI_DEBUG_AD_BLOCKING_STATUS | AI_DEBUG_BLOCKS)) != 0) {
3720
+ // $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " jQuery('body').prepend (\"<section id='ai-iab-tcf-bar' class='".AI_DEBUG_STATUS_CLASS."' style='cursor: pointer; display: none;' title='". __('Click to delete the cookie for the consents', 'ad-inserter') ."'><span id='ai-iab-tcf-status'>IAB TCF 2.0</span></section>\");
3721
+ $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " document.querySelector ('body').insertAdjacentHTML ('afterbegin', \"<section id='ai-iab-tcf-bar' class='".AI_DEBUG_STATUS_CLASS."' style='cursor: pointer; display: none;' title='". __('Click to delete the cookie for the consents', 'ad-inserter') ."'><span id='ai-iab-tcf-status'>IAB TCF 2.0</span></section>\");
3722
  ";
3723
 
3724
  if (!$ai_wp_data [AI_UNFILTERED_HTML]) {
3725
+ // $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " jQuery('body').prepend (\"<section class='".AI_DEBUG_STATUS_CLASS." status-error'>".__('UNFILTERED HTML DISABLED', 'ad-inserter')."</section>\");
3726
+ $ai_wp_data [AI_FOOTER_JS_CODE_DOM_READY] .= " document.querySelector ('body').insertAdjacentHTML ('afterbegin', \"<section class='".AI_DEBUG_STATUS_CLASS." status-error'>".__('UNFILTERED HTML DISABLED', 'ad-inserter')."</section>\");
3727
  ";
3728
  }
3729
  }
3821
 
3822
 
3823
  function ai_front_translations_code () {
3824
+ global $ai_front_translations, $ai_wp_data;
3825
+
3826
+ // if (get_disable_js_code () || (!$ai_wp_data [AI_HTML_ELEMENT_SELECTION] && $ai_wp_data [AI_WP_DEBUGGING] == 0)) return '';
3827
+ if (!$ai_wp_data [AI_HTML_ELEMENT_SELECTION] && $ai_wp_data [AI_WP_DEBUGGING] == 0) return '';
3828
 
3829
  $object_name = 'ai_front';
3830
  $l10n = $ai_front_translations;
3990
  echo $javascript_text, "\n";
3991
  echo get_page_type_debug_info () , "\n";
3992
 
3993
+ // if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0 && isset ($_GET [AI_URL_DEBUG_PROCESSING_FE]) && $_GET [AI_URL_DEBUG_PROCESSING_FE] != 0) {
3994
+ // echo "\n<pre class='ai-processing-log'>\n\n";
3995
+ // ai_write_debug_info (true);
3996
+ // echo "\n</pre>\n";
3997
+ // }
3998
  }
3999
  }
4000
 
4017
  }
4018
  ai_log ("FOOTER HOOK END: ". number_format (1000 * (microtime (true) - $start_time), 2)." ms\n");
4019
  }
4020
+
4021
+ if (!$ai_wp_data [AI_CODE_FOR_IFRAME]) {
4022
+ if ((get_remote_debugging () || ($ai_wp_data [AI_WP_USER] & AI_USER_LOGGED_IN) != 0)) {
4023
+ if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0 && isset ($_GET [AI_URL_DEBUG_PROCESSING_FE]) && $_GET [AI_URL_DEBUG_PROCESSING_FE] != 0) {
4024
+ echo "\n<pre class='ai-processing-log'>\n\n";
4025
+ ai_write_debug_info (true);
4026
+ echo "\n</pre>\n";
4027
+ }
4028
+ }
4029
+ }
4030
  }
4031
 
4032
  function ai_amp_footer_hook () {
4392
  if (defined ('AI_STICKY_SETTINGS') && AI_STICKY_SETTINGS) {
4393
  echo 'MAIN CONTENT: ', get_main_content_element (), "\n";
4394
  }
4395
+
4396
  echo 'PLUGIN PRIORITY: ', get_plugin_priority (), "\n";
4397
  echo 'TAB SETUP DELAY: ', get_tab_setup_delay (), "\n";
4398
  echo 'ADMIN DISABLE CACHING: ', get_disable_caching () ? 'ENABLED' : 'DISABLED', "\n";
4399
+ echo 'AI_NO_JQUERY: ', defined ('AI_NO_JQUERY') ? 'DEFINED' : 'NOT DEFINED', "\n";
4400
+ echo 'AI_NO_JQUERY_CODE: ', $ai_wp_data [AI_NO_JQUERY_CODE] ? 'TRUE' : 'FALSE', "\n";
4401
  echo 'WAIT FOR JQUERY: ', get_wait_for_jquery () ? 'ENABLED' : 'DISABLED', "\n";
4402
  echo 'DO NOT CACHE CONSTANTS: ', defined ('DONOTCACHEPAGE') ? 'DONOTCACHEPAGE ' : '', defined ('DONOTCACHEOBJECT') ? 'DONOTCACHEOBJECT ' : '', defined ('DONOTCACHEDB') ? 'DONOTCACHEDB ' : '', "\n";
4403
  $virtual_ads_txt = get_option (AI_ADS_TXT_NAME);
4806
  echo 'DISALLOW_FILE_EDIT: ', defined ('DISALLOW_FILE_EDIT') && DISALLOW_FILE_EDIT ? 'SET' : "NO", "\n";
4807
  echo 'DISALLOW_FILE_MODS: ', defined ('DISALLOW_FILE_MODS') && DISALLOW_FILE_MODS ? 'SET' : "NO", "\n";
4808
  echo 'DISALLOW_UNFILTERED_HTML:', defined ('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML ? 'SET' : "NO", "\n";
4809
+ echo 'AI_NO_ADSENSE_API: ', defined ('AI_NO_ADSENSE_API') ? 'SET' : "NO", "\n";
4810
 
4811
  echo "\n";
4812
 
class.php CHANGED
@@ -3318,8 +3318,10 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
3318
  switch (get_dynamic_blocks ()) {
3319
  case AI_DYNAMIC_BLOCKS_CLIENT_SIDE_SHOW:
3320
  case AI_DYNAMIC_BLOCKS_CLIENT_SIDE_INSERT:
3321
- case AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC:
3322
- $check_client_side_limits = $this->get_max_impressions () || $this->get_max_clicks ();
 
 
3323
  break;
3324
  default:
3325
  $check_client_side_limits = false;
@@ -5759,8 +5761,10 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
5759
  <head>
5760
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5761
  ';
5762
- echo "<script type='text/javascript' src='", includes_url ('js/jquery/jquery.js'), "?ver=", $jquery_version, "'></script>\n";
5763
- echo "<script type='text/javascript' src='", includes_url ('js/jquery/jquery-migrate.min.js'), "?ver=", $jquery_migrate_version, "'></script>\n";
 
 
5764
 
5765
  ai_wp_head_hook ();
5766
  echo '<style>
3318
  switch (get_dynamic_blocks ()) {
3319
  case AI_DYNAMIC_BLOCKS_CLIENT_SIDE_SHOW:
3320
  case AI_DYNAMIC_BLOCKS_CLIENT_SIDE_INSERT:
3321
+ // case AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC: // ?
3322
+ $check_client_side_limits =
3323
+ $this->get_max_impressions () || ($this->get_limit_impressions_per_time_period () && $this->get_limit_impressions_time_period ()) ||
3324
+ $this->get_max_clicks () || ($this->get_limit_clicks_per_time_period () && $this->get_limit_clicks_time_period ());
3325
  break;
3326
  default:
3327
  $check_client_side_limits = false;
5761
  <head>
5762
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5763
  ';
5764
+ if (!defined ('AI_NO_JQUERY')) {
5765
+ echo "<script type='text/javascript' src='", includes_url ('js/jquery/jquery.js'), "?ver=", $jquery_version, "'></script>\n";
5766
+ echo "<script type='text/javascript' src='", includes_url ('js/jquery/jquery-migrate.min.js'), "?ver=", $jquery_migrate_version, "'></script>\n";
5767
+ }
5768
 
5769
  ai_wp_head_hook ();
5770
  echo '<style>
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.18');
35
 
36
  if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
37
  define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
@@ -978,7 +978,7 @@ define ('AI_NORMAL_HEADER_STYLES', true);
978
  define ('AI_AMP_HEADER_STYLES', true);
979
  define ('AI_CODE_GENERATOR', true);
980
  define ('AI_BUFFERING', true);
981
- if (version_compare (phpversion (), "5.6", ">=")) {
982
  define ('AI_ADSENSE_API', true);
983
  }
984
  define ('AI_ADSENSE_OVERLAY', true);
@@ -1207,8 +1207,7 @@ define ('AI_PARALLAX', 77);
1207
  define ('AI_PHP_PROCESSING', 78);
1208
  define ('AI_UNFILTERED_HTML', 79);
1209
  define ('AI_ACTIVE_GROUP_NAMES', 80);
1210
-
1211
-
1212
 
1213
 
1214
  define ('AI_CONTEXT_NONE', 0);
@@ -1254,6 +1253,7 @@ define ('AI_URL_DEBUG_DISABLE_PHP_PROCESSING', 'ai-debug-disable-php-processin
1254
  define ('AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS', 'ai-debug-disable-block-insertions');
1255
  define ('AI_URL_DEBUG_DISABLE_HEADER_CODE', 'ai-debug-disable-header-code');
1256
  define ('AI_URL_DEBUG_DISABLE_FOOTER_CODE', 'ai-debug-disable-footer-code');
 
1257
 
1258
  define ('AI_DEBUG_PROCESSING', 0x01); // AI_DEBUG_PROCESSING_
1259
  define ('AI_DEBUG_BLOCKS', 0x02);
31
  define ('AD_INSERTER_NAME', 'Ad Inserter');
32
 
33
  if (!defined( 'AD_INSERTER_VERSION'))
34
+ define ('AD_INSERTER_VERSION', '2.7.19');
35
 
36
  if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
37
  define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
978
  define ('AI_AMP_HEADER_STYLES', true);
979
  define ('AI_CODE_GENERATOR', true);
980
  define ('AI_BUFFERING', true);
981
+ if (version_compare (phpversion (), "5.6", ">=") && !defined ('AI_NO_ADSENSE_API')) {
982
  define ('AI_ADSENSE_API', true);
983
  }
984
  define ('AI_ADSENSE_OVERLAY', true);
1207
  define ('AI_PHP_PROCESSING', 78);
1208
  define ('AI_UNFILTERED_HTML', 79);
1209
  define ('AI_ACTIVE_GROUP_NAMES', 80);
1210
+ define ('AI_NO_JQUERY_CODE', 81);
 
1211
 
1212
 
1213
  define ('AI_CONTEXT_NONE', 0);
1253
  define ('AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS', 'ai-debug-disable-block-insertions');
1254
  define ('AI_URL_DEBUG_DISABLE_HEADER_CODE', 'ai-debug-disable-header-code');
1255
  define ('AI_URL_DEBUG_DISABLE_FOOTER_CODE', 'ai-debug-disable-footer-code');
1256
+ define ('AI_URL_DEBUG_NO_JQUERY', 'ai-debug-no-jquery');
1257
 
1258
  define ('AI_DEBUG_PROCESSING', 0x01); // AI_DEBUG_PROCESSING_
1259
  define ('AI_DEBUG_BLOCKS', 0x02);
css/ai-settings.css CHANGED
@@ -1,5 +1,5 @@
1
  #ai-data {
2
- font-family: "2.7.18"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
1
  #ai-data {
2
+ font-family: "2.7.19"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
images/1AInIn200x250.jpg ADDED
Binary file
images/1AInIn728x90.jpg ADDED
Binary file
images/1GAdXFP200x250.jpg ADDED
Binary file
images/1GAdXFP728x90.jpg ADDED
Binary file
images/2AInIn200x250.jpg ADDED
Binary file
images/2GAdXFP728x90.jpg ADDED
Binary file
includes/js/ai-ads.jq.js ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var adsense_ad_names = [];
2
+ var ai_preview_window = typeof ai_preview !== 'undefined';
3
+
4
+ function ai_process_adsense_ad (element) {
5
+ var ai_debug = typeof ai_debugging !== 'undefined'; // 1
6
+ // var ai_debug = false;
7
+
8
+ var adsense_container = jQuery(element);
9
+ var adsense_width = adsense_container.attr ('width');
10
+ var adsense_height = adsense_container.attr ('height');
11
+
12
+ // var adsense_iframe2 = adsense_container.contents().find ('iframe[allowtransparency]');
13
+ // var url_parameters = getAllUrlParams (adsense_iframe2.attr ('src'))
14
+ var url_parameters = getAllUrlParams (adsense_container.attr ('src'))
15
+
16
+ if (typeof url_parameters ['client'] !== 'undefined') {
17
+ var adsense_ad_client = url_parameters ['client'];
18
+ var adsense_publisher_id = adsense_ad_client.replace ('ca-', '');
19
+ var adsense_ad_slot = url_parameters ['slotname'];
20
+ var adsense_index = url_parameters ['ifi'];
21
+
22
+ if (ai_debug) console.log ('AI ADSENSE', adsense_index, adsense_ad_client, adsense_ad_slot, url_parameters ['format'], url_parameters ['w'], url_parameters ['h']);
23
+
24
+ var adsense_overlay = jQuery('<div class="ai-debug-ad-overlay"></div>');
25
+
26
+ var adsense_ad_info = '';
27
+ if (typeof adsense_ad_slot !== 'undefined') {
28
+ var adsense_ad_name = '';
29
+ if (typeof adsense_ad_names ['publisher_id'] !== 'undefined' &&
30
+ adsense_ad_names ['publisher_id'] == adsense_publisher_id &&
31
+ typeof adsense_ad_names [adsense_ad_slot] !== 'undefined') {
32
+ adsense_ad_name = '<div class="ai-info ai-info-2">' + adsense_ad_names [adsense_ad_slot] + '</div>';
33
+ }
34
+ adsense_ad_info = '<div class="ai-info ai-info-1">' + adsense_ad_slot + '</div>' + adsense_ad_name;
35
+ } else {
36
+ var adsense_auto_ads = adsense_container.closest ('div.google-auto-placed').length != 0;
37
+ if (adsense_auto_ads) {
38
+ adsense_overlay.addClass ('ai-auto-ads');
39
+ adsense_ad_info = '<div class="ai-info ai-info-1">Auto ads</div>';
40
+ } else adsense_overlay.addClass ('ai-no-slot');
41
+ }
42
+
43
+ var adsense_info = jQuery('<div class="ai-debug-ad-info"><div class="ai-info ai-info-1">AdSense #' + adsense_index + '</div><div class="ai-info ai-info-2">' + adsense_width + 'x' + adsense_height + '</div>' + adsense_ad_info + '</div>');
44
+
45
+ adsense_container.after (adsense_info);
46
+
47
+ if (!ai_preview_window) {
48
+ adsense_container.after (adsense_overlay);
49
+ }
50
+ }
51
+ }
52
+
53
+ function ai_process_adsense_ads () {
54
+ // jQuery('ins ins iframe').each (function () {
55
+ jQuery('ins > ins > iframe[src*="google"]:visible').each (function () {
56
+ // var dummy_container = jQuery (this).closest ('.ai-dummy-ad');
57
+ // if (!dummy_container.length) ai_process_adsense_ad (this);
58
+ // if (!dummy_container.length)
59
+ ai_process_adsense_ad (this);
60
+ });
61
+ }
62
+
63
+ jQuery(document).ready(function($) {
64
+ var ai_debug = typeof ai_debugging !== 'undefined'; // 2
65
+ // var ai_debug = false;
66
+
67
+ var ajaxurl = 'AI_AJAXURL';
68
+ var nonce = 'AI_NONCE';
69
+ var adsense_data = {'ai': 1}; // dummy
70
+
71
+ $.post (ajaxurl, {'action': 'ai_ajax', 'ai_check': nonce, 'adsense-ad-units': adsense_data}
72
+ ).done (function (data) {
73
+ if (data != '') {
74
+ try {
75
+ adsense_ad_names = JSON.parse (data);
76
+
77
+ if (ai_debug) console.log ('');
78
+ if (ai_debug) console.log ("AI ADSENSE DATA:", Object.keys (adsense_ad_names).length - 1, 'ad units');
79
+
80
+ } catch (error) {
81
+ if (ai_debug) console.log ("AI ADSENSE DATA ERROR:", data);
82
+ }
83
+ }
84
+ }).fail (function (xhr, status, error) {
85
+ if (ai_debug) console.log ("AI ADSENSE DATA ERROR:", xhr.status, xhr.statusText);
86
+ }).always (function (data) {
87
+ if (ai_debug) console.log ('AI ADSENSE DATA', 'END');
88
+ });
89
+
90
+ // $(window).on ('load', function () {
91
+ // if (!ai_preview_window) setTimeout (function() {ai_process_adsense_ads (jQuery);}, 500);
92
+ // });
93
+ });
94
+
95
+ if (!ai_preview_window) {
96
+ const targetNode = document.querySelector ('body');
97
+ const config = {attributes: false, childList: true, subtree: true};
98
+ const ai_process_adsense_callback = function (mutationsList, observer) {
99
+ // Use traditional 'for loops' for IE 11
100
+ for (const mutation of mutationsList) {
101
+ if (mutation.type === 'childList' &&
102
+ mutation.addedNodes.length &&
103
+ mutation.addedNodes [0].tagName == 'IFRAME' &&
104
+ mutation.addedNodes [0].getAttribute ('width') != null &&
105
+ mutation.addedNodes [0].getAttribute ('height') != null &&
106
+ !!mutation.addedNodes [0].closest ('.adsbygoogle')) {
107
+ ai_process_adsense_ad (mutation.addedNodes [0]);
108
+ }
109
+ }
110
+ };
111
+
112
+ const observer = new MutationObserver (ai_process_adsense_callback);
113
+ observer.observe (targetNode, config);
114
+ }
115
+
116
+
117
+ function getAllUrlParams (url) {
118
+
119
+ // get query string from url (optional) or window
120
+ var queryString = url ? url.split('?')[1] : window.location.search.slice(1);
121
+
122
+ // we'll store the parameters here
123
+ var obj = {};
124
+
125
+ // if query string exists
126
+ if (queryString) {
127
+
128
+ // stuff after # is not part of query string, so get rid of it
129
+ queryString = queryString.split('#')[0];
130
+
131
+ // split our query string into its component parts
132
+ var arr = queryString.split('&');
133
+
134
+ for (var i=0; i<arr.length; i++) {
135
+ // separate the keys and the values
136
+ var a = arr[i].split('=');
137
+
138
+ // in case params look like: list[]=thing1&list[]=thing2
139
+ var paramNum = undefined;
140
+ var paramName = a[0].replace(/\[\d*\]/, function(v) {
141
+ paramNum = v.slice(1,-1);
142
+ return '';
143
+ });
144
+
145
+ // set parameter value (use 'true' if empty)
146
+ // var paramValue = typeof(a[1])==='undefined' ? true : a[1];
147
+ var paramValue = typeof(a[1])==='undefined' ? '' : a[1];
148
+
149
+ // (optional) keep case consistent
150
+ paramName = paramName.toLowerCase();
151
+ paramValue = paramValue.toLowerCase();
152
+
153
+ // if parameter name already exists
154
+ if (obj[paramName]) {
155
+ // convert value to array (if still string)
156
+ if (typeof obj[paramName] === 'string') {
157
+ obj[paramName] = [obj[paramName]];
158
+ }
159
+ // if no array index number specified...
160
+ if (typeof paramNum === 'undefined') {
161
+ // put the value on the end of the array
162
+ obj[paramName].push(paramValue);
163
+ }
164
+ // if array index number specified...
165
+ else {
166
+ // put the value at that index number
167
+ obj[paramName][paramNum] = paramValue;
168
+ }
169
+ }
170
+ // if param name doesn't exist yet, set it
171
+ else {
172
+ obj[paramName] = paramValue;
173
+ }
174
+ }
175
+ }
176
+
177
+ return obj;
178
+ }
179
+
includes/js/ai-ads.jq.min.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var c=0;return function(){return c<a.length?{done:!1,value:a[c++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var c="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return c?c.call(a):$jscomp.arrayIterator(a)};var adsense_ad_names=[],ai_preview_window="undefined"!==typeof ai_preview;
2
+ function ai_process_adsense_ad(a){a=jQuery(a);var c=a.attr("width"),e=a.attr("height"),b=getAllUrlParams(a.attr("src"));if("undefined"!==typeof b.client){var g=b.client.replace("ca-",""),d=b.slotname,h=b.ifi;b=jQuery('<div class="ai-debug-ad-overlay"></div>');var f="";"undefined"!==typeof d?(f="","undefined"!==typeof adsense_ad_names.publisher_id&&adsense_ad_names.publisher_id==g&&"undefined"!==typeof adsense_ad_names[d]&&(f='<div class="ai-info ai-info-2">'+adsense_ad_names[d]+"</div>"),f='<div class="ai-info ai-info-1">'+
3
+ d+"</div>"+f):0!=a.closest("div.google-auto-placed").length?(b.addClass("ai-auto-ads"),f='<div class="ai-info ai-info-1">Auto ads</div>'):b.addClass("ai-no-slot");c=jQuery('<div class="ai-debug-ad-info"><div class="ai-info ai-info-1">AdSense #'+h+'</div><div class="ai-info ai-info-2">'+c+"x"+e+"</div>"+f+"</div>");a.after(c);ai_preview_window||a.after(b)}}function ai_process_adsense_ads(){jQuery('ins > ins > iframe[src*="google"]:visible').each(function(){ai_process_adsense_ad(this)})}
4
+ jQuery(document).ready(function(a){a.post("AI_AJAXURL",{action:"ai_ajax",ai_check:"AI_NONCE","adsense-ad-units":{ai:1}}).done(function(c){if(""!=c)try{adsense_ad_names=JSON.parse(c)}catch(e){}}).fail(function(c,e,b){}).always(function(c){})});
5
+ if(!ai_preview_window){var targetNode=document.querySelector("body"),config={attributes:!1,childList:!0,subtree:!0},ai_process_adsense_callback=function(a,c){for(var e=$jscomp.makeIterator(a),b=e.next();!b.done;b=e.next())b=b.value,"childList"===b.type&&b.addedNodes.length&&"IFRAME"==b.addedNodes[0].tagName&&null!=b.addedNodes[0].getAttribute("width")&&null!=b.addedNodes[0].getAttribute("height")&&b.addedNodes[0].closest(".adsbygoogle")&&ai_process_adsense_ad(b.addedNodes[0])},observer=new MutationObserver(ai_process_adsense_callback);
6
+ observer.observe(targetNode,config)}function getAllUrlParams(a){var c=a?a.split("?")[1]:window.location.search.slice(1);a={};if(c){c=c.split("#")[0];c=c.split("&");for(var e=0;e<c.length;e++){var b=c[e].split("="),g=void 0,d=b[0].replace(/\[\d*\]/,function(h){g=h.slice(1,-1);return""});b="undefined"===typeof b[1]?"":b[1];d=d.toLowerCase();b=b.toLowerCase();a[d]?("string"===typeof a[d]&&(a[d]=[a[d]]),"undefined"===typeof g?a[d].push(b):a[d][g]=b):a[d]=b}}return a};
includes/js/ai-ads.js CHANGED
@@ -2,16 +2,20 @@ var adsense_ad_names = [];
2
  var ai_preview_window = typeof ai_preview !== 'undefined';
3
 
4
  function ai_process_adsense_ad (element) {
5
- var ai_debug = typeof ai_debugging !== 'undefined'; // 1
6
- // var ai_debug = false;
7
 
8
- var adsense_container = jQuery(element);
9
- var adsense_width = adsense_container.attr ('width');
10
- var adsense_height = adsense_container.attr ('height');
 
 
 
11
 
12
  // var adsense_iframe2 = adsense_container.contents().find ('iframe[allowtransparency]');
13
  // var url_parameters = getAllUrlParams (adsense_iframe2.attr ('src'))
14
- var url_parameters = getAllUrlParams (adsense_container.attr ('src'))
 
15
 
16
  if (typeof url_parameters ['client'] !== 'undefined') {
17
  var adsense_ad_client = url_parameters ['client'];
@@ -21,7 +25,8 @@ function ai_process_adsense_ad (element) {
21
 
22
  if (ai_debug) console.log ('AI ADSENSE', adsense_index, adsense_ad_client, adsense_ad_slot, url_parameters ['format'], url_parameters ['w'], url_parameters ['h']);
23
 
24
- var adsense_overlay = jQuery('<div class="ai-debug-ad-overlay"></div>');
 
25
 
26
  var adsense_ad_info = '';
27
  if (typeof adsense_ad_slot !== 'undefined') {
@@ -35,62 +40,115 @@ function ai_process_adsense_ad (element) {
35
  } else {
36
  var adsense_auto_ads = adsense_container.closest ('div.google-auto-placed').length != 0;
37
  if (adsense_auto_ads) {
38
- adsense_overlay.addClass ('ai-auto-ads');
 
 
39
  adsense_ad_info = '<div class="ai-info ai-info-1">Auto ads</div>';
40
- } else adsense_overlay.addClass ('ai-no-slot');
 
41
  }
42
 
43
- var adsense_info = jQuery('<div class="ai-debug-ad-info"><div class="ai-info ai-info-1">AdSense #' + adsense_index + '</div><div class="ai-info ai-info-2">' + adsense_width + 'x' + adsense_height + '</div>' + adsense_ad_info + '</div>');
 
 
 
44
 
45
- adsense_container.after (adsense_info);
 
46
 
47
  if (!ai_preview_window) {
48
- adsense_container.after (adsense_overlay);
 
49
  }
50
  }
51
  }
52
 
53
  function ai_process_adsense_ads () {
54
- // jQuery('ins ins iframe').each (function () {
55
- jQuery('ins > ins > iframe[src*="google"]:visible').each (function () {
56
- // var dummy_container = jQuery (this).closest ('.ai-dummy-ad');
57
- // if (!dummy_container.length) ai_process_adsense_ad (this);
58
- // if (!dummy_container.length)
59
- ai_process_adsense_ad (this);
60
  });
61
  }
62
 
63
- jQuery(document).ready(function($) {
64
- var ai_debug = typeof ai_debugging !== 'undefined'; // 2
65
- // var ai_debug = false;
 
 
 
66
 
67
  var ajaxurl = 'AI_AJAXURL';
68
  var nonce = 'AI_NONCE';
69
- var adsense_data = {'ai': 1}; // dummy
70
 
71
- $.post (ajaxurl, {'action': 'ai_ajax', 'ai_check': nonce, 'adsense-ad-units': adsense_data}
72
- ).done (function (data) {
73
- if (data != '') {
74
- try {
75
- adsense_ad_names = JSON.parse (data);
76
 
77
- if (ai_debug) console.log ('');
78
- if (ai_debug) console.log ("AI ADSENSE DATA:", Object.keys (adsense_ad_names).length - 1, 'ad units');
 
 
 
79
 
80
- } catch (error) {
81
- if (ai_debug) console.log ("AI ADSENSE DATA ERROR:", data);
82
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  }
84
- }).fail (function (xhr, status, error) {
85
- if (ai_debug) console.log ("AI ADSENSE DATA ERROR:", xhr.status, xhr.statusText);
86
- }).always (function (data) {
87
- if (ai_debug) console.log ('AI ADSENSE DATA', 'END');
 
 
88
  });
89
 
90
  // $(window).on ('load', function () {
91
  // if (!ai_preview_window) setTimeout (function() {ai_process_adsense_ads (jQuery);}, 500);
92
  // });
93
- });
 
 
 
 
 
 
 
 
 
 
 
94
 
95
  if (!ai_preview_window) {
96
  const targetNode = document.querySelector ('body');
2
  var ai_preview_window = typeof ai_preview !== 'undefined';
3
 
4
  function ai_process_adsense_ad (element) {
5
+ // var ai_debug = typeof ai_debugging !== 'undefined'; // 1
6
+ var ai_debug = false;
7
 
8
+ // var adsense_container = jQuery(element);
9
+ var adsense_container = element;
10
+ // var adsense_width = adsense_container.attr ('width');
11
+ var adsense_width = adsense_container.getAttribute ('width');
12
+ // var adsense_height = adsense_container.attr ('height');
13
+ var adsense_height = adsense_container.getAttribute ('height');
14
 
15
  // var adsense_iframe2 = adsense_container.contents().find ('iframe[allowtransparency]');
16
  // var url_parameters = getAllUrlParams (adsense_iframe2.attr ('src'))
17
+ // var url_parameters = getAllUrlParams (adsense_container.attr ('src'))
18
+ var url_parameters = getAllUrlParams (adsense_container.getAttribute ('src'))
19
 
20
  if (typeof url_parameters ['client'] !== 'undefined') {
21
  var adsense_ad_client = url_parameters ['client'];
25
 
26
  if (ai_debug) console.log ('AI ADSENSE', adsense_index, adsense_ad_client, adsense_ad_slot, url_parameters ['format'], url_parameters ['w'], url_parameters ['h']);
27
 
28
+ // var adsense_overlay = jQuery('<div class="ai-debug-ad-overlay"></div>');
29
+ var adsense_overlay_class = 'ai-debug-ad-overlay';
30
 
31
  var adsense_ad_info = '';
32
  if (typeof adsense_ad_slot !== 'undefined') {
40
  } else {
41
  var adsense_auto_ads = adsense_container.closest ('div.google-auto-placed').length != 0;
42
  if (adsense_auto_ads) {
43
+ // adsense_overlay.addClass ('ai-auto-ads');
44
+ adsense_overlay_class += ' ai-auto-ads';
45
+
46
  adsense_ad_info = '<div class="ai-info ai-info-1">Auto ads</div>';
47
+ // } else adsense_overlay.addClass ('ai-no-slot');
48
+ } else adsense_overlay_class += ' ai-no-slot';
49
  }
50
 
51
+ var adsense_overlay = '<div class="' + adsense_overlay_class + '"></div>';
52
+
53
+ // var adsense_info = jQuery('<div class="ai-debug-ad-info"><div class="ai-info ai-info-1">AdSense #' + adsense_index + '</div><div class="ai-info ai-info-2">' + adsense_width + 'x' + adsense_height + '</div>' + adsense_ad_info + '</div>');
54
+ var adsense_info = '<div class="ai-debug-ad-info"><div class="ai-info ai-info-1">AdSense #' + adsense_index + '</div><div class="ai-info ai-info-2">' + adsense_width + 'x' + adsense_height + '</div>' + adsense_ad_info + '</div>';
55
 
56
+ // adsense_container.after (adsense_info);
57
+ adsense_container.insertAdjacentHTML ('afterend', adsense_info);
58
 
59
  if (!ai_preview_window) {
60
+ // adsense_container.after (adsense_overlay);
61
+ adsense_container.insertAdjacentHTML ('afterend', adsense_overlay);
62
  }
63
  }
64
  }
65
 
66
  function ai_process_adsense_ads () {
67
+ // jQuery('ins > ins > iframe[src*="google"]:visible').each (function () {
68
+ document.querySelectorAll ('ins > ins > iframe[src*="google"]').forEach ((el, index) => {
69
+ if (!!(el.offsetWidth || el.offsetHeight || el.getClientRects ().length)) {
70
+ // ai_process_adsense_ad (this);
71
+ ai_process_adsense_ad (el);
72
+ }
73
  });
74
  }
75
 
76
+
77
+ //jQuery(document).ready(function($) {
78
+ function ai_load_adsense_ad_units () {
79
+
80
+ // var ai_debug = typeof ai_debugging !== 'undefined'; // 2
81
+ var ai_debug = false;
82
 
83
  var ajaxurl = 'AI_AJAXURL';
84
  var nonce = 'AI_NONCE';
85
+ // var adsense_data = {'ai': 1}; // dummy
86
 
87
+ // $.post (ajaxurl, {'action': 'ai_ajax', 'ai_check': nonce, 'adsense-ad-units': adsense_data}
88
+ // ).done (function (data) {
 
 
 
89
 
90
+ var data = {
91
+ 'action': "ai_ajax",
92
+ 'ai_check': nonce,
93
+ 'adsense-ad-units[ai]': 1
94
+ };
95
 
96
+ var formBody = [];
97
+ for (var property in data) {
98
+ var encodedKey = encodeURIComponent (property);
99
+ var encodedValue = encodeURIComponent (data [property]);
100
+ formBody.push (encodedKey + "=" + encodedValue);
101
+ }
102
+ formBody = formBody.join ("&");
103
+
104
+ async function ai_load_adsense () {
105
+ const response = await fetch (ajaxurl, {
106
+ method: 'POST',
107
+ headers: {
108
+ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
109
+ },
110
+ body: formBody
111
+ });
112
+
113
+ const text = await response.text ();
114
+
115
+ return text;
116
+ }
117
+
118
+ ai_load_adsense ().then (data => {
119
+ if (data != '') {
120
+ try {
121
+ adsense_ad_names = JSON.parse (data);
122
+
123
+ if (ai_debug) console.log ('');
124
+ if (ai_debug) console.log ("AI ADSENSE DATA:", Object.keys (adsense_ad_names).length - 1, 'ad units');
125
+
126
+ } catch (error) {
127
+ if (ai_debug) console.log ("AI ADSENSE DATA ERROR:", data);
128
  }
129
+ }
130
+ if (ai_debug) console.log ('AI ADSENSE DATA', 'END');
131
+ // }).fail (function (xhr, status, error) {
132
+ }).catch ((error) => {
133
+ if (ai_debug) console.log ("AI ADSENSE DATA ERROR:", error.status, error.statusText);
134
+ // }).always (function (data) {
135
  });
136
 
137
  // $(window).on ('load', function () {
138
  // if (!ai_preview_window) setTimeout (function() {ai_process_adsense_ads (jQuery);}, 500);
139
  // });
140
+ //});
141
+ }
142
+
143
+ function ai_ready (fn) {
144
+ if (document.readyState === 'complete' || (document.readyState !== 'loading' && !document.documentElement.doScroll)) {
145
+ fn ();
146
+ } else {
147
+ document.addEventListener ('DOMContentLoaded', fn);
148
+ }
149
+ }
150
+
151
+ ai_ready (ai_load_adsense_ad_units);
152
 
153
  if (!ai_preview_window) {
154
  const targetNode = document.querySelector ('body');
includes/js/ai-ads.min.js CHANGED
@@ -1,6 +1 @@
1
- var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var c=0;return function(){return c<a.length?{done:!1,value:a[c++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var c="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return c?c.call(a):$jscomp.arrayIterator(a)};var adsense_ad_names=[],ai_preview_window="undefined"!==typeof ai_preview;
2
- function ai_process_adsense_ad(a){a=jQuery(a);var c=a.attr("width"),e=a.attr("height"),b=getAllUrlParams(a.attr("src"));if("undefined"!==typeof b.client){var g=b.client.replace("ca-",""),d=b.slotname,h=b.ifi;b=jQuery('<div class="ai-debug-ad-overlay"></div>');var f="";"undefined"!==typeof d?(f="","undefined"!==typeof adsense_ad_names.publisher_id&&adsense_ad_names.publisher_id==g&&"undefined"!==typeof adsense_ad_names[d]&&(f='<div class="ai-info ai-info-2">'+adsense_ad_names[d]+"</div>"),f='<div class="ai-info ai-info-1">'+
3
- d+"</div>"+f):0!=a.closest("div.google-auto-placed").length?(b.addClass("ai-auto-ads"),f='<div class="ai-info ai-info-1">Auto ads</div>'):b.addClass("ai-no-slot");c=jQuery('<div class="ai-debug-ad-info"><div class="ai-info ai-info-1">AdSense #'+h+'</div><div class="ai-info ai-info-2">'+c+"x"+e+"</div>"+f+"</div>");a.after(c);ai_preview_window||a.after(b)}}function ai_process_adsense_ads(){jQuery('ins > ins > iframe[src*="google"]:visible').each(function(){ai_process_adsense_ad(this)})}
4
- jQuery(document).ready(function(a){a.post("AI_AJAXURL",{action:"ai_ajax",ai_check:"AI_NONCE","adsense-ad-units":{ai:1}}).done(function(c){if(""!=c)try{adsense_ad_names=JSON.parse(c)}catch(e){}}).fail(function(c,e,b){}).always(function(c){})});
5
- if(!ai_preview_window){var targetNode=document.querySelector("body"),config={attributes:!1,childList:!0,subtree:!0},ai_process_adsense_callback=function(a,c){for(var e=$jscomp.makeIterator(a),b=e.next();!b.done;b=e.next())b=b.value,"childList"===b.type&&b.addedNodes.length&&"IFRAME"==b.addedNodes[0].tagName&&null!=b.addedNodes[0].getAttribute("width")&&null!=b.addedNodes[0].getAttribute("height")&&b.addedNodes[0].closest(".adsbygoogle")&&ai_process_adsense_ad(b.addedNodes[0])},observer=new MutationObserver(ai_process_adsense_callback);
6
- observer.observe(targetNode,config)}function getAllUrlParams(a){var c=a?a.split("?")[1]:window.location.search.slice(1);a={};if(c){c=c.split("#")[0];c=c.split("&");for(var e=0;e<c.length;e++){var b=c[e].split("="),g=void 0,d=b[0].replace(/\[\d*\]/,function(h){g=h.slice(1,-1);return""});b="undefined"===typeof b[1]?"":b[1];d=d.toLowerCase();b=b.toLowerCase();a[d]?("string"===typeof a[d]&&(a[d]=[a[d]]),"undefined"===typeof g?a[d].push(b):a[d][g]=b):a[d]=b}}return a};
1
+ var adsense_ad_names=[],ai_preview_window="undefined"!=typeof ai_preview;function ai_process_adsense_ad(e){var a=e,i=a.getAttribute("width"),d=a.getAttribute("height"),t=getAllUrlParams(a.getAttribute("src"));if(void 0!==t.client){var s,n=t.client.replace("ca-",""),o=t.slotname,r=t.ifi,l="ai-debug-ad-overlay",c="";if(void 0!==o){var f="";void 0!==adsense_ad_names.publisher_id&&adsense_ad_names.publisher_id==n&&void 0!==adsense_ad_names[o]&&(f='<div class="ai-info ai-info-2">'+adsense_ad_names[o]+"</div>"),c='<div class="ai-info ai-info-1">'+o+"</div>"+f}else 0!=a.closest("div.google-auto-placed").length?(l+=" ai-auto-ads",c='<div class="ai-info ai-info-1">Auto ads</div>'):l+=" ai-no-slot";var v='<div class="'+l+'"></div>',u='<div class="ai-debug-ad-info"><div class="ai-info ai-info-1">AdSense #'+r+'</div><div class="ai-info ai-info-2">'+i+"x"+d+"</div>"+c+"</div>";a.insertAdjacentHTML("afterend",u),ai_preview_window||a.insertAdjacentHTML("afterend",v)}}function ai_process_adsense_ads(){document.querySelectorAll('ins > ins > iframe[src*="google"]').forEach((e,a)=>{(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&ai_process_adsense_ad(e)})}function ai_load_adsense_ad_units(){var e={action:"ai_ajax",ai_check:"AI_NONCE","adsense-ad-units[ai]":1},a=[];for(var i in e){var d=encodeURIComponent(i),t=encodeURIComponent(e[i]);a.push(d+"="+t)}async function s(){let e=await fetch("AI_AJAXURL",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:a}),i=await e.text();return i}a=a.join("&"),s().then(e=>{if(""!=e)try{adsense_ad_names=JSON.parse(e)}catch(a){}}).catch(e=>{})}function ai_ready(e){"complete"!==document.readyState&&("loading"===document.readyState||document.documentElement.doScroll)?document.addEventListener("DOMContentLoaded",e):e()}if(ai_ready(ai_load_adsense_ad_units),!ai_preview_window){let e=document.querySelector("body"),a={attributes:!1,childList:!0,subtree:!0},i=function(e,a){for(let i of e)"childList"===i.type&&i.addedNodes.length&&"IFRAME"==i.addedNodes[0].tagName&&null!=i.addedNodes[0].getAttribute("width")&&null!=i.addedNodes[0].getAttribute("height")&&i.addedNodes[0].closest(".adsbygoogle")&&ai_process_adsense_ad(i.addedNodes[0])},d=new MutationObserver(i);d.observe(e,a)}function getAllUrlParams(e){var a=e?e.split("?")[1]:window.location.search.slice(1),i={};if(a)for(var d=(a=a.split("#")[0]).split("&"),t=0;t<d.length;t++){var s=d[t].split("="),n=void 0,o=s[0].replace(/\[\d*\]/,function(e){return n=e.slice(1,-1),""}),r=void 0===s[1]?"":s[1];o=o.toLowerCase(),r=r.toLowerCase(),i[o]?("string"==typeof i[o]&&(i[o]=[i[o]]),void 0===n?i[o].push(r):i[o][n]=r):i[o]=r}return i}
 
 
 
 
 
includes/js/ai-auto-ads.jq.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ jQuery(window).on ('load', function () {
2
+ setTimeout (function() {
3
+ // var google_auto_placed = jQuery ('.google-auto-placed ins > ins > iframe[onload*="google"]:visible');
4
+ // google_auto_placed.closest ('div').before ('<section class=\"ai-debug-bar ai-debug-adsense ai-adsense-auto-ads\">' + ai_front.automatically_placed + '</section>');
5
+ var google_auto_placed = jQuery ('.google-auto-placed > ins');
6
+ google_auto_placed.before ('<section class=\"ai-debug-bar ai-debug-adsense ai-adsense-auto-ads\">' + ai_front.automatically_placed + '</section>');
7
+ }, 150);
8
+ });
includes/js/ai-auto-ads.jq.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(window).on("load",function(){setTimeout(function(){jQuery(".google-auto-placed > ins").before('<section class="ai-debug-bar ai-debug-adsense ai-adsense-auto-ads">'+ai_front.automatically_placed+"</section>")},150)});
includes/js/ai-auto-ads.js CHANGED
@@ -1,8 +1,11 @@
1
- jQuery(window).on ('load', function () {
 
2
  setTimeout (function() {
3
- // var google_auto_placed = jQuery ('.google-auto-placed ins > ins > iframe[onload*="google"]:visible');
4
- // google_auto_placed.closest ('div').before ('<section class=\"ai-debug-bar ai-debug-adsense ai-adsense-auto-ads\">' + ai_front.automatically_placed + '</section>');
5
- var google_auto_placed = jQuery ('.google-auto-placed > ins');
6
- google_auto_placed.before ('<section class=\"ai-debug-bar ai-debug-adsense ai-adsense-auto-ads\">' + ai_front.automatically_placed + '</section>');
 
 
7
  }, 150);
8
  });
1
+ //jQuery(window).on ('load', function () {
2
+ window.addEventListener ('load', (event) => {
3
  setTimeout (function() {
4
+ // var google_auto_placed = jQuery ('.google-auto-placed > ins');
5
+ // google_auto_placed.before ('<section class=\"ai-debug-bar ai-debug-adsense ai-adsense-auto-ads\">' + ai_front.automatically_placed + '</section>');
6
+ document.querySelectorAll ('.google-auto-placed > ins').forEach ((el, index) => {
7
+ el.insertAdjacentHTML ('afterbegin', '<section class=\"ai-debug-bar ai-debug-adsense ai-adsense-auto-ads\">' + ai_front.automatically_placed + '</section>');
8
+ });
9
+
10
  }, 150);
11
  });
includes/js/ai-auto-ads.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(window).on("load",function(){setTimeout(function(){jQuery(".google-auto-placed > ins").before('<section class="ai-debug-bar ai-debug-adsense ai-adsense-auto-ads">'+ai_front.automatically_placed+"</section>")},150)});
1
+ window.addEventListener("load",function(b){setTimeout(function(){document.querySelectorAll(".google-auto-placed > ins").forEach(function(a,c){a.insertAdjacentHTML("afterbegin",'<section class="ai-debug-bar ai-debug-adsense ai-adsense-auto-ads">'+ai_front.automatically_placed+"</section>")})},150)});
includes/js/ai-errors-footer.js CHANGED
@@ -1,18 +1,34 @@
1
- jQuery('body').prepend ("AI_HTML_CODE");
 
2
 
3
  ai_check_js_errors = function () {
4
- jQuery('.ai-js-0').hide ();
 
 
 
 
5
  if (ai_js_errors.length != 0) {
6
- jQuery('.ai-js-2').show ();
7
- jQuery('.ai-js-1').hide ();
 
 
 
 
 
 
 
8
  } else {
9
- jQuery('.ai-js-1').show ();
10
- jQuery('.ai-js-2').hide ();
 
 
 
 
 
 
11
  }
12
  }
13
 
14
  ai_check_js_errors ();
15
-
16
  setTimeout (ai_check_js_errors, 500);
17
-
18
  setTimeout (ai_check_js_errors, 3000);
1
+ //jQuery('body').prepend ("AI_HTML_CODE");
2
+ document.querySelector ('body').insertAdjacentHTML ('afterbegin', "AI_HTML_CODE");
3
 
4
  ai_check_js_errors = function () {
5
+ // jQuery('.ai-js-0').hide ();
6
+ document.querySelectorAll ('.ai-js-0').forEach ((el, index) => {
7
+ el.style.display = 'none';
8
+ });
9
+
10
  if (ai_js_errors.length != 0) {
11
+ // jQuery('.ai-js-2').show ();
12
+ // jQuery('.ai-js-1').hide ();
13
+ document.querySelectorAll ('.ai-js-2').forEach ((el, index) => {
14
+ el.style.display = '';
15
+ });
16
+ document.querySelectorAll ('.ai-js-1').forEach ((el, index) => {
17
+ el.style.display = 'none';
18
+ });
19
+
20
  } else {
21
+ // jQuery('.ai-js-1').show ();
22
+ // jQuery('.ai-js-2').hide ();
23
+ document.querySelectorAll ('.ai-js-1').forEach ((el, index) => {
24
+ el.style.display = '';
25
+ });
26
+ document.querySelectorAll ('.ai-js-2').forEach ((el, index) => {
27
+ el.style.display = 'none';
28
+ });
29
  }
30
  }
31
 
32
  ai_check_js_errors ();
 
33
  setTimeout (ai_check_js_errors, 500);
 
34
  setTimeout (ai_check_js_errors, 3000);
includes/js/ai-errors-footer.min.js CHANGED
@@ -1 +1 @@
1
- jQuery("body").prepend("AI_HTML_CODE");ai_check_js_errors=function(){jQuery(".ai-js-0").hide();0!=ai_js_errors.length?(jQuery(".ai-js-2").show(),jQuery(".ai-js-1").hide()):(jQuery(".ai-js-1").show(),jQuery(".ai-js-2").hide())};ai_check_js_errors();setTimeout(ai_check_js_errors,500);setTimeout(ai_check_js_errors,3E3);
1
+ document.querySelector("body").insertAdjacentHTML("afterbegin","AI_HTML_CODE"),(ai_check_js_errors=function(){document.querySelectorAll(".ai-js-0").forEach((e,l)=>{e.style.display="none"}),0!=ai_js_errors.length?(document.querySelectorAll(".ai-js-2").forEach((e,l)=>{e.style.display=""}),document.querySelectorAll(".ai-js-1").forEach((e,l)=>{e.style.display="none"})):(document.querySelectorAll(".ai-js-1").forEach((e,l)=>{e.style.display=""}),document.querySelectorAll(".ai-js-2").forEach((e,l)=>{e.style.display="none"}))})(),setTimeout(ai_check_js_errors,500),setTimeout(ai_check_js_errors,3e3);
js/ad-inserter.js CHANGED
@@ -1,4 +1,4 @@
1
- var javascript_version = "2.7.18"
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
@@ -3709,7 +3709,7 @@ jQuery(document).ready (function($) {
3709
  generate_rotatation_code (block);
3710
 
3711
  ul.find ("li").remove ();
3712
- var div = option_tabs.find ("div.rounded").remove ();
3713
  }
3714
  });
3715
 
@@ -4191,7 +4191,7 @@ jQuery(document).ready (function($) {
4191
 
4192
  var rotation_container = $('#ai-rotation-container-' + block);
4193
  rotation_container.find ("ul").find ("li").remove ();
4194
- rotation_container.find ("div.rounded").remove ();
4195
 
4196
  var tabs = options;
4197
  if (tabs < 1) tabs = 1;
@@ -4240,7 +4240,7 @@ jQuery(document).ready (function($) {
4240
  $("#rotation-" + block).next ("label").find ('.checkbox-icon').removeClass("on");
4241
 
4242
  rotation_container.find ("ul").find ("li").remove ();
4243
- rotation_container.find ("div.rounded").remove ();
4244
  }).always (function() {
4245
  $("#rotation-"+block).next ("label").find ('.checkbox-icon').removeClass("active");
4246
  });
@@ -4255,7 +4255,7 @@ jQuery(document).ready (function($) {
4255
  $(('#option-' + block + '-' + option)).data ('code', b64e (get_editor_text (block)));
4256
 
4257
  var rotation_data = [];
4258
- rotation_container.find ("div.rounded").each (function (index) {
4259
  var code_data = $('#option-' + block + '-' + (index + 1)).data ('code');
4260
  var code = typeof code_data == 'undefined' ? '' : b64d (code_data);
4261
  var group_rotation = $("#rotation-groups-" + block).next ().find ('span').hasClass ('on');
@@ -4294,7 +4294,7 @@ jQuery(document).ready (function($) {
4294
  $("#rotation-" + block).next ("label").find ('.checkbox-icon').removeClass("on");
4295
 
4296
  rotation_container.find ("ul").find ("li").remove ();
4297
- rotation_container.find ("div.rounded").remove ();
4298
  }).always (function() {
4299
  $("#rotation-"+block).next ("label").find ('.checkbox-icon').removeClass("active");
4300
 
@@ -4310,7 +4310,7 @@ jQuery(document).ready (function($) {
4310
 
4311
  var rotation_tabs = $('#rotation-tabs');
4312
  var li = rotation_tabs.find ("li");
4313
- var div = rotation_tabs.find ("div.rounded");
4314
 
4315
  var insertion = 0;
4316
 
@@ -4363,14 +4363,14 @@ jQuery(document).ready (function($) {
4363
  var ul = rotation_container.find ("ul");
4364
 
4365
  ul.find ("li").slice (option, option + 1).remove ();
4366
- var div = rotation_container.find ("div.rounded").slice (option, option + 1).remove ();
4367
 
4368
  rotation_container.find ('ul li').each (function (index) {
4369
  var option = index + 1;
4370
  $(this).attr ('id', 'option-' + block + '-' + option).find ("a").attr ('href', '#tab-option-' + block + '-' + option).text (String.fromCharCode (64 + option));
4371
  });
4372
 
4373
- rotation_container.find ("div.rounded").each (function (index) {
4374
  var option = index + 1;
4375
  $(this).attr ('id', 'tab-option-' + block + '-' + option);
4376
  });
1
+ var javascript_version = "2.7.19"
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
3709
  generate_rotatation_code (block);
3710
 
3711
  ul.find ("li").remove ();
3712
+ var div = option_tabs.find ("div.ai-rounded").remove ();
3713
  }
3714
  });
3715
 
4191
 
4192
  var rotation_container = $('#ai-rotation-container-' + block);
4193
  rotation_container.find ("ul").find ("li").remove ();
4194
+ rotation_container.find ("div.ai-rounded").remove ();
4195
 
4196
  var tabs = options;
4197
  if (tabs < 1) tabs = 1;
4240
  $("#rotation-" + block).next ("label").find ('.checkbox-icon').removeClass("on");
4241
 
4242
  rotation_container.find ("ul").find ("li").remove ();
4243
+ rotation_container.find ("div.ai-rounded").remove ();
4244
  }).always (function() {
4245
  $("#rotation-"+block).next ("label").find ('.checkbox-icon').removeClass("active");
4246
  });
4255
  $(('#option-' + block + '-' + option)).data ('code', b64e (get_editor_text (block)));
4256
 
4257
  var rotation_data = [];
4258
+ rotation_container.find ("div.ai-rounded").each (function (index) {
4259
  var code_data = $('#option-' + block + '-' + (index + 1)).data ('code');
4260
  var code = typeof code_data == 'undefined' ? '' : b64d (code_data);
4261
  var group_rotation = $("#rotation-groups-" + block).next ().find ('span').hasClass ('on');
4294
  $("#rotation-" + block).next ("label").find ('.checkbox-icon').removeClass("on");
4295
 
4296
  rotation_container.find ("ul").find ("li").remove ();
4297
+ rotation_container.find ("div.ai-rounded").remove ();
4298
  }).always (function() {
4299
  $("#rotation-"+block).next ("label").find ('.checkbox-icon').removeClass("active");
4300
 
4310
 
4311
  var rotation_tabs = $('#rotation-tabs');
4312
  var li = rotation_tabs.find ("li");
4313
+ var div = rotation_tabs.find ("div.ai-rounded");
4314
 
4315
  var insertion = 0;
4316
 
4363
  var ul = rotation_container.find ("ul");
4364
 
4365
  ul.find ("li").slice (option, option + 1).remove ();
4366
+ var div = rotation_container.find ("div.ai-rounded").slice (option, option + 1).remove ();
4367
 
4368
  rotation_container.find ('ul li').each (function (index) {
4369
  var option = index + 1;
4370
  $(this).attr ('id', 'option-' + block + '-' + option).find ("a").attr ('href', '#tab-option-' + block + '-' + option).text (String.fromCharCode (64 + option));
4371
  });
4372
 
4373
+ rotation_container.find ("div.ai-rounded").each (function (index) {
4374
  var option = index + 1;
4375
  $(this).attr ('id', 'tab-option-' + block + '-' + option);
4376
  });
js/ad-inserter.min.js CHANGED
@@ -1,4 +1,4 @@
1
- var javascript_version="2.7.18",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=
@@ -140,7 +140,7 @@ a("#adsense-layout-key-"+c).val();g["adsense-full-width-responsive"]="true";"dis
140
  r.push(t)});g["adsense-viewports"]=r}break;case AI_CODE_AMAZON:g["amazon-data"]=a("#amazon-data-"+c).val(),g["amazon-amp"]=a("select#amazon-amp-"+c+" option:selected").attr("value"),g["amazon-width"]=a("#amazon-width-"+c).val(),g["amazon-height"]=a("#amazon-height-"+c).val(),g["amazon-amp-block-on-consent"]=a("#amazon-amp-block-on-consent-"+c).is(":checked")?"":"#"}debug&&(console.log("AI GENERATE CODE:",e),console.log(g));a.post(ajaxurl,g).done(function(q){""!=q&&(q=JSON.parse(q),"undefined"!==typeof q&&
141
  set_editor_text(c,q))}).fail(function(q,t,v){console.log("AI GENERATE CODE ERROR:",q.status,q.statusText);a("#ai-error-container").text(ai_admin.error+" "+q.status+": "+q.statusText).show()}).always(function(){a("#generate-code-"+c).next("label").find(".checkbox-icon").removeClass("on")})});a("#clear-block-"+b).click(function(){T(!0,!0,!0,!0)});a("#copy-block-"+b).click(function(){Ma()});a("#paste-name-"+b).click(function(){T(!0,!1,!1,!1)});a("#paste-code-"+b).click(function(){T(!1,!0,!1,!1)});a("#paste-settings-"+
142
  b).click(function(){T(!1,!1,!0,!1)});a("#paste-block-"+b).click(function(){T(!0,!0,!0,!1)});a("#rotation-"+b).click(function(){var c=a(this).attr("id").replace("rotation-",""),e=a("#ai-rotation-container-"+c);a(this).next("label").find(".checkbox-icon").toggleClass("on");e.toggle();var g=e.tabs(),n=g.find("ul");e.is(":visible")?(e.data("code",b64e(get_editor_text(c))),e.data("option",1),ha(c,1),g.tabs("option","active",0),a("input[name=ai_save]").css("color","#f00"),setTimeout(function(){Na(c)},5)):
143
- (Oa(c),n.find("li").remove(),g.find("div.rounded").remove())});a("#add-option-"+b).click(function(){var c=a(this).attr("id").replace("add-option-","");ha(c,1);a("#ai-rotation-container-"+c).find("ul").find("li").slice(-1).click()});a("#remove-option-"+b).click(function(){var c=a(this).attr("id").replace("remove-option-","");Pa(c,a("#ai-rotation-container-"+c).tabs("option","active"))});a("#rotation-groups-"+b).click(function(){var c=a(this).attr("id").tabIndex(),e=a(this).next().find("span");e.toggleClass("on");
144
  c=a("#ai-rotation-container-"+c);e.hasClass("on")?(c.find("span.group-name-label").show(),c.find("span.option-name-label").hide(),c.find("td.option-parameters").hide()):(c.find("span.group-name-label").hide(),c.find("span.option-name-label").show(),c.find("td.option-parameters").show())});a("#tab-"+b+" .adsense-list").click(function(){a(this).blur();ea()});a("select#html-element-insertion-"+b).change(function(){a("select#html-element-insertion-"+b+" option:selected").attr("value")==AI_HTML_INSERTION_SEREVR_SIDE?
145
  a("#server-side-insertion-"+b).hide():a("#server-side-insertion-"+b).show()});a("#tab-"+b+" .adsense-ad-size").scombobox({showDropDown:!1,invalidAsValue:!0,animation:{duration:50}});a("select#close-button-"+b).change(function(){var c=a(this).attr("id").replace("close-button-","");a("select#close-button-sticky-"+c).val(a("select#close-button-"+c+" option:selected").attr("value"))});a("select#close-button-sticky-"+b).change(function(){var c=a(this).attr("id").replace("close-button-sticky-","");a("select#close-button-"+
146
  c).val(a("select#close-button-sticky-"+c+" option:selected").attr("value"))});a("input#filter-numbers-insertions-"+b).on("keyup",function(){var c=a(this).attr("id").tabIndex();a("input#filter-numbers-"+c).val(a(this).val());a("select#filter-type-"+c).val(0);a("input#invert-filter-"+c).removeAttr("checked")});a("input#filter-numbers-"+b).on("keyup",function(){var c=a(this).attr("id").tabIndex();a("input#filter-numbers-insertions-"+c).val(a(this).val())});a("#html-elements-button-"+b).click(function(){var c=
@@ -155,18 +155,18 @@ var d=a("select#insertion-type-"+b+" option:selected").attr("value"),f=a("select
155
  [];a("select#insertion-type-"+b).imagepicker({hide_select:!1}).find("option").each(function(c){f.push(a(this).data("title"))});a("select#insertion-type-"+b+" + ul").appendTo("#automatic-insertion-"+b).css("padding-top","10px").find("li").each(function(c){a(this).attr("title",f[c]).tooltip({track:!0,delay:700,showURL:!1,showBody:" | ",fade:250})});f=[];a("select#block-alignment-"+b).imagepicker({hide_select:!1}).find("option").each(function(c){f.push(a(this).data("title"))});a("select#block-alignment-"+
156
  b+" + ul").appendTo("#alignment-style-"+b).css("padding-top","10px").find("li").each(function(c){a(this).attr("title",f[c]).tooltip({track:!0,delay:700,showURL:!1,showBody:" | ",fade:250})});f=[];a("select#horizontal-position-"+b).imagepicker({hide_select:!1}).find("option").each(function(c){f.push(a(this).data("title"))});a("select#horizontal-position-"+b+" + ul").appendTo("#horizontal-positions-"+b).css("padding-top","10px").find("li").each(function(c){a(this).attr("title",f[c]).tooltip({track:!0,
157
  delay:700,showURL:!1,showBody:" | ",fade:250})});f=[];a("select#vertical-position-"+b).imagepicker({hide_select:!1}).find("option").each(function(c){f.push(a(this).data("title"))});a("select#vertical-position-"+b+" + ul").appendTo("#vertical-positions-"+b).css("padding-top","10px").find("li").each(function(c){a(this).attr("title",f[c]).tooltip({track:!0,delay:700,showURL:!1,showBody:" | ",fade:250})});d.addClass("configured")}}function Na(b){a("#rotation-"+b).next("label").find(".checkbox-icon").addClass("active");
158
- a.post(ajaxurl,{action:"ai_ajax_backend",ai_check:ai_nonce,"import-rotation-code":b64e(get_editor_text(b))}).done(function(d){if(""!=d){var f=JSON.parse(d);if("undefined"!==typeof f&&"undefined"!==typeof f.options){a("#ai-error-container").hide();var c=f.options.length;debug&&(console.log("AI IMPORT ROTATION CODE:",c),console.log(" OPTIONS:",f.options));d=a("#ai-rotation-container-"+b);d.find("ul").find("li").remove();d.find("div.rounded").remove();var e=c;1>e&&(e=1);17<e&&(e=17);ha(b,e);d.find("ul li").each(function(g){g<
159
  c?a(this).data("code",b64e(f.options[g].code)):a(this).data("code",b64e(""))});d.tabs("option","active",0);set_editor_text(b,f.options[0].code);d.find("input.option-name").each(function(g){g<c&&a(this).val(f.options[g].name)});d.find("input.option-share").each(function(g){g<c&&a(this).val(f.options[g].share)});d.find("input.option-time").each(function(g){g<c&&a(this).val(f.options[g].time)});d.find("input.option-scheduling").each(function(g){g<c&&a(this).val(f.options[g].scheduling)});d=a("#rotation-groups-"+
160
- b).next().find("span");f.options[0].groups?d.removeClass("on"):d.addClass("on");a("#rotation-groups-"+b).click()}}}).fail(function(d,f,c){console.log("AI IMPORT ROTATION CODE ERROR:",d.status,d.statusText);a("#ai-error-container").text(ai_admin.error+" "+d.status+": "+d.statusText).show();d=a("#ai-rotation-container-"+b);set_editor_text(b,b64d(d.data("code")));d.hide();a("#rotation-"+b).next("label").find(".checkbox-icon").removeClass("on");d.find("ul").find("li").remove();d.find("div.rounded").remove()}).always(function(){a("#rotation-"+
161
- b).next("label").find(".checkbox-icon").removeClass("active")})}function Oa(b){a("#rotation-"+b).next("label").find(".checkbox-icon").addClass("active");var d=a("#ai-rotation-container-"+b),f=d.tabs("option","active")+1;a("#option-"+b+"-"+f).data("code",b64e(get_editor_text(b)));var c=[];d.find("div.rounded").each(function(e){e=a("#option-"+b+"-"+(e+1)).data("code");e="undefined"==typeof e?"":b64d(e);var g=a("#rotation-groups-"+b).next().find("span").hasClass("on");e={name:a(this).find("input.option-name").val(),
162
  share:a(this).find("input.option-share").val(),scheduling:a(this).find("input.option-scheduling").val(),time:a(this).find("input.option-time").val(),code:e,groups:g};c.push(e)});debug&&console.log("ROTATION DATA:",c);a.post(ajaxurl,{action:"ai_ajax_backend",ai_check:ai_nonce,"generate-rotation-code":b64e(JSON.stringify(c))}).done(function(e){a("#ai-error-container").hide();""!=e&&(e=JSON.parse(e),"undefined"!==typeof e&&(debug&&console.log("ROTATION CODE:",e),set_editor_text(b,e)))}).fail(function(e,
163
- g,n){console.log("AI GENERATE ROTATION CODE ERROR:",e.status,e.statusText);a("#ai-error-container").text(ai_admin.error+" "+e.status+": "+e.statusText).show();e=a("#ai-rotation-container-"+b);set_editor_text(b,b64d(e.data("code")));e.hide();a("#rotation-"+b).next("label").find(".checkbox-icon").removeClass("on");e.find("ul").find("li").remove();e.find("div.rounded").remove()}).always(function(){a("#rotation-"+b).next("label").find(".checkbox-icon").removeClass("active");a("input[name=ai_save]").css("color",
164
- "#555")})}function ha(b,d){var f=a("#ai-rotation-container-"+b),c=f.find("ul"),e=f.find("ul >li").length,g=a("#rotation-tabs"),n=g.find("li");g=g.find("div.rounded");for(option=e+1;option<=e+d&&!(17<option);option++){var r=n.clone().show();r.find("a").attr("href","#tab-option-"+b+"-"+option).text(String.fromCharCode(64+option));r.attr("id","option-"+b+"-"+option).appendTo(c).data("code",b64e(""));r.click(function(){var q=a(this).closest(".ai-rotate"),t=q.attr("id").replace("ai-rotation-container-",
165
  ""),v=q.data("option"),B=a(this).attr("id").replace("option-"+t+"-","");q.data("option",B);debug&&console.log("OPTION CHANGE:",v,"=>",B);a("#option-"+t+"-"+v).data("code",b64e(get_editor_text(t)));set_editor_text(t,b64d(a(this).data("code")))});g.clone().show().attr("id","tab-option-"+b+"-"+option).appendTo(f);f.tabs("refresh")}f.find("[data-title]").each(function(){a(this).attr("title",a(this).data("title"))});f.find("[title]").tooltip({track:!0,delay:700,showURL:!1,showBody:" | ",fade:250});f.tabs("option",
166
- "active",option-2)}function Pa(b,d){var f=a("#ai-rotation-container-"+b);if(1!=f.find("ul >li").length){var c=f.find("ul");c.find("li").slice(d,d+1).remove();f.find("div.rounded").slice(d,d+1).remove();f.find("ul li").each(function(e){e+=1;a(this).attr("id","option-"+b+"-"+e).find("a").attr("href","#tab-option-"+b+"-"+e).text(String.fromCharCode(64+e))});f.find("div.rounded").each(function(e){e+=1;a(this).attr("id","tab-option-"+b+"-"+e)});f.tabs("refresh");f=0==d?0:d-1;active_li=a("#option-"+b+"-"+
167
- (f+1));set_editor_text(b,b64d(active_li.data("code")));c.closest(".ai-rotate").data("option",f+1)}}function M(b,d){var f=a("#"+b+"-select-"+d);if(0!==f.length){var c=function(n,r){"function"==typeof before_update_selection_from_list&&before_update_selection_from_list(d);e.find("span.ui-button-text").addClass("ai-button-updating");setTimeout(function(){Qa(n,r)},5)},e=a("#"+b+"-button-"+d),g=e.data("list");null==g&&(g=b);e.click(function(){if(f.hasClass("multi-select"))c(a("#"+g+"-list-"+d),b),a("#ms-"+
168
- b+"-select-"+d).toggle();else if(0==f.find("option").length){var n=a("#ms-"+b+"-select-"+d).find(".filter-input");n=n.length?n.val():"";var r=f.data("parameters");r="undefined"==typeof r?"":r;a("#ai-loading").show();e.find("span.ui-button-text").addClass("ai-button-active").show();a.get(ajaxurl+"?action=ai_ajax_backend&list-options="+b+"&parameters="+r+"&filter="+n+"&ai_check="+ai_nonce,function(q){if(""!=q){var t="";q=a("option","<div>"+q+"</div>");0!=q.length&&0==a(q[0]).attr("value").length&&(t=
169
- a(q[0]).text(),q=q.splice(1));f.attr("data-message",t);f.html(q);ra(f,b,g,d);a("#ms-"+b+"-select-"+d).find(".filter-message").text(t);c(a("#"+g+"-list-"+d),b)}}).fail(function(q,t,v){a("input.filter-input",selection_container).remove();console.log("Error loading "+b+" options: "+q.status+" "+q.statusText)}).always(function(){a("#ai-loading").hide();e.find("span.ui-button-text").removeClass("ai-button-active")})}else ra(f,b,g,d)});a("#"+g+"-list-"+d).focusout(function(){var n=a("#ms-"+b+"-select-"+
170
  d);n.length&&n.is(":visible")&&c(a(this),b)})}}function sa(b,d,f){var c=b.$element,e=c.val();null!=e&&(""==e[0]&&(e=e.splice(1)),e=e.join(", ").trim(","));d=c.attr("id").replace(d+"-select-","");f=a("#"+f+"-list-"+d);d=f.attr("data-custom");"undefined"!=typeof d&&""!=d&&(null!=e?(""!=e&&(e+=", "),e+=d):e=d);f.attr("value",e);b.qs1.cache()}function Qa(b,d){Array.prototype.diff=function(t){return this.filter(function(v){return-1===t.indexOf(v)})};var f=b.attr("id").replace(/^\D+/g,""),c=a("#"+d+"-select-"+
171
  f);if(a("#ms-"+d+"-select-"+f).is(":visible")){var e=b.val().split(",").map(Function.prototype.call,String.prototype.trim);""==e[0]&&(e=e.splice(1));if(b.hasClass("ai-list-filter"))for(var g=0;g<e.length;g++)e[g]=e[g].replace(/ /g,"-").replace(/[!@#\$%\^&\*\(\)=\+\{\}\|\[\]\\;':"\.\/\?]/g,"");if(b.hasClass("ai-list-filter-cat"))for(g=0;g<e.length;g++)e[g]=e[g].replace(/ /g,"-").replace(/[!@#\$%\^&\(\)=\{\}\|\[\]\\;':"\.\/\?]/g,"");b.hasClass("ai-list-uppercase")?e=e.map(Function.prototype.call,String.prototype.toUpperCase):
172
  b.hasClass("ai-list-lowercase")?e=e.map(Function.prototype.call,String.prototype.toLowerCase):b.hasClass("ai-list-country-case")&&(e=e.map(function(t){t=t.split(":");null!=t[0]&&(t[0]=t[0].toUpperCase());null!=t[1]&&(t[1]=t[1].toUpperCase());null!=t[2]&&(t[2]=t[2].toLowerCase());return t.join(":")}));a("#"+d+"-select-"+f).multiSelect("refresh").multiSelect("deselect_all").multiSelect("select",e);if(b.hasClass("ai-list-custom")){g=e;var n=a("#"+d+"-select-"+f).val();null!=n&&(g=e.diff(n));null!=g&&
1
+ var javascript_version="2.7.19",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=
140
  r.push(t)});g["adsense-viewports"]=r}break;case AI_CODE_AMAZON:g["amazon-data"]=a("#amazon-data-"+c).val(),g["amazon-amp"]=a("select#amazon-amp-"+c+" option:selected").attr("value"),g["amazon-width"]=a("#amazon-width-"+c).val(),g["amazon-height"]=a("#amazon-height-"+c).val(),g["amazon-amp-block-on-consent"]=a("#amazon-amp-block-on-consent-"+c).is(":checked")?"":"#"}debug&&(console.log("AI GENERATE CODE:",e),console.log(g));a.post(ajaxurl,g).done(function(q){""!=q&&(q=JSON.parse(q),"undefined"!==typeof q&&
141
  set_editor_text(c,q))}).fail(function(q,t,v){console.log("AI GENERATE CODE ERROR:",q.status,q.statusText);a("#ai-error-container").text(ai_admin.error+" "+q.status+": "+q.statusText).show()}).always(function(){a("#generate-code-"+c).next("label").find(".checkbox-icon").removeClass("on")})});a("#clear-block-"+b).click(function(){T(!0,!0,!0,!0)});a("#copy-block-"+b).click(function(){Ma()});a("#paste-name-"+b).click(function(){T(!0,!1,!1,!1)});a("#paste-code-"+b).click(function(){T(!1,!0,!1,!1)});a("#paste-settings-"+
142
  b).click(function(){T(!1,!1,!0,!1)});a("#paste-block-"+b).click(function(){T(!0,!0,!0,!1)});a("#rotation-"+b).click(function(){var c=a(this).attr("id").replace("rotation-",""),e=a("#ai-rotation-container-"+c);a(this).next("label").find(".checkbox-icon").toggleClass("on");e.toggle();var g=e.tabs(),n=g.find("ul");e.is(":visible")?(e.data("code",b64e(get_editor_text(c))),e.data("option",1),ha(c,1),g.tabs("option","active",0),a("input[name=ai_save]").css("color","#f00"),setTimeout(function(){Na(c)},5)):
143
+ (Oa(c),n.find("li").remove(),g.find("div.ai-rounded").remove())});a("#add-option-"+b).click(function(){var c=a(this).attr("id").replace("add-option-","");ha(c,1);a("#ai-rotation-container-"+c).find("ul").find("li").slice(-1).click()});a("#remove-option-"+b).click(function(){var c=a(this).attr("id").replace("remove-option-","");Pa(c,a("#ai-rotation-container-"+c).tabs("option","active"))});a("#rotation-groups-"+b).click(function(){var c=a(this).attr("id").tabIndex(),e=a(this).next().find("span");e.toggleClass("on");
144
  c=a("#ai-rotation-container-"+c);e.hasClass("on")?(c.find("span.group-name-label").show(),c.find("span.option-name-label").hide(),c.find("td.option-parameters").hide()):(c.find("span.group-name-label").hide(),c.find("span.option-name-label").show(),c.find("td.option-parameters").show())});a("#tab-"+b+" .adsense-list").click(function(){a(this).blur();ea()});a("select#html-element-insertion-"+b).change(function(){a("select#html-element-insertion-"+b+" option:selected").attr("value")==AI_HTML_INSERTION_SEREVR_SIDE?
145
  a("#server-side-insertion-"+b).hide():a("#server-side-insertion-"+b).show()});a("#tab-"+b+" .adsense-ad-size").scombobox({showDropDown:!1,invalidAsValue:!0,animation:{duration:50}});a("select#close-button-"+b).change(function(){var c=a(this).attr("id").replace("close-button-","");a("select#close-button-sticky-"+c).val(a("select#close-button-"+c+" option:selected").attr("value"))});a("select#close-button-sticky-"+b).change(function(){var c=a(this).attr("id").replace("close-button-sticky-","");a("select#close-button-"+
146
  c).val(a("select#close-button-sticky-"+c+" option:selected").attr("value"))});a("input#filter-numbers-insertions-"+b).on("keyup",function(){var c=a(this).attr("id").tabIndex();a("input#filter-numbers-"+c).val(a(this).val());a("select#filter-type-"+c).val(0);a("input#invert-filter-"+c).removeAttr("checked")});a("input#filter-numbers-"+b).on("keyup",function(){var c=a(this).attr("id").tabIndex();a("input#filter-numbers-insertions-"+c).val(a(this).val())});a("#html-elements-button-"+b).click(function(){var c=
155
  [];a("select#insertion-type-"+b).imagepicker({hide_select:!1}).find("option").each(function(c){f.push(a(this).data("title"))});a("select#insertion-type-"+b+" + ul").appendTo("#automatic-insertion-"+b).css("padding-top","10px").find("li").each(function(c){a(this).attr("title",f[c]).tooltip({track:!0,delay:700,showURL:!1,showBody:" | ",fade:250})});f=[];a("select#block-alignment-"+b).imagepicker({hide_select:!1}).find("option").each(function(c){f.push(a(this).data("title"))});a("select#block-alignment-"+
156
  b+" + ul").appendTo("#alignment-style-"+b).css("padding-top","10px").find("li").each(function(c){a(this).attr("title",f[c]).tooltip({track:!0,delay:700,showURL:!1,showBody:" | ",fade:250})});f=[];a("select#horizontal-position-"+b).imagepicker({hide_select:!1}).find("option").each(function(c){f.push(a(this).data("title"))});a("select#horizontal-position-"+b+" + ul").appendTo("#horizontal-positions-"+b).css("padding-top","10px").find("li").each(function(c){a(this).attr("title",f[c]).tooltip({track:!0,
157
  delay:700,showURL:!1,showBody:" | ",fade:250})});f=[];a("select#vertical-position-"+b).imagepicker({hide_select:!1}).find("option").each(function(c){f.push(a(this).data("title"))});a("select#vertical-position-"+b+" + ul").appendTo("#vertical-positions-"+b).css("padding-top","10px").find("li").each(function(c){a(this).attr("title",f[c]).tooltip({track:!0,delay:700,showURL:!1,showBody:" | ",fade:250})});d.addClass("configured")}}function Na(b){a("#rotation-"+b).next("label").find(".checkbox-icon").addClass("active");
158
+ a.post(ajaxurl,{action:"ai_ajax_backend",ai_check:ai_nonce,"import-rotation-code":b64e(get_editor_text(b))}).done(function(d){if(""!=d){var f=JSON.parse(d);if("undefined"!==typeof f&&"undefined"!==typeof f.options){a("#ai-error-container").hide();var c=f.options.length;debug&&(console.log("AI IMPORT ROTATION CODE:",c),console.log(" OPTIONS:",f.options));d=a("#ai-rotation-container-"+b);d.find("ul").find("li").remove();d.find("div.ai-rounded").remove();var e=c;1>e&&(e=1);17<e&&(e=17);ha(b,e);d.find("ul li").each(function(g){g<
159
  c?a(this).data("code",b64e(f.options[g].code)):a(this).data("code",b64e(""))});d.tabs("option","active",0);set_editor_text(b,f.options[0].code);d.find("input.option-name").each(function(g){g<c&&a(this).val(f.options[g].name)});d.find("input.option-share").each(function(g){g<c&&a(this).val(f.options[g].share)});d.find("input.option-time").each(function(g){g<c&&a(this).val(f.options[g].time)});d.find("input.option-scheduling").each(function(g){g<c&&a(this).val(f.options[g].scheduling)});d=a("#rotation-groups-"+
160
+ b).next().find("span");f.options[0].groups?d.removeClass("on"):d.addClass("on");a("#rotation-groups-"+b).click()}}}).fail(function(d,f,c){console.log("AI IMPORT ROTATION CODE ERROR:",d.status,d.statusText);a("#ai-error-container").text(ai_admin.error+" "+d.status+": "+d.statusText).show();d=a("#ai-rotation-container-"+b);set_editor_text(b,b64d(d.data("code")));d.hide();a("#rotation-"+b).next("label").find(".checkbox-icon").removeClass("on");d.find("ul").find("li").remove();d.find("div.ai-rounded").remove()}).always(function(){a("#rotation-"+
161
+ b).next("label").find(".checkbox-icon").removeClass("active")})}function Oa(b){a("#rotation-"+b).next("label").find(".checkbox-icon").addClass("active");var d=a("#ai-rotation-container-"+b),f=d.tabs("option","active")+1;a("#option-"+b+"-"+f).data("code",b64e(get_editor_text(b)));var c=[];d.find("div.ai-rounded").each(function(e){e=a("#option-"+b+"-"+(e+1)).data("code");e="undefined"==typeof e?"":b64d(e);var g=a("#rotation-groups-"+b).next().find("span").hasClass("on");e={name:a(this).find("input.option-name").val(),
162
  share:a(this).find("input.option-share").val(),scheduling:a(this).find("input.option-scheduling").val(),time:a(this).find("input.option-time").val(),code:e,groups:g};c.push(e)});debug&&console.log("ROTATION DATA:",c);a.post(ajaxurl,{action:"ai_ajax_backend",ai_check:ai_nonce,"generate-rotation-code":b64e(JSON.stringify(c))}).done(function(e){a("#ai-error-container").hide();""!=e&&(e=JSON.parse(e),"undefined"!==typeof e&&(debug&&console.log("ROTATION CODE:",e),set_editor_text(b,e)))}).fail(function(e,
163
+ g,n){console.log("AI GENERATE ROTATION CODE ERROR:",e.status,e.statusText);a("#ai-error-container").text(ai_admin.error+" "+e.status+": "+e.statusText).show();e=a("#ai-rotation-container-"+b);set_editor_text(b,b64d(e.data("code")));e.hide();a("#rotation-"+b).next("label").find(".checkbox-icon").removeClass("on");e.find("ul").find("li").remove();e.find("div.ai-rounded").remove()}).always(function(){a("#rotation-"+b).next("label").find(".checkbox-icon").removeClass("active");a("input[name=ai_save]").css("color",
164
+ "#555")})}function ha(b,d){var f=a("#ai-rotation-container-"+b),c=f.find("ul"),e=f.find("ul >li").length,g=a("#rotation-tabs"),n=g.find("li");g=g.find("div.ai-rounded");for(option=e+1;option<=e+d&&!(17<option);option++){var r=n.clone().show();r.find("a").attr("href","#tab-option-"+b+"-"+option).text(String.fromCharCode(64+option));r.attr("id","option-"+b+"-"+option).appendTo(c).data("code",b64e(""));r.click(function(){var q=a(this).closest(".ai-rotate"),t=q.attr("id").replace("ai-rotation-container-",
165
  ""),v=q.data("option"),B=a(this).attr("id").replace("option-"+t+"-","");q.data("option",B);debug&&console.log("OPTION CHANGE:",v,"=>",B);a("#option-"+t+"-"+v).data("code",b64e(get_editor_text(t)));set_editor_text(t,b64d(a(this).data("code")))});g.clone().show().attr("id","tab-option-"+b+"-"+option).appendTo(f);f.tabs("refresh")}f.find("[data-title]").each(function(){a(this).attr("title",a(this).data("title"))});f.find("[title]").tooltip({track:!0,delay:700,showURL:!1,showBody:" | ",fade:250});f.tabs("option",
166
+ "active",option-2)}function Pa(b,d){var f=a("#ai-rotation-container-"+b);if(1!=f.find("ul >li").length){var c=f.find("ul");c.find("li").slice(d,d+1).remove();f.find("div.ai-rounded").slice(d,d+1).remove();f.find("ul li").each(function(e){e+=1;a(this).attr("id","option-"+b+"-"+e).find("a").attr("href","#tab-option-"+b+"-"+e).text(String.fromCharCode(64+e))});f.find("div.ai-rounded").each(function(e){e+=1;a(this).attr("id","tab-option-"+b+"-"+e)});f.tabs("refresh");f=0==d?0:d-1;active_li=a("#option-"+
167
+ b+"-"+(f+1));set_editor_text(b,b64d(active_li.data("code")));c.closest(".ai-rotate").data("option",f+1)}}function M(b,d){var f=a("#"+b+"-select-"+d);if(0!==f.length){var c=function(n,r){"function"==typeof before_update_selection_from_list&&before_update_selection_from_list(d);e.find("span.ui-button-text").addClass("ai-button-updating");setTimeout(function(){Qa(n,r)},5)},e=a("#"+b+"-button-"+d),g=e.data("list");null==g&&(g=b);e.click(function(){if(f.hasClass("multi-select"))c(a("#"+g+"-list-"+d),b),
168
+ a("#ms-"+b+"-select-"+d).toggle();else if(0==f.find("option").length){var n=a("#ms-"+b+"-select-"+d).find(".filter-input");n=n.length?n.val():"";var r=f.data("parameters");r="undefined"==typeof r?"":r;a("#ai-loading").show();e.find("span.ui-button-text").addClass("ai-button-active").show();a.get(ajaxurl+"?action=ai_ajax_backend&list-options="+b+"&parameters="+r+"&filter="+n+"&ai_check="+ai_nonce,function(q){if(""!=q){var t="";q=a("option","<div>"+q+"</div>");0!=q.length&&0==a(q[0]).attr("value").length&&
169
+ (t=a(q[0]).text(),q=q.splice(1));f.attr("data-message",t);f.html(q);ra(f,b,g,d);a("#ms-"+b+"-select-"+d).find(".filter-message").text(t);c(a("#"+g+"-list-"+d),b)}}).fail(function(q,t,v){a("input.filter-input",selection_container).remove();console.log("Error loading "+b+" options: "+q.status+" "+q.statusText)}).always(function(){a("#ai-loading").hide();e.find("span.ui-button-text").removeClass("ai-button-active")})}else ra(f,b,g,d)});a("#"+g+"-list-"+d).focusout(function(){var n=a("#ms-"+b+"-select-"+
170
  d);n.length&&n.is(":visible")&&c(a(this),b)})}}function sa(b,d,f){var c=b.$element,e=c.val();null!=e&&(""==e[0]&&(e=e.splice(1)),e=e.join(", ").trim(","));d=c.attr("id").replace(d+"-select-","");f=a("#"+f+"-list-"+d);d=f.attr("data-custom");"undefined"!=typeof d&&""!=d&&(null!=e?(""!=e&&(e+=", "),e+=d):e=d);f.attr("value",e);b.qs1.cache()}function Qa(b,d){Array.prototype.diff=function(t){return this.filter(function(v){return-1===t.indexOf(v)})};var f=b.attr("id").replace(/^\D+/g,""),c=a("#"+d+"-select-"+
171
  f);if(a("#ms-"+d+"-select-"+f).is(":visible")){var e=b.val().split(",").map(Function.prototype.call,String.prototype.trim);""==e[0]&&(e=e.splice(1));if(b.hasClass("ai-list-filter"))for(var g=0;g<e.length;g++)e[g]=e[g].replace(/ /g,"-").replace(/[!@#\$%\^&\*\(\)=\+\{\}\|\[\]\\;':"\.\/\?]/g,"");if(b.hasClass("ai-list-filter-cat"))for(g=0;g<e.length;g++)e[g]=e[g].replace(/ /g,"-").replace(/[!@#\$%\^&\(\)=\{\}\|\[\]\\;':"\.\/\?]/g,"");b.hasClass("ai-list-uppercase")?e=e.map(Function.prototype.call,String.prototype.toUpperCase):
172
  b.hasClass("ai-list-lowercase")?e=e.map(Function.prototype.call,String.prototype.toLowerCase):b.hasClass("ai-list-country-case")&&(e=e.map(function(t){t=t.split(":");null!=t[0]&&(t[0]=t[0].toUpperCase());null!=t[1]&&(t[1]=t[1].toUpperCase());null!=t[2]&&(t[2]=t[2].toLowerCase());return t.join(":")}));a("#"+d+"-select-"+f).multiSelect("refresh").multiSelect("deselect_all").multiSelect("select",e);if(b.hasClass("ai-list-custom")){g=e;var n=a("#"+d+"-select-"+f).val();null!=n&&(g=e.diff(n));null!=g&&
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.18
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
@@ -361,6 +361,12 @@ If you are not happy to reveal this information and you have opted in, simply di
361
 
362
  == Changelog ==
363
 
 
 
 
 
 
 
364
  = 2.7.18 =
365
  - Added support to hide ad label when unfilled AdSense block is hidden
366
  - Simplified AdSense API authorization process
@@ -670,6 +676,12 @@ For the changelog of earlier versions, please refer to the separate changelog.tx
670
 
671
  == Upgrade Notice ==
672
 
 
 
 
 
 
 
673
  = 2.7.18 =
674
  Added support to hide ad label when unfilled AdSense block is hidden;
675
  Simplified AdSense API authorization process;
6
  Requires at least: 4.9
7
  Tested up to: 6.0
8
  Requires PHP: 5.6
9
+ Stable tag: 2.7.19
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
361
 
362
  == Changelog ==
363
 
364
+ = 2.7.19 =
365
+ - Added constant to disable AdSense API
366
+ - Fix for rotation code editor
367
+ - Fix for advaced click tracker for banners (Pro only)
368
+ - Few minor bug fixes, cosmetic changes and code improvements
369
+
370
  = 2.7.18 =
371
  - Added support to hide ad label when unfilled AdSense block is hidden
372
  - Simplified AdSense API authorization process
676
 
677
  == Upgrade Notice ==
678
 
679
+ = 2.7.19 =
680
+ Added constant to disable AdSense API;
681
+ Fix for rotation code editor;
682
+ Fix for advaced click tracker for banners (Pro only);
683
+ Few minor bug fixes, cosmetic changes and code improvements;
684
+
685
  = 2.7.18 =
686
  Added support to hide ad label when unfilled AdSense block is hidden;
687
  Simplified AdSense API authorization process;
settings.php CHANGED
@@ -5593,21 +5593,50 @@ function ai_check_page () {
5593
  function sidebar_addense_alternative () { ?>
5594
 
5595
  <?php
5596
- switch (rand (5, 16)) {
 
 
 
 
 
5597
  case 1:
 
 
 
 
 
 
 
 
 
 
 
 
5598
  case 2:
 
 
 
 
 
 
 
 
 
 
 
 
5599
  case 3:
5600
  case 4:
5601
  ?>
5602
- <!-- <div class="ai-form header ai-rounded">-->
5603
- <!-- <div style="float: left;">-->
5604
- <!-- <h2 style="display: inline-block; margin: 5px 0;"><?php _e ('Maximize Your Ad Revenue With Header Bidding', 'ad-inserter'); ?></h2>-->
5605
- <!-- </div>-->
5606
- <!-- <div style="clear: both;"></div>-->
5607
- <!-- </div>-->
5608
- <!-- <div class="ai-form ai-rounded" style="height: 90px; padding: 8px 4px 8px 12px;">-->
5609
- <!-- <a href='https://setupad.com/maximise-your-ad-revenue-with-header-bidding/?utm_source=ad-inserter-plugin&utm_medium=banner&utm_campaign=728x90-Maximise-Your-Ad-Revenue' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-sa-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>sa-2.gif" /></a>-->
5610
- <!-- </div>-->
5611
  <?php
5612
  break;
5613
  case 5:
@@ -5847,8 +5876,9 @@ function sidebar_pro () {
5847
  <!-- <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>-->
5848
  <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>
5849
  <?php break; case 1: ?>
5850
- <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>
5851
  <!-- <a href='https://setupad.com/maximise-your-ad-revenue-with-header-bidding/?utm_source=ad-inserter-plugin&utm_medium=banner&utm_campaign=250x250-Maximise-Your-Ad-Revenue' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-sa-1" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>sa-1.png" /></a>-->
 
5852
  <?php break; case 2: ?>
5853
  <!-- <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>-->
5854
  <a href="https://underdogmedia.com/edge-publisher-adinserter/" class="clear-link" title="<?php _e ('Maximize Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-um-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>um-2.png" /></a>
@@ -5861,8 +5891,9 @@ function sidebar_pro () {
5861
  <?php switch ($version) {
5862
  case 0:
5863
  ?>
5864
- <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>
5865
  <!-- <a href='https://setupad.com/maximise-your-ad-revenue-with-header-bidding/?utm_source=ad-inserter-plugin&utm_medium=banner&utm_campaign=250x250-Maximise-Your-Ad-Revenue' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-sa-1" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>sa-1.png" /></a>-->
 
5866
  <?php break;
5867
  case 1:
5868
  ?>
@@ -5890,8 +5921,9 @@ function sidebar_pro () {
5890
  <!-- <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>-->
5891
  <a href="https://underdogmedia.com/edge-publisher-adinserter/" class="clear-link" title="<?php _e ('Maximize Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-um-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>um-2.png" /></a>
5892
  <?php break; case 2: ?>
5893
- <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>
5894
  <!-- <a href='https://setupad.com/maximise-your-ad-revenue-with-header-bidding/?utm_source=ad-inserter-plugin&utm_medium=banner&utm_campaign=250x250-Maximise-Your-Ad-Revenue' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-sa-1" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>sa-1.png" /></a>-->
 
5895
  <?php break; case 3: ?>
5896
  <!-- <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>-->
5897
  <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>
@@ -5919,8 +5951,9 @@ function sidebar_pro () {
5919
  <?php break;
5920
  case 3:
5921
  ?>
5922
- <a href='https://adinserter.pro/documentation/plugin-settings#recaptcha' class="clear-link" title="<?php _e ('Stop invalid traffic with reCAPTCHA v3 score check', 'ad-inserter'); ?>" target="_blank"><img id="ai-recaptcha" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-recaptcha-250.png" /></a>
5923
  <!-- <a href='https://setupad.com/maximise-your-ad-revenue-with-header-bidding/?utm_source=ad-inserter-plugin&utm_medium=banner&utm_campaign=250x250-Maximise-Your-Ad-Revenue' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-sa-1" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>sa-1.png" /></a>-->
 
5924
  <?php break;
5925
  } ?>
5926
  </div>
5593
  function sidebar_addense_alternative () { ?>
5594
 
5595
  <?php
5596
+ // 1AInIn728x90.jpg
5597
+ // 1GAdXFP728x90.jpg
5598
+ // 2GAdXFP728x90.jpg
5599
+
5600
+
5601
+ switch (rand (1, 16)) {
5602
  case 1:
5603
+ ?>
5604
+ <div class="ai-form header ai-rounded">
5605
+ <div style="float: left;">
5606
+ <h2 style="display: inline-block; margin: 5px 0;"><?php _e ('bcm Ad Exchange', 'ad-inserter'); ?></h2>
5607
+ </div>
5608
+ <div style="clear: both;"></div>
5609
+ </div>
5610
+ <div class="ai-form ai-rounded" style="height: 90px; padding: 8px 4px 8px 12px;">
5611
+ <a href='https://sales.bcm.ltd/1/?utm_source=adinserterpro&utm_medium=wp&utm_campaign=1AInIn728x90' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-1ainin-l" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>1AInIn728x90.jpg" /></a>
5612
+ </div>
5613
+ <?php
5614
+ break;
5615
  case 2:
5616
+ ?>
5617
+ <div class="ai-form header ai-rounded">
5618
+ <div style="float: left;">
5619
+ <h2 style="display: inline-block; margin: 5px 0;"><?php _e ('Google AdX', 'ad-inserter'); ?></h2>
5620
+ </div>
5621
+ <div style="clear: both;"></div>
5622
+ </div>
5623
+ <div class="ai-form ai-rounded" style="height: 90px; padding: 8px 4px 8px 12px;">
5624
+ <a href='https://sales.bcm.ltd/2/?utm_source=adinserterpro&utm_medium=wp&utm_campaign=1GAdXFP728x90' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-1gadxfp7-l" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>1GAdXFP728x90.jpg" /></a>
5625
+ </div>
5626
+ <?php
5627
+ break;
5628
  case 3:
5629
  case 4:
5630
  ?>
5631
+ <div class="ai-form header ai-rounded">
5632
+ <div style="float: left;">
5633
+ <h2 style="display: inline-block; margin: 5px 0;"><?php _e ('Google AdX', 'ad-inserter'); ?></h2>
5634
+ </div>
5635
+ <div style="clear: both;"></div>
5636
+ </div>
5637
+ <div class="ai-form ai-rounded" style="height: 90px; padding: 8px 4px 8px 12px;">
5638
+ <a href='https://sales.bcm.ltd/2/?utm_source=adinserterpro&utm_medium=wp&utm_campaign=2GAdXFP728x90' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-2gadxfp-l" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>2GAdXFP728x90.jpg" /></a>
5639
+ </div>
5640
  <?php
5641
  break;
5642
  case 5:
5876
  <!-- <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>-->
5877
  <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>
5878
  <?php break; case 1: ?>
5879
+ <!-- <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>-->
5880
  <!-- <a href='https://setupad.com/maximise-your-ad-revenue-with-header-bidding/?utm_source=ad-inserter-plugin&utm_medium=banner&utm_campaign=250x250-Maximise-Your-Ad-Revenue' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-sa-1" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>sa-1.png" /></a>-->
5881
+ <a href='https://sales.bcm.ltd/1/?utm_source=adinserterpro&utm_medium=wp&utm_campaign=1AInIn200x250' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-1ainin" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>1AInIn200x250.jpg" /></a>
5882
  <?php break; case 2: ?>
5883
  <!-- <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>-->
5884
  <a href="https://underdogmedia.com/edge-publisher-adinserter/" class="clear-link" title="<?php _e ('Maximize Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-um-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>um-2.png" /></a>
5891
  <?php switch ($version) {
5892
  case 0:
5893
  ?>
5894
+ <!-- <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>-->
5895
  <!-- <a href='https://setupad.com/maximise-your-ad-revenue-with-header-bidding/?utm_source=ad-inserter-plugin&utm_medium=banner&utm_campaign=250x250-Maximise-Your-Ad-Revenue' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-sa-1" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>sa-1.png" /></a>-->
5896
+ <a href='https://sales.bcm.ltd/2/?utm_source=adinserterpro&utm_medium=wp&utm_campaign=1GAdXFP200x250' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-1gadxfp" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>1GAdXFP200x250.jpg" /></a>
5897
  <?php break;
5898
  case 1:
5899
  ?>
5921
  <!-- <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>-->
5922
  <a href="https://underdogmedia.com/edge-publisher-adinserter/" class="clear-link" title="<?php _e ('Maximize Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-um-2" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>um-2.png" /></a>
5923
  <?php break; case 2: ?>
5924
+ <!-- <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>-->
5925
  <!-- <a href='https://setupad.com/maximise-your-ad-revenue-with-header-bidding/?utm_source=ad-inserter-plugin&utm_medium=banner&utm_campaign=250x250-Maximise-Your-Ad-Revenue' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-sa-1" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>sa-1.png" /></a>-->
5926
+ <a href='https://sales.bcm.ltd/1/?utm_source=adinserterpro&utm_medium=wp&utm_campaign=2AInIn200x250' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-2ainin" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>2AInIn200x250.jpg" /></a>
5927
  <?php break; case 3: ?>
5928
  <!-- <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>-->
5929
  <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>
5951
  <?php break;
5952
  case 3:
5953
  ?>
5954
+ <!-- <a href='https://adinserter.pro/documentation/plugin-settings#recaptcha' class="clear-link" title="<?php _e ('Stop invalid traffic with reCAPTCHA v3 score check', 'ad-inserter'); ?>" target="_blank"><img id="ai-recaptcha" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>ai-recaptcha-250.png" /></a>-->
5955
  <!-- <a href='https://setupad.com/maximise-your-ad-revenue-with-header-bidding/?utm_source=ad-inserter-plugin&utm_medium=banner&utm_campaign=250x250-Maximise-Your-Ad-Revenue' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-sa-1" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>sa-1.png" /></a>-->
5956
+ <a href='https://sales.bcm.ltd/1/?utm_source=adinserterpro&utm_medium=wp&utm_campaign=1AInIn200x250' class="clear-link" title="<?php _e ('Maximize Your Ad Revenue', 'ad-inserter'); ?>" target="_blank"><img id="ai-1ainin" src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>1AInIn200x250.jpg" /></a>
5957
  <?php break;
5958
  } ?>
5959
  </div>