Ad Injection - Version 1.2.0.12

Version Description

  • Fix for ads with UTF-8 characters
Download this release

Release Info

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

Code changes from version 1.2.0.11 to 1.2.0.12

ad-injection-admin.php CHANGED
@@ -342,7 +342,7 @@ function adinj_top_message_box(){
342
 
343
  } else if (!isset($_GET['tab'])){
344
  echo '<div id="message" class="updated below-h2"><p style="line-height:140%"><strong>';
345
- echo "7th April 2012: Preserve special HTML character sequences such as &amp;amp; and &amp;para. With support for my new <a href='http://wordpress.org/extend/plugins/ad-logger/' target='_new'>Ad Logger</a> plugin's AdSense click blocking feature. 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 :)';
346
  echo '</strong></p></div>';
347
  }
348
  }
@@ -886,6 +886,10 @@ function adinj_get_authors(){
886
  return $authors;
887
  }
888
 
 
 
 
 
889
  function adinj_table_width($table){
890
  global $wp_db_version;
891
  if ($table == 'ad'){
342
 
343
  } else if (!isset($_GET['tab'])){
344
  echo '<div id="message" class="updated below-h2"><p style="line-height:140%"><strong>';
345
+ echo "14th April 2012: Fix for ads with UTF-8 characters. With support for my new <a href='http://wordpress.org/extend/plugins/ad-logger/' target='_new'>Ad Logger</a> plugin's AdSense click blocking feature. 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 :)';
346
  echo '</strong></p></div>';
347
  }
348
  }
886
  return $authors;
887
  }
888
 
889
+ function adinj_process_text($text){
890
+ return htmlentities($text, ENT_COMPAT | ENT_HTML401, "UTF-8");
891
+ }
892
+
893
  function adinj_table_width($table){
894
  global $wp_db_version;
895
  if ($table == 'ad'){
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.11
7
  Author: reviewmylife
8
  Author URI: http://www.reviewmylife.co.uk/
9
  License: GPLv2
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.12
7
  Author: reviewmylife
8
  Author URI: http://www.reviewmylife.co.uk/
9
  License: GPLv2
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.1
7
- Stable tag: 1.2.0.11
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
 
@@ -607,6 +607,9 @@ If you do get any errors please use the 'Report a bug or give feedback' link on
607
 
608
  == Changelog ==
609
 
 
 
 
610
  = 1.2.0.11 =
611
  * Preserve HTML entities when saving - i.e. preserve special character sequences.
612
  * Add '400' as an option to the numbered drop downs.
@@ -847,6 +850,9 @@ Fix 'Something badly wrong in num_rand_ads_to_insert' message that occurs on pag
847
 
848
  == Upgrade Notice ==
849
 
 
 
 
850
  = 1.2.0.11 =
851
  * Preserve HTML entities when saving - i.e. preserve special character sequences.
852
  * Add '400' as an option to the numbered drop downs.
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.1
7
+ Stable tag: 1.2.0.12
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
 
607
 
608
  == Changelog ==
609
 
610
+ = 1.2.0.12 =
611
+ * Fix for ads with UTF-8 characters
612
+
613
  = 1.2.0.11 =
614
  * Preserve HTML entities when saving - i.e. preserve special character sequences.
615
  * Add '400' as an option to the numbered drop downs.
850
 
851
  == Upgrade Notice ==
852
 
853
+ = 1.2.0.12 =
854
+ * Fix for ads with UTF-8 characters
855
+
856
  = 1.2.0.11 =
857
  * Preserve HTML entities when saving - i.e. preserve special character sequences.
858
  * Add '400' as an option to the numbered drop downs.
ui-tab-adrotation.php CHANGED
@@ -106,7 +106,7 @@ echo <<<EOT
106
  <textarea name="$name" rows="8" cols="
107
  EOT;
108
  adinj_table_width('rotation');
109
- echo '">'.htmlentities($ops[$name]);
110
  echo <<<EOT
111
  </textarea>
112
  </td><td>
@@ -117,7 +117,6 @@ echo <<<EOT
117
  EOT;
118
  }
119
 
120
-
121
  function adinj_advanced(){
122
  adinj_postbox_start(__("Advanced settings", 'adinj'), "advanced");
123
  echo "<p>If your theme or another plugin is causing problems with Ad Injection (e.g. by changing the priority of the 'wpautop' filter which may prevent the random ads from being added) you can try modifying Ad Injection's the_content filter priority here. Try '100', if that doesn't work try something higher. ";
106
  <textarea name="$name" rows="8" cols="
107
  EOT;
108
  adinj_table_width('rotation');
109
+ echo '">'.adinj_process_text($ops[$name]);
110
  echo <<<EOT
111
  </textarea>
112
  </td><td>
117
  EOT;
118
  }
119
 
 
120
  function adinj_advanced(){
121
  adinj_postbox_start(__("Advanced settings", 'adinj'), "advanced");
122
  echo "<p>If your theme or another plugin is causing problems with Ad Injection (e.g. by changing the priority of the 'wpautop' filter which may prevent the random ads from being added) you can try modifying Ad Injection's the_content filter priority here. Try '100', if that doesn't work try something higher. ";
ui-tab-main.php CHANGED
@@ -390,7 +390,7 @@ function adinj_adverts_box($ops){
390
  <h3><a name="topadcode"></a>Top ad (below post title - this is not a 'header' ad) [<a href="#topadplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_top'>pool</a>]--></h3>
391
  <table border="0" class="adinjtable" width="98%">
392
  <tr><td>
393
- <textarea name="ad_code_top_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo htmlentities($ops['ad_code_top_1']); ?></textarea>
394
  <br />
395
  <p><span style="font-size:10px;"><b>Docs:</b> Try a <a href="#468x15">468x15</a> or <a href="#336x280">336x280</a> advert.</span></p>
396
  </td><td>
@@ -405,7 +405,7 @@ function adinj_adverts_box($ops){
405
  <h3><a name="randomadcode"></a>Random ad (inserted randomly between paragraphs) [<a href="#randomadplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_random'>pool</a>]--></h3>
406
  <table border="0" class="adinjtable" width="98%">
407
  <tr><td>
408
- <textarea name="ad_code_random_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo htmlentities($ops['ad_code_random_1']); ?></textarea>
409
  <br />
410
  <p><span style="font-size:10px;"><b>Docs:</b> Try a <a href="#468x60">468x60</a> or <a href="#728x90">728x90</a> banner.</span></p>
411
  </td><td>
@@ -419,7 +419,7 @@ function adinj_adverts_box($ops){
419
  <h3><a name="bottomadcode"></a>Bottom ad (below the post content) [<a href="#bottomadplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_bottom'>pool</a>]--></h3>
420
  <table border="0" class="adinjtable" width="98%">
421
  <tr><td>
422
- <textarea name="ad_code_bottom_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo htmlentities($ops['ad_code_bottom_1']); ?></textarea>
423
  <br />
424
  <p><span style="font-size:10px;"><b>Docs:</b> Try a <a href="#336x280">336x280</a> advert.</span></p>
425
  </td><td>
@@ -434,7 +434,7 @@ function adinj_adverts_box($ops){
434
  <h3><a name="footeradcode"></a>Footer ad (put into 'the_footer' hook - not supported by all themes) [<a href="#footeradplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_footer'>pool</a>]--></h3>
435
  <table border="0" class="adinjtable" width="98%">
436
  <tr><td>
437
- <textarea name="ad_code_footer_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo htmlentities($ops['ad_code_footer_1']); ?></textarea>
438
  <br />
439
  Docs: footer ad information and troubleshooting
440
  <?php adinj_add_show_hide_section('footer_docs_'.uniqid(''), 'ui_footer_docs_show', 'ui_footer_docs_show', $ops); ?>
390
  <h3><a name="topadcode"></a>Top ad (below post title - this is not a 'header' ad) [<a href="#topadplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_top'>pool</a>]--></h3>
391
  <table border="0" class="adinjtable" width="98%">
392
  <tr><td>
393
+ <textarea name="ad_code_top_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo adinj_process_text($ops['ad_code_top_1']); ?></textarea>
394
  <br />
395
  <p><span style="font-size:10px;"><b>Docs:</b> Try a <a href="#468x15">468x15</a> or <a href="#336x280">336x280</a> advert.</span></p>
396
  </td><td>
405
  <h3><a name="randomadcode"></a>Random ad (inserted randomly between paragraphs) [<a href="#randomadplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_random'>pool</a>]--></h3>
406
  <table border="0" class="adinjtable" width="98%">
407
  <tr><td>
408
+ <textarea name="ad_code_random_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo adinj_process_text($ops['ad_code_random_1']); ?></textarea>
409
  <br />
410
  <p><span style="font-size:10px;"><b>Docs:</b> Try a <a href="#468x60">468x60</a> or <a href="#728x90">728x90</a> banner.</span></p>
411
  </td><td>
419
  <h3><a name="bottomadcode"></a>Bottom ad (below the post content) [<a href="#bottomadplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_bottom'>pool</a>]--></h3>
420
  <table border="0" class="adinjtable" width="98%">
421
  <tr><td>
422
+ <textarea name="ad_code_bottom_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo adinj_process_text($ops['ad_code_bottom_1']); ?></textarea>
423
  <br />
424
  <p><span style="font-size:10px;"><b>Docs:</b> Try a <a href="#336x280">336x280</a> advert.</span></p>
425
  </td><td>
434
  <h3><a name="footeradcode"></a>Footer ad (put into 'the_footer' hook - not supported by all themes) [<a href="#footeradplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_footer'>pool</a>]--></h3>
435
  <table border="0" class="adinjtable" width="98%">
436
  <tr><td>
437
+ <textarea name="ad_code_footer_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo adinj_process_text($ops['ad_code_footer_1']); ?></textarea>
438
  <br />
439
  Docs: footer ad information and troubleshooting
440
  <?php adinj_add_show_hide_section('footer_docs_'.uniqid(''), 'ui_footer_docs_show', 'ui_footer_docs_show', $ops); ?>