Advanced Ads - Version 1.7.9.1

Version Description

  • removed the the_content check from non-singular pages
  • moved ad blocker check into footer
Download this release

Release Info

Developer webzunft
Plugin Icon 128x128 Advanced Ads
Version 1.7.9.1
Comparing to
See all releases

Code changes from version 1.7.9 to 1.7.9.1

admin/includes/class-overview-widgets.php CHANGED
@@ -66,6 +66,8 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
66
  array('Advanced_Ads_Overview_Widgets_Callbacks', 'render_add_on_slider'), $screen->id, 'side', 'high');
67
  // add_meta_box('advads_overview_addon_sellingads', __( 'Selling Ads', 'advanced-ads' ),
68
  // array('Advanced_Ads_Overview_Widgets_Callbacks', 'render_add_on_sellingads'), $screen->id, 'side', 'high');
 
 
69
  }
70
 
71
  /**
66
  array('Advanced_Ads_Overview_Widgets_Callbacks', 'render_add_on_slider'), $screen->id, 'side', 'high');
67
  // add_meta_box('advads_overview_addon_sellingads', __( 'Selling Ads', 'advanced-ads' ),
68
  // array('Advanced_Ads_Overview_Widgets_Callbacks', 'render_add_on_sellingads'), $screen->id, 'side', 'high');
69
+
70
+ do_action( 'advanced-ads-overview-widgets-after', $screen );
71
  }
72
 
73
  /**
advanced-ads.php CHANGED
@@ -12,7 +12,7 @@
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
- * Version: 1.7.9
16
  * Author: Thomas Maier
17
  * Author URI: http://webgilde.com
18
  * Text Domain: advanced-ads
@@ -39,7 +39,7 @@ define( 'ADVADS_BASE_DIR', dirname( ADVADS_BASE ) ); // directory of the plugin
39
  // general and global slug, e.g. to store options in WP, textdomain
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
- define( 'ADVADS_VERSION', '1.7.9' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
+ * Version: 1.7.9.1
16
  * Author: Thomas Maier
17
  * Author URI: http://webgilde.com
18
  * Text Domain: advanced-ads
39
  // general and global slug, e.g. to store options in WP, textdomain
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
+ define( 'ADVADS_VERSION', '1.7.9.1' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
classes/frontend_checks.php CHANGED
@@ -18,8 +18,8 @@ class Advanced_Ads_Frontend_Checks {
18
  && current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads' ) )
19
  ) {
20
  add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 1000 );
21
- add_filter( 'the_content', array( $this, 'set_did_the_content' ), 101 );
22
- add_filter( 'wp_footer', array( $this, 'check_adblocker' ) );
23
  }
24
  }
25
 
@@ -63,20 +63,21 @@ class Advanced_Ads_Frontend_Checks {
63
  )
64
  ) );
65
 
66
- if ( ! $this->did_the_content ) {
67
- $wp_admin_bar->add_node( array(
68
- 'parent' => 'advanced_ads_ad_health',
69
- 'id' => 'advanced_ads_ad_health_the_content_not_invoked',
70
- 'title' => sprintf( __( '<em>%s</em> filter does not exist', 'advanced-ads' ), 'the_content' ),
71
- 'href' => 'https://wpadvancedads.com/manual/ads-not-showing-up/#frontend-issues-the-content-filter',
72
- 'meta' => array(
73
- 'target' => '_blank'
74
- )
75
- ) );
76
- $display_fine = false;
77
- }
78
-
79
  if ( $wp_the_query->is_singular() ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  if ( ! empty( $post->ID ) ) {
81
  $ad_settings = get_post_meta( $post->ID, '_advads_ad_settings', true );
82
 
@@ -160,7 +161,6 @@ class Advanced_Ads_Frontend_Checks {
160
 
161
  /**
162
  * Set variable to 'true' when 'the_content' filter is invoked.
163
- * If not invoked, jQuery will not be checked.
164
  *
165
  * @param string $content
166
  * @return string $content
@@ -168,7 +168,6 @@ class Advanced_Ads_Frontend_Checks {
168
  public function set_did_the_content( $content ) {
169
  if ( ! $this->did_the_content ) {
170
  $this->did_the_content = true;
171
- $content = '<!--noptimize--><script>var advanced_ads_head_jQuery = typeof jQuery !== "undefined";</script><!--/noptimize-->' . $content;
172
  }
173
  return $content;
174
  }
@@ -181,6 +180,8 @@ class Advanced_Ads_Frontend_Checks {
181
  <script type="text/javascript" src="<?php echo ADVADS_BASE_URL . 'admin/assets/js/advertisement.js' ?>"></script>
182
  <script>
183
  (function(d, w) {
 
 
184
  var addEvent = function( obj, type, fn ) {
185
  if ( obj.addEventListener )
186
  obj.addEventListener( type, fn, false );
@@ -200,7 +201,7 @@ class Advanced_Ads_Frontend_Checks {
200
  hide_fine = true;
201
  }
202
 
203
- if ( jQuery_item && typeof advanced_ads_head_jQuery !== 'undefined' && ! advanced_ads_head_jQuery ) {
204
  // show hidden item
205
  jQuery_item.className = jQuery_item.className.replace( /hidden/, '' );
206
  hide_fine = true;
18
  && current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads' ) )
19
  ) {
20
  add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 1000 );
21
+ add_filter( 'the_content', array( $this, 'set_did_the_content' ) );
22
+ add_filter( 'wp_footer', array( $this, 'check_adblocker' ), -101 );
23
  }
24
  }
25
 
63
  )
64
  ) );
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  if ( $wp_the_query->is_singular() ) {
67
+
68
+ if ( ! $this->did_the_content ) {
69
+ $wp_admin_bar->add_node( array(
70
+ 'parent' => 'advanced_ads_ad_health',
71
+ 'id' => 'advanced_ads_ad_health_the_content_not_invoked',
72
+ 'title' => sprintf( __( '<em>%s</em> filter does not exist', 'advanced-ads' ), 'the_content' ),
73
+ 'href' => 'https://wpadvancedads.com/manual/ads-not-showing-up/#frontend-issues-the-content-filter',
74
+ 'meta' => array(
75
+ 'target' => '_blank'
76
+ )
77
+ ) );
78
+ $display_fine = false;
79
+ }
80
+
81
  if ( ! empty( $post->ID ) ) {
82
  $ad_settings = get_post_meta( $post->ID, '_advads_ad_settings', true );
83
 
161
 
162
  /**
163
  * Set variable to 'true' when 'the_content' filter is invoked.
 
164
  *
165
  * @param string $content
166
  * @return string $content
168
  public function set_did_the_content( $content ) {
169
  if ( ! $this->did_the_content ) {
170
  $this->did_the_content = true;
 
171
  }
172
  return $content;
173
  }
180
  <script type="text/javascript" src="<?php echo ADVADS_BASE_URL . 'admin/assets/js/advertisement.js' ?>"></script>
181
  <script>
182
  (function(d, w) {
183
+ var not_head_jQuery = typeof jQuery === 'undefined';
184
+
185
  var addEvent = function( obj, type, fn ) {
186
  if ( obj.addEventListener )
187
  obj.addEventListener( type, fn, false );
201
  hide_fine = true;
202
  }
203
 
204
+ if ( jQuery_item && not_head_jQuery ) {
205
  // show hidden item
206
  jQuery_item.className = jQuery_item.className.replace( /hidden/, '' );
207
  hide_fine = true;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id
4
  Tags: ads, ad, ad inserter, ad injection, ad manager, ads manager, ad widget, adrotate, adsense, advertise, advertisements, advertising, adverts, advert, amazon, banner, banners, buysellads, chitika, clickbank, dfp, doubleclick, geotarget, geolocation, geo location, google dfp, monetization, widget
5
  Requires at least: WP 4.2, PHP 5.3
6
  Tested up to: 4.6.1
7
- Stable tag: 1.7.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -113,7 +113,7 @@ You can also use it to insert additional ad network tags into header or footer o
113
 
114
  * switch sizes of an ad
115
  * switch between normal and responsive ads
116
- * automatic limit to 3 AdSense banners according to AdSense terms of service (can be disabled)
117
  * hide AdSense advertisements on 404 pages by default (to comply with AdSense terms)
118
  * insert Page-Level ads code globally
119
  * assistant for exact sizes of responsive ads with the [Responsive add-on](https://wpadvancedads.com/add-ons/responsive-ads/)
@@ -206,6 +206,11 @@ There is no revenue share. Advanced Ads doesn’t alter your ad codes in a way t
206
 
207
  == Changelog ==
208
 
 
 
 
 
 
209
  = 1.7.9 =
210
 
211
  * added frontend error checks to the admin bar
4
  Tags: ads, ad, ad inserter, ad injection, ad manager, ads manager, ad widget, adrotate, adsense, advertise, advertisements, advertising, adverts, advert, amazon, banner, banners, buysellads, chitika, clickbank, dfp, doubleclick, geotarget, geolocation, geo location, google dfp, monetization, widget
5
  Requires at least: WP 4.2, PHP 5.3
6
  Tested up to: 4.6.1
7
+ Stable tag: 1.7.9.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
113
 
114
  * switch sizes of an ad
115
  * switch between normal and responsive ads
116
+ * optional limit to 3 AdSense banners according to AdSense terms of service
117
  * hide AdSense advertisements on 404 pages by default (to comply with AdSense terms)
118
  * insert Page-Level ads code globally
119
  * assistant for exact sizes of responsive ads with the [Responsive add-on](https://wpadvancedads.com/add-ons/responsive-ads/)
206
 
207
  == Changelog ==
208
 
209
+ = 1.7.9.1 =
210
+
211
+ * removed the `the_content` check from non-singular pages
212
+ * moved ad blocker check into footer
213
+
214
  = 1.7.9 =
215
 
216
  * added frontend error checks to the admin bar