Ad Injection - Version 1.2.0.15

Version Description

  • New options to exclude ads from div, form, ol and ul tags.
  • Fix relating to post length restrictions.
Download this release

Release Info

Developer reviewmylife
Plugin Icon wp plugin Ad Injection
Version 1.2.0.15
Comparing to
See all releases

Code changes from version 1.2.0.14 to 1.2.0.15

Files changed (4) hide show
  1. ad-injection-admin.php +32 -13
  2. ad-injection.php +47 -10
  3. readme.txt +17 -1
  4. ui-tab-main.php +24 -4
ad-injection-admin.php CHANGED
@@ -343,7 +343,7 @@ function adinj_top_message_box(){
343
 
344
  } else if (!isset($_GET['tab'])){
345
  echo '<div id="message" class="updated below-h2"><p style="line-height:140%"><strong>';
346
- echo "17th May 2012: New numeric values in some of the pull down boxes for post length and ad start/end positions. Please contact me ASAP if you spot any bugs, or odd behaviour via the <a href='http://wordpress.org/tags/ad-injection?forum_id=10'target='_new'>Ad Injection WordPress forum</a> or my ".'<a href="'.adinj_feedback_url().'" target="_new">quick feedback form</a>. If you like the plugin please consider making a donation using the PayPal box below :)'."<br/>And finally I've just released my first iPhone game called <a href='http://itunes.apple.com/us/app/solar-balls/id521551813?ls=1&mt=8' target='_new'>Solar Balls</a> - please have a look and consider playing it :)";
347
  echo '</strong></p></div>';
348
  }
349
  }
@@ -1046,32 +1046,48 @@ function is_supported_caching_plugin_active(){
1046
 
1047
  //////////////////////////////////////////////////////////////////////////////
1048
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1049
  function adinj_testads(){
1050
  adinj_postbox_start(__("Test Adverts and template ad examples", 'adinj'), "testads", '95%');
 
1051
  ?>
1052
  <p>You can copy and paste these adverts into the boxes above to test your ad setup before switching to your real ads.</p>
1053
 
1054
  <h4><a name="468x60"></a>468x60 banner</h4>
1055
 
1056
  <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4">&lt;div style=&quot;background-color:#ff9999; width:468px; height:60px;&quot;&gt;
1057
- &lt;h5&gt;TEST ADVERT 468x60 - &lt;a href=&quot;http://www.reviewmylife.co.uk/&quot;&gt;www.reviewmylife.co.uk&lt;/a&gt;&lt;/h5&gt;
1058
  &lt;/div&gt;</textarea></p>
1059
 
1060
  <div style="background-color:#99ffff; width:468px; height:60px;">
1061
- <h5>TEST ADVERT 468x60 - <a href="http://www.reviewmylife.co.uk/">www.reviewmylife.co.uk</a></h5>
1062
  </div><p></p>
1063
 
1064
  <h4><a name="728x90"></a>728x90 banner</h4>
1065
 
1066
  <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4">&lt;div style=&quot;background-color:#ff9999; width:728px; height:90px;&quot;&gt;
1067
- &lt;h5&gt;TEST ADVERT 728x90&lt;/h5&gt;
1068
- &lt;a href=&quot;http://www.reviewmylife.co.uk/&quot;&gt;www.reviewmylife.co.uk&lt;/a&gt;&lt;br /&gt;
1069
  &lt;a href=&quot;http://www.advancedhtml.co.uk/&quot;&gt;www.advancedhtml.co.uk&lt;/a&gt;
1070
  &lt;/div&gt;</textarea></p>
1071
 
1072
  <div style="background-color:#ff9999; width:728px; height:90px;">
1073
- <h5>TEST ADVERT 728x90</h5>
1074
- <a href="http://www.reviewmylife.co.uk/">www.reviewmylife.co.uk</a><br />
1075
  <a href="http://www.advancedhtml.co.uk/">www.advancedhtml.co.uk</a>
1076
  </div><p></p>
1077
 
@@ -1079,34 +1095,34 @@ function adinj_testads(){
1079
 
1080
  <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4">&lt;div style=&quot;background-color:#ccff99; width:160px; height:90px;&quot;&gt;
1081
  &lt;h5&gt;TEST ADVERT 160x90&lt;/h5&gt;
1082
- &lt;a href=&quot;http://www.reviewmylife.co.uk/&quot;&gt;reviewmylife.co.uk&lt;/a&gt;&lt;br /&gt;
1083
  &lt;a href=&quot;http://www.advancedhtml.co.uk/&quot;&gt;advancedhtml.co.uk&lt;/a&gt;
1084
  &lt;/div&gt;</textarea></p>
1085
 
1086
  <div style="background-color:#ccff99; width:160px; height:90px;">
1087
  <h5>TEST ADVERT 160x90</h5>
1088
- <a href="http://www.reviewmylife.co.uk/">reviewmylife.co.uk</a>
1089
  <a href="http://www.advancedhtml.co.uk/">advancedhtml.co.uk</a><br />
1090
  </div><p></p>
1091
 
1092
  <h4><a name="468x15"></a>468x15 link unit</h4>
1093
 
1094
  <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4">&lt;div style=&quot;background-color:#cccc99; width:468px; height:15px;&quot;&gt;
1095
- &lt;font size=&quot;-2&quot;&gt;&lt;b&gt;TEST ADVERT 160x90&lt;/b&gt; &lt;a href=&quot;http://www.reviewmylife.co.uk/&quot;&gt;reviewmylife.co.uk&lt;/a&gt;&lt;/font&gt;
1096
  &lt;/div&gt;</textarea></p>
1097
 
1098
  <div style="background-color:#cccc99; width:468px; height:15px;">
1099
- <font size="-2"><b>TEST ADVERT 468x15</b> <a href="http://www.reviewmylife.co.uk/">reviewmylife.co.uk</a></font>
1100
  </div><p></p>
1101
 
1102
  <h4><a name="336x280"></a>336x280 large rectangle</h4>
1103
 
1104
  <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4">&lt;div style=&quot;background-color:#ccccff; width:336px; height:280px;&quot;&gt;
1105
- &lt;h5&gt;TEST ADVERT 336x280 - &lt;a href=&quot;http://www.reviewmylife.co.uk/&quot;&gt;www.reviewmylife.co.uk&lt;/a&gt;&lt;/h5&gt;
1106
  &lt;/div&gt;</textarea></p>
1107
 
1108
  <div style="background-color:#ccccff; width:336px; height:280px;">
1109
- <h5>TEST ADVERT 336x280 - <a href="http://www.reviewmylife.co.uk/">www.reviewmylife.co.uk</a></h5>
1110
  </div><p></p>
1111
 
1112
  <h4>468x60 banner with dynamic PHP</h4>
@@ -1401,6 +1417,9 @@ function adinj_default_options(){
1401
  'widgets_on_page_older_than' => '0',
1402
  'content_length_unit' => 'words',
1403
  'exclude_ads_from_block_tags' => 'off',
 
 
 
1404
  // random ad start/end position
1405
  'random_ads_start_mode' => 'anywhere',
1406
  'random_ads_start_unit' => 'paragraph',
343
 
344
  } else if (!isset($_GET['tab'])){
345
  echo '<div id="message" class="updated below-h2"><p style="line-height:140%"><strong>';
346
+ echo "25th June 2012: New options to exclude ads from div, form, ol and ul tags. Fix relating to post length restrictions. Please contact me ASAP if you spot any bugs, or odd behaviour via the <a href='http://wordpress.org/tags/ad-injection?forum_id=10'target='_new'>Ad Injection WordPress forum</a> or my ".'<a href="'.adinj_feedback_url().'" target="_new">quick feedback form</a>. If you like the plugin please consider making a donation using the PayPal box below :)'."<br/>And finally I've just released my first iPhone game called <a href='http://itunes.apple.com/us/app/solar-balls/id521551813?ls=1&mt=8' target='_new'>Solar Balls</a> - please have a go if you have time :)";
347
  echo '</strong></p></div>';
348
  }
349
  }
1046
 
1047
  //////////////////////////////////////////////////////////////////////////////
1048
 
1049
+ function adinj_get_test_ad_link_escaped($rnd){
1050
+ echo htmlspecialchars(adinj_get_test_ad_link($rnd));
1051
+ }
1052
+ //? >&lt;a href=&quot;http://www.reviewmylife.co.uk/&quot;&gt;www.reviewmylife.co.uk&lt;/a&gt;< ?php
1053
+
1054
+ function adinj_get_test_ad_link($rnd){
1055
+ if ($rnd == 0){
1056
+ ?><a href="http://www.reviewmylife.co.uk/">www.reviewmylife.co.uk</a><?php
1057
+ } else if ($rnd == 1) {
1058
+ ?><a href="http://www.reviewmylife.co.uk/">reviewmylife</a><?php
1059
+ } else {
1060
+ ?><a href="http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/">Ad Injection</a><?php
1061
+ }
1062
+ }
1063
+
1064
  function adinj_testads(){
1065
  adinj_postbox_start(__("Test Adverts and template ad examples", 'adinj'), "testads", '95%');
1066
+ $rnd = rand(0, 2);
1067
  ?>
1068
  <p>You can copy and paste these adverts into the boxes above to test your ad setup before switching to your real ads.</p>
1069
 
1070
  <h4><a name="468x60"></a>468x60 banner</h4>
1071
 
1072
  <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4">&lt;div style=&quot;background-color:#ff9999; width:468px; height:60px;&quot;&gt;
1073
+ &lt;h5&gt;AD INJECTION TEST ADVERT 468x60 - <?php adinj_get_test_ad_link_escaped($rnd); ?>&lt;/h5&gt;
1074
  &lt;/div&gt;</textarea></p>
1075
 
1076
  <div style="background-color:#99ffff; width:468px; height:60px;">
1077
+ <h5>AD INJECTION TEST ADVERT 468x60 - <?php adinj_get_test_ad_link($rnd); ?></h5>
1078
  </div><p></p>
1079
 
1080
  <h4><a name="728x90"></a>728x90 banner</h4>
1081
 
1082
  <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4">&lt;div style=&quot;background-color:#ff9999; width:728px; height:90px;&quot;&gt;
1083
+ &lt;h5&gt;AD INJECTION TEST ADVERT 728x90&lt;/h5&gt;
1084
+ <?php adinj_get_test_ad_link_escaped($rnd); ?>&lt;br /&gt;
1085
  &lt;a href=&quot;http://www.advancedhtml.co.uk/&quot;&gt;www.advancedhtml.co.uk&lt;/a&gt;
1086
  &lt;/div&gt;</textarea></p>
1087
 
1088
  <div style="background-color:#ff9999; width:728px; height:90px;">
1089
+ <h5>AD INJECTION TEST ADVERT 728x90</h5>
1090
+ <?php adinj_get_test_ad_link($rnd); ?><br />
1091
  <a href="http://www.advancedhtml.co.uk/">www.advancedhtml.co.uk</a>
1092
  </div><p></p>
1093
 
1095
 
1096
  <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4">&lt;div style=&quot;background-color:#ccff99; width:160px; height:90px;&quot;&gt;
1097
  &lt;h5&gt;TEST ADVERT 160x90&lt;/h5&gt;
1098
+ <?php adinj_get_test_ad_link_escaped($rnd); ?>&lt;br /&gt;
1099
  &lt;a href=&quot;http://www.advancedhtml.co.uk/&quot;&gt;advancedhtml.co.uk&lt;/a&gt;
1100
  &lt;/div&gt;</textarea></p>
1101
 
1102
  <div style="background-color:#ccff99; width:160px; height:90px;">
1103
  <h5>TEST ADVERT 160x90</h5>
1104
+ <?php adinj_get_test_ad_link($rnd); ?><br />
1105
  <a href="http://www.advancedhtml.co.uk/">advancedhtml.co.uk</a><br />
1106
  </div><p></p>
1107
 
1108
  <h4><a name="468x15"></a>468x15 link unit</h4>
1109
 
1110
  <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4">&lt;div style=&quot;background-color:#cccc99; width:468px; height:15px;&quot;&gt;
1111
+ &lt;font size=&quot;-2&quot;&gt;&lt;b&gt;TEST ADVERT 160x90&lt;/b&gt; <?php adinj_get_test_ad_link_escaped($rnd); ?>&lt;/font&gt;
1112
  &lt;/div&gt;</textarea></p>
1113
 
1114
  <div style="background-color:#cccc99; width:468px; height:15px;">
1115
+ <font size="-2"><b>TEST ADVERT 468x15</b> <?php adinj_get_test_ad_link($rnd); ?></font>
1116
  </div><p></p>
1117
 
1118
  <h4><a name="336x280"></a>336x280 large rectangle</h4>
1119
 
1120
  <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4">&lt;div style=&quot;background-color:#ccccff; width:336px; height:280px;&quot;&gt;
1121
+ &lt;h5&gt;TEST ADVERT 336x280 - <?php adinj_get_test_ad_link_escaped($rnd); ?>&lt;/h5&gt;
1122
  &lt;/div&gt;</textarea></p>
1123
 
1124
  <div style="background-color:#ccccff; width:336px; height:280px;">
1125
+ <h5>TEST ADVERT 336x280 - <?php adinj_get_test_ad_link($rnd); ?></h5>
1126
  </div><p></p>
1127
 
1128
  <h4>468x60 banner with dynamic PHP</h4>
1417
  'widgets_on_page_older_than' => '0',
1418
  'content_length_unit' => 'words',
1419
  'exclude_ads_from_block_tags' => 'off',
1420
+ 'exclude_ads_from_div_tags' => 'off',
1421
+ 'exclude_ads_from_list_tags' => 'off',
1422
+ 'exclude_ads_from_form_tags' => 'off',
1423
  // random ad start/end position
1424
  'random_ads_start_mode' => 'anywhere',
1425
  'random_ads_start_unit' => 'paragraph',
ad-injection.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ad Injection
4
  Plugin URI: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/
5
  Description: Injects any advert (e.g. AdSense) into your WordPress posts or widget area. Restrict who sees the ads by post length, age, referrer or IP. Cache compatible.
6
- Version: 1.2.0.14
7
  Author: reviewmylife
8
  Author URI: http://www.reviewmylife.co.uk/
9
  License: GPLv2
@@ -37,7 +37,8 @@ define('ADINJ_NO_CONFIG_FILE', 1);
37
  // 20 = 1.2.0.3 the_content_filter_priority setting
38
  // 21 = 1.2.0.8 Template conditions
39
  // 22 = 1.2.0.13 exclude_ads_from_block_tags option
40
- define('ADINJ_DB_VERSION', 22);
 
41
 
42
  // Files
43
  // TODO will these paths work on windows?
@@ -705,17 +706,53 @@ function adinj_content_hook($content){
705
  $original_paragraph_positions = array();
706
  $prevpos = -1;
707
  while(($prevpos = stripos($content, ADINJ_PARA, $prevpos+1)) !== false){
708
- $next_blockquote_open = adinj_stripos($content, '<blockquote>', $prevpos);
709
- $next_blockquote_close = adinj_stripos($content, '</blockquote>', $prevpos);
710
- $next_pre_open = adinj_stripos($content, '<pre>', $prevpos);
711
- $next_pre_close = adinj_stripos($content, '</pre>', $prevpos);
712
  $valid = true;
713
  if (adinj_ticked('exclude_ads_from_block_tags')){
 
 
 
 
714
  $valid = (($next_blockquote_open == $next_blockquote_close) ||
715
  ($next_blockquote_open > $prevpos && $next_blockquote_open <= $next_blockquote_close)) &&
716
  (($next_pre_open == $next_pre_close) ||
717
  ($next_pre_open > $prevpos && $next_pre_open <= $next_pre_close));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
718
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
719
  if($valid){
720
  $next_exclude_open = adinj_stripos($content, '<!--adinj_exclude_start-->', $prevpos);
721
  $next_exclude_close = adinj_stripos($content, '<!--adinj_exclude_end-->', $prevpos);
@@ -1174,22 +1211,22 @@ function adinj_num_rand_ads_to_insert($content_length, &$debug){
1174
 
1175
  $length = $content_length;
1176
  $conditionlength = $ops[$prefix.'no_random_ads_if_shorter_than'];
1177
- if (adinj_true_if($length, '<', $conditionlength)){
1178
  $debug .= "\nNo random ads because post length < $conditionlength";
1179
  return 0;
1180
  }
1181
  $conditionlength = $ops[$prefix.'one_ad_if_shorter_than'];
1182
- if (adinj_true_if($length, '<', $conditionlength)){
1183
  $debug .= "\nOnly 1 random ad because post length < $conditionlength";
1184
  return 1;
1185
  }
1186
  $conditionlength = $ops[$prefix.'two_ads_if_shorter_than'];
1187
- if (adinj_true_if($length, '<', $conditionlength)){
1188
  $debug .= "\nLimit on random ads because post length < $conditionlength";
1189
  return min(2, $max_num_rand_ads_to_insert);
1190
  }
1191
  $conditionlength = $ops[$prefix.'three_ads_if_shorter_than'];
1192
- if (adinj_true_if($length, '<', $conditionlength)){
1193
  $debug .= "\nLimit on random ads because post length < $conditionlength";
1194
  return min(3, $max_num_rand_ads_to_insert);
1195
  }
3
  Plugin Name: Ad Injection
4
  Plugin URI: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/
5
  Description: Injects any advert (e.g. AdSense) into your WordPress posts or widget area. Restrict who sees the ads by post length, age, referrer or IP. Cache compatible.
6
+ Version: 1.2.0.15
7
  Author: reviewmylife
8
  Author URI: http://www.reviewmylife.co.uk/
9
  License: GPLv2
37
  // 20 = 1.2.0.3 the_content_filter_priority setting
38
  // 21 = 1.2.0.8 Template conditions
39
  // 22 = 1.2.0.13 exclude_ads_from_block_tags option
40
+ // 23 = 1.2.0.15 exclude_ads_from_[div/list/form]_tags option
41
+ define('ADINJ_DB_VERSION', 23);
42
 
43
  // Files
44
  // TODO will these paths work on windows?
706
  $original_paragraph_positions = array();
707
  $prevpos = -1;
708
  while(($prevpos = stripos($content, ADINJ_PARA, $prevpos+1)) !== false){
709
+
 
 
 
710
  $valid = true;
711
  if (adinj_ticked('exclude_ads_from_block_tags')){
712
+ $next_blockquote_open = adinj_stripos($content, '<blockquote', $prevpos);
713
+ $next_blockquote_close = adinj_stripos($content, '</blockquote>', $prevpos);
714
+ $next_pre_open = adinj_stripos($content, '<pre', $prevpos);
715
+ $next_pre_close = adinj_stripos($content, '</pre>', $prevpos);
716
  $valid = (($next_blockquote_open == $next_blockquote_close) ||
717
  ($next_blockquote_open > $prevpos && $next_blockquote_open <= $next_blockquote_close)) &&
718
  (($next_pre_open == $next_pre_close) ||
719
  ($next_pre_open > $prevpos && $next_pre_open <= $next_pre_close));
720
+ if (!$valid) continue;
721
+ }
722
+
723
+ if (adinj_ticked('exclude_ads_from_div_tags')){
724
+ $next_open = adinj_stripos($content, '<div', $prevpos);
725
+ $next_close = adinj_stripos($content, '</div>', $prevpos);
726
+ $valid = (($next_open == $next_close) ||
727
+ ($next_open > $prevpos && $next_open <= $next_close));
728
+ if (!$valid) continue;
729
+ }
730
+
731
+
732
+ if (adinj_ticked('exclude_ads_from_list_tags')){
733
+ $next_open = adinj_stripos($content, '<ol', $prevpos);
734
+ $next_close = adinj_stripos($content, '</ol>', $prevpos);
735
+ $valid = (($next_open == $next_close) ||
736
+ ($next_open > $prevpos && $next_open <= $next_close));
737
+ if (!$valid) continue;
738
  }
739
+
740
+ if (adinj_ticked('exclude_ads_from_list_tags')){
741
+ $next_open = adinj_stripos($content, '<ul', $prevpos);
742
+ $next_close = adinj_stripos($content, '</ul>', $prevpos);
743
+ $valid = (($next_open == $next_close) ||
744
+ ($next_open > $prevpos && $next_open <= $next_close));
745
+ if (!$valid) continue;
746
+ }
747
+
748
+ if (adinj_ticked('exclude_ads_from_form_tags')){
749
+ $next_open = adinj_stripos($content, '<form', $prevpos);
750
+ $next_close = adinj_stripos($content, '</form>', $prevpos);
751
+ $valid = (($next_open == $next_close) ||
752
+ ($next_open > $prevpos && $next_open <= $next_close));
753
+ if (!$valid) continue;
754
+ }
755
+
756
  if($valid){
757
  $next_exclude_open = adinj_stripos($content, '<!--adinj_exclude_start-->', $prevpos);
758
  $next_exclude_close = adinj_stripos($content, '<!--adinj_exclude_end-->', $prevpos);
1211
 
1212
  $length = $content_length;
1213
  $conditionlength = $ops[$prefix.'no_random_ads_if_shorter_than'];
1214
+ if (!adinj_rule_disabled($conditionlength) && adinj_true_if($length, '<', $conditionlength)){
1215
  $debug .= "\nNo random ads because post length < $conditionlength";
1216
  return 0;
1217
  }
1218
  $conditionlength = $ops[$prefix.'one_ad_if_shorter_than'];
1219
+ if (!adinj_rule_disabled($conditionlength) && adinj_true_if($length, '<', $conditionlength)){
1220
  $debug .= "\nOnly 1 random ad because post length < $conditionlength";
1221
  return 1;
1222
  }
1223
  $conditionlength = $ops[$prefix.'two_ads_if_shorter_than'];
1224
+ if (!adinj_rule_disabled($conditionlength) && adinj_true_if($length, '<', $conditionlength)){
1225
  $debug .= "\nLimit on random ads because post length < $conditionlength";
1226
  return min(2, $max_num_rand_ads_to_insert);
1227
  }
1228
  $conditionlength = $ops[$prefix.'three_ads_if_shorter_than'];
1229
+ if (!adinj_rule_disabled($conditionlength) && adinj_true_if($length, '<', $conditionlength)){
1230
  $debug .= "\nLimit on random ads because post length < $conditionlength";
1231
  return min(3, $max_num_rand_ads_to_insert);
1232
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-w
4
  Tags: ad injection, adsense, advert injection, advert, ad, injection, advertising, affiliate, inject, injection, insert, widget, widgets, sidebar, monetize, monetise, banner, Amazon, ClickBank, TradeDoubler, Google, adBrite, post, WordPress, automatically, plugin, Adsense Injection, free, blog, ad rotation, A:B testing, split testing, WP Super Cache, W3 Total Cache, WP Cache
5
  Requires at least: 2.8.6
6
  Tested up to: 3.3.2
7
- Stable tag: 1.2.0.14
8
 
9
  Injects any adverts (e.g. AdSense) into the WordPress posts or widget area. Restrict who sees ads by post length/age/referrer or IP. Cache compatible.
10
 
@@ -306,6 +306,14 @@ Check your style sheet to see if either the text or headings have the 'clear' at
306
 
307
  This is because you have inserted adverts that are too wide for your site's layout. The browser can no longer fit all the parts of your layout side-by-side. Try using ads that are less wide.
308
 
 
 
 
 
 
 
 
 
309
  = I have configured four Google AdSense ad units but only three are showing. Why? =
310
 
311
  Google's AdSense TOS only allow allow three ad units, and three link units per page. If you have for example tried to insert four ad units on your page then Google will (probably) disable the forth one automatically. Read Google's AdSense [program policies](https://www.google.com/adsense/support/bin/answer.py?hl=en&answer=48182 "AdSense program policies") for more info.
@@ -616,6 +624,10 @@ If you do get any errors please use the 'Report a bug or give feedback' link on
616
 
617
  == Changelog ==
618
 
 
 
 
 
619
  = 1.2.0.14 =
620
  * Add additional values to numeric pull down boxes. 6000-8000 for paragraph positions. And 7500 for post length boxes.
621
 
@@ -866,6 +878,10 @@ Fix 'Something badly wrong in num_rand_ads_to_insert' message that occurs on pag
866
 
867
  == Upgrade Notice ==
868
 
 
 
 
 
869
  = 1.2.0.14 =
870
  * Add additional values to numeric pull down boxes. 6000-8000 for paragraph positions. And 7500 for post length boxes.
871
 
4
  Tags: ad injection, adsense, advert injection, advert, ad, injection, advertising, affiliate, inject, injection, insert, widget, widgets, sidebar, monetize, monetise, banner, Amazon, ClickBank, TradeDoubler, Google, adBrite, post, WordPress, automatically, plugin, Adsense Injection, free, blog, ad rotation, A:B testing, split testing, WP Super Cache, W3 Total Cache, WP Cache
5
  Requires at least: 2.8.6
6
  Tested up to: 3.3.2
7
+ Stable tag: 1.2.0.15
8
 
9
  Injects any adverts (e.g. AdSense) into the WordPress posts or widget area. Restrict who sees ads by post length/age/referrer or IP. Cache compatible.
10
 
306
 
307
  This is because you have inserted adverts that are too wide for your site's layout. The browser can no longer fit all the parts of your layout side-by-side. Try using ads that are less wide.
308
 
309
+ = How do I add left/right margins to the ads
310
+
311
+ There aren't any options to do this in the UI, but you can just put the layout tags into the ad box around your advert. e.g.
312
+
313
+ `<div style="margin-left:50px;margin-right:50px;">
314
+ Your advert
315
+ </div>`
316
+
317
  = I have configured four Google AdSense ad units but only three are showing. Why? =
318
 
319
  Google's AdSense TOS only allow allow three ad units, and three link units per page. If you have for example tried to insert four ad units on your page then Google will (probably) disable the forth one automatically. Read Google's AdSense [program policies](https://www.google.com/adsense/support/bin/answer.py?hl=en&answer=48182 "AdSense program policies") for more info.
624
 
625
  == Changelog ==
626
 
627
+ = 1.2.0.15 =
628
+ * New options to exclude ads from div, form, ol and ul tags.
629
+ * Fix relating to post length restrictions.
630
+
631
  = 1.2.0.14 =
632
  * Add additional values to numeric pull down boxes. 6000-8000 for paragraph positions. And 7500 for post length boxes.
633
 
878
 
879
  == Upgrade Notice ==
880
 
881
+ = 1.2.0.15 =
882
+ * New options to exclude ads from div, form, ol and ul tags.
883
+ * Fix relating to post length restrictions.
884
+
885
  = 1.2.0.14 =
886
  * Add additional values to numeric pull down boxes. 6000-8000 for paragraph positions. And 7500 for post length boxes.
887
 
ui-tab-main.php CHANGED
@@ -379,14 +379,34 @@ JQUERYOPACITY;
379
  <tr><td colspan="4"><p><span style="font-size:10px;">When defining 'post longer than' / 'post shorter than' conditions; do you want to count viewable characters, all characters (which includes HTML tags), or number of words?<br />This setting does not apply to the settings for positioning the ads near a character position - these use the raw character count.</span></p></td></tr>
380
 
381
  <tr>
382
- <td>Exclude ads from &lt;blockquote&gt;&lt;/blockquote&gt; and &lt;pre&gt;&lt;/pre&gt; blocks:</td>
383
- <td colspan="3">
384
  <?php
385
  adinj_add_checkbox('exclude_ads_from_block_tags');
386
  ?>
387
  </td></tr>
388
- <tr><td colspan="4"><p><span style="font-size:10px;">Exclude ads from &lt;pre&gt;&lt;/pre&gt; and &lt;blockquote&gt;&lt;/blockquote&gt; tag blocks.<br/>
389
- Ad Injection also supports &lt;!--adinj_exclude_start--&gt;&lt;!--adinj_exclude_end--&gt; tags. You don't need to tick the box for these to be enabled.</span></p></td></tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
 
391
  </table>
392
 
379
  <tr><td colspan="4"><p><span style="font-size:10px;">When defining 'post longer than' / 'post shorter than' conditions; do you want to count viewable characters, all characters (which includes HTML tags), or number of words?<br />This setting does not apply to the settings for positioning the ads near a character position - these use the raw character count.</span></p></td></tr>
380
 
381
  <tr>
382
+ <td colspan="2">Exclude ads from &lt;blockquote&gt;&lt;/blockquote&gt; and &lt;pre&gt;&lt;/pre&gt; blocks:</td>
383
+ <td colspan="2">
384
  <?php
385
  adinj_add_checkbox('exclude_ads_from_block_tags');
386
  ?>
387
  </td></tr>
388
+ <tr>
389
+ <td colspan="2">Exclude ads from &lt;div&gt;&lt;/div&gt; blocks:</td>
390
+ <td colspan="2">
391
+ <?php
392
+ adinj_add_checkbox('exclude_ads_from_div_tags');
393
+ ?>
394
+ </td></tr>
395
+ <tr>
396
+ <td colspan="2">Exclude ads from &lt;ul&gt;&lt;/ul&gt; and &lt;ol&gt;&lt;/ol&gt; blocks:</td>
397
+ <td colspan="2">
398
+ <?php
399
+ adinj_add_checkbox('exclude_ads_from_list_tags');
400
+ ?>
401
+ </td></tr>
402
+ <tr>
403
+ <td colspan="2">Exclude ads from &lt;form&gt;&lt;/form&gt; blocks:</td>
404
+ <td colspan="2">
405
+ <?php
406
+ adinj_add_checkbox('exclude_ads_from_form_tags');
407
+ ?>
408
+ </td></tr>
409
+ <tr><td colspan="4"><p><span style="font-size:10px;">Ad Injection also supports &lt;!--adinj_exclude_start--&gt;&lt;!--adinj_exclude_end--&gt; tags. You don't need to tick the box for these to be enabled.</span></p></td></tr>
410
 
411
  </table>
412