Advanced Ads - Version 1.37.2

Version Description

(November 2, 2022) =

  • Improvement: add manual links to display and visitor conditions
  • Improvement: sanitize the frontend prefix according to W3C valid class names
  • Improvement: update Black Friday / Cyber Monday promotion
  • Fix: remove the ad width and height before saving for responsive AdSense ads
Download this release

Release Info

Developer advancedads
Plugin Icon 128x128 Advanced Ads
Version 1.37.2
Comparing to
See all releases

Code changes from version 1.37.1 to 1.37.2

admin/assets/css/admin.css CHANGED
@@ -239,6 +239,14 @@ select + .advads-conditions-single { display: inline-flex; flex-wrap: wrap; alig
239
  gap: 10px;
240
  }
241
 
 
 
 
 
 
 
 
 
242
  .advads-conditions-table .advads-conditions-table-width-100 {
243
  width: 100%;
244
  }
@@ -866,6 +874,21 @@ li:hover > .advads-help:before {
866
  top: 4px;
867
  margin-right: 5px;
868
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
869
 
870
  /* Notification blocks */
871
  .advads-notice-block {
239
  gap: 10px;
240
  }
241
 
242
+ .advads-conditions-table td:nth-of-type(2) p.description {
243
+ flex-basis: 100%;
244
+ }
245
+
246
+ .advads-conditions-table td:first-of-type {
247
+ text-transform: capitalize;
248
+ }
249
+
250
  .advads-conditions-table .advads-conditions-table-width-100 {
251
  width: 100%;
252
  }
874
  top: 4px;
875
  margin-right: 5px;
876
  }
877
+ .advads-notice.notice-promo {
878
+ border: 0;
879
+ text-align: center;
880
+ color: #fff;
881
+ }
882
+ .advads-notice.notice.notice-promo .button{
883
+ background-color: transparent;
884
+ border-color: #fff;
885
+ }
886
+ .advads-notice.notice.notice-promo .button:focus {
887
+ box-shadow: none;
888
+ }
889
+ .advads-notice.notice-promo .notice-dismiss:before {
890
+ color: #fff;
891
+ }
892
 
893
  /* Notification blocks */
894
  .advads-notice-block {
admin/assets/img/promo-background.svg ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg version="1.1"
4
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="35px" viewBox="0 0 20 35" overflow="visible" enable-background="new 0 0 20 35" xml:space="preserve">
5
+ <defs>
6
+ </defs>
7
+ <rect fill="#CC3000" width="20" height="35"/>
8
+ <polygon fill="#D13607" points="0,0 10.017,5.828 20,0 "/>
9
+ <polygon fill="#D13607" points="10.017,17.5 20,11.672 20,23.345 "/>
10
+ <polygon fill="#D13607" points="0,23.345 0,11.672 10.017,17.5 "/>
11
+ <polygon fill="#C52E00" points="20,0 10.017,5.828 10.017,17.5 20,11.672 "/>
12
+ <polygon fill="#D13607" points="0,35 10.017,29.155 20,35 "/>
13
+ <polygon fill="#C52E00" points="10.017,17.5 0,23.345 0,35 10.017,29.155 "/>
14
+ </svg>
admin/includes/class-notices.php CHANGED
@@ -318,14 +318,14 @@ class Advanced_Ads_Admin_Notices {
318
  return;
319
  }
320
 
321
- // register Black Friday 2021 deals.
322
- if ( time() > 1637841600 &&
323
- time() <= 1638273600 && Advanced_Ads_Admin::get_instance()->screen_belongs_to_advanced_ads() ) {
324
  $options = $this->options();
325
  $closed = isset( $options['closed'] ) ? $options['closed'] : array();
326
 
327
- if ( ! isset( $closed['bf2021'] ) ) {
328
- $this->notices[] = 'bf2021';
329
  }
330
  }
331
 
@@ -378,6 +378,9 @@ class Advanced_Ads_Admin_Notices {
378
  case 'plugin_error':
379
  include ADVADS_BASE_PATH . '/admin/views/notices/plugin_error.php';
380
  break;
 
 
 
381
  default:
382
  include ADVADS_BASE_PATH . '/admin/views/notices/error.php';
383
  }
318
  return;
319
  }
320
 
321
+ // register Black Friday 2022 deals.
322
+ if ( time() > 1669291200 &&
323
+ time() <= 1669723200 && Advanced_Ads_Admin::get_instance()->screen_belongs_to_advanced_ads() ) {
324
  $options = $this->options();
325
  $closed = isset( $options['closed'] ) ? $options['closed'] : array();
326
 
327
+ if ( ! isset( $closed['bfcm22'] ) ) {
328
+ $this->notices[] = 'bfcm22';
329
  }
330
  }
331
 
378
  case 'plugin_error':
379
  include ADVADS_BASE_PATH . '/admin/views/notices/plugin_error.php';
380
  break;
381
+ case 'promo':
382
+ include ADVADS_BASE_PATH . '/admin/views/notices/promo.php';
383
+ break;
384
  default:
385
  include ADVADS_BASE_PATH . '/admin/views/notices/error.php';
386
  }
admin/includes/class-settings.php CHANGED
@@ -632,7 +632,10 @@ class Advanced_Ads_Admin_Settings {
632
 
633
  // sanitize whatever option one wants to sanitize.
634
  if ( isset( $options['front-prefix'] ) ) {
635
- $options['front-prefix'] = sanitize_html_class( $options['front-prefix'], Advanced_Ads_Plugin::DEFAULT_FRONTEND_PREFIX );
 
 
 
636
  }
637
 
638
  $options = apply_filters( 'advanced-ads-sanitize-settings', $options );
632
 
633
  // sanitize whatever option one wants to sanitize.
634
  if ( isset( $options['front-prefix'] ) ) {
635
+ $options['front-prefix'] = Advanced_Ads_Plugin::get_instance()->sanitize_frontend_prefix(
636
+ $options['front-prefix'],
637
+ Advanced_Ads_Plugin::DEFAULT_FRONTEND_PREFIX
638
+ );
639
  }
640
 
641
  $options = apply_filters( 'advanced-ads-sanitize-settings', $options );
admin/includes/notices.php CHANGED
@@ -56,13 +56,15 @@ $advanced_ads_admin_notices = apply_filters(
56
  . '</p></div>',
57
  'global' => false,
58
  ),
59
- // Black Friday 2021 promotion.
60
- 'bf2021' => array(
61
- 'type' => 'info',
62
  'text' => sprintf(
63
- // translators: %s is a link. `30%%` is correct, please use exactly that value so that it shows "30%".
64
- __( 'Our Black Friday / Cyber Monday Offer: <span style="font-weight: bold; font-size: 1.4em; color: green;">-30%%</span> on all add-ons and All Access.<a class="button button-primary" target="_blank" href="%s">Get All Access</a>', 'advanced-ads' ),
65
- ADVADS_URL . 'checkout/?edd_action=add_to_cart&download_id=95170&edd_options[price_id]=1&discount=BFCM2021/?utm_source=advanced-ads&utm_medium=link&utm_campaign=bfcm-2021'
 
 
66
  ),
67
  'global' => true,
68
  ),
56
  . '</p></div>',
57
  'global' => false,
58
  ),
59
+ // Black Friday 2022 promotion.
60
+ 'bfcm22' => array(
61
+ 'type' => 'promo',
62
  'text' => sprintf(
63
+ /* translators: %1$s is the markup for the discount value, %2$s starts a button link, %3$s closes the button link. */
64
+ __( 'Save %1$s on all products with our Black Friday / Cyber Monday offer! %2$sGet All Access%3$s', 'advanced-ads' ),
65
+ '<span style="font-weight: bold; font-size: 1.6em; vertical-align: sub;">30%</span>',
66
+ '<a class="button button-primary" target="_blank" href="' . ADVADS_URL . 'checkout/?edd_action=add_to_cart&download_id=95170&edd_options[price_id]=1&discount=BFCM2022&utm_source=advanced-ads&utm_medium=link&utm_campaign=bfcm-2022">',
67
+ '</a>'
68
  ),
69
  'global' => true,
70
  ),
admin/views/conditions/condition-device.php CHANGED
@@ -14,11 +14,10 @@
14
  <option
15
  value="is_not" <?php selected( 'is_not', $operator ); ?>><?php esc_html_e( 'Desktop', 'advanced-ads' ); ?></option>
16
  </select>
17
- <p class="description">
18
- <?php
19
- echo $type_options[ $options['type'] ]['description'];
20
- if ( isset( $type_options[ $options['type'] ]['helplink'] ) ) :
21
- ?>
22
- <a href="<?php echo esc_url( $type_options[ $options['type'] ]['helplink'] ); ?>" target="_blank">
23
- <?php esc_html_e( 'Manual and Troubleshooting', 'advanced-ads' ); ?>
24
- </a><?php endif; ?></p>
14
  <option
15
  value="is_not" <?php selected( 'is_not', $operator ); ?>><?php esc_html_e( 'Desktop', 'advanced-ads' ); ?></option>
16
  </select>
17
+ <?php
18
+ printf(
19
+ '<p class="description">%1$s <a href="%2$s" class="advads-manual-link" target="_blank">%3$s</a></p>',
20
+ esc_html( $type_options[ $options['type'] ]['description'] ),
21
+ esc_url( $type_options[ $options['type'] ]['helplink'] ),
22
+ esc_html__( 'Manual', 'advanced-ads' )
23
+ );
 
admin/views/conditions/condition-is-or-not.php CHANGED
@@ -12,12 +12,14 @@
12
  include ADVADS_BASE_PATH . 'admin/views/conditions/condition-operator.php';
13
  ?>
14
  <p class="description">
 
15
  <?php
16
- echo esc_html( $type_options[ $options['type'] ]['description'] );
17
- if ( isset( $type_options[ $options['type'] ]['helplink'] ) ) :
18
- ?>
19
- <a href="<?php echo esc_url( $type_options[ $options['type'] ]['helplink'] ); ?>" target="_blank">
20
- <?php
21
- esc_html_e( 'Manual and Troubleshooting', 'advanced-ads' );
22
- ?>
23
- </a><?php endif; ?></p>
 
12
  include ADVADS_BASE_PATH . 'admin/views/conditions/condition-operator.php';
13
  ?>
14
  <p class="description">
15
+ <?php echo esc_html( $type_options[ $options['type'] ]['description'] ); ?>
16
  <?php
17
+ if ( isset( $type_options[ $options['type'] ]['helplink'] ) ) {
18
+ printf(
19
+ '<a href="%1$s" class="advads-manual-link" target="_blank">%2$s</a>',
20
+ esc_url( $type_options[ $options['type'] ]['helplink'] ),
21
+ esc_html__( 'Manual', 'advanced-ads' )
22
+ );
23
+ }
24
+ ?>
25
+ </p>
admin/views/notices/promo.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for a promotional banner
4
+ *
5
+ * @var string $text content of the notice.
6
+ * @var string $_notice internal key of the notice.
7
+ */
8
+ ?>
9
+ <div class="notice notice-promo advads-notice advads-admin-notice message is-dismissible"
10
+ data-notice="<?php echo esc_attr( $_notice ); ?>"
11
+ style="background: url(<?php echo esc_url( ADVADS_BASE_URL . 'admin/assets/img/promo-background.svg' ); ?>);">
12
+ <p>
13
+ <?php
14
+ echo wp_kses(
15
+ $text,
16
+ array(
17
+ 'a' => array(
18
+ 'href' => array(),
19
+ 'class' => array(),
20
+ 'target' => array(),
21
+ ),
22
+ 'span' => array(
23
+ 'style' => array(),
24
+ ),
25
+ )
26
+ );
27
+ ?>
28
+ </p>
29
+ <a href="
30
+ <?php
31
+ add_query_arg(
32
+ array(
33
+ 'action' => 'advads-close-notice',
34
+ 'notice' => $_notice,
35
+ 'nonce' => wp_create_nonce( 'advanced-ads-admin-ajax-nonce' ),
36
+ 'redirect' => $_SERVER['REQUEST_URI'],
37
+ ),
38
+ admin_url( 'admin-ajax.php' )
39
+ );
40
+ ?>
41
+ " class="notice-dismiss"><span class="screen-reader-text"><?php esc_html__( 'Dismiss this notice.', 'advanced-ads' ); ?></span></a>
42
+ </div>
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.37.1
16
  * Author: Thomas Maier, Advanced Ads GmbH
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.37.1' );
43
 
44
  // Autoloading, modules and functions.
45
 
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
+ * Version: 1.37.2
16
  * Author: Thomas Maier, Advanced Ads GmbH
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.37.2' );
43
 
44
  // Autoloading, modules and functions.
45
 
changelog.txt CHANGED
@@ -1,5 +1,12 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
3
  = 1.37.1 (October 25, 2022) =
4
 
5
  - Improvement: align the ad image preview in the Ad Parameters with other options
1
  == Changelog ==
2
 
3
+ = 1.37.2 (November 2, 2022) =
4
+
5
+ - Improvement: add manual links to display and visitor conditions
6
+ - Improvement: sanitize the frontend prefix according to W3C valid class names
7
+ - Improvement: update Black Friday / Cyber Monday promotion
8
+ - Fix: remove the ad width and height before saving for responsive AdSense ads
9
+
10
  = 1.37.1 (October 25, 2022) =
11
 
12
  - Improvement: align the ad image preview in the Ad Parameters with other options
classes/display-conditions.php CHANGED
@@ -830,8 +830,19 @@ class Advanced_Ads_Display_Conditions {
830
  <select name="<?php echo $name; ?>[operator]">
831
  <option value="older_than" <?php selected( 'older_than', $operator ); ?>><?php _e( 'older than', 'advanced-ads' ); ?></option>
832
  <option value="younger_than" <?php selected( 'younger_than', $operator ); ?>><?php _e( 'younger than', 'advanced-ads' ); ?></option>
833
- </select><input type="text" name="<?php echo $name; ?>[value]"
834
- value="<?php echo $value; ?>"/>&nbsp;<?php _e( 'days', 'advanced-ads' );
 
 
 
 
 
 
 
 
 
 
 
835
  }
836
 
837
  /**
830
  <select name="<?php echo $name; ?>[operator]">
831
  <option value="older_than" <?php selected( 'older_than', $operator ); ?>><?php _e( 'older than', 'advanced-ads' ); ?></option>
832
  <option value="younger_than" <?php selected( 'younger_than', $operator ); ?>><?php _e( 'younger than', 'advanced-ads' ); ?></option>
833
+ </select>
834
+
835
+ <input type="text" name="<?php echo esc_attr( $name ); ?>[value]" value="<?php echo esc_attr( $value ); ?>"/>
836
+
837
+ <?php esc_html_e( 'days', 'advanced-ads' ); ?>
838
+
839
+ <p class="description">
840
+ <?php esc_html_e( 'Display ads based on the age of a page or post.', 'advanced-ads' ); ?>
841
+ <a href="https://wpadvancedads.com/manual/display-ads-by-content-age/?utm_source=advanced-ads&utm_medium=link&utm_campaign=condition-content-age" class="advads-manual-link" target="_blank">
842
+ <?php esc_html_e( 'Manual', 'advanced-ads' ); ?>
843
+ </a>
844
+ </p>
845
+ <?php
846
  }
847
 
848
  /**
classes/plugin.php CHANGED
@@ -568,32 +568,64 @@ class Advanced_Ads_Plugin {
568
 
569
  /**
570
  * Get prefix used for frontend elements
 
 
571
  */
572
  public function get_frontend_prefix() {
573
- if ( ! $this->frontend_prefix ) {
574
- $options = $this->options();
575
-
576
- if ( ! isset( $options['front-prefix'] ) ) {
577
- if ( isset( $options['id-prefix'] ) ) {
578
- // deprecated: keeps widgets working that previously received an id based on the front-prefix.
579
- $frontend_prefix = esc_attr( $options['id-prefix'] );
580
- } else {
581
- $host = parse_url( get_home_url(), PHP_URL_HOST );
582
- $frontend_prefix = preg_match( '/[A-Za-z][A-Za-z0-9_]{4}/', $host, $result ) ? $result[0] . '-' : self::DEFAULT_FRONTEND_PREFIX;
583
- }
584
  } else {
585
- $frontend_prefix = esc_attr( $options['front-prefix'] );
 
 
586
  }
587
- /**
588
- * Applying the filter here makes sure that it is the same frontend prefix for all
589
- * calls on this page impression
590
- */
591
- $this->frontend_prefix = apply_filters( 'advanced-ads-frontend-prefix', $frontend_prefix );
592
  }
 
 
 
 
 
 
 
 
593
 
594
  return $this->frontend_prefix;
595
  }
596
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
597
  /**
598
  * Get priority used for injection inside content
599
  */
568
 
569
  /**
570
  * Get prefix used for frontend elements
571
+ *
572
+ * @return string
573
  */
574
  public function get_frontend_prefix() {
575
+ if ( isset( $this->frontend_prefix ) ) {
576
+ return $this->frontend_prefix;
577
+ }
578
+
579
+ $options = $this->options();
580
+
581
+ if ( ! isset( $options['front-prefix'] ) ) {
582
+ if ( isset( $options['id-prefix'] ) ) {
583
+ // deprecated: keeps widgets working that previously received an id based on the front-prefix.
584
+ $frontend_prefix = $options['id-prefix'];
 
585
  } else {
586
+ $frontend_prefix = preg_match( '/[A-Za-z][A-Za-z0-9_]{4}/', parse_url( get_home_url(), PHP_URL_HOST ), $result )
587
+ ? $result[0] . '-'
588
+ : self::DEFAULT_FRONTEND_PREFIX;
589
  }
590
+ } else {
591
+ $frontend_prefix = $options['front-prefix'];
 
 
 
592
  }
593
+ /**
594
+ * Applying the filter here makes sure that it is the same frontend prefix for all
595
+ * calls on this page impression
596
+ *
597
+ * @param string $frontend_prefix
598
+ */
599
+ $this->frontend_prefix = (string) apply_filters( 'advanced-ads-frontend-prefix', $frontend_prefix );
600
+ $this->frontend_prefix = $this->sanitize_frontend_prefix( $frontend_prefix );
601
 
602
  return $this->frontend_prefix;
603
  }
604
 
605
+ /**
606
+ * Sanitize the frontend prefix to result in valid HTML classes.
607
+ * See https://www.w3.org/TR/selectors-3/#grammar for valid tokens.
608
+ *
609
+ * @param string $prefix The HTML class to sanitize.
610
+ * @param string $fallback The fallback if the class is invalid.
611
+ *
612
+ * @return string
613
+ */
614
+ public function sanitize_frontend_prefix( $prefix, $fallback = '' ) {
615
+ $prefix = sanitize_html_class( $prefix );
616
+ $nonascii = '[^\0-\177]';
617
+ $unicode = '\\[0-9a-f]{1,6}(\r\n|[ \n\r\t\f])?';
618
+ $escape = sprintf( '%s|\\[^\n\r\f0-9a-f]', $unicode );
619
+ $nmstart = sprintf( '[_a-z]|%s|%s', $nonascii, $escape );
620
+ $nmchar = sprintf( '[_a-z0-9-]|%s|%s', $nonascii, $escape );
621
+
622
+ if ( ! preg_match( sprintf( '/-?(?:%s)(?:%s)*/i', $nmstart, $nmchar ), $prefix, $matches ) ) {
623
+ return $fallback;
624
+ }
625
+
626
+ return $matches[0];
627
+ }
628
+
629
  /**
630
  * Get priority used for injection inside content
631
  */
classes/visitor-conditions.php CHANGED
@@ -41,13 +41,14 @@ class Advanced_Ads_Visitor_Conditions {
41
  'description' => __( 'Display ads only on mobile devices or hide them.', 'advanced-ads' ),
42
  'metabox' => array( 'Advanced_Ads_Visitor_Conditions', 'mobile_is_or_not' ), // callback to generate the metabox.
43
  'check' => array( 'Advanced_Ads_Visitor_Conditions', 'check_mobile' ), // callback for frontend check.
44
- 'helplink' => ADVADS_URL . 'manual/display-ads-either-on-mobile-or-desktop/?utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-visitor-mobile', // link to help section.
45
  ),
46
  'loggedin' => array(
47
  'label' => __( 'logged-in visitor', 'advanced-ads' ),
48
  'description' => __( 'Whether the visitor has to be logged in or not in order to see the ad.', 'advanced-ads' ),
49
  'metabox' => array( 'Advanced_Ads_Visitor_Conditions', 'metabox_is_or_not' ), // callback to generate the metabox.
50
  'check' => array( 'Advanced_Ads_Visitor_Conditions', 'check_logged_in' ), // callback for frontend check.
 
51
  'passive_info' => array(
52
  'hash_fields' => null,
53
  'remove' => 'login',
41
  'description' => __( 'Display ads only on mobile devices or hide them.', 'advanced-ads' ),
42
  'metabox' => array( 'Advanced_Ads_Visitor_Conditions', 'mobile_is_or_not' ), // callback to generate the metabox.
43
  'check' => array( 'Advanced_Ads_Visitor_Conditions', 'check_mobile' ), // callback for frontend check.
44
+ 'helplink' => ADVADS_URL . 'manual/display-ads-either-on-mobile-or-desktop/?utm_source=advanced-ads&utm_medium=link&utm_campaign=condition-device',
45
  ),
46
  'loggedin' => array(
47
  'label' => __( 'logged-in visitor', 'advanced-ads' ),
48
  'description' => __( 'Whether the visitor has to be logged in or not in order to see the ad.', 'advanced-ads' ),
49
  'metabox' => array( 'Advanced_Ads_Visitor_Conditions', 'metabox_is_or_not' ), // callback to generate the metabox.
50
  'check' => array( 'Advanced_Ads_Visitor_Conditions', 'check_logged_in' ), // callback for frontend check.
51
+ 'helplink' => ADVADS_URL . 'manual/logged-in-visitors/?utm_source=advanced-ads&utm_medium=link&utm_campaign=condition-logged-in-visitors',
52
  'passive_info' => array(
53
  'hash_fields' => null,
54
  'remove' => 'login',
languages/advanced-ads.pot CHANGED
@@ -2,16 +2,16 @@
2
  # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Advanced Ads 1.37.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n"
7
  "Last-Translator: Thomas Maier <post@webzunft.de>\n"
8
  "Language-Team: webgilde <support@wpadvancedads.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2022-10-25T10:24:19+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
- "X-Generator: WP-CLI 2.6.0\n"
15
  "X-Domain: advanced-ads\n"
16
 
17
  #. Plugin Name of the plugin
@@ -34,7 +34,7 @@ msgstr ""
34
 
35
  #: admin/class-advanced-ads-admin.php:224
36
  #: classes/display-conditions.php:317
37
- #: classes/visitor-conditions.php:309
38
  #: modules/gadsense/admin/views/external-ads-links.php:17
39
  #: modules/gadsense/admin/views/external-ads-links.php:22
40
  #: modules/gadsense/admin/views/external-ads-links.php:29
@@ -43,7 +43,7 @@ msgstr ""
43
 
44
  #: admin/class-advanced-ads-admin.php:225
45
  #: classes/display-conditions.php:317
46
- #: classes/visitor-conditions.php:309
47
  msgid "and"
48
  msgstr ""
49
 
@@ -753,11 +753,14 @@ msgstr ""
753
  #: admin/views/ad-group.php:76
754
  #: admin/views/ad-main-metabox.php:29
755
  #: admin/views/ad-output-metabox.php:43
 
 
756
  #: admin/views/header.php:50
757
  #: admin/views/placements.php:28
758
  #: admin/views/settings/general/custom-label.php:10
759
  #: admin/views/settings/general/disable-notices.php:6
760
  #: classes/ad_type_plain.php:250
 
761
  #: modules/ads-txt/admin/views/setting-create.php:12
762
  #: modules/privacy/admin/views/setting-general.php:34
763
  msgid "Manual"
@@ -799,16 +802,16 @@ msgid "Latest posts on wpadvancedads.com"
799
  msgstr ""
800
 
801
  #. translators: %s is a URL.
802
- #: admin/includes/class-notices.php:436
803
  msgid "You don’t seem to have an email address. Please use <a href=\"%s\" target=\"_blank\">this form</a> to sign up."
804
  msgstr ""
805
 
806
- #: admin/includes/class-notices.php:457
807
  msgid "How embarrassing. The email server seems to be down. Please try again later."
808
  msgstr ""
809
 
810
  #. translators: the first %s is an email address, the seconds %s is a URL.
811
- #: admin/includes/class-notices.php:464
812
  msgid "Please check your email (%1$s) for the confirmation message. If you didn’t receive one or want to use another email address then please use <a href=\"%2$s\" target=\"_blank\">this form</a> to sign up."
813
  msgstr ""
814
 
@@ -1165,9 +1168,9 @@ msgstr ""
1165
  msgid "Yes, but help me first to solve a problem, please"
1166
  msgstr ""
1167
 
1168
- #. translators: %s is a link. `30%%` is correct, please use exactly that value so that it shows "30%".
1169
  #: admin/includes/notices.php:64
1170
- msgid "Our Black Friday / Cyber Monday Offer: <span style=\"font-weight: bold; font-size: 1.4em; color: green;\">-30%%</span> on all add-ons and All Access.<a class=\"button button-primary\" target=\"_blank\" href=\"%s\">Get All Access</a>"
1171
  msgstr ""
1172
 
1173
  #: admin/includes/shortcode-creator-l10n.php:17
@@ -1576,11 +1579,6 @@ msgstr ""
1576
  msgid "Desktop"
1577
  msgstr ""
1578
 
1579
- #: admin/views/conditions/condition-device.php:23
1580
- #: admin/views/conditions/condition-is-or-not.php:21
1581
- msgid "Manual and Troubleshooting"
1582
- msgstr ""
1583
-
1584
  #: admin/views/conditions/condition-number.php:13
1585
  msgid "equal"
1586
  msgstr ""
@@ -1748,6 +1746,10 @@ msgstr ""
1748
  msgid "Please disable your <strong>AdBlocker</strong> to prevent problems with your ad setup."
1749
  msgstr ""
1750
 
 
 
 
 
1751
  #: admin/views/notices/starter-setup-success.php:2
1752
  msgid "2 Test Ads successfully added!"
1753
  msgstr ""
@@ -1862,12 +1864,12 @@ msgstr ""
1862
  #. translators: %s is a URL.
1863
  #. Translators: %s is a URL.
1864
  #: admin/views/placement-injection-top.php:46
1865
- #: modules/gadsense/admin/admin.php:217
1866
  msgid "The AdSense verification and Auto ads code is already activated in the <a href=\"%s\">AdSense settings</a>."
1867
  msgstr ""
1868
 
1869
  #: admin/views/placement-injection-top.php:58
1870
- #: modules/gadsense/admin/admin.php:220
1871
  msgid "No need to add the code manually here, unless you want to include it into certain pages only."
1872
  msgstr ""
1873
 
@@ -2990,10 +2992,14 @@ msgstr ""
2990
  msgid "younger than"
2991
  msgstr ""
2992
 
2993
- #: classes/display-conditions.php:834
2994
  msgid "days"
2995
  msgstr ""
2996
 
 
 
 
 
2997
  #. translators: the plugin name.
2998
  #: classes/EDD_SL_Plugin_Updater.php:224
2999
  msgid "There is a new version of %1$s available."
@@ -3237,55 +3243,55 @@ msgid "Whether the visitor has to be logged in or not in order to see the ad."
3237
  msgstr ""
3238
 
3239
  #. translators: %s is a URL. Please don’t change it.
3240
- #: classes/visitor-conditions.php:119
3241
  msgid "Display ads by the available space on the device or target tablets with the <a href=\"%s\" target=\"_blank\">Responsive add-on</a>"
3242
  msgstr ""
3243
 
3244
- #: classes/visitor-conditions.php:270
3245
  msgid "browser language"
3246
  msgstr ""
3247
 
3248
- #: classes/visitor-conditions.php:271
3249
  msgid "cookie"
3250
  msgstr ""
3251
 
3252
- #: classes/visitor-conditions.php:272
3253
  msgid "max. ad clicks"
3254
  msgstr ""
3255
 
3256
- #: classes/visitor-conditions.php:273
3257
  msgid "max. ad impressions"
3258
  msgstr ""
3259
 
3260
- #: classes/visitor-conditions.php:274
3261
  msgid "new visitor"
3262
  msgstr ""
3263
 
3264
- #: classes/visitor-conditions.php:275
3265
  msgid "page impressions"
3266
  msgstr ""
3267
 
3268
- #: classes/visitor-conditions.php:276
3269
  msgid "geo location"
3270
  msgstr ""
3271
 
3272
- #: classes/visitor-conditions.php:277
3273
  msgid "referrer url"
3274
  msgstr ""
3275
 
3276
- #: classes/visitor-conditions.php:278
3277
  msgid "user agent"
3278
  msgstr ""
3279
 
3280
- #: classes/visitor-conditions.php:279
3281
  msgid "user can (capabilities)"
3282
  msgstr ""
3283
 
3284
- #: classes/visitor-conditions.php:280
3285
  msgid "user role"
3286
  msgstr ""
3287
 
3288
- #: classes/visitor-conditions.php:283
3289
  msgid "browser width"
3290
  msgstr ""
3291
 
@@ -3547,21 +3553,21 @@ msgid "Usually, this should be enabled on the main site of the network - often t
3547
  msgstr ""
3548
 
3549
  #. Translators: %s is a URL.
3550
- #: modules/gadsense/admin/admin.php:166
3551
  msgid "Responsive AdSense ads don’t work reliably with <em>Position</em> set to left or right. Either switch the <em>Type</em> to \"normal\" or follow <a href=\"%s\" target=\"_blank\">this tutorial</a> if you want the ad to be wrapped in text."
3552
  msgstr ""
3553
 
3554
  #. Translators: %s is a URL.
3555
- #: modules/gadsense/admin/admin.php:176
3556
  msgid "<a href=\"%s\" target=\"_blank\">Install the free AdSense In-feed add-on</a> in order to place ads between posts."
3557
  msgstr ""
3558
 
3559
  #. Translators: %s is a URL.
3560
- #: modules/gadsense/admin/admin.php:225
3561
  msgid "The AdSense verification and Auto ads code should be set up in the <a href=\"%s\">AdSense settings</a>. Click on the following button to enable it now."
3562
  msgstr ""
3563
 
3564
- #: modules/gadsense/admin/admin.php:228
3565
  msgid "Activate"
3566
  msgstr ""
3567
 
2
  # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Advanced Ads 1.37.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n"
7
  "Last-Translator: Thomas Maier <post@webzunft.de>\n"
8
  "Language-Team: webgilde <support@wpadvancedads.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-11-02T10:46:48+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
+ "X-Generator: WP-CLI 2.7.1\n"
15
  "X-Domain: advanced-ads\n"
16
 
17
  #. Plugin Name of the plugin
34
 
35
  #: admin/class-advanced-ads-admin.php:224
36
  #: classes/display-conditions.php:317
37
+ #: classes/visitor-conditions.php:310
38
  #: modules/gadsense/admin/views/external-ads-links.php:17
39
  #: modules/gadsense/admin/views/external-ads-links.php:22
40
  #: modules/gadsense/admin/views/external-ads-links.php:29
43
 
44
  #: admin/class-advanced-ads-admin.php:225
45
  #: classes/display-conditions.php:317
46
+ #: classes/visitor-conditions.php:310
47
  msgid "and"
48
  msgstr ""
49
 
753
  #: admin/views/ad-group.php:76
754
  #: admin/views/ad-main-metabox.php:29
755
  #: admin/views/ad-output-metabox.php:43
756
+ #: admin/views/conditions/condition-device.php:22
757
+ #: admin/views/conditions/condition-is-or-not.php:21
758
  #: admin/views/header.php:50
759
  #: admin/views/placements.php:28
760
  #: admin/views/settings/general/custom-label.php:10
761
  #: admin/views/settings/general/disable-notices.php:6
762
  #: classes/ad_type_plain.php:250
763
+ #: classes/display-conditions.php:842
764
  #: modules/ads-txt/admin/views/setting-create.php:12
765
  #: modules/privacy/admin/views/setting-general.php:34
766
  msgid "Manual"
802
  msgstr ""
803
 
804
  #. translators: %s is a URL.
805
+ #: admin/includes/class-notices.php:439
806
  msgid "You don’t seem to have an email address. Please use <a href=\"%s\" target=\"_blank\">this form</a> to sign up."
807
  msgstr ""
808
 
809
+ #: admin/includes/class-notices.php:460
810
  msgid "How embarrassing. The email server seems to be down. Please try again later."
811
  msgstr ""
812
 
813
  #. translators: the first %s is an email address, the seconds %s is a URL.
814
+ #: admin/includes/class-notices.php:467
815
  msgid "Please check your email (%1$s) for the confirmation message. If you didn’t receive one or want to use another email address then please use <a href=\"%2$s\" target=\"_blank\">this form</a> to sign up."
816
  msgstr ""
817
 
1168
  msgid "Yes, but help me first to solve a problem, please"
1169
  msgstr ""
1170
 
1171
+ #. translators: %1$s is the markup for the discount value, %2$s starts a button link, %3$s closes the button link.
1172
  #: admin/includes/notices.php:64
1173
+ msgid "Save %1$s on all products with our Black Friday / Cyber Monday offer! %2$sGet All Access%3$s"
1174
  msgstr ""
1175
 
1176
  #: admin/includes/shortcode-creator-l10n.php:17
1579
  msgid "Desktop"
1580
  msgstr ""
1581
 
 
 
 
 
 
1582
  #: admin/views/conditions/condition-number.php:13
1583
  msgid "equal"
1584
  msgstr ""
1746
  msgid "Please disable your <strong>AdBlocker</strong> to prevent problems with your ad setup."
1747
  msgstr ""
1748
 
1749
+ #: admin/views/notices/promo.php:41
1750
+ msgid "Dismiss this notice."
1751
+ msgstr ""
1752
+
1753
  #: admin/views/notices/starter-setup-success.php:2
1754
  msgid "2 Test Ads successfully added!"
1755
  msgstr ""
1864
  #. translators: %s is a URL.
1865
  #. Translators: %s is a URL.
1866
  #: admin/views/placement-injection-top.php:46
1867
+ #: modules/gadsense/admin/admin.php:248
1868
  msgid "The AdSense verification and Auto ads code is already activated in the <a href=\"%s\">AdSense settings</a>."
1869
  msgstr ""
1870
 
1871
  #: admin/views/placement-injection-top.php:58
1872
+ #: modules/gadsense/admin/admin.php:251
1873
  msgid "No need to add the code manually here, unless you want to include it into certain pages only."
1874
  msgstr ""
1875
 
2992
  msgid "younger than"
2993
  msgstr ""
2994
 
2995
+ #: classes/display-conditions.php:837
2996
  msgid "days"
2997
  msgstr ""
2998
 
2999
+ #: classes/display-conditions.php:840
3000
+ msgid "Display ads based on the age of a page or post."
3001
+ msgstr ""
3002
+
3003
  #. translators: the plugin name.
3004
  #: classes/EDD_SL_Plugin_Updater.php:224
3005
  msgid "There is a new version of %1$s available."
3243
  msgstr ""
3244
 
3245
  #. translators: %s is a URL. Please don’t change it.
3246
+ #: classes/visitor-conditions.php:120
3247
  msgid "Display ads by the available space on the device or target tablets with the <a href=\"%s\" target=\"_blank\">Responsive add-on</a>"
3248
  msgstr ""
3249
 
3250
+ #: classes/visitor-conditions.php:271
3251
  msgid "browser language"
3252
  msgstr ""
3253
 
3254
+ #: classes/visitor-conditions.php:272
3255
  msgid "cookie"
3256
  msgstr ""
3257
 
3258
+ #: classes/visitor-conditions.php:273
3259
  msgid "max. ad clicks"
3260
  msgstr ""
3261
 
3262
+ #: classes/visitor-conditions.php:274
3263
  msgid "max. ad impressions"
3264
  msgstr ""
3265
 
3266
+ #: classes/visitor-conditions.php:275
3267
  msgid "new visitor"
3268
  msgstr ""
3269
 
3270
+ #: classes/visitor-conditions.php:276
3271
  msgid "page impressions"
3272
  msgstr ""
3273
 
3274
+ #: classes/visitor-conditions.php:277
3275
  msgid "geo location"
3276
  msgstr ""
3277
 
3278
+ #: classes/visitor-conditions.php:278
3279
  msgid "referrer url"
3280
  msgstr ""
3281
 
3282
+ #: classes/visitor-conditions.php:279
3283
  msgid "user agent"
3284
  msgstr ""
3285
 
3286
+ #: classes/visitor-conditions.php:280
3287
  msgid "user can (capabilities)"
3288
  msgstr ""
3289
 
3290
+ #: classes/visitor-conditions.php:281
3291
  msgid "user role"
3292
  msgstr ""
3293
 
3294
+ #: classes/visitor-conditions.php:284
3295
  msgid "browser width"
3296
  msgstr ""
3297
 
3553
  msgstr ""
3554
 
3555
  #. Translators: %s is a URL.
3556
+ #: modules/gadsense/admin/admin.php:197
3557
  msgid "Responsive AdSense ads don’t work reliably with <em>Position</em> set to left or right. Either switch the <em>Type</em> to \"normal\" or follow <a href=\"%s\" target=\"_blank\">this tutorial</a> if you want the ad to be wrapped in text."
3558
  msgstr ""
3559
 
3560
  #. Translators: %s is a URL.
3561
+ #: modules/gadsense/admin/admin.php:207
3562
  msgid "<a href=\"%s\" target=\"_blank\">Install the free AdSense In-feed add-on</a> in order to place ads between posts."
3563
  msgstr ""
3564
 
3565
  #. Translators: %s is a URL.
3566
+ #: modules/gadsense/admin/admin.php:256
3567
  msgid "The AdSense verification and Auto ads code should be set up in the <a href=\"%s\">AdSense settings</a>. Click on the following button to enable it now."
3568
  msgstr ""
3569
 
3570
+ #: modules/gadsense/admin/admin.php:259
3571
  msgid "Activate"
3572
  msgstr ""
3573
 
modules/gadsense/admin/admin.php CHANGED
@@ -53,6 +53,37 @@ class Advanced_Ads_AdSense_Admin {
53
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
54
  add_action( 'admin_print_scripts', array( $this, 'print_scripts' ) );
55
  add_filter( 'advanced-ads-ad-notices', array( $this, 'ad_notices' ), 10, 3 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  }
57
 
58
  /**
53
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
54
  add_action( 'admin_print_scripts', array( $this, 'print_scripts' ) );
55
  add_filter( 'advanced-ads-ad-notices', array( $this, 'ad_notices' ), 10, 3 );
56
+ add_filter( 'advanced-ads-ad-settings-pre-save', array( $this, 'pre_save_post' ) );
57
+ }
58
+
59
+ /**
60
+ * Edit $_POST['advanced_ad'] before saving
61
+ *
62
+ * @param array $advanced_ad content of $_POST['advanced_ad'].
63
+ *
64
+ * @return array
65
+ */
66
+ public function pre_save_post( $advanced_ad ) {
67
+ if ( $advanced_ad['type'] !== 'adsense' ) {
68
+ return $advanced_ad;
69
+ }
70
+
71
+ // Remove ad size options for responsive AdSense ads.
72
+ $content = json_decode( str_replace( "\n", '', wp_unslash( $advanced_ad['content'] ) ), true );
73
+ if ( in_array( $content['unitType'], array(
74
+ 'responsive',
75
+ 'link',
76
+ 'link-responsive',
77
+ 'matched-content',
78
+ 'in-article',
79
+ 'in-feed',
80
+ ), true )
81
+ ) {
82
+ $advanced_ad['width'] = '';
83
+ $advanced_ad['height'] = '';
84
+ }
85
+
86
+ return $advanced_ad;
87
  }
88
 
89
  /**
modules/gadsense/admin/assets/js/adsense.js CHANGED
@@ -440,8 +440,6 @@ class AdvancedAdsNetworkAdsense extends AdvancedAdsAdNetwork {
440
 
441
  jQuery( '.advads-ad-notice-in-feed-add-on' ).hide();
442
  if ( type === 'responsive' || type === 'link-responsive' || type === 'matched-content' ) {
443
- width.val( '' );
444
- height.val( '' );
445
  size.hide().prev( '.label' ).hide();
446
  size.next( '.hr' ).hide();
447
  $( '.clearfix-before' ).show();
440
 
441
  jQuery( '.advads-ad-notice-in-feed-add-on' ).hide();
442
  if ( type === 'responsive' || type === 'link-responsive' || type === 'matched-content' ) {
 
 
443
  size.hide().prev( '.label' ).hide();
444
  size.next( '.hr' ).hide();
445
  $( '.clearfix-before' ).show();
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: webzunft, advancedads
3
  Tags: ads, adsense, amp, ads.txt, ad rotations, ad blocker, amazon, banner, click fraud protection, google ad manager, header code, lazy loading,
4
  Requires at least: 4.9
5
- Tested up to: 6.0
6
  Requires PHP: 7.2
7
- Stable tag: 1.37.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -336,6 +336,13 @@ Yes. You can use plenty of [hooks](https://wpadvancedads.com/codex/) to customiz
336
 
337
  == Changelog ==
338
 
 
 
 
 
 
 
 
339
  = 1.37.1 (October 25, 2022) =
340
 
341
  - Improvement: align the ad image preview in the Ad Parameters with other options
2
  Contributors: webzunft, advancedads
3
  Tags: ads, adsense, amp, ads.txt, ad rotations, ad blocker, amazon, banner, click fraud protection, google ad manager, header code, lazy loading,
4
  Requires at least: 4.9
5
+ Tested up to: 6.1
6
  Requires PHP: 7.2
7
+ Stable tag: 1.37.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
336
 
337
  == Changelog ==
338
 
339
+ = 1.37.2 (November 2, 2022) =
340
+
341
+ - Improvement: add manual links to display and visitor conditions
342
+ - Improvement: sanitize the frontend prefix according to W3C valid class names
343
+ - Improvement: update Black Friday / Cyber Monday promotion
344
+ - Fix: remove the ad width and height before saving for responsive AdSense ads
345
+
346
  = 1.37.1 (October 25, 2022) =
347
 
348
  - Improvement: align the ad image preview in the Ad Parameters with other options