Version Description
- Added support to insert [embed] shortcodes
- Few minor bug fixes, cosmetic changes and code improvements
Download this release
Release Info
Developer | spacetime |
Plugin | Ad Inserter – WordPress Ads Management with AdSense Header Integration |
Version | 2.6.14 |
Comparing to | |
See all releases |
Code changes from version 2.6.13 to 2.6.14
- ad-inserter.php +5 -2
- class.php +28 -7
- constants.php +1 -1
- css/ai-settings.css +1 -1
- includes/js/ai-lists.js +126 -100
- includes/js/ai-lists.min.js +17 -16
- js/ad-inserter.js +1 -1
- readme.txt +9 -1
ad-inserter.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/*
|
4 |
Plugin Name: Ad Inserter
|
5 |
-
Version: 2.6.
|
6 |
Description: Ad management with many advanced advertising features to insert ads at optimal positions
|
7 |
Author: Igor Funa
|
8 |
Author URI: http://igorfuna.com/
|
@@ -15,6 +15,10 @@ Domain Path: /languages
|
|
15 |
|
16 |
Change Log
|
17 |
|
|
|
|
|
|
|
|
|
18 |
Ad Inserter 2.6.13 - 2020-08-26
|
19 |
- Few minor bug fixes
|
20 |
|
@@ -1370,7 +1374,6 @@ function ai_post_check ($post, $action) {
|
|
1370 |
return true;
|
1371 |
}
|
1372 |
|
1373 |
-
|
1374 |
function ai_content_marker () {
|
1375 |
if (get_disable_block_insertions ()) return;
|
1376 |
|
2 |
|
3 |
/*
|
4 |
Plugin Name: Ad Inserter
|
5 |
+
Version: 2.6.14
|
6 |
Description: Ad management with many advanced advertising features to insert ads at optimal positions
|
7 |
Author: Igor Funa
|
8 |
Author URI: http://igorfuna.com/
|
15 |
|
16 |
Change Log
|
17 |
|
18 |
+
Ad Inserter 2.6.14 - 2020-09-07
|
19 |
+
- Added support to insert [embed] shortcodes
|
20 |
+
- Few minor bug fixes, cosmetic changes and code improvements
|
21 |
+
|
22 |
Ad Inserter 2.6.13 - 2020-08-26
|
23 |
- Few minor bug fixes
|
24 |
|
1374 |
return true;
|
1375 |
}
|
1376 |
|
|
|
1377 |
function ai_content_marker () {
|
1378 |
if (get_disable_block_insertions ()) return;
|
1379 |
|
class.php
CHANGED
@@ -3072,8 +3072,21 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
|
|
3072 |
// $code = $this->replace_ai_tags (do_shortcode ($this->ai_getCode (), true)); // Does not expand shortcodes inside HTML <div id='div-gpt-ad-1234567890-[ADINSERTER counter="block"]'>
|
3073 |
$ai_code = str_replace ('<', '<ad-inserter-dummy-tag>', $this->ai_getCode ());
|
3074 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3075 |
$code = replace_ai_tags (do_shortcode ($ai_code), $this->get_ad_general_tag());
|
3076 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3077 |
$code = str_replace ('<ad-inserter-dummy-tag>', '<', $code);
|
3078 |
|
3079 |
unset ($ai_wp_data [AI_CURRENT_BLOCK_NUMBER]);
|
@@ -3721,7 +3734,8 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
|
|
3721 |
$client_list_type = '';
|
3722 |
|
3723 |
if (isset ($this->check_url_parameters)) {
|
3724 |
-
$url_parameters_raw = trim (str_replace (' ', '', $this->check_url_parameters));
|
|
|
3725 |
$url_parameter_list_type = $this->check_url_parameter_list_type;
|
3726 |
}
|
3727 |
|
@@ -3744,7 +3758,8 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
|
|
3744 |
|
3745 |
$check_again = true;
|
3746 |
} else {
|
3747 |
-
$url_parameters_raw = trim (str_replace (' ', '', $this->get_url_parameter_list ()));
|
|
|
3748 |
$url_parameter_list_type = $this->get_url_parameter_list_type ();
|
3749 |
|
3750 |
$referers_raw = trim (str_replace (' ', '', strtolower ($this->get_ad_domain_list ())));
|
@@ -3819,13 +3834,19 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
|
|
3819 |
if ($ai_wp_data [AI_WP_AMP_PAGE]) $this->needs_class = true;
|
3820 |
$this->wrapping_div_classes []= 'ai-list-block';
|
3821 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3822 |
switch ($dynamic_blocks) {
|
3823 |
case AI_DYNAMIC_BLOCKS_CLIENT_SIDE_SHOW:
|
3824 |
if ($url_parameter_attributes != '' && $this->get_manual_loading () == AI_MANUAL_LOADING_AUTO) {
|
3825 |
$list_class = ' ai-list-manual';
|
3826 |
} else $list_class = '';
|
3827 |
|
3828 |
-
$processed_code = "\n<div class='ai-dynamic{$list_class} ai-list-data'{$referer_attributes}{$client_attributes}{$url_parameter_attributes}{$scheduling_attributes}>{$processed_code}</div>\n";
|
3829 |
|
3830 |
if ($scheduling_type !== null) {
|
3831 |
$processed_code .= "<div class='ai-fallback'>{$fallback_code}</div>\n";
|
@@ -3843,7 +3864,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
|
|
3843 |
$list_class .= ' ai-list-manual';
|
3844 |
}
|
3845 |
|
3846 |
-
$processed_code = "\n<div class='ai-dynamic{$list_class} ai-list-data'{$referer_attributes}{$client_attributes}{$url_parameter_attributes}{$scheduling_attributes}{$code_data}{$fallback_code_data}></div>\n";
|
3847 |
|
3848 |
if ($ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_AJAX && !$ai_wp_data [AI_CODE_FOR_IFRAME] && !get_disable_js_code ()) {
|
3849 |
$processed_code .= "<script>if (typeof ai_js_code == 'boolean') {var ai_block_div = jQuery ('.{$block_id}'); ai_process_lists (ai_block_div); ai_block_div.removeClass ('{$block_id}');};</script>\n";
|
@@ -3881,9 +3902,9 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
|
|
3881 |
$version_name = $this->version_name == '' ? '' : ' - ' . $this->version_name;
|
3882 |
$block_name = $this->number . ' ' . $this->get_ad_name () . '<kbd data-separator=" - " class="ai-option-name">' . $version_name . '</kbd>';
|
3883 |
|
3884 |
-
$status = $this->get_manual_loading () == AI_MANUAL_LOADING_AUTO ? 'MANUAL LOADING' : '
|
3885 |
// Debugging label before the hidden block in case manual loading is set to Auto and the block has not been enabled yet
|
3886 |
-
$this->additional_code_before_block = $debug_manual_loading->bar ($block_name, '', 'NOT LOADED', $status);
|
3887 |
}
|
3888 |
}
|
3889 |
|
@@ -4513,7 +4534,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
|
|
4513 |
|
4514 |
// Debugging label before the hidden block in case manual loading is set to Auto and the block has not been enabled yet
|
4515 |
if ($this->additional_code_before_block != '') {
|
4516 |
-
$classes = array ('ai-debug-
|
4517 |
|
4518 |
if ($alignment_class) $classes []= $alignment_class;
|
4519 |
|
3072 |
// $code = $this->replace_ai_tags (do_shortcode ($this->ai_getCode (), true)); // Does not expand shortcodes inside HTML <div id='div-gpt-ad-1234567890-[ADINSERTER counter="block"]'>
|
3073 |
$ai_code = str_replace ('<', '<ad-inserter-dummy-tag>', $this->ai_getCode ());
|
3074 |
|
3075 |
+
$replace_embed = false;
|
3076 |
+
if (stripos ($ai_code, 'embed]') !== false) {
|
3077 |
+
$replace_embed = true;
|
3078 |
+
|
3079 |
+
$ai_code = str_ireplace (array ('[embed]', '[/embed]'), array ('[#embed#]', '[#/embed#]'), $ai_code);
|
3080 |
+
}
|
3081 |
+
|
3082 |
$code = replace_ai_tags (do_shortcode ($ai_code), $this->get_ad_general_tag());
|
3083 |
|
3084 |
+
if ($replace_embed) {
|
3085 |
+
$code = str_ireplace (array ('[#embed#]', '[#/embed#]'), array ('[embed]', '[/embed]'), $code);
|
3086 |
+
|
3087 |
+
$code = $GLOBALS[ 'wp_embed']->run_shortcode ($code);
|
3088 |
+
}
|
3089 |
+
|
3090 |
$code = str_replace ('<ad-inserter-dummy-tag>', '<', $code);
|
3091 |
|
3092 |
unset ($ai_wp_data [AI_CURRENT_BLOCK_NUMBER]);
|
3734 |
$client_list_type = '';
|
3735 |
|
3736 |
if (isset ($this->check_url_parameters)) {
|
3737 |
+
// $url_parameters_raw = trim (str_replace (' ', '', $this->check_url_parameters));
|
3738 |
+
$url_parameters_raw = trim ($this->check_url_parameters);
|
3739 |
$url_parameter_list_type = $this->check_url_parameter_list_type;
|
3740 |
}
|
3741 |
|
3758 |
|
3759 |
$check_again = true;
|
3760 |
} else {
|
3761 |
+
// $url_parameters_raw = trim (str_replace (' ', '', $this->get_url_parameter_list ()));
|
3762 |
+
$url_parameters_raw = trim ($this->get_url_parameter_list ());
|
3763 |
$url_parameter_list_type = $this->get_url_parameter_list_type ();
|
3764 |
|
3765 |
$referers_raw = trim (str_replace (' ', '', strtolower ($this->get_ad_domain_list ())));
|
3834 |
if ($ai_wp_data [AI_WP_AMP_PAGE]) $this->needs_class = true;
|
3835 |
$this->wrapping_div_classes []= 'ai-list-block';
|
3836 |
|
3837 |
+
|
3838 |
+
if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_BLOCKS) != 0 && !$this->hide_debug_labels) {
|
3839 |
+
$debug_id = 'ai-debug-info-' . $this->number . '-' . rand (1000, 9999) . rand (1000, 9999);
|
3840 |
+
$debug_id_data = " data-debug-info='$debug_id'";
|
3841 |
+
} else $debug_id_data = '';
|
3842 |
+
|
3843 |
switch ($dynamic_blocks) {
|
3844 |
case AI_DYNAMIC_BLOCKS_CLIENT_SIDE_SHOW:
|
3845 |
if ($url_parameter_attributes != '' && $this->get_manual_loading () == AI_MANUAL_LOADING_AUTO) {
|
3846 |
$list_class = ' ai-list-manual';
|
3847 |
} else $list_class = '';
|
3848 |
|
3849 |
+
$processed_code = "\n<div class='ai-dynamic{$list_class} ai-list-data'{$referer_attributes}{$client_attributes}{$url_parameter_attributes}{$scheduling_attributes}{$debug_id_data}>{$processed_code}</div>\n";
|
3850 |
|
3851 |
if ($scheduling_type !== null) {
|
3852 |
$processed_code .= "<div class='ai-fallback'>{$fallback_code}</div>\n";
|
3864 |
$list_class .= ' ai-list-manual';
|
3865 |
}
|
3866 |
|
3867 |
+
$processed_code = "\n<div class='ai-dynamic{$list_class} ai-list-data'{$referer_attributes}{$client_attributes}{$url_parameter_attributes}{$scheduling_attributes}{$debug_id_data}{$code_data}{$fallback_code_data}></div>\n";
|
3868 |
|
3869 |
if ($ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_AJAX && !$ai_wp_data [AI_CODE_FOR_IFRAME] && !get_disable_js_code ()) {
|
3870 |
$processed_code .= "<script>if (typeof ai_js_code == 'boolean') {var ai_block_div = jQuery ('.{$block_id}'); ai_process_lists (ai_block_div); ai_block_div.removeClass ('{$block_id}');};</script>\n";
|
3902 |
$version_name = $this->version_name == '' ? '' : ' - ' . $this->version_name;
|
3903 |
$block_name = $this->number . ' ' . $this->get_ad_name () . '<kbd data-separator=" - " class="ai-option-name">' . $version_name . '</kbd>';
|
3904 |
|
3905 |
+
$status = $this->get_manual_loading () == AI_MANUAL_LOADING_AUTO ? 'MANUAL LOADING' : 'NOT ENABLED';
|
3906 |
// Debugging label before the hidden block in case manual loading is set to Auto and the block has not been enabled yet
|
3907 |
+
$this->additional_code_before_block = $debug_manual_loading->bar ($block_name, '', 'NOT LOADED', $status, '', $debug_id);
|
3908 |
}
|
3909 |
}
|
3910 |
|
4534 |
|
4535 |
// Debugging label before the hidden block in case manual loading is set to Auto and the block has not been enabled yet
|
4536 |
if ($this->additional_code_before_block != '') {
|
4537 |
+
$classes = array ('ai-debug-info');
|
4538 |
|
4539 |
if ($alignment_class) $classes []= $alignment_class;
|
4540 |
|
constants.php
CHANGED
@@ -31,7 +31,7 @@ if (!defined( 'AD_INSERTER_NAME'))
|
|
31 |
define ('AD_INSERTER_NAME', 'Ad Inserter');
|
32 |
|
33 |
if (!defined( 'AD_INSERTER_VERSION'))
|
34 |
-
define ('AD_INSERTER_VERSION', '2.6.
|
35 |
|
36 |
if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
|
37 |
define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
|
31 |
define ('AD_INSERTER_NAME', 'Ad Inserter');
|
32 |
|
33 |
if (!defined( 'AD_INSERTER_VERSION'))
|
34 |
+
define ('AD_INSERTER_VERSION', '2.6.14');
|
35 |
|
36 |
if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
|
37 |
define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
|
css/ai-settings.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
#ai-data {
|
2 |
-
font-family: "2.6.
|
3 |
}
|
4 |
|
5 |
#blocked-warning {
|
1 |
#ai-data {
|
2 |
+
font-family: "2.6.14"; /* Used for version number of the file */
|
3 |
}
|
4 |
|
5 |
#blocked-warning {
|
includes/js/ai-lists.js
CHANGED
@@ -126,10 +126,14 @@ jQuery (function ($) {
|
|
126 |
|
127 |
if (tcData.eventStatus == 'tcloaded' || tcData.eventStatus == 'useractioncomplete') {
|
128 |
ai_tcData = tcData;
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
|
|
|
|
|
|
133 |
setTimeout (function () {ai_process_lists ();}, 10);
|
134 |
|
135 |
if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi getTCData success", ai_tcData);
|
@@ -147,7 +151,10 @@ jQuery (function ($) {
|
|
147 |
}
|
148 |
} else {
|
149 |
if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi getTCData failed");
|
150 |
-
|
|
|
|
|
|
|
151 |
});
|
152 |
}
|
153 |
}
|
@@ -355,6 +362,7 @@ jQuery (function ($) {
|
|
355 |
var url_parameters_need_tcData = false;
|
356 |
if (enable_block) {
|
357 |
var parameter_list = $(this).attr ("parameter-list");
|
|
|
358 |
if (typeof parameter_list != "undefined") {
|
359 |
var parameter_list_array = b64d (parameter_list).split (",");
|
360 |
var parameter_list_type = $(this).attr ("parameter-list-type");
|
@@ -399,95 +407,104 @@ jQuery (function ($) {
|
|
399 |
|
400 |
if (ai_debug) console.log ("");
|
401 |
if (ai_debug) console.log ("AI LISTS item check", list_parameter_org);
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
//
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
}
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
//
|
488 |
-
|
489 |
-
}
|
490 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
491 |
|
492 |
if (!list_passed) {
|
493 |
if (ai_debug) console.log ("AI LISTS item failed", list_parameter_org);
|
@@ -522,8 +539,15 @@ jQuery (function ($) {
|
|
522 |
}
|
523 |
}
|
524 |
|
525 |
-
|
526 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
527 |
}
|
528 |
|
529 |
if (ai_debug) console.log ("AI LISTS list passed", list_passed);
|
@@ -708,11 +732,13 @@ jQuery (function ($) {
|
|
708 |
__tcfapi ('addEventListener', 2, ai_iab_tcf_callback);
|
709 |
}
|
710 |
|
711 |
-
|
|
|
712 |
|
713 |
-
|
714 |
-
|
715 |
-
|
|
|
716 |
}
|
717 |
}
|
718 |
|
126 |
|
127 |
if (tcData.eventStatus == 'tcloaded' || tcData.eventStatus == 'useractioncomplete') {
|
128 |
ai_tcData = tcData;
|
129 |
+
|
130 |
+
if (!tcData.gdprApplies) {
|
131 |
+
jQuery('#ai-iab-tcf-status').text ('GDPR DOES NOT APPLY');
|
132 |
+
} else {
|
133 |
+
$('#ai-iab-tcf-status').text ('DATA LOADED');
|
134 |
+
}
|
135 |
+
$('#ai-iab-tcf-bar').addClass ('status-ok').removeClass ('status-error');
|
136 |
+
|
137 |
setTimeout (function () {ai_process_lists ();}, 10);
|
138 |
|
139 |
if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi getTCData success", ai_tcData);
|
151 |
}
|
152 |
} else {
|
153 |
if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi getTCData failed");
|
154 |
+
|
155 |
+
$('#ai-iab-tcf-status').text ('__tcfapi getTCData failed');
|
156 |
+
$('#ai-iab-tcf-bar').removeClass ('status-ok').addClass ('status-error');
|
157 |
+
}
|
158 |
});
|
159 |
}
|
160 |
}
|
362 |
var url_parameters_need_tcData = false;
|
363 |
if (enable_block) {
|
364 |
var parameter_list = $(this).attr ("parameter-list");
|
365 |
+
|
366 |
if (typeof parameter_list != "undefined") {
|
367 |
var parameter_list_array = b64d (parameter_list).split (",");
|
368 |
var parameter_list_type = $(this).attr ("parameter-list-type");
|
407 |
|
408 |
if (ai_debug) console.log ("");
|
409 |
if (ai_debug) console.log ("AI LISTS item check", list_parameter_org);
|
410 |
+
|
411 |
+
var cookie_name = list_parameter;
|
412 |
+
var cookie_value = '!@!';
|
413 |
+
// General check
|
414 |
+
var structured_data = list_parameter.indexOf ('[') != - 1;
|
415 |
+
var euconsent_v2_check = list_parameter.indexOf ('euconsent-v2') == 0 && list_parameter.indexOf ('[') != - 1;
|
416 |
+
|
417 |
+
if (list_parameter.indexOf ('=') != - 1) {
|
418 |
+
var list_parameter_data = list_parameter.split ("=");
|
419 |
+
cookie_name = list_parameter_data [0];
|
420 |
+
cookie_value = list_parameter_data [1];
|
421 |
+
// Check again only cookie name (no value)
|
422 |
+
structured_data = cookie_name.indexOf ('[') != - 1;
|
423 |
+
euconsent_v2_check = cookie_name.indexOf ('euconsent-v2') == 0 && cookie_name.indexOf ('[') != - 1;
|
424 |
+
}
|
425 |
+
|
426 |
+
if (euconsent_v2_check) {
|
427 |
+
// IAB Europe Transparency and Consent Framework (TCF v2)
|
428 |
+
if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2");
|
429 |
+
|
430 |
+
$('#ai-iab-tcf-bar').show ();
|
431 |
+
|
432 |
+
if (typeof ai_tcData == 'object') {
|
433 |
+
if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: ai_tcData set");
|
434 |
+
|
435 |
+
$('#ai-iab-tcf-bar').addClass ('status-ok');
|
436 |
+
|
437 |
+
var indexes = cookie_name.replace (/]| /gi, '').split ('[');
|
438 |
+
// Remove cookie name (euconsent-v2)
|
439 |
+
indexes.shift ();
|
440 |
+
|
441 |
+
if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: tcData", ai_tcData);
|
442 |
+
|
443 |
+
var structured_data_found = ai_structured_data_item (indexes, ai_tcData, cookie_value);
|
444 |
+
|
445 |
+
if (ai_debug) console.log ("AI LISTS COOKIE", cookie_value == '!@!' ? cookie_name : cookie_name + '=' + cookie_value, structured_data_found);
|
446 |
+
|
447 |
+
if (structured_data_found) {
|
448 |
+
list_passed = result;
|
449 |
+
} else list_passed = !result;
|
450 |
+
} else {
|
451 |
+
// Mark this list as unprocessed - will be processed later when __tcfapi callback function is called
|
452 |
+
block_div.addClass ('ai-list-data');
|
453 |
+
url_parameters_no_ai_tcData_yet = true;
|
454 |
+
|
455 |
+
if (typeof __tcfapi == 'function') {
|
456 |
+
// Already available
|
457 |
+
check_and_call__tcfapi (false)
|
458 |
+
} else {
|
459 |
+
if (typeof ai_tcData_retrying == 'undefined') {
|
460 |
+
ai_tcData_retrying = true;
|
461 |
+
|
462 |
+
if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi not found, waiting...");
|
463 |
+
|
464 |
+
setTimeout (function() {
|
465 |
+
if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: checking again for __tcfapi");
|
466 |
+
check_and_call__tcfapi (true);
|
467 |
+
}, 200);
|
468 |
+
} else {
|
469 |
+
if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi still waiting...");
|
470 |
+
}
|
471 |
+
}
|
472 |
+
}
|
473 |
+
} else
|
474 |
+
|
475 |
+
if (structured_data) {
|
476 |
+
var structured_data_found = ai_structured_data (cookie_array, cookie_name, cookie_value);
|
477 |
+
|
478 |
+
if (ai_debug) console.log ("AI LISTS COOKIE", cookie_value == '!@!' ? cookie_name : cookie_name + '=' + cookie_value, 'found: ', structured_data_found);
|
479 |
+
|
480 |
+
if (structured_data_found) {
|
481 |
+
list_passed = result;
|
482 |
+
} else list_passed = !result;
|
483 |
+
} else {
|
484 |
+
var cookie_found = false;
|
485 |
+
if (cookie_value == '!@!') {
|
486 |
+
// Check only cookie presence
|
487 |
+
cookies.every (function (cookie) {
|
488 |
+
var cookie_data = cookie.split ("=");
|
489 |
+
|
490 |
+
if (cookie_data [0] == list_parameter) {
|
491 |
+
cookie_found = true;
|
492 |
+
return false; // exit from cookies.every
|
493 |
+
}
|
494 |
+
|
495 |
+
return true; // Next loop iteration
|
496 |
+
});
|
497 |
+
} else {
|
498 |
+
// Check cookie with value
|
499 |
+
cookie_found = cookies.indexOf (list_parameter) != - 1;
|
500 |
+
}
|
501 |
+
|
502 |
+
if (ai_debug) console.log ("AI LISTS COOKIE", list_parameter, 'found: ', found);
|
503 |
+
|
504 |
+
if (cookie_found) {
|
505 |
+
list_passed = result;
|
506 |
+
} else list_passed = !result;
|
507 |
+
}
|
508 |
|
509 |
if (!list_passed) {
|
510 |
if (ai_debug) console.log ("AI LISTS item failed", list_parameter_org);
|
539 |
}
|
540 |
}
|
541 |
|
542 |
+
var debug_info = $(this).data ('debug-info');
|
543 |
+
if (typeof debug_info != 'undefined') {
|
544 |
+
var debug_info_element = $('.' + debug_info);
|
545 |
+
if (debug_info_element.length != 0) {
|
546 |
+
var debug_bar = debug_info_element.parent ();
|
547 |
+
if (debug_bar.hasClass ('ai-debug-info')) {
|
548 |
+
debug_bar.remove ();
|
549 |
+
}
|
550 |
+
}
|
551 |
}
|
552 |
|
553 |
if (ai_debug) console.log ("AI LISTS list passed", list_passed);
|
732 |
__tcfapi ('addEventListener', 2, ai_iab_tcf_callback);
|
733 |
}
|
734 |
|
735 |
+
if (typeof ai_load_blocks == 'function') {
|
736 |
+
jQuery(document).on ("cmplzEnableScripts", ai_cmplzEnableScripts);
|
737 |
|
738 |
+
function ai_cmplzEnableScripts (consentData) {
|
739 |
+
if (consentData.consentLevel === 'all'){
|
740 |
+
ai_load_blocks ();
|
741 |
+
}
|
742 |
}
|
743 |
}
|
744 |
|
includes/js/ai-lists.min.js
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$jscomp.createTemplateTagFirstArgWithRaw=function(a,k){a.raw=k;return a};$jscomp.arrayIteratorImpl=function(a){var k=0;return function(){return k<a.length?{done:!1,value:a[k++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var k="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return k?k.call(a):$jscomp.arrayIterator(a)};
|
2 |
-
jQuery(function(a){function k(h){h=h.match(
|
3 |
-
typeof b&&"array"!=typeof b)return!1;var e=d[0];d=d.slice(1);if("*"==e)for(b=$jscomp.makeIterator(Object.entries(b)),e=b.next();!e.done;e=b.next()){if(e=$jscomp.makeIterator(e.value),e.next(),e=e.next().value,f(d,e,g))return!0}else if(e in b)return f(d,b[e],g);return!1}function
|
4 |
-
b){b
|
5 |
-
typeof ai_tcData_requested&&(ai_tcData_requested=!0,
|
6 |
-
""!=
|
7 |
-
|
8 |
-
c.substr(1,c.length-2).toLowerCase(),-1!=
|
9 |
-
try{var c=JSON.parse(decodeURIComponent(u[1]))}catch(
|
10 |
-
"").split("[")
|
11 |
-
C.
|
12 |
-
"
|
13 |
-
|
14 |
-
|
15 |
-
d.find(".ai-debug-block").length?(d.css({visibility:""}).removeClass("ai-close"),d.hasClass("ai-remove-position")&&d.css({position:""})):d.hide());a(this).attr("data-code","");a(this).attr("data-fallback-code","");d.removeClass("ai-list-block")})}};
|
16 |
-
(ai_tcData=f,ai_load_blocks(),jQuery("#ai-iab-tcf-status").text("DATA LOADED"),jQuery("#ai-iab-tcf-bar").addClass("status-ok").removeClass("status-error"))});jQuery(document).on("cmplzEnableScripts",function(f){"all"===
|
|
|
17 |
function ai_process_element(a){setTimeout(function(){"function"==typeof ai_process_rotations_in_element&&ai_process_rotations_in_element(a);"function"==typeof ai_process_lists&&ai_process_lists(jQuery("div.ai-list-data",a));"function"==typeof ai_process_ip_addresses&&ai_process_ip_addresses(jQuery("div.ai-ip-data",a));"function"==typeof ai_adb_process_blocks&&ai_adb_process_blocks(a)},5)}
|
18 |
-
function getAllUrlParams(a){var k=a?a.split("?")[1]:window.location.search.slice(1);a={};if(k){k=k.split("#")[0];k=k.split("&");for(var
|
1 |
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$jscomp.createTemplateTagFirstArgWithRaw=function(a,k){a.raw=k;return a};$jscomp.arrayIteratorImpl=function(a){var k=0;return function(){return k<a.length?{done:!1,value:a[k++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var k="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return k?k.call(a):$jscomp.arrayIterator(a)};
|
2 |
+
jQuery(function(a){function k(h){h=h.match(p);return null!=h&&1<h.length&&"string"===typeof h[1]&&0<h[1].length?h[1].toLowerCase():null}function y(h){try{var f=Date.parse(h);isNaN(f)&&(f=null)}catch(z){f=null}return f}Array.prototype.includes||(Array.prototype.includes=function(h){return!!~this.indexOf(h)});var p=/:\/\/(.[^/:]+)/i;ai_process_lists=function(h){function f(d,b,g){if(0==d.length){if("!@!"==g)return!0;b!=g&&("true"==g.toLowerCase()?g=!0:"false"==g.toLowerCase()&&(g=!1));return b==g}if("object"!=
|
3 |
+
typeof b&&"array"!=typeof b)return!1;var e=d[0];d=d.slice(1);if("*"==e)for(b=$jscomp.makeIterator(Object.entries(b)),e=b.next();!e.done;e=b.next()){if(e=$jscomp.makeIterator(e.value),e.next(),e=e.next().value,f(d,e,g))return!0}else if(e in b)return f(d,b[e],g);return!1}function z(d,b,g){if("object"!=typeof d||-1==b.indexOf("["))return!1;b=b.replace(/]| /gi,"").split("[");return f(b,d,g)}function T(){"function"==typeof __tcfapi&&(a("#ai-iab-tcf-status").text("DETECTED"),__tcfapi("getTCData",2,function(d,
|
4 |
+
b){b?(a("#ai-iab-tcf-bar").addClass("status-ok"),"tcloaded"==d.eventStatus||"useractioncomplete"==d.eventStatus?(ai_tcData=d,d.gdprApplies?a("#ai-iab-tcf-status").text("DATA LOADED"):jQuery("#ai-iab-tcf-status").text("GDPR DOES NOT APPLY"),a("#ai-iab-tcf-bar").addClass("status-ok").removeClass("status-error"),setTimeout(function(){ai_process_lists()},10)):"cmpuishown"==d.eventStatus&&(ai_cmpuishown=!0,a("#ai-iab-tcf-status").text("CMP UI SHOWN"),a("#ai-iab-tcf-bar").addClass("status-ok").removeClass("status-error"))):
|
5 |
+
(a("#ai-iab-tcf-status").text("__tcfapi getTCData failed"),a("#ai-iab-tcf-bar").removeClass("status-ok").addClass("status-error"))}))}function K(d){"function"==typeof __tcfapi?"undefined"==typeof ai_tcData_requested&&(ai_tcData_requested=!0,T(),url_parameters_need_tcData=!0):d&&(a("#ai-iab-tcf-bar").addClass("status-error").removeClass("status-ok"),a("#ai-iab-tcf-status").text("MISSING: __tcfapi function not found"))}h=null==h?a("div.ai-list-data"):h.filter(".ai-list-data");if(h.length){h.removeClass("ai-list-data");
|
6 |
+
var C=document.cookie.split(";");C.forEach(function(d,b){C[b]=d.trim()});var L=getAllUrlParams(window.location.search);if(null!=L.referrer)var q=L.referrer;else q=document.referrer,""!=q&&(q=k(q));var F=window.navigator.userAgent,G=F.toLowerCase();if("undefined"!==typeof MobileDetect)var M=new MobileDetect(F);h.each(function(){var d=a(this).closest("div.AI_FUNCT_GET_BLOCK_CLASS_NAME"),b=!0,g=a(this).attr("referer-list");if("undefined"!=typeof g){g=b64d(g).split(",");var e=a(this).attr("referer-list-type"),
|
7 |
+
m=!1;a.each(g,function(u,c){if(""==c)return!0;if("*"==c.charAt(0))if("*"==c.charAt(c.length-1)){if(c=c.substr(1,c.length-2),-1!=q.indexOf(c))return m=!0,!1}else{if(c=c.substr(1),q.substr(-c.length)==c)return m=!0,!1}else if("*"==c.charAt(c.length-1)){if(c=c.substr(0,c.length-1),0==q.indexOf(c))return m=!0,!1}else if("#"==c){if(""==q)return m=!0,!1}else if(c==q)return m=!0,!1});switch(e){case "B":m&&(b=!1);break;case "W":m||(b=!1)}}if(b&&(g=a(this).attr("client-list"),"undefined"!=typeof g&&"undefined"!==
|
8 |
+
typeof M))switch(g=b64d(g).split(","),e=a(this).attr("client-list-type"),m=!1,a.each(g,function(u,c){if(""==c)return!0;if("*"==c.charAt(0))if("*"==c.charAt(c.length-1)){if(c=c.substr(1,c.length-2).toLowerCase(),-1!=G.indexOf(c))return m=!0,!1}else{if(c=c.substr(1).toLowerCase(),G.substr(-c.length)==c)return m=!0,!1}else if("*"==c.charAt(c.length-1)){if(c=c.substr(0,c.length-1).toLowerCase(),0==G.indexOf(c))return m=!0,!1}else if(M.is(c))return m=!0,!1}),e){case "B":m&&(b=!1);break;case "W":m||(b=
|
9 |
+
!1)}var N=g=!1;if(b&&(e=a(this).attr("parameter-list"),"undefined"!=typeof e)){e=b64d(e).split(",");var r=a(this).attr("parameter-list-type"),O=[];C.forEach(function(u){u=u.split("=");try{var c=JSON.parse(decodeURIComponent(u[1]))}catch(P){c=decodeURIComponent(u[1])}O[u[0]]=c});var v=!1,D=a(this);a.each(e,function(u,c){var P=c.split("&&");a.each(P,function(V,n){var w=!0;n=n.trim();"!!"==n.substring(0,2)&&(w=!1,n=n.substring(2));var t=n,x="!@!",Q=-1!=n.indexOf("["),R=0==n.indexOf("euconsent-v2")&&
|
10 |
+
-1!=n.indexOf("[");-1!=n.indexOf("=")&&(x=n.split("="),t=x[0],x=x[1],Q=-1!=t.indexOf("["),R=0==t.indexOf("euconsent-v2")&&-1!=t.indexOf("["));if(R)a("#ai-iab-tcf-bar").show(),"object"==typeof ai_tcData?(a("#ai-iab-tcf-bar").addClass("status-ok"),t=t.replace(/]| /gi,"").split("["),t.shift(),v=(t=f(t,ai_tcData,x))?w:!w):(D.addClass("ai-list-data"),N=!0,"function"==typeof __tcfapi?K(!1):"undefined"==typeof ai_tcData_retrying&&(ai_tcData_retrying=!0,setTimeout(function(){K(!0)},200)));else if(Q)v=(t=
|
11 |
+
z(O,t,x))?w:!w;else{var H=!1;"!@!"==x?C.every(function(U){return U.split("=")[0]==n?(H=!0,!1):!0}):H=-1!=C.indexOf(n);v=H?w:!w}if(!v)return!1});if(v)return!1});switch(r){case "B":v&&(b=!1);break;case "W":v||(b=!1)}a(this).hasClass("ai-list-manual")&&(b?(D.removeClass("ai-list-data"),D.removeClass("ai-list-manual")):(g=!0,D.addClass("ai-list-data")));e=a(this).data("debug-info");if("undefined"!=typeof e&&(e=a("."+e),0!=e.length)){var l=e.parent();l.hasClass("ai-debug-info")&&l.remove()}}l=a(this).prevAll(".ai-debug-bar.ai-debug-lists");
|
12 |
+
e=""==q?"#":q;l.find(".ai-debug-name.ai-list-info").text(e).attr("title",F);l.find(".ai-debug-name.ai-list-status").text(b?ai_front.visible:ai_front.hidden);e=!1;if(b){var E=a(this).attr("scheduling-start");l=a(this).attr("scheduling-end");var A=a(this).attr("scheduling-days");if("undefined"!=typeof E&&"undefined"!=typeof l&&"undefined"!=typeof A){e=!0;var I=parseInt(a(this).attr("scheduling-fallback"));r=parseInt(a(this).attr("gmt"));var B=y(b64d(E))+r;l=y(b64d(l))+r;E=b64d(A).split(",");A=a(this).attr("scheduling-type");
|
13 |
+
var J=(new Date).getTime()+r,S=new Date(J);r=S.getDay();0==r?r=6:r--;B=J>=B&&J<l&&E.includes(r.toString());switch(A){case "B":B=!B}B||(b=!1);A=S.toISOString().split(".")[0].replace("T"," ");l=a(this).prevAll(".ai-debug-bar.ai-debug-scheduling");l.find(".ai-debug-name.ai-scheduling-info").text(A+" "+r);l.find(".ai-debug-name.ai-scheduling-status").text(b?ai_front.visible:ai_front.hidden);b||0==I||(l.removeClass("ai-debug-scheduling").addClass("ai-debug-fallback"),l.find(".ai-debug-name.ai-scheduling-status").text(ai_front.fallback+
|
14 |
+
"="+I))}}if(g||N)return!0;a(this).css({visibility:"",position:"",width:"",height:"","z-index":""});b?(d.css({visibility:""}),d.hasClass("ai-remove-position")&&d.css({position:""}),"undefined"!=typeof a(this).data("code")&&(b=b64d(a(this).data("code")),a(this).append(b),ai_process_element(this))):e&&!B&&0!=I?(d.css({visibility:""}),d.hasClass("ai-remove-position")&&d.css({position:""}),a(this).next(".ai-fallback").removeClass("ai-fallback"),"undefined"!=typeof a(this).data("fallback-code")?(b=b64d(a(this).data("fallback-code")),
|
15 |
+
a(this).append(b),ai_process_element(this)):a(this).hide(),b=d.attr("data-ai"),"undefined"!==typeof b&&!1!==b&&(b=a(this).attr("fallback-tracking"),"undefined"!==typeof b&&!1!==b&&d.attr("data-ai",b))):(a(this).hide(),d.removeAttr("data-ai").removeClass("ai-track"),d.find(".ai-debug-block").length?(d.css({visibility:""}).removeClass("ai-close"),d.hasClass("ai-remove-position")&&d.css({position:""})):d.hide());a(this).attr("data-code","");a(this).attr("data-fallback-code","");d.removeClass("ai-list-block")})}};
|
16 |
+
a(document).ready(function(h){setTimeout(function(){ai_process_lists();(jQuery("#ai-iab-tcf-bar").length||jQuery(".ai-list-manual").length)&&"function"==typeof __tcfapi&&__tcfapi("addEventListener",2,function(f,z){z&&"useractioncomplete"===f.eventStatus&&(ai_tcData=f,ai_load_blocks(),jQuery("#ai-iab-tcf-status").text("DATA LOADED"),jQuery("#ai-iab-tcf-bar").addClass("status-ok").removeClass("status-error"))});if("function"==typeof ai_load_blocks)jQuery(document).on("cmplzEnableScripts",function(f){"all"===
|
17 |
+
f.consentLevel&&ai_load_blocks()});jQuery("#ai-iab-tcf-bar").click(function(){AiCookies.remove("euconsent-v2",{path:"/",domain:"."+window.location.hostname});jQuery("#ai-iab-tcf-status").text("COOKIE DELETED")})},5)})});
|
18 |
function ai_process_element(a){setTimeout(function(){"function"==typeof ai_process_rotations_in_element&&ai_process_rotations_in_element(a);"function"==typeof ai_process_lists&&ai_process_lists(jQuery("div.ai-list-data",a));"function"==typeof ai_process_ip_addresses&&ai_process_ip_addresses(jQuery("div.ai-ip-data",a));"function"==typeof ai_adb_process_blocks&&ai_adb_process_blocks(a)},5)}
|
19 |
+
function getAllUrlParams(a){var k=a?a.split("?")[1]:window.location.search.slice(1);a={};if(k){k=k.split("#")[0];k=k.split("&");for(var y=0;y<k.length;y++){var p=k[y].split("="),h=void 0,f=p[0].replace(/\[\d*\]/,function(z){h=z.slice(1,-1);return""});p="undefined"===typeof p[1]?"":p[1];f=f.toLowerCase();p=p.toLowerCase();a[f]?("string"===typeof a[f]&&(a[f]=[a[f]]),"undefined"===typeof h?a[f].push(p):a[f][h]=p):a[f]=p}}return a};
|
js/ad-inserter.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
var javascript_version = "2.6.
|
2 |
var ignore_key = true;
|
3 |
var start = 1;
|
4 |
var end = 16;
|
1 |
+
var javascript_version = "2.6.14";
|
2 |
var ignore_key = true;
|
3 |
var start = 1;
|
4 |
var end = 16;
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Tags: ads, adsense, ad rotation, ad manager, amp, amazon, ad blocking detection,
|
|
6 |
Requires at least: 4.6
|
7 |
Tested up to: 5.5
|
8 |
Requires PHP: 5.6
|
9 |
-
Stable tag: 2.6.
|
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
|
@@ -335,6 +335,10 @@ If you are not happy to reveal this information and you have opted in, simply di
|
|
335 |
|
336 |
== Changelog ==
|
337 |
|
|
|
|
|
|
|
|
|
338 |
= 2.6.13 =
|
339 |
- Few minor bug fixes
|
340 |
|
@@ -454,6 +458,10 @@ For the changelog of earlier versions, please refer to the separate changelog.tx
|
|
454 |
|
455 |
== Upgrade Notice ==
|
456 |
|
|
|
|
|
|
|
|
|
457 |
= 2.6.13 =
|
458 |
Few minor bug fixes
|
459 |
|
6 |
Requires at least: 4.6
|
7 |
Tested up to: 5.5
|
8 |
Requires PHP: 5.6
|
9 |
+
Stable tag: 2.6.14
|
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
|
335 |
|
336 |
== Changelog ==
|
337 |
|
338 |
+
= 2.6.14 =
|
339 |
+
- Added support to insert [embed] shortcodes
|
340 |
+
- Few minor bug fixes, cosmetic changes and code improvements
|
341 |
+
|
342 |
= 2.6.13 =
|
343 |
- Few minor bug fixes
|
344 |
|
458 |
|
459 |
== Upgrade Notice ==
|
460 |
|
461 |
+
= 2.6.14 =
|
462 |
+
Added support to insert [embed] shortcodes;
|
463 |
+
Few minor bug fixes, cosmetic changes and code improvements
|
464 |
+
|
465 |
= 2.6.13 =
|
466 |
Few minor bug fixes
|
467 |
|