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

Version Description

  • Added support to filter subpages created by the <!--nextpage--> tag
  • Added option to import block name (Pro only)
  • Cookie deleted only when it exists and debugging is disabled
  • Few minor bug fixes
Download this release

Release Info

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

Code changes from version 2.0.5 to 2.0.6

Files changed (7) hide show
  1. ad-inserter.php +23 -12
  2. class.php +16 -5
  3. constants.php +13 -11
  4. css/ad-inserter.css +1 -1
  5. js/ad-inserter.js +1 -1
  6. readme.txt +43 -22
  7. settings.php +1 -0
ad-inserter.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Ad Inserter
4
- Version: 2.0.5
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/
@@ -11,6 +11,12 @@ Plugin URI: http://tinymonitor.com/ad-inserter
11
  /*
12
  Change Log
13
 
 
 
 
 
 
 
14
  Ad Inserter 2.0.5 - 8 october 2016
15
  - Cookie created only when debugging is enabled
16
  - Few minor bug fixes
@@ -706,10 +712,14 @@ function ai_wp_hook () {
706
 
707
  if (!is_admin()) {
708
  if (isset ($_GET [AI_URL_DEBUG]) && $_GET [AI_URL_DEBUG] == 0) {
709
- unset ($_COOKIE ['AI_WP_DEBUGGING']);
710
- setcookie ('AI_WP_DEBUGGING', '', time() - (15 * 60), COOKIEPATH);
711
- unset ($_COOKIE ['AI_WP_DEBUG_BLOCK']);
712
- setcookie ('AI_WP_DEBUG_BLOCK', '', time() - (15 * 60), COOKIEPATH);
 
 
 
 
713
  } else {
714
  $ai_wp_data [AI_WP_DEBUGGING] = isset ($_COOKIE ['AI_WP_DEBUGGING']) ? $ai_wp_data [AI_WP_DEBUGGING] | ($_COOKIE ['AI_WP_DEBUGGING'] & ~AI_DEBUG_PROCESSING) : $ai_wp_data [AI_WP_DEBUGGING];
715
  $ai_wp_data [AI_WP_DEBUG_BLOCK] = isset ($_COOKIE ['AI_WP_DEBUG_BLOCK']) ? $_COOKIE ['AI_WP_DEBUG_BLOCK'] : 0;
@@ -731,11 +741,11 @@ function ai_wp_hook () {
731
 
732
  if ($ai_wp_data [AI_WP_DEBUGGING] != 0)
733
  setcookie ('AI_WP_DEBUGGING', $ai_wp_data [AI_WP_DEBUGGING], time() + AI_COOKIE_TIME, COOKIEPATH); else
734
- setcookie ('AI_WP_DEBUGGING', '', time() - (15 * 60), COOKIEPATH);
735
 
736
  if ($ai_wp_data [AI_WP_DEBUG_BLOCK] != 0)
737
  setcookie ('AI_WP_DEBUG_BLOCK', $ai_wp_data [AI_WP_DEBUG_BLOCK], time() + AI_COOKIE_TIME, COOKIEPATH); else
738
- setcookie ('AI_WP_DEBUG_BLOCK', '', time() - (15 * 60), COOKIEPATH);
739
  }
740
  }
741
 
@@ -1897,15 +1907,16 @@ function ai_settings () {
1897
  continue;
1898
  }
1899
 
1900
- $block_settings = 0;
1901
- $import_switch_name = AI_OPTION_IMPORT . WP_FORM_FIELD_POSTFIX . $block;
 
1902
  if (isset ($_POST [$import_switch_name]) && $_POST [$import_switch_name] == "1") {
1903
 
1904
  $exported_settings = @unserialize (base64_decode (str_replace (array ("\\\""), array ("\""), $_POST ["export_settings_" . $block])));
1905
 
1906
  if ($exported_settings !== false) {
1907
  foreach (array_keys ($ad->wp_options) as $key){
1908
- if ($key == AI_OPTION_NAME) {
1909
  $form_field_name = $key . WP_FORM_FIELD_POSTFIX . $block;
1910
  if (isset ($_POST [$form_field_name])){
1911
  $ad->wp_options [$key] = filter_option ($key, $_POST [$form_field_name]);
@@ -1913,7 +1924,7 @@ function ai_settings () {
1913
  } else {
1914
  if (isset ($exported_settings [$key])) {
1915
  $ad->wp_options [$key] = filter_option ($key, $exported_settings [$key], false);
1916
- $block_settings ++;
1917
  }
1918
  }
1919
  }
@@ -1926,7 +1937,7 @@ function ai_settings () {
1926
  $form_field_name = $key . WP_FORM_FIELD_POSTFIX . $block;
1927
  if (isset ($_POST [$form_field_name])){
1928
  $ad->wp_options [$key] = filter_option ($key, $_POST [$form_field_name]);
1929
- $block_settings ++;
1930
  }
1931
  }
1932
  }
1
  <?php
2
  /*
3
  Plugin Name: Ad Inserter
4
+ Version: 2.0.6
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/
11
  /*
12
  Change Log
13
 
14
+ Ad Inserter 2.0.6 - 25 November 2016
15
+ - Added support to filter subpages created by the <!--nextpage--> tag
16
+ - Added option to import block name (Pro only)
17
+ - Cookie deleted only when it exists and debugging is disabled
18
+ - Few minor bug fixes
19
+
20
  Ad Inserter 2.0.5 - 8 october 2016
21
  - Cookie created only when debugging is enabled
22
  - Few minor bug fixes
712
 
713
  if (!is_admin()) {
714
  if (isset ($_GET [AI_URL_DEBUG]) && $_GET [AI_URL_DEBUG] == 0) {
715
+ if (isset ($_COOKIE ['AI_WP_DEBUGGING'])) {
716
+ unset ($_COOKIE ['AI_WP_DEBUGGING']);
717
+ setcookie ('AI_WP_DEBUGGING', '', time() - (15 * 60), COOKIEPATH);
718
+ }
719
+ if (isset ($_COOKIE ['AI_WP_DEBUG_BLOCK'])) {
720
+ unset ($_COOKIE ['AI_WP_DEBUG_BLOCK']);
721
+ setcookie ('AI_WP_DEBUG_BLOCK', '', time() - (15 * 60), COOKIEPATH);
722
+ }
723
  } else {
724
  $ai_wp_data [AI_WP_DEBUGGING] = isset ($_COOKIE ['AI_WP_DEBUGGING']) ? $ai_wp_data [AI_WP_DEBUGGING] | ($_COOKIE ['AI_WP_DEBUGGING'] & ~AI_DEBUG_PROCESSING) : $ai_wp_data [AI_WP_DEBUGGING];
725
  $ai_wp_data [AI_WP_DEBUG_BLOCK] = isset ($_COOKIE ['AI_WP_DEBUG_BLOCK']) ? $_COOKIE ['AI_WP_DEBUG_BLOCK'] : 0;
741
 
742
  if ($ai_wp_data [AI_WP_DEBUGGING] != 0)
743
  setcookie ('AI_WP_DEBUGGING', $ai_wp_data [AI_WP_DEBUGGING], time() + AI_COOKIE_TIME, COOKIEPATH); else
744
+ if (isset ($_COOKIE ['AI_WP_DEBUGGING'])) setcookie ('AI_WP_DEBUGGING', '', time() - (15 * 60), COOKIEPATH);
745
 
746
  if ($ai_wp_data [AI_WP_DEBUG_BLOCK] != 0)
747
  setcookie ('AI_WP_DEBUG_BLOCK', $ai_wp_data [AI_WP_DEBUG_BLOCK], time() + AI_COOKIE_TIME, COOKIEPATH); else
748
+ if (isset ($_COOKIE ['AI_WP_DEBUG_BLOCK'])) setcookie ('AI_WP_DEBUG_BLOCK', '', time() - (15 * 60), COOKIEPATH);
749
  }
750
  }
751
 
1907
  continue;
1908
  }
1909
 
1910
+ // $block_settings = 0;
1911
+ $import_switch_name = AI_OPTION_IMPORT . WP_FORM_FIELD_POSTFIX . $block;
1912
+ $import_name_switch_name = AI_OPTION_IMPORT_NAME . WP_FORM_FIELD_POSTFIX . $block;
1913
  if (isset ($_POST [$import_switch_name]) && $_POST [$import_switch_name] == "1") {
1914
 
1915
  $exported_settings = @unserialize (base64_decode (str_replace (array ("\\\""), array ("\""), $_POST ["export_settings_" . $block])));
1916
 
1917
  if ($exported_settings !== false) {
1918
  foreach (array_keys ($ad->wp_options) as $key){
1919
+ if ($key == AI_OPTION_NAME && isset ($_POST [$import_name_switch_name]) && $_POST [$import_name_switch_name] != "1") {
1920
  $form_field_name = $key . WP_FORM_FIELD_POSTFIX . $block;
1921
  if (isset ($_POST [$form_field_name])){
1922
  $ad->wp_options [$key] = filter_option ($key, $_POST [$form_field_name]);
1924
  } else {
1925
  if (isset ($exported_settings [$key])) {
1926
  $ad->wp_options [$key] = filter_option ($key, $exported_settings [$key], false);
1927
+ // $block_settings ++;
1928
  }
1929
  }
1930
  }
1937
  $form_field_name = $key . WP_FORM_FIELD_POSTFIX . $block;
1938
  if (isset ($_POST [$form_field_name])){
1939
  $ad->wp_options [$key] = filter_option ($key, $_POST [$form_field_name]);
1940
+ // $block_settings ++;
1941
  }
1942
  }
1943
  }
class.php CHANGED
@@ -1954,7 +1954,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1954
  }
1955
 
1956
  function check_filter ($counter_for_filter) {
1957
- global $ai_last_check, $ad_interter_globals;
1958
 
1959
  $ai_last_check = AI_CHECK_FILTER;
1960
  $filter_settings = trim ($this->get_call_filter());
@@ -1985,6 +1985,10 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1985
  if (isset ($ad_interter_globals [AI_WIDGET_COUNTER_NAME . $this->number]))
1986
  $counter_for_filter = $ad_interter_globals [AI_WIDGET_COUNTER_NAME . $this->number]; else return false;
1987
  break;
 
 
 
 
1988
  }
1989
 
1990
  $filter_values = array ();
@@ -2138,11 +2142,18 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
2138
 
2139
  if ($selected_tag == '' && count ($tag_array) >= 2 && count ($tag_array [0]) == 1 && count ($tag_array [1]) == 1) {
2140
 
2141
- if (strpos ($tag_array [0][0], $tag_array [1][0]) !== false) $tag_array = array_slice ($tag_array, 1, count ($tag_array) - 1);
2142
- if (strpos ($tag_array [1][0], $tag_array [0][0]) !== false) $tag_array = array_slice ($tag_array, 1, count ($tag_array) - 1);
 
2143
 
2144
- if (count ($tag_array) >= 2 && count ($tag_array [0]) == 1 && count ($tag_array [1]) == 1) {
2145
- $selected_tag = array ($tag_array [0][0], $tag_array [1][0]);
 
 
 
 
 
 
2146
  }
2147
  }
2148
 
1954
  }
1955
 
1956
  function check_filter ($counter_for_filter) {
1957
+ global $ai_last_check, $ad_interter_globals, $page;
1958
 
1959
  $ai_last_check = AI_CHECK_FILTER;
1960
  $filter_settings = trim ($this->get_call_filter());
1985
  if (isset ($ad_interter_globals [AI_WIDGET_COUNTER_NAME . $this->number]))
1986
  $counter_for_filter = $ad_interter_globals [AI_WIDGET_COUNTER_NAME . $this->number]; else return false;
1987
  break;
1988
+ case AI_OPTION_FILTER_SUBPAGES:
1989
+ if (isset ($page))
1990
+ $counter_for_filter = $page; else return false;
1991
+ break;
1992
  }
1993
 
1994
  $filter_values = array ();
2142
 
2143
  if ($selected_tag == '' && count ($tag_array) >= 2 && count ($tag_array [0]) == 1 && count ($tag_array [1]) == 1) {
2144
 
2145
+ if (isset ($tag_array [0][0]) && isset ($tag_array [1][0])) {
2146
+ if (strpos ($tag_array [0][0], $tag_array [1][0]) !== false) $tag_array = array_slice ($tag_array, 1, count ($tag_array) - 1);
2147
+ }
2148
 
2149
+ if (isset ($tag_array [0][0]) && isset ($tag_array [1][0])) {
2150
+ if (strpos ($tag_array [1][0], $tag_array [0][0]) !== false) $tag_array = array_slice ($tag_array, 1, count ($tag_array) - 1);
2151
+ }
2152
+
2153
+ if (isset ($tag_array [0][0]) && isset ($tag_array [1][0])) {
2154
+ if (count ($tag_array) >= 2 && count ($tag_array [0]) == 1 && count ($tag_array [1]) == 1) {
2155
+ $selected_tag = array ($tag_array [0][0], $tag_array [1][0]);
2156
+ }
2157
  }
2158
  }
2159
 
constants.php CHANGED
@@ -11,7 +11,7 @@ if (!defined( 'AD_INSERTER_NAME'))
11
  define ('AD_INSERTER_NAME', 'Ad Inserter');
12
 
13
  if (!defined( 'AD_INSERTER_VERSION'))
14
- define ('AD_INSERTER_VERSION', '2.0.5');
15
 
16
  if (!defined ('AD_INSERTER_BLOCKS'))
17
  define ('AD_INSERTER_BLOCKS', 16);
@@ -31,20 +31,20 @@ if (!defined ('AD_INSERTER_PLUGIN_URL'))
31
  if (!defined ('AD_INSERTER_PLUGIN_IMAGES_URL'))
32
  define ('AD_INSERTER_PLUGIN_IMAGES_URL', AD_INSERTER_PLUGIN_URL. 'images/');
33
 
34
- if (!defined( 'WP_CONTENT_URL'))
35
- define ('WP_CONTENT_URL', get_option ('siteurl') . '/wp-content');
36
 
37
- if (!defined ('WP_ADMIN_URL'))
38
- define ('WP_ADMIN_URL', get_option ('siteurl') . '/wp-admin');
39
 
40
- if (!defined ('WP_CONTENT_DIR'))
41
- define ('WP_CONTENT_DIR', ABSPATH . 'wp-content');
42
 
43
- if (!defined ('WP_PLUGIN_URL'))
44
- define ('WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins');
45
 
46
- if (!defined ('WP_PLUGIN_DIR'))
47
- define ('WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins');
48
 
49
  define ('AD_EMPTY_DATA', '');
50
  define ('AD_ZERO', '0');
@@ -127,6 +127,7 @@ define ('AI_OPTION_DETECT_VIEWPORT', 'detect_viewport');
127
  define ('AI_OPTION_DISABLED', 'disabled');
128
 
129
  define ('AI_OPTION_IMPORT', 'import');
 
130
 
131
 
132
  //misc
@@ -202,6 +203,7 @@ define ('AI_OPTION_FILTER_EXCERPT_PROCESSING', 'Excerpt processing');
202
  define ('AI_OPTION_FILTER_BEFORE_POST_PROCESSING', 'Before post processing');
203
  define ('AI_OPTION_FILTER_AFTER_POST_PROCESSING', 'After post processing');
204
  define ('AI_OPTION_FILTER_WIDGET_DRAWING', 'Widget drawing');
 
205
 
206
  //Counter names
207
  define ('AI_BLOCK_COUNTER_NAME', 'AI_BLOCK_COUNTER_');
11
  define ('AD_INSERTER_NAME', 'Ad Inserter');
12
 
13
  if (!defined( 'AD_INSERTER_VERSION'))
14
+ define ('AD_INSERTER_VERSION', '2.0.6');
15
 
16
  if (!defined ('AD_INSERTER_BLOCKS'))
17
  define ('AD_INSERTER_BLOCKS', 16);
31
  if (!defined ('AD_INSERTER_PLUGIN_IMAGES_URL'))
32
  define ('AD_INSERTER_PLUGIN_IMAGES_URL', AD_INSERTER_PLUGIN_URL. 'images/');
33
 
34
+ //if (!defined( 'WP_CONTENT_URL'))
35
+ // define ('WP_CONTENT_URL', get_option ('siteurl') . '/wp-content');
36
 
37
+ //if (!defined ('WP_ADMIN_URL'))
38
+ // define ('WP_ADMIN_URL', get_option ('siteurl') . '/wp-admin');
39
 
40
+ //if (!defined ('WP_CONTENT_DIR'))
41
+ // define ('WP_CONTENT_DIR', ABSPATH . 'wp-content');
42
 
43
+ //if (!defined ('WP_PLUGIN_URL'))
44
+ // define ('WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins');
45
 
46
+ //if (!defined ('WP_PLUGIN_DIR'))
47
+ // define ('WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins');
48
 
49
  define ('AD_EMPTY_DATA', '');
50
  define ('AD_ZERO', '0');
127
  define ('AI_OPTION_DISABLED', 'disabled');
128
 
129
  define ('AI_OPTION_IMPORT', 'import');
130
+ define ('AI_OPTION_IMPORT_NAME', 'import_name');
131
 
132
 
133
  //misc
203
  define ('AI_OPTION_FILTER_BEFORE_POST_PROCESSING', 'Before post processing');
204
  define ('AI_OPTION_FILTER_AFTER_POST_PROCESSING', 'After post processing');
205
  define ('AI_OPTION_FILTER_WIDGET_DRAWING', 'Widget drawing');
206
+ define ('AI_OPTION_FILTER_SUBPAGES', 'Subpages');
207
 
208
  //Counter names
209
  define ('AI_BLOCK_COUNTER_NAME', 'AI_BLOCK_COUNTER_');
css/ad-inserter.css CHANGED
@@ -1,5 +1,5 @@
1
  #data {
2
- font-family: "2.0.5"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
1
  #data {
2
+ font-family: "2.0.6"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
js/ad-inserter.js CHANGED
@@ -1,4 +1,4 @@
1
- var javascript_version = "2.0.5";
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
1
+ var javascript_version = "2.0.6";
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: spacetime
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4
4
  Tags: adsense, amazon, clickbank, advertising, cj, ad, ads, html, javascript, php, code, widget, sidebar, responsive, viewport, rotating, banner, rotation, multisite, contextual, shortcodes, widgets, header, footer, users, logged in, not logged in, mobile, desktop, phone, tablet, custom css, category, tag, filter, url, skip
5
  Requires at least: 4.0
6
- Tested up to: 4.6.1
7
- Stable tag: 2.0.5
8
  License: GPLv3
9
 
10
  Insert any ad or HTML/Javascript/PHP code into Wordpress. Perfect for all kinds of ads. 16 code blocks, many display options and features.
@@ -13,26 +13,34 @@ Insert any ad or HTML/Javascript/PHP code into Wordpress. Perfect for all kinds
13
 
14
  A simple yet powerful plugin to 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.
15
 
16
- Ad Inserter supports up to 16 code blocks. Code block is any code (for example AdSense ad) that has to be inserted (displayed) at some position.
17
- Each code block can be configured to insert code at almost any position supported by Wordpress.
18
-
19
- **Features**
20
-
21
- * 16 code blocks
22
- * Syntax highlighting editor
23
- * Code preview with visual CSS editor
24
- * Automatic positions: before/after post, content, paragraph or excerpt
25
- * Manual positions: widgets, shortcodes, PHP function call
26
- * Block alignment and style: left, center, right, float left, float right, custom CSS, no wrapping (leaves ad code as it is, otherwise it is wrapped by a div)
27
- * Clearance options to avoid insertion near images or headers
28
- * PHP code processing
29
- * Server-side and client-side device detection (3 custom viewports)
30
- * Black/White-list categories, tags, post IDs, urls, url parameters, referers
31
- * Simple troubleshooting with many debugging functions to visualize inserted code blocks, available insertion positions, HTML tags, etc.
32
-
33
- Check <a href="http://tinymonitor.com/ad-inserter" target="_blank">Ad Inserter page</a> for detailed description of all the features.
34
-
35
- And there is also <a href="http://tinymonitor.com/ad-inserter-pro" target="_blank">Ad Inserter Pro</a> if you need more than 16 code blocks, more than 3 viewports, export/import settings or additional multisite options.
 
 
 
 
 
 
 
 
36
 
37
  **Quick Start**
38
 
@@ -211,6 +219,7 @@ For each code block you can also limit how many times on the page the code (or a
211
  This is **useful in many cases where you can't remove unwanted insertions** of the code with other settings:
212
 
213
  * If you need to insert ad before the first, third and fith excerpt on the homepage you simply specify `1, 3, 5` for the filter.
 
214
  * In some WP themes hooks (that call Ad Inserter insertion functions) are called more than once. In such case you might get unwanted insertions. Simply set the filter to the number of the wanted call(s). Use debugging function **Show positions** on every post/page to show available positions for automatic insertion with counters.
215
  * If you use adinserter PHP function and you don't want that for each time the functon is called on the page the code is inserted, you can simply filter calls.
216
  * If you oly need the first N calls (insertions) then leave filter to 0 and use Max N insertions instead.
@@ -807,6 +816,12 @@ AD CODE RIGHT
807
  == Changelog ==
808
 
809
 
 
 
 
 
 
 
810
  = 2.0.5 =
811
  - Cookie created only when debugging is enabled
812
  - Few minor bug fixes
@@ -1065,6 +1080,12 @@ AD CODE RIGHT
1065
 
1066
  == Upgrade Notice ==
1067
 
 
 
 
 
 
 
1068
  = 2.0.5 =
1069
  Cookie created only when debugging is enabled;
1070
  Few minor bug fixes
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4
4
  Tags: adsense, amazon, clickbank, advertising, cj, ad, ads, html, javascript, php, code, widget, sidebar, responsive, viewport, rotating, banner, rotation, multisite, contextual, shortcodes, widgets, header, footer, users, logged in, not logged in, mobile, desktop, phone, tablet, custom css, category, tag, filter, url, skip
5
  Requires at least: 4.0
6
+ Tested up to: 4.7
7
+ Stable tag: 2.0.6
8
  License: GPLv3
9
 
10
  Insert any ad or HTML/Javascript/PHP code into Wordpress. Perfect for all kinds of ads. 16 code blocks, many display options and features.
13
 
14
  A simple yet powerful plugin to 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.
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
22
+ > * Manual insertion: widgets, shortcodes, PHP function call
23
+ > * Block alignment and style: left, center, right, float left, float right, custom CSS, no wrapping (leaves ad code as it is, otherwise it is wrapped by a div)
24
+ > * Clearance options to avoid insertion near images or headers
25
+ > * PHP code processing
26
+ > * Server-side and client-side device detection (3 custom viewports)
27
+ > * Black/White-list categories, tags, post IDs, urls, url parameters, referers
28
+ > * Simple troubleshooting with many debugging functions to visualize inserted code blocks, available insertion positions, HTML tags, etc.
29
+ >
30
+ > Check <a href="http://adinserter.pro/documentation" target="_blank">Ad Inserter documentation page</a> for detailed description of all the features.
31
+
32
+ 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.
33
+
34
+ > **Endorsed by Amazon**
35
+ >
36
+ > 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.
37
+ >
38
+ > * Check <a href="https://affiliate-program.amazon.com/help/topic/t405" target="_blank">Wordpress Integration Guide for Native Shopping Ads</a>
39
+ > * 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)
40
+
41
+ **Go Pro** to get premium features
42
+
43
+ There is also <a href="http://adinserter.pro/" target="_blank">Ad Inserter Pro</a> if you need more than 16 code blocks, more than 3 viewports, GEO targeting, scheduling, export/import settings or additional multisite options.
44
 
45
  **Quick Start**
46
 
219
  This is **useful in many cases where you can't remove unwanted insertions** of the code with other settings:
220
 
221
  * If you need to insert ad before the first, third and fith excerpt on the homepage you simply specify `1, 3, 5` for the filter.
222
+ * If your posts are divided into subpages using the `<!--nextpage-->` tag - specify Subpages as filter source and list subpage numbers, for example `2,3,4,5,6,7,8,9,10,11` for display on all subpages except the first one.
223
  * In some WP themes hooks (that call Ad Inserter insertion functions) are called more than once. In such case you might get unwanted insertions. Simply set the filter to the number of the wanted call(s). Use debugging function **Show positions** on every post/page to show available positions for automatic insertion with counters.
224
  * If you use adinserter PHP function and you don't want that for each time the functon is called on the page the code is inserted, you can simply filter calls.
225
  * If you oly need the first N calls (insertions) then leave filter to 0 and use Max N insertions instead.
816
  == Changelog ==
817
 
818
 
819
+ = 2.0.6 =
820
+ - Added support to filter subpages created by the `<!--nextpage-->` tag
821
+ - Added option to import block name (Pro only)
822
+ - Cookie deleted only when it exists and debugging is disabled
823
+ - Few minor bug fixes
824
+
825
  = 2.0.5 =
826
  - Cookie created only when debugging is enabled
827
  - Few minor bug fixes
1080
 
1081
  == Upgrade Notice ==
1082
 
1083
+ = 2.0.6 =
1084
+ Added support to filter subpages created by the `<!--nextpage-->` tag;
1085
+ Added option to import block name (Pro only);
1086
+ Cookie deleted only when it exists and debugging is disabled;
1087
+ Few minor bug fixes
1088
+
1089
  = 2.0.5 =
1090
  Cookie created only when debugging is enabled;
1091
  Few minor bug fixes
settings.php CHANGED
@@ -852,6 +852,7 @@ function generate_settings_form (){
852
  <option value="<?php echo AI_OPTION_FILTER_BEFORE_POST_PROCESSING; ?>" <?php echo ($obj->get_filter_type()==AI_OPTION_FILTER_BEFORE_POST_PROCESSING) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_OPTION_FILTER_BEFORE_POST_PROCESSING; ?></option>
853
  <option value="<?php echo AI_OPTION_FILTER_AFTER_POST_PROCESSING; ?>" <?php echo ($obj->get_filter_type()==AI_OPTION_FILTER_AFTER_POST_PROCESSING) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_OPTION_FILTER_AFTER_POST_PROCESSING; ?></option>
854
  <option value="<?php echo AI_OPTION_FILTER_WIDGET_DRAWING; ?>" <?php echo ($obj->get_filter_type()==AI_OPTION_FILTER_WIDGET_DRAWING) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_OPTION_FILTER_WIDGET_DRAWING; ?></option>
 
855
  </select>
856
  </span>
857
  <span style="display: table-cell;">
852
  <option value="<?php echo AI_OPTION_FILTER_BEFORE_POST_PROCESSING; ?>" <?php echo ($obj->get_filter_type()==AI_OPTION_FILTER_BEFORE_POST_PROCESSING) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_OPTION_FILTER_BEFORE_POST_PROCESSING; ?></option>
853
  <option value="<?php echo AI_OPTION_FILTER_AFTER_POST_PROCESSING; ?>" <?php echo ($obj->get_filter_type()==AI_OPTION_FILTER_AFTER_POST_PROCESSING) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_OPTION_FILTER_AFTER_POST_PROCESSING; ?></option>
854
  <option value="<?php echo AI_OPTION_FILTER_WIDGET_DRAWING; ?>" <?php echo ($obj->get_filter_type()==AI_OPTION_FILTER_WIDGET_DRAWING) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_OPTION_FILTER_WIDGET_DRAWING; ?></option>
855
+ <option value="<?php echo AI_OPTION_FILTER_SUBPAGES; ?>" <?php echo ($obj->get_filter_type()==AI_OPTION_FILTER_SUBPAGES) ? AD_SELECT_SELECTED : AD_EMPTY_VALUE; ?>><?php echo AI_OPTION_FILTER_SUBPAGES; ?></option>
856
  </select>
857
  </span>
858
  <span style="display: table-cell;">