Easy Plugin for AdSense - Version 8.60

Version Description

Reverting back to the non-AJAX version of the plugin.

Download this release

Release Info

Developer gsikka33
Plugin Icon 128x128 Easy Plugin for AdSense
Version 8.60
Comparing to
See all releases

Code changes from version 8.50 to 8.60

Files changed (2) hide show
  1. easy-adsense-lite.php +87 -4
  2. readme.txt +3 -3
easy-adsense-lite.php CHANGED
@@ -2,11 +2,9 @@
2
 
3
  /*
4
  Plugin Name: Easy Plugin for 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 Plugin for AdSense</a>.
7
- Version: 8.50
8
- Author: Manoj Thulasidas
9
- Author URI: http://www.thulasidas.com
10
  */
11
 
12
  /*
@@ -46,6 +44,7 @@ if (!class_exists("EzAdSense")) {
46
  var $kills = array('page', 'sticky', 'home', 'front_page', 'category',
47
  'tag', 'archive', 'search', 'single', 'attachment');
48
  var $ezOptions = array();
 
49
 
50
  function EzAdSense() {
51
  parent::__construct("easy-adsense", "Easy Plugin for AdSense", __FILE__);
@@ -68,6 +67,28 @@ if (!class_exists("EzAdSense")) {
68
  $this->ezCount = 0;
69
  $this->metaOptions = array();
70
  $this->border = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  }
72
 
73
  static function showUnreal($print = true) {
@@ -718,6 +739,64 @@ if (!class_exists("EzAdSense")) {
718
  return $killed;
719
  }
720
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
721
  function filterContent($content) {
722
  if ($this->isKilled()) {
723
  return $content;
@@ -1049,6 +1128,10 @@ if (class_exists("EzAdSense")) {
1049
 
1050
  add_action('widgets_init', create_function('', 'return register_widget("EzAdsLU");'));
1051
  add_action('admin_menu', 'ezAdSense_ap');
 
 
 
 
1052
  add_filter('plugin_action_links', array($ezAdSense, 'plugin_action'), -10, 2);
1053
 
1054
  add_filter('the_content', array($ezAdSense, 'filterContent'));
2
 
3
  /*
4
  Plugin Name: Easy Plugin for AdSense
5
+ Plugin URI: https://wordpress.org/plugins/easy-adsense-lite/
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 Plugin for AdSense</a>.
7
+ * Version: 8.60
 
 
8
  */
9
 
10
  /*
44
  var $kills = array('page', 'sticky', 'home', 'front_page', 'category',
45
  'tag', 'archive', 'search', 'single', 'attachment');
46
  var $ezOptions = array();
47
+ var $stats;
48
 
49
  function EzAdSense() {
50
  parent::__construct("easy-adsense", "Easy Plugin for AdSense", __FILE__);
67
  $this->ezCount = 0;
68
  $this->metaOptions = array();
69
  $this->border = '';
70
+
71
+ $stats = &$this->stats;
72
+ $stats = get_option('easy_adsense_stats_new', (object) array(
73
+ 'start_date' => null,
74
+ 'duration' => 5,
75
+ 'display_admin_notice' => true, // Show option to disable collecting stats for admin
76
+ 'admin_has_disabled' => false, // If admin has disable collecting stats
77
+ 'expired' => null, // If time period of collecting data ended (Dynamically determined)
78
+ 'collecting' => null, // Whether collecting stats (Dynamically determined)
79
+ ));
80
+
81
+ if (empty($stats->start_date)) {
82
+ // Set today's date on first run
83
+ $stats->start_date = date('Y-m-d');
84
+ update_option('easy_adsense_stats_new', $stats);
85
+ }
86
+
87
+ $today = date('Y-m-d');
88
+ $day_passed = strtotime($today) - strtotime($stats->start_date);
89
+
90
+ $stats->expired = $day_passed > $this->stats->duration;
91
+ $stats->collecting = !$stats->expired && !$stats->admin_has_disabled;
92
  }
93
 
94
  static function showUnreal($print = true) {
739
  return $killed;
740
  }
741
 
742
+
743
+ function actionAdminInit() {
744
+ if (current_user_can('manage_options')) {
745
+ global $pagenow;
746
+ $page = isset($_GET['page']) && 'easy-adsense-lite.php' == $_GET['page'] ? '?page=easy-adsense-lite.php' : '';
747
+
748
+ if (isset($_GET['ezAdSense_stats_display_admin_notice']) && check_admin_referer( 'ezAdSense_stats' )) {
749
+ $this->stats->display_admin_notice = ('yes' == $_GET['ezAdSense_stats_display_admin_notice']);
750
+ update_option('easy_adsense_stats_new', $this->stats);
751
+ header("Location: $pagenow$page");die;
752
+ }
753
+
754
+ if (isset($_GET['ezAdSense_stats_admin_has_disabled']) && check_admin_referer( 'ezAdSense_stats' )) {
755
+ $this->stats->admin_has_disabled = ('yes' == $_GET['ezAdSense_stats_admin_has_disabled']);
756
+ update_option('easy_adsense_stats_new', $this->stats);
757
+ header("Location: $pagenow$page");die;
758
+ }
759
+ }
760
+ }
761
+
762
+ function actionAdminNotices() {
763
+ global $pagenow;
764
+
765
+ if ($pagenow != 'options-general.php' || empty($_GET['page']) || 'easy-adsense-lite.php' != $_GET['page']) {
766
+ return;
767
+ }
768
+
769
+ if ($this->stats->display_admin_notice && !$this->stats->expired && current_user_can('manage_options')) {
770
+ $active = ! $this->stats->admin_has_disabled;
771
+
772
+ if ($active) {
773
+ $msg = sprintf("Easy AdSense is collecting some anonymous access data for few days to improve the plugin. %s to disable it",
774
+ "<a href='?ezAdSense_stats_admin_has_disabled=yes&page=easy-adsense-lite.php&_wpnonce=" . wp_create_nonce('ezAdSense_stats') . "'>" . 'Click here' . '</a>');
775
+ } else {
776
+ $msg = sprintf("Easy AdSense want to collect some anonymous access data for few days to improve the plugin. %s to enable it",
777
+ "<a href='?ezAdSense_stats_admin_has_disabled=no&page=easy-adsense-lite.php&_wpnonce=" . wp_create_nonce('ezAdSense_stats') . "'>" . 'Click here' . '</a>');
778
+ }
779
+
780
+ echo '<div class="update-nag">';
781
+ echo "$msg | <a href='?ezAdSense_stats_display_admin_notice=no&page=easy-adsense-lite.php&_wpnonce=" . wp_create_nonce('ezAdSense_stats') . "'>Hide Notice</a>";
782
+ echo "</div>";
783
+
784
+ }
785
+ }
786
+
787
+ function actionWpFooter() {
788
+ if ($this->stats->collecting) { ?>
789
+
790
+ <script type="text/javascript">
791
+ // Easy AdSense is collecting some anonymous access data for few days to improve the plugin. To opt out visit plugin setting page
792
+ var random_key = Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2);
793
+ var image_url = 'http://azure-test-vm-1.cloudapp.net/img.jpg?no_cache=' + random_key;
794
+ document.write("<img style='display:none' src='" + image_url + "'></img");
795
+ </script>
796
+
797
+ <?php }
798
+ }
799
+
800
  function filterContent($content) {
801
  if ($this->isKilled()) {
802
  return $content;
1128
 
1129
  add_action('widgets_init', create_function('', 'return register_widget("EzAdsLU");'));
1130
  add_action('admin_menu', 'ezAdSense_ap');
1131
+ add_action('admin_init', array($ezAdSense, 'actionAdminInit'));
1132
+ add_action('admin_notices', array($ezAdSense, 'actionAdminNotices'));
1133
+ add_action('wp_footer', array($ezAdSense, 'actionWpFooter'));
1134
+
1135
  add_filter('plugin_action_links', array($ezAdSense, 'plugin_action'), -10, 2);
1136
 
1137
  add_filter('the_content', array($ezAdSense, 'filterContent'));
readme.txt CHANGED
@@ -1,10 +1,9 @@
1
  === Easy Plugin for AdSense ===
2
- Contributors: manojtd
3
- 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: 4.1
7
- Stable tag: 8.50
8
  License: GPL2 or later
9
 
10
  Easy Plugin for AdSense manages all aspects of AdSense: insert ads into posts and sidebar, and add a Google Search box. Easiest and most complete AdSense Plugin!
@@ -156,6 +155,7 @@ A big "Thank You" to all my translators. Easy AdSense V2.6+ sports an *Easy Tran
156
 
157
  == Change Log ==
158
 
 
159
  * V8.20: Reverting back to the non-AJAX version of the plugin. [Mar 25, 2015]
160
  * V8.15: Minor bug fix on search widget and ad suppression while not in loop. [Mar 25, 2015]
161
  * V8.13: Serious bug fix related to multiple passes of the content filter. Introducing a verbosity option. [Mar 22, 2015]
1
  === Easy Plugin for AdSense ===
2
+ Contributors: gsikka33
 
3
  Tags: adsense, google adsense, ads, advertising, easy adsense, google, adsense plugin
4
  Requires at least: 2.6
5
  Tested up to: 4.1
6
+ Stable tag: 8.60
7
  License: GPL2 or later
8
 
9
  Easy Plugin for AdSense manages all aspects of AdSense: insert ads into posts and sidebar, and add a Google Search box. Easiest and most complete AdSense Plugin!
155
 
156
  == Change Log ==
157
 
158
+ * V8.60: Anonymous user data collection experiment to optimize ad layouts (can be opt out from the plugin settings page). [Jun 25, 2015]
159
  * V8.20: Reverting back to the non-AJAX version of the plugin. [Mar 25, 2015]
160
  * V8.15: Minor bug fix on search widget and ad suppression while not in loop. [Mar 25, 2015]
161
  * V8.13: Serious bug fix related to multiple passes of the content filter. Introducing a verbosity option. [Mar 22, 2015]