Advanced Ads - Version 1.13.5

Version Description

  • option to hide ads by user role does now show all registered roles
  • prevented possible JavaScript error in Ad Health
  • updated minimum PHP version check to warn below PHP 5.6.20
  • exclude LiteSpeed Cache bot from bot detection
  • fixed Ad Health notices with invalid ID
Download this release

Release Info

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

Code changes from version 1.13.4 to 1.13.5

admin/assets/css/admin.css CHANGED
@@ -360,6 +360,8 @@ tr:hover .on-hover { display: block; }
360
  .advads-tab-sub-menu ul li a { cursor: pointer; }
361
  .advads-tab-sub-menu ul li + li:before { content: '|'; }
362
  .advads-tab-sub-menu ul li + li a { padding-left: 0.5em; }
 
 
363
 
364
  /**
365
  - SUPPORT PAGE
360
  .advads-tab-sub-menu ul li a { cursor: pointer; }
361
  .advads-tab-sub-menu ul li + li:before { content: '|'; }
362
  .advads-tab-sub-menu ul li + li a { padding-left: 0.5em; }
363
+ #advads-settings-hide-by-user-role { -webkit-columns: 200px 5; /* Chrome, Safari, Opera */ -moz-columns: 200px 5; /* Firefox */ columns: 200px 5; column-gap: 10px; }
364
+ #advads-settings-hide-by-user-role label { display: block; }
365
 
366
  /**
367
  - SUPPORT PAGE
admin/includes/class-settings.php CHANGED
@@ -133,7 +133,7 @@ class Advanced_Ads_Admin_Settings {
133
  // add setting fields for user role.
134
  add_settings_field(
135
  'hide-for-user-role',
136
- __( 'Hide ads for logged in users', 'advanced-ads' ),
137
  array( $this, 'render_settings_hide_for_users' ),
138
  $hook,
139
  'advanced_ads_setting_section_disable_ads'
@@ -170,6 +170,16 @@ class Advanced_Ads_Admin_Settings {
170
  $hook,
171
  'advanced_ads_setting_section_disable_ads'
172
  );
 
 
 
 
 
 
 
 
 
 
173
  // opt out from internal notices.
174
  add_settings_field(
175
  'disable-notices',
@@ -403,24 +413,25 @@ class Advanced_Ads_Admin_Settings {
403
  * @since 1.1.1
404
  */
405
  public function render_settings_hide_for_users() {
406
- $options = Advanced_Ads::get_instance()->options();
407
- $current_capability_role = isset( $options['hide-for-user-role'] ) ? $options['hide-for-user-role'] : 0;
408
-
409
- $capability_roles = array(
410
- '' => __( '(display to all)', 'advanced-ads' ),
411
- 'read' => __( 'Subscriber', 'advanced-ads' ),
412
- 'delete_posts' => __( 'Contributor', 'advanced-ads' ),
413
- 'edit_posts' => __( 'Author', 'advanced-ads' ),
414
- 'edit_pages' => __( 'Editor', 'advanced-ads' ),
415
- 'activate_plugins' => __( 'Admin', 'advanced-ads' ),
416
- );
417
- echo '<select name="' . ADVADS_SLUG . '[hide-for-user-role]">';
418
- foreach ( $capability_roles as $_capability => $_role ) {
419
- echo '<option value="' . $_capability . '" ' . selected( $_capability, $current_capability_role, false ) . '>' . $_role . '</option>';
 
420
  }
421
- echo '</select>';
422
 
423
- echo '<p class="description">' . __( 'Choose the lowest role a user must have in order to not see any ads.', 'advanced-ads' ) . '</p>';
424
  }
425
 
426
  /**
@@ -509,6 +520,21 @@ class Advanced_Ads_Admin_Settings {
509
  echo '<p class="description">' . __( 'Hide ads from crawlers, bots and empty user agents.', 'advanced-ads' ) . '</p>';
510
  }
511
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
512
  /**
513
  * render setting to disable notices
514
  *
133
  // add setting fields for user role.
134
  add_settings_field(
135
  'hide-for-user-role',
136
+ __( 'Hide ads for user roles', 'advanced-ads' ),
137
  array( $this, 'render_settings_hide_for_users' ),
138
  $hook,
139
  'advanced_ads_setting_section_disable_ads'
170
  $hook,
171
  'advanced_ads_setting_section_disable_ads'
172
  );
173
+ // dummy setting field to hide ads for post types.
174
+ if( !defined( 'AAP_VERSION' ) ) {
175
+ add_settings_field(
176
+ 'disable-by-post-types-pro',
177
+ __( 'Disable ads for post types', 'advanced-ads' ),
178
+ array( $this, 'render_settings_disable_post_types' ),
179
+ $hook,
180
+ 'advanced_ads_setting_section_disable_ads'
181
+ );
182
+ }
183
  // opt out from internal notices.
184
  add_settings_field(
185
  'disable-notices',
413
  * @since 1.1.1
414
  */
415
  public function render_settings_hide_for_users() {
416
+ $options = Advanced_Ads::get_instance()->options();
417
+ if ( isset( $options['hide-for-user-role'] ) ) {
418
+ $hide_for_roles = Advanced_Ads_Utils::maybe_translate_cap_to_role( $options['hide-for-user-role'] );
419
+ } else {
420
+ $hide_for_roles = array();
421
+ }
422
+
423
+ global $wp_roles;
424
+ $roles = $wp_roles->get_names();
425
+
426
+ echo '<div id="advads-settings-hide-by-user-role">';
427
+ foreach ( $roles as $_role => $_display_name ) {
428
+ $checked = in_array( $_role, $hide_for_roles, true );
429
+ echo '<label><input type="checkbox" value="' . esc_attr( $_role ) . '" name="' . ADVADS_SLUG . '[hide-for-user-role][]" '
430
+ . checked( $checked, true, false ) . '>' . esc_html( $_display_name ) . '</label>';
431
  }
432
+ echo '</div>';
433
 
434
+ echo '<p class="description">' . esc_html__( 'Choose the roles a user must have in order to not see any ads.', 'advanced-ads' ) . '</p>';
435
  }
436
 
437
  /**
520
  echo '<p class="description">' . __( 'Hide ads from crawlers, bots and empty user agents.', 'advanced-ads' ) . '</p>';
521
  }
522
 
523
+ /**
524
+ * render setting to disable ads by post types
525
+ *
526
+ * @since 1.13.5
527
+ */
528
+ public function render_settings_disable_post_types(){
529
+
530
+ $post_types = get_post_types( array( 'public' => true, 'publicly_queryable' => true ), 'objects', 'or' );
531
+ $type_label_counts = array_count_values( wp_list_pluck( $post_types, 'label' ) );
532
+
533
+ echo '<p><a href="' . ADVADS_URL . 'add-ons/advanced-ads-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=pitch-pro-disable-post-type' . '" target="_blank">'. __( 'Pro feature', 'advanced-ads' ) .'</a></p>';
534
+
535
+ require ADVADS_BASE_PATH . '/admin/views/setting-disable-post-types.php';
536
+ }
537
+
538
  /**
539
  * render setting to disable notices
540
  *
admin/views/setting-disable-post-types.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ foreach ( $post_types as $_type_id => $_type ) {
3
+
4
+ if ( $type_label_counts[ $_type->label ] < 2 ) {
5
+ $_label = $_type->label;
6
+ } else {
7
+ $_label = sprintf( '%s (%s)', $_type->label, $_type_id );
8
+ }
9
+ ?>
10
+ <label style="margin-right: 1em;"><input type="checkbox" disabled="disabled"><?php esc_html_e( $_label ); ?></label><?php
11
+ }
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.13.4
16
  * Author: Thomas Maier
17
  * Author URI: https://wpadvancedads.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
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
- define( 'ADVADS_VERSION', '1.13.4' );
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.13.5
16
  * Author: Thomas Maier
17
  * Author URI: https://wpadvancedads.com
18
  * Text Domain: advanced-ads
39
  // general and global slug, e.g. to store options in WP
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
+ define( 'ADVADS_VERSION', '1.13.5' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
classes/ad-health-notices.php CHANGED
@@ -156,6 +156,13 @@ class Advanced_Ads_Ad_Health_Notices {
156
  // load notices from "notices".
157
  $this->notices = isset( $options['notices'] ) ? $options['notices'] : array();
158
 
 
 
 
 
 
 
 
159
  // load hidden notices.
160
  $this->ignore = $this->get_valid_ignored();
161
 
@@ -369,13 +376,6 @@ class Advanced_Ads_Ad_Health_Notices {
369
  }
370
  }
371
 
372
- // cleanup due to an issue fixed after 1.13.3.
373
- foreach ( $notices as $_key => $_notice ) {
374
- if ( empty( $_key ) ) {
375
- unset( $notices[ $_key ] );
376
- }
377
- }
378
-
379
  // update db.
380
  $options['notices'] = $this->notices = $notices;
381
  $this->update_options( $options );
156
  // load notices from "notices".
157
  $this->notices = isset( $options['notices'] ) ? $options['notices'] : array();
158
 
159
+ // cleanup notices without valid key caused by an issue prior to 1.13.3.
160
+ foreach ( $this->notices as $_key => $_notice ) {
161
+ if ( empty( $_key ) ) {
162
+ unset( $this->notices[ $_key ] );
163
+ }
164
+ }
165
+
166
  // load hidden notices.
167
  $this->ignore = $this->get_valid_ignored();
168
 
376
  }
377
  }
378
 
 
 
 
 
 
 
 
379
  // update db.
380
  $options['notices'] = $this->notices = $notices;
381
  $this->update_options( $options );
classes/ad.php CHANGED
@@ -300,11 +300,19 @@ class Advanced_Ads_Ad {
300
  // if ( method_exists( 'Advanced_Ads_Tracking_Plugin' , 'check_ad_tracking_enabled' ) ) {
301
  // if ( class_exists( 'Advanced_Ads_Tracking_Plugin', false ) ) {
302
  if ( defined( 'AAT_VERSION' ) && -1 < version_compare( AAT_VERSION, '1.4.2' ) ) {
 
303
  $new_ad['tracking_enabled'] = Advanced_Ads_Tracking_Plugin::get_instance()->check_ad_tracking_enabled( $this );
 
 
 
 
 
 
304
  }
 
305
  $advads->current_ads[] = $new_ad;
306
  }
307
-
308
  // action when output is created
309
  do_action( 'advanced-ads-output', $this, $output, $output_options );
310
 
300
  // if ( method_exists( 'Advanced_Ads_Tracking_Plugin' , 'check_ad_tracking_enabled' ) ) {
301
  // if ( class_exists( 'Advanced_Ads_Tracking_Plugin', false ) ) {
302
  if ( defined( 'AAT_VERSION' ) && -1 < version_compare( AAT_VERSION, '1.4.2' ) ) {
303
+
304
  $new_ad['tracking_enabled'] = Advanced_Ads_Tracking_Plugin::get_instance()->check_ad_tracking_enabled( $this );
305
+
306
+ $tracking_options = Advanced_Ads_Tracking_Plugin::get_instance()->options();
307
+ if ( 'frontend' == $tracking_options['method'] && isset( $this->output['placement_id'] ) ) {
308
+ $new_ad['placement_id'] = $this->output['placement_id'];
309
+ }
310
+
311
  }
312
+
313
  $advads->current_ads[] = $new_ad;
314
  }
315
+
316
  // action when output is created
317
  do_action( 'advanced-ads-output', $this, $output, $output_options );
318
 
classes/checks.php CHANGED
@@ -10,7 +10,7 @@ class Advanced_Ads_Checks {
10
  /**
11
  * Minimum required PHP version of Advanced Ads
12
  */
13
- const MINIMUM_PHP_VERSION = 5.4;
14
 
15
 
16
  /**
@@ -21,9 +21,9 @@ class Advanced_Ads_Checks {
21
  }
22
 
23
  /**
24
- * php version minimum 5.4
25
  *
26
- * @return bool true if 5.4 and higher
27
  */
28
  public static function php_version_minimum(){
29
 
10
  /**
11
  * Minimum required PHP version of Advanced Ads
12
  */
13
+ const MINIMUM_PHP_VERSION = '5.6.20';
14
 
15
 
16
  /**
21
  }
22
 
23
  /**
24
+ * PHP version minimum
25
  *
26
+ * @return bool true if uses the minimum PHP version or higher
27
  */
28
  public static function php_version_minimum(){
29
 
classes/frontend_checks.php CHANGED
@@ -540,8 +540,8 @@ class Advanced_Ads_Frontend_Checks {
540
  jQuery( 'ins.adsbygoogle', context ).each( function() {
541
  // The parent container is invisible.
542
  if( ! jQuery( this ).parent().is(':visible') ){
543
- advads_ad_health_check_adsense_hidden_ids.push( this.dataset.adSlot );
544
- advanced_ads_frontend_checks.add_item_to_notices( 'adsense_hidden', { mode: 'add', append_key: this.dataset.adSlot, append_text: ' AdSense ID: ' + this.dataset.adSlot + ' URL: ' + window.location + ', ' + jQuery( document ).width() + 'px' } );
545
  }
546
 
547
  // Zero width, perhaps because a parent container is floated
@@ -550,7 +550,7 @@ class Advanced_Ads_Frontend_Checks {
550
  }
551
  });
552
  if( advads_ad_health_check_adsense_hidden_ids.length ){
553
- advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_hidden_adsense', advads_ad_health_check_adsense_hidden_ids );
554
  }
555
  if ( responsive_zero_width.length ) {
556
  advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_floated_responsive_adsense', responsive_zero_width );
@@ -609,7 +609,7 @@ class Advanced_Ads_Frontend_Checks {
609
  // show hint if AdSense Auto ads are enabled
610
  setTimeout( function(){
611
  advanced_ads_ready( advanced_ads_frontend_checks.advads_highlight_hidden_adsense );
612
- advads_highlight_adsense_auto_ads();
613
  }, 2000 );
614
 
615
  // highlight AdSense Auto Ads ads 3 seconds after site loaded
@@ -618,14 +618,14 @@ class Advanced_Ads_Frontend_Checks {
618
  }, 3000 );
619
  function advads_highlight_adsense_autoads(){
620
  if ( ! window.jQuery ) {
621
- window.console && window.console.log( 'Advanced Ads: jQuery not found. Some Ad Health warnings will not be shown' );
622
  return;
623
  }
624
  var autoads_ads = jQuery(document).find('.google-auto-placed');
625
- jQuery( '<p class="advads-autoads-hint" style="background-color:#0085ba;color:#fff;font-size:0.8em;padding:5px;"><?php
626
  printf(__( 'This ad 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-auto-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=frontend-autoads-ads' );
627
- ?></p>' ).prependTo( autoads_ads );
628
- // show Auto Ads warning in Adhealth Bar if relevant
629
  if( autoads_ads.length ){
630
  var advads_autoads_link = document.querySelector( '#wp-admin-bar-advanced_ads_autoads_displayed.hidden' );
631
  if ( advads_autoads_link ) {
540
  jQuery( 'ins.adsbygoogle', context ).each( function() {
541
  // The parent container is invisible.
542
  if( ! jQuery( this ).parent().is(':visible') ){
543
+ // advads_ad_health_check_adsense_hidden_ids.push( this.dataset.adSlot );
544
+ // advanced_ads_frontend_checks.add_item_to_notices( 'adsense_hidden', { mode: 'add', append_key: this.dataset.adSlot, append_text: ' AdSense ID: ' + this.dataset.adSlot + ' URL: ' + window.location + ', ' + jQuery( document ).width() + 'px' } );
545
  }
546
 
547
  // Zero width, perhaps because a parent container is floated
550
  }
551
  });
552
  if( advads_ad_health_check_adsense_hidden_ids.length ){
553
+ // advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_hidden_adsense', advads_ad_health_check_adsense_hidden_ids );
554
  }
555
  if ( responsive_zero_width.length ) {
556
  advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_floated_responsive_adsense', responsive_zero_width );
609
  // show hint if AdSense Auto ads are enabled
610
  setTimeout( function(){
611
  advanced_ads_ready( advanced_ads_frontend_checks.advads_highlight_hidden_adsense );
612
+ advanced_ads_ready( advads_highlight_adsense_auto_ads );
613
  }, 2000 );
614
 
615
  // highlight AdSense Auto Ads ads 3 seconds after site loaded
618
  }, 3000 );
619
  function advads_highlight_adsense_autoads(){
620
  if ( ! window.jQuery ) {
621
+ window.console && window.console.log( 'Advanced Ads: jQuery not found. Some Ad Health warnings will not be displayed.' );
622
  return;
623
  }
624
  var autoads_ads = jQuery(document).find('.google-auto-placed');
625
+ <?php /* jQuery( '<p class="advads-autoads-hint" style="background-color:#0085ba;color:#fff;font-size:0.8em;padding:5px;"><?php
626
  printf(__( 'This ad 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-auto-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=frontend-autoads-ads' );
627
+ ?></p>' ).prependTo( autoads_ads ); */ ?>
628
+ // show Auto Ads warning in Ad Health bar if relevant
629
  if( autoads_ads.length ){
630
  var advads_autoads_link = document.querySelector( '#wp-admin-bar-advanced_ads_autoads_displayed.hidden' );
631
  if ( advads_autoads_link ) {
classes/utils.php CHANGED
@@ -126,5 +126,33 @@ class Advanced_Ads_Utils {
126
  }
127
  return $result;
128
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  }
130
  ?>
126
  }
127
  return $result;
128
  }
129
+
130
+ /**
131
+ * Maybe translate a capability to a set of roles.
132
+ *
133
+ * @param string/array $roles_or_caps A set of roles or capabilities.
134
+ * @return array $roles A list of roles.
135
+ */
136
+ public static function maybe_translate_cap_to_role( $roles_or_caps ) {
137
+ global $wp_roles;
138
+
139
+ $roles_or_caps = (array) $roles_or_caps;
140
+ $roles = array();
141
+
142
+ foreach ( $roles_or_caps as $cap ) {
143
+ if ( $wp_roles->is_role( $cap ) ){
144
+ $roles[] = $cap;
145
+ continue;
146
+ }
147
+
148
+ foreach ( $wp_roles->roles as $id => $role ) {
149
+ if ( isset( $role['capabilities'][ $cap ] ) ) {
150
+ $roles[] = $id;
151
+ }
152
+ }
153
+ }
154
+
155
+ return array_unique( $roles );
156
+ }
157
  }
158
  ?>
languages/advanced-ads.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Advanved Ads\n"
5
  "Report-Msgid-Bugs-To: http://wordpress.org/plugins/plugin-name\n"
6
- "POT-Creation-Date: 2019-04-24 11:35+0000\n"
7
  "POT-Revision-Date: Wed Jul 13 2016 13:23:05 GMT+0200 (CEST)\n"
8
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
9
  "Last-Translator: Thomas Maier <post@webzunft.de>\n"
@@ -95,11 +95,11 @@ msgid "main query"
95
  msgstr ""
96
 
97
  #: classes/ad-debug.php:118 classes/ad-debug.php:167 classes/ad-debug.php:169
98
- #: public/class-advanced-ads.php:712 admin/views/ad-group-list-ads.php:13
99
  msgid "Ad"
100
  msgstr ""
101
 
102
- #: classes/ad-debug.php:121 public/class-advanced-ads.php:675
103
  msgctxt "ad group singular name"
104
  msgid "Ad Group"
105
  msgstr ""
@@ -528,7 +528,7 @@ msgstr ""
528
  msgid "Random AdSense ads"
529
  msgstr ""
530
 
531
- #: classes/frontend_checks.php:105 admin/includes/class-settings.php:506
532
  msgid "You look like a bot"
533
  msgstr ""
534
 
@@ -632,14 +632,6 @@ msgid ""
632
  "admins"
633
  msgstr ""
634
 
635
- #: classes/frontend_checks.php:626
636
- #, php-format
637
- msgid ""
638
- "This ad was automatically placed here by AdSense. <a href=\"%s\" "
639
- "target=\"_blank\" style=\"color:#fff;border-color:#fff;\">Click here to "
640
- "learn more</a>."
641
- msgstr ""
642
-
643
  #: classes/visitor-conditions.php:32
644
  msgid "device"
645
  msgstr ""
@@ -713,7 +705,7 @@ msgstr ""
713
  msgid "Ad Groups"
714
  msgstr ""
715
 
716
- #: classes/widget.php:93 public/class-advanced-ads.php:711
717
  #: admin/includes/class-menu.php:68 admin/includes/class-menu.php:68
718
  #: admin/includes/class-shortcode-creator.php:84
719
  #: admin/views/ad-group-list-form-row.php:90
@@ -759,61 +751,61 @@ msgstr ""
759
  msgid "Advanced Ads Error: %s"
760
  msgstr ""
761
 
762
- #: public/class-advanced-ads.php:674
763
  msgctxt "ad group general name"
764
  msgid "Ad Groups & Rotations"
765
  msgstr ""
766
 
767
- #: public/class-advanced-ads.php:676
768
  msgid "Search Ad Groups"
769
  msgstr ""
770
 
771
- #: public/class-advanced-ads.php:677
772
  msgid "All Ad Groups"
773
  msgstr ""
774
 
775
- #: public/class-advanced-ads.php:678
776
  msgid "Parent Ad Groups"
777
  msgstr ""
778
 
779
- #: public/class-advanced-ads.php:679
780
  msgid "Parent Ad Groups:"
781
  msgstr ""
782
 
783
- #: public/class-advanced-ads.php:680
784
  msgid "Edit Ad Group"
785
  msgstr ""
786
 
787
- #: public/class-advanced-ads.php:681
788
  msgid "Update Ad Group"
789
  msgstr ""
790
 
791
- #: public/class-advanced-ads.php:682
792
  msgid "Add New Ad Group"
793
  msgstr ""
794
 
795
- #: public/class-advanced-ads.php:683
796
  msgid "New Ad Groups Name"
797
  msgstr ""
798
 
799
- #: public/class-advanced-ads.php:684 modules/import-export/views/page.php:24
800
  msgid "Groups"
801
  msgstr ""
802
 
803
- #: public/class-advanced-ads.php:685
804
  msgid "No Ad Group found"
805
  msgstr ""
806
 
807
- #: public/class-advanced-ads.php:713 public/class-advanced-ads.php:717
808
  #: admin/includes/class-menu.php:85 admin/views/ad-group-list-ads.php:28
809
  msgid "New Ad"
810
  msgstr ""
811
 
812
- #: public/class-advanced-ads.php:714 admin/includes/class-menu.php:85
813
  msgid "Add New Ad"
814
  msgstr ""
815
 
816
- #: public/class-advanced-ads.php:715
817
  #: admin/includes/class-ad-groups-list.php:313
818
  #: modules/import-export/classes/import.php:146
819
  #: modules/import-export/classes/import.php:186
@@ -821,35 +813,35 @@ msgstr ""
821
  msgid "Edit"
822
  msgstr ""
823
 
824
- #: public/class-advanced-ads.php:716
825
  msgid "Edit Ad"
826
  msgstr ""
827
 
828
- #: public/class-advanced-ads.php:718
829
  msgid "View"
830
  msgstr ""
831
 
832
- #: public/class-advanced-ads.php:719
833
  msgid "View the Ad"
834
  msgstr ""
835
 
836
- #: public/class-advanced-ads.php:720
837
  msgid "Search Ads"
838
  msgstr ""
839
 
840
- #: public/class-advanced-ads.php:721
841
  msgid "No Ads found"
842
  msgstr ""
843
 
844
- #: public/class-advanced-ads.php:722
845
  msgid "No Ads found in Trash"
846
  msgstr ""
847
 
848
- #: public/class-advanced-ads.php:723
849
  msgid "Parent Ad"
850
  msgstr ""
851
 
852
- #: public/class-advanced-ads.php:881
853
  msgctxt "label above ads"
854
  msgid "Advertisements"
855
  msgstr ""
@@ -1268,7 +1260,7 @@ msgid "Ad Stats"
1268
  msgstr ""
1269
 
1270
  #: admin/includes/class-meta-box.php:140 admin/includes/class-meta-box.php:151
1271
- #: admin/includes/class-meta-box.php:156 admin/includes/class-settings.php:584
1272
  #: admin/views/ad-output-metabox.php:81
1273
  #: modules/ads-txt/admin/views/setting-create.php:11
1274
  #: modules/privacy/admin/views/setting-enable.php:2
@@ -1534,7 +1526,7 @@ msgstr ""
1534
  msgid "Get this add-on"
1535
  msgstr ""
1536
 
1537
- #: admin/includes/class-settings.php:50 admin/includes/class-settings.php:415
1538
  msgid "Admin"
1539
  msgstr ""
1540
 
@@ -1547,7 +1539,7 @@ msgid "Content injection"
1547
  msgstr ""
1548
 
1549
  #: admin/includes/class-settings.php:136
1550
- msgid "Hide ads for logged in users"
1551
  msgstr ""
1552
 
1553
  #: admin/includes/class-settings.php:144
@@ -1562,103 +1554,87 @@ msgstr ""
1562
  msgid "Hide ads from bots"
1563
  msgstr ""
1564
 
1565
- #: admin/includes/class-settings.php:176
 
 
 
 
1566
  msgid "Disable Ad Health and other notices"
1567
  msgstr ""
1568
 
1569
- #: admin/includes/class-settings.php:184
1570
  msgid "ID prefix"
1571
  msgstr ""
1572
 
1573
- #: admin/includes/class-settings.php:192
1574
  msgid "Allow editors to manage ads"
1575
  msgstr ""
1576
 
1577
- #: admin/includes/class-settings.php:200
1578
  msgid "Ad label"
1579
  msgstr ""
1580
 
1581
- #: admin/includes/class-settings.php:209
1582
  msgid "Open links in a new window"
1583
  msgstr ""
1584
 
1585
- #: admin/includes/class-settings.php:217
1586
  msgid "Use advanced JavaScript"
1587
  msgstr ""
1588
 
1589
- #: admin/includes/class-settings.php:227
1590
  msgid "Delete data on uninstall"
1591
  msgstr ""
1592
 
1593
- #: admin/includes/class-settings.php:237
1594
  msgid "Disable shortcode button"
1595
  msgstr ""
1596
 
1597
- #: admin/includes/class-settings.php:259
1598
  msgid "Licenses"
1599
  msgstr ""
1600
 
1601
- #: admin/includes/class-settings.php:276
1602
  msgid "Pro"
1603
  msgstr ""
1604
 
1605
- #: admin/includes/class-settings.php:292 admin/views/pitch-tracking.php:2
1606
  msgid "Tracking"
1607
  msgstr ""
1608
 
1609
- #: admin/includes/class-settings.php:340
1610
  #, php-format
1611
  msgid ""
1612
  "Enter license keys for our powerful <a href=\"%s\" target=\"_blank\">add-"
1613
  "ons</a>."
1614
  msgstr ""
1615
 
1616
- #: admin/includes/class-settings.php:341
1617
  #, php-format
1618
  msgid ""
1619
  "See also <a href=\"%s\" target=\"_blank\">Issues and questions about "
1620
  "licenses</a>."
1621
  msgstr ""
1622
 
1623
- #: admin/includes/class-settings.php:353
1624
  msgid "Are you missing something?"
1625
  msgstr ""
1626
 
1627
- #: admin/includes/class-settings.php:356
1628
  msgid "How to install and activate an add-on."
1629
  msgstr ""
1630
 
1631
- #: admin/includes/class-settings.php:410
1632
- msgid "(display to all)"
1633
- msgstr ""
1634
-
1635
- #: admin/includes/class-settings.php:411
1636
- msgid "Subscriber"
1637
- msgstr ""
1638
-
1639
- #: admin/includes/class-settings.php:412
1640
- msgid "Contributor"
1641
  msgstr ""
1642
 
1643
- #: admin/includes/class-settings.php:413
1644
- msgid "Author"
1645
- msgstr ""
1646
-
1647
- #: admin/includes/class-settings.php:414
1648
- msgid "Editor"
1649
- msgstr ""
1650
-
1651
- #: admin/includes/class-settings.php:423
1652
- msgid "Choose the lowest role a user must have in order to not see any ads."
1653
- msgstr ""
1654
-
1655
- #: admin/includes/class-settings.php:437
1656
  msgid ""
1657
  "<strong>notice: </strong>the file is currently enabled by an add-on that "
1658
  "needs it."
1659
  msgstr ""
1660
 
1661
- #: admin/includes/class-settings.php:440
1662
  #, php-format
1663
  msgid ""
1664
  "Enable advanced JavaScript functions (<a href=\"%s\" target=\"_blank\">"
@@ -1666,7 +1642,7 @@ msgid ""
1666
  "need features from this file."
1667
  msgstr ""
1668
 
1669
- #: admin/includes/class-settings.php:460
1670
  msgid ""
1671
  "Some plugins and themes trigger ad injections where it shouldn’t happen. "
1672
  "Therefore, Advanced Ads ignores injected placements on non-singular pages "
@@ -1676,73 +1652,77 @@ msgid ""
1676
  "injection only in the first x posts on your archive pages."
1677
  msgstr ""
1678
 
1679
- #: admin/includes/class-settings.php:476
1680
  msgid ""
1681
  "Please check your post content. A priority of 10 and below might cause "
1682
  "issues (wpautop function might run twice)."
1683
  msgstr ""
1684
 
1685
- #: admin/includes/class-settings.php:478
1686
  msgid ""
1687
  "Play with this value in order to change the priority of the injected ads "
1688
  "compared to other auto injected elements in the post content."
1689
  msgstr ""
1690
 
1691
- #: admin/includes/class-settings.php:492
1692
  msgid ""
1693
  "Advanced Ads ignores paragraphs and other elements in containers when "
1694
  "injecting ads into the post content. Check this option to ignore this "
1695
  "limitation and ads might show up again."
1696
  msgstr ""
1697
 
1698
- #: admin/includes/class-settings.php:508
1699
  msgid "Read this first"
1700
  msgstr ""
1701
 
1702
- #: admin/includes/class-settings.php:509
1703
  msgid "Hide ads from crawlers, bots and empty user agents."
1704
  msgstr ""
1705
 
 
 
 
 
1706
  #. %1$s is a starting <a> tag and %2$s a closing one
1707
- #: admin/includes/class-settings.php:525
1708
  #, php-format
1709
  msgid ""
1710
  "Disable %1$sAd Health%2$s in frontend and backend, warnings and internal "
1711
  "notices like tips, tutorials, email newsletters and update notices."
1712
  msgstr ""
1713
 
1714
- #: admin/includes/class-settings.php:543
1715
  msgid ""
1716
  "Prefix of class or id attributes in the frontend. Change it if you don’t "
1717
  "want <strong>ad blockers</strong> to mark these blocks as ads.<br/>You might "
1718
  "need to <strong>rewrite css rules afterwards</strong>."
1719
  msgstr ""
1720
 
1721
- #: admin/includes/class-settings.php:562
1722
  msgid "Allow editors to also manage and publish ads."
1723
  msgstr ""
1724
 
1725
- #: admin/includes/class-settings.php:563
1726
  #, php-format
1727
  msgid ""
1728
  "You can assign different ad-related roles on a user basis with <a "
1729
  "href=\"%s\" target=\"_blank\">Advanced Ads Pro</a>."
1730
  msgstr ""
1731
 
1732
- #: admin/includes/class-settings.php:574
1733
  msgctxt "label before ads"
1734
  msgid "Advertisements"
1735
  msgstr ""
1736
 
1737
- #: admin/includes/class-settings.php:583
1738
  msgid "Displayed above ads."
1739
  msgstr ""
1740
 
1741
- #: admin/includes/class-settings.php:620
1742
  msgid "Clean up all data related to Advanced Ads when removing the plugin."
1743
  msgstr ""
1744
 
1745
- #: admin/includes/class-settings.php:633
1746
  msgid "Disable shortcode button in visual editor."
1747
  msgstr ""
1748
 
3
  msgstr ""
4
  "Project-Id-Version: Advanved Ads\n"
5
  "Report-Msgid-Bugs-To: http://wordpress.org/plugins/plugin-name\n"
6
+ "POT-Creation-Date: 2019-05-16 07:05+0000\n"
7
  "POT-Revision-Date: Wed Jul 13 2016 13:23:05 GMT+0200 (CEST)\n"
8
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
9
  "Last-Translator: Thomas Maier <post@webzunft.de>\n"
95
  msgstr ""
96
 
97
  #: classes/ad-debug.php:118 classes/ad-debug.php:167 classes/ad-debug.php:169
98
+ #: public/class-advanced-ads.php:722 admin/views/ad-group-list-ads.php:13
99
  msgid "Ad"
100
  msgstr ""
101
 
102
+ #: classes/ad-debug.php:121 public/class-advanced-ads.php:685
103
  msgctxt "ad group singular name"
104
  msgid "Ad Group"
105
  msgstr ""
528
  msgid "Random AdSense ads"
529
  msgstr ""
530
 
531
+ #: classes/frontend_checks.php:105 admin/includes/class-settings.php:517
532
  msgid "You look like a bot"
533
  msgstr ""
534
 
632
  "admins"
633
  msgstr ""
634
 
 
 
 
 
 
 
 
 
635
  #: classes/visitor-conditions.php:32
636
  msgid "device"
637
  msgstr ""
705
  msgid "Ad Groups"
706
  msgstr ""
707
 
708
+ #: classes/widget.php:93 public/class-advanced-ads.php:721
709
  #: admin/includes/class-menu.php:68 admin/includes/class-menu.php:68
710
  #: admin/includes/class-shortcode-creator.php:84
711
  #: admin/views/ad-group-list-form-row.php:90
751
  msgid "Advanced Ads Error: %s"
752
  msgstr ""
753
 
754
+ #: public/class-advanced-ads.php:684
755
  msgctxt "ad group general name"
756
  msgid "Ad Groups & Rotations"
757
  msgstr ""
758
 
759
+ #: public/class-advanced-ads.php:686
760
  msgid "Search Ad Groups"
761
  msgstr ""
762
 
763
+ #: public/class-advanced-ads.php:687
764
  msgid "All Ad Groups"
765
  msgstr ""
766
 
767
+ #: public/class-advanced-ads.php:688
768
  msgid "Parent Ad Groups"
769
  msgstr ""
770
 
771
+ #: public/class-advanced-ads.php:689
772
  msgid "Parent Ad Groups:"
773
  msgstr ""
774
 
775
+ #: public/class-advanced-ads.php:690
776
  msgid "Edit Ad Group"
777
  msgstr ""
778
 
779
+ #: public/class-advanced-ads.php:691
780
  msgid "Update Ad Group"
781
  msgstr ""
782
 
783
+ #: public/class-advanced-ads.php:692
784
  msgid "Add New Ad Group"
785
  msgstr ""
786
 
787
+ #: public/class-advanced-ads.php:693
788
  msgid "New Ad Groups Name"
789
  msgstr ""
790
 
791
+ #: public/class-advanced-ads.php:694 modules/import-export/views/page.php:24
792
  msgid "Groups"
793
  msgstr ""
794
 
795
+ #: public/class-advanced-ads.php:695
796
  msgid "No Ad Group found"
797
  msgstr ""
798
 
799
+ #: public/class-advanced-ads.php:723 public/class-advanced-ads.php:727
800
  #: admin/includes/class-menu.php:85 admin/views/ad-group-list-ads.php:28
801
  msgid "New Ad"
802
  msgstr ""
803
 
804
+ #: public/class-advanced-ads.php:724 admin/includes/class-menu.php:85
805
  msgid "Add New Ad"
806
  msgstr ""
807
 
808
+ #: public/class-advanced-ads.php:725
809
  #: admin/includes/class-ad-groups-list.php:313
810
  #: modules/import-export/classes/import.php:146
811
  #: modules/import-export/classes/import.php:186
813
  msgid "Edit"
814
  msgstr ""
815
 
816
+ #: public/class-advanced-ads.php:726
817
  msgid "Edit Ad"
818
  msgstr ""
819
 
820
+ #: public/class-advanced-ads.php:728
821
  msgid "View"
822
  msgstr ""
823
 
824
+ #: public/class-advanced-ads.php:729
825
  msgid "View the Ad"
826
  msgstr ""
827
 
828
+ #: public/class-advanced-ads.php:730
829
  msgid "Search Ads"
830
  msgstr ""
831
 
832
+ #: public/class-advanced-ads.php:731
833
  msgid "No Ads found"
834
  msgstr ""
835
 
836
+ #: public/class-advanced-ads.php:732
837
  msgid "No Ads found in Trash"
838
  msgstr ""
839
 
840
+ #: public/class-advanced-ads.php:733
841
  msgid "Parent Ad"
842
  msgstr ""
843
 
844
+ #: public/class-advanced-ads.php:891
845
  msgctxt "label above ads"
846
  msgid "Advertisements"
847
  msgstr ""
1260
  msgstr ""
1261
 
1262
  #: admin/includes/class-meta-box.php:140 admin/includes/class-meta-box.php:151
1263
+ #: admin/includes/class-meta-box.php:156 admin/includes/class-settings.php:610
1264
  #: admin/views/ad-output-metabox.php:81
1265
  #: modules/ads-txt/admin/views/setting-create.php:11
1266
  #: modules/privacy/admin/views/setting-enable.php:2
1526
  msgid "Get this add-on"
1527
  msgstr ""
1528
 
1529
+ #: admin/includes/class-settings.php:50
1530
  msgid "Admin"
1531
  msgstr ""
1532
 
1539
  msgstr ""
1540
 
1541
  #: admin/includes/class-settings.php:136
1542
+ msgid "Hide ads for user roles"
1543
  msgstr ""
1544
 
1545
  #: admin/includes/class-settings.php:144
1554
  msgid "Hide ads from bots"
1555
  msgstr ""
1556
 
1557
+ #: admin/includes/class-settings.php:177
1558
+ msgid "Disable ads for post types"
1559
+ msgstr ""
1560
+
1561
+ #: admin/includes/class-settings.php:186
1562
  msgid "Disable Ad Health and other notices"
1563
  msgstr ""
1564
 
1565
+ #: admin/includes/class-settings.php:194
1566
  msgid "ID prefix"
1567
  msgstr ""
1568
 
1569
+ #: admin/includes/class-settings.php:202
1570
  msgid "Allow editors to manage ads"
1571
  msgstr ""
1572
 
1573
+ #: admin/includes/class-settings.php:210
1574
  msgid "Ad label"
1575
  msgstr ""
1576
 
1577
+ #: admin/includes/class-settings.php:219
1578
  msgid "Open links in a new window"
1579
  msgstr ""
1580
 
1581
+ #: admin/includes/class-settings.php:227
1582
  msgid "Use advanced JavaScript"
1583
  msgstr ""
1584
 
1585
+ #: admin/includes/class-settings.php:237
1586
  msgid "Delete data on uninstall"
1587
  msgstr ""
1588
 
1589
+ #: admin/includes/class-settings.php:247
1590
  msgid "Disable shortcode button"
1591
  msgstr ""
1592
 
1593
+ #: admin/includes/class-settings.php:269
1594
  msgid "Licenses"
1595
  msgstr ""
1596
 
1597
+ #: admin/includes/class-settings.php:286
1598
  msgid "Pro"
1599
  msgstr ""
1600
 
1601
+ #: admin/includes/class-settings.php:302 admin/views/pitch-tracking.php:2
1602
  msgid "Tracking"
1603
  msgstr ""
1604
 
1605
+ #: admin/includes/class-settings.php:350
1606
  #, php-format
1607
  msgid ""
1608
  "Enter license keys for our powerful <a href=\"%s\" target=\"_blank\">add-"
1609
  "ons</a>."
1610
  msgstr ""
1611
 
1612
+ #: admin/includes/class-settings.php:351
1613
  #, php-format
1614
  msgid ""
1615
  "See also <a href=\"%s\" target=\"_blank\">Issues and questions about "
1616
  "licenses</a>."
1617
  msgstr ""
1618
 
1619
+ #: admin/includes/class-settings.php:363
1620
  msgid "Are you missing something?"
1621
  msgstr ""
1622
 
1623
+ #: admin/includes/class-settings.php:366
1624
  msgid "How to install and activate an add-on."
1625
  msgstr ""
1626
 
1627
+ #: admin/includes/class-settings.php:434
1628
+ msgid "Choose the roles a user must have in order to not see any ads."
 
 
 
 
 
 
 
 
1629
  msgstr ""
1630
 
1631
+ #: admin/includes/class-settings.php:448
 
 
 
 
 
 
 
 
 
 
 
 
1632
  msgid ""
1633
  "<strong>notice: </strong>the file is currently enabled by an add-on that "
1634
  "needs it."
1635
  msgstr ""
1636
 
1637
+ #: admin/includes/class-settings.php:451
1638
  #, php-format
1639
  msgid ""
1640
  "Enable advanced JavaScript functions (<a href=\"%s\" target=\"_blank\">"
1642
  "need features from this file."
1643
  msgstr ""
1644
 
1645
+ #: admin/includes/class-settings.php:471
1646
  msgid ""
1647
  "Some plugins and themes trigger ad injections where it shouldn’t happen. "
1648
  "Therefore, Advanced Ads ignores injected placements on non-singular pages "
1652
  "injection only in the first x posts on your archive pages."
1653
  msgstr ""
1654
 
1655
+ #: admin/includes/class-settings.php:487
1656
  msgid ""
1657
  "Please check your post content. A priority of 10 and below might cause "
1658
  "issues (wpautop function might run twice)."
1659
  msgstr ""
1660
 
1661
+ #: admin/includes/class-settings.php:489
1662
  msgid ""
1663
  "Play with this value in order to change the priority of the injected ads "
1664
  "compared to other auto injected elements in the post content."
1665
  msgstr ""
1666
 
1667
+ #: admin/includes/class-settings.php:503
1668
  msgid ""
1669
  "Advanced Ads ignores paragraphs and other elements in containers when "
1670
  "injecting ads into the post content. Check this option to ignore this "
1671
  "limitation and ads might show up again."
1672
  msgstr ""
1673
 
1674
+ #: admin/includes/class-settings.php:519
1675
  msgid "Read this first"
1676
  msgstr ""
1677
 
1678
+ #: admin/includes/class-settings.php:520
1679
  msgid "Hide ads from crawlers, bots and empty user agents."
1680
  msgstr ""
1681
 
1682
+ #: admin/includes/class-settings.php:533
1683
+ msgid "Pro feature"
1684
+ msgstr ""
1685
+
1686
  #. %1$s is a starting <a> tag and %2$s a closing one
1687
+ #: admin/includes/class-settings.php:551
1688
  #, php-format
1689
  msgid ""
1690
  "Disable %1$sAd Health%2$s in frontend and backend, warnings and internal "
1691
  "notices like tips, tutorials, email newsletters and update notices."
1692
  msgstr ""
1693
 
1694
+ #: admin/includes/class-settings.php:569
1695
  msgid ""
1696
  "Prefix of class or id attributes in the frontend. Change it if you don’t "
1697
  "want <strong>ad blockers</strong> to mark these blocks as ads.<br/>You might "
1698
  "need to <strong>rewrite css rules afterwards</strong>."
1699
  msgstr ""
1700
 
1701
+ #: admin/includes/class-settings.php:588
1702
  msgid "Allow editors to also manage and publish ads."
1703
  msgstr ""
1704
 
1705
+ #: admin/includes/class-settings.php:589
1706
  #, php-format
1707
  msgid ""
1708
  "You can assign different ad-related roles on a user basis with <a "
1709
  "href=\"%s\" target=\"_blank\">Advanced Ads Pro</a>."
1710
  msgstr ""
1711
 
1712
+ #: admin/includes/class-settings.php:600
1713
  msgctxt "label before ads"
1714
  msgid "Advertisements"
1715
  msgstr ""
1716
 
1717
+ #: admin/includes/class-settings.php:609
1718
  msgid "Displayed above ads."
1719
  msgstr ""
1720
 
1721
+ #: admin/includes/class-settings.php:646
1722
  msgid "Clean up all data related to Advanced Ads when removing the plugin."
1723
  msgstr ""
1724
 
1725
+ #: admin/includes/class-settings.php:659
1726
  msgid "Disable shortcode button in visual editor."
1727
  msgstr ""
1728
 
public/class-advanced-ads.php CHANGED
@@ -574,10 +574,14 @@ class Advanced_Ads {
574
  return false;
575
  }
576
 
577
- $see_ads_capability = isset( $options['hide-for-user-role'] ) && '' !== $options['hide-for-user-role'] ? $options['hide-for-user-role'] : false;
 
 
 
 
 
578
 
579
- // check if user is logged in and if so if users with his rights can see ads.
580
- if ( $see_ads_capability && is_user_logged_in() && current_user_can( $see_ads_capability ) ) {
581
  return false;
582
  }
583
 
@@ -625,14 +629,20 @@ class Advanced_Ads {
625
  */
626
  public function is_cache_bot() {
627
  if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && '' !== $_SERVER['HTTP_USER_AGENT'] ) {
 
628
  // WP Rocket.
629
- if ( false !== strpos( sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ), 'wprocketbot' ) ) {
630
  return true;
631
  }
632
 
633
  // WP Super Cache.
634
  $wp_useragent = apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ) );
635
- if ( sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) === $wp_useragent ) {
 
 
 
 
 
636
  return true;
637
  }
638
  }
574
  return false;
575
  }
576
 
577
+ if ( isset( $options['hide-for-user-role'] ) ) {
578
+ $hide_for_roles = Advanced_Ads_Utils::maybe_translate_cap_to_role( $options['hide-for-user-role'] );
579
+ } else {
580
+ $hide_for_roles = array();
581
+ }
582
+ $user = wp_get_current_user();
583
 
584
+ if ( $hide_for_roles && is_user_logged_in() && is_array( $user->roles ) && array_intersect( $hide_for_roles, $user->roles ) ) {
 
585
  return false;
586
  }
587
 
629
  */
630
  public function is_cache_bot() {
631
  if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && '' !== $_SERVER['HTTP_USER_AGENT'] ) {
632
+ $current = sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) );
633
  // WP Rocket.
634
+ if ( false !== strpos( $current, 'wprocketbot' ) ) {
635
  return true;
636
  }
637
 
638
  // WP Super Cache.
639
  $wp_useragent = apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ) );
640
+ if ( $current === $wp_useragent ) {
641
+ return true;
642
+ }
643
+
644
+ // LiteSpeed Cache: `lscache_runner` and `lscache_walker` user agents.
645
+ if ( false !== strpos( $current, 'lscache_' ) ) {
646
  return true;
647
  }
648
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: ads, ad manager, ad rotation, adsense, banner
5
  Requires at least: 4.6
6
  Tested up to: 5.2
7
  Requires PHP: 5.6
8
- Stable tag: 1.13.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -288,6 +288,14 @@ Yes. Advanced Ads is based on WordPress standards and therefore easily customiza
288
 
289
  == Changelog ==
290
 
 
 
 
 
 
 
 
 
291
  = 1.13.4 =
292
 
293
  * improved compatibility with WPML
5
  Requires at least: 4.6
6
  Tested up to: 5.2
7
  Requires PHP: 5.6
8
+ Stable tag: 1.13.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
288
 
289
  == Changelog ==
290
 
291
+ = 1.13.5 =
292
+
293
+ * option to hide ads by user role does now show all registered roles
294
+ * prevented possible JavaScript error in Ad Health
295
+ * updated minimum PHP version check to warn below PHP 5.6.20
296
+ * exclude LiteSpeed Cache bot from bot detection
297
+ * fixed Ad Health notices with invalid ID
298
+
299
  = 1.13.4 =
300
 
301
  * improved compatibility with WPML