Advanced Ads - Version 1.8.9

Version Description

  • added option to disable AdSense-related Ad-Health warnings
  • fixed search for terms with numbers in them
  • added check for hidden AdSense units
  • added warning that AdSense InFeed and InArticle ads cant be aligned left or right
Download this release

Release Info

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

Code changes from version 1.8.8 to 1.8.9

admin/includes/class-overview-widgets.php CHANGED
@@ -122,6 +122,10 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
122
  _e( 'support for cached sites', 'advanced-ads' );
123
  if( $caching_used ) : ?></strong><?php endif;
124
  ?></li>
 
 
 
 
125
  <li><?php _e( '11 more display and visitor conditions', 'advanced-ads' ); ?></li>
126
  <li><?php _e( '6 more placements', 'advanced-ads' ); ?></li>
127
  <li><?php _e( 'placement tests for ad optimization', 'advanced-ads' ); ?></li>
@@ -130,14 +134,6 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
130
  $pro_content = ob_get_clean();
131
 
132
  $add_ons = array(
133
- 'bundle' => array(
134
- 'title' => 'Pro Bundle',
135
- 'desc' => __( 'Our best deal with all current and future add-ons included.', 'advanced-ads' ),
136
- 'link' => ADVADS_URL . 'add-ons/bundle-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
137
- 'link_title' => __( 'Get the Bundle', 'advanced-ads' ),
138
- 'link_primary' => true,
139
- 'order' => 0,
140
- ),
141
  'tracking' => array(
142
  'title' => 'Tracking',
143
  'desc' => __( 'Analyze clicks and impressions of your ads locally or in Google Analytics, share reports, and limit ads to a specific number of impressions or clicks.', 'advanced-ads' ),
@@ -154,7 +150,8 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
154
  'title' => 'Advanced Ads Pro',
155
  'desc' => $pro_content,
156
  'link' => ADVADS_URL . 'add-ons/advanced-ads-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
157
- 'order' => 4,
 
158
  ),
159
  'selling' => array(
160
  'title' => 'Selling Ads',
@@ -198,6 +195,7 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
198
 
199
  // get all installed plugins; installed is not activated
200
  $installed_plugins = get_plugins();
 
201
 
202
  // handle Code Highlighter if already installed or not activated
203
  if( isset( $installed_plugins['advanced-ads-code-highlighter/advanced-ads-code-highlighter.php'] ) && ! class_exists( 'Advanced_Ads_Code_Highlighter') ){ // is installed, but not active
@@ -212,79 +210,94 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
212
  if( isset( $installed_plugins['advanced-ads-pro/advanced-ads-pro.php'] ) && ! class_exists( 'Advanced_Ads_Pro') ){ // is installed, but not active
213
  $add_ons['pro']['link'] = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=advanced-ads-pro/advanced-ads-pro.php&amp', 'activate-plugin_advanced-ads-pro/advanced-ads-pro.php' );
214
  $add_ons['pro']['link_title'] = __( 'Activate now', 'advanced-ads' );
 
215
  } elseif( class_exists( 'Advanced_Ads_Pro') ) {
216
  $add_ons['pro']['link'] = ADVADS_URL . 'add-ons/advanced-ads-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
217
  $add_ons['pro']['desc'] = '';
218
  $add_ons['pro']['installed'] = true;
219
  $add_ons['pro']['order'] = 20;
 
220
  } elseif( $caching_used ) {
221
- $add_ons['pro']['class'] = 'recommended';
 
222
  }
223
 
224
  // TRACKING
225
  if( isset( $installed_plugins['advanced-ads-tracking/tracking.php'] ) && ! class_exists( 'Advanced_Ads_Tracking_Plugin') ){ // is installed, but not active
226
  $add_ons['tracking']['link'] = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=advanced-ads-tracking/tracking.php&amp', 'activate-plugin_advanced-ads-tracking/tracking.php' );
227
  $add_ons['tracking']['link_title'] = __( 'Activate now', 'advanced-ads' );
 
228
  } elseif( class_exists( 'Advanced_Ads_Tracking_Plugin') ) {
229
  $add_ons['tracking']['link'] = ADVADS_URL . 'add-ons/tracking/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
230
  $add_ons['tracking']['desc'] = '<a href="' . admin_url( '/admin.php?page=advanced-ads-stats' ) . '">' . __('Visit your ad stats', 'advanced-ads') . '</a>';
231
  $add_ons['tracking']['installed'] = true;
232
  $add_ons['tracking']['order'] = 20;
 
233
  }
234
 
235
  // RESPONSIVE
236
  if( isset( $installed_plugins['advanced-ads-responsive/responsive-ads.php'] ) && ! class_exists( 'Advanced_Ads_Responsive_Plugin') ){ // is installed, but not active
237
  $add_ons['responsive']['link'] = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=advanced-ads-responsive/responsive-ads.php&amp', 'activate-plugin_advanced-ads-responsive/responsive-ads.php' );
238
  $add_ons['responsive']['link_title'] = __( 'Activate now', 'advanced-ads' );
 
239
  } elseif( class_exists( 'Advanced_Ads_Responsive_Plugin') ) {
240
  $add_ons['responsive']['link'] = ADVADS_URL . 'add-ons/responsive-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
241
  $add_ons['responsive']['desc'] = '<a href="' . admin_url( 'admin.php?page=responsive-ads-list' ) . '">' . __('List of responsive ads by browser width', 'advanced-ads-responsive') . '</a>';
242
  $add_ons['responsive']['installed'] = true;
243
  $add_ons['responsive']['order'] = 20;
 
244
  }
245
 
246
  // STICKY
247
  if( isset( $installed_plugins['advanced-ads-sticky-ads/sticky-ads.php'] ) && ! class_exists( 'Advanced_Ads_Sticky_Plugin') ){ // is installed, but not active
248
  $add_ons['sticky']['link'] = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=advanced-ads-sticky-ads/sticky-ads.php&amp', 'activate-plugin_advanced-ads-sticky-ads/sticky-ads.php' );
249
  $add_ons['sticky']['link_title'] = __( 'Activate now', 'advanced-ads' );
 
250
  } elseif( class_exists( 'Advanced_Ads_Sticky_Plugin') ) {
251
  $add_ons['sticky']['link'] = ADVADS_URL . 'add-ons/sticky-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
252
  $add_ons['sticky']['desc'] = '';
253
  $add_ons['sticky']['installed'] = true;
254
  $add_ons['sticky']['order'] = 20;
 
255
  }
256
 
257
  // LAYER
258
  if( isset( $installed_plugins['advanced-ads-layer/layer-ads.php'] ) && ! class_exists( 'Advanced_Ads_Layer_Plugin') ){ // is installed, but not active
259
  $add_ons['layer']['link'] = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=advanced-ads-layer/layer-ads.php&amp', 'activate-plugin_advanced-ads-layer/layer-ads.php' );
260
  $add_ons['layer']['link_title'] = __( 'Activate now', 'advanced-ads' );
 
261
  } elseif( class_exists( 'Advanced_Ads_Layer_Plugin') ) {
262
  $add_ons['layer']['link'] = ADVADS_URL . 'add-ons/popup-and-layer-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
263
  $add_ons['layer']['desc'] = '';
264
  $add_ons['layer']['installed'] = true;
265
  $add_ons['layer']['order'] = 20;
 
266
  }
267
 
268
  // SELLING ADS
269
  if( isset( $installed_plugins['advanced-ads-selling/advanced-ads-selling.php'] ) && ! class_exists( 'Advanced_Ads_Selling_Plugin') ){ // is installed, but not active
270
  $add_ons['selling']['link'] = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=advanced-ads-selling/advanced-ads-selling.php&amp', 'activate-plugin_advanced-ads-selling/advanced-ads-selling.php' );
271
  $add_ons['selling']['link_title'] = __( 'Activate now', 'advanced-ads' );
 
272
  } elseif( class_exists( 'Advanced_Ads_Selling_Plugin') ) {
273
  $add_ons['selling']['link'] = ADVADS_URL . 'add-ons/selling-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
274
  $add_ons['selling']['desc'] = '';
275
  $add_ons['selling']['installed'] = true;
276
  $add_ons['selling']['order'] = 20;
 
277
  }
278
 
279
  // GEO TARGETING
280
  if( isset( $installed_plugins['advanced-ads-geo/advanced-ads-geo.php'] ) && ! class_exists( 'Advanced_Ads_Geo_Plugin') ){ // is installed, but not active
281
  $add_ons['geo']['link'] = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=advanced-ads-geo/advanced-ads-geo.php&amp', 'activate-plugin_advanced-ads-geo/advanced-ads-geo.php' );
282
  $add_ons['geo']['link_title'] = __( 'Activate now', 'advanced-ads' );
 
283
  } elseif( class_exists( 'Advanced_Ads_Geo_Plugin') ) {
284
  $add_ons['geo']['link'] = ADVADS_URL . 'add-ons/geo-targeting/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
285
  $add_ons['geo']['desc'] = '';
286
  $add_ons['geo']['installed'] = true;
287
  $add_ons['geo']['order'] = 20;
 
288
  }
289
 
290
  // SLIDER
@@ -336,6 +349,18 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
336
  }
337
  }
338
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  // allow add-ons to manipulate the output
340
  $add_ons = apply_filters( 'advanced-ads-overview-add-ons', $add_ons );
341
 
122
  _e( 'support for cached sites', 'advanced-ads' );
123
  if( $caching_used ) : ?></strong><?php endif;
124
  ?></li>
125
+ <?php if ( class_exists( 'bbPress', false ) ) : ?><li><?php printf( __( 'integrates with <strong>%s</strong>', 'advanced-ads' ), 'bbPress' ); ?></li><?php endif; /* bbPress */ ?>
126
+ <?php if ( class_exists( 'BuddyPress', false ) ) : ?><li><?php printf( __( 'integrates with <strong>%s</strong>', 'advanced-ads' ), 'BuddyPress' ); ?></li><?php endif; /* BuddyPress */ ?>
127
+ <?php if ( defined( 'PMPRO_VERSION' ) ) : ?><li><?php printf( __( 'integrates with <strong>%s</strong>', 'advanced-ads' ), 'Paid Memberships Pro' ); ?></li><?php endif; /* Paid Memberships Pro */ ?>
128
+ <?php if ( defined( 'ICL_SITEPRESS_VERSION' ) ) : ?><li><?php printf( __( 'integrates with <strong>%s</strong>', 'advanced-ads' ), 'WPML' ); ?></li><?php endif; /* WPML */ ?>
129
  <li><?php _e( '11 more display and visitor conditions', 'advanced-ads' ); ?></li>
130
  <li><?php _e( '6 more placements', 'advanced-ads' ); ?></li>
131
  <li><?php _e( 'placement tests for ad optimization', 'advanced-ads' ); ?></li>
134
  $pro_content = ob_get_clean();
135
 
136
  $add_ons = array(
 
 
 
 
 
 
 
 
137
  'tracking' => array(
138
  'title' => 'Tracking',
139
  'desc' => __( 'Analyze clicks and impressions of your ads locally or in Google Analytics, share reports, and limit ads to a specific number of impressions or clicks.', 'advanced-ads' ),
150
  'title' => 'Advanced Ads Pro',
151
  'desc' => $pro_content,
152
  'link' => ADVADS_URL . 'add-ons/advanced-ads-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
153
+ 'order' => 4,
154
+ 'class' => 'recommended'
155
  ),
156
  'selling' => array(
157
  'title' => 'Selling Ads',
195
 
196
  // get all installed plugins; installed is not activated
197
  $installed_plugins = get_plugins();
198
+ $installed_pro_plugins = 0;
199
 
200
  // handle Code Highlighter if already installed or not activated
201
  if( isset( $installed_plugins['advanced-ads-code-highlighter/advanced-ads-code-highlighter.php'] ) && ! class_exists( 'Advanced_Ads_Code_Highlighter') ){ // is installed, but not active
210
  if( isset( $installed_plugins['advanced-ads-pro/advanced-ads-pro.php'] ) && ! class_exists( 'Advanced_Ads_Pro') ){ // is installed, but not active
211
  $add_ons['pro']['link'] = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=advanced-ads-pro/advanced-ads-pro.php&amp', 'activate-plugin_advanced-ads-pro/advanced-ads-pro.php' );
212
  $add_ons['pro']['link_title'] = __( 'Activate now', 'advanced-ads' );
213
+ $installed_pro_plugins++;
214
  } elseif( class_exists( 'Advanced_Ads_Pro') ) {
215
  $add_ons['pro']['link'] = ADVADS_URL . 'add-ons/advanced-ads-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
216
  $add_ons['pro']['desc'] = '';
217
  $add_ons['pro']['installed'] = true;
218
  $add_ons['pro']['order'] = 20;
219
+ $installed_pro_plugins++;
220
  } elseif( $caching_used ) {
221
+ // for now, "recommended" is always set for this plugin since there are so many advantages
222
+ // $add_ons['pro']['class'] = 'recommended';
223
  }
224
 
225
  // TRACKING
226
  if( isset( $installed_plugins['advanced-ads-tracking/tracking.php'] ) && ! class_exists( 'Advanced_Ads_Tracking_Plugin') ){ // is installed, but not active
227
  $add_ons['tracking']['link'] = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=advanced-ads-tracking/tracking.php&amp', 'activate-plugin_advanced-ads-tracking/tracking.php' );
228
  $add_ons['tracking']['link_title'] = __( 'Activate now', 'advanced-ads' );
229
+ $installed_pro_plugins++;
230
  } elseif( class_exists( 'Advanced_Ads_Tracking_Plugin') ) {
231
  $add_ons['tracking']['link'] = ADVADS_URL . 'add-ons/tracking/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
232
  $add_ons['tracking']['desc'] = '<a href="' . admin_url( '/admin.php?page=advanced-ads-stats' ) . '">' . __('Visit your ad stats', 'advanced-ads') . '</a>';
233
  $add_ons['tracking']['installed'] = true;
234
  $add_ons['tracking']['order'] = 20;
235
+ $installed_pro_plugins++;
236
  }
237
 
238
  // RESPONSIVE
239
  if( isset( $installed_plugins['advanced-ads-responsive/responsive-ads.php'] ) && ! class_exists( 'Advanced_Ads_Responsive_Plugin') ){ // is installed, but not active
240
  $add_ons['responsive']['link'] = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=advanced-ads-responsive/responsive-ads.php&amp', 'activate-plugin_advanced-ads-responsive/responsive-ads.php' );
241
  $add_ons['responsive']['link_title'] = __( 'Activate now', 'advanced-ads' );
242
+ $installed_pro_plugins++;
243
  } elseif( class_exists( 'Advanced_Ads_Responsive_Plugin') ) {
244
  $add_ons['responsive']['link'] = ADVADS_URL . 'add-ons/responsive-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
245
  $add_ons['responsive']['desc'] = '<a href="' . admin_url( 'admin.php?page=responsive-ads-list' ) . '">' . __('List of responsive ads by browser width', 'advanced-ads-responsive') . '</a>';
246
  $add_ons['responsive']['installed'] = true;
247
  $add_ons['responsive']['order'] = 20;
248
+ $installed_pro_plugins++;
249
  }
250
 
251
  // STICKY
252
  if( isset( $installed_plugins['advanced-ads-sticky-ads/sticky-ads.php'] ) && ! class_exists( 'Advanced_Ads_Sticky_Plugin') ){ // is installed, but not active
253
  $add_ons['sticky']['link'] = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=advanced-ads-sticky-ads/sticky-ads.php&amp', 'activate-plugin_advanced-ads-sticky-ads/sticky-ads.php' );
254
  $add_ons['sticky']['link_title'] = __( 'Activate now', 'advanced-ads' );
255
+ $installed_pro_plugins++;
256
  } elseif( class_exists( 'Advanced_Ads_Sticky_Plugin') ) {
257
  $add_ons['sticky']['link'] = ADVADS_URL . 'add-ons/sticky-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
258
  $add_ons['sticky']['desc'] = '';
259
  $add_ons['sticky']['installed'] = true;
260
  $add_ons['sticky']['order'] = 20;
261
+ $installed_pro_plugins++;
262
  }
263
 
264
  // LAYER
265
  if( isset( $installed_plugins['advanced-ads-layer/layer-ads.php'] ) && ! class_exists( 'Advanced_Ads_Layer_Plugin') ){ // is installed, but not active
266
  $add_ons['layer']['link'] = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=advanced-ads-layer/layer-ads.php&amp', 'activate-plugin_advanced-ads-layer/layer-ads.php' );
267
  $add_ons['layer']['link_title'] = __( 'Activate now', 'advanced-ads' );
268
+ $installed_pro_plugins++;
269
  } elseif( class_exists( 'Advanced_Ads_Layer_Plugin') ) {
270
  $add_ons['layer']['link'] = ADVADS_URL . 'add-ons/popup-and-layer-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
271
  $add_ons['layer']['desc'] = '';
272
  $add_ons['layer']['installed'] = true;
273
  $add_ons['layer']['order'] = 20;
274
+ $installed_pro_plugins++;
275
  }
276
 
277
  // SELLING ADS
278
  if( isset( $installed_plugins['advanced-ads-selling/advanced-ads-selling.php'] ) && ! class_exists( 'Advanced_Ads_Selling_Plugin') ){ // is installed, but not active
279
  $add_ons['selling']['link'] = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=advanced-ads-selling/advanced-ads-selling.php&amp', 'activate-plugin_advanced-ads-selling/advanced-ads-selling.php' );
280
  $add_ons['selling']['link_title'] = __( 'Activate now', 'advanced-ads' );
281
+ $installed_pro_plugins++;
282
  } elseif( class_exists( 'Advanced_Ads_Selling_Plugin') ) {
283
  $add_ons['selling']['link'] = ADVADS_URL . 'add-ons/selling-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
284
  $add_ons['selling']['desc'] = '';
285
  $add_ons['selling']['installed'] = true;
286
  $add_ons['selling']['order'] = 20;
287
+ $installed_pro_plugins++;
288
  }
289
 
290
  // GEO TARGETING
291
  if( isset( $installed_plugins['advanced-ads-geo/advanced-ads-geo.php'] ) && ! class_exists( 'Advanced_Ads_Geo_Plugin') ){ // is installed, but not active
292
  $add_ons['geo']['link'] = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=advanced-ads-geo/advanced-ads-geo.php&amp', 'activate-plugin_advanced-ads-geo/advanced-ads-geo.php' );
293
  $add_ons['geo']['link_title'] = __( 'Activate now', 'advanced-ads' );
294
+ $installed_pro_plugins++;
295
  } elseif( class_exists( 'Advanced_Ads_Geo_Plugin') ) {
296
  $add_ons['geo']['link'] = ADVADS_URL . 'add-ons/geo-targeting/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
297
  $add_ons['geo']['desc'] = '';
298
  $add_ons['geo']['installed'] = true;
299
  $add_ons['geo']['order'] = 20;
300
+ $installed_pro_plugins++;
301
  }
302
 
303
  // SLIDER
349
  }
350
  }
351
 
352
+ // only show Pro Bundle Pitch if less than 2 add-ons exist
353
+ if( $installed_pro_plugins < 2 ){
354
+ $add_ons['bundle'] = array(
355
+ 'title' => 'Pro Bundle',
356
+ 'desc' => __( 'Our best deal with all current and future add-ons included.', 'advanced-ads' ),
357
+ 'link' => ADVADS_URL . 'add-ons/bundle-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
358
+ 'link_title' => __( 'Get the Bundle', 'advanced-ads' ),
359
+ 'link_primary' => true,
360
+ 'order' => 0,
361
+ );
362
+ }
363
+
364
  // allow add-ons to manipulate the output
365
  $add_ons = apply_filters( 'advanced-ads-overview-add-ons', $add_ons );
366
 
admin/views/setting-target.php CHANGED
@@ -1,3 +1,3 @@
1
  <input name="<?php echo ADVADS_SLUG; ?>[target-blank]" type="checkbox" value="1" <?php
2
  checked( 1, $target); ?>/>
3
- <p class="description"><?php _e( 'Choose whether to open programatically created links in the same window (no <code>target="_blank"</code>) or not by default', 'advanced-ads' ); ?></p>
1
  <input name="<?php echo ADVADS_SLUG; ?>[target-blank]" type="checkbox" value="1" <?php
2
  checked( 1, $target); ?>/>
3
+ <p class="description"><?php _e( 'Open programatically created links in a new window (use <code>target="_blank"</code>)', 'advanced-ads' ); ?></p>
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.8.8
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.8.8' );
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.8.9
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.8.9' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
classes/ad_ajax_callbacks.php CHANGED
@@ -143,7 +143,7 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
143
  if ( !isset( $_POST['search'] ) || $_POST['search'] === '' ) { die(); }
144
 
145
  // if search is an id, search for the term id, else do a full text search
146
- if(0 !== absint($_POST['search'])){
147
  $args['include'] = array(absint($_POST['search']));
148
  } else {
149
  $args['search'] = $_POST['search'];
143
  if ( !isset( $_POST['search'] ) || $_POST['search'] === '' ) { die(); }
144
 
145
  // if search is an id, search for the term id, else do a full text search
146
+ if( 0 !== absint($_POST['search'] ) && strlen( $_POST['search'] ) == strlen ( absint($_POST['search'] ) ) ){
147
  $args['include'] = array(absint($_POST['search']));
148
  } else {
149
  $args['search'] = $_POST['search'];
classes/frontend_checks.php CHANGED
@@ -52,6 +52,9 @@ class Advanced_Ads_Frontend_Checks {
52
 
53
  $options = Advanced_Ads_Plugin::get_instance()->options();
54
  $display_fine = true;
 
 
 
55
 
56
  $wp_admin_bar->add_node( array(
57
  'id' => 'advanced_ads_ad_health',
@@ -74,16 +77,18 @@ class Advanced_Ads_Frontend_Checks {
74
 
75
  // check if AdSense loads QuickStart ads
76
  // Hidden, will be shown using js.
77
- $wp_admin_bar->add_node( array(
78
- 'parent' => 'advanced_ads_ad_health',
79
- 'id' => 'advanced_ads_quickstart_displayed',
80
- 'title' => __( 'Random AdSense ads', 'advanced-ads' ),
81
- 'href' => ADVADS_URL . 'adsense-in-random-positions-quickstart/#utm_source=advancedads&utm_medium=link&utm_campaign=frontend-quickstart-ads',
82
- 'meta' => array(
83
- 'class' => 'hidden advanced_ads_ad_health_warning',
84
- 'target' => '_blank'
85
- )
86
- ) );
 
 
87
 
88
  // check if an ad blocker is enabled
89
  // Hidden, will be shown using js.
@@ -215,6 +220,24 @@ class Advanced_Ads_Frontend_Checks {
215
  )
216
  ) );
217
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  $display_fine = apply_filters( 'advanced-ads-ad-health-display-fine', $display_fine );
219
 
220
  if ( $display_fine ) {
@@ -267,8 +290,9 @@ class Advanced_Ads_Frontend_Checks {
267
  * jQuery is included in header
268
  * AdSense Quick Start ads are running
269
  */
270
- public function footer_checks() { ?>
271
- <!--noptimize--><style>.hidden { display: none; } .advads-adminbar-is-warnings { background: #a54811 ! important; color: #fff !important; }
 
272
  #wp-admin-bar-advanced_ads_ad_health-default a:after { content: "\25BA"; margin-left: .5em; font-size: smaller; }
273
  .advanced-ads-highlight-ads { outline:4px solid blue !important; }</style>
274
  <script type="text/javascript" src="<?php echo ADVADS_BASE_URL . 'admin/assets/js/advertisement.js' ?>"></script>
@@ -341,29 +365,56 @@ class Advanced_Ads_Frontend_Checks {
341
 
342
  advanced_ads_frontend_checks.showCount();
343
  });
344
-
345
- // highlight AdSense QuickStart ads 3 seconds after site loaded
346
- setTimeout(function(){ advads_highlight_adsense_quickstart(); }, 3000);
347
- function advads_highlight_adsense_quickstart(){
348
- if ( ! window.jQuery ) {
349
- window.console && window.console.log( 'Advanced Ads: jQuery not found. Some Ad Health warnings will not be shown' );
350
- return;
351
- }
352
- var quickstart_ads = jQuery(document).find('.google-auto-placed');
353
- jQuery( '<p class="advads-quickstart-hint" style="background-color:#0085ba;color:#fff;font-size:0.8em;padding:5px;"><?php
354
- printf(__( 'This ads was automatically placed here by AdSense. <a href="%s" target="_blank" style="color:#fff;border-color:#fff;">Click here to learn more</a>.', 'advanced-ads' ), ADVADS_URL . 'adsense-in-random-positions/#utm_source=advanced-ads&utm_medium=link&utm_campaign=frontend-quickstart-ads' );
355
- ?></p>' ).prependTo( quickstart_ads );
356
- // show quickstart warning in Adhealth Bar if relevant
357
- if( quickstart_ads.length ){
358
- var advads_quickstart_link = document.querySelector( '#wp-admin-bar-advanced_ads_quickstart_displayed.hidden' );
359
- console.log( advads_quickstart_link );
360
- if ( advads_quickstart_link ) {
361
- advads_quickstart_link.className = advads_quickstart_link.className.replace( 'hidden', '' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
362
  }
363
- advanced_ads_frontend_checks.showCount();
364
- }
365
 
366
- }
 
367
  })(document, window);
368
  </script><!--/noptimize-->
369
  <?php
52
 
53
  $options = Advanced_Ads_Plugin::get_instance()->options();
54
  $display_fine = true;
55
+
56
+ // load AdSense related options
57
+ $adsense_options = Advanced_Ads_AdSense_Data::get_instance()->get_options();
58
 
59
  $wp_admin_bar->add_node( array(
60
  'id' => 'advanced_ads_ad_health',
77
 
78
  // check if AdSense loads QuickStart ads
79
  // Hidden, will be shown using js.
80
+ if( ! isset( $adsense_options['violation-warnings-disable'] ) ) {
81
+ $wp_admin_bar->add_node( array(
82
+ 'parent' => 'advanced_ads_ad_health',
83
+ 'id' => 'advanced_ads_quickstart_displayed',
84
+ 'title' => __( 'Random AdSense ads', 'advanced-ads' ),
85
+ 'href' => ADVADS_URL . 'adsense-in-random-positions-quickstart/#utm_source=advancedads&utm_medium=link&utm_campaign=frontend-quickstart-ads',
86
+ 'meta' => array(
87
+ 'class' => 'hidden advanced_ads_ad_health_warning',
88
+ 'target' => '_blank'
89
+ )
90
+ ) );
91
+ }
92
 
93
  // check if an ad blocker is enabled
94
  // Hidden, will be shown using js.
220
  )
221
  ) );
222
 
223
+ // warn if an AdSense ad seems to be hidden
224
+ if( ! isset( $adsense_options['violation-warnings-disable'] ) ) {
225
+ $wp_admin_bar->add_node( array(
226
+ 'parent' => 'advanced_ads_ad_health',
227
+ 'id' => 'advanced_ads_ad_health_hidden_adsense',
228
+ 'title' => sprintf( '%s: %s. %s',
229
+ __( 'AdSense violation', 'advanced-ads' ),
230
+ __( 'Ad is hidden', 'advanced-ads' ),
231
+ sprintf( __( 'IDs: %s', 'advanced-ads' ), '<i></i>' )
232
+ ),
233
+ 'href' => 'https://wpadvancedads.com/manual/ad-health/#adsense-hidden&utm_source=advanced-ads&utm_medium=link&utm_campaign=frontend-adsense-hidden',
234
+ 'meta' => array(
235
+ 'class' => 'hidden advanced_ads_ad_health_warning advanced_ads_ad_health_hidden_adsense',
236
+ 'target' => '_blank'
237
+ )
238
+ ) );
239
+ }
240
+
241
  $display_fine = apply_filters( 'advanced-ads-ad-health-display-fine', $display_fine );
242
 
243
  if ( $display_fine ) {
290
  * jQuery is included in header
291
  * AdSense Quick Start ads are running
292
  */
293
+ public function footer_checks() {
294
+ $adsense_options = Advanced_Ads_AdSense_Data::get_instance()->get_options();
295
+ ?><!--noptimize--><style>.hidden { display: none; } .advads-adminbar-is-warnings { background: #a54811 ! important; color: #fff !important; }
296
  #wp-admin-bar-advanced_ads_ad_health-default a:after { content: "\25BA"; margin-left: .5em; font-size: smaller; }
297
  .advanced-ads-highlight-ads { outline:4px solid blue !important; }</style>
298
  <script type="text/javascript" src="<?php echo ADVADS_BASE_URL . 'admin/assets/js/advertisement.js' ?>"></script>
365
 
366
  advanced_ads_frontend_checks.showCount();
367
  });
368
+
369
+ <?php if( ! isset( $adsense_options['violation-warnings-disable'] ) ) : ?>
370
+ // show warning if AdSense ad is hidden
371
+ addEvent( w, 'load', function() {
372
+ window.jQuery && jQuery( document ).ready( function() {
373
+ var advads_ad_health_check_adsense_hidden_ids = [];
374
+ jQuery('ins.adsbygoogle').each( function(){
375
+ if( ! jQuery( this ).parent().is(':visible') ){
376
+ advads_ad_health_check_adsense_hidden_ids.push( this.dataset.adSlot );
377
+ }
378
+ });
379
+ if( advads_ad_health_check_adsense_hidden_ids.length ){
380
+ var advads_has_hidden_adsense_link = document.querySelector( '.advanced_ads_ad_health_hidden_adsense' );
381
+ if ( advads_has_hidden_adsense_link ) {
382
+ advads_has_hidden_adsense_link.className = advads_has_hidden_adsense_link.className.replace( 'hidden', '' );
383
+ advads_has_hidden_adsense_link.innerHTML = advads_has_hidden_adsense_link.innerHTML.replace( /(<i>)(.*?)(<\/i>)/, function( match, p1, p2, p3 ) {
384
+ var ad_id = advads_ad_health_check_adsense_hidden_ids.join( ', ');
385
+ p2 = ( p2 ) ? p2.split( ', ' ) : [];
386
+ if ( p2.indexOf( ad_id ) === -1 ) p2.push( ad_id );
387
+ return p1 + p2.join( ', ' ) + p3;
388
+ } );
389
+ advanced_ads_frontend_checks.showCount();
390
+ }
391
+ }
392
+ });
393
+ });
394
+
395
+ // highlight AdSense QuickStart ads 3 seconds after site loaded
396
+ setTimeout(function(){ advads_highlight_adsense_quickstart(); }, 3000);
397
+ function advads_highlight_adsense_quickstart(){
398
+ if ( ! window.jQuery ) {
399
+ window.console && window.console.log( 'Advanced Ads: jQuery not found. Some Ad Health warnings will not be shown' );
400
+ return;
401
+ }
402
+ var quickstart_ads = jQuery(document).find('.google-auto-placed');
403
+ jQuery( '<p class="advads-quickstart-hint" style="background-color:#0085ba;color:#fff;font-size:0.8em;padding:5px;"><?php
404
+ printf(__( 'This ads was automatically placed here by AdSense. <a href="%s" target="_blank" style="color:#fff;border-color:#fff;">Click here to learn more</a>.', 'advanced-ads' ), ADVADS_URL . 'adsense-in-random-positions/#utm_source=advanced-ads&utm_medium=link&utm_campaign=frontend-quickstart-ads' );
405
+ ?></p>' ).prependTo( quickstart_ads );
406
+ // show quickstart warning in Adhealth Bar if relevant
407
+ if( quickstart_ads.length ){
408
+ var advads_quickstart_link = document.querySelector( '#wp-admin-bar-advanced_ads_quickstart_displayed.hidden' );
409
+ console.log( advads_quickstart_link );
410
+ if ( advads_quickstart_link ) {
411
+ advads_quickstart_link.className = advads_quickstart_link.className.replace( 'hidden', '' );
412
+ }
413
+ advanced_ads_frontend_checks.showCount();
414
  }
 
 
415
 
416
+ }
417
+ <?php endif; ?>
418
  })(document, window);
419
  </script><!--/noptimize-->
420
  <?php
modules/gadsense/admin/admin.php CHANGED
@@ -152,6 +152,15 @@ class Advanced_Ads_AdSense_Admin {
152
  $hook,
153
  'advanced_ads_adsense_setting_section'
154
  );
 
 
 
 
 
 
 
 
 
155
 
156
  // hook for additional settings from add-ons
157
  do_action( 'advanced-ads-adsense-settings-init', $hook );
@@ -220,6 +229,20 @@ class Advanced_Ads_AdSense_Admin {
220
  <p class="description"><?php printf(__( 'Please notice that this code might also activate QuickStart ads. Please read <a href="%s" target="_blank">this article</a> if <strong>ads appear in random places</strong>.', 'advanced-ads' ), ADVADS_URL . 'adsense-in-random-positions-quickstart/#utm_source=advanced-ads&utm_medium=link&utm_campaign=backend-quickstart-ads' ); ?></p><?php
221
  }
222
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  /**
224
  * sanitize adsense settings
225
  *
152
  $hook,
153
  'advanced_ads_adsense_setting_section'
154
  );
155
+
156
+ // disable AdSense violation warnings
157
+ add_settings_field(
158
+ 'adsense-warnings-disable',
159
+ __( 'Disable violation warnings', 'advanced-ads' ),
160
+ array($this, 'render_settings_adsense_warnings_disable'),
161
+ $hook,
162
+ 'advanced_ads_adsense_setting_section'
163
+ );
164
 
165
  // hook for additional settings from add-ons
166
  do_action( 'advanced-ads-adsense-settings-init', $hook );
229
  <p class="description"><?php printf(__( 'Please notice that this code might also activate QuickStart ads. Please read <a href="%s" target="_blank">this article</a> if <strong>ads appear in random places</strong>.', 'advanced-ads' ), ADVADS_URL . 'adsense-in-random-positions-quickstart/#utm_source=advanced-ads&utm_medium=link&utm_campaign=backend-quickstart-ads' ); ?></p><?php
230
  }
231
 
232
+ /**
233
+ * render AdSense violation warnings setting
234
+ *
235
+ * @since 1.6.9
236
+ */
237
+ public function render_settings_adsense_warnings_disable(){
238
+ $options = $this->data->get_options();
239
+ $disable_violation_warnings = isset( $options['violation-warnings-disable'] ) ? 1 : 0;
240
+
241
+ ?><label><input type="checkbox" name="<?php echo GADSENSE_OPT_NAME; ?>[violation-warnings-disable]" value="1" <?php checked( 1, $disable_violation_warnings ); ?> />
242
+ <?php _e( 'Disable warnings about potential violations of the AdSense terms.', 'advanced-ads' ); ?></label>
243
+ <p class="description"><?php printf(__( 'Our <a href="%s" target="_blank">Ad Health</a> feature monitors if AdSense is implemented correctly on your site. It also considers ads not managed with Advanced Ads. Enable this option to remove these checks', 'advanced-ads' ), ADVADS_URL . 'adsense-in-random-positions-quickstart/#utm_source=advanced-ads&utm_medium=link&utm_campaign=backend-quickstart-ads' ); ?></p><?php
244
+ }
245
+
246
  /**
247
  * sanitize adsense settings
248
  *
modules/gadsense/admin/assets/js/new-ad.js CHANGED
@@ -237,7 +237,7 @@
237
 
238
  // show / hide position warning
239
  var position = $( '#advanced-ad-output-position input[name="advanced_ad[output][position]"]:checked' ).val();
240
- if ('responsive' == type && ( 'left' == position || 'right' == position ) ){
241
  $('#ad-parameters-box-notices .advads-ad-notice-responsive-position').show();
242
  } else {
243
  $('#ad-parameters-box-notices .advads-ad-notice-responsive-position').hide();
237
 
238
  // show / hide position warning
239
  var position = $( '#advanced-ad-output-position input[name="advanced_ad[output][position]"]:checked' ).val();
240
+ if ( -1 !== ['responsive', 'in-article', 'in-feed' ].indexOf( type ) && ( 'left' == position || 'right' == position ) ){
241
  $('#ad-parameters-box-notices .advads-ad-notice-responsive-position').show();
242
  } else {
243
  $('#ad-parameters-box-notices .advads-ad-notice-responsive-position').hide();
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: ads, ad, ad inserter, ad injection, ad manager, ads manager, ad widget, ad
5
  Requires at least: 4.6
6
  Tested up to: 4.8
7
  Requires PHP: 5.2
8
- Stable tag: 1.8.8
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -18,6 +18,7 @@ Are you looking for an ad manager plugin? These are the top arguments to use Adv
18
  * most features to test and optimize ads
19
  * unlimited ad units
20
  * works with all ad types and networks
 
21
  * [best rated](https://wordpress.org/support/plugin/advanced-ads/reviews/?filter=5) and free email support
22
 
23
  I built Advanced Ads based on my experience delivering millions of ads per month.
@@ -100,6 +101,7 @@ Placements to insert ads in pre-defined positions in your theme and content. [Li
100
  * optional limit to 3 AdSense banners
101
  * hide AdSense advertisements on 404 pages by default (to comply with AdSense terms)
102
  * insert AdSense verification, Page-Level ads and QuickStart code
 
103
  * assistant for exact sizes of responsive ads with the [Responsive add-on](https://wpadvancedads.com/add-ons/responsive-ads/)
104
 
105
  = ad blocker =
@@ -218,8 +220,11 @@ Yes. Advanced Ads is based on WordPress standards and therefore easily customiza
218
 
219
  == Changelog ==
220
 
221
- = untagged =
222
 
 
 
 
223
  * added warning that AdSense InFeed and InArticle ads can’t be aligned left or right
224
 
225
  = 1.8.8 =
5
  Requires at least: 4.6
6
  Tested up to: 4.8
7
  Requires PHP: 5.2
8
+ Stable tag: 1.8.9
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
18
  * most features to test and optimize ads
19
  * unlimited ad units
20
  * works with all ad types and networks
21
+ * the only solution with *Ad Health* integration and AdSense violation checks
22
  * [best rated](https://wordpress.org/support/plugin/advanced-ads/reviews/?filter=5) and free email support
23
 
24
  I built Advanced Ads based on my experience delivering millions of ads per month.
101
  * optional limit to 3 AdSense banners
102
  * hide AdSense advertisements on 404 pages by default (to comply with AdSense terms)
103
  * insert AdSense verification, Page-Level ads and QuickStart code
104
+ * Ad Health integration and AdSense violation checks
105
  * assistant for exact sizes of responsive ads with the [Responsive add-on](https://wpadvancedads.com/add-ons/responsive-ads/)
106
 
107
  = ad blocker =
220
 
221
  == Changelog ==
222
 
223
+ = 1.8.9 =
224
 
225
+ * added option to disable AdSense-related Ad-Health warnings
226
+ * fixed search for terms with numbers in them
227
+ * added check for hidden AdSense units
228
  * added warning that AdSense InFeed and InArticle ads can’t be aligned left or right
229
 
230
  = 1.8.8 =