Advanced Ads - Version 1.17.1

Version Description

  • fixed failing upload of new image ads
  • fixed Google Ad Manager debug link also showing up when other Google Publisher Tags are used
Download this release

Release Info

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

Code changes from version 1.17 to 1.17.1

Files changed (47) hide show
  1. admin/assets/js/admin.js +5 -1
  2. admin/class-advanced-ads-admin.php +2 -2
  3. admin/views/ad-conditions-string-operators.php +2 -2
  4. admin/views/ad-group-edit.php +2 -2
  5. admin/views/ad-group-list-ads.php +2 -2
  6. admin/views/ad-group-list-form-row.php +2 -2
  7. admin/views/ad-group-list-header.php +2 -2
  8. admin/views/ad-group-list-row.php +2 -2
  9. admin/views/ad-group.php +2 -2
  10. admin/views/ad-info-after-textarea.php +2 -2
  11. admin/views/ad-info-bottom.php +2 -2
  12. admin/views/conditions/ad-display-metabox.php +17 -6
  13. admin/views/conditions/ad-visitor-metabox.php +1 -2
  14. admin/views/conditions/condition-author.php +18 -8
  15. admin/views/conditions/condition-device.php +12 -9
  16. admin/views/conditions/condition-is-or-not.php +14 -9
  17. admin/views/conditions/condition-number.php +7 -7
  18. admin/views/conditions/condition-operator.php +1 -1
  19. admin/views/conditions/condition-string.php +3 -3
  20. admin/views/conditions/conditions-form.php +10 -8
  21. admin/views/conditions/display-conditions-list.php +4 -4
  22. admin/views/conditions/no-option.php +7 -1
  23. admin/views/conditions/not-selected.php +1 -1
  24. admin/views/conditions/visitor-conditions-form-top.php +16 -4
  25. admin/views/conditions/visitor-conditions-list.php +4 -4
  26. advanced-ads.php +15 -21
  27. classes/ad.php +5 -5
  28. classes/ad_ajax_callbacks.php +4 -4
  29. classes/ad_group.php +4 -4
  30. classes/ad_placements.php +4 -4
  31. classes/ad_type_abstract.php +3 -3
  32. classes/ad_type_content.php +3 -3
  33. classes/ad_type_dummy.php +3 -3
  34. classes/ad_type_group.php +3 -3
  35. classes/ad_type_image.php +3 -3
  36. classes/ad_type_plain.php +3 -3
  37. classes/display-conditions.php +50 -37
  38. classes/frontend_checks.php +4 -6
  39. classes/visitor-conditions.php +17 -4
  40. classes/widget.php +3 -3
  41. composer.json +1 -1
  42. languages/advanced-ads.po +2 -2
  43. languages/advanced-ads.pot +74 -74
  44. modules/gadsense/admin/assets/js/mapi-settings.js +3 -3
  45. modules/gadsense/includes/class-ad-type-adsense.php +3 -3
  46. public/class-advanced-ads.php +4 -4
  47. readme.txt +6 -1
admin/assets/js/admin.js CHANGED
@@ -1579,7 +1579,11 @@ class AdvancedAdsExternalAdUnit {
1579
 
1580
  // hook into the XHR send to intercept the request data
1581
  XMLHttpRequest.prototype.send = function (data) {
1582
- request.payload = JSON.parse('{"' + decodeURI(data).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}');
 
 
 
 
1583
 
1584
  // apply original
1585
  send.apply(this, arguments);
1579
 
1580
  // hook into the XHR send to intercept the request data
1581
  XMLHttpRequest.prototype.send = function (data) {
1582
+ if (typeof data === 'string' || data instanceof String) {
1583
+ request.payload = JSON.parse('{"' + decodeURI(data).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}');
1584
+ } else {
1585
+ request.payload = data;
1586
+ }
1587
 
1588
  // apply original
1589
  send.apply(this, arguments);
admin/class-advanced-ads-admin.php CHANGED
@@ -3,10 +3,10 @@
3
  * Advanced Ads main admin class
4
  *
5
  * @package Advanced_Ads_Admin
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
- * @copyright since 2013 Thomas Maier, webgilde GmbH
10
  *
11
  * Plugin class. This class should ideally be used to work with the
12
  * administrative side of the WordPress site.
3
  * Advanced Ads main admin class
4
  *
5
  * @package Advanced_Ads_Admin
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
+ * @copyright since 2013 Thomas Maier, Advanced Ads GmbH
10
  *
11
  * Plugin class. This class should ideally be used to work with the
12
  * administrative side of the WordPress site.
admin/views/ad-conditions-string-operators.php CHANGED
@@ -3,10 +3,10 @@
3
  * Render select field for matching-technique of string-based Display Conditions
4
  *
5
  * @package Advanced_Ads_Admin
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
- * @copyright since 2013 Thomas Maier, webgilde GmbH
10
  */
11
  ?><select name="<?php echo $name; ?>[operator]">
12
  <option value="contain" <?php selected( 'contain', $operator ); ?>><?php esc_attr_e( 'contains', 'advanced-ads' ); ?></option>
3
  * Render select field for matching-technique of string-based Display Conditions
4
  *
5
  * @package Advanced_Ads_Admin
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
+ * @copyright since 2013 Thomas Maier, Advanced Ads GmbH
10
  */
11
  ?><select name="<?php echo $name; ?>[operator]">
12
  <option value="contain" <?php selected( 'contain', $operator ); ?>><?php esc_attr_e( 'contains', 'advanced-ads' ); ?></option>
admin/views/ad-group-edit.php CHANGED
@@ -3,10 +3,10 @@
3
  * Add and edit an ad group (taxonomy)
4
  *
5
  * @package Advanced_Ads_Admin
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
- * @copyright since 2013 Thomas Maier, webgilde GmbH
10
  * @deprecated
11
  */
12
 
3
  * Add and edit an ad group (taxonomy)
4
  *
5
  * @package Advanced_Ads_Admin
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
+ * @copyright since 2013 Thomas Maier, Advanced Ads GmbH
10
  * @deprecated
11
  */
12
 
admin/views/ad-group-list-ads.php CHANGED
@@ -3,10 +3,10 @@
3
  * Render a list of ads included in an ad group
4
  *
5
  * @package Advanced_Ads_Admin
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
- * @copyright since 2013 Thomas Maier, webgilde GmbH
10
  */
11
 
12
  ?><table class="advads-group-ads">
3
  * Render a list of ads included in an ad group
4
  *
5
  * @package Advanced_Ads_Admin
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
+ * @copyright since 2013 Thomas Maier, Advanced Ads GmbH
10
  */
11
 
12
  ?><table class="advads-group-ads">
admin/views/ad-group-list-form-row.php CHANGED
@@ -3,10 +3,10 @@
3
  * Advanced Ads – form to edit ad groups in the admin
4
  *
5
  * @package Advanced_Ads_Admin
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
- * @copyright since 2013 Thomas Maier, webgilde GmbH
10
  */
11
 
12
  // Open form if this was the last edited.
3
  * Advanced Ads – form to edit ad groups in the admin
4
  *
5
  * @package Advanced_Ads_Admin
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
+ * @copyright since 2013 Thomas Maier, Advanced Ads GmbH
10
  */
11
 
12
  // Open form if this was the last edited.
admin/views/ad-group-list-header.php CHANGED
@@ -3,10 +3,10 @@
3
  * Template for <thead> of group list
4
  *
5
  * @package Advanced_Ads_Admin
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
- * @copyright since 2013 Thomas Maier, webgilde GmbH
10
  *
11
  */
12
 
3
  * Template for <thead> of group list
4
  *
5
  * @package Advanced_Ads_Admin
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
+ * @copyright since 2013 Thomas Maier, Advanced Ads GmbH
10
  *
11
  */
12
 
admin/views/ad-group-list-row.php CHANGED
@@ -3,10 +3,10 @@
3
  * Template for a single row in the group list
4
  *
5
  * @package Advanced_Ads_Admin
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
- * @copyright since 2013 Thomas Maier, webgilde GmbH
10
  *
11
  */
12
 
3
  * Template for a single row in the group list
4
  *
5
  * @package Advanced_Ads_Admin
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
+ * @copyright since 2013 Thomas Maier, Advanced Ads GmbH
10
  *
11
  */
12
 
admin/views/ad-group.php CHANGED
@@ -3,10 +3,10 @@
3
  * Renders the ad group page in WP Admin
4
  *
5
  * @package Advanced_Ads_Admin
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
- * @copyright since 2013 Thomas Maier, webgilde GmbH
10
  *
11
  */
12
 
3
  * Renders the ad group page in WP Admin
4
  *
5
  * @package Advanced_Ads_Admin
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
+ * @copyright since 2013 Thomas Maier, Advanced Ads GmbH
10
  *
11
  */
12
 
admin/views/ad-info-after-textarea.php CHANGED
@@ -4,10 +4,10 @@
4
  * currently "plain text" and "rich content" ad types
5
  *
6
  * @package Advanced_Ads_Admin
7
- * @author Thomas Maier <thomas.maier@webgilde.com>
8
  * @license GPL-2.0+
9
  * @link https://wpadvancedads.com
10
- * @copyright since 2013 Thomas Maier, webgilde GmbH
11
  *
12
  */
13
 
4
  * currently "plain text" and "rich content" ad types
5
  *
6
  * @package Advanced_Ads_Admin
7
+ * @author Thomas Maier <support@wpadvancedads.com>
8
  * @license GPL-2.0+
9
  * @link https://wpadvancedads.com
10
+ * @copyright since 2013 Thomas Maier, Advanced Ads GmbH
11
  *
12
  */
13
 
admin/views/ad-info-bottom.php CHANGED
@@ -3,10 +3,10 @@
3
  * Render additional content below the ad edit page.
4
  *
5
  * @package Advanced_Ads_Admin
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
- * @copyright since 2013 Thomas Maier, webgilde GmbH
10
  *
11
  */
12
 
3
  * Render additional content below the ad edit page.
4
  *
5
  * @package Advanced_Ads_Admin
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
+ * @copyright since 2013 Thomas Maier, Advanced Ads GmbH
10
  *
11
  */
12
 
admin/views/conditions/ad-display-metabox.php CHANGED
@@ -3,10 +3,9 @@
3
  * Render meta box for Display Conditions on ad edit page
4
  *
5
  * @package Advanced_Ads_Admin
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
- * @copyright since 2013 Thomas Maier, webgilde GmbH
10
  */
11
 
12
  $set_conditions = $ad->options( 'conditions' );
@@ -33,8 +32,8 @@ if ( $empty_options ) :
33
  <button type="button" class="advads-video-link-inline button button-primary">
34
  <?php esc_attr_e( 'Watch video', 'advanced-ads' ); ?>
35
  </button>&nbsp;<a class="button button-secondary"
36
- href="<?php echo ADVADS_URL; ?>manual/display-conditions#utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-display"
37
- target="_blank">
38
  <?php esc_attr_e( 'Visit the manual', 'advanced-ads' ); ?>
39
  </a></p>
40
  <?php
@@ -42,8 +41,20 @@ endif;
42
  ?>
43
  <p class="advads-jqueryui-error advads-error-message hidden">
44
  <?php
45
- // translators: %s is a link to a tutorial.
46
- printf( __( 'There might be a problem with layouts and scripts in your dashboard. Please check <a href="%s" target="_blank">this article to learn more</a>.', 'advanced-ads' ), ADVADS_URL . 'manual/jquery-problem-in-dashboard/#utm_source=advanced-ads&utm_medium=link&utm_campaign=notice-jquery-error' ); ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
47
  <p><?php esc_attr_e( 'A page with this ad on it must match all of the following conditions.', 'advanced-ads' ); ?></p>
48
  <?php
49
  $conditions_list_target = 'advads-ad-display-conditions';
3
  * Render meta box for Display Conditions on ad edit page
4
  *
5
  * @package Advanced_Ads_Admin
 
6
  * @license GPL-2.0+
7
  * @link https://wpadvancedads.com
8
+ * @copyright since 2013 Thomas Maier, Advanced Ads GmbH
9
  */
10
 
11
  $set_conditions = $ad->options( 'conditions' );
32
  <button type="button" class="advads-video-link-inline button button-primary">
33
  <?php esc_attr_e( 'Watch video', 'advanced-ads' ); ?>
34
  </button>&nbsp;<a class="button button-secondary"
35
+ href="<?php echo esc_url( ADVADS_URL ); ?>manual/display-conditions#utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-display"
36
+ target="_blank">
37
  <?php esc_attr_e( 'Visit the manual', 'advanced-ads' ); ?>
38
  </a></p>
39
  <?php
41
  ?>
42
  <p class="advads-jqueryui-error advads-error-message hidden">
43
  <?php
44
+ printf(
45
+ wp_kses(
46
+ // translators: %s is a link to a tutorial.
47
+ __( 'There might be a problem with layouts and scripts in your dashboard. Please check <a href="%s" target="_blank">this article to learn more</a>.', 'advanced-ads' ),
48
+ array(
49
+ 'a' => array(
50
+ 'href' => array(),
51
+ 'target' => array(),
52
+ ),
53
+ )
54
+ ),
55
+ esc_url( ADVADS_URL ) . 'manual/jquery-problem-in-dashboard/#utm_source=advanced-ads&utm_medium=link&utm_campaign=notice-jquery-error'
56
+ );
57
+ ?></p>
58
  <p><?php esc_attr_e( 'A page with this ad on it must match all of the following conditions.', 'advanced-ads' ); ?></p>
59
  <?php
60
  $conditions_list_target = 'advads-ad-display-conditions';
admin/views/conditions/ad-visitor-metabox.php CHANGED
@@ -3,10 +3,9 @@
3
  * Render meta box for Visitor Conditions on ad edit page
4
  *
5
  * @package Advanced_Ads_Admin
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
- * @copyright since 2013 Thomas Maier, webgilde GmbH
10
  */
11
 
12
  $set_conditions = $ad->options( 'visitors' );
3
  * Render meta box for Visitor Conditions on ad edit page
4
  *
5
  * @package Advanced_Ads_Admin
 
6
  * @license GPL-2.0+
7
  * @link https://wpadvancedads.com
8
+ * @copyright since 2013 Thomas Maier, Advanced Ads GmbH
9
  */
10
 
11
  $set_conditions = $ad->options( 'visitors' );
admin/views/conditions/condition-author.php CHANGED
@@ -1,20 +1,20 @@
1
  <div class="advads-conditions-single advads-buttonset">
2
  <?php foreach ( $authors as $_author ) {
3
- // don’t use strict comparasion because $values contains strings.
4
  if ( in_array( $_author->ID, $values ) ) {
5
  $_val = 1;
6
  } else {
7
  $_val = 0;
8
  }
9
  $author_name = $_author->display_name;
10
- $field_id = 'advads-conditions-' . absint( $_author->ID ) . $rand;
11
  ?><label class="button ui-button"
12
- for="<?php echo $field_id; ?>">
13
  <?php echo esc_attr( $author_name ); ?>
14
  </label><input type="checkbox"
15
- id="<?php echo $field_id; ?>"
16
- name="<?php echo $name; ?>[value][]" <?php checked( $_val, 1 ); ?>
17
- value="<?php echo absint( $_author->ID ); ?>"><?php
18
  }
19
  include ADVADS_BASE_PATH . 'admin/views/conditions/not-selected.php';
20
  ?>
@@ -24,8 +24,18 @@ if ( count( $authors ) >= $max_authors ) :
24
  ?>
25
  <p class="advads-error-message">
26
  <?php
27
- printf( // translators: %d is the number of elements in the list and %s a URL.
28
- __( 'Only %d elements are displayed above. Use the <code>advanced-ads-admin-max-terms</code> filter to change this limit according to <a href="%s" target="_blank">this page</a>.', 'advanced-ads' ),
 
 
 
 
 
 
 
 
 
 
29
  absint( $max_authors ),
30
  esc_url( ADVADS_URL . 'codex/filter-hooks//#utm_source=advanced-ads&utm_medium=link&utm_campaign=author-term-limit' )
31
  );
1
  <div class="advads-conditions-single advads-buttonset">
2
  <?php foreach ( $authors as $_author ) {
3
+ // don’t use strict comparision because $values contains strings.
4
  if ( in_array( $_author->ID, $values ) ) {
5
  $_val = 1;
6
  } else {
7
  $_val = 0;
8
  }
9
  $author_name = $_author->display_name;
10
+ $field_id = 'advads-conditions-' . absint( $_author->ID ) . $rand;
11
  ?><label class="button ui-button"
12
+ for="<?php echo $field_id; ?>">
13
  <?php echo esc_attr( $author_name ); ?>
14
  </label><input type="checkbox"
15
+ id="<?php echo esc_attr( $field_id ); ?>"
16
+ name="<?php echo esc_attr( $name ); ?>[value][]" <?php checked( $_val, 1 ); ?>
17
+ value="<?php echo absint( $_author->ID ); ?>"><?php
18
  }
19
  include ADVADS_BASE_PATH . 'admin/views/conditions/not-selected.php';
20
  ?>
24
  ?>
25
  <p class="advads-error-message">
26
  <?php
27
+ printf(
28
+ wp_kses(
29
+ // translators: %d is the number of elements in the list and %s a URL.
30
+ __( 'Only %d elements are displayed above. Use the <code>advanced-ads-admin-max-terms</code> filter to change this limit according to <a href="%s" target="_blank">this page</a>.', 'advanced-ads' ),
31
+ array(
32
+ 'code' => array(),
33
+ 'a' => array(
34
+ 'href' => array(),
35
+ 'target' => array(),
36
+ ),
37
+ )
38
+ ),
39
  absint( $max_authors ),
40
  esc_url( ADVADS_URL . 'codex/filter-hooks//#utm_source=advanced-ads&utm_medium=link&utm_campaign=author-term-limit' )
41
  );
admin/views/conditions/condition-device.php CHANGED
@@ -1,10 +1,13 @@
1
- <input type="hidden" name="<?php echo $name; ?>[type]" value="<?php echo $options['type']; ?>"/>
2
- <select name="<?php echo $name; ?>[operator]">
3
- <option value="is" <?php selected( 'is', $operator ); ?>><?php _e( 'Mobile (including tablets)', 'advanced-ads' ); ?></option>
4
- <option value="is_not" <?php selected( 'is_not', $operator ); ?>><?php _e( 'Desktop', 'advanced-ads' ); ?></option>
5
  </select>
6
- <p class="description"><?php echo $type_options[ $options['type'] ]['description'];
7
- if ( isset( $type_options[ $options['type'] ]['helplink'] ) ) : ?>
8
- <a href="<?php echo $type_options[ $options['type'] ]['helplink']; ?>" target="_blank"><?php
9
- _e( 'Manual and Troubleshooting', 'advanced-ads' );
10
- ?></a><?php endif; ?></p>
 
 
 
1
+ <input type="hidden" name="<?php echo esc_attr( $name ); ?>[type]" value="<?php echo esc_attr( $options['type'] ); ?>"/>
2
+ <select name="<?php echo esc_attr( $name ); ?>[operator]">
3
+ <option value="is" <?php selected( 'is', $operator ); ?>><?php esc_html_e( 'Mobile (including tablets)', 'advanced-ads' ); ?></option>
4
+ <option value="is_not" <?php selected( 'is_not', $operator ); ?>><?php esc_html_e( 'Desktop', 'advanced-ads' ); ?></option>
5
  </select>
6
+ <p class="description">
7
+ <?php
8
+ echo $type_options[ $options['type'] ]['description'];
9
+ if ( isset( $type_options[ $options['type'] ]['helplink'] ) ) :
10
+ ?>
11
+ <a href="<?php echo esc_url( $type_options[ $options['type'] ]['helplink'] ); ?>" target="_blank">
12
+ <?php esc_html_e( 'Manual and Troubleshooting', 'advanced-ads' ); ?>
13
+ </a><?php endif; ?></p>
admin/views/conditions/condition-is-or-not.php CHANGED
@@ -1,10 +1,15 @@
1
- <input type="hidden" name="<?php echo $name; ?>[type]" value="<?php echo $options['type']; ?>"/>
2
- <select name="<?php echo $name; ?>[operator]">
3
- <option value="is" <?php selected( 'is', $operator ); ?>><?php _e( 'is', 'advanced-ads' ); ?></option>
4
- <option value="is_not" <?php selected( 'is_not', $operator ); ?>><?php _e( 'is not', 'advanced-ads' ); ?></option>
5
  </select>
6
- <p class="description"><?php echo $type_options[ $options['type'] ]['description'];
7
- if ( isset( $type_options[ $options['type'] ]['helplink'] ) ) : ?>
8
- <a href="<?php echo $type_options[ $options['type'] ]['helplink']; ?>" target="_blank"><?php
9
- _e( 'Manual and Troubleshooting', 'advanced-ads' );
10
- ?></a><?php endif; ?></p>
 
 
 
 
 
1
+ <input type="hidden" name="<?php echo esc_attr( $name ); ?>[type]" value="<?php echo esc_attr( $options['type'] ); ?>"/>
2
+ <select name="<?php echo esc_attr( $name ); ?>[operator]">
3
+ <option value="is" <?php selected( 'is', $operator ); ?>><?php esc_html_e( 'is', 'advanced-ads' ); ?></option>
4
+ <option value="is_not" <?php selected( 'is_not', $operator ); ?>><?php esc_html_e( 'is not', 'advanced-ads' ); ?></option>
5
  </select>
6
+ <p class="description">
7
+ <?php
8
+ echo $type_options[ $options['type'] ]['description'];
9
+ if ( isset( $type_options[ $options['type'] ]['helplink'] ) ) :
10
+ ?>
11
+ <a href="<?php echo esc_url( $type_options[ $options['type'] ]['helplink'] ); ?>" target="_blank">
12
+ <?php
13
+ esc_html_e( 'Manual and Troubleshooting', 'advanced-ads' );
14
+ ?>
15
+ </a><?php endif; ?></p>
admin/views/conditions/condition-number.php CHANGED
@@ -1,7 +1,7 @@
1
- <input type="hidden" name="<?php echo $name; ?>[type]" value="<?php echo $options['type']; ?>"/>
2
- <select name="<?php echo $name; ?>[operator]">
3
- <option value="is_equal" <?php selected( 'is_equal', $operator ); ?>><?php _e( 'equal', 'advanced-ads' ); ?></option>
4
- <option value="is_higher" <?php selected( 'is_higher', $operator ); ?>><?php _e( 'equal or higher', 'advanced-ads' ); ?></option>
5
- <option value="is_lower" <?php selected( 'is_lower', $operator ); ?>><?php _e( 'equal or lower', 'advanced-ads' ); ?></option>
6
- </select><input type="number" name="<?php echo $name; ?>[value]" value="<?php echo absint( $value ); ?>"/>
7
- <p class="description"><?php echo $type_options[ $options['type'] ]['description']; ?></p>
1
+ <input type="hidden" name="<?php echo esc_attr( $name ); ?>[type]" value="<?php echo esc_attr( $options['type'] ); ?>"/>
2
+ <select name="<?php echo esc_attr( $name ); ?>[operator]">
3
+ <option value="is_equal" <?php selected( 'is_equal', $operator ); ?>><?php esc_html_e( 'equal', 'advanced-ads' ); ?></option>
4
+ <option value="is_higher" <?php selected( 'is_higher', $operator ); ?>><?php esc_html_e( 'equal or higher', 'advanced-ads' ); ?></option>
5
+ <option value="is_lower" <?php selected( 'is_lower', $operator ); ?>><?php esc_html_e( 'equal or lower', 'advanced-ads' ); ?></option>
6
+ </select><input type="number" name="<?php echo esc_attr( $name ); ?>[value]" value="<?php echo absint( $value ); ?>"/>
7
+ <p class="description"><?php echo $type_options[ $options['type'] ]['description']; ?></p>
admin/views/conditions/condition-operator.php CHANGED
@@ -1,4 +1,4 @@
1
- <select name="<?php echo $name; ?>[operator]">
2
  <option value="is" <?php selected( 'is', $operator ); ?>><?php esc_attr_e( 'is', 'advanced-ads' ); ?></option>
3
  <option value="is_not" <?php selected( 'is_not', $operator ); ?>><?php esc_attr_e( 'is not', 'advanced-ads' ); ?></option>
4
  </select>
1
+ <select name="<?php echo esc_attr( $name ); ?>[operator]">
2
  <option value="is" <?php selected( 'is', $operator ); ?>><?php esc_attr_e( 'is', 'advanced-ads' ); ?></option>
3
  <option value="is_not" <?php selected( 'is_not', $operator ); ?>><?php esc_attr_e( 'is not', 'advanced-ads' ); ?></option>
4
  </select>
admin/views/conditions/condition-string.php CHANGED
@@ -1,6 +1,6 @@
1
- <input type="hidden" name="<?php echo $name; ?>[type]" value="<?php echo $options['type']; ?>"/>
2
  <div class="advads-condition-line-wrap">
3
- <?php include( ADVADS_BASE_PATH . 'admin/views/ad-conditions-string-operators.php' ); ?>
4
- <input type="text" name="<?php echo $name; ?>[value]" value="<?php echo $value; ?>"/>
5
  </div>
6
  <p class="description"><?php echo $type_options[ $options['type'] ]['description']; ?></p>
1
+ <input type="hidden" name="<?php echo esc_attr( $name ); ?>[type]" value="<?php echo esc_attr( $options['type'] ); ?>"/>
2
  <div class="advads-condition-line-wrap">
3
+ <?php include ADVADS_BASE_PATH . 'admin/views/ad-conditions-string-operators.php'; ?>
4
+ <input type="text" name="<?php echo esc_attr( $name ); ?>[value]" value="<?php echo esc_attr( $value ); ?>"/>
5
  </div>
6
  <p class="description"><?php echo $type_options[ $options['type'] ]['description']; ?></p>
admin/views/conditions/conditions-form.php CHANGED
@@ -1,19 +1,21 @@
1
- <fieldset data-condition-list-target="<?php echo $list_target; ?>"
2
- data-condition-form-name="<?php echo $form_name; ?>"
3
- data-condition-action="<?php echo $action; ?>"
4
- data-condition-connector-default="<?php echo $connector_default; ?>"
5
  <?php
6
  if ( $empty_options ) :
7
- ?> class="advads-hide-in-wizard"<?php endif; ?>>
 
 
8
  <legend><?php esc_attr_e( 'New condition', 'advanced-ads' ); ?></legend>
9
  <input type="hidden" class="advads-conditions-index"
10
- value="<?php echo is_array( $set_conditions ) ? count( $set_conditions ) : 0; ?>"/>
11
  <div class="advads-conditions-new">
12
  <select>
13
  <option value=""><?php esc_attr_e( '-- choose a condition --', 'advanced-ads' ); ?></option>
14
  <?php foreach ( $conditions as $_condition_id => $_condition ) : ?>
15
  <?php if ( empty( $_condition['disabled'] ) ) : ?>
16
- <option value="<?php echo $_condition_id; ?>"><?php echo $_condition['label']; ?></option>
17
  <?php endif; ?>
18
  <?php
19
  endforeach;
@@ -23,7 +25,7 @@
23
  <?php
24
  foreach ( $pro_conditions as $_pro_condition ) :
25
  ?>
26
- <option disabled="disabled"><?php echo $_pro_condition; ?></option>
27
  <?php
28
  endforeach;
29
  ?>
1
+ <fieldset data-condition-list-target="<?php echo esc_attr( $list_target ); ?>"
2
+ data-condition-form-name="<?php echo esc_attr( $form_name ); ?>"
3
+ data-condition-action="<?php echo esc_attr( $action ); ?>"
4
+ data-condition-connector-default="<?php echo esc_attr( $connector_default ); ?>"
5
  <?php
6
  if ( $empty_options ) :
7
+ ?> class="advads-hide-in-wizard"<?php
8
+ endif;
9
+ ?>>
10
  <legend><?php esc_attr_e( 'New condition', 'advanced-ads' ); ?></legend>
11
  <input type="hidden" class="advads-conditions-index"
12
+ value="<?php echo is_array( $set_conditions ) ? count( $set_conditions ) : 0; ?>"/>
13
  <div class="advads-conditions-new">
14
  <select>
15
  <option value=""><?php esc_attr_e( '-- choose a condition --', 'advanced-ads' ); ?></option>
16
  <?php foreach ( $conditions as $_condition_id => $_condition ) : ?>
17
  <?php if ( empty( $_condition['disabled'] ) ) : ?>
18
+ <option value="<?php echo esc_attr( $_condition_id ); ?>"><?php echo esc_html( $_condition['label'] ); ?></option>
19
  <?php endif; ?>
20
  <?php
21
  endforeach;
25
  <?php
26
  foreach ( $pro_conditions as $_pro_condition ) :
27
  ?>
28
+ <option disabled="disabled"><?php echo esc_html( $_pro_condition ); ?></option>
29
  <?php
30
  endforeach;
31
  ?>
admin/views/conditions/display-conditions-list.php CHANGED
@@ -1,4 +1,4 @@
1
- <table id="<?php echo $list_target; ?>" class="advads-conditions-table">
2
  <tbody>
3
  <?php
4
  $last_index = - 1;
@@ -34,7 +34,7 @@
34
  if ( $i > 0 ) :
35
 
36
  ?>
37
- <tr class="advads-conditions-connector advads-conditions-connector-<?php echo $connector; ?>">
38
  <td colspan="3">
39
  <?php
40
  echo Advanced_Ads_Display_Conditions::render_connector_option( $i, $connector, $form_name );
@@ -43,7 +43,7 @@
43
  <p class="advads-error-message">
44
  <?php
45
  esc_attr_e( 'Forced to OR.', 'advanced-ads' );
46
- echo '&nbsp;<a target="_blank" href="' . ADVADS_URL . 'manual/display-conditions#manual-combining-multiple-conditions' . '">' . esc_attr__( 'manual', 'advanced-ads' ) . '</a>';
47
  ?>
48
  </p>
49
  <?php
@@ -54,7 +54,7 @@
54
  </tr><?php endif; ?>
55
  <tr>
56
  <td class="advads-conditions-type"
57
- data-condition-type="<?php echo $_options['type']; ?>"><?php echo $conditions[ $_options['type'] ]['label']; ?></td>
58
  <td>
59
  <?php
60
  call_user_func( array( $metabox[0], $metabox[1] ), $_options, $i ++, $form_name );
1
+ <table id="<?php echo esc_attr( $list_target ); ?>" class="advads-conditions-table">
2
  <tbody>
3
  <?php
4
  $last_index = - 1;
34
  if ( $i > 0 ) :
35
 
36
  ?>
37
+ <tr class="advads-conditions-connector advads-conditions-connector-<?php echo esc_attr( $connector ); ?>">
38
  <td colspan="3">
39
  <?php
40
  echo Advanced_Ads_Display_Conditions::render_connector_option( $i, $connector, $form_name );
43
  <p class="advads-error-message">
44
  <?php
45
  esc_attr_e( 'Forced to OR.', 'advanced-ads' );
46
+ echo '&nbsp;<a target="_blank" href="' . esc_url( ADVADS_URL ) . 'manual/display-conditions#manual-combining-multiple-conditions">' . esc_attr__( 'manual', 'advanced-ads' ) . '</a>';
47
  ?>
48
  </p>
49
  <?php
54
  </tr><?php endif; ?>
55
  <tr>
56
  <td class="advads-conditions-type"
57
+ data-condition-type="<?php echo esc_attr( $_options['type'] ); ?>"><?php echo esc_html( $conditions[ $_options['type'] ]['label'] ); ?></td>
58
  <td>
59
  <?php
60
  call_user_func( array( $metabox[0], $metabox[1] ), $_options, $i ++, $form_name );
admin/views/conditions/no-option.php CHANGED
@@ -4,5 +4,11 @@
4
  */
5
  ?>
6
  <p class="advads-conditions-not-selected advads-error-message">
7
- <?php printf( _x( 'No %s found on your site.', 'Error message shown when no terms exists for display condition; placeholder is taxonomy label.', 'advanced-ads' ), $taxonomy->label ); ?>
 
 
 
 
 
 
8
  </p>
4
  */
5
  ?>
6
  <p class="advads-conditions-not-selected advads-error-message">
7
+ <?php
8
+ printf(
9
+ // translators: %s is a name of a taxonomy.
10
+ esc_html_x( 'No %s found on your site.', 'Error message shown when no terms exists for display condition; placeholder is taxonomy label.', 'advanced-ads' ),
11
+ esc_html( $taxonomy->label )
12
+ );
13
+ ?>
14
  </p>
admin/views/conditions/not-selected.php CHANGED
@@ -1,3 +1,3 @@
1
  <p class="advads-conditions-not-selected advads-error-message">
2
- <?php _ex( 'Please select some items.', 'Error message shown when no display condition term is selected', 'advanced-ads' ); ?>
3
  </p>
1
  <p class="advads-conditions-not-selected advads-error-message">
2
+ <?php echo esc_html_x( 'Please select some items.', 'Error message shown when no display condition term is selected', 'advanced-ads' ); ?>
3
  </p>
admin/views/conditions/visitor-conditions-form-top.php CHANGED
@@ -1,15 +1,27 @@
1
  <?php $empty_options = ( ! is_array( $set_conditions ) || ! count( $set_conditions ) );
2
  if ( $empty_options ) :
3
  ?>
4
- <p><?php _e( 'Visitor conditions limit the number of users who can see your ad. There is no need to set visitor conditions if you want all users to see the ad.', 'advanced-ads' ); ?></p>
5
  <?php
6
  elseif ( Advanced_Ads_Checks::cache() && ! defined( 'AAP_VERSION' ) ) :
7
  ?>
8
  <p>
9
- <span class="advads-error-message"><?php _e( 'It seems that a caching plugin is activated.', 'advanced-ads' ); ?></span>&nbsp;
10
  <?php
11
- printf( __( 'Check out cache-busting in <a href="%s" target="_blank">Advanced Ads Pro</a> if dynamic features get cached.', 'advanced-ads' ), ADVADS_URL . 'add-ons/advanced-ads-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-visitor' );
 
 
 
 
 
 
 
 
 
 
 
 
12
  ?>
13
  </p>
14
  <?php
15
- endif;
1
  <?php $empty_options = ( ! is_array( $set_conditions ) || ! count( $set_conditions ) );
2
  if ( $empty_options ) :
3
  ?>
4
+ <p><?php esc_html_e( 'Visitor conditions limit the number of users who can see your ad. There is no need to set visitor conditions if you want all users to see the ad.', 'advanced-ads' ); ?></p>
5
  <?php
6
  elseif ( Advanced_Ads_Checks::cache() && ! defined( 'AAP_VERSION' ) ) :
7
  ?>
8
  <p>
9
+ <span class="advads-error-message"><?php esc_html_e( 'It seems that a caching plugin is activated.', 'advanced-ads' ); ?></span>&nbsp;
10
  <?php
11
+ printf(
12
+ wp_kses(
13
+ // translators: %s is a URL.
14
+ __( 'Check out cache-busting in <a href="%s" target="_blank">Advanced Ads Pro</a> if dynamic features get cached.', 'advanced-ads' ),
15
+ array(
16
+ 'a' => array(
17
+ 'href' => array(),
18
+ 'target' => array(),
19
+ ),
20
+ )
21
+ ),
22
+ esc_url( ADVADS_URL ) . 'add-ons/advanced-ads-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-visitor'
23
+ );
24
  ?>
25
  </p>
26
  <?php
27
+ endif;
admin/views/conditions/visitor-conditions-list.php CHANGED
@@ -1,4 +1,4 @@
1
- <table id="<?php echo $list_target; ?>" class="advads-conditions-table">
2
  <tbody>
3
  <?php
4
  if ( isset( $set_conditions ) ) :
@@ -13,7 +13,7 @@
13
  if ( method_exists( $metabox[0], $metabox[1] ) ) {
14
  if ( $i > 0 ) :
15
  ?>
16
- <tr class="advads-conditions-connector advads-conditions-connector-<?php echo $connector; ?>">
17
  <td colspan="3">
18
  <?php
19
  echo Advanced_Ads_Visitor_Conditions::render_connector_option( $i, $connector, $form_name );
@@ -22,7 +22,7 @@
22
  </tr>
23
  <?php endif; ?>
24
  <tr>
25
- <td class="advads-conditions-type"><?php echo $conditions[ $_options['type'] ]['label']; ?></td>
26
  <td>
27
  <?php
28
  call_user_func( array( $metabox[0], $metabox[1] ), $_options, $i ++, $form_name );
@@ -38,4 +38,4 @@
38
  endif;
39
  ?>
40
  </tbody>
41
- </table>
1
+ <table id="<?php echo esc_attr( $list_target ); ?>" class="advads-conditions-table">
2
  <tbody>
3
  <?php
4
  if ( isset( $set_conditions ) ) :
13
  if ( method_exists( $metabox[0], $metabox[1] ) ) {
14
  if ( $i > 0 ) :
15
  ?>
16
+ <tr class="advads-conditions-connector advads-conditions-connector-<?php echo esc_attr( $connector ); ?>">
17
  <td colspan="3">
18
  <?php
19
  echo Advanced_Ads_Visitor_Conditions::render_connector_option( $i, $connector, $form_name );
22
  </tr>
23
  <?php endif; ?>
24
  <tr>
25
+ <td class="advads-conditions-type"><?php echo esc_html( $conditions[ $_options['type'] ]['label'] ); ?></td>
26
  <td>
27
  <?php
28
  call_user_func( array( $metabox[0], $metabox[1] ), $_options, $i ++, $form_name );
38
  endif;
39
  ?>
40
  </tbody>
41
+ </table>
advanced-ads.php CHANGED
@@ -3,7 +3,7 @@
3
  * Advanced Ads.
4
  *
5
  * @package Advanced_Ads
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
  * @copyright 2013-2020 Thomas Maier, Advanced Ads GmbH
@@ -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.17
16
  * Author: Thomas Maier, Advanced Ads GmbH
17
  * Author URI: https://wpadvancedads.com
18
  * Text Domain: advanced-ads
@@ -26,42 +26,36 @@ if ( ! defined( 'WPINC' ) ) {
26
  die;
27
  }
28
 
29
- // only load if not already existing (maybe included from another plugin)
30
  if ( defined( 'ADVADS_BASE_PATH' ) ) {
31
- return ;
32
  }
33
 
34
- // load basic path to the plugin
35
- define( 'ADVADS_BASE', plugin_basename( __FILE__ ) ); // plugin base as used by WordPress to identify it
36
  define( 'ADVADS_BASE_PATH', plugin_dir_path( __FILE__ ) );
37
  define( 'ADVADS_BASE_URL', plugin_dir_url( __FILE__ ) );
38
- define( 'ADVADS_BASE_DIR', dirname( ADVADS_BASE ) ); // directory of the plugin without any paths
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.17' );
43
 
44
- /*----------------------------------------------------------------------------*
45
- * Autoloading, modules and functions
46
- *----------------------------------------------------------------------------*/
47
 
48
- // load public functions (might be used by modules, other plugins or theme)
49
  require_once ADVADS_BASE_PATH . 'includes/functions.php';
50
  require_once ADVADS_BASE_PATH . 'includes/load_modules.php';
51
  require_once ADVADS_BASE_PATH . 'includes/cap_map.php';
52
 
53
- Advanced_Ads_ModuleLoader::getLoader(); // enable autoloading
54
 
55
- /*----------------------------------------------------------------------------*
56
- * Public-Facing and Core Functionality
57
- *----------------------------------------------------------------------------*/
58
 
59
  Advanced_Ads::get_instance();
60
- Advanced_Ads_ModuleLoader::loadModules( ADVADS_BASE_PATH . 'modules/' ); // enable modules, requires base class
61
 
62
- /*----------------------------------------------------------------------------*
63
- * Dashboard and Administrative Functionality
64
- *----------------------------------------------------------------------------*/
65
 
66
  if ( is_admin() ) {
67
  Advanced_Ads_Admin::get_instance();
3
  * Advanced Ads.
4
  *
5
  * @package Advanced_Ads
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
  * @link https://wpadvancedads.com
9
  * @copyright 2013-2020 Thomas Maier, Advanced Ads GmbH
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
+ * Version: 1.17.1
16
  * Author: Thomas Maier, Advanced Ads GmbH
17
  * Author URI: https://wpadvancedads.com
18
  * Text Domain: advanced-ads
26
  die;
27
  }
28
 
29
+ // only load if not already existing (maybe included from another plugin).
30
  if ( defined( 'ADVADS_BASE_PATH' ) ) {
31
+ return;
32
  }
33
 
34
+ // load basic path to the plugin.
35
+ define( 'ADVADS_BASE', plugin_basename( __FILE__ ) ); // plugin base as used by WordPress to identify it.
36
  define( 'ADVADS_BASE_PATH', plugin_dir_path( __FILE__ ) );
37
  define( 'ADVADS_BASE_URL', plugin_dir_url( __FILE__ ) );
38
+ define( 'ADVADS_BASE_DIR', dirname( ADVADS_BASE ) ); // directory of the plugin without any paths.
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.17.1' );
43
 
44
+ // Autoloading, modules and functions.
 
 
45
 
46
+ // load public functions (might be used by modules, other plugins or theme).
47
  require_once ADVADS_BASE_PATH . 'includes/functions.php';
48
  require_once ADVADS_BASE_PATH . 'includes/load_modules.php';
49
  require_once ADVADS_BASE_PATH . 'includes/cap_map.php';
50
 
51
+ Advanced_Ads_ModuleLoader::getLoader(); // enable autoloading.
52
 
53
+ // Public-Facing and Core Functionality.
 
 
54
 
55
  Advanced_Ads::get_instance();
56
+ Advanced_Ads_ModuleLoader::loadModules( ADVADS_BASE_PATH . 'modules/' ); // enable modules, requires base class.
57
 
58
+ // Dashboard and Administrative Functionality.
 
 
59
 
60
  if ( is_admin() ) {
61
  Advanced_Ads_Admin::get_instance();
classes/ad.php CHANGED
@@ -4,17 +4,17 @@
4
  * Advanced Ads Ad.
5
  *
6
  * @package Advanced_Ads_Ad
7
- * @author Thomas Maier <thomas.maier@webgilde.com>
8
  * @license GPL-2.0+
9
- * @link http://webgilde.com
10
- * @copyright 2013 Thomas Maier, webgilde GmbH
11
  */
12
 
13
  /**
14
  * an ad object
15
  *
16
  * @package Advanced_Ads_Ad
17
- * @author Thomas Maier <thomas.maier@webgilde.com>
18
  * @deprecated since version 1.5.3 (May 6th 2015)
19
  * might still be needed if some old add-ons are running somewhere
20
  */
@@ -28,7 +28,7 @@ if( ! class_exists ( 'Advads_Ad', false ) ){
28
  * an ad object
29
  *
30
  * @package Advanced_Ads_Ad
31
- * @author Thomas Maier <thomas.maier@webgilde.com>
32
  */
33
  class Advanced_Ads_Ad {
34
 
4
  * Advanced Ads Ad.
5
  *
6
  * @package Advanced_Ads_Ad
7
+ * @author Thomas Maier <support@wpadvancedads.com>
8
  * @license GPL-2.0+
9
+ * @link https://wpadvancedads.com
10
+ * @copyright 2013 Thomas Maier, Advanced Ads GmbH
11
  */
12
 
13
  /**
14
  * an ad object
15
  *
16
  * @package Advanced_Ads_Ad
17
+ * @author Thomas Maier <support@wpadvancedads.com>
18
  * @deprecated since version 1.5.3 (May 6th 2015)
19
  * might still be needed if some old add-ons are running somewhere
20
  */
28
  * an ad object
29
  *
30
  * @package Advanced_Ads_Ad
31
+ * @author Thomas Maier <support@wpadvancedads.com>
32
  */
33
  class Advanced_Ads_Ad {
34
 
classes/ad_ajax_callbacks.php CHANGED
@@ -4,17 +4,17 @@
4
  * Advanced Ads.
5
  *
6
  * @package Advanced_Ads
7
- * @author Thomas Maier <thomas.maier@webgilde.com>
8
  * @license GPL-2.0+
9
- * @link http://webgilde.com
10
- * @copyright 2013-2018 Thomas Maier, webgilde GmbH
11
  */
12
 
13
  /**
14
  * This class is used to bundle all ajax callbacks
15
  *
16
  * @package Advanced_Ads_Ajax_Callbacks
17
- * @author Thomas Maier <thomas.maier@webgilde.com>
18
  */
19
  class Advanced_Ads_Ad_Ajax_Callbacks {
20
 
4
  * Advanced Ads.
5
  *
6
  * @package Advanced_Ads
7
+ * @author Thomas Maier <support@wpadvancedads.com>
8
  * @license GPL-2.0+
9
+ * @link https://wpadvancedads.com
10
+ * @copyright 2013-2018 Thomas Maier, Advanced Ads GmbH
11
  */
12
 
13
  /**
14
  * This class is used to bundle all ajax callbacks
15
  *
16
  * @package Advanced_Ads_Ajax_Callbacks
17
+ * @author Thomas Maier <support@wpadvancedads.com>
18
  */
19
  class Advanced_Ads_Ad_Ajax_Callbacks {
20
 
classes/ad_group.php CHANGED
@@ -4,17 +4,17 @@
4
  * Advanced Ads
5
  *
6
  * @package Advanced_Ads_Group
7
- * @author Thomas Maier <thomas.maier@webgilde.com>
8
  * @license GPL-2.0+
9
- * @link http://webgilde.com
10
- * @copyright 2014 Thomas Maier, webgilde GmbH
11
  */
12
 
13
  /**
14
  * an ad group object
15
  *
16
  * @package Advanced_Ads_Group
17
- * @author Thomas Maier <thomas.maier@webgilde.com>
18
  */
19
  class Advanced_Ads_Group {
20
 
4
  * Advanced Ads
5
  *
6
  * @package Advanced_Ads_Group
7
+ * @author Thomas Maier <support@wpadvancedads.com>
8
  * @license GPL-2.0+
9
+ * @link https://wpadvancedads.com
10
+ * @copyright 2014 Thomas Maier, Advanced Ads GmbH
11
  */
12
 
13
  /**
14
  * an ad group object
15
  *
16
  * @package Advanced_Ads_Group
17
+ * @author Thomas Maier <support@wpadvancedads.com>
18
  */
19
  class Advanced_Ads_Group {
20
 
classes/ad_placements.php CHANGED
@@ -4,10 +4,10 @@
4
  * Advanced Ads
5
  *
6
  * @package Advanced_Ads_Placements
7
- * @author Thomas Maier <thomas.maier@webgilde.com>
8
  * @license GPL-2.0+
9
- * @link http://webgilde.com
10
- * @copyright 2014 Thomas Maier, webgilde GmbH
11
  */
12
 
13
  /**
@@ -15,7 +15,7 @@
15
  *
16
  * @since 1.1.0
17
  * @package Advanced_Ads_Placements
18
- * @author Thomas Maier <thomas.maier@webgilde.com>
19
  */
20
  class Advanced_Ads_Placements {
21
  private static $ads_for_placeholders = array();
4
  * Advanced Ads
5
  *
6
  * @package Advanced_Ads_Placements
7
+ * @author Thomas Maier <support@wpadvancedads.com>
8
  * @license GPL-2.0+
9
+ * @link https://wpadvancedads.com
10
+ * @copyright 2014 Thomas Maier, Advanced Ads GmbH
11
  */
12
 
13
  /**
15
  *
16
  * @since 1.1.0
17
  * @package Advanced_Ads_Placements
18
+ * @author Thomas Maier <support@wpadvancedads.com>
19
  */
20
  class Advanced_Ads_Placements {
21
  private static $ads_for_placeholders = array();
classes/ad_type_abstract.php CHANGED
@@ -3,10 +3,10 @@
3
  * Advanced Ads Abstract Ad Type
4
  *
5
  * @package Advanced_Ads
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
- * @link http://webgilde.com
9
- * @copyright 2014 Thomas Maier, webgilde GmbH
10
  *
11
  * Class containing information that are defaults for all the other ad types
12
  *
3
  * Advanced Ads Abstract Ad Type
4
  *
5
  * @package Advanced_Ads
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
+ * @link https://wpadvancedads.com
9
+ * @copyright 2014 Thomas Maier, Advanced Ads GmbH
10
  *
11
  * Class containing information that are defaults for all the other ad types
12
  *
classes/ad_type_content.php CHANGED
@@ -3,10 +3,10 @@
3
  * Advanced Ads Content Ad Type
4
  *
5
  * @package Advanced_Ads
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
- * @link http://webgilde.com
9
- * @copyright 2014 Thomas Maier, webgilde GmbH
10
  *
11
  * Class containing information about the content ad type
12
  * this should also work as an example for other ad types
3
  * Advanced Ads Content Ad Type
4
  *
5
  * @package Advanced_Ads
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
+ * @link https://wpadvancedads.com
9
+ * @copyright 2014 Thomas Maier, Advanced Ads GmbH
10
  *
11
  * Class containing information about the content ad type
12
  * this should also work as an example for other ad types
classes/ad_type_dummy.php CHANGED
@@ -3,10 +3,10 @@
3
  * Advanced Ads Dummy Ad Type
4
  *
5
  * @package Advanced_Ads
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
- * @link http://webgilde.com
9
- * @copyright 2014-2017 Thomas Maier, webgilde GmbH
10
  * @since 1.8
11
  *
12
  * Class containing information about the dummy ad type
3
  * Advanced Ads Dummy Ad Type
4
  *
5
  * @package Advanced_Ads
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
+ * @link https://wpadvancedads.com
9
+ * @copyright 2014-2017 Thomas Maier, Advanced Ads GmbH
10
  * @since 1.8
11
  *
12
  * Class containing information about the dummy ad type
classes/ad_type_group.php CHANGED
@@ -3,10 +3,10 @@
3
  * Advanced Ads Plain Ad Type
4
  *
5
  * @package Advanced_Ads
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
- * @link http://webgilde.com
9
- * @copyright 2014-2016 Thomas Maier, webgilde GmbH
10
  *
11
  * Class containing information about the plain text/code ad type
12
  *
3
  * Advanced Ads Plain Ad Type
4
  *
5
  * @package Advanced_Ads
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
+ * @link https://wpadvancedads.com
9
+ * @copyright 2014-2016 Thomas Maier, Advanced Ads GmbH
10
  *
11
  * Class containing information about the plain text/code ad type
12
  *
classes/ad_type_image.php CHANGED
@@ -3,10 +3,10 @@
3
  * Advanced Ads Image Ad Type
4
  *
5
  * @package Advanced_Ads
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
- * @link http://webgilde.com
9
- * @copyright 2015 Thomas Maier, webgilde GmbH
10
  * @since 1.6.10
11
  *
12
  * Class containing information about the content ad type
3
  * Advanced Ads Image Ad Type
4
  *
5
  * @package Advanced_Ads
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
+ * @link https://wpadvancedads.com
9
+ * @copyright 2015 Thomas Maier, Advanced Ads GmbH
10
  * @since 1.6.10
11
  *
12
  * Class containing information about the content ad type
classes/ad_type_plain.php CHANGED
@@ -4,10 +4,10 @@
4
  * Advanced Ads Plain Ad Type
5
  *
6
  * @package Advanced_Ads
7
- * @author Thomas Maier <thomas.maier@webgilde.com>
8
  * @license GPL-2.0+
9
- * @link http://webgilde.com
10
- * @copyright 2014 Thomas Maier, webgilde GmbH
11
  *
12
  * Class containing information about the plain text/code ad type
13
  *
4
  * Advanced Ads Plain Ad Type
5
  *
6
  * @package Advanced_Ads
7
+ * @author Thomas Maier <support@wpadvancedads.com>
8
  * @license GPL-2.0+
9
+ * @link https://wpadvancedads.com
10
+ * @copyright 2014 Thomas Maier, Advanced Ads GmbH
11
  *
12
  * Class containing information about the plain text/code ad type
13
  *
classes/display-conditions.php CHANGED
@@ -88,8 +88,7 @@ class Advanced_Ads_Display_Conditions {
88
  'label' => __( 'post type', 'advanced-ads' ),
89
  'description' => __( 'Choose the public post types on which to display the ad.', 'advanced-ads' ),
90
  'metabox' => array( 'Advanced_Ads_Display_Conditions', 'metabox_post_type' ), // callback to generate the metabox.
91
- 'check' => array( 'Advanced_Ads_Display_Conditions', 'check_post_type' ), // callback for frontend check
92
- // '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
93
  ),
94
  // post id condition.
95
  'postids' => array(
@@ -101,14 +100,12 @@ class Advanced_Ads_Display_Conditions {
101
  // general conditions.
102
  'general' => array(
103
  'label' => __( 'general conditions', 'advanced-ads' ),
104
- // 'description' => __( 'Choose on which individual posts, pages and public post type pages you want to display or hide ads.', 'advanced-ads' ),
105
  'metabox' => array( 'Advanced_Ads_Display_Conditions', 'metabox_general' ), // callback to generate the metabox.
106
  'check' => array( 'Advanced_Ads_Display_Conditions', 'check_general' ), // callback for frontend check.
107
  ),
108
  // author conditions.
109
  'author' => array(
110
  'label' => __( 'author', 'advanced-ads' ),
111
- // 'description' => __( 'Choose on which individual posts, pages and public post type pages you want to display or hide ads.', 'advanced-ads' ),
112
  'metabox' => array( 'Advanced_Ads_Display_Conditions', 'metabox_author' ), // callback to generate the metabox.
113
  'check' => array( 'Advanced_Ads_Display_Conditions', 'check_author' ), // callback for frontend check.
114
  ),
@@ -129,7 +126,14 @@ class Advanced_Ads_Display_Conditions {
129
  );
130
 
131
  // register a condition for each taxonomy for posts.
132
- $taxonomies = get_taxonomies( array( 'public' => true, 'publicly_queryable' => true ), 'objects', 'or' );
 
 
 
 
 
 
 
133
 
134
  $tax_label_counts = array();
135
 
@@ -146,7 +150,8 @@ class Advanced_Ads_Display_Conditions {
146
 
147
  // add tax type to label if we find it multiple times.
148
  if ( $tax_label_counts[ $_tax->label ] < 2 ) {
149
- $label = $archive_label = $_tax->label;
 
150
  } else {
151
  $label = sprintf( '%s (%s)', $_tax->label, $_tax->name );
152
  $archive_label = sprintf( '%s (%s)', $_tax->labels->singular_name, $_tax->name );
@@ -154,15 +159,17 @@ class Advanced_Ads_Display_Conditions {
154
 
155
  $conditions[ 'taxonomy_' . $_tax->name ] = array(
156
  'label' => $label,
157
- // 'description' => sprintf(__( 'Choose terms from the %s taxonomy a post must belong to for showing or hiding ads.', 'advanced-ads' ), $_tax->label ),
158
- 'metabox' => array( 'Advanced_Ads_Display_Conditions', 'metabox_taxonomy_terms' ), // callback to generate the metabox
159
- 'check' => array( 'Advanced_Ads_Display_Conditions', 'check_taxonomies' ), // callback for frontend check
160
- 'taxonomy' => $_tax->name, // unique for this type: the taxonomy name
161
  );
162
 
163
  $conditions[ 'archive_' . $_tax->name ] = array(
164
- 'label' => sprintf( __( 'archive: %s', 'advanced-ads' ), $archive_label ),
165
- // 'description' => sprintf(__( 'Choose on which %s archive page ads are hidden or displayeds.', 'advanced-ads' ), $_tax->label ),
 
 
 
166
  'metabox' => array( 'Advanced_Ads_Display_Conditions', 'metabox_taxonomy_terms' ), // callback to generate the metabox.
167
  'check' => array( 'Advanced_Ads_Display_Conditions', 'check_taxonomy_archive' ), // callback for frontend check.
168
  'taxonomy' => $_tax->name, // unique for this type: the taxonomy name.
@@ -173,9 +180,9 @@ class Advanced_Ads_Display_Conditions {
173
  }
174
 
175
  /**
176
- * Instance of Advanced_Ads_Plugin
177
  *
178
- * @return Advanced_Ads_Plugin
179
  */
180
  public static function get_instance() {
181
  // If the single instance hasn't been set, set it now.
@@ -201,8 +208,8 @@ class Advanced_Ads_Display_Conditions {
201
  /**
202
  * Controls frontend checks for conditions
203
  *
204
- * @param array $options options of the condition.
205
- * @param Advanced_Ads_Ad $ad ad.
206
  *
207
  * @return bool false, if ad can’t be delivered
208
  */
@@ -300,7 +307,7 @@ class Advanced_Ads_Display_Conditions {
300
  public static function render_type_field( $type, $name ) {
301
 
302
  ?>
303
- <input type="hidden" name="<?php echo $name; ?>[type]" value="<?php esc_attr_e( $type ); ?>"/>
304
  <?php
305
 
306
  }
@@ -377,9 +384,9 @@ class Advanced_Ads_Display_Conditions {
377
  $field_id = "advads-conditions-$_type_id-$rand";
378
  ?><label class="button" for="<?php echo $field_id;
379
  ?>"><?php echo $_label ?></label><input type="checkbox"
380
- id="<?php echo $field_id; ?>"
381
- name="<?php echo $name; ?>[value][]" <?php checked( $_val, 1 ); ?>
382
- value="<?php echo $_type_id; ?>"><?php
383
  }
384
  include ADVADS_BASE_PATH . 'admin/views/conditions/not-selected.php';
385
  ?>
@@ -452,7 +459,7 @@ class Advanced_Ads_Display_Conditions {
452
  }
453
 
454
  $taxonomy = get_taxonomy( $type_options[ $options['type'] ]['taxonomy'] );
455
- if ( $taxonomy == false ) {
456
  return;
457
  }
458
 
@@ -529,9 +536,9 @@ class Advanced_Ads_Display_Conditions {
529
  $field_id = "advads-conditions-$_taxonomy_id-$rand";
530
  ?><label class="button" for="<?php echo $field_id
531
  ?>"><?php echo $_label ?></label><input type="checkbox"
532
- id="<?php echo $field_id; ?>"
533
- name="<?php echo $name; ?>[value][]" <?php checked( $_val, 1 ); ?>
534
- value="<?php echo $_taxonomy_id; ?>"><?php
535
  endforeach;
536
  include ADVADS_BASE_PATH . 'admin/views/conditions/not-selected.php';
537
  ?>
@@ -547,6 +554,8 @@ class Advanced_Ads_Display_Conditions {
547
  * @param string $inputname name of the input field.
548
  * @param int $max_terms maximum number of terms to show.
549
  * @param int $index index of the conditions group.
 
 
550
  */
551
  public static function display_term_list( $taxonomy, $checked = array(), $inputname = '', $max_terms = 50, $index = 0 ) {
552
 
@@ -557,7 +566,7 @@ class Advanced_Ads_Display_Conditions {
557
  'number' => $max_terms,
558
  )
559
  );
560
- $rand = md5( $inputname );
561
 
562
  if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) :
563
  // display search field if the term limit is reached.
@@ -573,7 +582,7 @@ class Advanced_Ads_Display_Conditions {
573
  foreach ( $checked_terms as $_checked_term ) :
574
  ?><label class="button ui-state-active"><?php echo $_checked_term->name;
575
  ?><input type="hidden" name="<?php echo $inputname; ?>"
576
- value="<?php echo $_checked_term->term_id; ?>"></label><?php
577
  endforeach;
578
  ?></div><?php
579
  } else {
@@ -583,16 +592,16 @@ class Advanced_Ads_Display_Conditions {
583
  ?><span class="advads-conditions-terms-show-search button" title="<?php
584
  _ex( 'add more terms', 'display the terms search field on ad edit page', 'advanced-ads' );
585
  ?>">+</span><br/><input type="text" class="advads-conditions-terms-search"
586
- data-tag-name="<?php echo $taxonomy->name;
587
- ?>" data-input-name="<?php echo $inputname; ?>"
588
- placeholder="<?php _e( 'term name or id', 'advanced-ads' ); ?>"/><?php
589
  else :
590
  ?>
591
  <div class="advads-conditions-terms-buttons advads-buttonset"><?php
592
  foreach ( $terms as $_term ) :
593
  $field_id = "advads-conditions-$_term->term_id-$rand";
594
  ?><input type="checkbox" id="<?php echo $field_id; ?>" name="<?php echo $inputname; ?>"
595
- value="<?php echo $_term->term_id; ?>" <?php checked( in_array( $_term->term_id, $checked ), true );
596
  ?>><label for="<?php echo $field_id; ?>"><?php echo $_term->name; ?></label><?php
597
  endforeach;
598
  include ADVADS_BASE_PATH . 'admin/views/conditions/not-selected.php';
@@ -661,8 +670,8 @@ class Advanced_Ads_Display_Conditions {
661
  <input type="text" class="advads-display-conditions-individual-post" <?php if ( count( $values ) ) {
662
  echo 'style="display:none;"';
663
  } ?>
664
- placeholder="<?php _e( 'title or id', 'advanced-ads' ); ?>"
665
- data-field-name="<?php echo $name; ?>"/><?php
666
  wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false );
667
  ?></p></div><?php
668
  }
@@ -698,7 +707,7 @@ class Advanced_Ads_Display_Conditions {
698
 
699
  $field_id = "advads-conditions-$_key-$rand";
700
  ?><input type="checkbox" id="<?php echo $field_id; ?>" name="<?php echo $name; ?>[value][]"
701
- value="<?php echo $_key; ?>" <?php checked( 1, $value ); ?>><label
702
  for="<?php echo $field_id; ?>"><?php echo $_condition['label']; ?></label><?php
703
  endforeach;
704
  include ADVADS_BASE_PATH . 'admin/views/conditions/not-selected.php';
@@ -770,7 +779,7 @@ class Advanced_Ads_Display_Conditions {
770
  return;
771
  }
772
 
773
- $type_options = Advanced_Ads_Display_Conditions::get_instance()->conditions;
774
 
775
  if ( ! isset( $type_options[ $options['type'] ] ) ) {
776
  return;
@@ -789,7 +798,7 @@ class Advanced_Ads_Display_Conditions {
789
  <option value="older_than" <?php selected( 'older_than', $operator ); ?>><?php _e( 'older than', 'advanced-ads' ); ?></option>
790
  <option value="younger_than" <?php selected( 'younger_than', $operator ); ?>><?php _e( 'younger than', 'advanced-ads' ); ?></option>
791
  </select><input type="text" name="<?php echo $name; ?>[value]"
792
- value="<?php echo $value; ?>"/>&nbsp;<?php _e( 'days', 'advanced-ads' );
793
  }
794
 
795
  /**
@@ -950,7 +959,7 @@ class Advanced_Ads_Display_Conditions {
950
  *
951
  * @return bool true if can be displayed
952
  */
953
- static function check_taxonomy( $options = array(), Advanced_Ads_Ad $ad ) {
954
 
955
  if ( ! isset( $options['value'] ) ) {
956
  return false;
@@ -1168,9 +1177,13 @@ class Advanced_Ads_Display_Conditions {
1168
  /**
1169
  * Check display conditions
1170
  *
 
 
 
1171
  * @return bool $can_display true if can be displayed in frontend
1172
- * @since 1.7.0 moved here from display-by-query module
1173
  * @since 1.1.0 moved here from can_display()
 
 
1174
  */
1175
  public function can_display( $can_display, $ad ) {
1176
  if ( ! $can_display ) {
88
  'label' => __( 'post type', 'advanced-ads' ),
89
  'description' => __( 'Choose the public post types on which to display the ad.', 'advanced-ads' ),
90
  'metabox' => array( 'Advanced_Ads_Display_Conditions', 'metabox_post_type' ), // callback to generate the metabox.
91
+ 'check' => array( 'Advanced_Ads_Display_Conditions', 'check_post_type' ), // callback for frontend check.
 
92
  ),
93
  // post id condition.
94
  'postids' => array(
100
  // general conditions.
101
  'general' => array(
102
  'label' => __( 'general conditions', 'advanced-ads' ),
 
103
  'metabox' => array( 'Advanced_Ads_Display_Conditions', 'metabox_general' ), // callback to generate the metabox.
104
  'check' => array( 'Advanced_Ads_Display_Conditions', 'check_general' ), // callback for frontend check.
105
  ),
106
  // author conditions.
107
  'author' => array(
108
  'label' => __( 'author', 'advanced-ads' ),
 
109
  'metabox' => array( 'Advanced_Ads_Display_Conditions', 'metabox_author' ), // callback to generate the metabox.
110
  'check' => array( 'Advanced_Ads_Display_Conditions', 'check_author' ), // callback for frontend check.
111
  ),
126
  );
127
 
128
  // register a condition for each taxonomy for posts.
129
+ $taxonomies = get_taxonomies(
130
+ array(
131
+ 'public' => true,
132
+ 'publicly_queryable' => true,
133
+ ),
134
+ 'objects',
135
+ 'or'
136
+ );
137
 
138
  $tax_label_counts = array();
139
 
150
 
151
  // add tax type to label if we find it multiple times.
152
  if ( $tax_label_counts[ $_tax->label ] < 2 ) {
153
+ $archive_label = $_tax->label;
154
+ $label = $archive_label;
155
  } else {
156
  $label = sprintf( '%s (%s)', $_tax->label, $_tax->name );
157
  $archive_label = sprintf( '%s (%s)', $_tax->labels->singular_name, $_tax->name );
159
 
160
  $conditions[ 'taxonomy_' . $_tax->name ] = array(
161
  'label' => $label,
162
+ 'metabox' => array( 'Advanced_Ads_Display_Conditions', 'metabox_taxonomy_terms' ), // callback to generate the metabox.
163
+ 'check' => array( 'Advanced_Ads_Display_Conditions', 'check_taxonomies' ), // callback for frontend check.
164
+ 'taxonomy' => $_tax->name, // unique for this type: the taxonomy name.
 
165
  );
166
 
167
  $conditions[ 'archive_' . $_tax->name ] = array(
168
+ 'label' => sprintf(
169
+ // translators: %s is a label of an archive page.
170
+ __( 'archive: %s', 'advanced-ads' ),
171
+ $archive_label
172
+ ),
173
  'metabox' => array( 'Advanced_Ads_Display_Conditions', 'metabox_taxonomy_terms' ), // callback to generate the metabox.
174
  'check' => array( 'Advanced_Ads_Display_Conditions', 'check_taxonomy_archive' ), // callback for frontend check.
175
  'taxonomy' => $_tax->name, // unique for this type: the taxonomy name.
180
  }
181
 
182
  /**
183
+ * Instance of Advanced_Ads_Display_Conditions
184
  *
185
+ * @return Advanced_Ads_Display_Conditions
186
  */
187
  public static function get_instance() {
188
  // If the single instance hasn't been set, set it now.
208
  /**
209
  * Controls frontend checks for conditions
210
  *
211
+ * @param array $options options of the condition.
212
+ * @param mixed $ad false or Advanced_Ads_Ad object.
213
  *
214
  * @return bool false, if ad can’t be delivered
215
  */
307
  public static function render_type_field( $type, $name ) {
308
 
309
  ?>
310
+ <input type="hidden" name="<?php echo esc_attr( $name ); ?>[type]" value="<?php echo esc_attr( $type ); ?>"/>
311
  <?php
312
 
313
  }
384
  $field_id = "advads-conditions-$_type_id-$rand";
385
  ?><label class="button" for="<?php echo $field_id;
386
  ?>"><?php echo $_label ?></label><input type="checkbox"
387
+ id="<?php echo $field_id; ?>"
388
+ name="<?php echo $name; ?>[value][]" <?php checked( $_val, 1 ); ?>
389
+ value="<?php echo $_type_id; ?>"><?php
390
  }
391
  include ADVADS_BASE_PATH . 'admin/views/conditions/not-selected.php';
392
  ?>
459
  }
460
 
461
  $taxonomy = get_taxonomy( $type_options[ $options['type'] ]['taxonomy'] );
462
+ if ( false === $taxonomy ) {
463
  return;
464
  }
465
 
536
  $field_id = "advads-conditions-$_taxonomy_id-$rand";
537
  ?><label class="button" for="<?php echo $field_id
538
  ?>"><?php echo $_label ?></label><input type="checkbox"
539
+ id="<?php echo $field_id; ?>"
540
+ name="<?php echo $name; ?>[value][]" <?php checked( $_val, 1 ); ?>
541
+ value="<?php echo $_taxonomy_id; ?>"><?php
542
  endforeach;
543
  include ADVADS_BASE_PATH . 'admin/views/conditions/not-selected.php';
544
  ?>
554
  * @param string $inputname name of the input field.
555
  * @param int $max_terms maximum number of terms to show.
556
  * @param int $index index of the conditions group.
557
+ *
558
+ * @return array|int|WP_Error
559
  */
560
  public static function display_term_list( $taxonomy, $checked = array(), $inputname = '', $max_terms = 50, $index = 0 ) {
561
 
566
  'number' => $max_terms,
567
  )
568
  );
569
+ $rand = md5( $inputname );
570
 
571
  if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) :
572
  // display search field if the term limit is reached.
582
  foreach ( $checked_terms as $_checked_term ) :
583
  ?><label class="button ui-state-active"><?php echo $_checked_term->name;
584
  ?><input type="hidden" name="<?php echo $inputname; ?>"
585
+ value="<?php echo $_checked_term->term_id; ?>"></label><?php
586
  endforeach;
587
  ?></div><?php
588
  } else {
592
  ?><span class="advads-conditions-terms-show-search button" title="<?php
593
  _ex( 'add more terms', 'display the terms search field on ad edit page', 'advanced-ads' );
594
  ?>">+</span><br/><input type="text" class="advads-conditions-terms-search"
595
+ data-tag-name="<?php echo $taxonomy->name;
596
+ ?>" data-input-name="<?php echo $inputname; ?>"
597
+ placeholder="<?php _e( 'term name or id', 'advanced-ads' ); ?>"/><?php
598
  else :
599
  ?>
600
  <div class="advads-conditions-terms-buttons advads-buttonset"><?php
601
  foreach ( $terms as $_term ) :
602
  $field_id = "advads-conditions-$_term->term_id-$rand";
603
  ?><input type="checkbox" id="<?php echo $field_id; ?>" name="<?php echo $inputname; ?>"
604
+ value="<?php echo $_term->term_id; ?>" <?php checked( in_array( $_term->term_id, $checked ), true );
605
  ?>><label for="<?php echo $field_id; ?>"><?php echo $_term->name; ?></label><?php
606
  endforeach;
607
  include ADVADS_BASE_PATH . 'admin/views/conditions/not-selected.php';
670
  <input type="text" class="advads-display-conditions-individual-post" <?php if ( count( $values ) ) {
671
  echo 'style="display:none;"';
672
  } ?>
673
+ placeholder="<?php _e( 'title or id', 'advanced-ads' ); ?>"
674
+ data-field-name="<?php echo $name; ?>"/><?php
675
  wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false );
676
  ?></p></div><?php
677
  }
707
 
708
  $field_id = "advads-conditions-$_key-$rand";
709
  ?><input type="checkbox" id="<?php echo $field_id; ?>" name="<?php echo $name; ?>[value][]"
710
+ value="<?php echo $_key; ?>" <?php checked( 1, $value ); ?>><label
711
  for="<?php echo $field_id; ?>"><?php echo $_condition['label']; ?></label><?php
712
  endforeach;
713
  include ADVADS_BASE_PATH . 'admin/views/conditions/not-selected.php';
779
  return;
780
  }
781
 
782
+ $type_options = self::get_instance()->conditions;
783
 
784
  if ( ! isset( $type_options[ $options['type'] ] ) ) {
785
  return;
798
  <option value="older_than" <?php selected( 'older_than', $operator ); ?>><?php _e( 'older than', 'advanced-ads' ); ?></option>
799
  <option value="younger_than" <?php selected( 'younger_than', $operator ); ?>><?php _e( 'younger than', 'advanced-ads' ); ?></option>
800
  </select><input type="text" name="<?php echo $name; ?>[value]"
801
+ value="<?php echo $value; ?>"/>&nbsp;<?php _e( 'days', 'advanced-ads' );
802
  }
803
 
804
  /**
959
  *
960
  * @return bool true if can be displayed
961
  */
962
+ public static function check_taxonomy( $options = array(), Advanced_Ads_Ad $ad ) {
963
 
964
  if ( ! isset( $options['value'] ) ) {
965
  return false;
1177
  /**
1178
  * Check display conditions
1179
  *
1180
+ * @param bool $can_display whether the current ad can be displayed based on the checks that ran by now.
1181
+ * @param Advanced_Ads_Ad $ad ad object.
1182
+ *
1183
  * @return bool $can_display true if can be displayed in frontend
 
1184
  * @since 1.1.0 moved here from can_display()
1185
+ *
1186
+ * @since 1.7.0 moved here from display-by-query module
1187
  */
1188
  public function can_display( $can_display, $ad ) {
1189
  if ( ! $can_display ) {
classes/frontend_checks.php CHANGED
@@ -817,7 +817,7 @@ class Advanced_Ads_Frontend_Checks {
817
  '<span class="advads-close advads-smiley advads-smiley-positive" title="<?php esc_attr_e( 'All is fine', 'advanced-ads' ); ?>"><i class="eye eye1"></i><i class="eye eye2"></i><i class="mouth"></i></span>' +
818
  '<span class="advads-choice-negative advads-smiley" title="<?php esc_attr_e( 'Something is off', 'advanced-ads' ); ?>"><i class="eye eye1"></i><i class="eye eye2"></i><i class="mouth"></i></span>' +
819
  '</div>' +
820
- '<p class="advads-notice-var1"><?php esc_attr_e( 'This is a one-time check from your friendly Advanced Ads plugin. It is only visible to you.', 'advanced-ads' ); ?></p>';
821
  // dynamically add the number of Auto ads found.
822
  content = content.replace( 'AUTO_ADS_NUM', autoads_ads.length );
823
  break;
@@ -899,9 +899,9 @@ class Advanced_Ads_Frontend_Checks {
899
  /**
900
  * show Google Ad Manager debug link in Ad Health
901
  *
902
- * checks if window.googletag is defined
903
  * look for container with ID starting with `div-gpt-ad-`
904
- * does not look for `gpt-ad-` as used by our inline tags since they contain window.googletag as well
 
905
  */
906
  function advads_gam_show_debug_link(){
907
  var advads_gam_debug_link = document.querySelector( '.advanced_ads_ad_health_gam_debug_link.hidden' );
@@ -911,9 +911,7 @@ class Advanced_Ads_Frontend_Checks {
911
  }
912
 
913
  // initialized by the GAM header tag or inline body tags
914
- if( window.googletag ){
915
- advads_gam_debug_link.className = advads_gam_debug_link.className.replace( 'hidden', '' );
916
- } else if ( document.querySelector( '[id^="div-gpt-ad-"]' ) ) {
917
  advads_gam_debug_link.className = advads_gam_debug_link.className.replace( 'hidden', '' );
918
  }
919
  }
817
  '<span class="advads-close advads-smiley advads-smiley-positive" title="<?php esc_attr_e( 'All is fine', 'advanced-ads' ); ?>"><i class="eye eye1"></i><i class="eye eye2"></i><i class="mouth"></i></span>' +
818
  '<span class="advads-choice-negative advads-smiley" title="<?php esc_attr_e( 'Something is off', 'advanced-ads' ); ?>"><i class="eye eye1"></i><i class="eye eye2"></i><i class="mouth"></i></span>' +
819
  '</div>' +
820
+ '<p class="advads-notice-var1"><?php esc_attr_e( 'PS: This is a one-time check from your friendly Advanced Ads plugin. It is only visible to you.', 'advanced-ads' ); ?></p>';
821
  // dynamically add the number of Auto ads found.
822
  content = content.replace( 'AUTO_ADS_NUM', autoads_ads.length );
823
  break;
899
  /**
900
  * show Google Ad Manager debug link in Ad Health
901
  *
 
902
  * look for container with ID starting with `div-gpt-ad-`
903
+ * or `gpt-ad-` as used by our own Google Ad Manager integration
904
+ * we don’t look for the gpt header script because that is also used by other services that are based on Google Publisher Tags
905
  */
906
  function advads_gam_show_debug_link(){
907
  var advads_gam_debug_link = document.querySelector( '.advanced_ads_ad_health_gam_debug_link.hidden' );
911
  }
912
 
913
  // initialized by the GAM header tag or inline body tags
914
+ if ( document.querySelector( '[id^="div-gpt-ad-"],[id^="gpt-ad-"]' ) ) {
 
 
915
  advads_gam_debug_link.className = advads_gam_debug_link.className.replace( 'hidden', '' );
916
  }
917
  }
classes/visitor-conditions.php CHANGED
@@ -112,8 +112,21 @@ class Advanced_Ads_Visitor_Conditions {
112
  include ADVADS_BASE_PATH . 'admin/views/conditions/condition-device.php';
113
 
114
  if ( ! defined( 'AAR_SLUG' ) ) {
115
- // translators: %s is a URL. Please don’t change it.
116
- echo '<p>' . sprintf( __( 'Display ads by the available space on the device or target tablets with the <a href="%s" target="_blank">Responsive add-on</a>', 'advanced-ads' ), ADVADS_URL . 'add-ons/responsive-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-visitor-responsive' ) . '</p>';
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  }
118
  }
119
 
@@ -206,8 +219,8 @@ class Advanced_Ads_Visitor_Conditions {
206
  /**
207
  * Controls frontend checks for conditions
208
  *
209
- * @param array $options options of the condition.
210
- * @param object $ad Advanced_Ads_Ad.
211
  *
212
  * @return bool false, if ad can’t be delivered
213
  */
112
  include ADVADS_BASE_PATH . 'admin/views/conditions/condition-device.php';
113
 
114
  if ( ! defined( 'AAR_SLUG' ) ) {
115
+ ?><p><?php
116
+ sprintf(
117
+ wp_kses(
118
+ // translators: %s is a URL. Please don’t change it.
119
+ __( 'Display ads by the available space on the device or target tablets with the <a href="%s" target="_blank">Responsive add-on</a>', 'advanced-ads' ),
120
+ array(
121
+ 'a' => array(
122
+ 'href' => array(),
123
+ 'target' => array(),
124
+ ),
125
+ )
126
+ ),
127
+ ADVADS_URL . 'add-ons/responsive-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-visitor-responsive'
128
+ );
129
+ ?></p><?php
130
  }
131
  }
132
 
219
  /**
220
  * Controls frontend checks for conditions
221
  *
222
+ * @param array $options options of the condition.
223
+ * @param bool|object $ad false or Advanced_Ads_Ad.
224
  *
225
  * @return bool false, if ad can’t be delivered
226
  */
classes/widget.php CHANGED
@@ -3,10 +3,10 @@
3
  * Advanced Ads Widget
4
  *
5
  * @package Advanced_Ads_Widget
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
- * @link http://webgilde.com
9
- * @copyright 2014 Thomas Maier, webgilde GmbH
10
  */
11
 
12
  /**
3
  * Advanced Ads Widget
4
  *
5
  * @package Advanced_Ads_Widget
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
+ * @link https://wpadvancedads.com
9
+ * @copyright 2014 Thomas Maier, Advanced Ads GmbH
10
  */
11
 
12
  /**
composer.json CHANGED
@@ -5,7 +5,7 @@
5
  "authors": [
6
  {
7
  "name": "Thomas Maier",
8
- "email": "thomas.maier@webgilde.com"
9
  }
10
  ],
11
  "homepage": "https://wordpress.org/plugins/advanced-ads/",
5
  "authors": [
6
  {
7
  "name": "Thomas Maier",
8
+ "email": "support@wpadvancedads.com"
9
  }
10
  ],
11
  "homepage": "https://wordpress.org/plugins/advanced-ads/",
languages/advanced-ads.po CHANGED
@@ -5,7 +5,7 @@ msgstr ""
5
  "POT-Creation-Date: 2015-01-28 20:07+0100\n"
6
  "PO-Revision-Date: Mon Apr 25 2016 08:52:19 GMT+0200 (CEST)\n"
7
  "Last-Translator: admin <post@webzunft.de>\n"
8
- "Language-Team: webgilde <thomas.maier@webgilde.com>\n"
9
  "Language: Unknown locale\n"
10
  "Plural-Forms: nplurals=2; plural=n != 1\n"
11
  "MIME-Version: 1.0\n"
@@ -39,7 +39,7 @@ msgid "Thomas Maier"
39
  msgstr ""
40
 
41
  #. Author URI of the plugin
42
- msgid "http://webgilde.com"
43
  msgstr ""
44
 
45
  #: ../admin/class-advanced-ads-admin.php:212 ../classes/display-conditions.php:
5
  "POT-Creation-Date: 2015-01-28 20:07+0100\n"
6
  "PO-Revision-Date: Mon Apr 25 2016 08:52:19 GMT+0200 (CEST)\n"
7
  "Last-Translator: admin <post@webzunft.de>\n"
8
+ "Language-Team: webgilde <support@wpadvancedads.com>\n"
9
  "Language: Unknown locale\n"
10
  "Plural-Forms: nplurals=2; plural=n != 1\n"
11
  "MIME-Version: 1.0\n"
39
  msgstr ""
40
 
41
  #. Author URI of the plugin
42
+ msgid "https://wpadvancedads.com"
43
  msgstr ""
44
 
45
  #: ../admin/class-advanced-ads-admin.php:212 ../classes/display-conditions.php:
languages/advanced-ads.pot CHANGED
@@ -3,11 +3,11 @@ 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: 2020-01-27 08:27+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"
10
- "Language-Team: webgilde <thomas.maier@webgilde.com>\n"
11
  "Language: \n"
12
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
13
  "MIME-Version: 1.0\n"
@@ -396,8 +396,8 @@ msgstr ""
396
 
397
  #: classes/frontend_checks.php:820
398
  msgid ""
399
- "This is a one-time check from your friendly Advanced Ads plugin. It is only "
400
- "visible to you."
401
  msgstr ""
402
 
403
  #: classes/frontend_checks.php:827
@@ -487,62 +487,62 @@ msgstr ""
487
  msgid "Whether the visitor has to be logged in or not in order to see the ads."
488
  msgstr ""
489
 
490
- #: classes/visitor-conditions.php:116
491
  #, php-format
492
  msgid ""
493
  "Display ads by the available space on the device or target tablets with the "
494
  "<a href=\"%s\" target=\"_blank\">Responsive add-on</a>"
495
  msgstr ""
496
 
497
- #: classes/visitor-conditions.php:257
498
  msgid "browser language"
499
  msgstr ""
500
 
501
- #: classes/visitor-conditions.php:258
502
  msgid "cookie"
503
  msgstr ""
504
 
505
- #: classes/visitor-conditions.php:259
506
  msgid "max. ad clicks"
507
  msgstr ""
508
 
509
- #: classes/visitor-conditions.php:260
510
  msgid "max. ad impressions"
511
  msgstr ""
512
 
513
- #: classes/visitor-conditions.php:261
514
  msgid "new visitor"
515
  msgstr ""
516
 
517
- #: classes/visitor-conditions.php:262
518
  msgid "page impressions"
519
  msgstr ""
520
 
521
- #: classes/visitor-conditions.php:263
522
  msgid "referrer url"
523
  msgstr ""
524
 
525
- #: classes/visitor-conditions.php:264
526
  msgid "user agent"
527
  msgstr ""
528
 
529
- #: classes/visitor-conditions.php:265
530
  msgid "user can (capabilities)"
531
  msgstr ""
532
 
533
- #: classes/visitor-conditions.php:266
534
  msgid "user role"
535
  msgstr ""
536
 
537
- #: classes/visitor-conditions.php:269
538
  msgid "geo location"
539
  msgstr ""
540
 
541
- #: classes/visitor-conditions.php:272
542
  msgid "browser width"
543
  msgstr ""
544
 
545
- #: classes/visitor-conditions.php:298 classes/display-conditions.php:282
546
  #: admin/class-advanced-ads-admin.php:232
547
  #: modules/gadsense/admin/views/external-ads-links.php:17
548
  #: modules/gadsense/admin/views/external-ads-links.php:22
@@ -550,7 +550,7 @@ msgstr ""
550
  msgid "or"
551
  msgstr ""
552
 
553
- #: classes/visitor-conditions.php:298 classes/display-conditions.php:282
554
  #: admin/class-advanced-ads-admin.php:233
555
  msgid "and"
556
  msgstr ""
@@ -573,151 +573,151 @@ msgstr ""
573
  msgid "Choose the public post types on which to display the ad."
574
  msgstr ""
575
 
576
- #: classes/display-conditions.php:96
577
  msgid "specific pages"
578
  msgstr ""
579
 
580
- #: classes/display-conditions.php:97 includes/array_ad_conditions.php:58
581
  msgid ""
582
  "Choose on which individual posts, pages and public post type pages you want "
583
  "to display or hide ads."
584
  msgstr ""
585
 
586
- #: classes/display-conditions.php:103
587
  msgid "general conditions"
588
  msgstr ""
589
 
590
- #: classes/display-conditions.php:110
591
  msgid "author"
592
  msgstr ""
593
 
594
- #: classes/display-conditions.php:117
595
  msgid "content age"
596
  msgstr ""
597
 
598
- #: classes/display-conditions.php:118
599
  msgid "Display ads based on age of the page."
600
  msgstr ""
601
 
602
- #: classes/display-conditions.php:124
603
  msgid "taxonomy"
604
  msgstr ""
605
 
606
- #: classes/display-conditions.php:125
607
  msgid "Display ads based on the taxonomy of an archive page."
608
  msgstr ""
609
 
610
- #: classes/display-conditions.php:164
611
  #, php-format
612
  msgid "archive: %s"
613
  msgstr ""
614
 
615
- #: classes/display-conditions.php:252
616
  msgid "parent page"
617
  msgstr ""
618
 
619
- #: classes/display-conditions.php:253
620
  msgid "post meta"
621
  msgstr ""
622
 
623
- #: classes/display-conditions.php:254
624
  msgid "page template"
625
  msgstr ""
626
 
627
- #: classes/display-conditions.php:255
628
  msgid "url parameters"
629
  msgstr ""
630
 
631
- #: classes/display-conditions.php:258
632
  msgid "accelerated mobile pages"
633
  msgstr ""
634
 
635
- #: classes/display-conditions.php:584
636
  msgctxt "display the terms search field on ad edit page"
637
  msgid "add more terms"
638
  msgstr ""
639
 
640
- #: classes/display-conditions.php:588
641
  msgid "term name or id"
642
  msgstr ""
643
 
644
- #: classes/display-conditions.php:664
645
  msgid "title or id"
646
  msgstr ""
647
 
648
- #: classes/display-conditions.php:718 includes/array_ad_conditions.php:63
649
  msgid "Home Page"
650
  msgstr ""
651
 
652
- #: classes/display-conditions.php:719 includes/array_ad_conditions.php:64
653
  msgid "show on Home page"
654
  msgstr ""
655
 
656
- #: classes/display-conditions.php:723 includes/array_ad_conditions.php:68
657
  msgid "Singular Pages"
658
  msgstr ""
659
 
660
- #: classes/display-conditions.php:724 includes/array_ad_conditions.php:69
661
  msgid "show on singular pages/posts"
662
  msgstr ""
663
 
664
- #: classes/display-conditions.php:728 includes/array_ad_conditions.php:73
665
  msgid "Archive Pages"
666
  msgstr ""
667
 
668
- #: classes/display-conditions.php:729 includes/array_ad_conditions.php:74
669
  msgid "show on any type of archive page (category, tag, author and date)"
670
  msgstr ""
671
 
672
- #: classes/display-conditions.php:733 includes/array_ad_conditions.php:78
673
  msgid "Search Results"
674
  msgstr ""
675
 
676
- #: classes/display-conditions.php:734 includes/array_ad_conditions.php:79
677
  msgid "show on search result pages"
678
  msgstr ""
679
 
680
- #: classes/display-conditions.php:738 includes/array_ad_conditions.php:83
681
  msgid "404 Page"
682
  msgstr ""
683
 
684
- #: classes/display-conditions.php:739 includes/array_ad_conditions.php:84
685
  msgid "show on 404 error page"
686
  msgstr ""
687
 
688
- #: classes/display-conditions.php:743 includes/array_ad_conditions.php:88
689
  msgid "Attachment Pages"
690
  msgstr ""
691
 
692
- #: classes/display-conditions.php:744 includes/array_ad_conditions.php:89
693
  msgid "show on attachment pages"
694
  msgstr ""
695
 
696
- #: classes/display-conditions.php:748 includes/array_ad_conditions.php:93
697
  msgid "Secondary Queries"
698
  msgstr ""
699
 
700
- #: classes/display-conditions.php:749 includes/array_ad_conditions.php:94
701
  msgid "allow ads in secondary queries"
702
  msgstr ""
703
 
704
- #: classes/display-conditions.php:753
705
  msgid "RSS Feed"
706
  msgstr ""
707
 
708
- #: classes/display-conditions.php:754
709
  msgid "allow ads in RSS Feed"
710
  msgstr ""
711
 
712
- #: classes/display-conditions.php:789
713
  msgid "older than"
714
  msgstr ""
715
 
716
- #: classes/display-conditions.php:790
717
  msgid "younger than"
718
  msgstr ""
719
 
720
- #: classes/display-conditions.php:792
721
  msgid "days"
722
  msgstr ""
723
 
@@ -2035,8 +2035,8 @@ msgid "Get full access"
2035
  msgstr ""
2036
 
2037
  #: admin/includes/class-overview-widgets.php:664
2038
- #: admin/views/conditions/ad-display-metabox.php:38
2039
- #: admin/views/conditions/ad-visitor-metabox.php:38
2040
  msgid "Visit the manual"
2041
  msgstr ""
2042
 
@@ -2157,7 +2157,7 @@ msgid "weight"
2157
  msgstr ""
2158
 
2159
  #: admin/views/ad-group-list-ads.php:37
2160
- #: admin/views/conditions/conditions-form.php:35
2161
  msgid "add"
2162
  msgstr ""
2163
 
@@ -3061,7 +3061,7 @@ msgid "See them in action"
3061
  msgstr ""
3062
 
3063
  #: admin/views/notices/jqueryui_error.php:2
3064
- #: admin/views/conditions/ad-display-metabox.php:46
3065
  #, php-format
3066
  msgid ""
3067
  "There might be a problem with layouts and scripts in your dashboard. Please "
@@ -3141,8 +3141,8 @@ msgstr ""
3141
  msgid "If you want to display the ad everywhere, don't do anything here. "
3142
  msgstr ""
3143
 
3144
- #: admin/views/conditions/condition-is-or-not.php:9
3145
- #: admin/views/conditions/condition-device.php:9
3146
  msgid "Manual and Troubleshooting"
3147
  msgstr ""
3148
 
@@ -3157,14 +3157,14 @@ msgstr ""
3157
  msgid "It seems that a caching plugin is activated."
3158
  msgstr ""
3159
 
3160
- #: admin/views/conditions/visitor-conditions-form-top.php:11
3161
  #, php-format
3162
  msgid ""
3163
  "Check out cache-busting in <a href=\"%s\" target=\"_blank\">Advanced Ads "
3164
  "Pro</a> if dynamic features get cached."
3165
  msgstr ""
3166
 
3167
- #: admin/views/conditions/condition-author.php:28
3168
  #, php-format
3169
  msgid ""
3170
  "Only %d elements are displayed above. Use the <code>advanced-ads-admin-max-"
@@ -3181,25 +3181,25 @@ msgstr ""
3181
  msgid "manual"
3182
  msgstr ""
3183
 
3184
- #: admin/views/conditions/ad-display-metabox.php:17
3185
  msgid ""
3186
  "Click on the button below if the ad should NOT show up on all pages when "
3187
  "included automatically."
3188
  msgstr ""
3189
 
3190
- #: admin/views/conditions/ad-display-metabox.php:19
3191
  msgid "Hide the ad on some pages"
3192
  msgstr ""
3193
 
3194
- #: admin/views/conditions/ad-display-metabox.php:34
3195
  msgid "Watch video"
3196
  msgstr ""
3197
 
3198
- #: admin/views/conditions/ad-display-metabox.php:47
3199
  msgid "A page with this ad on it must match all of the following conditions."
3200
  msgstr ""
3201
 
3202
- #: admin/views/conditions/no-option.php:7
3203
  #, php-format
3204
  msgctxt ""
3205
  "Error message shown when no terms exists for display condition; placeholder "
@@ -3215,28 +3215,28 @@ msgstr ""
3215
  msgid "Desktop"
3216
  msgstr ""
3217
 
3218
- #: admin/views/conditions/conditions-form.php:8
3219
  msgid "New condition"
3220
  msgstr ""
3221
 
3222
- #: admin/views/conditions/conditions-form.php:13
3223
  msgid "-- choose a condition --"
3224
  msgstr ""
3225
 
3226
- #: admin/views/conditions/conditions-form.php:22
3227
  msgid "Add-On features"
3228
  msgstr ""
3229
 
3230
- #: admin/views/conditions/ad-visitor-metabox.php:17
3231
  msgid ""
3232
  "Click on the button below if the ad should NOT be visible to all visitors"
3233
  msgstr ""
3234
 
3235
- #: admin/views/conditions/ad-visitor-metabox.php:19
3236
  msgid "Hide the ad from some users"
3237
  msgstr ""
3238
 
3239
- #: admin/views/conditions/ad-visitor-metabox.php:29
3240
  msgid ""
3241
  "Display conditions that are based on the user. Use with caution on cached "
3242
  "websites."
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: 2020-01-28 09:04+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"
10
+ "Language-Team: webgilde <support@wpadvancedads.com>\n"
11
  "Language: \n"
12
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
13
  "MIME-Version: 1.0\n"
396
 
397
  #: classes/frontend_checks.php:820
398
  msgid ""
399
+ "PS: This is a one-time check from your friendly Advanced Ads plugin. It is "
400
+ "only visible to you."
401
  msgstr ""
402
 
403
  #: classes/frontend_checks.php:827
487
  msgid "Whether the visitor has to be logged in or not in order to see the ads."
488
  msgstr ""
489
 
490
+ #: classes/visitor-conditions.php:119
491
  #, php-format
492
  msgid ""
493
  "Display ads by the available space on the device or target tablets with the "
494
  "<a href=\"%s\" target=\"_blank\">Responsive add-on</a>"
495
  msgstr ""
496
 
497
+ #: classes/visitor-conditions.php:270
498
  msgid "browser language"
499
  msgstr ""
500
 
501
+ #: classes/visitor-conditions.php:271
502
  msgid "cookie"
503
  msgstr ""
504
 
505
+ #: classes/visitor-conditions.php:272
506
  msgid "max. ad clicks"
507
  msgstr ""
508
 
509
+ #: classes/visitor-conditions.php:273
510
  msgid "max. ad impressions"
511
  msgstr ""
512
 
513
+ #: classes/visitor-conditions.php:274
514
  msgid "new visitor"
515
  msgstr ""
516
 
517
+ #: classes/visitor-conditions.php:275
518
  msgid "page impressions"
519
  msgstr ""
520
 
521
+ #: classes/visitor-conditions.php:276
522
  msgid "referrer url"
523
  msgstr ""
524
 
525
+ #: classes/visitor-conditions.php:277
526
  msgid "user agent"
527
  msgstr ""
528
 
529
+ #: classes/visitor-conditions.php:278
530
  msgid "user can (capabilities)"
531
  msgstr ""
532
 
533
+ #: classes/visitor-conditions.php:279
534
  msgid "user role"
535
  msgstr ""
536
 
537
+ #: classes/visitor-conditions.php:282
538
  msgid "geo location"
539
  msgstr ""
540
 
541
+ #: classes/visitor-conditions.php:285
542
  msgid "browser width"
543
  msgstr ""
544
 
545
+ #: classes/visitor-conditions.php:311 classes/display-conditions.php:289
546
  #: admin/class-advanced-ads-admin.php:232
547
  #: modules/gadsense/admin/views/external-ads-links.php:17
548
  #: modules/gadsense/admin/views/external-ads-links.php:22
550
  msgid "or"
551
  msgstr ""
552
 
553
+ #: classes/visitor-conditions.php:311 classes/display-conditions.php:289
554
  #: admin/class-advanced-ads-admin.php:233
555
  msgid "and"
556
  msgstr ""
573
  msgid "Choose the public post types on which to display the ad."
574
  msgstr ""
575
 
576
+ #: classes/display-conditions.php:95
577
  msgid "specific pages"
578
  msgstr ""
579
 
580
+ #: classes/display-conditions.php:96 includes/array_ad_conditions.php:58
581
  msgid ""
582
  "Choose on which individual posts, pages and public post type pages you want "
583
  "to display or hide ads."
584
  msgstr ""
585
 
586
+ #: classes/display-conditions.php:102
587
  msgid "general conditions"
588
  msgstr ""
589
 
590
+ #: classes/display-conditions.php:108
591
  msgid "author"
592
  msgstr ""
593
 
594
+ #: classes/display-conditions.php:114
595
  msgid "content age"
596
  msgstr ""
597
 
598
+ #: classes/display-conditions.php:115
599
  msgid "Display ads based on age of the page."
600
  msgstr ""
601
 
602
+ #: classes/display-conditions.php:121
603
  msgid "taxonomy"
604
  msgstr ""
605
 
606
+ #: classes/display-conditions.php:122
607
  msgid "Display ads based on the taxonomy of an archive page."
608
  msgstr ""
609
 
610
+ #: classes/display-conditions.php:170
611
  #, php-format
612
  msgid "archive: %s"
613
  msgstr ""
614
 
615
+ #: classes/display-conditions.php:259
616
  msgid "parent page"
617
  msgstr ""
618
 
619
+ #: classes/display-conditions.php:260
620
  msgid "post meta"
621
  msgstr ""
622
 
623
+ #: classes/display-conditions.php:261
624
  msgid "page template"
625
  msgstr ""
626
 
627
+ #: classes/display-conditions.php:262
628
  msgid "url parameters"
629
  msgstr ""
630
 
631
+ #: classes/display-conditions.php:265
632
  msgid "accelerated mobile pages"
633
  msgstr ""
634
 
635
+ #: classes/display-conditions.php:593
636
  msgctxt "display the terms search field on ad edit page"
637
  msgid "add more terms"
638
  msgstr ""
639
 
640
+ #: classes/display-conditions.php:597
641
  msgid "term name or id"
642
  msgstr ""
643
 
644
+ #: classes/display-conditions.php:673
645
  msgid "title or id"
646
  msgstr ""
647
 
648
+ #: classes/display-conditions.php:727 includes/array_ad_conditions.php:63
649
  msgid "Home Page"
650
  msgstr ""
651
 
652
+ #: classes/display-conditions.php:728 includes/array_ad_conditions.php:64
653
  msgid "show on Home page"
654
  msgstr ""
655
 
656
+ #: classes/display-conditions.php:732 includes/array_ad_conditions.php:68
657
  msgid "Singular Pages"
658
  msgstr ""
659
 
660
+ #: classes/display-conditions.php:733 includes/array_ad_conditions.php:69
661
  msgid "show on singular pages/posts"
662
  msgstr ""
663
 
664
+ #: classes/display-conditions.php:737 includes/array_ad_conditions.php:73
665
  msgid "Archive Pages"
666
  msgstr ""
667
 
668
+ #: classes/display-conditions.php:738 includes/array_ad_conditions.php:74
669
  msgid "show on any type of archive page (category, tag, author and date)"
670
  msgstr ""
671
 
672
+ #: classes/display-conditions.php:742 includes/array_ad_conditions.php:78
673
  msgid "Search Results"
674
  msgstr ""
675
 
676
+ #: classes/display-conditions.php:743 includes/array_ad_conditions.php:79
677
  msgid "show on search result pages"
678
  msgstr ""
679
 
680
+ #: classes/display-conditions.php:747 includes/array_ad_conditions.php:83
681
  msgid "404 Page"
682
  msgstr ""
683
 
684
+ #: classes/display-conditions.php:748 includes/array_ad_conditions.php:84
685
  msgid "show on 404 error page"
686
  msgstr ""
687
 
688
+ #: classes/display-conditions.php:752 includes/array_ad_conditions.php:88
689
  msgid "Attachment Pages"
690
  msgstr ""
691
 
692
+ #: classes/display-conditions.php:753 includes/array_ad_conditions.php:89
693
  msgid "show on attachment pages"
694
  msgstr ""
695
 
696
+ #: classes/display-conditions.php:757 includes/array_ad_conditions.php:93
697
  msgid "Secondary Queries"
698
  msgstr ""
699
 
700
+ #: classes/display-conditions.php:758 includes/array_ad_conditions.php:94
701
  msgid "allow ads in secondary queries"
702
  msgstr ""
703
 
704
+ #: classes/display-conditions.php:762
705
  msgid "RSS Feed"
706
  msgstr ""
707
 
708
+ #: classes/display-conditions.php:763
709
  msgid "allow ads in RSS Feed"
710
  msgstr ""
711
 
712
+ #: classes/display-conditions.php:798
713
  msgid "older than"
714
  msgstr ""
715
 
716
+ #: classes/display-conditions.php:799
717
  msgid "younger than"
718
  msgstr ""
719
 
720
+ #: classes/display-conditions.php:801
721
  msgid "days"
722
  msgstr ""
723
 
2035
  msgstr ""
2036
 
2037
  #: admin/includes/class-overview-widgets.php:664
2038
+ #: admin/views/conditions/ad-display-metabox.php:37
2039
+ #: admin/views/conditions/ad-visitor-metabox.php:37
2040
  msgid "Visit the manual"
2041
  msgstr ""
2042
 
2157
  msgstr ""
2158
 
2159
  #: admin/views/ad-group-list-ads.php:37
2160
+ #: admin/views/conditions/conditions-form.php:37
2161
  msgid "add"
2162
  msgstr ""
2163
 
3061
  msgstr ""
3062
 
3063
  #: admin/views/notices/jqueryui_error.php:2
3064
+ #: admin/views/conditions/ad-display-metabox.php:47
3065
  #, php-format
3066
  msgid ""
3067
  "There might be a problem with layouts and scripts in your dashboard. Please "
3141
  msgid "If you want to display the ad everywhere, don't do anything here. "
3142
  msgstr ""
3143
 
3144
+ #: admin/views/conditions/condition-is-or-not.php:13
3145
+ #: admin/views/conditions/condition-device.php:12
3146
  msgid "Manual and Troubleshooting"
3147
  msgstr ""
3148
 
3157
  msgid "It seems that a caching plugin is activated."
3158
  msgstr ""
3159
 
3160
+ #: admin/views/conditions/visitor-conditions-form-top.php:14
3161
  #, php-format
3162
  msgid ""
3163
  "Check out cache-busting in <a href=\"%s\" target=\"_blank\">Advanced Ads "
3164
  "Pro</a> if dynamic features get cached."
3165
  msgstr ""
3166
 
3167
+ #: admin/views/conditions/condition-author.php:30
3168
  #, php-format
3169
  msgid ""
3170
  "Only %d elements are displayed above. Use the <code>advanced-ads-admin-max-"
3181
  msgid "manual"
3182
  msgstr ""
3183
 
3184
+ #: admin/views/conditions/ad-display-metabox.php:16
3185
  msgid ""
3186
  "Click on the button below if the ad should NOT show up on all pages when "
3187
  "included automatically."
3188
  msgstr ""
3189
 
3190
+ #: admin/views/conditions/ad-display-metabox.php:18
3191
  msgid "Hide the ad on some pages"
3192
  msgstr ""
3193
 
3194
+ #: admin/views/conditions/ad-display-metabox.php:33
3195
  msgid "Watch video"
3196
  msgstr ""
3197
 
3198
+ #: admin/views/conditions/ad-display-metabox.php:58
3199
  msgid "A page with this ad on it must match all of the following conditions."
3200
  msgstr ""
3201
 
3202
+ #: admin/views/conditions/no-option.php:10
3203
  #, php-format
3204
  msgctxt ""
3205
  "Error message shown when no terms exists for display condition; placeholder "
3215
  msgid "Desktop"
3216
  msgstr ""
3217
 
3218
+ #: admin/views/conditions/conditions-form.php:10
3219
  msgid "New condition"
3220
  msgstr ""
3221
 
3222
+ #: admin/views/conditions/conditions-form.php:15
3223
  msgid "-- choose a condition --"
3224
  msgstr ""
3225
 
3226
+ #: admin/views/conditions/conditions-form.php:24
3227
  msgid "Add-On features"
3228
  msgstr ""
3229
 
3230
+ #: admin/views/conditions/ad-visitor-metabox.php:16
3231
  msgid ""
3232
  "Click on the button below if the ad should NOT be visible to all visitors"
3233
  msgstr ""
3234
 
3235
+ #: admin/views/conditions/ad-visitor-metabox.php:18
3236
  msgid "Hide the ad from some users"
3237
  msgstr ""
3238
 
3239
+ #: admin/views/conditions/ad-visitor-metabox.php:28
3240
  msgid ""
3241
  "Display conditions that are based on the user. Use with caution on cached "
3242
  "websites."
modules/gadsense/admin/assets/js/mapi-settings.js CHANGED
@@ -1,10 +1,10 @@
1
  /**
2
  * Advanced Ads.
3
  *
4
- * @author Thomas Maier <thomas.maier@webgilde.com>
5
  * @license GPL-2.0+
6
- * @link http://webgilde.com
7
- * @copyright 2013-2018 Thomas Maier, webgilde GmbH
8
  */
9
  ;(function($){
10
 
1
  /**
2
  * Advanced Ads.
3
  *
4
+ * @author Thomas Maier <support@wpadvancedads.com>
5
  * @license GPL-2.0+
6
+ * @link https://wpadvancedads.com
7
+ * @copyright 2013-2018 Thomas Maier, Advanced Ads GmbH
8
  */
9
  ;(function($){
10
 
modules/gadsense/includes/class-ad-type-adsense.php CHANGED
@@ -4,10 +4,10 @@
4
  * Advanced Ads dfp Ad Type
5
  *
6
  * @package Advanced_Ads
7
- * @author Thomas Maier <thomas.maier@webgilde.com>
8
  * @license GPL-2.0+
9
- * @link http://webgilde.com
10
- * @copyright 2013-2018 Thomas Maier, webgilde GmbH
11
  *
12
  * Class containing information about the adsense ad type
13
  *
4
  * Advanced Ads dfp Ad Type
5
  *
6
  * @package Advanced_Ads
7
+ * @author Thomas Maier <support@wpadvancedads.com>
8
  * @license GPL-2.0+
9
+ * @link https://wpadvancedads.com
10
+ * @copyright 2013-2018 Thomas Maier, Advanced Ads GmbH
11
  *
12
  * Class containing information about the adsense ad type
13
  *
public/class-advanced-ads.php CHANGED
@@ -3,10 +3,10 @@
3
  * Advanced Ads.
4
  *
5
  * @package Advanced_Ads_Admin
6
- * @author Thomas Maier <thomas.maier@webgilde.com>
7
  * @license GPL-2.0+
8
- * @link http://webgilde.com
9
- * @copyright 2013-2018 Thomas Maier, webgilde GmbH
10
  */
11
 
12
  /**
@@ -14,7 +14,7 @@
14
  * public-facing side of the WordPress site.
15
  *
16
  * @package Advanced_Ads
17
- * @author Thomas Maier <thomas.maier@webgilde.com>
18
  */
19
  class Advanced_Ads {
20
 
3
  * Advanced Ads.
4
  *
5
  * @package Advanced_Ads_Admin
6
+ * @author Thomas Maier <support@wpadvancedads.com>
7
  * @license GPL-2.0+
8
+ * @link https://wpadvancedads.com
9
+ * @copyright 2013-2018 Thomas Maier, Advanced Ads GmbH
10
  */
11
 
12
  /**
14
  * public-facing side of the WordPress site.
15
  *
16
  * @package Advanced_Ads
17
+ * @author Thomas Maier <support@wpadvancedads.com>
18
  */
19
  class Advanced_Ads {
20
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: ads, ad manager, ad rotation, adsense, banner
4
  Requires at least: 4.6
5
  Tested up to: 5.3
6
  Requires PHP: 5.6
7
- Stable tag: 1.17
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -304,6 +304,11 @@ Yes. Advanced Ads is based on WordPress standards and therefore easily customiza
304
 
305
  == Changelog ==
306
 
 
 
 
 
 
307
  = 1.17 =
308
 
309
  * improved AdSense ad unit list coming from the AdSense API
4
  Requires at least: 4.6
5
  Tested up to: 5.3
6
  Requires PHP: 5.6
7
+ Stable tag: 1.17.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
304
 
305
  == Changelog ==
306
 
307
+ = 1.17.1 =
308
+
309
+ * fixed failing upload of new image ads
310
+ * fixed Google Ad Manager debug link also showing up when other Google Publisher Tags are used
311
+
312
  = 1.17 =
313
 
314
  * improved AdSense ad unit list coming from the AdSense API