Easy Plugin for AdSense - Version 7.22

Version Description

Fixing some bugs related to the lead-in ad placements.

Download this release

Release Info

Developer manojtd
Plugin Icon 128x128 Easy Plugin for AdSense
Version 7.22
Comparing to
See all releases

Code changes from version 7.21 to 7.22

Files changed (7) hide show
  1. EzAdmin.php +41 -15
  2. EzTran.php +5 -0
  3. arvixe.gif +0 -0
  4. easy-adsense-lite.php +77 -70
  5. head-text.php +1 -1
  6. maxcdn.jpg +0 -0
  7. readme.txt +3 -2
EzAdmin.php CHANGED
@@ -68,7 +68,9 @@ if (!class_exists('EzAdmin')) {
68
  $yesTitle = __('Get the Pro version now!', 'easy-common');
69
  $noTip = __('Continue using the Lite version, and hide this message. After clicking this button, please remember to save your options to hide this box for good.', 'easy-common');
70
  $noTitle = __('Stay Lite', 'easy-common');
71
- $hideTip = __('Click the link to hide this box. After clicking this link, please remember to save your options to hide this box for good.', 'easy-common');
 
 
72
  if (empty($plg['benefits'])) {
73
  return;
74
  }
@@ -96,7 +98,7 @@ $benefits
96
  $s4 $s5<br />
97
  <input onmouseover="Tip('$yesTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$yesTitle')" onmouseout="UnTip()" type = "button" id = "ybutton" value = "$s6" onclick = "buttonwhich('Yes')" />
98
  <input onmouseover="Tip('$noTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$noTitle')" onmouseout="UnTip()" type = "button" id = "nbutton" value = "$s7" onclick = "buttonwhich('No')" />
99
- <small style='font-weight:normal;'><a id='hideInvite' href='#' style='float:right; display:block; border:none;' onmouseover="Tip('$hideTip', WIDTH, 200, CLICKCLOSE, true, TITLE, 'Hide this Box')" onmouseout="UnTip()" onclick = "buttonwhich('No')">
100
  $s8</a></small>
101
  <script type = "text/javascript">
102
  function hideInvite() {
@@ -137,16 +139,16 @@ ENDINVITE;
137
  $plg = $this->plg;
138
  $plgCTime = filemtime($plgFile);
139
  $plgLongName = $plg['value'];
140
- $hideTip = __('Click the link to hide this box. After clicking this link, please remember to save your options to hide this box for good.', 'easy-common');
 
 
 
141
  if (time() > $plgCTime + (60 * 60 * 24 * 30)) {
142
  $msg = __("You've installed this plugin over a month ago.", 'easy-common');
143
- ;
144
  }
145
  else {
146
  $msg = __("You will find it feature-rich and robust.", 'easy-common');
147
- ;
148
  }
149
- $plgKey = $this->getPlgKey();
150
  $display = '';
151
  if (!$killable) {
152
  $display = "style='display:none'";
@@ -161,7 +163,7 @@ ENDINVITE;
161
  <div class='updated' id='rating'>
162
  <p>Thanks for using <i><b>$plgLongName</b></i>! $msg <br />
163
  $s1 <a href='http://wordpress.org/extend/plugins/$plgKey/' onclick="popupwindow('http://wordpress.org/extend/plugins/$plgKey/','$s2', 1024, 768);return false;">$s2</a>
164
- <small style='font-weight:normal;'><a id='hideRating' $display href='#' style='float:right; display:block; border:none;' onmouseover="Tip('$hideTip', WIDTH, 200, CLICKCLOSE, true, TITLE, 'Hide this Box')" onmouseout="UnTip()" onclick = "hideme()">
165
  $s3</a></small></p></div>
166
  <input type="hidden" id="kill_rating" name="kill_rating" value="" />
167
  <script type = "text/javascript">
@@ -198,6 +200,11 @@ ENDRATING;
198
  $s6 = sprintf(__('You are using the %s version of %s, which is available in two versions:', 'easy-common'), $version, $value);
199
  $s7 = sprintf(__('And it costs only $%.2f!', 'easy-common'), $price);
200
  $s8 = __('Get the Pro version now!', 'easy-common');
 
 
 
 
 
201
  echo "<b>$s8</b>
202
  <a href='http://buy.thulasidas.com/$slug' title='$s3. $s4' $onclick><img src='$plgURL/ezpaypal.png' alt='ezPayPal' class='alignright'/></a>
203
  <br />
@@ -206,7 +213,7 @@ $s6
206
  $moreInfo
207
  </li>
208
  <li>$why $s7</li>
209
- </ul>";
210
  }
211
 
212
  function renderProText() {
@@ -235,15 +242,18 @@ $moreInfo
235
 
236
  $moreInfo = "&nbsp; <a href='http://buy.thulasidas.com/lite/$slug.zip' title='$s1'>$s2 </a>&nbsp; <a href='http://buy.thulasidas.com/$slug' title='$s3' $onclick>$s4</a>";
237
  $toolTip .= addslashes('<br />' . $moreInfo);
238
- echo "<div style='background-color:#ffcccc;padding:5px;border: solid 1px;text-align:center;'>
239
- <span style='font-size:14px;color:#a48;font-variant: small-caps;text-decoration:underline;text-align:center;' $onclick onmouseover=\"TagToTip('pro', WIDTH, 300, TITLE, '$s5',STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 5, 5])\"><b>$s4</b></span><br />";
240
 
241
  $s8 = sprintf(__('It costs only $%.2f!', 'easy-common'), $price);
242
  $s9 = __('Instant download link.', 'easy-common');
243
  $value .= '<b><i> Lite</i></b>';
244
  $s10 = sprintf(__('Thank you for using %s. The "Pro" version gives you more options.', 'easy-common'), $value);
245
  $s11 = __("Consider buying it.", 'easy-common');
246
- echo "$s10 $filter $s11 <a href='http://buy.thulasidas.com/$slug' title='$s3. $s9'>$s8</a>";
 
 
 
247
  echo "</div>";
248
  }
249
 
@@ -252,7 +262,19 @@ $moreInfo
252
  return;
253
  }
254
  $plgURL = $this->plgURL;
255
- echo "<div style='padding:0px;border:none; width:300px;text-align:center' id='support' onmouseover=\"Tip('<b>ezAffiliates</b>: The most affiliate-centric revenue sharing model on the Web. Finally, you can make some serious returns on your web presence.<br /><b>Generous 50% Commission</b>: perhaps the highest rate of revenue sharing on the web. With just a couple of sales of this plugin, you will have recovered your purchase price!<br /><b>$10 Minimum Payout</b> so that you will not be waiting forever before you qualify for payment.<br /><b>Lifetime Tracking</b>: ezAffiliates uses cookie-less tracking technology to attribute every purchase of your lead to your account. Whatever your leads buy from us, whenever they do, will earn you commission. No cookie expiry!<br /><b>High Quality Products</b> such as this plugin, and other premium plugins and PHP packages.<br /><b>Diverse Markets</b>: Bloggers who blog about plugins, PayPal integration, affiliate marketing, MacOS apps and even eBooks will find ezAffiliates attractive and more effective that their current ad campaigns.', WIDTH, 295, TITLE, 'ezAffiliates', FIX, [this, 0, 0])\" onmouseout=\"UnTip()\" ><a href='http://affiliates.thulasidas.com'><img src='$plgURL/invite.gif' alt='ezAffiliates' onclick=\"popupwindow('http://affiliates.thulasidas.com/','50-50 Revenue Share', 1024, 768);return false;\"/></a></div>";
 
 
 
 
 
 
 
 
 
 
 
 
256
  }
257
 
258
  function renderSupportText() {
@@ -265,12 +287,12 @@ $moreInfo
265
  $value = '<em><strong>' . $plg['value'] . '</strong></em>';
266
  $supportText = "<div style=\"background-color:#cff;padding:5px;border: solid 1px\" id=\"support\"><b>Support $value. <a href=\"http://buy.thulasidas.com/$slug\" title=\"Pro version of this plugin. Instant download link.\" onclick=\"popupwindow('http://buy.thulasidas.com/$slug','Get {$plg['value']}', 1024, 768);return false;\">Go Pro!</a></b>";
267
  if ($long) {
268
- $longText = "How about ";
269
  }
270
  else {
271
  $longText = '';
272
  }
273
- $supportText .= "<br />$longText<span onmouseover=\"TagToTip('dropbox', WIDTH, 440, TITLE, 'What is DropBox?',STICKY, 1, CLOSEBTN, true, FIX, [this, -150, 2])\"><a href='http://db.tt/qsogWB1' title='Sign up for Dropbox -- free 2GB online storage on the cloud!' target='_blank'>2GB of <em>free</em> online storage</a></span>?";
274
  if ($long) {
275
  $longText = "WordPress Hosting for ";
276
  }
@@ -293,9 +315,13 @@ $moreInfo
293
  $plgURL = $this->plgURL;
294
  echo <<<ENDDIVS
295
  <div id="arvixe" style='display:none;'>
296
- <a href="http://www.arvixe.com/1933-27-1-310.html" target="_blank">Arvixe</a> is my favorite hosting provider. Friendly service, extremely competitive rates, and of course a great affiliate program.
297
  </div>
298
 
 
 
 
 
299
  <span id="dropbox" style='display:none;'>
300
  Dropbox! gives you 2GB of network (cloud) storage for free, which I find quite adequate for any normal user. (That sounds like the famous last words by Bill Gates, doesn’t it? “64KB of memory should be enough for anyone!”) And, you can get 250MB extra for every successful referral you make. That brings me to my ulterior motive – please use this link to sign up. When you do, I get 500MB extra. Don’t worry, you get 500MB extra as well. So I can grow my online storage up to 18GB, which should keep me happy for a long time. Thank you!
301
  </span>
68
  $yesTitle = __('Get the Pro version now!', 'easy-common');
69
  $noTip = __('Continue using the Lite version, and hide this message. After clicking this button, please remember to save your options to hide this box for good.', 'easy-common');
70
  $noTitle = __('Stay Lite', 'easy-common');
71
+ $plgKey = $this->getPlgKey();
72
+ $onClick = addslashes("onclick=\"popupwindow('http://www.thulasidas.com/promo.php?key=$plgKey','Get Pro', 1024, 768);return false;\"");
73
+ $hideTip = htmlspecialchars(__('Click the link to hide this box. After clicking this link, please remember to save your options to hide this box for good.', 'easy-common') . "<br /><a style=\"color:red;font-weight:bold\" href=\"http://www.thulasidas.com/promo.php?key=$plgKey\" target=_blank $onClick>" . __("Limited Time Offer. Get the Pro version for less than a dollar!", 'easy-common') . "</a>");
74
  if (empty($plg['benefits'])) {
75
  return;
76
  }
98
  $s4 $s5<br />
99
  <input onmouseover="Tip('$yesTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$yesTitle')" onmouseout="UnTip()" type = "button" id = "ybutton" value = "$s6" onclick = "buttonwhich('Yes')" />
100
  <input onmouseover="Tip('$noTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$noTitle')" onmouseout="UnTip()" type = "button" id = "nbutton" value = "$s7" onclick = "buttonwhich('No')" />
101
+ <small style='font-weight:normal;'><a id='hideInvite' href='#' style='float:right; display:block; border:none;' onmouseover="Tip('$hideTip', WIDTH, 200, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 5, 5], TITLE, 'Hide this Box')" onclick = "buttonwhich('No')">
102
  $s8</a></small>
103
  <script type = "text/javascript">
104
  function hideInvite() {
139
  $plg = $this->plg;
140
  $plgCTime = filemtime($plgFile);
141
  $plgLongName = $plg['value'];
142
+ $plgKey = $this->getPlgKey();
143
+ $onClick = addslashes("onclick=\"popupwindow('http://www.thulasidas.com/promo.php?key=$plgKey','Get Pro', 1024, 768);return false;\"");
144
+ $hideTip = htmlspecialchars(__('Click the link to hide this box. After clicking this link, please remember to save your options to hide this box for good.', 'easy-common') . "<br /><a style=\"color:red;font-weight:bold\" href=\"http://www.thulasidas.com/promo.php?key=$plgKey\" target=_blank $onClick>" . __("Limited Time Offer. Get the Pro version for less than a dollar!", 'easy-common') . "</a>");
145
+
146
  if (time() > $plgCTime + (60 * 60 * 24 * 30)) {
147
  $msg = __("You've installed this plugin over a month ago.", 'easy-common');
 
148
  }
149
  else {
150
  $msg = __("You will find it feature-rich and robust.", 'easy-common');
 
151
  }
 
152
  $display = '';
153
  if (!$killable) {
154
  $display = "style='display:none'";
163
  <div class='updated' id='rating'>
164
  <p>Thanks for using <i><b>$plgLongName</b></i>! $msg <br />
165
  $s1 <a href='http://wordpress.org/extend/plugins/$plgKey/' onclick="popupwindow('http://wordpress.org/extend/plugins/$plgKey/','$s2', 1024, 768);return false;">$s2</a>
166
+ <small style='font-weight:normal;'><a id='hideRating' $display href='#' style='float:right; display:block; border:none;' onmouseover="Tip('$hideTip', WIDTH, 200, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 5, 5], TITLE, 'Hide this Box')" onclick = "hideme()">
167
  $s3</a></small></p></div>
168
  <input type="hidden" id="kill_rating" name="kill_rating" value="" />
169
  <script type = "text/javascript">
200
  $s6 = sprintf(__('You are using the %s version of %s, which is available in two versions:', 'easy-common'), $version, $value);
201
  $s7 = sprintf(__('And it costs only $%.2f!', 'easy-common'), $price);
202
  $s8 = __('Get the Pro version now!', 'easy-common');
203
+
204
+ $plgKey = $this->getPlgKey();
205
+ $promoClick = "onclick=\"popupwindow('http://www.thulasidas.com/promo.php?key=$plgKey','Get Pro', 1024, 768);return false;\"";
206
+ $promoTip = "<a style=\"color:red;font-weight:bold\" href=\"http://www.thulasidas.com/promo.php?key=$plgKey\" target=_blank $promoClick>" . __("Limited Time Offer. Get the Pro version for less than a dollar!", 'easy-common') . "</a>";
207
+
208
  echo "<b>$s8</b>
209
  <a href='http://buy.thulasidas.com/$slug' title='$s3. $s4' $onclick><img src='$plgURL/ezpaypal.png' alt='ezPayPal' class='alignright'/></a>
210
  <br />
213
  $moreInfo
214
  </li>
215
  <li>$why $s7</li>
216
+ </ul>$promoTip";
217
  }
218
 
219
  function renderProText() {
242
 
243
  $moreInfo = "&nbsp; <a href='http://buy.thulasidas.com/lite/$slug.zip' title='$s1'>$s2 </a>&nbsp; <a href='http://buy.thulasidas.com/$slug' title='$s3' $onclick>$s4</a>";
244
  $toolTip .= addslashes('<br />' . $moreInfo);
245
+ echo "<div style='background-color:#ffcccc;padding:5px;border: solid 1px;'>
246
+ <div style='font-size:14px;color:#a48;font-variant: small-caps;text-decoration:underline;text-align:center;' $onclick onmouseover=\"TagToTip('pro', WIDTH, 300, TITLE, '$s5',STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 5, 5])\"><b>$s4</b></div>";
247
 
248
  $s8 = sprintf(__('It costs only $%.2f!', 'easy-common'), $price);
249
  $s9 = __('Instant download link.', 'easy-common');
250
  $value .= '<b><i> Lite</i></b>';
251
  $s10 = sprintf(__('Thank you for using %s. The "Pro" version gives you more options.', 'easy-common'), $value);
252
  $s11 = __("Consider buying it.", 'easy-common');
253
+ $plgKey = $this->getPlgKey();
254
+ $promoClick = addslashes("onclick=\"popupwindow('http://www.thulasidas.com/promo.php?key=$plgKey','Get Pro', 1024, 768);return false;\"");
255
+ $promoTip = htmlspecialchars("$s3. $s9<br /><a style=\"color:red;font-weight:bold\" href=\"http://www.thulasidas.com/promo.php?key=$plgKey\" target=_blank $promoClick>" . __("Limited Time Offer. Get the Pro version for less than a dollar!", 'easy-common') . "</a>");
256
+ echo "$s10 $filter $s11 <br /><a href='http://buy.thulasidas.com/$slug' title='$s3. $s9' onmouseover=\"Tip('$promoTip', WIDTH, 200, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 5, 5], TITLE, 'Limited Time Offer')\">$s8</a>";
257
  echo "</div>";
258
  }
259
 
262
  return;
263
  }
264
  $plgURL = $this->plgURL;
265
+ $select = rand(0, 2);
266
+ switch ($select) {
267
+ case 0:
268
+ echo "<div style='padding:0px;border:none;text-align:center' id='support' onmouseover=\"TagToTip('maxcdn', WIDTH, 295, TITLE, 'MaxCDN', FIX, [this, 0, 0])\" onmouseout=\"UnTip()\" ><a href='http://tracking.maxcdn.com/c/95082/3964/378' target='_blank'><img src='$plgURL/maxcdn.jpg' border='0' alt='MaxCDN Content Delivery Network' /></a></div>";
269
+ break;
270
+ case 1:
271
+ echo "<div style='padding:0px;border:none;text-align:center' id='support' onmouseover=\"TagToTip('arvixe', WIDTH, 295, TITLE, 'Arvixe', FIX, [this, 0, 0])\" onmouseout=\"UnTip()\" ><a href='http://www.arvixe.com/1933-0-1-357.html' target='_blank'><img border='0' src='$plgURL/arvixe.gif' alt='Advanced Web Hosting for only $4/month'></a></div>";
272
+ break;
273
+ case 2:
274
+ default:
275
+ echo "<div style='padding:0px;border:none; width:300px;text-align:center' id='support' onmouseover=\"Tip('<b>ezAffiliates</b>: The most affiliate-centric revenue sharing model on the Web. Finally, you can make some serious returns on your web presence.<br /><b>Generous 50% Commission</b>: perhaps the highest rate of revenue sharing on the web. With just a couple of sales of this plugin, you will have recovered your purchase price!<br /><b>$10 Minimum Payout</b> so that you will not be waiting forever before you qualify for payment.<br /><b>Lifetime Tracking</b>: ezAffiliates uses cookie-less tracking technology to attribute every purchase of your lead to your account. Whatever your leads buy from us, whenever they do, will earn you commission. No cookie expiry!<br /><b>High Quality Products</b> such as this plugin, and other premium plugins and PHP packages.<br /><b>Diverse Markets</b>: Bloggers who blog about plugins, PayPal integration, affiliate marketing, MacOS apps and even eBooks will find ezAffiliates attractive and more effective that their current ad campaigns.', WIDTH, 295, TITLE, 'ezAffiliates', FIX, [this, 0, 0])\" onmouseout=\"UnTip()\" ><a href='http://affiliates.thulasidas.com'><img src='$plgURL/invite.gif' alt='ezAffiliates' onclick=\"popupwindow('http://affiliates.thulasidas.com/','50-50 Revenue Share', 1024, 768);return false;\"/></a></div>";
276
+ break;
277
+ }
278
  }
279
 
280
  function renderSupportText() {
287
  $value = '<em><strong>' . $plg['value'] . '</strong></em>';
288
  $supportText = "<div style=\"background-color:#cff;padding:5px;border: solid 1px\" id=\"support\"><b>Support $value. <a href=\"http://buy.thulasidas.com/$slug\" title=\"Pro version of this plugin. Instant download link.\" onclick=\"popupwindow('http://buy.thulasidas.com/$slug','Get {$plg['value']}', 1024, 768);return false;\">Go Pro!</a></b>";
289
  if ($long) {
290
+ $longText = "Speed up your blog: ";
291
  }
292
  else {
293
  $longText = '';
294
  }
295
+ $supportText .= "<br />$longText<span onmouseover=\"TagToTip('maxcdn', WIDTH, 300, TITLE, 'What is MaxCDN?',STICKY, 1, CLOSEBTN, true, FIX, [this, -150, 2])\"><a href='http://tracking.maxcdn.com/c/95082/3964/378' target='_blank'>Use MaxCDN!</a></span>";
296
  if ($long) {
297
  $longText = "WordPress Hosting for ";
298
  }
315
  $plgURL = $this->plgURL;
316
  echo <<<ENDDIVS
317
  <div id="arvixe" style='display:none;'>
318
+ <a href="http://www.arvixe.com/1933-27-1-310.html" target="_blank"><b>Arvixe</b></a> is my favorite hosting provider. Friendly service, extremely competitive rates, and of course a great affiliate program. My own WordPress blog and a dozen websites are hosted on their VPS. If you are looking for a new hosting provider, do check them out!
319
  </div>
320
 
321
+ <span id="maxcdn" style='display:none;'>
322
+ <a href='http://tracking.maxcdn.com/c/95082/3964/378' target='_blank'><b>MaxCDN</b></a> is a professional content delivery network. Easiest and most effective way to optimize your blog performance. Compatible with caching plugins, 24x7 professional support. Faster than most CDN providers in the continental US. Cheaper and better than most. Check it out now!
323
+ </span>
324
+
325
  <span id="dropbox" style='display:none;'>
326
  Dropbox! gives you 2GB of network (cloud) storage for free, which I find quite adequate for any normal user. (That sounds like the famous last words by Bill Gates, doesn’t it? “64KB of memory should be enough for anyone!”) And, you can get 250MB extra for every successful referral you make. That brings me to my ulterior motive – please use this link to sign up. When you do, I get 500MB extra. Don’t worry, you get 500MB extra as well. So I can grow my online storage up to 18GB, which should keep me happy for a long time. Thank you!
327
  </span>
EzTran.php CHANGED
@@ -211,6 +211,11 @@ if (!class_exists("EzTran")) {
211
  $poName = $slug;
212
  }
213
  $zip = new ZipStream($file);
 
 
 
 
 
214
  foreach ($potArray as $d => $str) {
215
  if (empty($d)) { // skip strings with no domain -- they are WP core ones
216
  continue;
211
  $poName = $slug;
212
  }
213
  $zip = new ZipStream($file);
214
+ if ($this->isEmbedded
215
+ && $slug != 'easy-translator'
216
+ && $slug != 'easy-translator-lite') {
217
+ $zip->add_file("readme.txt", "Please edit the included PO files using appropriate tools such as poedit (or any text editor) and email them to the plugin author. If you are translating one of my plugins, the email address is manoj@thulasidas.com.");
218
+ }
219
  foreach ($potArray as $d => $str) {
220
  if (empty($d)) { // skip strings with no domain -- they are WP core ones
221
  continue;
arvixe.gif ADDED
Binary file
easy-adsense-lite.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Easy AdSense
5
  Plugin URI: http://www.thulasidas.com/adsense
6
  Description: Easiest way to show AdSense and make money from your blog. Configure it at <a href="options-general.php?page=easy-adsense-lite.php">Settings &rarr; Easy AdSense</a>.
7
- Version: 7.21
8
  Author: Manoj Thulasidas
9
  Author URI: http://www.thulasidas.com
10
  */
@@ -70,7 +70,7 @@ if (!class_exists("EzAdSense")) {
70
  $this->border = '';
71
  }
72
 
73
- static function showUnreal($print = false) {
74
  $unreal = "<div style='text-align:center;margin-left:auto;margin-right:auto;font-size:0.6em'><a href='http://www.thulasidas.com/adsense/' target='_blank' title='The simplest way to put AdSense to work for you!'> Easy AdSense</a> by <a href='http://www.Thulasidas.com/' target='_blank' title='Unreal Blog proudly brings you Easy AdSense'>Unreal</a></div>";
75
  if ($print) {
76
  echo $unreal;
@@ -577,45 +577,55 @@ if (!class_exists("EzAdSense")) {
577
  }
578
 
579
  function getMetaOptions() {
580
- if (empty($this->metaOptions)) {
581
  global $post;
582
- $lookup = array('adsense' => 'adsense',
583
- 'adsense-top' => 'show_leadin',
584
- 'adsense-middle' => 'show_midtext',
585
- 'adsense-bottom' => 'show_leadout',
586
- 'adsense-widget' => 'show_widget',
587
- 'adsense-search' => 'title_gsearch',
588
- 'adsense-linkunits' => 'show_lu');
 
589
  $metaOptions = array();
590
- foreach ($lookup as $metaKey => $optKey) {
591
- if (!empty($this->options[$optKey])) {
592
- $metaOptions[$optKey] = $this->options[$optKey];
593
- }
594
- else {
595
- $metaOptions[$optKey] = '';
596
- }
597
- $customStyle = get_post_custom_values($metaKey, $post->ID, true);
598
- if (is_array($customStyle)) {
599
- $metaStyle = strtolower($customStyle[0]);
600
- }
601
- else {
602
- $metaStyle = strtolower($customStyle);
603
- }
604
- $style = '';
605
- if ($metaStyle == 'left') {
606
- $style = 'float:left;display:block;';
607
- }
608
- else if ($metaStyle == 'right') {
609
- $style = 'float:right;display:block;';
610
- }
611
- else if ($metaStyle == 'center') {
612
- $style = 'text-align:center;display:block;';
613
- }
614
- else {
615
- $style = $metaStyle;
616
- }
617
- if (!empty($style)) {
618
- $metaOptions[$optKey] = $style;
 
 
 
 
 
 
 
 
 
619
  }
620
  }
621
  $this->metaOptions = $metaOptions;
@@ -639,6 +649,10 @@ if (!class_exists("EzAdSense")) {
639
  return $paras;
640
  }
641
 
 
 
 
 
642
  function mkBorder() {
643
  if ($this->options['show_borders'] && empty($this->border)) {
644
  $this->border = 'border:#' . $this->options['border_normal'] .
@@ -668,7 +682,7 @@ if (!class_exists("EzAdSense")) {
668
  $inline = 'style="' . $show . ';margin:' .
669
  $margin . 'px;' . $border . '"';
670
  }
671
- $unreal = self::showUnreal();
672
  $info = $this->info();
673
  $adBlock = stripslashes($linebreak . $info . $linebreak .
674
  "<!-- [$slot: {$this->ezCount} urCount: {$this->urCount} urMax: {$this->urMax}] -->$linebreak" .
@@ -676,6 +690,7 @@ if (!class_exists("EzAdSense")) {
676
  $this->options["text_$slot"] .
677
  ($this->urCount++ < $this->urMax ? $unreal : '') .
678
  "</div>" . $linebreak . $info . $linebreak);
 
679
  return $adBlock;
680
  }
681
 
@@ -703,11 +718,12 @@ if (!class_exists("EzAdSense")) {
703
  . "is not less than {$this->ezMax}] -->";
704
  }
705
  if (strpos($content, "<!--noadsense-->") !== false) {
706
- return $content;
 
707
  }
708
  $metaOptions = $this->getMetaOptions();
709
  if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') {
710
- return $content;
711
  }
712
 
713
  if (!in_the_loop()) {
@@ -719,9 +735,10 @@ if (!class_exists("EzAdSense")) {
719
 
720
  $show_leadin = $metaOptions['show_leadin'];
721
  $leadin = '';
722
- if ($show_leadin != 'no' && $wc > $this->options['wc_leadin']) {
 
 
723
  if ($this->ezCount < $this->ezMax) {
724
- $this->ezCount++;
725
  $leadin = $this->mkAdBlock("leadin");
726
  }
727
  }
@@ -740,7 +757,6 @@ if (!class_exists("EzAdSense")) {
740
  $split = $paras[floor(sizeof($paras) / 2)];
741
  }
742
  if ($this->options['force_midad'] || $half > 10) {
743
- $this->ezCount++;
744
  $midtext = $this->mkAdBlock("midtext");
745
  $content = substr($content, 0, $split) . $midtext . substr($content, $split);
746
  }
@@ -751,7 +767,6 @@ if (!class_exists("EzAdSense")) {
751
  $leadout = '';
752
  if ($show_leadout != 'no' && $wc > $this->options['wc_leadout']) {
753
  if ($this->ezCount < $this->ezMax) {
754
- $this->ezCount++;
755
  if (strpos($show_leadout, "float") !== false) {
756
  $paras = $this->findParas($content);
757
  $split = array_pop($paras);
@@ -763,7 +778,7 @@ if (!class_exists("EzAdSense")) {
763
  $leadout = $this->mkAdBlock("leadout");
764
  }
765
  }
766
- if ($this->options['header_leadin']) {
767
  $this->leadin = $leadin;
768
  $leadin = '';
769
  }
@@ -780,19 +795,8 @@ if (!class_exists("EzAdSense")) {
780
  return $content;
781
  }
782
 
783
- function footer_action() {
784
- self::showUnreal(true);
785
- }
786
-
787
  // This is add_action target to either the_content, loop_start or send_headers.
788
- function header_leadin($arg) {
789
- if (is_object($arg)) {
790
- $content = '';
791
- }
792
- else {
793
- $content = $arg;
794
- }
795
- // if it is an admin page, don't show ads
796
  if (is_admin()) {
797
  return $arg;
798
  }
@@ -805,14 +809,18 @@ if (!class_exists("EzAdSense")) {
805
  }
806
  $show_leadin = $this->options['show_leadin'];
807
  if ($show_leadin != 'no') {
808
- $this->metaOptions['show_leadin'] = '';
809
- echo $this->mkAdBlock("leadin");
810
- unset($this->metaOptions);
811
- return $arg;
 
 
 
812
  }
 
813
  }
814
 
815
- function footer_leadout($arg) {
816
  if (is_admin()) {
817
  return $arg;
818
  }
@@ -871,7 +879,6 @@ if (class_exists("EzAdSense")) {
871
  if ($ezAdSense->ezCount >= $ezAdSense->ezMax) {
872
  return;
873
  }
874
- $ezAdSense->ezCount++;
875
  }
876
 
877
  $title = empty($ezAdSense->options['title_widget']) ?
@@ -1035,18 +1042,18 @@ if (class_exists("EzAdSense")) {
1035
 
1036
  add_filter('the_content', array($ezAdSense, 'filterContent'));
1037
  if ($ezAdSense->options['max_link'] === -1) {
1038
- add_action('wp_footer', array($ezAdSense, 'footer_action', 1));
1039
  }
1040
  else {
1041
- remove_action('wp_footer', array($ezAdSense, 'footer_action'));
1042
  }
1043
 
1044
- if ($ezAdSense->options['header_leadin']) {
1045
- add_action($ezAdSense->options['header_leadin'], array($ezAdSense, 'header_leadin'));
1046
  }
1047
 
1048
  if ($ezAdSense->options['footer_leadout']) {
1049
- add_action($ezAdSense->options['footer_leadout'], array($ezAdSense, 'footer_leadout'));
1050
  }
1051
  register_activation_hook(__FILE__, array($ezAdSense, 'migrateOptions'));
1052
  }
4
  Plugin Name: Easy AdSense
5
  Plugin URI: http://www.thulasidas.com/adsense
6
  Description: Easiest way to show AdSense and make money from your blog. Configure it at <a href="options-general.php?page=easy-adsense-lite.php">Settings &rarr; Easy AdSense</a>.
7
+ Version: 7.22
8
  Author: Manoj Thulasidas
9
  Author URI: http://www.thulasidas.com
10
  */
70
  $this->border = '';
71
  }
72
 
73
+ static function showUnreal($print = true) {
74
  $unreal = "<div style='text-align:center;margin-left:auto;margin-right:auto;font-size:0.6em'><a href='http://www.thulasidas.com/adsense/' target='_blank' title='The simplest way to put AdSense to work for you!'> Easy AdSense</a> by <a href='http://www.Thulasidas.com/' target='_blank' title='Unreal Blog proudly brings you Easy AdSense'>Unreal</a></div>";
75
  if ($print) {
76
  echo $unreal;
577
  }
578
 
579
  function getMetaOptions() {
580
+ if (empty($this->metaOptions) || $this->mayBeExcerpt()) {
581
  global $post;
582
+ if (is_object($post)) {
583
+ $postID = $post->ID;
584
+ }
585
+ else {
586
+ global $wp;
587
+ $url = home_url(add_query_arg(array(), $wp->request));
588
+ $postID = url_to_postid($url);
589
+ }
590
  $metaOptions = array();
591
+ if (!empty($postID)) {
592
+ $lookup = array('adsense' => 'adsense',
593
+ 'adsense-top' => 'show_leadin',
594
+ 'adsense-middle' => 'show_midtext',
595
+ 'adsense-bottom' => 'show_leadout',
596
+ 'adsense-widget' => 'show_widget',
597
+ 'adsense-search' => 'title_gsearch',
598
+ 'adsense-linkunits' => 'show_lu');
599
+ foreach ($lookup as $metaKey => $optKey) {
600
+ if (!empty($this->options[$optKey])) {
601
+ $metaOptions[$optKey] = $this->options[$optKey];
602
+ }
603
+ else {
604
+ $metaOptions[$optKey] = '';
605
+ }
606
+ $customStyle = get_post_custom_values($metaKey, $postID, true);
607
+ if (is_array($customStyle)) {
608
+ $metaStyle = strtolower($customStyle[0]);
609
+ }
610
+ else {
611
+ $metaStyle = strtolower($customStyle);
612
+ }
613
+ $style = '';
614
+ if ($metaStyle == 'left') {
615
+ $style = 'float:left;display:block;';
616
+ }
617
+ else if ($metaStyle == 'right') {
618
+ $style = 'float:right;display:block;';
619
+ }
620
+ else if ($metaStyle == 'center') {
621
+ $style = 'text-align:center;display:block;';
622
+ }
623
+ else {
624
+ $style = $metaStyle;
625
+ }
626
+ if (!empty($style)) {
627
+ $metaOptions[$optKey] = $style;
628
+ }
629
  }
630
  }
631
  $this->metaOptions = $metaOptions;
649
  return $paras;
650
  }
651
 
652
+ function mayBeExcerpt() {
653
+ return is_home() || is_category() || is_tag() || is_archive();
654
+ }
655
+
656
  function mkBorder() {
657
  if ($this->options['show_borders'] && empty($this->border)) {
658
  $this->border = 'border:#' . $this->options['border_normal'] .
682
  $inline = 'style="' . $show . ';margin:' .
683
  $margin . 'px;' . $border . '"';
684
  }
685
+ $unreal = self::showUnreal(false);
686
  $info = $this->info();
687
  $adBlock = stripslashes($linebreak . $info . $linebreak .
688
  "<!-- [$slot: {$this->ezCount} urCount: {$this->urCount} urMax: {$this->urMax}] -->$linebreak" .
690
  $this->options["text_$slot"] .
691
  ($this->urCount++ < $this->urMax ? $unreal : '') .
692
  "</div>" . $linebreak . $info . $linebreak);
693
+ $this->ezCount++;
694
  return $adBlock;
695
  }
696
 
718
  . "is not less than {$this->ezMax}] -->";
719
  }
720
  if (strpos($content, "<!--noadsense-->") !== false) {
721
+ $this->metaOptions['adsense'] = 'no';
722
+ return "$content <!-- Easy AdSense Unfiltered [suppressed by noadsense comment] -->";
723
  }
724
  $metaOptions = $this->getMetaOptions();
725
  if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') {
726
+ return "$content <!-- Easy AdSense Unfiltered [suppressed by meta option adsense = no] -->";
727
  }
728
 
729
  if (!in_the_loop()) {
735
 
736
  $show_leadin = $metaOptions['show_leadin'];
737
  $leadin = '';
738
+ if ($show_leadin != 'no'
739
+ && empty($this->options['header_leadin'])
740
+ && $wc > $this->options['wc_leadin']) {
741
  if ($this->ezCount < $this->ezMax) {
 
742
  $leadin = $this->mkAdBlock("leadin");
743
  }
744
  }
757
  $split = $paras[floor(sizeof($paras) / 2)];
758
  }
759
  if ($this->options['force_midad'] || $half > 10) {
 
760
  $midtext = $this->mkAdBlock("midtext");
761
  $content = substr($content, 0, $split) . $midtext . substr($content, $split);
762
  }
767
  $leadout = '';
768
  if ($show_leadout != 'no' && $wc > $this->options['wc_leadout']) {
769
  if ($this->ezCount < $this->ezMax) {
 
770
  if (strpos($show_leadout, "float") !== false) {
771
  $paras = $this->findParas($content);
772
  $split = array_pop($paras);
778
  $leadout = $this->mkAdBlock("leadout");
779
  }
780
  }
781
+ if (!empty($this->options['header_leadin'])) {
782
  $this->leadin = $leadin;
783
  $leadin = '';
784
  }
795
  return $content;
796
  }
797
 
 
 
 
 
798
  // This is add_action target to either the_content, loop_start or send_headers.
799
+ function filterHeader($arg) {
 
 
 
 
 
 
 
800
  if (is_admin()) {
801
  return $arg;
802
  }
809
  }
810
  $show_leadin = $this->options['show_leadin'];
811
  if ($show_leadin != 'no') {
812
+ $metaOptions = $this->getMetaOptions();
813
+ if (empty($metaOptions['adsense']) ||
814
+ (!empty($metaOptions['adsense']) && $metaOptions['adsense'] != 'no')) {
815
+ $this->metaOptions['show_leadin'] = '';
816
+ echo $this->mkAdBlock("leadin");
817
+ unset($this->metaOptions);
818
+ }
819
  }
820
+ return $arg;
821
  }
822
 
823
+ function filterFooter($arg) {
824
  if (is_admin()) {
825
  return $arg;
826
  }
879
  if ($ezAdSense->ezCount >= $ezAdSense->ezMax) {
880
  return;
881
  }
 
882
  }
883
 
884
  $title = empty($ezAdSense->options['title_widget']) ?
1042
 
1043
  add_filter('the_content', array($ezAdSense, 'filterContent'));
1044
  if ($ezAdSense->options['max_link'] === -1) {
1045
+ add_action('wp_footer', array($ezAdSense, 'showUnreal', 1));
1046
  }
1047
  else {
1048
+ remove_action('wp_footer', array($ezAdSense, 'showUnreal'));
1049
  }
1050
 
1051
+ if (!empty($ezAdSense->options['header_leadin'])) {
1052
+ add_action($ezAdSense->options['header_leadin'], array($ezAdSense, 'filterHeader'));
1053
  }
1054
 
1055
  if ($ezAdSense->options['footer_leadout']) {
1056
+ add_action($ezAdSense->options['footer_leadout'], array($ezAdSense, 'filterFooter'));
1057
  }
1058
  register_activation_hook(__FILE__, array($ezAdSense, 'migrateOptions'));
1059
  }
head-text.php CHANGED
@@ -24,11 +24,11 @@ if (rand(0, 2) % 2
24
  || $ez->slug == "easy-chitika"
25
  || $ez->slug == "google-adsense") {
26
  $ez->renderSupportText();
27
- $ez->renderTipDivs();
28
  }
29
  else {
30
  $ez->renderAffiliate();
31
  }
 
32
 
33
  echo '</td>';
34
  echo '<td style="width:30%">';
24
  || $ez->slug == "easy-chitika"
25
  || $ez->slug == "google-adsense") {
26
  $ez->renderSupportText();
 
27
  }
28
  else {
29
  $ez->renderAffiliate();
30
  }
31
+ $ez->renderTipDivs();
32
 
33
  echo '</td>';
34
  echo '<td style="width:30%">';
maxcdn.jpg ADDED
Binary file
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://buy.thulasidas.com/easy-adsense
4
  Tags: adsense, google adsense, ads, advertising, easy adsense, google, adsense plugin
5
  Requires at least: 2.6
6
  Tested up to: 3.9
7
- Stable tag: 7.21
8
  License: GPL2 or later
9
 
10
  Easy AdSense manages all aspects of AdSense: insert ads into posts and sidebar, and add a Google Search box. Easiest and most complete AdSense Plugin!
@@ -42,7 +42,7 @@ Easy AdSense is the freely distributed version of a premium plugin. The [Pro ver
42
 
43
  == Upgrade Notice ==
44
 
45
- Further refactoring and internationalization changes.
46
 
47
  == Screenshots ==
48
 
@@ -140,6 +140,7 @@ A big "Thank You" to all my translators. Easy AdSense V2.6+ sports an *Easy Tran
140
 
141
  == Change Log ==
142
 
 
143
  * V7.21: Further refactoring and internationalization changes. [May 6, 2014]
144
  * V7.20: Some refactoring changes. [Apr 18, 2014]
145
  * V7.13: Bug fix. [Apr 10, 2014]
4
  Tags: adsense, google adsense, ads, advertising, easy adsense, google, adsense plugin
5
  Requires at least: 2.6
6
  Tested up to: 3.9
7
+ Stable tag: 7.22
8
  License: GPL2 or later
9
 
10
  Easy AdSense manages all aspects of AdSense: insert ads into posts and sidebar, and add a Google Search box. Easiest and most complete AdSense Plugin!
42
 
43
  == Upgrade Notice ==
44
 
45
+ Fixing some bugs related to the lead-in ad placements.
46
 
47
  == Screenshots ==
48
 
140
 
141
  == Change Log ==
142
 
143
+ * V7.22: Fixing some bugs related to the lead-in ad placements. [May 30, 2014]
144
  * V7.21: Further refactoring and internationalization changes. [May 6, 2014]
145
  * V7.20: Some refactoring changes. [Apr 18, 2014]
146
  * V7.13: Bug fix. [Apr 10, 2014]