Advanced Ads - Version 1.7.25

Version Description

  • added explicit "link ads" AdSense type with normal and responsive format
  • included link to AdSense types manual
  • optimized bot check
  • removed TinyMCE security features from links added to the rich media ad type to not break affiliate links
  • fixed error appearing when image of an image ad does not exist anymore
  • fixed wizard not going to ad parameters box automatically after selecting ad type
Download this release

Release Info

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

Code changes from version 1.7.24 to 1.7.25

admin/assets/css/admin.css CHANGED
@@ -292,7 +292,8 @@ tr:hover .on-hover { display: block; }
292
  overflow-y: scroll;
293
  }
294
  #advanced-ads-feedback-content textarea,
295
- #advanced-ads-feedback-content input[type="text"] { display:none; }
 
296
  .advanced-ads-feedback-not-deactivate { display: block; text-align: right; }
297
 
298
  /**
292
  overflow-y: scroll;
293
  }
294
  #advanced-ads-feedback-content textarea,
295
+ #advanced-ads-feedback-content input[type="text"] { display:none; width: 100%; }
296
+ #advanced-ads-feedback-content .advanced_ads_disable_reply { display:none; }
297
  .advanced-ads-feedback-not-deactivate { display: block; text-align: right; }
298
 
299
  /**
admin/assets/js/admin-global.js CHANGED
@@ -68,6 +68,11 @@ jQuery( document ).ready(function () {
68
  // show text field if there is one
69
  jQuery(this).parents('li').next('li').children('input[type="text"], textarea').show();
70
  });
 
 
 
 
 
71
  // send form or close it
72
  jQuery('#advanced-ads-feedback-content .button').click(function ( e ) {
73
  e.preventDefault();
68
  // show text field if there is one
69
  jQuery(this).parents('li').next('li').children('input[type="text"], textarea').show();
70
  });
71
+ // handle technical issue feedback in particular
72
+ jQuery('#advanced-ads-feedback-content .advanced_ads_disable_technical_issue input[type="radio"]').click(function () {
73
+ // show text field if there is one
74
+ jQuery(this).parents('li').siblings('.advanced_ads_disable_reply').show();
75
+ });
76
  // send form or close it
77
  jQuery('#advanced-ads-feedback-content .button').click(function ( e ) {
78
  e.preventDefault();
admin/assets/js/wizard.js CHANGED
@@ -33,6 +33,7 @@ var advads_wizard = {
33
  },
34
  start: function(){ // do stuff when wizard is started
35
  // show page in 1-column stype
 
36
  if( jQuery( '#post-body').hasClass('columns-1') ){
37
  this.one_column = true;
38
  } else {
@@ -51,6 +52,7 @@ var advads_wizard = {
51
  jQuery( '#advads-ad-info').addClass('advads-hide'); // shortcode and php function info
52
  // hide all elements with 'advads-hide-for-wizard' class
53
  jQuery( '.advads-hide-in-wizard').hide();
 
54
  // remove close-class from ad type box
55
  jQuery( '#ad-main-box' ).removeClass('closed');
56
  this.save_hide_wizard( false );
@@ -68,6 +70,7 @@ var advads_wizard = {
68
  jQuery('#advads-wizard-welcome').remove();// close wizard welcome message
69
  // show all elements with 'advads-hide-for-wizard' class
70
  jQuery( '.advads-hide-in-wizard').show();
 
71
  this.save_hide_wizard( true );
72
  },
73
  update_nav: function(){ // update navigation, display only valid buttons
33
  },
34
  start: function(){ // do stuff when wizard is started
35
  // show page in 1-column stype
36
+ var _this = this;
37
  if( jQuery( '#post-body').hasClass('columns-1') ){
38
  this.one_column = true;
39
  } else {
52
  jQuery( '#advads-ad-info').addClass('advads-hide'); // shortcode and php function info
53
  // hide all elements with 'advads-hide-for-wizard' class
54
  jQuery( '.advads-hide-in-wizard').hide();
55
+ jQuery( '#advads-start-wizard' ).hide();
56
  // remove close-class from ad type box
57
  jQuery( '#ad-main-box' ).removeClass('closed');
58
  this.save_hide_wizard( false );
70
  jQuery('#advads-wizard-welcome').remove();// close wizard welcome message
71
  // show all elements with 'advads-hide-for-wizard' class
72
  jQuery( '.advads-hide-in-wizard').show();
73
+ jQuery( '#advads-start-wizard' ).show();
74
  this.save_hide_wizard( true );
75
  },
76
  update_nav: function(){ // update navigation, display only valid buttons
admin/class-advanced-ads-admin.php CHANGED
@@ -111,6 +111,9 @@ class Advanced_Ads_Admin {
111
  add_filter( 'admin_footer', array( $this, 'add_deactivation_logic' ) );
112
  // add_filter( 'after_plugin_row_' . ADVADS_BASE, array( $this, 'display_deactivation_message' ) );
113
 
 
 
 
114
  Advanced_Ads_Admin_Meta_Boxes::get_instance();
115
  Advanced_Ads_Admin_Menu::get_instance();
116
  Advanced_Ads_Admin_Ad_Type::get_instance();
@@ -361,8 +364,10 @@ class Advanced_Ads_Admin {
361
  $current_user = wp_get_current_user();
362
  if ( !($current_user instanceof WP_User) ){
363
  $from = '';
 
364
  } else {
365
  $from = $current_user->user_nicename . ' <' . trim( $current_user->user_email ) . '>';
 
366
  }
367
 
368
  include ADVADS_BASE_PATH . 'admin/views/feedback-disable.php';
@@ -393,9 +398,15 @@ class Advanced_Ads_Admin {
393
  $headers = array();
394
 
395
  $from = isset( $form['advanced_ads_disable_from'] ) ? $form['advanced_ads_disable_from'] : '';
 
 
 
 
 
 
396
  if( $from ){
397
- $headers[] = "From: $from";
398
- $headers[] = "Reply-To: $from";
399
  }
400
 
401
  $subject = isset( $form['advanced_ads_disable_reason'] ) ? $form['advanced_ads_disable_reason'] : '(no reason given)';
@@ -404,5 +415,21 @@ class Advanced_Ads_Admin {
404
 
405
  die();
406
 
407
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
408
  }
111
  add_filter( 'admin_footer', array( $this, 'add_deactivation_logic' ) );
112
  // add_filter( 'after_plugin_row_' . ADVADS_BASE, array( $this, 'display_deactivation_message' ) );
113
 
114
+ // disable adding rel="noopener noreferrer" to link added through TinyMCE for rich content ads
115
+ add_filter( 'tiny_mce_before_init', array( $this, 'tinymce_allow_unsafe_link_target' ) );
116
+
117
  Advanced_Ads_Admin_Meta_Boxes::get_instance();
118
  Advanced_Ads_Admin_Menu::get_instance();
119
  Advanced_Ads_Admin_Ad_Type::get_instance();
364
  $current_user = wp_get_current_user();
365
  if ( !($current_user instanceof WP_User) ){
366
  $from = '';
367
+ $email = '';
368
  } else {
369
  $from = $current_user->user_nicename . ' <' . trim( $current_user->user_email ) . '>';
370
+ $email = $current_user->user_email;
371
  }
372
 
373
  include ADVADS_BASE_PATH . 'admin/views/feedback-disable.php';
398
  $headers = array();
399
 
400
  $from = isset( $form['advanced_ads_disable_from'] ) ? $form['advanced_ads_disable_from'] : '';
401
+ // if an address is given in the form then use that one
402
+ if( isset( $form['advanced_ads_disable_reason'] ) && 'technical issue' === $form['advanced_ads_disable_reason']
403
+ && isset( $form[ 'advanced_ads_disable_reply' ] ) && !empty( $form[ 'advanced_ads_disable_reply_email' ] ) ){
404
+ $from = $current_user->user_nicename . ' <' . trim( $form[ 'advanced_ads_disable_reply_email' ] ) . '>';
405
+ $text .= "\n\n REPLY ALLOWED";
406
+ }
407
  if( $from ){
408
+ $headers[] = "From: $from";
409
+ $headers[] = "Reply-To: $from";
410
  }
411
 
412
  $subject = isset( $form['advanced_ads_disable_reason'] ) ? $form['advanced_ads_disable_reason'] : '(no reason given)';
415
 
416
  die();
417
 
418
+ }
419
+
420
+ public function tinymce_allow_unsafe_link_target( $mceInit ) {
421
+
422
+ // check if we are on the ad edit screen
423
+ if( ! function_exists( 'get_current_screen' ) ){
424
+ return $mceInit;
425
+ }
426
+
427
+ $screen = get_current_screen();
428
+ if( isset( $screen->id ) && $screen->id === 'advanced_ads' ) {
429
+ $mceInit['allow_unsafe_link_target'] = true;
430
+ }
431
+
432
+ return $mceInit;
433
+ }
434
+
435
  }
admin/views/ad-info-top.php CHANGED
@@ -66,7 +66,7 @@ if( isset( $_GET['message'] ) && 6 === $_GET['message'] ) : ?>
66
  <script>
67
  // move wizard button to head
68
  jQuery('#advads-start-wizard').appendTo('h1');
69
- jQuery('.advads-stop-wizard').insertBefore('h1');
70
  </script>
71
  <?php // show wizard welcome message
72
  if( $this->show_wizard_welcome() ) : ?>
66
  <script>
67
  // move wizard button to head
68
  jQuery('#advads-start-wizard').appendTo('h1');
69
+ jQuery('.advads-stop-wizard').insertAfter('h1');
70
  </script>
71
  <?php // show wizard welcome message
72
  if( $this->show_wizard_welcome() ) : ?>
admin/views/feedback-disable.php CHANGED
@@ -4,11 +4,15 @@
4
  <p><strong><?php _e('Why did you decide to disable Advanced Ads?', 'advanced-ads'); ?></strong></p>
5
  <ul>
6
  <li><label><input type="radio" name="advanced_ads_disable_reason" value="temporary"/><?php _e('It is only temporary', 'advanced-ads'); ?></label></li>
7
- <li><label><input type="radio" name="advanced_ads_disable_reason" value="stopped showing ads"/><?php _e('I stopped showing ads on my site', 'advanced-ads'); ?></label></li>
 
 
 
 
 
8
  <li><label><input type="radio" name="advanced_ads_disable_reason" value="missing feature"/><?php _e('I miss a feature', 'advanced-ads'); ?></label></li>
9
  <li><input type="text" name="advanced_ads_disable_text[]" value="" placeholder="Which one?"/></li>
10
- <li><label><input type="radio" name="advanced_ads_disable_reason" value="technical issue"/><?php _e('I have a technical issue', 'advanced-ads'); ?></label></li>
11
- <li><textarea name="advanced_ads_disable_text[]" placeholder="<?php _e('Can we help? Please let us know how', 'advanced-ads'); ?>"></textarea></li>
12
  <li><label><input type="radio" name="advanced_ads_disable_reason" value="other plugin"/><?php _e('I switched to another plugin', 'advanced-ads'); ?></label></li>
13
  <li><input type="text" name="advanced_ads_disable_text[]" value="" placeholder="Which one?"/></li>
14
  <li><label><input type="radio" name="advanced_ads_disable_reason" value="other"/><?php _e('other reason', 'advanced-ads'); ?></label></li>
4
  <p><strong><?php _e('Why did you decide to disable Advanced Ads?', 'advanced-ads'); ?></strong></p>
5
  <ul>
6
  <li><label><input type="radio" name="advanced_ads_disable_reason" value="temporary"/><?php _e('It is only temporary', 'advanced-ads'); ?></label></li>
7
+ <li class="advanced_ads_disable_technical_issue"><label><input type="radio" name="advanced_ads_disable_reason" value="technical issue"/><?php _e('I have a problem', 'advanced-ads'); ?></label></li>
8
+ <li><textarea name="advanced_ads_disable_text[]" placeholder="<?php _e('Please let us know how we can help', 'advanced-ads'); ?>"></textarea></li>
9
+ <?php if( $email ) : ?>
10
+ <?php $mailinput = '<input type="email" name="advanced_ads_disable_reply_email" value="'. $email .'"/>'; ?>
11
+ <li class="advanced_ads_disable_reply"><label><input type="checkbox" name="advanced_ads_disable_reply" value="1" checked="checked"/><?php printf(__('Send me free help to %s', 'advanced-ads'), $mailinput ); ?></label></li>
12
+ <?php endif; ?>
13
  <li><label><input type="radio" name="advanced_ads_disable_reason" value="missing feature"/><?php _e('I miss a feature', 'advanced-ads'); ?></label></li>
14
  <li><input type="text" name="advanced_ads_disable_text[]" value="" placeholder="Which one?"/></li>
15
+ <li><label><input type="radio" name="advanced_ads_disable_reason" value="stopped showing ads"/><?php _e('I don’t use ads on my site', 'advanced-ads'); ?></label></li>
 
16
  <li><label><input type="radio" name="advanced_ads_disable_reason" value="other plugin"/><?php _e('I switched to another plugin', 'advanced-ads'); ?></label></li>
17
  <li><input type="text" name="advanced_ads_disable_text[]" value="" placeholder="Which one?"/></li>
18
  <li><label><input type="radio" name="advanced_ads_disable_reason" value="other"/><?php _e('other reason', 'advanced-ads'); ?></label></li>
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.24
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.24' );
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.25
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.25' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
classes/ad-ajax.php CHANGED
@@ -76,6 +76,9 @@ class Advanced_Ads_Ajax {
76
  $arguments = stripslashes($arguments);
77
  $arguments = json_decode($arguments, true);
78
  }
 
 
 
79
 
80
  $response = array();
81
  if ( isset( $methods[ $method ] ) && isset( $id ) ) {
76
  $arguments = stripslashes($arguments);
77
  $arguments = json_decode($arguments, true);
78
  }
79
+ if ( ! empty( $request['elementId'] ) ) {
80
+ $arguments['cache_busting_elementid'] = $request['elementId'];
81
+ }
82
 
83
  $response = array();
84
  if ( isset( $methods[ $method ] ) && isset( $id ) ) {
classes/ad.php CHANGED
@@ -107,6 +107,16 @@ class Advanced_Ads_Ad {
107
  */
108
  public $wrapper = array();
109
 
 
 
 
 
 
 
 
 
 
 
110
  /**
111
  * init ad object
112
  *
@@ -178,6 +188,7 @@ class Advanced_Ads_Ad {
178
  $this->description = $this->options( 'description' );
179
  $this->output = $this->options( 'output' );
180
  $this->status = $_data->post_status;
 
181
  $this->wrapper = $this->load_wrapper_options();
182
  $this->expiry_date = $this->options( 'expiry_date' );
183
 
@@ -186,8 +197,10 @@ class Advanced_Ads_Ad {
186
 
187
  // set wrapper conditions
188
  $this->wrapper = apply_filters( 'advanced-ads-set-wrapper', $this->wrapper, $this );
189
- // add unique wrapper id, if options given
190
- if ( is_array( $this->wrapper ) && $this->wrapper !== array() && ! isset( $this->wrapper['id'] ) ){
 
 
191
  // create unique id if not yet given
192
  $this->wrapper['id'] = $this->create_wrapper_id();
193
  }
@@ -528,7 +541,9 @@ class Advanced_Ads_Ad {
528
  // filter to manipulate the output before the wrapper is added
529
  $output = apply_filters( 'advanced-ads-output-inside-wrapper', $output, $this );
530
 
531
- $output = $this->maybe_add_label ( $output );
 
 
532
 
533
  // build wrapper around the ad
534
  $output = $this->add_wrapper( $output );
@@ -670,7 +685,9 @@ class Advanced_Ads_Ad {
670
  }
671
  }
672
 
673
- if ( isset($this->output['class']) && is_array( $this->output['class'] ) ) {
 
 
674
  $wrapper['class'] = $this->output['class'];
675
  }
676
 
@@ -701,11 +718,6 @@ class Advanced_Ads_Ad {
701
  $wrapper['style']['height'] = intval( $this->height ) . 'px';
702
  }
703
 
704
- // exclude the 'Header Code' placement type
705
- if ( ! isset( $this->args['placement_type'] ) || 'header' !== $this->args['placement_type'] ) {
706
- $wrapper['data-id'] = $this->id;
707
- }
708
-
709
  return $wrapper;
710
  }
711
 
@@ -717,7 +729,6 @@ class Advanced_Ads_Ad {
717
  * @return str $wrapper ad within the wrapper
718
  */
719
  protected function add_wrapper($ad_content = ''){
720
-
721
  $wrapper_options = apply_filters( 'advanced-ads-output-wrapper-options', $this->wrapper, $this );
722
 
723
  if ( ( ! isset( $this->output['wrapper-id'] ) || '' === $this->output['wrapper-id'] )
@@ -729,26 +740,7 @@ class Advanced_Ads_Ad {
729
  }
730
 
731
  // build the box
732
- $wrapper = '<div';
733
- foreach ( $wrapper_options as $_html_attr => $_values ){
734
- if ( $_html_attr == 'style' ){
735
- $_style_values_string = '';
736
- foreach ( $_values as $_style_attr => $_style_values ){
737
- if ( is_array( $_style_values ) ) {
738
- $_style_values_string .= $_style_attr . ': ' .implode( ' ', $_style_values ). '; '; }
739
- else {
740
- $_style_values_string .= $_style_attr . ': ' .$_style_values. '; '; }
741
- }
742
- $wrapper .= " style=\"$_style_values_string\"";
743
- } else {
744
- if ( is_array( $_values ) ) {
745
- $_values_string = implode( ' ', $_values ); }
746
- else {
747
- $_values_string = sanitize_title( $_values ); }
748
- $wrapper .= " $_html_attr=\"$_values_string\"";
749
- }
750
- }
751
- $wrapper .= '>';
752
  $wrapper .= apply_filters( 'advanced-ads-output-wrapper-before-content', '', $this );
753
  $wrapper .= $ad_content;
754
  $wrapper .= apply_filters( 'advanced-ads-output-wrapper-after-content', '', $this );
@@ -798,30 +790,30 @@ class Advanced_Ads_Ad {
798
  }
799
 
800
  /**
801
- * add an "Advertisement" label if conditions are met
802
- *
803
- * @param str $output
804
- * @return str $output
805
  */
806
- public function maybe_add_label( &$output ) {
807
- if ( ! ( isset( $this->args['placement_type'] ) && $this->args['placement_type'] === 'header' ) &&
808
  $this->type !== 'group' &&
809
  $label = Advanced_Ads::get_instance()->get_label()
810
  ) {
811
  // ignore slider and group with refresh
812
- if ( isset( $this->args['group_info']['type'] ) &&
813
- $this->args['group_info']['type'] === 'slider' &&
814
- ! empty( $this->args['group_info']['refresh_enabled'] )
815
  ) {
816
- return $output;
817
  }
 
 
 
 
818
  // first ad in a group or single ad without group, and not group output for passive cb
819
  if ( empty( $this->args['group_info']['ads_displayed'] ) && empty( $this->args['group_info']['passive_cb'] ) ) {
820
- $output = $label . $output;
821
  }
822
  }
823
-
824
- return $output;
825
  }
826
 
 
 
827
  }
107
  */
108
  public $wrapper = array();
109
 
110
+ /**
111
+ * Whether to create wrapper even if array is empty.
112
+ */
113
+ protected $need_wrapper = false;
114
+
115
+ /**
116
+ * Displayed above the ad.
117
+ */
118
+ protected $label = '';
119
+
120
  /**
121
  * init ad object
122
  *
188
  $this->description = $this->options( 'description' );
189
  $this->output = $this->options( 'output' );
190
  $this->status = $_data->post_status;
191
+ $this->maybe_create_label();
192
  $this->wrapper = $this->load_wrapper_options();
193
  $this->expiry_date = $this->options( 'expiry_date' );
194
 
197
 
198
  // set wrapper conditions
199
  $this->wrapper = apply_filters( 'advanced-ads-set-wrapper', $this->wrapper, $this );
200
+ // add unique wrapper id
201
+ if ( is_array( $this->wrapper )
202
+ && ( $this->wrapper !== array() || $this->need_wrapper )
203
+ && ! isset( $this->wrapper['id'] ) ){
204
  // create unique id if not yet given
205
  $this->wrapper['id'] = $this->create_wrapper_id();
206
  }
541
  // filter to manipulate the output before the wrapper is added
542
  $output = apply_filters( 'advanced-ads-output-inside-wrapper', $output, $this );
543
 
544
+ if ( $this->label ) {
545
+ $output = $this->label . $output;
546
+ }
547
 
548
  // build wrapper around the ad
549
  $output = $this->add_wrapper( $output );
685
  }
686
  }
687
 
688
+ if ( isset($this->output['class'] ) && is_array( $this->output['class'] )
689
+ && ( ! isset( $this->args['previous_method'] ) || 'group' !== $this->args['previous_method'] )
690
+ ) {
691
  $wrapper['class'] = $this->output['class'];
692
  }
693
 
718
  $wrapper['style']['height'] = intval( $this->height ) . 'px';
719
  }
720
 
 
 
 
 
 
721
  return $wrapper;
722
  }
723
 
729
  * @return str $wrapper ad within the wrapper
730
  */
731
  protected function add_wrapper($ad_content = ''){
 
732
  $wrapper_options = apply_filters( 'advanced-ads-output-wrapper-options', $this->wrapper, $this );
733
 
734
  if ( ( ! isset( $this->output['wrapper-id'] ) || '' === $this->output['wrapper-id'] )
740
  }
741
 
742
  // build the box
743
+ $wrapper = '<div' . Advanced_Ads_Utils::build_html_attributes( $wrapper_options ) . '>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
744
  $wrapper .= apply_filters( 'advanced-ads-output-wrapper-before-content', '', $this );
745
  $wrapper .= $ad_content;
746
  $wrapper .= apply_filters( 'advanced-ads-output-wrapper-after-content', '', $this );
790
  }
791
 
792
  /**
793
+ * Create an "Advertisement" label if conditions are met.
 
 
 
794
  */
795
+ public function maybe_create_label() {
796
+ if ( ( ! isset( $this->args['placement_type'] ) || $this->args['placement_type'] !== 'header' ) &&
797
  $this->type !== 'group' &&
798
  $label = Advanced_Ads::get_instance()->get_label()
799
  ) {
800
  // ignore slider and group with refresh
801
+ if ( ( isset( $this->args['group_info']['type'] ) && $this->args['group_info']['type'] === 'slider' )
802
+ || ! empty( $this->args['group_info']['refresh_enabled'] )
 
803
  ) {
804
+ return;
805
  }
806
+ // Label probably will be shown.
807
+ // Passive cache-busting can display it above any ad.
808
+ $this->need_wrapper = true;
809
+
810
  // first ad in a group or single ad without group, and not group output for passive cb
811
  if ( empty( $this->args['group_info']['ads_displayed'] ) && empty( $this->args['group_info']['passive_cb'] ) ) {
812
+ $this->label = $label;
813
  }
814
  }
 
 
815
  }
816
 
817
+
818
+
819
  }
classes/ad_group.php CHANGED
@@ -94,6 +94,14 @@ class Advanced_Ads_Group {
94
  */
95
  private $ads = array();
96
 
 
 
 
 
 
 
 
 
97
  /**
98
  * init ad group object
99
  *
@@ -162,6 +170,8 @@ class Advanced_Ads_Group {
162
  if ( isset( $group_data['options'] ) ) {
163
  $this->options = isset( $group_data['options'] ) ? $group_data['options'] : array();
164
  }
 
 
165
  }
166
 
167
  /**
@@ -215,9 +225,17 @@ class Advanced_Ads_Group {
215
  $advads = Advanced_Ads::get_instance();
216
  $advads->current_ads[] = array('type' => 'group', 'id' => $this->id, 'title' => $this->name);
217
 
 
 
218
  // filter grouped ads output
219
  $output_string = implode( '', apply_filters( 'advanced-ads-group-output-array', $output, $this ) );
220
 
 
 
 
 
 
 
221
  // filter final group output
222
  return apply_filters( 'advanced-ads-group-output', $output_string, $this );
223
  }
@@ -508,4 +526,23 @@ class Advanced_Ads_Group {
508
  return $sanitized_weights;
509
  }
510
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
511
  }
94
  */
95
  private $ads = array();
96
 
97
+ /**
98
+ * Multidimensional array contains information about the wrapper
99
+ * each possible html attribute is an array with possible multiple elements.
100
+ *
101
+ * @since untagged
102
+ */
103
+ public $wrapper = array();
104
+
105
  /**
106
  * init ad group object
107
  *
170
  if ( isset( $group_data['options'] ) ) {
171
  $this->options = isset( $group_data['options'] ) ? $group_data['options'] : array();
172
  }
173
+
174
+ $this->create_wrapper();
175
  }
176
 
177
  /**
225
  $advads = Advanced_Ads::get_instance();
226
  $advads->current_ads[] = array('type' => 'group', 'id' => $this->id, 'title' => $this->name);
227
 
228
+ if ( ! $output ) { return ''; }
229
+
230
  // filter grouped ads output
231
  $output_string = implode( '', apply_filters( 'advanced-ads-group-output-array', $output, $this ) );
232
 
233
+ if ( $this->wrapper !== array() ) {
234
+ $output_string = '<div' . Advanced_Ads_Utils::build_html_attributes( $this->wrapper ) . '>'
235
+ . $output_string
236
+ . '</div>';
237
+ }
238
+
239
  // filter final group output
240
  return apply_filters( 'advanced-ads-group-output', $output_string, $this );
241
  }
526
  return $sanitized_weights;
527
  }
528
 
529
+ /**
530
+ * Create a wrapper to place around the group.
531
+ */
532
+ private function create_wrapper() {
533
+ $this->wrapper = array();
534
+
535
+ // Add placement class.
536
+ if ( isset( $this->ad_args['output']['class'] ) && is_array( $this->ad_args['output']['class'] ) ) {
537
+ $this->wrapper['class'] = $this->ad_args['output']['class'];
538
+ }
539
+
540
+ $this->wrapper = (array) apply_filters( 'advanced-ads-output-wrapper-options-group', $this->wrapper, $this );
541
+
542
+ if ( $this->wrapper !== array() && ! isset( $this->wrapper['id'] ) ) {
543
+ $prefix = Advanced_Ads_Plugin::get_instance()->get_frontend_prefix();
544
+ $this->wrapper['id'] = $prefix . mt_rand();
545
+ }
546
+ }
547
+
548
  }
classes/ad_type_image.php CHANGED
@@ -126,12 +126,13 @@ class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract{
126
  $height = 100;
127
  }
128
 
129
- $hwstring = image_hwstring($width, $height);
130
  $attachment = get_post($attachment_id);
131
  $alt = trim(strip_tags( get_post_meta($attachment_id, '_wp_attachment_image_alt', true) ));
132
- $title = trim(strip_tags( $attachment->post_title )); // Finally, use the title
133
 
134
- echo rtrim("<img $hwstring") . " src='$src' alt='$alt' title='$title'/>";
 
 
135
  }
136
  }
137
 
126
  $height = 100;
127
  }
128
 
129
+ $hwstring = trim( image_hwstring($width, $height) );
130
  $attachment = get_post($attachment_id);
131
  $alt = trim(strip_tags( get_post_meta($attachment_id, '_wp_attachment_image_alt', true) ));
 
132
 
133
+ $title = ( $attachment instanceof WP_Post ) ? trim(strip_tags( $attachment->post_title )) : ''; // Finally, use the title
134
+
135
+ echo "<img $hwstring src='$src' alt='$alt' title='$title'/>";
136
  }
137
  }
138
 
classes/utils.php CHANGED
@@ -41,5 +41,37 @@ class Advanced_Ads_Utils {
41
  }
42
  return $result;
43
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
45
  ?>
41
  }
42
  return $result;
43
  }
44
+
45
+ /**
46
+ * Convert array of html attributes to string.
47
+ *
48
+ * @param array $data
49
+ * @return string
50
+ * @since untagged
51
+ */
52
+ public static function build_html_attributes( $data ) {
53
+ $result = '';
54
+ foreach ( $data as $_html_attr => $_values ){
55
+ if ( $_html_attr == 'style' ){
56
+ $_style_values_string = '';
57
+ foreach ( $_values as $_style_attr => $_style_values ){
58
+ if ( is_array( $_style_values ) ) {
59
+ $_style_values_string .= $_style_attr . ': ' .implode( ' ', $_style_values ). '; '; }
60
+ else {
61
+ $_style_values_string .= $_style_attr . ': ' .$_style_values. '; '; }
62
+ }
63
+ $result .= " style=\"$_style_values_string\"";
64
+ } else {
65
+ if ( is_array( $_values ) ) {
66
+ $_values_string = implode( ' ', $_values ); }
67
+ else {
68
+ $_values_string = sanitize_title( $_values ); }
69
+ $result .= " $_html_attr=\"$_values_string\"";
70
+ }
71
+ }
72
+ return $result;
73
+ }
74
+
75
+
76
  }
77
  ?>
modules/gadsense/admin/admin.php CHANGED
@@ -216,9 +216,8 @@ class Advanced_Ads_AdSense_Admin {
216
 
217
  ?><label><input type="checkbox" name="<?php echo GADSENSE_OPT_NAME; ?>[page-level-enabled]" value="1" <?php checked( $page_level ); ?> />
218
  <?php _e( 'Insert Page-Level ads code on all pages.', 'advanced-ads' ); ?></label>
219
- <p class="description">
220
- <?php _e( 'You still need to enable Page-Level ads in your AdSense account. See <a href="https://support.google.com/adsense/answer/6245304" target="_blank">AdSense Help</a> (requires AdSense-login) for more information', 'advanced-ads' ); ?>
221
- </p><?php
222
  }
223
 
224
  /**
@@ -314,12 +313,13 @@ class Advanced_Ads_AdSense_Admin {
314
  'class' => 'advads-ad-notice-responsive-position error hidden',
315
  );
316
  // show hint about Content ad, Link unit or Matched content being defined in AdSense account
317
- if( 'adsense' === $ad->type ){
 
318
  $notices[] = array(
319
  'text' => sprintf( __( 'The type of your AdSense ad unit (content unit, link unit or matched content) needs to be defined in <a href="%s" target="_blank">your AdSense account</a>.', 'advanced-ads' ), 'https://www.google.com/adsense' ),
320
  'class' => 'advads-ad-notice-adsense-ad-unit-type',
321
  );
322
- }
323
  break;
324
  }
325
 
216
 
217
  ?><label><input type="checkbox" name="<?php echo GADSENSE_OPT_NAME; ?>[page-level-enabled]" value="1" <?php checked( $page_level ); ?> />
218
  <?php _e( 'Insert Page-Level ads code on all pages.', 'advanced-ads' ); ?></label>
219
+ <p class="description"><?php _e( 'You still need to enable Page-Level ads in your AdSense account. See <a href="https://support.google.com/adsense/answer/6245304" target="_blank">AdSense Help</a> (requires AdSense-login) for more information.', 'advanced-ads' ); ?></p>
220
+ <p class="description"><?php _e( 'Please notice that this code might also activate QuickStart ads. Please read <a href="https://support.google.com/adsense/answer/7171740" target="_blank">QuickStart</a> and remove this option <strong>when ads appear in random places</strong>.', 'advanced-ads' ); ?></p><?php
 
221
  }
222
 
223
  /**
313
  'class' => 'advads-ad-notice-responsive-position error hidden',
314
  );
315
  // show hint about Content ad, Link unit or Matched content being defined in AdSense account
316
+ // disabled since it might no longer be needed with the new ad types
317
+ /* if( 'adsense' === $ad->type ){
318
  $notices[] = array(
319
  'text' => sprintf( __( 'The type of your AdSense ad unit (content unit, link unit or matched content) needs to be defined in <a href="%s" target="_blank">your AdSense account</a>.', 'advanced-ads' ), 'https://www.google.com/adsense' ),
320
  'class' => 'advads-ad-notice-adsense-ad-unit-type',
321
  );
322
+ }*/
323
  break;
324
  }
325
 
modules/gadsense/admin/assets/js/new-ad.js CHANGED
@@ -80,6 +80,22 @@
80
  return theAd;
81
  }
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  if ('undefined' != typeof(theAd.format) && 'autorelaxed' == theAd.format) {
84
  /* Responsive Matched Content */
85
  theAd.type = 'matched-content';
@@ -106,6 +122,17 @@
106
  $( '#advanced-ads-ad-parameters-size input[name="advanced_ad[width]"]' ).val( '' );
107
  $( '#advanced-ads-ad-parameters-size input[name="advanced_ad[height]"]' ).val( '' );
108
  }
 
 
 
 
 
 
 
 
 
 
 
109
  if ('matched-content' == theAd.type) {
110
  $( '#unit-type' ).val( 'matched-content' );
111
  $( '#ad-resize-type' ).val( 'auto' );
@@ -151,11 +178,11 @@
151
 
152
  function advads_update_adsense_type(){
153
  var type = $( '#unit-type' ).val();
154
- if ('responsive' == type || 'matched-content' == type) {
155
  $( '#advanced-ads-ad-parameters-size' ).css( 'display', 'none' );
156
  $( '#advanced-ads-ad-parameters-size' ).prev('.label').css( 'display', 'none' );
157
  $( '#advanced-ads-ad-parameters-size' ).next('.hr').css( 'display', 'none' );
158
- } else if ('normal' == type) {
159
  $( '#advanced-ads-ad-parameters-size' ).css( 'display', 'block' );
160
  $( '#advanced-ads-ad-parameters-size' ).prev('.label').css( 'display', 'block' );
161
  $( '#advanced-ads-ad-parameters-size' ).next('.hr').css( 'display', 'block' );
80
  return theAd;
81
  }
82
 
83
+
84
+ /* older link unit format; for new ads the format type is no longer needed; link units are created through the AdSense panel */
85
+ if ('undefined' != typeof(theAd.format) && 'link' == theAd.format) {
86
+
87
+ if( -1 != theAd.style.indexOf( 'width' ) ){
88
+ // is fixed size
89
+ theAd.width = adByGoogle.css( 'width' ).replace( 'px', '' );
90
+ theAd.height = adByGoogle.css( 'height' ).replace( 'px', '' );
91
+ theAd.type = 'link';
92
+ } else {
93
+ // is responsive
94
+ theAd.type = 'link-responsive';
95
+ }
96
+ return theAd;
97
+ }
98
+
99
  if ('undefined' != typeof(theAd.format) && 'autorelaxed' == theAd.format) {
100
  /* Responsive Matched Content */
101
  theAd.type = 'matched-content';
122
  $( '#advanced-ads-ad-parameters-size input[name="advanced_ad[width]"]' ).val( '' );
123
  $( '#advanced-ads-ad-parameters-size input[name="advanced_ad[height]"]' ).val( '' );
124
  }
125
+ if ('link' == theAd.type) {
126
+ $( '#unit-type' ).val( 'link' );
127
+ $( '#advanced-ads-ad-parameters-size input[name="advanced_ad[width]"]' ).val( theAd.width );
128
+ $( '#advanced-ads-ad-parameters-size input[name="advanced_ad[height]"]' ).val( theAd.height );
129
+ }
130
+ if ('link-responsive' == theAd.type) {
131
+ $( '#unit-type' ).val( 'link-responsive' );
132
+ $( '#ad-resize-type' ).val( 'auto' );
133
+ $( '#advanced-ads-ad-parameters-size input[name="advanced_ad[width]"]' ).val( '' );
134
+ $( '#advanced-ads-ad-parameters-size input[name="advanced_ad[height]"]' ).val( '' );
135
+ }
136
  if ('matched-content' == theAd.type) {
137
  $( '#unit-type' ).val( 'matched-content' );
138
  $( '#ad-resize-type' ).val( 'auto' );
178
 
179
  function advads_update_adsense_type(){
180
  var type = $( '#unit-type' ).val();
181
+ if ( 'responsive' == type || 'link-responsive' == type || 'matched-content' == type ) {
182
  $( '#advanced-ads-ad-parameters-size' ).css( 'display', 'none' );
183
  $( '#advanced-ads-ad-parameters-size' ).prev('.label').css( 'display', 'none' );
184
  $( '#advanced-ads-ad-parameters-size' ).next('.hr').css( 'display', 'none' );
185
+ } else if ( 'normal' == type || 'link' == type ) {
186
  $( '#advanced-ads-ad-parameters-size' ).css( 'display', 'block' );
187
  $( '#advanced-ads-ad-parameters-size' ).prev('.label').css( 'display', 'block' );
188
  $( '#advanced-ads-ad-parameters-size' ).next('.hr').css( 'display', 'block' );
modules/gadsense/admin/views/adsense-ad-parameters.php CHANGED
@@ -3,9 +3,10 @@ if ( ! defined( 'WPINC' ) ) {
3
  die();
4
  }
5
  $is_responsive = ('responsive' == $unit_type) ? true : false;
 
6
  $is_matched_content = ('matched-content' == $unit_type) ? true : false;
7
  $use_manual_css = ('manual' == $unit_resize) ? true : false;
8
- if ( $is_responsive || $is_matched_content ) {
9
  echo '<style type="text/css"> #advanced-ads-ad-parameters-size {display: none;} </style>';
10
  }
11
 
@@ -51,7 +52,10 @@ if( $pub_id_errors ) : ?>
51
  <option value="normal" <?php selected( $unit_type, 'normal' ); ?>><?php _e( 'Normal', 'advanced-ads' ); ?></option>
52
  <option value="responsive" <?php selected( $unit_type, 'responsive' ); ?>><?php _e( 'Responsive', 'advanced-ads' ); ?></option>
53
  <option value="matched-content" <?php selected( $unit_type, 'matched-content' ); ?>><?php _e( 'Responsive (Matched Content)', 'advanced-ads' ); ?></option>
 
 
54
  </select>
 
55
  </div>
56
  <hr/>
57
  <?php if ( ! defined( 'AAR_SLUG' ) ) : ?>
3
  die();
4
  }
5
  $is_responsive = ('responsive' == $unit_type) ? true : false;
6
+ $is_link_responsive_unit = ('link-responsive' == $unit_type) ? true : false;
7
  $is_matched_content = ('matched-content' == $unit_type) ? true : false;
8
  $use_manual_css = ('manual' == $unit_resize) ? true : false;
9
+ if ( $is_responsive || $is_link_responsive_unit || $is_matched_content ) {
10
  echo '<style type="text/css"> #advanced-ads-ad-parameters-size {display: none;} </style>';
11
  }
12
 
52
  <option value="normal" <?php selected( $unit_type, 'normal' ); ?>><?php _e( 'Normal', 'advanced-ads' ); ?></option>
53
  <option value="responsive" <?php selected( $unit_type, 'responsive' ); ?>><?php _e( 'Responsive', 'advanced-ads' ); ?></option>
54
  <option value="matched-content" <?php selected( $unit_type, 'matched-content' ); ?>><?php _e( 'Responsive (Matched Content)', 'advanced-ads' ); ?></option>
55
+ <option value="link" <?php selected( $unit_type, 'link' ); ?>><?php _e( 'Link ads', 'advanced-ads' ); ?></option>
56
+ <option value="link-responsive" <?php selected( $unit_type, 'link-responsive' ); ?>><?php _e( 'Link ads (Responsive)', 'advanced-ads' ); ?></option>
57
  </select>
58
+ <a href="<?php echo ADVADS_URL . 'manual/adsense-ads/#adsense-ad-types'; ?>" target="_blank"><?php _e( 'manual', 'advanced-ads' ); ?></a>
59
  </div>
60
  <hr/>
61
  <?php if ( ! defined( 'AAR_SLUG' ) ) : ?>
modules/gadsense/includes/class-ad-type-adsense.php CHANGED
@@ -85,7 +85,7 @@ class Advanced_Ads_Ad_Type_Adsense extends Advanced_Ads_Ad_Type_Abstract {
85
  $unit_type = $content->unitType;
86
  $unit_code = $content->slotId;
87
 
88
- if ( 'responsive' != $content->unitType && 'matched-content' != $content->unitType ) {
89
  // Normal ad unit
90
  $unit_width = $ad->width;
91
  $unit_height = $ad->height;
@@ -180,12 +180,17 @@ class Advanced_Ads_Ad_Type_Adsense extends Advanced_Ads_Ad_Type_Abstract {
180
 
181
  $output = '';
182
 
183
- if ( 'responsive' != $content->unitType && 'matched-content' != $content->unitType ) {
184
  $output .= '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>' . "\n";
185
  $output .= '<ins class="adsbygoogle" ';
186
  $output .= 'style="display:inline-block;width:' . $ad->width . 'px;height:' . $ad->height . 'px;" ' . "\n";
187
  $output .= 'data-ad-client="ca-' . $pub_id . '" ' . "\n";
188
- $output .= 'data-ad-slot="' . $content->slotId . '"></ins> ' . "\n";
 
 
 
 
 
189
  $output .= '<script> ' . "\n";
190
  $output .= '(adsbygoogle = window.adsbygoogle || []).push({}); ' . "\n";
191
  $output .= '</script>' . "\n";
@@ -214,13 +219,25 @@ class Advanced_Ads_Ad_Type_Adsense extends Advanced_Ads_Ad_Type_Abstract {
214
  }
215
 
216
  protected function append_defaut_responsive_content(&$output, $pub_id, $content) {
 
 
 
 
 
 
 
 
 
 
 
 
217
  $output .= '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>' . "\n";
218
  $output .= '<ins class="adsbygoogle" ';
219
  $output .= 'style="display:block;" ';
220
  $output .= 'data-ad-client="ca-' . $pub_id . '" ' . "\n";
221
  $output .= 'data-ad-slot="' . $content->slotId . '" ' . "\n";
222
  $output .= 'data-ad-format="';
223
- $output .= ( 'matched-content' == $content->unitType )? 'autorelaxed' : 'auto';
224
  $output .= '"></ins>' . "\n";
225
  $output .= '<script> ' . "\n";
226
  $output .= apply_filters( 'advanced-ads-gadsense-responsive-adsbygoogle', '(adsbygoogle = window.adsbygoogle || []).push({}); ' . "\n");
85
  $unit_type = $content->unitType;
86
  $unit_code = $content->slotId;
87
 
88
+ if ( 'responsive' != $content->unitType && 'link-responsive' != $content->unitType && 'matched-content' != $content->unitType ) {
89
  // Normal ad unit
90
  $unit_width = $ad->width;
91
  $unit_height = $ad->height;
180
 
181
  $output = '';
182
 
183
+ if ( 'responsive' != $content->unitType && 'link-responsive' != $content->unitType && 'matched-content' != $content->unitType ) {
184
  $output .= '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>' . "\n";
185
  $output .= '<ins class="adsbygoogle" ';
186
  $output .= 'style="display:inline-block;width:' . $ad->width . 'px;height:' . $ad->height . 'px;" ' . "\n";
187
  $output .= 'data-ad-client="ca-' . $pub_id . '" ' . "\n";
188
+ $output .= 'data-ad-slot="' . $content->slotId . '"';
189
+ // ad type for static link unit
190
+ if( 'link' == $content->unitType ){
191
+ $output .= "\n" . 'data-ad-format="link"';
192
+ }
193
+ $output .= '></ins> ' . "\n";
194
  $output .= '<script> ' . "\n";
195
  $output .= '(adsbygoogle = window.adsbygoogle || []).push({}); ' . "\n";
196
  $output .= '</script>' . "\n";
219
  }
220
 
221
  protected function append_defaut_responsive_content(&$output, $pub_id, $content) {
222
+ $format = '';
223
+ switch( $content->unitType ){
224
+ case 'matched-content' :
225
+ $format = 'autorelaxed';
226
+ break;
227
+ case 'link-responsive' :
228
+ $format = 'link';
229
+ break;
230
+ default :
231
+ $format = 'auto';
232
+ }
233
+
234
  $output .= '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>' . "\n";
235
  $output .= '<ins class="adsbygoogle" ';
236
  $output .= 'style="display:block;" ';
237
  $output .= 'data-ad-client="ca-' . $pub_id . '" ' . "\n";
238
  $output .= 'data-ad-slot="' . $content->slotId . '" ' . "\n";
239
  $output .= 'data-ad-format="';
240
+ $output .= $format;
241
  $output .= '"></ins>' . "\n";
242
  $output .= '<script> ' . "\n";
243
  $output .= apply_filters( 'advanced-ads-gadsense-responsive-adsbygoogle', '(adsbygoogle = window.adsbygoogle || []).push({}); ' . "\n");
public/class-advanced-ads.php CHANGED
@@ -75,7 +75,7 @@ class Advanced_Ads {
75
  * @since 1.4.9
76
  * @var array list of bots
77
  */
78
- protected $bots = array('008','ABACHOBot','Accoona-AI-Agent','AddSugarSpiderBot','ADmantX','AhrefsBot','alexa','AnyApexBot','appie','Apple-PubSub','Arachmo','Ask Jeeves','avira.com','B-l-i-t-z-B-O-T','Baiduspider','BecomeBot','BeslistBot','BillyBobBot','Bimbot','Bingbot','BLEXBot','BlitzBOT','boitho.com-dc','boitho.com-robot','bot','btbot','CatchBot','Cerberian Drtrs','Charlotte','ConveraCrawler','cosmos','Covario IDS','crawler','CrystalSemanticsBot','curl','DataparkSearch','DiamondBot','Discobot','Dotbot','EmeraldShield.com WebBot','envolk[ITS]spider','EsperanzaBot','Exabot','expo9','facebookexternalhit','FAST Enterprise Crawler','FAST-WebCrawler','FDSE robot','Feedfetcher-Google','FindLinks','Firefly','froogle','FurlBot','FyberSpider','g2crawler','Gaisbot','GalaxyBot','genieBot','Genieo','Gigabot','Girafabot','Googlebot','Googlebot-Image','GrapeshotCrawler','GurujiBot','HappyFunBot','heritrix','hl_ftien_spider','Holmes','htdig','https://developers.google.com','ia_archiver','iaskspider','iCCrawler','ichiro','igdeSpyder','InfoSeek','inktomi','IRLbot','IssueCrawler','Jaxified Bot','Jyxobot','KoepaBot','Kraken','L.webis','LapozzBot','Larbin','LDSpider','LexxeBot','Linguee','Bot','LinkWalker','lmspider','looksmart','lwp-trivial','mabontland','magpie-crawler','Mail.RU_Bot','MaxPointCrawler','Mediapartners-Google','MJ12bot','Mnogosearch','mogimogi','MojeekBot','Moreoverbot','Morning Paper','msnbot','MSRBot','MVAClient','mxbot','NationalDirectory','NetResearchServer','NetSeer Crawler','NewsGator','NG-Search','nicebot','noxtrumbot','Nusearch','Spider','Nutch crawler','NutchCVS','Nymesis','obot','oegp','omgilibot','OmniExplorer_Bot','OOZBOT','Orbiter','PageBitesHyperBot','Peew','polybot','Pompos','PostPost','proximic','Psbot','PycURL','Qseero','rabaz','Radian6','RAMPyBot','Rankivabot','RufusBot','SandCrawler','savetheworldheritage','SBIder','Scooter','ScoutJet','Scrubby','SearchSight','Seekbot','semanticdiscovery','Sensis','Web Crawler','SEOChat::Bot','SeznamBot','Shim-Crawler','ShopWiki','Shoula robot','silk','Sitebot','Snappy','sogou spider','Sogou web spider','Sosospider','Spade','Speedy Spider','Sqworm','StackRambler','suggybot','SurveyBot','SynooBot','TechnoratiSnoop','TECNOSEEK','Teoma','TerrawizBot','TheSuBot','Thumbnail.CZ','robot','TinEye','truwoGPS','TurnitinBot','TweetedTimes Bot','TwengaBot','updated','URL_Spider_SQL','Urlfilebot','Vagabondo','VoilaBot','voltron','Vortex','voyager','VYU2','WebAlta Crawler','WebBug','webcollage','WebFindBot','WebIndex','Websquash.com','WeSEE:Ads','wf84','Wget','WoFindeIch Robot','WomlpeFactory','WordPress','Xaldon_WebSpider','yacy','Yahoo! Slurp','Yahoo! Slurp China','YahooSeeker','YahooSeeker-Testing','YandexBot','YandexImages','Yasaklibot','Yeti','YodaoBot','yoogliFetchAgent','YoudaoBot','Zao','Zealbot','zspider','ZyBorg');
79
 
80
  /**
81
  *
@@ -525,8 +525,9 @@ class Advanced_Ads {
525
  */
526
  public function is_bot(){
527
  $bots = apply_filters('advanced-ads-bots', $this->bots);
 
528
  $bots = implode('|', $bots);
529
- $bots = preg_replace('@[^-_;/|\][ a-z0-9]@i', '', $bots);
530
  $regex = "@$bots@i";
531
 
532
  if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] !== '') {
75
  * @since 1.4.9
76
  * @var array list of bots
77
  */
78
+ protected $bots = array('bot','spider','crawler','scraper','parser','008','Accoona-AI-Agent','ADmantX','alexa','appie','Apple-PubSub','Arachmo','Ask Jeeves','avira\.com','B-l-i-t-z-B-O-T','boitho\.com-dc','BUbiNG','Cerberian Drtrs','Charlotte','cosmos','Covario IDS','curl','DataparkSearch','DDG-Android','expo9','facebookexternalhit','Feedfetcher-Google','FindLinks','Firefly','froogle','Genieo','heritrix','Holmes','htdig','https://developers\.google\.com','ia_archiver','ichiro','igdeSpyder','InfoSeek','inktomi','Kraken','L\.webis','Larbin','Linguee','LinkWalker','looksmart','lwp-trivial','mabontland','Mediapartners-Google','Mnogosearch','mogimogi','Morning Paper','MVAClient','NationalDirectory','NetResearchServer','NewsGator','NG-Search','Nusearch','NutchCVS','Nymesis','oegp','Orbiter','Peew','Pompos','PostPost','proximic','PycURL','Qseero','rabaz','Radian6','Reeder', 'savetheworldheritage','SBIder','Scooter','ScoutJet','Scrubby','SearchSight','semanticdiscovery','Sensis','ShopWiki','silk','Snappy','Spade','Sqworm','StackRambler','TechnoratiSnoop','TECNOSEEK','Teoma','Thumbnail\.CZ','TinEye','truwoGPS','updated','Vagabondo','voltron','Vortex','voyager','VYU2','WebBug','webcollage','WebIndex','Websquash\.com','WeSEE:Ads','wf84','Wget','WomlpeFactory','WordPress','yacy','Yahoo! Slurp','Yahoo! Slurp China','YahooSeeker','YahooSeeker-Testing','YandexImages','Yeti','yoogliFetchAgent','Zao','ZyBorg','okhttp','ips-agent','ltx71','Optimizer','Daum','Qwantify');
79
 
80
  /**
81
  *
525
  */
526
  public function is_bot(){
527
  $bots = apply_filters('advanced-ads-bots', $this->bots);
528
+
529
  $bots = implode('|', $bots);
530
+ $bots = preg_replace('@[^-_;/|\][ :.!a-z0-9]@i', '', $bots);
531
  $regex = "@$bots@i";
532
 
533
  if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] !== '') {
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: webzunft
3
  Donate link:https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5RRRCEBGN3UT2
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.7.4
7
- Stable tag: 1.7.24
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -210,6 +210,15 @@ There is no revenue share. Advanced Ads doesn’t alter your ad codes in a way t
210
 
211
  == Changelog ==
212
 
 
 
 
 
 
 
 
 
 
213
  = 1.7.24 =
214
 
215
  * fixed issue with shortcode button that caused some page builders and scripts to break
@@ -230,6 +239,7 @@ There is no revenue share. Advanced Ads doesn’t alter your ad codes in a way t
230
  * reapplied user capabilities to create or edit ads to make sure they are never wrong
231
  * added warning about left and right position not working with responsive AdSense units
232
  * edited feedback form
 
233
 
234
  = 1.7.21 =
235
 
3
  Donate link:https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5RRRCEBGN3UT2
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.8
7
+ Stable tag: 1.7.25
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
210
 
211
  == Changelog ==
212
 
213
+ = 1.7.25 =
214
+
215
+ * added explicit "link ads" AdSense type with normal and responsive format
216
+ * included link to AdSense types manual
217
+ * optimized bot check
218
+ * removed TinyMCE security features from links added to the rich media ad type to not break affiliate links
219
+ * fixed error appearing when image of an image ad does not exist anymore
220
+ * fixed wizard not going to ad parameters box automatically after selecting ad type
221
+
222
  = 1.7.24 =
223
 
224
  * fixed issue with shortcode button that caused some page builders and scripts to break
239
  * reapplied user capabilities to create or edit ads to make sure they are never wrong
240
  * added warning about left and right position not working with responsive AdSense units
241
  * edited feedback form
242
+ * add ad/group wrapper, if needed
243
 
244
  = 1.7.21 =
245