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

Version Description

  • Added support for sticky widgets
  • Added support to insert code after images (Automatic Insertion: After Paragraph, Paragraphs with tags: img)
  • Impression and click tracking (beta, 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.1.9
Comparing to
See all releases

Code changes from version 2.1.7 to 2.1.9

Files changed (7) hide show
  1. ad-inserter.php +189 -55
  2. class.php +28 -12
  3. constants.php +15 -2
  4. css/ad-inserter.css +4 -4
  5. js/ad-inserter.js +130 -54
  6. readme.txt +98 -176
  7. settings.php +47 -30
ad-inserter.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /*
3
  Plugin Name: Ad Inserter
4
- Version: 2.1.7
5
- Description: Insert any ad or code into Wordpress. Perfect for all kinds of ads. Simply enter any ad or HTML/Javascript/PHP code and select where and how you want to display it.
6
  Author: Igor Funa
7
  Author URI: http://igorfuna.com/
8
  Plugin URI: http://adinserter.pro/documentation
@@ -11,8 +11,17 @@ Plugin URI: http://adinserter.pro/documentation
11
  /*
12
  Change Log
13
 
 
 
 
 
 
 
 
 
 
14
  Ad Inserter 2.1.7 - 2017-05-13
15
- - Fixed error using PHP 5.4 or earlier
16
 
17
  Ad Inserter 2.1.6 - 2017-05-12
18
  - Added support for insertion before/after multiple paragraphs
@@ -452,6 +461,7 @@ $ai_wp_data [AI_CONTEXT] = AI_CONTEXT_NONE;
452
  $ai_wp_data [AI_SERVER_SIDE_DETECTION] = false;
453
  $ai_wp_data [AI_CLIENT_SIDE_DETECTION] = false;
454
  $ai_wp_data [AI_TRACKING] = false;
 
455
 
456
  for ($counter = 1; $counter <= AD_INSERTER_BLOCKS; $counter ++) {
457
  $obj = $block_object [$counter];
@@ -501,16 +511,18 @@ if ($adH->get_enable_manual () ||
501
  ($ai_wp_data [AI_WP_USER] & AI_USER_LOGGED_IN) != 0)
502
  add_action ('wp_head', 'ai_wp_head_hook');
503
 
504
- if ($adF->get_enable_manual () ||
505
- $ai_wp_data [AI_TRACKING] ||
506
- get_dynamic_blocks () == AI_DYNAMIC_BLOCKS_CLIENT_SIDE)
507
- add_action ('wp_footer', 'ai_wp_footer_hook');
 
508
 
509
  if (function_exists ('ai_system_output_check')) $ai_system_output = ai_system_output_check (); else $ai_system_output = false;
510
 
511
  if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0 || $ai_system_output)
512
  add_action ('shutdown', 'ai_shutdown_hook');
513
 
 
514
  add_action ('widgets_init', 'ai_widgets_init_hook');
515
  add_action ('add_meta_boxes', 'ai_add_meta_box_hook');
516
  add_action ('save_post', 'ai_save_meta_box_data_hook');
@@ -528,6 +540,7 @@ if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0) {
528
  }
529
 
530
 
 
531
  function ai_toolbar ($wp_admin_bar) {
532
  global $block_object, $ai_wp_data;
533
 
@@ -628,8 +641,8 @@ function ai_toolbar ($wp_admin_bar) {
628
  ($paragraph_block ['direction'] == 'b' ? ' <span class="dashicons dashicons-arrow-up-alt up-icon"></span>' : '').
629
  ($paragraph_block ['min'] != 0 ? ' min '.$paragraph_block ['min']. ' ' : '').
630
  ($paragraph_block ['max'] != 0 ? ' max '.$paragraph_block ['max']. ' ' : '').
631
- ($paragraph_block ['blockquote'] ? ' blockquote ' : '').
632
- ($paragraph_block ['text'] != '' ? ($paragraph_block ['text_type'] == AD_DO_NOT_CONTAIN ? ' NC ' : ' C ').' '.$paragraph_block ['text'] : ''),
633
  'href' => set_url_parameter (AI_URL_DEBUG_POSITIONS, $paragraph_block ['blocks'][0]),
634
  ));
635
  }
@@ -947,6 +960,7 @@ function ai_admin_enqueue_scripts ($hook_suffix) {
947
  'jquery-ui-button',
948
  'jquery-ui-tooltip',
949
  'jquery-ui-datepicker',
 
950
  ), AD_INSERTER_VERSION);
951
  wp_enqueue_style ('ai-admin-jquery-ui', plugins_url ('css/jquery-ui-1.10.3.custom.min.css', __FILE__), array (), null);
952
 
@@ -1027,7 +1041,7 @@ function add_head_inline_styles_and_scripts () {
1027
  function add_footer_inline_scripts () {
1028
  global $ai_wp_data;
1029
 
1030
- $inline_scripts = $ai_wp_data [AI_TRACKING] || get_dynamic_blocks () == AI_DYNAMIC_BLOCKS_CLIENT_SIDE;
1031
 
1032
  if ($inline_scripts) echo "<script type='text/javascript'>\n";
1033
 
@@ -1036,28 +1050,52 @@ function add_footer_inline_scripts () {
1036
  $block_class_name = get_block_class_name ();
1037
  if ($block_class_name == '') $block_class_name = DEFAULT_BLOCK_CLASS_NAME;
1038
 
1039
- echo 'jQuery (function ($) {
1040
- var wrapping_div_class = ".', $block_class_name, '";
1041
- $("div.ai-rotate").each (function () {
1042
- var rotate_options = $(".ai-rotate-option", this);
1043
- var random_index = Math.floor (Math.random () * rotate_options.length);
1044
- rotate_options.hide ();
1045
- $(rotate_options [random_index]).css ({"display": "", "visibility": "", "position": "", "width": "", "height": "", "top": "", "left": ""});
1046
- $(this).css ({"position": ""});
1047
-
1048
- var wrapping_div = $(this).closest (wrapping_div_class);
1049
- var data = JSON.parse (atob (wrapping_div.data ("ai")));
1050
- if (typeof data !== "undefined" && data.constructor === Array) {
1051
- data [1] = random_index + 1;
1052
- wrapping_div.data ("ai", btoa (JSON.stringify (data)))
1053
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1054
 
1055
- });
1056
- });
1057
- ';
1058
 
1059
- // echo 'jQuery(function($){$("div.ai-rotate").each(function(){var rotate_options=$(".ai-rotate-option",this);var random_index=Math.floor(Math.random()*rotate_options.length);rotate_options.hide();$(rotate_options[random_index]).css({"display":"","visibility":"","position":"","width":"","height":"","top":"","left":""});$(this).css({"position":""});var wrapping_div=$(this).parent();var version=wrapping_div.attr("version");if(typeof version!=="undefined"&&!isNaN(version))wrapping_div.attr("version",random_index+
1060
- //1)})});';
1061
  }
1062
 
1063
  if (function_exists ('add_footer_inline_scripts_2')) {
@@ -1300,6 +1338,10 @@ function ai_save_meta_box_data_hook ($post_id) {
1300
  update_post_meta ($post_id, '_adinserter_block_exceptions', implode (",", $selected));
1301
  }
1302
 
 
 
 
 
1303
  function ai_widgets_init_hook () {
1304
  if (is_multisite() && !is_main_site () && !multisite_widgets_enabled ()) return;
1305
  register_widget ('ai_widget');
@@ -1390,7 +1432,10 @@ function ai_write_debug_info ($write_processing_log = false) {
1390
  echo "USER: ";
1391
  if (($ai_wp_data [AI_WP_USER] & AI_USER_LOGGED_IN) == AI_USER_LOGGED_IN) echo "LOGGED-IN "; else echo "NOT LOGGED-IN ";
1392
  if (($ai_wp_data [AI_WP_USER] & AI_USER_ADMINISTRATOR) == AI_USER_ADMINISTRATOR) echo "ADMINISTRATOR";
 
1393
  echo "\n";
 
 
1394
  echo "PAGE TYPE: ";
1395
  switch ($ai_wp_data [AI_WP_PAGE_TYPE]) {
1396
  case AI_PT_STATIC: echo "STATIC PAGE"; break;
@@ -1439,6 +1484,34 @@ function ai_write_debug_info ($write_processing_log = false) {
1439
  elseif (AI_PHONE) echo "PHONE\n";
1440
  else echo "?\n";
1441
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1442
 
1443
  echo "\n";
1444
 
@@ -1655,6 +1728,21 @@ function ai_check_plugin_options ($plugin_options = array ()) {
1655
 
1656
  if (!isset ($plugin_options ['MINIMUM_USER_ROLE'])) $plugin_options ['MINIMUM_USER_ROLE'] = DEFAULT_MINIMUM_USER_ROLE;
1657
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1658
  if (!isset ($plugin_options ['PLUGIN_PRIORITY'])) $plugin_options ['PLUGIN_PRIORITY'] = DEFAULT_PLUGIN_PRIORITY;
1659
  $plugin_priority = $plugin_options ['PLUGIN_PRIORITY'];
1660
  if (!is_numeric ($plugin_priority)) {
@@ -1793,6 +1881,14 @@ function get_minimum_user_role () {
1793
  return ($ai_db_options [AI_GLOBAL_OPTION_NAME]['MINIMUM_USER_ROLE']);
1794
  }
1795
 
 
 
 
 
 
 
 
 
1796
  function get_plugin_priority () {
1797
  global $ai_db_options;
1798
 
@@ -2308,15 +2404,16 @@ function ai_settings () {
2308
 
2309
  if (function_exists ('ai_filter_global_settings')) ai_filter_global_settings ($options);
2310
 
2311
- $options ['SYNTAX_HIGHLIGHTER_THEME'] = filter_string ($_POST ['syntax-highlighter-theme']);
2312
- $options ['BLOCK_CLASS_NAME'] = filter_html_class ($_POST ['block-class-name']);
2313
- $options ['MINIMUM_USER_ROLE'] = filter_string ($_POST ['minimum-user-role']);
2314
- $options ['PLUGIN_PRIORITY'] = filter_option ('plugin_priority', $_POST ['plugin_priority']);
2315
- $options ['DYNAMIC_BLOCKS'] = filter_option ('dynamic_blocks', $_POST ['dynamic_blocks']);
2316
- $options ['PARAGRAPH_COUNTING_FUNCTIONS'] = filter_option ('paragraph_counting_functions', $_POST ['paragraph_counting_functions']);
2317
- $options ['ADMIN_TOOLBAR_DEBUGGING'] = filter_option ('admin_toolbar_debugging', $_POST ['admin_toolbar_debugging']);
2318
- $options ['REMOTE_DEBUGGING'] = filter_option ('remote_debugging', $_POST ['remote_debugging']);
2319
- $options ['JAVASCRIPT_DEBUGGING'] = filter_option ('javascript_debugging', $_POST ['javascript_debugging']);
 
2320
 
2321
  for ($viewport = 1; $viewport <= AD_INSERTER_VIEWPORTS; $viewport ++) {
2322
  if (isset ($_POST ['viewport-name-'.$viewport]))
@@ -2476,6 +2573,10 @@ function ai_settings () {
2476
  }
2477
  }
2478
  }
 
 
 
 
2479
  }
2480
 
2481
  generate_settings_form ();
@@ -3117,26 +3218,33 @@ class ai_widget extends WP_Widget {
3117
  // Output admin widget options form
3118
 
3119
  $widget_title = !empty ($instance ['widget-title']) ? $instance ['widget-title'] : '';
3120
- $block = isset ($instance ['block']) ? $instance ['block'] : 1;
 
 
3121
 
3122
- if ($block == 0) $title = 'Debugger'; else {
 
 
3123
  $obj = $block_object [$block];
3124
 
3125
  $title = '[' . $block . '] ' . $obj->get_ad_name();
3126
  if (!empty ($widget_title)) $title .= ' - ' . $widget_title;
3127
  if (!$obj->get_enable_widget ()) $title .= ' - DISABLED';
3128
- }
 
 
 
3129
 
3130
  ?>
3131
  <input id="<?php echo $this->get_field_id ('title'); ?>" name="<?php echo $this->get_field_name ('title'); ?>" type="hidden" value="<?php echo esc_attr ($title); ?>">
3132
 
3133
  <p>
3134
- <label for="<?php echo $this->get_field_id ('widget-title'); ?>">Title:</label>
3135
- <input id="<?php echo $this->get_field_id ('widget-title'); ?>" name="<?php echo $this->get_field_name ('widget-title'); ?>" type="text" value="<?php echo esc_attr ($widget_title); ?>" style="width: 90%;">
3136
  </p>
3137
 
3138
  <p>
3139
- <label for="<?php echo $this->get_field_id ('block'); ?>">Block:</label>
3140
  <select id="<?php echo $this->get_field_id ('block'); ?>" name="<?php echo $this->get_field_name('block'); ?>" style="width: 88%;">
3141
  <?php
3142
  for ($block_index = 1; $block_index <= AD_INSERTER_BLOCKS; $block_index ++) {
@@ -3145,14 +3253,16 @@ class ai_widget extends WP_Widget {
3145
  <option value='<?php echo $block_index; ?>' <?php if ($block_index == $block) echo 'selected="selected"'; ?>><?php echo $block_index, ' - ', $obj->get_ad_name(), !$obj->get_enable_widget ()? ' - DISABLED' : ''; ?></option>
3146
  <?php } ?>
3147
  <option value='0' <?php if ($block == 0) echo 'selected="selected"'; ?>>Debugger</option>
 
3148
  </select>
3149
  </p>
3150
 
 
 
 
 
 
3151
  <?php
3152
- $url_parameters = "";
3153
- if (function_exists ('ai_settings_url_parameters')) $url_parameters = ai_settings_url_parameters ($block);
3154
-
3155
- echo "<p><a href='", admin_url ('options-general.php?page=ad-inserter.php'), $url_parameters, "&tab=", $block, "'>Settings</a></p>";
3156
  }
3157
 
3158
  function update ($new_instance, $old_instance) {
@@ -3160,8 +3270,9 @@ class ai_widget extends WP_Widget {
3160
  $instance = $old_instance;
3161
 
3162
  $instance ['widget-title'] = (!empty ($new_instance ['widget-title'])) ? strip_tags ($new_instance ['widget-title']) : '';
3163
- $instance ['title'] = (!empty ($new_instance ['title'])) ? strip_tags ($new_instance ['title']) : '';
3164
- $instance ['block'] = (isset ($new_instance ['block'])) ? $new_instance ['block'] : 1;
 
3165
 
3166
  return $instance;
3167
  }
@@ -3189,7 +3300,8 @@ class ai_widget extends WP_Widget {
3189
  function ai_widget_draw ($args, $instance, &$block) {
3190
  global $block_object, $ad_inserter_globals, $ai_wp_data, $ai_last_check;
3191
 
3192
- $block = isset ($instance ['block']) ? $instance ['block'] : 1;
 
3193
 
3194
  if ($block == 0) {
3195
  if (get_remote_debugging () || ($ai_wp_data [AI_WP_USER] & AI_USER_ADMINISTRATOR) != 0)
@@ -3197,6 +3309,14 @@ function ai_widget_draw ($args, $instance, &$block) {
3197
  return;
3198
  }
3199
 
 
 
 
 
 
 
 
 
3200
  if ($block < 1 || $block > AD_INSERTER_BLOCKS) return;
3201
 
3202
  $title = !empty ($instance ['widget-title']) ? $instance ['widget-title'] : '';
@@ -3229,7 +3349,10 @@ function ai_widget_draw ($args, $instance, &$block) {
3229
 
3230
  // Last check before counter check before insertion
3231
  $ai_last_check = AI_CHECK_CODE;
3232
- if ($obj->ai_getCode () == '') return;
 
 
 
3233
 
3234
  // Last check before insertion
3235
  if (!$obj->check_and_increment_block_counter ()) return;
@@ -3237,7 +3360,10 @@ function ai_widget_draw ($args, $instance, &$block) {
3237
  $ai_last_check = AI_CHECK_DEBUG_NO_INSERTION;
3238
  if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_NO_INSERTION) == 0) {
3239
  $viewport_classes = trim ($obj->get_viewport_classes ());
3240
- if ($viewport_classes != "") echo "<div class='" . $viewport_classes . "'>";
 
 
 
3241
  echo $args ['before_widget'];
3242
 
3243
  if (!empty ($title)) {
@@ -3247,7 +3373,8 @@ function ai_widget_draw ($args, $instance, &$block) {
3247
  echo $obj->get_code_for_insertion (false);
3248
 
3249
  echo $args ['after_widget'];
3250
- if ($viewport_classes != "") echo "</div>";
 
3251
 
3252
  $ai_last_check = AI_CHECK_INSERTED;
3253
 
@@ -3259,8 +3386,15 @@ function ai_widget_draw ($args, $instance, &$block) {
3259
  function ai_widget_draw_debugger ($args, $instance, &$block) {
3260
  global $ai_wp_data, $ai_db_options, $block_object;
3261
 
 
 
3262
  echo $args ['before_widget'];
3263
 
 
 
 
 
 
3264
  $title = !empty ($instance ['widget-title']) ? $instance ['widget-title'] : '';
3265
 
3266
  if (!empty ($title)) {
1
  <?php
2
  /*
3
  Plugin Name: Ad Inserter
4
+ Version: 2.1.9
5
+ Description: Ad management plugin with powerful advertising options to automatically insert ad codes into your website.
6
  Author: Igor Funa
7
  Author URI: http://igorfuna.com/
8
  Plugin URI: http://adinserter.pro/documentation
11
  /*
12
  Change Log
13
 
14
+ Ad Inserter 2.1.9 - 2017-06-30
15
+ - Added support for sticky widgets
16
+ - Added support to insert code after images (Automatic Insertion: After Paragraph, Paragraphs with tags: img)
17
+ - Impression and click tracking (beta, Pro only)
18
+ - Few minor bug fixes, cosmetic changes and code improvements
19
+
20
+ Ad Inserter 2.1.8 - 2017-05-18
21
+ - Fixed error when using server-side device detection
22
+
23
  Ad Inserter 2.1.7 - 2017-05-13
24
+ - Fixed error when using PHP 5.4 or earlier
25
 
26
  Ad Inserter 2.1.6 - 2017-05-12
27
  - Added support for insertion before/after multiple paragraphs
461
  $ai_wp_data [AI_SERVER_SIDE_DETECTION] = false;
462
  $ai_wp_data [AI_CLIENT_SIDE_DETECTION] = false;
463
  $ai_wp_data [AI_TRACKING] = false;
464
+ $ai_wp_data [AI_STICKY_WIDGETS] = false;
465
 
466
  for ($counter = 1; $counter <= AD_INSERTER_BLOCKS; $counter ++) {
467
  $obj = $block_object [$counter];
511
  ($ai_wp_data [AI_WP_USER] & AI_USER_LOGGED_IN) != 0)
512
  add_action ('wp_head', 'ai_wp_head_hook');
513
 
514
+ //if ($adF->get_enable_manual () ||
515
+ // $ai_wp_data [AI_TRACKING] ||
516
+ // get_dynamic_blocks () == AI_DYNAMIC_BLOCKS_CLIENT_SIDE ||
517
+ // $ai_wp_data [AI_STICKY_WIDGETS])
518
+ add_action ('wp_footer', 'ai_wp_footer_hook');
519
 
520
  if (function_exists ('ai_system_output_check')) $ai_system_output = ai_system_output_check (); else $ai_system_output = false;
521
 
522
  if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0 || $ai_system_output)
523
  add_action ('shutdown', 'ai_shutdown_hook');
524
 
525
+ add_action ('get_sidebar', 'ai_get_sidebar');
526
  add_action ('widgets_init', 'ai_widgets_init_hook');
527
  add_action ('add_meta_boxes', 'ai_add_meta_box_hook');
528
  add_action ('save_post', 'ai_save_meta_box_data_hook');
540
  }
541
 
542
 
543
+
544
  function ai_toolbar ($wp_admin_bar) {
545
  global $block_object, $ai_wp_data;
546
 
641
  ($paragraph_block ['direction'] == 'b' ? ' <span class="dashicons dashicons-arrow-up-alt up-icon"></span>' : '').
642
  ($paragraph_block ['min'] != 0 ? ' min '.$paragraph_block ['min']. ' ' : '').
643
  ($paragraph_block ['max'] != 0 ? ' max '.$paragraph_block ['max']. ' ' : '').
644
+ ($paragraph_block ['blockquote'] ? ' [blockquote] ' : '').
645
+ ($paragraph_block ['text'] != '' ? ($paragraph_block ['text_type'] == AD_DO_NOT_CONTAIN ? ' NC ' : ' C ').' ['.$paragraph_block ['text'].']' : ''),
646
  'href' => set_url_parameter (AI_URL_DEBUG_POSITIONS, $paragraph_block ['blocks'][0]),
647
  ));
648
  }
960
  'jquery-ui-button',
961
  'jquery-ui-tooltip',
962
  'jquery-ui-datepicker',
963
+ 'jquery-ui-dialog',
964
  ), AD_INSERTER_VERSION);
965
  wp_enqueue_style ('ai-admin-jquery-ui', plugins_url ('css/jquery-ui-1.10.3.custom.min.css', __FILE__), array (), null);
966
 
1041
  function add_footer_inline_scripts () {
1042
  global $ai_wp_data;
1043
 
1044
+ $inline_scripts = get_dynamic_blocks () == AI_DYNAMIC_BLOCKS_CLIENT_SIDE || $ai_wp_data [AI_TRACKING] || $ai_wp_data [AI_STICKY_WIDGETS];
1045
 
1046
  if ($inline_scripts) echo "<script type='text/javascript'>\n";
1047
 
1050
  $block_class_name = get_block_class_name ();
1051
  if ($block_class_name == '') $block_class_name = DEFAULT_BLOCK_CLASS_NAME;
1052
 
1053
+ // echo 'jQuery (function ($) {
1054
+ // var wrapping_div_class = ".', $block_class_name, '";
1055
+ // $("div.ai-rotate").each (function () {
1056
+ // var rotate_options = $(".ai-rotate-option", this);
1057
+ // var random_index = Math.floor (Math.random () * rotate_options.length);
1058
+
1059
+ // var d = new Date();
1060
+ // var n = d.getMilliseconds();
1061
+ // if (n % 2) random_index = rotate_options.length - random_index - 1;
1062
+
1063
+ // rotate_options.hide ();
1064
+ // $(rotate_options [random_index]).css ({"display": "", "visibility": "", "position": "", "width": "", "height": "", "top": "", "left": ""});
1065
+ // $(this).css ({"position": ""});
1066
+
1067
+ // var wrapping_div = $(this).closest (wrapping_div_class);
1068
+ // if (typeof wrapping_div.data ("ai") != "undefined") {
1069
+ // var data = JSON.parse (atob (wrapping_div.data ("ai")));
1070
+ // if (typeof data !== "undefined" && data.constructor === Array) {
1071
+ // data [1] = random_index + 1;
1072
+ // wrapping_div.data ("ai", btoa (JSON.stringify (data)))
1073
+ // }
1074
+ // }
1075
+ // });
1076
+ // });
1077
+ //';
1078
+
1079
+ echo 'jQuery(function($){var wrapping_div_class=".', $block_class_name, '";$("div.ai-rotate").each(function(){var rotate_options=$(".ai-rotate-option",this);var random_index=Math.floor(Math.random()*rotate_options.length);var d=new Date;var n=d.getMilliseconds();if(n%2)random_index=rotate_options.length-random_index-1;rotate_options.hide();$(rotate_options[random_index]).css({"display":"","visibility":"","position":"","width":"","height":"","top":"","left":""});$(this).css({"position":""});var wrapping_div=$(this).closest(wrapping_div_class);
1080
+ if(typeof wrapping_div.data("ai")!="undefined"){var data=JSON.parse(atob(wrapping_div.data("ai")));if(typeof data!=="undefined"&&data.constructor===Array){data[1]=random_index+1;wrapping_div.data("ai",btoa(JSON.stringify(data)))}}})});';
1081
+ }
1082
+
1083
+ if ($ai_wp_data [AI_STICKY_WIDGETS]) {
1084
+
1085
+ // echo 'jQuery(document).ready(function($) {
1086
+ // var sticky_widget_margin = ', get_sticky_widget_margin (), ';
1087
+ // $("div.ai-sidebar").each (function () {
1088
+ // var sidebar = $(this).next ();
1089
+ // var widget = sidebar.find ("div.ai-sticky").first ();
1090
+ // if (widget.length == 1) {
1091
+ // sidebar.css ("position", "sticky").css ("top", sidebar.offset ().top - widget.offset ().top + sticky_widget_margin);
1092
+ // }
1093
+ // });
1094
+ // });
1095
+ //';
1096
 
1097
+ echo 'jQuery(document).ready(function($){var sticky_widget_margin=', get_sticky_widget_margin (), ';$("div.ai-sidebar").each(function(){var sidebar=$(this).next();var widget=sidebar.find("div.ai-sticky").first();if(widget.length==1)sidebar.css("position","sticky").css("top",sidebar.offset().top-widget.offset().top+sticky_widget_margin)})});';
 
 
1098
 
 
 
1099
  }
1100
 
1101
  if (function_exists ('add_footer_inline_scripts_2')) {
1338
  update_post_meta ($post_id, '_adinserter_block_exceptions', implode (",", $selected));
1339
  }
1340
 
1341
+ function ai_get_sidebar ($name) {
1342
+ echo "<div class='ai-sidebar'></div>\n";
1343
+ }
1344
+
1345
  function ai_widgets_init_hook () {
1346
  if (is_multisite() && !is_main_site () && !multisite_widgets_enabled ()) return;
1347
  register_widget ('ai_widget');
1432
  echo "USER: ";
1433
  if (($ai_wp_data [AI_WP_USER] & AI_USER_LOGGED_IN) == AI_USER_LOGGED_IN) echo "LOGGED-IN "; else echo "NOT LOGGED-IN ";
1434
  if (($ai_wp_data [AI_WP_USER] & AI_USER_ADMINISTRATOR) == AI_USER_ADMINISTRATOR) echo "ADMINISTRATOR";
1435
+ $current_user = wp_get_current_user();
1436
  echo "\n";
1437
+ echo 'USER ROLES: ', implode (', ', $current_user->roles), "\n";
1438
+ echo 'MIN.USER FOR EXCEPTIONS: ', get_minimum_user_role (), "\n";
1439
  echo "PAGE TYPE: ";
1440
  switch ($ai_wp_data [AI_WP_PAGE_TYPE]) {
1441
  case AI_PT_STATIC: echo "STATIC PAGE"; break;
1484
  elseif (AI_PHONE) echo "PHONE\n";
1485
  else echo "?\n";
1486
  }
1487
+ echo 'BLOCK CLASS NAME: ', get_block_class_name (), "\n";
1488
+ echo 'DYNAMIC BLOCKS: ';
1489
+ switch (get_dynamic_blocks()) {
1490
+ case AI_DYNAMIC_BLOCKS_SERVER_SIDE:
1491
+ echo AI_TEXT_SERVER_SIDE;
1492
+ break;
1493
+ case AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC:
1494
+ echo AI_TEXT_SERVER_SIDE_W3TC;
1495
+ break;
1496
+ case AI_DYNAMIC_BLOCKS_CLIENT_SIDE:
1497
+ echo AI_TEXT_CLIENT_SIDE;
1498
+ break;
1499
+ }
1500
+ echo "\n";
1501
+ echo 'PARAGRAPH COUNTING: ';
1502
+ switch (get_paragraph_counting_functions()) {
1503
+ case AI_STANDARD_PARAGRAPH_COUNTING_FUNCTIONS:
1504
+ echo AI_TEXT_STANDARD;
1505
+ break;
1506
+ case AI_MULTIBYTE_PARAGRAPH_COUNTING_FUNCTIONS:
1507
+ echo AI_TEXT_MULTIBYTE;
1508
+ break;
1509
+ }
1510
+ echo "\n";
1511
+ echo 'PLUGIN PRIORITY: ', get_plugin_priority (), "\n";
1512
+ echo 'HEADER CODE: ', $block_object [AI_HEADER_OPTION_NAME]->get_enable_manual () ? 'ENABLED' : 'DISABLED', "\n";
1513
+ echo 'FOOTER CODE: ', $block_object [AI_FOOTER_OPTION_NAME]->get_enable_manual () ? 'ENABLED' : 'DISABLED', "\n";
1514
+
1515
 
1516
  echo "\n";
1517
 
1728
 
1729
  if (!isset ($plugin_options ['MINIMUM_USER_ROLE'])) $plugin_options ['MINIMUM_USER_ROLE'] = DEFAULT_MINIMUM_USER_ROLE;
1730
 
1731
+ if (!isset ($plugin_options ['STICKY_WIDGET_MARGIN'])) $plugin_options ['STICKY_WIDGET_MARGIN'] = DEFAULT_STICKY_WIDGET_MARGIN;
1732
+ $sticky_widget_margin = $plugin_options ['STICKY_WIDGET_MARGIN'];
1733
+ if (!is_numeric ($sticky_widget_margin)) {
1734
+ $sticky_widget_margin = DEFAULT_STICKY_WIDGET_MARGIN;
1735
+ }
1736
+ $sticky_widget_margin = intval ($sticky_widget_margin);
1737
+ if ($sticky_widget_margin < 0) {
1738
+ $sticky_widget_margin = 0;
1739
+ }
1740
+ if ($sticky_widget_margin > 999) {
1741
+ $sticky_widget_margin = 999;
1742
+ }
1743
+ $plugin_options ['STICKY_WIDGET_MARGIN'] = $sticky_widget_margin;
1744
+
1745
+
1746
  if (!isset ($plugin_options ['PLUGIN_PRIORITY'])) $plugin_options ['PLUGIN_PRIORITY'] = DEFAULT_PLUGIN_PRIORITY;
1747
  $plugin_priority = $plugin_options ['PLUGIN_PRIORITY'];
1748
  if (!is_numeric ($plugin_priority)) {
1881
  return ($ai_db_options [AI_GLOBAL_OPTION_NAME]['MINIMUM_USER_ROLE']);
1882
  }
1883
 
1884
+ function get_sticky_widget_margin () {
1885
+ global $ai_db_options;
1886
+
1887
+ if (!isset ($ai_db_options [AI_GLOBAL_OPTION_NAME]['STICKY_WIDGET_MARGIN'])) $ai_db_options [AI_GLOBAL_OPTION_NAME]['STICKY_WIDGET_MARGIN'] = DEFAULT_STICKY_WIDGET_MARGIN;
1888
+
1889
+ return ($ai_db_options [AI_GLOBAL_OPTION_NAME]['STICKY_WIDGET_MARGIN']);
1890
+ }
1891
+
1892
  function get_plugin_priority () {
1893
  global $ai_db_options;
1894
 
2404
 
2405
  if (function_exists ('ai_filter_global_settings')) ai_filter_global_settings ($options);
2406
 
2407
+ if (isset ($_POST ['syntax-highlighter-theme'])) $options ['SYNTAX_HIGHLIGHTER_THEME'] = filter_string ($_POST ['syntax-highlighter-theme']);
2408
+ if (isset ($_POST ['block-class-name'])) $options ['BLOCK_CLASS_NAME'] = filter_html_class ($_POST ['block-class-name']);
2409
+ if (isset ($_POST ['minimum-user-role'])) $options ['MINIMUM_USER_ROLE'] = filter_string ($_POST ['minimum-user-role']);
2410
+ if (isset ($_POST ['sticky-widget-margin'])) $options ['STICKY_WIDGET_MARGIN'] = filter_option ('sticky-widget-margin', $_POST ['sticky-widget-margin']);
2411
+ if (isset ($_POST ['plugin_priority'])) $options ['PLUGIN_PRIORITY'] = filter_option ('plugin_priority', $_POST ['plugin_priority']);
2412
+ if (isset ($_POST ['dynamic_blocks'])) $options ['DYNAMIC_BLOCKS'] = filter_option ('dynamic_blocks', $_POST ['dynamic_blocks']);
2413
+ if (isset ($_POST ['paragraph_counting_functions'])) $options ['PARAGRAPH_COUNTING_FUNCTIONS'] = filter_option ('paragraph_counting_functions', $_POST ['paragraph_counting_functions']);
2414
+ if (isset ($_POST ['admin_toolbar_debugging'])) $options ['ADMIN_TOOLBAR_DEBUGGING'] = filter_option ('admin_toolbar_debugging', $_POST ['admin_toolbar_debugging']);
2415
+ if (isset ($_POST ['remote_debugging'])) $options ['REMOTE_DEBUGGING'] = filter_option ('remote_debugging', $_POST ['remote_debugging']);
2416
+ if (isset ($_POST ['javascript_debugging'])) $options ['JAVASCRIPT_DEBUGGING'] = filter_option ('javascript_debugging', $_POST ['javascript_debugging']);
2417
 
2418
  for ($viewport = 1; $viewport <= AD_INSERTER_VIEWPORTS; $viewport ++) {
2419
  if (isset ($_POST ['viewport-name-'.$viewport]))
2573
  }
2574
  }
2575
  }
2576
+ } elseif (isset ($_POST [AI_FORM_CLEAR_STATISTICS]) && is_numeric ($_POST [AI_FORM_CLEAR_STATISTICS])) {
2577
+ if ($_POST [AI_FORM_CLEAR_STATISTICS] != 0) {
2578
+ $wpdb->query ("DELETE FROM " . AI_STATISTICS_DB_TABLE . " WHERE block = " . $_POST [AI_FORM_CLEAR_STATISTICS]);
2579
+ } else $wpdb->query ("DROP TABLE IF EXISTS " . AI_STATISTICS_DB_TABLE);
2580
  }
2581
 
2582
  generate_settings_form ();
3218
  // Output admin widget options form
3219
 
3220
  $widget_title = !empty ($instance ['widget-title']) ? $instance ['widget-title'] : '';
3221
+ $block = isset ($instance ['block']) ? $instance ['block'] : 1;
3222
+ if ($block > AD_INSERTER_BLOCKS) $block = 1;
3223
+ $sticky = isset ($instance ['sticky']) ? $instance ['sticky'] : 0;
3224
 
3225
+ if ($block == 0) $title = 'Debugger';
3226
+ elseif ($block == - 1) $title = 'Dummy Widget';
3227
+ elseif ($block >= 1) {
3228
  $obj = $block_object [$block];
3229
 
3230
  $title = '[' . $block . '] ' . $obj->get_ad_name();
3231
  if (!empty ($widget_title)) $title .= ' - ' . $widget_title;
3232
  if (!$obj->get_enable_widget ()) $title .= ' - DISABLED';
3233
+ } else $title = "Unknown block";
3234
+
3235
+ $url_parameters = "";
3236
+ if (function_exists ('ai_settings_url_parameters')) $url_parameters = ai_settings_url_parameters ($block);
3237
 
3238
  ?>
3239
  <input id="<?php echo $this->get_field_id ('title'); ?>" name="<?php echo $this->get_field_name ('title'); ?>" type="hidden" value="<?php echo esc_attr ($title); ?>">
3240
 
3241
  <p>
3242
+ <label for="<?php echo $this->get_field_id ('widget-title'); ?>">Title: &nbsp;</label>
3243
+ <input id="<?php echo $this->get_field_id ('widget-title'); ?>" name="<?php echo $this->get_field_name ('widget-title'); ?>" type="text" value="<?php echo esc_attr ($widget_title); ?>" style="width: 88%;">
3244
  </p>
3245
 
3246
  <p>
3247
+ <label for="<?php echo $this->get_field_id ('block'); ?>"><a href='<?php echo admin_url ('options-general.php?page=ad-inserter.php'), $url_parameters, "&tab=", $block; ?>' title='Click for block settings' style='text-decoration: none;'>Block</a>:</label>
3248
  <select id="<?php echo $this->get_field_id ('block'); ?>" name="<?php echo $this->get_field_name('block'); ?>" style="width: 88%;">
3249
  <?php
3250
  for ($block_index = 1; $block_index <= AD_INSERTER_BLOCKS; $block_index ++) {
3253
  <option value='<?php echo $block_index; ?>' <?php if ($block_index == $block) echo 'selected="selected"'; ?>><?php echo $block_index, ' - ', $obj->get_ad_name(), !$obj->get_enable_widget ()? ' - DISABLED' : ''; ?></option>
3254
  <?php } ?>
3255
  <option value='0' <?php if ($block == 0) echo 'selected="selected"'; ?>>Debugger</option>
3256
+ <option value='-1' <?php if ($block == - 1) echo 'selected="selected"'; ?>>Dummy Widget</option>
3257
  </select>
3258
  </p>
3259
 
3260
+ <p>
3261
+ <input type="hidden" name='<?php echo $this->get_field_name ('sticky'); ?>' value="0" />
3262
+ <input type='checkbox' id='<?php echo $this->get_field_id ('sticky'); ?>' name='<?php echo $this->get_field_name ('sticky'); ?>' value='1' <?php if ($sticky) echo 'checked '; ?>>
3263
+ <label for='<?php echo $this->get_field_id ('sticky'); ?>'>Sticky</label>
3264
+ </p>
3265
  <?php
 
 
 
 
3266
  }
3267
 
3268
  function update ($new_instance, $old_instance) {
3270
  $instance = $old_instance;
3271
 
3272
  $instance ['widget-title'] = (!empty ($new_instance ['widget-title'])) ? strip_tags ($new_instance ['widget-title']) : '';
3273
+ $instance ['title'] = (!empty ($new_instance ['title'])) ? strip_tags ($new_instance ['title']) : '';
3274
+ $instance ['block'] = (isset ($new_instance ['block'])) ? $new_instance ['block'] : 1;
3275
+ $instance ['sticky'] = (isset ($new_instance ['sticky'])) ? $new_instance ['sticky'] : 0;
3276
 
3277
  return $instance;
3278
  }
3300
  function ai_widget_draw ($args, $instance, &$block) {
3301
  global $block_object, $ad_inserter_globals, $ai_wp_data, $ai_last_check;
3302
 
3303
+ $block = isset ($instance ['block']) ? $instance ['block'] : 1;
3304
+ $sticky = isset ($instance ['sticky']) ? $instance ['sticky'] : 0;
3305
 
3306
  if ($block == 0) {
3307
  if (get_remote_debugging () || ($ai_wp_data [AI_WP_USER] & AI_USER_ADMINISTRATOR) != 0)
3309
  return;
3310
  }
3311
 
3312
+ if ($sticky) {
3313
+ $ai_wp_data [AI_STICKY_WIDGETS] = true;
3314
+ if ($block == - 1) {
3315
+ echo "<div class='ai-sticky'></div>\n";
3316
+ return;
3317
+ }
3318
+ }
3319
+
3320
  if ($block < 1 || $block > AD_INSERTER_BLOCKS) return;
3321
 
3322
  $title = !empty ($instance ['widget-title']) ? $instance ['widget-title'] : '';
3349
 
3350
  // Last check before counter check before insertion
3351
  $ai_last_check = AI_CHECK_CODE;
3352
+ if ($obj->ai_getCode () == '') {
3353
+ if ($sticky) echo "<div class='ai-sticky'></div>\n";
3354
+ return;
3355
+ }
3356
 
3357
  // Last check before insertion
3358
  if (!$obj->check_and_increment_block_counter ()) return;
3360
  $ai_last_check = AI_CHECK_DEBUG_NO_INSERTION;
3361
  if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_NO_INSERTION) == 0) {
3362
  $viewport_classes = trim ($obj->get_viewport_classes ());
3363
+ $sticky_class = $sticky ? ' ai-sticky' : '';
3364
+ $widget_classes = trim ($viewport_classes . $sticky_class);
3365
+ if ($widget_classes != "") echo "<div class='" . $widget_classes . "'>";
3366
+
3367
  echo $args ['before_widget'];
3368
 
3369
  if (!empty ($title)) {
3373
  echo $obj->get_code_for_insertion (false);
3374
 
3375
  echo $args ['after_widget'];
3376
+
3377
+ if ($widget_classes != "") echo "</div>";
3378
 
3379
  $ai_last_check = AI_CHECK_INSERTED;
3380
 
3386
  function ai_widget_draw_debugger ($args, $instance, &$block) {
3387
  global $ai_wp_data, $ai_db_options, $block_object;
3388
 
3389
+ $sticky = isset ($instance ['sticky']) ? $instance ['sticky'] : 0;
3390
+
3391
  echo $args ['before_widget'];
3392
 
3393
+ if ($sticky) {
3394
+ $ai_wp_data [AI_STICKY_WIDGETS] = true;
3395
+ echo "<div class='ai-sticky'></div>\n";
3396
+ }
3397
+
3398
  $title = !empty ($instance ['widget-title']) ? $instance ['widget-title'] : '';
3399
 
3400
  if (!empty ($title)) {
class.php CHANGED
@@ -332,11 +332,9 @@ abstract class ai_BaseCodeBlock {
332
  eval ("?>". $code . "<?php ");
333
  } catch (Exception $e) {
334
  $php_error = "PHP error in " . AD_INSERTER_NAME . " code block ".$obj->number . " - " . $obj->get_ad_name() . "<br />\n" . $e->getMessage();
335
- // Error using PHP 5.4 or earlier
336
  }
337
- // finally {
338
- $processed_code = ob_get_clean ();
339
- // }
340
 
341
  if (strpos ($processed_code, __FILE__) || $php_error != "") {
342
  if (preg_match ("%(.+) in ".__FILE__."%", $processed_code, $error_message))
@@ -1004,10 +1002,11 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1004
 
1005
  switch ($dynamic_blocks) {
1006
  case AI_DYNAMIC_BLOCKS_SERVER_SIDE:
1007
- $this->code_version = rand (1, count ($ads));
1008
  $processed_code = $ads [$this->code_version - 1];
1009
  break;
1010
  case AI_DYNAMIC_BLOCKS_CLIENT_SIDE:
 
1011
  $processed_code = "\n<div class='ai-rotate' style='position: relative;'>\n";
1012
  foreach ($ads as $index => $ad) {
1013
  switch ($index) {
@@ -1022,7 +1021,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1022
  $processed_code .= "</div>\n";
1023
  break;
1024
  case AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC:
1025
- $this->w3tc_code = '$ai_code = unserialize (base64_decode (\''.base64_encode (serialize ($ads)).'\')); $ai_index = rand (1, count ($ai_code)); $ai_code = $ai_code [$ai_index - 1]; $ai_enabled = true;';
1026
  $processed_code = '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
1027
  $processed_code .= $this->w3tc_code.' echo $ai_code;';
1028
  $processed_code .= '<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
@@ -1537,7 +1536,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1537
  $positions [$index] = intval ($position * (count ($paragraph_positions) - 1) + 0.5);
1538
  }
1539
  elseif ($position <= 0) {
1540
- $positions [$index] = rand (0, count ($paragraph_positions) - 1);
1541
  }
1542
  }
1543
  }
@@ -1553,7 +1552,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1553
  $position = intval ($position * (count ($paragraph_positions) - 1) + 0.5);
1554
  }
1555
  elseif ($position <= 0) {
1556
- $position = rand (0, count ($paragraph_positions) - 1);
1557
  } else $position --;
1558
 
1559
 
@@ -1750,6 +1749,8 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1750
  public function after_paragraph ($content, $position_preview = false) {
1751
  global $ai_wp_data, $ai_last_check, $special_element_tags;
1752
 
 
 
1753
  $multibyte = get_paragraph_counting_functions() == AI_MULTIBYTE_PARAGRAPH_COUNTING_FUNCTIONS;
1754
 
1755
  $paragraph_positions = array ();
@@ -1769,12 +1770,27 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1769
  if (count ($paragraph_end_strings) == 0) return $content;
1770
 
1771
  foreach ($paragraph_end_strings as $paragraph_end_string) {
1772
- if (trim ($paragraph_end_string) == '') continue;
1773
 
1774
  $last_position = - 1;
1775
 
1776
  $paragraph_end_string = trim ($paragraph_end_string);
1777
- if ($paragraph_end_string == "#") {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1778
  $paragraph_end = "\r\n\r\n";
1779
  if (!in_array ($last_content_position, $paragraph_positions)) $paragraph_positions [] = $last_content_position;
1780
  } else $paragraph_end = '</' . $paragraph_end_string . '>';
@@ -1945,7 +1961,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1945
  $positions [$index] = intval ($position * (count ($paragraph_positions) - 1) + 0.5);
1946
  }
1947
  elseif ($position <= 0) {
1948
- $positions [$index] = rand (0, count ($paragraph_positions) - 1);
1949
  }
1950
  }
1951
  }
@@ -1961,7 +1977,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1961
  $position = intval ($position * (count ($paragraph_positions) - 1) + 0.5);
1962
  }
1963
  elseif ($position <= 0) {
1964
- $position = rand (0, count ($paragraph_positions) - 1);
1965
  } else $position --;
1966
 
1967
 
332
  eval ("?>". $code . "<?php ");
333
  } catch (Exception $e) {
334
  $php_error = "PHP error in " . AD_INSERTER_NAME . " code block ".$obj->number . " - " . $obj->get_ad_name() . "<br />\n" . $e->getMessage();
 
335
  }
336
+
337
+ $processed_code = ob_get_clean ();
 
338
 
339
  if (strpos ($processed_code, __FILE__) || $php_error != "") {
340
  if (preg_match ("%(.+) in ".__FILE__."%", $processed_code, $error_message))
1002
 
1003
  switch ($dynamic_blocks) {
1004
  case AI_DYNAMIC_BLOCKS_SERVER_SIDE:
1005
+ $this->code_version = mt_rand (1, count ($ads));
1006
  $processed_code = $ads [$this->code_version - 1];
1007
  break;
1008
  case AI_DYNAMIC_BLOCKS_CLIENT_SIDE:
1009
+ $this->code_version = '""';
1010
  $processed_code = "\n<div class='ai-rotate' style='position: relative;'>\n";
1011
  foreach ($ads as $index => $ad) {
1012
  switch ($index) {
1021
  $processed_code .= "</div>\n";
1022
  break;
1023
  case AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC:
1024
+ $this->w3tc_code = '$ai_code = unserialize (base64_decode (\''.base64_encode (serialize ($ads)).'\')); $ai_index = mt_rand (1, count ($ai_code)); $ai_code = $ai_code [$ai_index - 1]; $ai_enabled = true;';
1025
  $processed_code = '<!-- mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
1026
  $processed_code .= $this->w3tc_code.' echo $ai_code;';
1027
  $processed_code .= '<!-- /mfunc '.W3TC_DYNAMIC_SECURITY.' -->';
1536
  $positions [$index] = intval ($position * (count ($paragraph_positions) - 1) + 0.5);
1537
  }
1538
  elseif ($position <= 0) {
1539
+ $positions [$index] = mt_rand (0, count ($paragraph_positions) - 1);
1540
  }
1541
  }
1542
  }
1552
  $position = intval ($position * (count ($paragraph_positions) - 1) + 0.5);
1553
  }
1554
  elseif ($position <= 0) {
1555
+ $position = mt_rand (0, count ($paragraph_positions) - 1);
1556
  } else $position --;
1557
 
1558
 
1749
  public function after_paragraph ($content, $position_preview = false) {
1750
  global $ai_wp_data, $ai_last_check, $special_element_tags;
1751
 
1752
+ $no_closing_tag = array ('img', 'hr');
1753
+
1754
  $multibyte = get_paragraph_counting_functions() == AI_MULTIBYTE_PARAGRAPH_COUNTING_FUNCTIONS;
1755
 
1756
  $paragraph_positions = array ();
1770
  if (count ($paragraph_end_strings) == 0) return $content;
1771
 
1772
  foreach ($paragraph_end_strings as $paragraph_end_string) {
 
1773
 
1774
  $last_position = - 1;
1775
 
1776
  $paragraph_end_string = trim ($paragraph_end_string);
1777
+ if ($paragraph_end_string == '') continue;
1778
+
1779
+ if (in_array ($paragraph_end_string, $no_closing_tag)) {
1780
+ if (preg_match_all ("/<$paragraph_end_string(.*?)>/", $content, $images)) {
1781
+ foreach ($images [0] as $paragraph_end) {
1782
+ if ($multibyte) {
1783
+ $last_position = mb_stripos ($content, $paragraph_end, $last_position + 1) + mb_strlen ($paragraph_end) - 1;
1784
+ $paragraph_positions [] = $last_position;
1785
+ } else {
1786
+ $last_position = stripos ($content, $paragraph_end, $last_position + 1) + strlen ($paragraph_end) - 1;
1787
+ $paragraph_positions [] = $last_position;
1788
+ }
1789
+ }
1790
+ }
1791
+ continue;
1792
+ }
1793
+ elseif ($paragraph_end_string == "#") {
1794
  $paragraph_end = "\r\n\r\n";
1795
  if (!in_array ($last_content_position, $paragraph_positions)) $paragraph_positions [] = $last_content_position;
1796
  } else $paragraph_end = '</' . $paragraph_end_string . '>';
1961
  $positions [$index] = intval ($position * (count ($paragraph_positions) - 1) + 0.5);
1962
  }
1963
  elseif ($position <= 0) {
1964
+ $positions [$index] = mt_rand (0, count ($paragraph_positions) - 1);
1965
  }
1966
  }
1967
  }
1977
  $position = intval ($position * (count ($paragraph_positions) - 1) + 0.5);
1978
  }
1979
  elseif ($position <= 0) {
1980
+ $position = mt_rand (0, count ($paragraph_positions) - 1);
1981
  } else $position --;
1982
 
1983
 
constants.php CHANGED
@@ -14,7 +14,7 @@ if (!defined( 'AD_INSERTER_NAME'))
14
  define ('AD_INSERTER_NAME', 'Ad Inserter');
15
 
16
  if (!defined( 'AD_INSERTER_VERSION'))
17
- define ('AD_INSERTER_VERSION', '2.1.7');
18
 
19
  if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
20
  define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
@@ -126,7 +126,8 @@ define('AD_EMPTY_VALUE','');
126
  //define constant variable form
127
  define('AI_FORM_SAVE','ai_save');
128
  define('AI_FORM_CLEAR','ai_clear');
129
- define('AI_FORM_CLEAR_EXCEPTIONS','ai_clear_exceptions');
 
130
 
131
  define('AD_AUTHOR_SITE', '<!-- Powered by Ad Inserter Plugin By Spacetime -->');
132
  define('AD_ROTATE_SEPARATOR', '|rotate|');
@@ -308,7 +309,15 @@ define('AI_TEXT_MULTIBYTE', 'Multibyte');
308
  define('AI_TRACKING_DISABLED', 0);
309
  define('AI_TRACKING_INTERNAL', 1);
310
 
 
 
 
 
 
 
311
  define('AI_TEXT_INTERNAL', 'Internal');
 
 
312
 
313
  //Settings
314
  define('AI_ENABLED', '1');
@@ -319,6 +328,7 @@ define('AI_COOKIE_TIME', 3600);
319
  define ('DEFAULT_SYNTAX_HIGHLIGHTER_THEME', 'ad_inserter');
320
  define ('DEFAULT_BLOCK_CLASS_NAME', 'code-block');
321
  define ('DEFAULT_MINIMUM_USER_ROLE', 'administrator');
 
322
  define ('DEFAULT_PLUGIN_PRIORITY', 99999);
323
  define ('DEFAULT_DYNAMIC_BLOCKS', AI_DYNAMIC_BLOCKS_SERVER_SIDE);
324
  define ('DEFAULT_PARAGRAPH_COUNTING_FUNCTIONS', AI_STANDARD_PARAGRAPH_COUNTING_FUNCTIONS);
@@ -332,6 +342,8 @@ define ('DEFAULT_MULTISITE_PHP_PROCESSING', AI_ENABLED);
332
  define ('DEFAULT_MULTISITE_EXCEPTIONS', AI_ENABLED);
333
  define ('DEFAULT_MULTISITE_MAIN_FOR_ALL_BLOGS', AI_DISABLED);
334
  define ('DEFAULT_TRACKING', AI_TRACKING_DISABLED);
 
 
335
 
336
  define ('DEFAULT_VIEWPORT_NAME_1', "Desktop");
337
  define ('DEFAULT_VIEWPORT_NAME_2', "Tablet");
@@ -433,6 +445,7 @@ define ('AI_SERVER_SIDE_DETECTION', 5);
433
  define ('AI_CLIENT_SIDE_DETECTION', 6);
434
  define ('AI_CONTEXT', 7);
435
  define ('AI_TRACKING', 8);
 
436
 
437
  define ('AI_CONTEXT_NONE', 0);
438
  define ('AI_CONTEXT_CONTENT', 1);
14
  define ('AD_INSERTER_NAME', 'Ad Inserter');
15
 
16
  if (!defined( 'AD_INSERTER_VERSION'))
17
+ define ('AD_INSERTER_VERSION', '2.1.9');
18
 
19
  if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
20
  define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
126
  //define constant variable form
127
  define('AI_FORM_SAVE','ai_save');
128
  define('AI_FORM_CLEAR','ai_clear');
129
+ define('AI_FORM_CLEAR_EXCEPTIONS','ai-clear-exceptions');
130
+ define('AI_FORM_CLEAR_STATISTICS','ai-clear-statistics');
131
 
132
  define('AD_AUTHOR_SITE', '<!-- Powered by Ad Inserter Plugin By Spacetime -->');
133
  define('AD_ROTATE_SEPARATOR', '|rotate|');
309
  define('AI_TRACKING_DISABLED', 0);
310
  define('AI_TRACKING_INTERNAL', 1);
311
 
312
+ define('AI_TRACKING_ENABLED', 1);
313
+
314
+ // Click detection
315
+ define('AI_CLICK_DETECTION_STANDARD', 0);
316
+ define('AI_CLICK_DETECTION_ADVANCED', 1);
317
+
318
  define('AI_TEXT_INTERNAL', 'Internal');
319
+ define('AI_TEXT_ADVANCED', 'Advanced');
320
+ define('AI_TEXT_ENABLED', 'Enabled');
321
 
322
  //Settings
323
  define('AI_ENABLED', '1');
328
  define ('DEFAULT_SYNTAX_HIGHLIGHTER_THEME', 'ad_inserter');
329
  define ('DEFAULT_BLOCK_CLASS_NAME', 'code-block');
330
  define ('DEFAULT_MINIMUM_USER_ROLE', 'administrator');
331
+ define ('DEFAULT_STICKY_WIDGET_MARGIN', 15);
332
  define ('DEFAULT_PLUGIN_PRIORITY', 99999);
333
  define ('DEFAULT_DYNAMIC_BLOCKS', AI_DYNAMIC_BLOCKS_SERVER_SIDE);
334
  define ('DEFAULT_PARAGRAPH_COUNTING_FUNCTIONS', AI_STANDARD_PARAGRAPH_COUNTING_FUNCTIONS);
342
  define ('DEFAULT_MULTISITE_EXCEPTIONS', AI_ENABLED);
343
  define ('DEFAULT_MULTISITE_MAIN_FOR_ALL_BLOGS', AI_DISABLED);
344
  define ('DEFAULT_TRACKING', AI_TRACKING_DISABLED);
345
+ define ('DEFAULT_TRACKING_LOGGED_IN', AI_TRACKING_ENABLED);
346
+ define ('DEFAULT_CLICK_DETECTION', AI_CLICK_DETECTION_STANDARD);
347
 
348
  define ('DEFAULT_VIEWPORT_NAME_1', "Desktop");
349
  define ('DEFAULT_VIEWPORT_NAME_2', "Tablet");
445
  define ('AI_CLIENT_SIDE_DETECTION', 6);
446
  define ('AI_CONTEXT', 7);
447
  define ('AI_TRACKING', 8);
448
+ define ('AI_STICKY_WIDGETS', 9);
449
 
450
  define ('AI_CONTEXT_NONE', 0);
451
  define ('AI_CONTEXT_CONTENT', 1);
css/ad-inserter.css CHANGED
@@ -1,5 +1,5 @@
1
  #ai-data {
2
- font-family: "2.1.7"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
@@ -169,6 +169,7 @@ div.ai-chart-label {
169
  top: 13px;
170
  left: 44px;
171
  z-index: 202;
 
172
  display: none;
173
  }
174
 
@@ -447,11 +448,10 @@ div.automatic-insertion img {
447
  background: url('images/icons.png') -180px 0;
448
  }
449
 
450
- .checkbox-icon.icon-red {
451
- width: 12px;
452
  height: 12px;
453
  margin-top: 6px;
454
- background: url('images/icons.png') 0 -40px;
455
  }
456
 
457
  @media(max-width: 768px) {
1
  #ai-data {
2
+ font-family: "2.1.9"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
169
  top: 13px;
170
  left: 44px;
171
  z-index: 202;
172
+ opacity: 0.5;
173
  display: none;
174
  }
175
 
448
  background: url('images/icons.png') -180px 0;
449
  }
450
 
451
+ .checkbox-icon.icon-none {
452
+ width: 10px;
453
  height: 12px;
454
  margin-top: 6px;
 
455
  }
456
 
457
  @media(max-width: 768px) {
js/ad-inserter.js CHANGED
@@ -1,4 +1,4 @@
1
- var javascript_version = "2.1.7";
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
@@ -128,7 +128,7 @@ jQuery(document).ready(function($) {
128
  if (header) {
129
  $.elycharts.templates['ai'] = {
130
  type : "line",
131
- margins : [10, 37, 20, 37],
132
  defaultSeries : {
133
  fill: true,
134
  fillProps: {
@@ -213,7 +213,7 @@ jQuery(document).ready(function($) {
213
 
214
  $.elycharts.templates['ai-versions'] = {
215
  type : "line",
216
- margins : [10, 37, 20, 37],
217
  defaultSeries: {
218
  color: "#0a0",
219
  fillProps: {
@@ -283,7 +283,7 @@ jQuery(document).ready(function($) {
283
 
284
  $.elycharts.templates['ai-versions-legend'] = {
285
  template: 'ai-versions',
286
- margins : [10, 37, 10, 37],
287
  defaultSeries : {
288
  fill: true,
289
  fillProps: {
@@ -390,7 +390,7 @@ jQuery(document).ready(function($) {
390
  $.elycharts.templates['ai-bar'] = {
391
  template: 'ai-pie',
392
  type: "line",
393
- margins : [5, 0, 5, 30],
394
  barMargins : 1,
395
  defaultSeries : {
396
  type: "bar",
@@ -439,82 +439,93 @@ jQuery(document).ready(function($) {
439
  $("#tab-" + block + " input:checkbox").each (function() {
440
  var default_value = $(this).attr ("default");
441
  var current_value = $(this).is (':checked');
 
442
 
443
- if (typeof default_value != 'undefined') {
444
- default_value = Boolean (parseInt (default_value));
445
- // console.log ($(this).attr ("name"), ": default_value: ", $(this).attr ("default"), " = ", default_value, ", current_value: ", current_value);
 
446
 
447
- if (current_value == default_value) {
448
- var name = $(this).attr ("name");
449
- $(this).removeAttr ("name");
450
- $("#tab-" + block + " [name='" + name + "']").removeAttr ("name");
451
- // console.log ("REMOVED: ", name);
452
  }
 
453
  }
454
- // else console.log ("NO DEFAULT VALUE:", $(this).attr ("name"));
455
  });
456
 
457
  $("#tab-" + block + " input:text").each (function() {
458
  var default_value = $(this).attr ("default");
459
  var current_value = $(this).val ();
 
460
 
461
- if (typeof default_value != 'undefined') {
462
- // console.log ($(this).attr ("name"), ": default_value: ", default_value, ", current_value: ", current_value);
 
463
 
464
- if (current_value == default_value) {
465
- var name = $(this).attr ("name");
466
- $(this).removeAttr ("name");
467
- // console.log ("REMOVED: ", name);
468
  }
 
469
  }
470
- // else console.log ("NO DEFAULT VALUE: ", $(this).attr ("name"));
471
  });
472
 
473
  $("#tab-" + block + " select").each (function() {
474
  var default_value = $(this).attr ("default");
475
- var current_value = $(this).children ("option:selected");
476
-
477
- var childern = $(this).children ();
478
- if (childern.prop ("tagName") == "OPTGROUP") {
479
- var current_value = "";
480
- childern.each (function() {
481
- var selected = $(this).children ("option:selected");
482
- if (selected.length != 0) {
483
- current_value = selected;
484
- return false;
485
- }
486
- });
487
- }
 
 
 
 
 
488
 
489
- if ($(this).attr ("selected-value") == 1) current_value = current_value.attr("value"); else current_value = current_value.text();
490
 
491
- if (typeof default_value != 'undefined') {
492
- // console.log ($(this).attr ("name"), ": default_value: ", default_value, ", current_value: ", current_value);
493
 
494
- if (current_value == default_value) {
495
- var name = $(this).attr ("name");
496
- $(this).removeAttr ("name");
497
- // console.log ("REMOVED: ", name);
498
  }
 
499
  }
500
- // else console.log ("NO DEFAULT VALUE: ", $(this).attr ("name"));
501
  });
502
 
503
  $("#tab-" + block + " input:radio:checked").each (function() {
504
  var default_value = $(this).attr ("default");
505
  var current_value = $(this).is (':checked');
 
506
 
507
- if (typeof default_value != 'undefined') {
508
- default_value = Boolean (parseInt (default_value));
509
- // console.log ($(this).attr ("name"), ": default_value: ", $(this).attr ("default"), " = ", default_value, ", current_value: ", current_value);
 
510
 
511
- if (current_value == default_value) {
512
- var name = $(this).attr ("name");
513
- $("#tab-" + block + " [name='" + name + "']").removeAttr ("name");
514
- // console.log ("REMOVED: ", name);
515
  }
 
516
  }
517
- // else console.log ("NO DEFAULT VALUE: ", $(this).attr ("name"));
518
  });
519
  }
520
 
@@ -1130,7 +1141,12 @@ jQuery(document).ready(function($) {
1130
  var version_charts_container = $("div#ai-version-charts-" + block);
1131
  var version_charts_container_visible = version_charts_container.is (':visible');
1132
 
1133
- container.load (site_url+"/wp-admin/admin-ajax.php?action=ai_data&statistics=" + block + "&start-date=" + start_date + "&end-date=" + end_date + "&ai_check=" + nonce, function (response, status, xhr) {
 
 
 
 
 
1134
  label.removeClass ('on');
1135
  if ( status == "error" ) {
1136
  var message = "Error downloading data: " + xhr.status + " " + xhr.statusText ;
@@ -1175,6 +1191,44 @@ jQuery(document).ready(function($) {
1175
  }
1176
  });
1177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1178
  $("input#chart-start-date-"+tab).datepicker ({dateFormat: dateFormat, autoSize: true});
1179
  $("input#chart-end-date-"+tab).datepicker ({dateFormat: dateFormat, autoSize: true});
1180
 
@@ -1409,8 +1463,27 @@ jQuery(document).ready(function($) {
1409
  function configure_chart (container) {
1410
  if (!$(container).hasClass ('not-configured')) return;
1411
  var template = $(container).data ('template');
 
1412
  if (typeof template != 'undefined') {
 
 
 
 
 
 
 
 
 
1413
  var values = $(container).data ('values-1');
 
 
 
 
 
 
 
 
 
1414
  $(container).chart({
1415
  template: template,
1416
  labels: $(container).data ('labels'),
@@ -1427,6 +1500,7 @@ jQuery(document).ready(function($) {
1427
  },
1428
  legend: $(container).data ('legend'),
1429
  tooltips: {serie1: $(container).data ('tooltips')},
 
1430
  defaultAxis : {
1431
  max: $(container).data ('max'),
1432
  },
@@ -1436,6 +1510,7 @@ jQuery(document).ready(function($) {
1436
  }
1437
  }
1438
  });
 
1439
  $(container).removeClass ('not-configured');
1440
  $(container).parent().find ('div.ai-chart-label').show ();
1441
  }
@@ -1537,9 +1612,10 @@ jQuery(document).ready(function($) {
1537
  $('.header button').button().show ();
1538
 
1539
  $("#ai-form").submit (function (event) {
1540
- for (var tab = start; tab <= end; tab ++) {
1541
- remove_default_values (tab);
1542
- }
 
1543
  });
1544
 
1545
  if (syntax_highlighting) {
1
+ var javascript_version = "2.1.9";
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
128
  if (header) {
129
  $.elycharts.templates['ai'] = {
130
  type : "line",
131
+ margins : [10, 38, 20, 38],
132
  defaultSeries : {
133
  fill: true,
134
  fillProps: {
213
 
214
  $.elycharts.templates['ai-versions'] = {
215
  type : "line",
216
+ margins : [10, 38, 20, 38],
217
  defaultSeries: {
218
  color: "#0a0",
219
  fillProps: {
283
 
284
  $.elycharts.templates['ai-versions-legend'] = {
285
  template: 'ai-versions',
286
+ margins : [10, 38, 10, 38],
287
  defaultSeries : {
288
  fill: true,
289
  fillProps: {
390
  $.elycharts.templates['ai-bar'] = {
391
  template: 'ai-pie',
392
  type: "line",
393
+ margins : [5, 0, 5, 45],
394
  barMargins : 1,
395
  defaultSeries : {
396
  type: "bar",
439
  $("#tab-" + block + " input:checkbox").each (function() {
440
  var default_value = $(this).attr ("default");
441
  var current_value = $(this).is (':checked');
442
+ var name = $(this).attr ("name");
443
 
444
+ if (typeof name != 'undefined') {
445
+ if (typeof default_value != 'undefined') {
446
+ default_value = Boolean (parseInt (default_value));
447
+ // console.log ($(this).attr ("name"), ": default_value: ", $(this).attr ("default"), " = ", default_value, ", current_value: ", current_value);
448
 
449
+ if (current_value == default_value) {
450
+ $(this).removeAttr ("name");
451
+ $("#tab-" + block + " [name='" + name + "']").removeAttr ("name");
452
+ // console.log ("REMOVED: ", name);
453
+ }
454
  }
455
+ // else console.log ("NO DEFAULT VALUE:", $(this).attr ("name"));
456
  }
 
457
  });
458
 
459
  $("#tab-" + block + " input:text").each (function() {
460
  var default_value = $(this).attr ("default");
461
  var current_value = $(this).val ();
462
+ var name = $(this).attr ("name");
463
 
464
+ if (typeof name != 'undefined') {
465
+ if (typeof default_value != 'undefined') {
466
+ // console.log ($(this).attr ("name"), ": default_value: ", default_value, ", current_value: ", current_value);
467
 
468
+ if (current_value == default_value) {
469
+ $(this).removeAttr ("name");
470
+ // console.log ("REMOVED: ", name);
471
+ }
472
  }
473
+ // else console.log ("NO DEFAULT VALUE: ", $(this).attr ("name"));
474
  }
 
475
  });
476
 
477
  $("#tab-" + block + " select").each (function() {
478
  var default_value = $(this).attr ("default");
479
+ var current_value = $(this).val();
480
+ var name = $(this).attr ("name");
481
+
482
+ if (typeof name != 'undefined') {
483
+ // console.log ($(this).attr ("id"), name, default_value, current_value);
484
+
485
+ // to do: children of OPTGROUP
486
+ var childern = $(this).children ();
487
+ if (childern.prop ("tagName") == "OPTGROUP") {
488
+ var current_value = "";
489
+ childern.each (function() {
490
+ var selected = $(this).val();
491
+ if (selected.length != 0) {
492
+ current_value = selected;
493
+ return false;
494
+ }
495
+ });
496
+ }
497
 
498
+ // if ($(this).attr ("selected-value") == 1) current_value = current_value.attr("value");
499
 
500
+ if (typeof default_value != 'undefined') {
501
+ // console.log ($(this).attr ("name"), ": default_value: ", default_value, " current_value: ", current_value);
502
 
503
+ if (current_value == default_value) {
504
+ $(this).removeAttr ("name");
505
+ // console.log ("REMOVED: ", name);
506
+ }
507
  }
508
+ // else console.log ("NO DEFAULT VALUE: ", $(this).attr ("name"));
509
  }
 
510
  });
511
 
512
  $("#tab-" + block + " input:radio:checked").each (function() {
513
  var default_value = $(this).attr ("default");
514
  var current_value = $(this).is (':checked');
515
+ var name = $(this).attr ("name");
516
 
517
+ if (typeof name != 'undefined') {
518
+ if (typeof default_value != 'undefined') {
519
+ default_value = Boolean (parseInt (default_value));
520
+ // console.log ($(this).attr ("name"), ": default_value: ", $(this).attr ("default"), " = ", default_value, ", current_value: ", current_value);
521
 
522
+ if (current_value == default_value) {
523
+ $("#tab-" + block + " [name='" + name + "']").removeAttr ("name");
524
+ // console.log ("REMOVED: ", name);
525
+ }
526
  }
527
+ // else console.log ("NO DEFAULT VALUE: ", $(this).attr ("name"));
528
  }
 
529
  });
530
  }
531
 
1141
  var version_charts_container = $("div#ai-version-charts-" + block);
1142
  var version_charts_container_visible = version_charts_container.is (':visible');
1143
 
1144
+ var delete_range = '';
1145
+ if ($("input#clear-range-"+block).hasClass ('delete')) {
1146
+ delete_range = '&delete=1';
1147
+ }
1148
+
1149
+ container.load (site_url+"/wp-admin/admin-ajax.php?action=ai_data&statistics=" + block + "&start-date=" + start_date + "&end-date=" + end_date + delete_range + "&ai_check=" + nonce, function (response, status, xhr) {
1150
  label.removeClass ('on');
1151
  if ( status == "error" ) {
1152
  var message = "Error downloading data: " + xhr.status + " " + xhr.statusText ;
1191
  }
1192
  });
1193
 
1194
+ $("input#clear-range-"+tab).click (function () {
1195
+ var block = $(this).attr ("id");
1196
+ block = block.replace ("clear-range-","");
1197
+
1198
+ var delete_button = this;
1199
+ var start_date = $("input#chart-start-date-" + block).attr('value');
1200
+ var end_date = $("input#chart-end-date-" + block).attr('value');
1201
+
1202
+ var message = '';
1203
+ if (start_date == '' && end_date == '')
1204
+ var message = 'Delete all statistics data?'; else
1205
+ if (start_date != '' && end_date != '') var message = 'Delete statistics data between ' + start_date + ' and ' + end_date + '?';
1206
+
1207
+ if (message != '')
1208
+ $('<div />').html(message).attr ('title', 'Warning').dialog({
1209
+ bgiframe: true,
1210
+ draggable: false,
1211
+ resizable: false,
1212
+ modal: true,
1213
+ height: "auto",
1214
+ width: 400,
1215
+ position: {my: 'center', at: 'center', of: '#ai-settings'},
1216
+ buttons: {
1217
+ "Delete": function() {
1218
+ $(this).dialog ("close");
1219
+
1220
+ $(delete_button).addClass ('delete');
1221
+ $("input#load-custom-range-"+block).click ();
1222
+ $(delete_button).removeClass ('delete');
1223
+ },
1224
+ Cancel: function() {
1225
+ $(this).dialog ("close");
1226
+ },
1227
+ },
1228
+ open: function() {$(this).parent ().find ('button:nth-child(2)').focus();}
1229
+ });
1230
+ });
1231
+
1232
  $("input#chart-start-date-"+tab).datepicker ({dateFormat: dateFormat, autoSize: true});
1233
  $("input#chart-end-date-"+tab).datepicker ({dateFormat: dateFormat, autoSize: true});
1234
 
1463
  function configure_chart (container) {
1464
  if (!$(container).hasClass ('not-configured')) return;
1465
  var template = $(container).data ('template');
1466
+
1467
  if (typeof template != 'undefined') {
1468
+ var new_colors = [];
1469
+ var color_indexes = $(container).data ('colors');
1470
+ if (typeof color_indexes != 'undefined') {
1471
+ var colors = $.elycharts.templates['ai-pie'].defaultSeries.values;
1472
+ color_indexes.forEach (function (element) {
1473
+ new_colors.push (colors [element]);
1474
+ });
1475
+ }
1476
+
1477
  var values = $(container).data ('values-1');
1478
+ if (values == null) values = $(container).data ('values-2');
1479
+ if (values == null) values = $(container).data ('values-3');
1480
+ if (values == null) values = $(container).data ('values-4');
1481
+ if (values == null) values = $(container).data ('values-5');
1482
+ if (values == null) values = $(container).data ('values-6');
1483
+ if (values == null) values = $(container).data ('values-7');
1484
+ if (values == null) values = $(container).data ('values-8');
1485
+ if (values == null) values = $(container).data ('values-9');
1486
+
1487
  $(container).chart({
1488
  template: template,
1489
  labels: $(container).data ('labels'),
1500
  },
1501
  legend: $(container).data ('legend'),
1502
  tooltips: {serie1: $(container).data ('tooltips')},
1503
+ defaultSeries: {values: new_colors},
1504
  defaultAxis : {
1505
  max: $(container).data ('max'),
1506
  },
1510
  }
1511
  }
1512
  });
1513
+
1514
  $(container).removeClass ('not-configured');
1515
  $(container).parent().find ('div.ai-chart-label').show ();
1516
  }
1612
  $('.header button').button().show ();
1613
 
1614
  $("#ai-form").submit (function (event) {
1615
+ for (var tab = start; tab <= end; tab ++) {
1616
+ remove_default_values (tab);
1617
+ }
1618
+ remove_default_values (0);
1619
  });
1620
 
1621
  if (syntax_highlighting) {
readme.txt CHANGED
@@ -1,21 +1,21 @@
1
  === Ad Inserter ===
2
  Contributors: spacetime
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4
4
- Tags: ads, adsense, amazon, automatic insertion, ad rotation, contextual ads, banners, amp, geo targeting, multisite, shortcodes, widgets
5
  Requires at least: 4.0
6
- Tested up to: 4.7.4
7
- Stable tag: 2.1.5
8
  License: GPLv3
9
 
10
- Insert any ad, HTML, Javascript, PHP, header or footer code. Perfect for all kinds of ads: AdSense, Amazon, AMP, widgets, shortcodes, ad rotation,...
11
 
12
  == Description ==
13
 
14
- A simple yet powerful plugin to insert any ad or code into Wordpress. **Perfect for all kinds of ads including AdSense and Amazon.** Insert anything anywhere on the page.
15
 
16
  > **Features**
17
  >
18
- > * 16 code blocks
19
  > * Syntax highlighting editor
20
  > * Code preview with visual CSS editor
21
  > * Automatic insertion before / after post, content, paragraph or excerpt
@@ -26,21 +26,39 @@ A simple yet powerful plugin to insert any ad or code into Wordpress. **Perfect
26
  > * Clearance options to avoid insertion near images or headers
27
  > * Automatic insertion between posts on blog pages
28
  > * Insertion exceptions for posts and pages
 
 
29
  > * Manual insertion: widgets, shortcodes, PHP function call
 
30
  > * Custom block alignment and style
31
  > * Insertion of ads on AMP pages
32
  > * Custom CSS class name for wrapping divs to avoid ad blockers
33
  > * Insertion of shortcodes from other plugins
34
  > * PHP code processing
35
  > * Ad rotation (server-side and client-side - works with caching)
36
- > * Device detection (server-side and client-side, 3 custom viewports)
37
  > * Black/White-list categories, tags, post IDs, urls, url parameters, referers
38
  > * Simple troubleshooting with many debugging functions
39
  > * Function to visualize inserted code blocks
40
  > * Function to visualize available insertion positions
41
  > * Function to visualize HTML tags
42
 
43
- Ad Inserter plugin is simple to use but has many features. Please read user manual to get the most of it.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
  > * Check <a href="http://adinserter.pro/documentation" target="_blank">Ad Inserter documentation page</a> for detailed description of all the features and some <a href="http://adinserter.pro/settings" target="_blank">common settings</a> for quick start
46
  > * Download **PDF user guide** for Ad Inserter: go to <a href="http://adinserter.pro/" target="_blank">Ad Inserter Pro</a> page and below you can find button for free download of Ad Inserter User Guide
@@ -50,20 +68,24 @@ Ad Inserter plugin is simple to use but has many features. Please read user manu
50
  > Amazon suggests to use Ad Inserter to add Native Shopping Ads to Wordpress posts. Native Shopping Ads provide highly relevant and dynamic product recommendations in a stylishly designed and responsive ad unit that can be placed at the end of your content or within your content to create a more compelling visitor experience and shopping opportunity.
51
  >
52
  > * Check <a href="https://affiliate-program.amazon.com/help/topic/t405" target="_blank">Wordpress Integration Guide for Native Shopping Ads</a>
53
- > * On the <a href="https://wordpress.org/plugins/ad-inserter/faq/">FAQ</a> page you can also find an example of contextual Amazon Shopping Ads that show items related to the post content (using post tags)
54
 
55
- There is also <a href="http://adinserter.pro/" target="_blank">Ad Inserter Pro</a> if you need more:
56
 
57
- > * 64 code blocks
58
- > * GEO targeting (works also with caching)
59
- > * Black/White-list IP addresses or countries (works also with caching)
60
- > * Sticky positions
61
- > * Scheduling with fallback option
62
- > * Export and import of settings
63
- > * Multisite options to limit settings on the sites
64
- > * Post/page exception management
65
- > * 6 custom viewports
66
- > * Support via email
 
 
 
 
67
 
68
  **Quick Start**
69
 
@@ -71,18 +93,24 @@ Few very important things you need to know in order to <a href="http://adinserte
71
 
72
  * Code block is any code (for example AdSense ad) that has to be inserted (and displayed) at some position. Each code block can be configured to insert code at almost any position supported by Wordpress
73
  * **Enable and use at least one insertion option** (Automatic insertion, Widget, Shortcode, PHP function call)
74
- * **Enable insertion on at least one Wordpress page type** (Posts, Static pages, Homepage, Category pages, Search Pages, Archive pages)
75
  * For Posts and static pages **select default value On all Posts / On all Static pages** unless you really know what are you doing
76
  * If you don't see inserted code block turn on **debugging functions**: Label inserted blocks, Show available positions for automatic insertion (Ad Inserter menu item in the Wordpress toolbar on the top of every post/page)
77
 
78
- Few typical settings are described on the <a href="https://wordpress.org/plugins/ad-inserter/faq/">FAQ</a> page. Please make sure you have also read <a href="https://wordpress.org/plugins/ad-inserter/installation/">Docs</a> page.
79
  For more detailed instructions please read <a href="http://adinserter.pro/documentation" target="_blank">Ad Inserter documentation page</a>.
80
 
81
- Please *support the plugin* if you like it:
 
 
 
 
 
 
82
 
83
  * Write a nice <a href="https://wordpress.org/support/plugin/ad-inserter/reviews/">review</a>
84
  * <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4">Donate</a>
85
-
86
 
87
  == Installation ==
88
 
@@ -110,7 +138,7 @@ Please *support the plugin* if you like it:
110
 
111
  **Ad Inserter Pro Installation**
112
 
113
- If you are using free Ad Inserter simply uninstall it. The Pro version will automatically import existing settings from the free version.
114
  After you receive the email with download link for the Ad Inserter Pro plugin, download it, go to Wordpress Plugins, Add New, Upload Plugin, Choose file, click on Install Now,
115
  activate it and then click "Enter License Key" and enter license key you got in the email.
116
 
@@ -317,10 +345,17 @@ If you enable **Remote debugging** you can also allow other people using url par
317
  **Remote debugging** enables other, non-logged in users by using url parameters to see Debugger widget and code insertion debugging (blocks, positions, tags, processing).
318
  Enable this option (and disable caching) to allow other people to see Debugger widget, labeled blocks and positions in order to help you to diagnose problems. For logged in administrators debugging via url is always enabled.
319
 
320
- Please **support the plugin** if you like it:
 
 
 
 
 
 
321
 
322
  * Write a nice <a href="https://wordpress.org/support/plugin/ad-inserter/reviews/">review</a>
323
  * <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4">Donate</a>
 
324
 
325
 
326
  == Frequently Asked Questions ==
@@ -330,17 +365,26 @@ Please **support the plugin** if you like it:
330
  1. After activation, click "Settings / Ad Inserter" to access the settings page
331
  2. Put ad (or any other HTML/Javascript/PHP) code into the ad box
332
  3. Set automatic insertion option (for example: Before Post)
333
- 4. Enable at least one page type: Posts, Static pages, Homepage, Category pages, Search Pages, Archive pages (some insertion options don't work on all page types)
334
  5. Save settings
335
- 6. Check inserted code on the page
336
  7. Check also <a href="http://adinserter.pro/settings" target="_blank">common settings</a>
337
 
338
 
 
 
 
 
 
 
 
 
339
  = Settings for widget =
340
 
341
  * Nothing needed, just enter the code and save settings - widget is enabled by default
342
  * Go to Appearance / Widgets, drag Ad Inserter widget to the sidebar or any other widget position, select code block and click on Save
343
-
 
344
 
345
  = Settings for contextual Amazon Native Shopping Ads =
346
 
@@ -418,6 +462,7 @@ Change title tag according to the theme style.
418
 
419
  * Write a nice <a href="https://wordpress.org/support/plugin/ad-inserter/reviews/">review</a>
420
  * <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4">Donate</a>
 
421
 
422
 
423
  = How can I enable/disable ads on specific posts/pages? =
@@ -438,6 +483,8 @@ There are two possible approaches.
438
  2. Enable automatic insertion On all Posts/Pages.
439
  3. Click on Lists, enter url (or space separated urls) for Urls, e.g. `/permalink-url`, and white-list or black-list it.
440
 
 
 
441
 
442
  = I'm using responsive theme. How can I show or hide some ads on mobile devices? =
443
 
@@ -570,6 +617,8 @@ Asumming AMP urls end with `/amp/` use the following settings:
570
  * Put AMP head script in the Header code block (tab *)
571
  * For all other ads on standard (non AMP) pages blacklist url `*/amp/`
572
 
 
 
573
 
574
  = How can place ads below Read More tag? =
575
 
@@ -640,8 +689,17 @@ AD CODE RIGHT
640
 
641
  == Changelog ==
642
 
 
 
 
 
 
 
 
 
 
643
  = 2.1.7 =
644
- - Fixed error using PHP 5.4 or earlier
645
 
646
  = 2.1.6 =
647
  - Added support for insertion before/after multiple paragraphs
@@ -849,156 +907,20 @@ AD CODE RIGHT
849
  * Removed support for deprecated tags for manual insertion {adinserter n}
850
  * Few minor bug fixes
851
 
852
- = 1.5.8 =
853
- * Fixed notice "Undefined index: adinserter_selected_block_" when saving page or post
854
-
855
- = 1.5.7 =
856
- * Fixed notice "has_cap was called with an argument that is deprecated since version 2.0!"
857
- * Few minor bug fixes and code improvements
858
- * Added support to blacklist or whitelist url patterns: /url-start*. *url-pattern*, *url-end
859
- * Added support to define minimum number of words in paragraphs
860
- * Added support to define minimum user role for page/post Ad Inserter exceptions editing
861
- * Added support to limit insertions of individual code blocks
862
- * Added support to filter direct visits (no referer)
863
-
864
- = 1.5.6 =
865
- * Fixed Security Vulnerability: Plugin was vulnerable to Cross-Site Scripting (XSS)
866
- * Few bug fixes and code improvements
867
-
868
- = 1.5.5 =
869
- * Few bug fixes and code improvements
870
- * Added support to export and import all Ad Inserter settings
871
-
872
- = 1.5.4 =
873
- * Many code optimizations and cosmetic changes
874
- * Header and Footer code blocks moved to settings tab (*)
875
- * Added support to process shortcodes of other plugins used in Ad Inserter code blocks
876
- * Added support to white-list or black-list individual urls
877
- * Added support to export and import settings for code blocks
878
- * Added support to specify excerpts for block insertion
879
- * Added support to specify text that must be present when counting paragraphs
880
-
881
- = 1.5.3 =
882
- * Fixed Security Vulnerability: Plugin was vulnerable to a combination of CSRF/XSS attacks (credits to Kaustubh Padwad)
883
- * Fixed bug: In some cases deprecated widgets warning reported errors
884
- * Added support to white-list or black-list tags
885
- * Added support for category slugs in category list
886
- * Added support for relative paragraph positions
887
- * Added support for individual code block exceptions on post/page editor page
888
- * Added support for minimum number of words
889
- * Added support to disable syntax highlighting editor (to allow using copy/paste on mobile devices)
890
-
891
- = 1.5.2 =
892
- * Fixed bug: Widget titles might be displayed at wrong sidebar positions
893
- * Change: Default code block CSS class name was changed from ad-inserter to code-block to prevent Ad Blockers from blocking Ad Inserter divs
894
- * Added warning message if deprecated widgets are used
895
- * Added support to display blocks on desktop + tablet and desktop + phone devices
896
-
897
- = 1.5.1 =
898
- * Few fixes to solve plugin incompatibility issues
899
- * Added support to disable all ads on specific page
900
-
901
- = 1.5.0 =
902
- * Added support to display blocks on all, desktop or mobile devices
903
- * Added support for new widgets API - one widget for all code blocks with multiple instances
904
- * Added support to change wrapping code CSS class name
905
- * Fixed bug: Display block N days after post is published was not working properly
906
- * Fixed bug: Display block after paragraph in some cases was not working propery
907
-
908
- = 1.4.1 =
909
- * Fixed bug: Code blocks configured as widgets were not displayed properly on widgets admin page
910
-
911
- = 1.4.0 =
912
- * Added support to skip paragraphs with specified text
913
- * Added position After paragraph
914
- * Added support for header and footer scripts
915
- * Added support for custom CSS styles
916
- * Added support to display blocks to all, logged in or not logged in users
917
- * Added support for syntax highlighting
918
- * Added support for shortcodes
919
- * Added classes to block wrapping divs
920
- * Few bugs fixed
921
-
922
- = 1.3.5 =
923
- * Fixed bug: missing echo for PHP function call example
924
-
925
- = 1.3.4 =
926
- * Added option for no code wrapping with div
927
- * Added option to insert block codes from PHP code
928
- * Changed HTML codes to disable display on specific pages
929
- * Selected code block position is preserved after settings are saved
930
- * Manual insertion can be enabled or disabled regardless of primary display setting
931
- * Fixed bug: in some cases Before Title display setting inserted code into RSS feed
932
-
933
- = 1.3.3 =
934
- * Added option to insert ads also before or after the excerpt
935
- * Fixed bug: in some cases many errors reported after activating the plugin
936
- * Few minor bugs fixed
937
- * Few minor cosmetic changes
938
-
939
- = 1.3.2 =
940
- * Fixed blank settings page caused by incompatibility with some themes or plugins
941
-
942
- = 1.3.1 =
943
- * Added option to insert ads also on pages
944
- * Added option to process PHP code
945
- * Few bugs fixed
946
-
947
- = 1.3.0 =
948
- * Number of ad slots increased to 16
949
- * New tabbed admin interface
950
- * Ads can be manually inserted also with {adinserter AD_NUMBER} tag
951
- * Fixed bug: only the last ad block set to Before Title was displayed
952
- * Few other minor bugs fixed
953
- * Few cosmetic changes
954
-
955
- = 1.2.1 =
956
- * Fixed problem: || in ad code (e.g. asynchronous code for AdSense) causes only part of the code to be inserted (|| to rotate ads is replaced with |rotate|)
957
-
958
- = 1.2.0 =
959
- * Fixed bug: manual tags in posts lists were not removed
960
- * Added position Before title
961
- * Added support for minimum number of paragraphs
962
- * Added support for page display options for Widget and Before title positions
963
- * Alignment now works for all display positions
964
-
965
- = 1.1.3 =
966
- * Fixed bug for {search_query}: When the tag is empty {smart_tag} is used in all cases
967
- * Few changes in the settings page
968
-
969
- = 1.1.2 =
970
- * Fixed error with multisite/network installations
971
-
972
- = 1.1.1 =
973
- * Fixed bug in Float Right setting display
974
-
975
- = 1.1.0 =
976
- * Added option to manually display individual ads
977
- * Added new ad alignments: left, center, right
978
- * Added {search_query} tag
979
- * Added support for category black list and white list
980
-
981
- = 1.0.4 =
982
- * HTML entities for {title} and {short_title} are now decoded
983
- * Added {tag} to display the first tag
984
-
985
- = 1.0.3 =
986
- * Fixed bug with rotating ads
987
-
988
- = 1.0.2 =
989
- * Added support for rotating ads
990
-
991
- = 1.0.1 =
992
- * Added support for different sidebar implementations
993
-
994
- = 1.0.0 =
995
- * Initial release
996
-
997
 
998
  == Upgrade Notice ==
999
 
 
 
 
 
 
 
 
 
 
1000
  = 2.1.7 =
1001
- Fixed error using PHP 5.4 or earlier
1002
 
1003
  = 2.1.6 =
1004
  Added support for insertion before/after multiple paragraphs;
1
  === Ad Inserter ===
2
  Contributors: spacetime
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4
4
+ Tags: ads, adsense, ad management, advertising, widgets, contextual ads, ad rotation, amazon, banners, automatic insertion, amp, geo targeting, multisite, shortcodes, widgets, PHP, Javascript, HTML, header, footer, tracking, sticky
5
  Requires at least: 4.0
6
+ Tested up to: 4.8
7
+ Stable tag: 2.1.8
8
  License: GPLv3
9
 
10
+ Ad management plugin to automate advertising: AdSense, Amazon, AMP, banner rotation, header/footer code; insert anything anywhere on the page.
11
 
12
  == Description ==
13
 
14
+ Ad management plugin with many advertising features to automatically insert adverts. **Perfect for all kinds of ads including AdSense.** Great also for contextual Amazon Native Shopping Ads and rotating banners. Ad Inserter provides many options to insert any Javascript, HTML, PHP or advert code anywhere on the page.
15
 
16
  > **Features**
17
  >
18
+ > * 16 code (ad) blocks
19
  > * Syntax highlighting editor
20
  > * Code preview with visual CSS editor
21
  > * Automatic insertion before / after post, content, paragraph or excerpt
26
  > * Clearance options to avoid insertion near images or headers
27
  > * Automatic insertion between posts on blog pages
28
  > * Insertion exceptions for posts and pages
29
+ > * Insertion of header and footer code
30
+ > * Insertion of Google Analytics, Piwik or any other web analytics code
31
  > * Manual insertion: widgets, shortcodes, PHP function call
32
+ > * Sticky widgets
33
  > * Custom block alignment and style
34
  > * Insertion of ads on AMP pages
35
  > * Custom CSS class name for wrapping divs to avoid ad blockers
36
  > * Insertion of shortcodes from other plugins
37
  > * PHP code processing
38
  > * Ad rotation (server-side and client-side - works with caching)
39
+ > * Desktop/mobile device detection (server-side and client-side - works with caching)
40
  > * Black/White-list categories, tags, post IDs, urls, url parameters, referers
41
  > * Simple troubleshooting with many debugging functions
42
  > * Function to visualize inserted code blocks
43
  > * Function to visualize available insertion positions
44
  > * Function to visualize HTML tags
45
 
46
+ And <a href="http://adinserter.pro/" target="_blank">Ad Inserter Pro</a> has even more features:
47
+
48
+ > * 64 code (ad) blocks
49
+ > * GEO targeting (works also with caching)
50
+ > * Black/White-list IP addresses or countries (works also with caching)
51
+ > * Ad impression and click tracking
52
+ > * A/B testing
53
+ > * Sticky ad positions (left, top, right, bottom)
54
+ > * Scheduling with fallback option
55
+ > * Multisite options to limit settings on the sites
56
+ > * Post/page exception management
57
+ > * 6 custom viewports for client-side desktop/mobile device detection
58
+ > * Export and import of settings
59
+ > * Support via email
60
+
61
+ Ad Inserter Wordpress plugin has many features and options to automate ad insertion and to optimally monetize your website on desktop, tablet and phone displays. It provides many simple ways to insert any Javascript, HTML, PHP or advert code anywhere on the page. For best ad placement and to use optimal advertising positions please read the user manual to get the most of the plugin.
62
 
63
  > * Check <a href="http://adinserter.pro/documentation" target="_blank">Ad Inserter documentation page</a> for detailed description of all the features and some <a href="http://adinserter.pro/settings" target="_blank">common settings</a> for quick start
64
  > * Download **PDF user guide** for Ad Inserter: go to <a href="http://adinserter.pro/" target="_blank">Ad Inserter Pro</a> page and below you can find button for free download of Ad Inserter User Guide
68
  > Amazon suggests to use Ad Inserter to add Native Shopping Ads to Wordpress posts. Native Shopping Ads provide highly relevant and dynamic product recommendations in a stylishly designed and responsive ad unit that can be placed at the end of your content or within your content to create a more compelling visitor experience and shopping opportunity.
69
  >
70
  > * Check <a href="https://affiliate-program.amazon.com/help/topic/t405" target="_blank">Wordpress Integration Guide for Native Shopping Ads</a>
71
+ > * Check settings for <a href="https://adinserter.pro/settings#amazon">contextual Native Shopping Ads</a> that show items related to the post content (using post tags)
72
 
73
+ **One Plugin - Many Functions**
74
 
75
+ Do you enjoy finding the right plugin to solve a particular problem on your site? For example:
76
+
77
+ * to insert and manage ads
78
+ * to insert different ads for mobile devices
79
+ * for ad rotation
80
+ * for sticky (fixed) widgets
81
+ * for PHP code widgets
82
+ * to insert some PHP code into posts
83
+ * to insert header or footer code
84
+ * to insert Google analytics code
85
+ * to insert various forms
86
+
87
+ Maintaining several plugins (often from different vendors) is not easy. And each plugin is slowing down the speed of your website.
88
+ **Speed Up Your WordPress: Replace them all with free Ad Inserter!**
89
 
90
  **Quick Start**
91
 
93
 
94
  * Code block is any code (for example AdSense ad) that has to be inserted (and displayed) at some position. Each code block can be configured to insert code at almost any position supported by Wordpress
95
  * **Enable and use at least one insertion option** (Automatic insertion, Widget, Shortcode, PHP function call)
96
+ * **Enable insertion on at least one <a href="https://adinserter.pro/page-types">Wordpress page type</a>** (Posts, Static pages, Homepage, Category pages, Search Pages, Archive pages)
97
  * For Posts and static pages **select default value On all Posts / On all Static pages** unless you really know what are you doing
98
  * If you don't see inserted code block turn on **debugging functions**: Label inserted blocks, Show available positions for automatic insertion (Ad Inserter menu item in the Wordpress toolbar on the top of every post/page)
99
 
100
+ Few typical settings are described on the <a href="https://wordpress.org/plugins/ad-inserter/faq/">FAQ</a> page. Please make sure you have also read <a href="https://wordpress.org/plugins/ad-inserter/installation/">Installation</a> page.
101
  For more detailed instructions please read <a href="http://adinserter.pro/documentation" target="_blank">Ad Inserter documentation page</a>.
102
 
103
+ **Please support plugin development**
104
+
105
+ If you are using Ad Inserter and you like it, then please write about it and spread the word on the <a href="https://wordpress.org/support/plugin/ad-inserter/reviews/">review page</a>.
106
+
107
+ Positive reviews are a great way to show your appreciation for my work. Besides being an incredible boost to my morale, they are also a great incentive to fix any bug found in the software and to add new features for better monetization of your website.
108
+
109
+ Support the advancement of this plugin:
110
 
111
  * Write a nice <a href="https://wordpress.org/support/plugin/ad-inserter/reviews/">review</a>
112
  * <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4">Donate</a>
113
+ * Buy license for <a href="http://adinserter.pro/" target="_blank">Ad Inserter Pro</a>
114
 
115
  == Installation ==
116
 
138
 
139
  **Ad Inserter Pro Installation**
140
 
141
+ If you are using free Ad Inserter then first uninstall it. The Pro version will automatically import existing settings from the free version.
142
  After you receive the email with download link for the Ad Inserter Pro plugin, download it, go to Wordpress Plugins, Add New, Upload Plugin, Choose file, click on Install Now,
143
  activate it and then click "Enter License Key" and enter license key you got in the email.
144
 
345
  **Remote debugging** enables other, non-logged in users by using url parameters to see Debugger widget and code insertion debugging (blocks, positions, tags, processing).
346
  Enable this option (and disable caching) to allow other people to see Debugger widget, labeled blocks and positions in order to help you to diagnose problems. For logged in administrators debugging via url is always enabled.
347
 
348
+ **Please support plugin development**
349
+
350
+ If you are using Ad Inserter and you like it, then please write about it and spread the word on the <a href="https://wordpress.org/support/plugin/ad-inserter/reviews/">review page</a>.
351
+
352
+ Positive reviews are a great way to show your appreciation for my work. Besides being an incredible boost to my morale, they are also a great incentive to fix any bug found in the software and to add new features for better monetization of your website.
353
+
354
+ Support the advancement of this plugin:
355
 
356
  * Write a nice <a href="https://wordpress.org/support/plugin/ad-inserter/reviews/">review</a>
357
  * <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4">Donate</a>
358
+ * Buy license for <a href="http://adinserter.pro/" target="_blank">Ad Inserter Pro</a>
359
 
360
 
361
  == Frequently Asked Questions ==
365
  1. After activation, click "Settings / Ad Inserter" to access the settings page
366
  2. Put ad (or any other HTML/Javascript/PHP) code into the ad box
367
  3. Set automatic insertion option (for example: Before Post)
368
+ 4. Enable at least one page type (for example: Posts, some insertion options don't work on all page types)
369
  5. Save settings
370
+ 6. Check inserted code on the posts
371
  7. Check also <a href="http://adinserter.pro/settings" target="_blank">common settings</a>
372
 
373
 
374
+ = I have installed code for AdSense ads but the ad blocks are blank. =
375
+
376
+ If you get blank ads then this might be because there is some error in the code (wrong IDs), your AdSense account is not fully approved yet, your website was not accepted or your AdSense account is banned.
377
+
378
+ In most cases once Google approves your account you'll get ads. This may take few days, sometimes longer.
379
+ However, if after a week you still see blank ads or you know your AdSense account was banned you can try <a href="http://bit.ly/2oF81Oh" target="_blank">Media net ads</a> as good AdSense alternative.
380
+
381
+
382
  = Settings for widget =
383
 
384
  * Nothing needed, just enter the code and save settings - widget is enabled by default
385
  * Go to Appearance / Widgets, drag Ad Inserter widget to the sidebar or any other widget position, select code block and click on Save
386
+ * Optionally you can enable Sticky widget - this means that this widget (and widgets below) will stay fixed in the sidebar when the page is scrolled
387
+ * You can also make other widgets sticky even if you don't use Ad Inserter widgets - drag Ad Inserter widget to the sidebar ABOVE the top widget that needs to be sticky, select Dummy Widget for Block, check Sticky and save widget
388
 
389
  = Settings for contextual Amazon Native Shopping Ads =
390
 
462
 
463
  * Write a nice <a href="https://wordpress.org/support/plugin/ad-inserter/reviews/">review</a>
464
  * <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4">Donate</a>
465
+ * Buy license for <a href="http://adinserter.pro/" target="_blank">Ad Inserter Pro</a>
466
 
467
 
468
  = How can I enable/disable ads on specific posts/pages? =
483
  2. Enable automatic insertion On all Posts/Pages.
484
  3. Click on Lists, enter url (or space separated urls) for Urls, e.g. `/permalink-url`, and white-list or black-list it.
485
 
486
+ For details check <a href="https://adinserter.pro/exceptions" target="_blank">Ad Inserter Post/Page Exceptions</a>.
487
+
488
 
489
  = I'm using responsive theme. How can I show or hide some ads on mobile devices? =
490
 
617
  * Put AMP head script in the Header code block (tab *)
618
  * For all other ads on standard (non AMP) pages blacklist url `*/amp/`
619
 
620
+ For details check <a href="https://adinserter.pro/settings#amp" target="_blank">settings for ads on AMP pages</a>.
621
+
622
 
623
  = How can place ads below Read More tag? =
624
 
689
 
690
  == Changelog ==
691
 
692
+ = 2.1.9 =
693
+ - Added support for sticky widgets
694
+ - Added support to insert code after images (Automatic Insertion: After Paragraph, Paragraphs with tags: img)
695
+ - Impression and click tracking (beta, Pro only)
696
+ - Few minor bug fixes, cosmetic changes and code improvements
697
+
698
+ = 2.1.8 =
699
+ - Fixed error when using server-side device detection
700
+
701
  = 2.1.7 =
702
+ - Fixed error when using PHP 5.4 or earlier
703
 
704
  = 2.1.6 =
705
  - Added support for insertion before/after multiple paragraphs
907
  * Removed support for deprecated tags for manual insertion {adinserter n}
908
  * Few minor bug fixes
909
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
910
 
911
  == Upgrade Notice ==
912
 
913
+ = 2.1.9 =
914
+ Added support for sticky widgets;
915
+ Added support to insert code after images (Automatic Insertion: After Paragraph, Paragraphs with tags: img);
916
+ Impression and click tracking (beta, Pro only);
917
+ Few minor bug fixes, cosmetic changes and code improvements
918
+
919
+ = 2.1.8 =
920
+ Fixed error when using server-side device detection
921
+
922
  = 2.1.7 =
923
+ Fixed error when using PHP 5.4 or earlier
924
 
925
  = 2.1.6 =
926
  Added support for insertion before/after multiple paragraphs;
settings.php CHANGED
@@ -1007,7 +1007,7 @@ function generate_settings_form (){
1007
  </div>
1008
 
1009
  <div style="float: left; color: red;">
1010
- <input onclick="if (confirm('Are you sure you want to reset all settings?')) return true; return false" name="<?php echo AI_FORM_CLEAR; ?>" value="Reset All Settings" type="submit" style="display: none; width:120px; font-weight: bold; color: #e44;" />
1011
  </div>
1012
 
1013
  <div style="clear: both;"></div>
@@ -1092,7 +1092,7 @@ function generate_settings_form (){
1092
  Block Class Name
1093
  </td>
1094
  <td>
1095
- <input style="border-radius: 5px; margin-left: 0px;" title="CSS Class Name for the wrapping div" type="text" id="block-class-name" name="block-class-name" value="<?php echo $block_class_name; ?>" size="15" maxlength="40" />
1096
  </td>
1097
  </tr>
1098
  <tr>
@@ -1100,7 +1100,7 @@ function generate_settings_form (){
1100
  Minimum User Role for Exceptions Editing
1101
  </td>
1102
  <td>
1103
- <select style="border-radius: 5px; margin-bottom: 3px;" id="minimum-user-role" name="minimum-user-role" selected-value="1" style="width:300px">
1104
  <?php wp_dropdown_roles (get_minimum_user_role ()); ?>
1105
  </select>
1106
  </td>
@@ -1110,7 +1110,7 @@ function generate_settings_form (){
1110
  Dynamic blocks
1111
  </td>
1112
  <td>
1113
- <select style="border-radius: 5px; margin-bottom: 3px;" id="dynamic_blocks" name="dynamic_blocks">
1114
  <option value="<?php echo AI_DYNAMIC_BLOCKS_SERVER_SIDE; ?>" <?php echo get_dynamic_blocks() == AI_DYNAMIC_BLOCKS_SERVER_SIDE ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_SERVER_SIDE; ?></option>
1115
  <option value="<?php echo AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC; ?>" <?php echo get_dynamic_blocks() == AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_SERVER_SIDE_W3TC; ?></option>
1116
  <option value="<?php echo AI_DYNAMIC_BLOCKS_CLIENT_SIDE; ?>" <?php echo get_dynamic_blocks() == AI_DYNAMIC_BLOCKS_CLIENT_SIDE ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_CLIENT_SIDE; ?></option>
@@ -1122,18 +1122,26 @@ function generate_settings_form (){
1122
  Functions for Paragraph Counting
1123
  </td>
1124
  <td>
1125
- <select style="border-radius: 5px; margin-bottom: 3px;" id="paragraph_counting_functions" name="paragraph_counting_functions" title="Standard PHP functions are faster and work in most cases, use Multibyte functions if paragraphs are not counted properly on non-english pages.">
1126
  <option value="<?php echo AI_STANDARD_PARAGRAPH_COUNTING_FUNCTIONS; ?>" <?php echo get_paragraph_counting_functions() == AI_STANDARD_PARAGRAPH_COUNTING_FUNCTIONS ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_STANDARD; ?></option>
1127
  <option value="<?php echo AI_MULTIBYTE_PARAGRAPH_COUNTING_FUNCTIONS; ?>" <?php echo get_paragraph_counting_functions() == AI_MULTIBYTE_PARAGRAPH_COUNTING_FUNCTIONS ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_MULTIBYTE; ?></option>
1128
  </select>
1129
  </td>
1130
  </tr>
 
 
 
 
 
 
 
 
1131
  <tr>
1132
  <td style="padding-left: 10px;">
1133
  Plugin priority
1134
  </td>
1135
  <td>
1136
- <input style="border-radius: 5px;" type="text" name="plugin_priority" value="<?php echo get_plugin_priority (); ?>" size="6" maxlength="6" />
1137
  </td>
1138
  </tr>
1139
  </table>
@@ -1148,10 +1156,10 @@ function generate_settings_form (){
1148
  ?>
1149
  <div style="margin: 8px;">
1150
  Viewport <?php echo $viewport; ?> name&nbsp;&nbsp;&nbsp;
1151
- <input style="border-radius: 5px; margin-left: 0px;" type="text" id="option-name-<?php echo $viewport; ?>" name="viewport-name-<?php echo $viewport; ?>" value="<?php echo get_viewport_name ($viewport); ?>" size="15" maxlength="40" />
1152
  <?php if ($viewport == AD_INSERTER_VIEWPORTS) echo '<span style="display: none;">' ?>
1153
  &nbsp;&nbsp; min width
1154
- <input style="border-radius: 5px;" type="text" id="option-length-<?php echo $viewport; ?>" name="viewport-width-<?php echo $viewport; ?>" value="<?php echo get_viewport_width ($viewport); ?>" size="4" maxlength="4" /> px
1155
  <?php if ($viewport == AD_INSERTER_VIEWPORTS) echo '</span>' ?>
1156
  </div>
1157
  <?php
@@ -1168,11 +1176,11 @@ function generate_settings_form (){
1168
  <?php endif; ?>
1169
 
1170
  <input type="hidden" name="<?php echo AI_OPTION_ENABLE_MANUAL, '_block_h'; ?>" value="0" />
1171
- <input type="checkbox" name="<?php echo AI_OPTION_ENABLE_MANUAL, '_block_h'; ?>" id="enable-header" value="1" <?php if ($adH->get_enable_manual () == AI_ENABLED) echo 'checked '; ?> style="display: none;" />
1172
  <label class="checkbox-button" style="margin-left: 10px;" for="enable-header" title="Enable or disable insertion of this code into HTML page header"><span class="checkbox-icon icon-enabled<?php if ($adH->get_enable_manual () == AI_ENABLED) echo ' on'; ?>"></span></label>
1173
 
1174
  <input type="hidden" name="<?php echo AI_OPTION_PROCESS_PHP, '_block_h'; ?>" value="0" />
1175
- <input type="checkbox" name="<?php echo AI_OPTION_PROCESS_PHP, '_block_h'; ?>" value="1" id="process-php-h" <?php if ($adH->get_process_php () == AI_ENABLED) echo 'checked '; ?> style="display: none;" />
1176
  <label class="checkbox-button" style="margin-left: 10px;" for="process-php-h" title="Process PHP code"><span class="checkbox-icon icon-php<?php if ($adH->get_process_php () == AI_ENABLED) echo ' on'; ?>"></span></label>
1177
  </div>
1178
 
@@ -1195,9 +1203,9 @@ function generate_settings_form (){
1195
 
1196
  <div id="device-detection-settings-h" style="padding:8px 8px 8px 8px; margin: 8px 0; border: 1px solid #ddd; border-radius: 5px;">
1197
  <input style="border-radius: 5px;" type="hidden" name="<?php echo AI_OPTION_DETECT_SERVER_SIDE, WP_FORM_FIELD_POSTFIX, AI_HEADER_OPTION_NAME; ?>" value="0" />
1198
- <input style="border-radius: 5px;" type="checkbox" name="<?php echo AI_OPTION_DETECT_SERVER_SIDE, WP_FORM_FIELD_POSTFIX, AI_HEADER_OPTION_NAME; ?>" id="server-side-detection-h" value="1" <?php if ($adH->get_detection_server_side ()==AI_ENABLED) echo 'checked '; ?> />
1199
  <label for="server-side-detection-h">Use server-side detection to insert code only for </label>
1200
- <select style="border-radius: 5px; margin-bottom: 3px;" id="display-for-devices-h" name="<?php echo AI_OPTION_DISPLAY_FOR_DEVICES, WP_FORM_FIELD_POSTFIX, AI_HEADER_OPTION_NAME; ?>" >
1201
  <option value="<?php echo AD_DISPLAY_DESKTOP_DEVICES; ?>" <?php echo ($adH->get_display_for_devices() == AD_DISPLAY_DESKTOP_DEVICES) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_DESKTOP_DEVICES; ?></option>
1202
  <option value="<?php echo AD_DISPLAY_MOBILE_DEVICES; ?>" <?php echo ($adH->get_display_for_devices() == AD_DISPLAY_MOBILE_DEVICES) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_MOBILE_DEVICES; ?></option>
1203
  <option value="<?php echo AD_DISPLAY_TABLET_DEVICES; ?>" <?php echo ($adH->get_display_for_devices() == AD_DISPLAY_TABLET_DEVICES) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_TABLET_DEVICES; ?></option>
@@ -1209,7 +1217,7 @@ function generate_settings_form (){
1209
 
1210
  <span style="float: right; margin-top: 6px;">
1211
  <input style="border-radius: 5px;" type="hidden" name="<?php echo AI_OPTION_ENABLE_404, '_block_h'; ?>" value="0" />
1212
- <input style="border-radius: 5px; margin-left: 10px;" type="checkbox" name="<?php echo AI_OPTION_ENABLE_404, '_block_h'; ?>" id="enable-header-404" value="1" <?php if ($adH->get_enable_404 () == AI_ENABLED) echo 'checked '; ?> />
1213
  <label for="enable-header-404" title="Enable or disable insertion of this code into HTML page header on page for Error 404: Page not found">Insert on Error 404 page</label>
1214
  </span>
1215
  </div>
@@ -1224,11 +1232,11 @@ function generate_settings_form (){
1224
  <?php endif; ?>
1225
 
1226
  <input type="hidden" name="<?php echo AI_OPTION_ENABLE_MANUAL, '_block_f'; ?>" value="0" />
1227
- <input type="checkbox" name="<?php echo AI_OPTION_ENABLE_MANUAL, '_block_f'; ?>" id="enable-footer" value="1" <?php if ($adF->get_enable_manual () == AI_ENABLED) echo 'checked '; ?> style="display: none;" />
1228
  <label class="checkbox-button" style="margin-left: 10px;" for="enable-footer" title="Enable or disable insertion of this code into HTML page footer"><span class="checkbox-icon icon-enabled<?php if ($adF->get_enable_manual () == AI_ENABLED) echo ' on'; ?>"></span></label>
1229
 
1230
  <input type="hidden" name="<?php echo AI_OPTION_PROCESS_PHP, '_block_f'; ?>" value="0" />
1231
- <input type="checkbox" name="<?php echo AI_OPTION_PROCESS_PHP, '_block_f'; ?>" value="1" id="process-php-f" <?php if ($adF->get_process_php () == AI_ENABLED) echo 'checked '; ?> style="display: none;" />
1232
  <label class="checkbox-button" style="margin-left: 10px;" for="process-php-f" title="Process PHP code"><span class="checkbox-icon icon-php<?php if ($adF->get_process_php () == AI_ENABLED) echo ' on'; ?>"></span></label>
1233
  </div>
1234
 
@@ -1251,9 +1259,9 @@ function generate_settings_form (){
1251
 
1252
  <div id="device-detection-settings-f" style="padding:8px 8px 8px 8px; margin: 8px 0; border: 1px solid #ddd; border-radius: 5px;">
1253
  <input style="border-radius: 5px;" type="hidden" name="<?php echo AI_OPTION_DETECT_SERVER_SIDE, WP_FORM_FIELD_POSTFIX, AI_FOOTER_OPTION_NAME; ?>" value="0" />
1254
- <input style="border-radius: 5px;" type="checkbox" name="<?php echo AI_OPTION_DETECT_SERVER_SIDE, WP_FORM_FIELD_POSTFIX, AI_FOOTER_OPTION_NAME; ?>" id="server-side-detection-f" value="1" <?php if ($adF->get_detection_server_side ()==AI_ENABLED) echo 'checked '; ?> />
1255
  <label for="server-side-detection-f">Use server-side detection to insert code only for </label>
1256
- <select style="border-radius: 5px; margin-bottom: 3px;" id="display-for-devices-f" name="<?php echo AI_OPTION_DISPLAY_FOR_DEVICES, WP_FORM_FIELD_POSTFIX, AI_FOOTER_OPTION_NAME; ?>" >
1257
  <option value="<?php echo AD_DISPLAY_DESKTOP_DEVICES; ?>" <?php echo ($adF->get_display_for_devices() == AD_DISPLAY_DESKTOP_DEVICES) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_DESKTOP_DEVICES; ?></option>
1258
  <option value="<?php echo AD_DISPLAY_MOBILE_DEVICES; ?>" <?php echo ($adF->get_display_for_devices() == AD_DISPLAY_MOBILE_DEVICES) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_MOBILE_DEVICES; ?></option>
1259
  <option value="<?php echo AD_DISPLAY_TABLET_DEVICES; ?>" <?php echo ($adF->get_display_for_devices() == AD_DISPLAY_TABLET_DEVICES) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_TABLET_DEVICES; ?></option>
@@ -1265,7 +1273,7 @@ function generate_settings_form (){
1265
 
1266
  <span style="float: right; margin-top: 6px;">
1267
  <input style="border-radius: 5px;" type="hidden" name="<?php echo AI_OPTION_ENABLE_404, '_block_f'; ?>" value="0" />
1268
- <input style="border-radius: 5px; margin-left: 10px;" type="checkbox" name="<?php echo AI_OPTION_ENABLE_404, '_block_f'; ?>" id="enable-footer-404" value="1" <?php if ($adF->get_enable_404 () == AI_ENABLED) echo 'checked '; ?> />
1269
  <label for="enable-footer-404" title="Enable or disable insertion of this code into HTML page footer on page for Error 404: Page not found">Insert on Error 404 page</label>
1270
  </span>
1271
  </div>
@@ -1332,48 +1340,56 @@ function generate_settings_form (){
1332
  <div style="float: left;">
1333
  <div class="ai-form header" style="margin: 8px 0; padding: 0 8px; border: 1px solid rgb(221, 221, 221); border-radius: 5px;">
1334
  <div style="float: left;">
 
 
 
1335
  <h2 style="display: inline-block; margin: 13px 0;">Follow Ad Inserter</h2>
1336
  <a href="https://twitter.com/AdInserter" class="clear-link" target="_blank"><img src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>twitter.png" style="vertical-align: middle; margin: 0 10px 6px 10px;" title="Ad Inserter on Twitter" alt="Ad Inserter on Twitter" /></a>
1337
  <a href="https://www.facebook.com/AdInserter/" class="clear-link" target="_blank"><img src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>facebook.png" style="vertical-align: middle; margin: 0 10px 6px 10px;" title="Ad Inserter on Facebook" alt="Ad Inserter on Facebook" /></a>
1338
  </div>
1339
 
1340
- <div id="header-buttons">
1341
- <a style="text-decoration: none; box-shadow: 0 0 0;" href="http://adinserter.pro/" target="_blank"><button type="button" style="display: none; margin: 0 10px 0 0; width: 62px;">Go&nbsp;Pro</button></a>
1342
- </div>
1343
-
1344
  <div style="clear: both;"></div>
1345
  </div>
1346
 
 
 
 
 
1347
 
1348
  <div class="ai-form" style="padding: 2px 8px 6px 8px; margin: 8px 0 8px 0; border: 1px solid rgb(221, 221, 221); border-radius: 5px; background: #fff;">
1349
  <div style="float: right;" >
1350
  <div>
1351
- <a href="http://adinserter.pro/" style="text-decoration: none; box-shadow: 0 0 0;" title="Automate ad placement in posts and pages" target="_blank"><img src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>icon-256x256.jpg" style="margin-top: 10px;" /></a>
1352
  </div>
1353
  <div>
1354
  <a href='http://bit.ly/2oF81Oh' class="clear-link" title="Looking for AdSense alternative?" target="_blank"><img src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>media.net_250x250_2.jpg" style="margin-top: 10px;" /></a>
1355
  </div>
1356
  </div>
1357
 
1358
- <h3 style="text-align: justify;"><a href="http://adinserter.pro/" style="text-decoration: none; box-shadow: 0 0 0;" target="_blank">Ad Inserter Pro</a> features:</h3>
1359
 
1360
  <ul>
1361
- <li><strong>&squf;</strong> 64 code blocks</li>
 
1362
  <li><strong>&squf;</strong> Syntax highlighting editor</li>
1363
  <li><strong>&squf;</strong> <a href="http://adinserter.pro/documentation#code-preview" class="simple-link" target="_blank">Code preview</a> with visual CSS editor</li>
1364
  <li><strong>&squf;</strong> Automatic insertion before or after post / content / <a href="http://adinserter.pro/documentation#paragraphs" class="simple-link" target="_blank">paragraph</a> / excerpt</li>
1365
  <li><strong>&squf;</strong> Automatic insertion between posts on blog pages</li>
1366
  <li><strong>&squf;</strong> Insertion exceptions for posts and pages</li>
1367
  <li><strong>&squf;</strong> <a href="http://adinserter.pro/documentation#manual" class="simple-link" target="_blank">Manual insertion</a>: widgets, shortcodes, PHP function call</li>
1368
- <li><strong>&squf;</strong> Sticky positions (ads do not move when the page scrolls)</li>
 
1369
  <li><strong>&squf;</strong> Block alignment and style customizations</li>
1370
- <li><strong>&squf;</strong> <a href="http://adinserter.pro/documentation#paragraphs" class="simple-link" target="_blank">Clearance</a> options to avoid insertion near images or headers</li>
1371
  <li><strong>&squf;</strong> Options to disable insertion on Ajax calls, 404 error pages or in feeds</li>
1372
  <li><strong>&squf;</strong> Ad rotation (works also with caching)</li>
1373
- <li><strong>&squf;</strong> Support for <a href="http://adinserter.pro/settings#amp" class="simple-link" target="_blank">AMP pages</a></li>
 
 
1374
  <li><strong>&squf;</strong> Custom CSS class name for wrapping divs to avoid ad blockers</li>
1375
  <li><strong>&squf;</strong> PHP code processing</li>
1376
  <li><strong>&squf;</strong> Support for <a href="http://adinserter.pro/documentation#header-footer" class="simple-link" target="_blank">header and footer</a> code</li>
 
1377
  <li><strong>&squf;</strong> Desktop, tablet and phone server-side <a href="http://adinserter.pro/documentation#devices" class="simple-link" target="_blank">device detection</a></li>
1378
  <li><strong>&squf;</strong> Client-side <a href="http://adinserter.pro/documentation#devices" class="simple-link" target="_blank">device detection</a> (works with caching, 6 custom viewports)</li>
1379
  <li><strong>&squf;</strong> <a href="http://adinserter.pro/documentation#lists" class="simple-link" target="_blank">Black/White-list</a> categories, tags, post IDs, urls, referers</li>
@@ -1388,8 +1404,9 @@ function generate_settings_form (){
1388
  <li><strong>&squf;</strong> <a href="http://adinserter.pro/documentation#visualization" class="simple-link" target="_blank">Visualization</a> of HTML tags for easier ad placement between paragraphs</li>
1389
  </ul>
1390
 
1391
- <p style="text-align: justify;">With Ad Inserter Pro you also get <strong>one year of free updates and support via email</strong>. If you find Ad Inserter useful and need more code blocks, GEO targeting or multisite support
1392
- then you can simply upgrade to <a href="http://adinserter.pro/" style="text-decoration: none;" target="_blank">Ad Inserter Pro</a> (existing settings will be preserved).</p>
 
1393
  </div>
1394
 
1395
  </div>
1007
  </div>
1008
 
1009
  <div style="float: left; color: red;">
1010
+ <input onclick="if (confirm('Are you sure you want to reset all settings?')) return true; return false;" name="<?php echo AI_FORM_CLEAR; ?>" value="Reset All Settings" type="submit" style="display: none; width:125px; font-weight: bold; color: #e44;" />
1011
  </div>
1012
 
1013
  <div style="clear: both;"></div>
1092
  Block Class Name
1093
  </td>
1094
  <td>
1095
+ <input style="border-radius: 5px; margin-left: 0px;" title="CSS Class Name for the wrapping div" type="text" id="block-class-name" name="block-class-name" value="<?php echo $block_class_name; ?>" default="<?php echo DEFAULT_BLOCK_CLASS_NAME; ?>" size="15" maxlength="40" />
1096
  </td>
1097
  </tr>
1098
  <tr>
1100
  Minimum User Role for Exceptions Editing
1101
  </td>
1102
  <td>
1103
+ <select style="border-radius: 5px; margin-bottom: 3px;" id="minimum-user-role" name="minimum-user-role" selected-value="1" data="<?php echo get_minimum_user_role (); ?>" default="<?php echo DEFAULT_MINIMUM_USER_ROLE; ?>" style="width:300px">
1104
  <?php wp_dropdown_roles (get_minimum_user_role ()); ?>
1105
  </select>
1106
  </td>
1110
  Dynamic blocks
1111
  </td>
1112
  <td>
1113
+ <select style="border-radius: 5px; margin-bottom: 3px;" id="dynamic_blocks" name="dynamic_blocks" default="<?php echo DEFAULT_DYNAMIC_BLOCKS; ?>">
1114
  <option value="<?php echo AI_DYNAMIC_BLOCKS_SERVER_SIDE; ?>" <?php echo get_dynamic_blocks() == AI_DYNAMIC_BLOCKS_SERVER_SIDE ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_SERVER_SIDE; ?></option>
1115
  <option value="<?php echo AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC; ?>" <?php echo get_dynamic_blocks() == AI_DYNAMIC_BLOCKS_SERVER_SIDE_W3TC ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_SERVER_SIDE_W3TC; ?></option>
1116
  <option value="<?php echo AI_DYNAMIC_BLOCKS_CLIENT_SIDE; ?>" <?php echo get_dynamic_blocks() == AI_DYNAMIC_BLOCKS_CLIENT_SIDE ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_CLIENT_SIDE; ?></option>
1122
  Functions for Paragraph Counting
1123
  </td>
1124
  <td>
1125
+ <select style="border-radius: 5px; margin-bottom: 3px;" id="paragraph_counting_functions" name="paragraph_counting_functions" default="<?php echo DEFAULT_PARAGRAPH_COUNTING_FUNCTIONS; ?>" title="Standard PHP functions are faster and work in most cases, use Multibyte functions if paragraphs are not counted properly on non-english pages.">
1126
  <option value="<?php echo AI_STANDARD_PARAGRAPH_COUNTING_FUNCTIONS; ?>" <?php echo get_paragraph_counting_functions() == AI_STANDARD_PARAGRAPH_COUNTING_FUNCTIONS ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_STANDARD; ?></option>
1127
  <option value="<?php echo AI_MULTIBYTE_PARAGRAPH_COUNTING_FUNCTIONS; ?>" <?php echo get_paragraph_counting_functions() == AI_MULTIBYTE_PARAGRAPH_COUNTING_FUNCTIONS ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_TEXT_MULTIBYTE; ?></option>
1128
  </select>
1129
  </td>
1130
  </tr>
1131
+ <tr>
1132
+ <td style="padding-left: 10px;">
1133
+ Sticky Widget Top Margin
1134
+ </td>
1135
+ <td>
1136
+ <input style="border-radius: 5px;" type="text" name="sticky-widget-margin" value="<?php echo get_sticky_widget_margin (); ?>" default="<?php echo DEFAULT_STICKY_WIDGET_MARGIN; ?>" size="6" maxlength="4" /> px
1137
+ </td>
1138
+ </tr>
1139
  <tr>
1140
  <td style="padding-left: 10px;">
1141
  Plugin priority
1142
  </td>
1143
  <td>
1144
+ <input style="border-radius: 5px;" type="text" name="plugin_priority" value="<?php echo get_plugin_priority (); ?>" default="<?php echo DEFAULT_PLUGIN_PRIORITY; ?>" size="6" maxlength="6" />
1145
  </td>
1146
  </tr>
1147
  </table>
1156
  ?>
1157
  <div style="margin: 8px;">
1158
  Viewport <?php echo $viewport; ?> name&nbsp;&nbsp;&nbsp;
1159
+ <input style="border-radius: 5px; margin-left: 0px;" type="text" id="option-name-<?php echo $viewport; ?>" name="viewport-name-<?php echo $viewport; ?>" value="<?php echo get_viewport_name ($viewport); ?>" default="<?php echo defined ("DEFAULT_VIEWPORT_NAME_" . $viewport) ? constant ("DEFAULT_VIEWPORT_NAME_" . $viewport) : ""; ?>" size="15" maxlength="40" />
1160
  <?php if ($viewport == AD_INSERTER_VIEWPORTS) echo '<span style="display: none;">' ?>
1161
  &nbsp;&nbsp; min width
1162
+ <input style="border-radius: 5px;" type="text" id="option-length-<?php echo $viewport; ?>" name="viewport-width-<?php echo $viewport; ?>" value="<?php echo get_viewport_width ($viewport); ?>" default="<?php echo defined ("DEFAULT_VIEWPORT_WIDTH_" . $viewport) ? constant ("DEFAULT_VIEWPORT_WIDTH_" . $viewport) : ""; ?>" size="4" maxlength="4" /> px
1163
  <?php if ($viewport == AD_INSERTER_VIEWPORTS) echo '</span>' ?>
1164
  </div>
1165
  <?php
1176
  <?php endif; ?>
1177
 
1178
  <input type="hidden" name="<?php echo AI_OPTION_ENABLE_MANUAL, '_block_h'; ?>" value="0" />
1179
+ <input type="checkbox" name="<?php echo AI_OPTION_ENABLE_MANUAL, '_block_h'; ?>" id="enable-header" value="1" default="<?php echo $default->get_enable_manual(); ?>" <?php if ($adH->get_enable_manual () == AI_ENABLED) echo 'checked '; ?> style="display: none;" />
1180
  <label class="checkbox-button" style="margin-left: 10px;" for="enable-header" title="Enable or disable insertion of this code into HTML page header"><span class="checkbox-icon icon-enabled<?php if ($adH->get_enable_manual () == AI_ENABLED) echo ' on'; ?>"></span></label>
1181
 
1182
  <input type="hidden" name="<?php echo AI_OPTION_PROCESS_PHP, '_block_h'; ?>" value="0" />
1183
+ <input type="checkbox" name="<?php echo AI_OPTION_PROCESS_PHP, '_block_h'; ?>" value="1" id="process-php-h" default="<?php echo $default->get_process_php (); ?>" <?php if ($adH->get_process_php () == AI_ENABLED) echo 'checked '; ?> style="display: none;" />
1184
  <label class="checkbox-button" style="margin-left: 10px;" for="process-php-h" title="Process PHP code"><span class="checkbox-icon icon-php<?php if ($adH->get_process_php () == AI_ENABLED) echo ' on'; ?>"></span></label>
1185
  </div>
1186
 
1203
 
1204
  <div id="device-detection-settings-h" style="padding:8px 8px 8px 8px; margin: 8px 0; border: 1px solid #ddd; border-radius: 5px;">
1205
  <input style="border-radius: 5px;" type="hidden" name="<?php echo AI_OPTION_DETECT_SERVER_SIDE, WP_FORM_FIELD_POSTFIX, AI_HEADER_OPTION_NAME; ?>" value="0" />
1206
+ <input style="border-radius: 5px;" type="checkbox" name="<?php echo AI_OPTION_DETECT_SERVER_SIDE, WP_FORM_FIELD_POSTFIX, AI_HEADER_OPTION_NAME; ?>" id="server-side-detection-h" value="1" default="<?php echo $default->get_detection_server_side(); ?>" <?php if ($adH->get_detection_server_side ()==AI_ENABLED) echo 'checked '; ?> />
1207
  <label for="server-side-detection-h">Use server-side detection to insert code only for </label>
1208
+ <select style="border-radius: 5px; margin-bottom: 3px;" id="display-for-devices-h" name="<?php echo AI_OPTION_DISPLAY_FOR_DEVICES, WP_FORM_FIELD_POSTFIX, AI_HEADER_OPTION_NAME; ?>" default="<?php echo $default->get_display_for_devices(); ?>" >
1209
  <option value="<?php echo AD_DISPLAY_DESKTOP_DEVICES; ?>" <?php echo ($adH->get_display_for_devices() == AD_DISPLAY_DESKTOP_DEVICES) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_DESKTOP_DEVICES; ?></option>
1210
  <option value="<?php echo AD_DISPLAY_MOBILE_DEVICES; ?>" <?php echo ($adH->get_display_for_devices() == AD_DISPLAY_MOBILE_DEVICES) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_MOBILE_DEVICES; ?></option>
1211
  <option value="<?php echo AD_DISPLAY_TABLET_DEVICES; ?>" <?php echo ($adH->get_display_for_devices() == AD_DISPLAY_TABLET_DEVICES) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_TABLET_DEVICES; ?></option>
1217
 
1218
  <span style="float: right; margin-top: 6px;">
1219
  <input style="border-radius: 5px;" type="hidden" name="<?php echo AI_OPTION_ENABLE_404, '_block_h'; ?>" value="0" />
1220
+ <input style="border-radius: 5px; margin-left: 10px;" type="checkbox" name="<?php echo AI_OPTION_ENABLE_404, '_block_h'; ?>" id="enable-header-404" value="1" default="<?php echo $default->get_enable_404(); ?>" <?php if ($adH->get_enable_404 () == AI_ENABLED) echo 'checked '; ?> />
1221
  <label for="enable-header-404" title="Enable or disable insertion of this code into HTML page header on page for Error 404: Page not found">Insert on Error 404 page</label>
1222
  </span>
1223
  </div>
1232
  <?php endif; ?>
1233
 
1234
  <input type="hidden" name="<?php echo AI_OPTION_ENABLE_MANUAL, '_block_f'; ?>" value="0" />
1235
+ <input type="checkbox" name="<?php echo AI_OPTION_ENABLE_MANUAL, '_block_f'; ?>" id="enable-footer" value="1" default="<?php echo $default->get_enable_manual(); ?>" <?php if ($adF->get_enable_manual () == AI_ENABLED) echo 'checked '; ?> style="display: none;" />
1236
  <label class="checkbox-button" style="margin-left: 10px;" for="enable-footer" title="Enable or disable insertion of this code into HTML page footer"><span class="checkbox-icon icon-enabled<?php if ($adF->get_enable_manual () == AI_ENABLED) echo ' on'; ?>"></span></label>
1237
 
1238
  <input type="hidden" name="<?php echo AI_OPTION_PROCESS_PHP, '_block_f'; ?>" value="0" />
1239
+ <input type="checkbox" name="<?php echo AI_OPTION_PROCESS_PHP, '_block_f'; ?>" value="1" id="process-php-f" default="<?php echo $default->get_process_php (); ?>" <?php if ($adF->get_process_php () == AI_ENABLED) echo 'checked '; ?> style="display: none;" />
1240
  <label class="checkbox-button" style="margin-left: 10px;" for="process-php-f" title="Process PHP code"><span class="checkbox-icon icon-php<?php if ($adF->get_process_php () == AI_ENABLED) echo ' on'; ?>"></span></label>
1241
  </div>
1242
 
1259
 
1260
  <div id="device-detection-settings-f" style="padding:8px 8px 8px 8px; margin: 8px 0; border: 1px solid #ddd; border-radius: 5px;">
1261
  <input style="border-radius: 5px;" type="hidden" name="<?php echo AI_OPTION_DETECT_SERVER_SIDE, WP_FORM_FIELD_POSTFIX, AI_FOOTER_OPTION_NAME; ?>" value="0" />
1262
+ <input style="border-radius: 5px;" type="checkbox" name="<?php echo AI_OPTION_DETECT_SERVER_SIDE, WP_FORM_FIELD_POSTFIX, AI_FOOTER_OPTION_NAME; ?>" id="server-side-detection-f" value="1" default="<?php echo $default->get_detection_server_side(); ?>" <?php if ($adF->get_detection_server_side ()==AI_ENABLED) echo 'checked '; ?> />
1263
  <label for="server-side-detection-f">Use server-side detection to insert code only for </label>
1264
+ <select style="border-radius: 5px; margin-bottom: 3px;" id="display-for-devices-f" name="<?php echo AI_OPTION_DISPLAY_FOR_DEVICES, WP_FORM_FIELD_POSTFIX, AI_FOOTER_OPTION_NAME; ?>" default="<?php echo $default->get_display_for_devices(); ?>" >
1265
  <option value="<?php echo AD_DISPLAY_DESKTOP_DEVICES; ?>" <?php echo ($adF->get_display_for_devices() == AD_DISPLAY_DESKTOP_DEVICES) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_DESKTOP_DEVICES; ?></option>
1266
  <option value="<?php echo AD_DISPLAY_MOBILE_DEVICES; ?>" <?php echo ($adF->get_display_for_devices() == AD_DISPLAY_MOBILE_DEVICES) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_MOBILE_DEVICES; ?></option>
1267
  <option value="<?php echo AD_DISPLAY_TABLET_DEVICES; ?>" <?php echo ($adF->get_display_for_devices() == AD_DISPLAY_TABLET_DEVICES) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AD_DISPLAY_TABLET_DEVICES; ?></option>
1273
 
1274
  <span style="float: right; margin-top: 6px;">
1275
  <input style="border-radius: 5px;" type="hidden" name="<?php echo AI_OPTION_ENABLE_404, '_block_f'; ?>" value="0" />
1276
+ <input style="border-radius: 5px; margin-left: 10px;" type="checkbox" name="<?php echo AI_OPTION_ENABLE_404, '_block_f'; ?>" id="enable-footer-404" value="1" default="<?php echo $default->get_enable_404(); ?>" <?php if ($adF->get_enable_404 () == AI_ENABLED) echo 'checked '; ?> />
1277
  <label for="enable-footer-404" title="Enable or disable insertion of this code into HTML page footer on page for Error 404: Page not found">Insert on Error 404 page</label>
1278
  </span>
1279
  </div>
1340
  <div style="float: left;">
1341
  <div class="ai-form header" style="margin: 8px 0; padding: 0 8px; border: 1px solid rgb(221, 221, 221); border-radius: 5px;">
1342
  <div style="float: left;">
1343
+ <h2 style="display: inline-block; margin: 13px 0;">Please support plugin development</h2>
1344
+ </div>
1345
+ <div style="float: right;">
1346
  <h2 style="display: inline-block; margin: 13px 0;">Follow Ad Inserter</h2>
1347
  <a href="https://twitter.com/AdInserter" class="clear-link" target="_blank"><img src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>twitter.png" style="vertical-align: middle; margin: 0 10px 6px 10px;" title="Ad Inserter on Twitter" alt="Ad Inserter on Twitter" /></a>
1348
  <a href="https://www.facebook.com/AdInserter/" class="clear-link" target="_blank"><img src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>facebook.png" style="vertical-align: middle; margin: 0 10px 6px 10px;" title="Ad Inserter on Facebook" alt="Ad Inserter on Facebook" /></a>
1349
  </div>
1350
 
 
 
 
 
1351
  <div style="clear: both;"></div>
1352
  </div>
1353
 
1354
+ <div class="ai-form header" style="margin: 8px 0; padding: 0 8px; border: 1px solid rgb(221, 221, 221); border-radius: 5px;">
1355
+ <p>If you are using Ad Inserter and you like it, then please write about it and spread the word on the <a href="https://wordpress.org/support/plugin/ad-inserter/reviews/" style="text-decoration: none; box-shadow: 0 0 0;" target="_blank">review page</a>.</p>
1356
+ <p>Positive reviews are a great way to show your appreciation for my work. Besides being an incredible boost to my morale, they are also a great incentive to fix any bug found in the software and to add new features for better monetization of your website.</p>
1357
+ </div>
1358
 
1359
  <div class="ai-form" style="padding: 2px 8px 6px 8px; margin: 8px 0 8px 0; border: 1px solid rgb(221, 221, 221); border-radius: 5px; background: #fff;">
1360
  <div style="float: right;" >
1361
  <div>
1362
+ <a href="http://adinserter.pro/" style="text-decoration: none; box-shadow: 0 0 0;" title="Automate ad placement on posts and pages" target="_blank"><img src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>icon-256x256.jpg" style="margin-top: 10px;" /></a>
1363
  </div>
1364
  <div>
1365
  <a href='http://bit.ly/2oF81Oh' class="clear-link" title="Looking for AdSense alternative?" target="_blank"><img src="<?php echo AD_INSERTER_PLUGIN_IMAGES_URL; ?>media.net_250x250_2.jpg" style="margin-top: 10px;" /></a>
1366
  </div>
1367
  </div>
1368
 
1369
+ <h3 style="text-align: justify;">Need a plugin for ad management? <a href="http://adinserter.pro/" style="text-decoration: none; box-shadow: 0 0 0;" target="_blank">Ad Inserter Pro</a> features:</h3>
1370
 
1371
  <ul>
1372
+ <li><strong>&squf;</strong> Email support</li>
1373
+ <li><strong>&squf;</strong> 64 code (ad) blocks</li>
1374
  <li><strong>&squf;</strong> Syntax highlighting editor</li>
1375
  <li><strong>&squf;</strong> <a href="http://adinserter.pro/documentation#code-preview" class="simple-link" target="_blank">Code preview</a> with visual CSS editor</li>
1376
  <li><strong>&squf;</strong> Automatic insertion before or after post / content / <a href="http://adinserter.pro/documentation#paragraphs" class="simple-link" target="_blank">paragraph</a> / excerpt</li>
1377
  <li><strong>&squf;</strong> Automatic insertion between posts on blog pages</li>
1378
  <li><strong>&squf;</strong> Insertion exceptions for posts and pages</li>
1379
  <li><strong>&squf;</strong> <a href="http://adinserter.pro/documentation#manual" class="simple-link" target="_blank">Manual insertion</a>: widgets, shortcodes, PHP function call</li>
1380
+ <li><strong>&squf;</strong> Sticky positions (left, top, right, bottom - ads stay fixed when the page scrolls)</li>
1381
+ <li><strong>&squf;</strong> Sticky (fixed) widgets (sidebar does not move when the page scrolls)</li>
1382
  <li><strong>&squf;</strong> Block alignment and style customizations</li>
1383
+ <li><strong>&squf;</strong> <a href="http://adinserter.pro/documentation#paragraphs" class="simple-link" target="_blank">Clearance</a> options to avoid insertion near images or headers (AdSense TOS)</li>
1384
  <li><strong>&squf;</strong> Options to disable insertion on Ajax calls, 404 error pages or in feeds</li>
1385
  <li><strong>&squf;</strong> Ad rotation (works also with caching)</li>
1386
+ <li><strong>&squf;</strong> Ad impression and click tracking</li>
1387
+ <li><strong>&squf;</strong> A/B testing</li>
1388
+ <li><strong>&squf;</strong> Support for ads on <a href="http://adinserter.pro/settings#amp" class="simple-link" target="_blank">AMP pages</a></li>
1389
  <li><strong>&squf;</strong> Custom CSS class name for wrapping divs to avoid ad blockers</li>
1390
  <li><strong>&squf;</strong> PHP code processing</li>
1391
  <li><strong>&squf;</strong> Support for <a href="http://adinserter.pro/documentation#header-footer" class="simple-link" target="_blank">header and footer</a> code</li>
1392
+ <li><strong>&squf;</strong> Support for Google Analytics, Piwik or any other web analytics code</li>
1393
  <li><strong>&squf;</strong> Desktop, tablet and phone server-side <a href="http://adinserter.pro/documentation#devices" class="simple-link" target="_blank">device detection</a></li>
1394
  <li><strong>&squf;</strong> Client-side <a href="http://adinserter.pro/documentation#devices" class="simple-link" target="_blank">device detection</a> (works with caching, 6 custom viewports)</li>
1395
  <li><strong>&squf;</strong> <a href="http://adinserter.pro/documentation#lists" class="simple-link" target="_blank">Black/White-list</a> categories, tags, post IDs, urls, referers</li>
1404
  <li><strong>&squf;</strong> <a href="http://adinserter.pro/documentation#visualization" class="simple-link" target="_blank">Visualization</a> of HTML tags for easier ad placement between paragraphs</li>
1405
  </ul>
1406
 
1407
+ <p style="text-align: justify;">Ad Inserter Pro is a complete ad management plugin with many advertising features to automatically insert adverts on posts and pages.
1408
+ With Ad Inserter Pro you also get <strong>one year of free updates and support via email</strong>. If you find Ad Inserter useful and need more code blocks, GEO targeting,
1409
+ impression and click tracking or multisite support then you can simply upgrade to <a href="http://adinserter.pro/" style="text-decoration: none;" target="_blank">Ad Inserter Pro</a> (existing settings will be preserved).</p>
1410
  </div>
1411
 
1412
  </div>