Advanced Ads - Version 1.10.7

Version Description

  • reverted code optimization that broke some forms
Download this release

Release Info

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

Code changes from version 1.10.6 to 1.10.7

admin/views/ad-group-edit.php CHANGED
@@ -47,13 +47,11 @@ wp_nonce_field( 'update-group_' . $group_id );
47
  <?php if ( ! global_terms_enabled() ) { ?>
48
  <tr class="form-field">
49
  <th scope="row" valign="top"><label for="slug"><?php echo esc_attr_x( 'Slug', 'Taxonomy Slug', 'advanced-ads' ); ?></label></th>
50
- <td><input name="slug" id="slug" type="text" value="
51
- <?php
52
  if ( isset( $tag->slug ) ) {
53
  echo esc_attr( apply_filters( 'editable_slug', $tag->slug ) ); }
54
- ?>
55
- " size="40" />
56
- <p class="description"><?php esc_attr_e( 'An id-like string with only letters in lower case, numbers, and hyphens.', 'advanced-ads' ); ?></p></td>
57
  </tr>
58
  <?php
59
  }
47
  <?php if ( ! global_terms_enabled() ) { ?>
48
  <tr class="form-field">
49
  <th scope="row" valign="top"><label for="slug"><?php echo esc_attr_x( 'Slug', 'Taxonomy Slug', 'advanced-ads' ); ?></label></th>
50
+ <td><input name="slug" id="slug" type="text" value="<?php
 
51
  if ( isset( $tag->slug ) ) {
52
  echo esc_attr( apply_filters( 'editable_slug', $tag->slug ) ); }
53
+ ?>" size="40" />
54
+ <p class="description"><?php esc_attr_e( 'An id-like string with only letters in lower case, numbers, and hyphens.', 'advanced-ads' ); ?></p></td>
 
55
  </tr>
56
  <?php
57
  }
admin/views/ad-group-list-form-row.php CHANGED
@@ -33,18 +33,15 @@ $hidden = ( isset( $_POST['advads-last-edited-group'] ) && $group->id === $_POST
33
  <div class="advads-ad-group-type">
34
  <?php
35
  foreach ( $this->types as $_type_key => $_type ) :
 
 
 
 
 
36
  ?>
37
- <label title="<?php echo $_type['description']; ?>"><input type="radio" name="advads-groups[
38
- <?php
39
- echo $group->id;
40
- ?>
41
- ][type]" value="<?php echo $_type_key; ?>" <?php checked( $group->type, $_type_key ); ?>/>
42
- <?php
43
- echo $_type['title'];
44
- ?>
45
- </label>
46
- <?php
47
- endforeach;
48
  ?>
49
  </div>
50
  <?php
33
  <div class="advads-ad-group-type">
34
  <?php
35
  foreach ( $this->types as $_type_key => $_type ) :
36
+ ?><label title="<?php echo $_type['description']; ?>"><input type="radio" name="advads-groups[<?php
37
+ echo $group->id;
38
+ ?>][type]" value="<?php echo $_type_key; ?>" <?php checked( $group->type, $_type_key ); ?>/>
39
+ <?php
40
+ echo $_type['title'];
41
  ?>
42
+ </label>
43
+ <?php
44
+ endforeach;
 
 
 
 
 
 
 
 
45
  ?>
46
  </div>
47
  <?php
admin/views/ad-main-metabox.php CHANGED
@@ -9,10 +9,8 @@
9
  foreach ( $types as $_type ) :
10
  ?>
11
  <li class="advanced-ads-type-list-<?php echo $_type->ID; ?>">
12
- <input type="radio" name="advanced_ad[type]"
13
- id="advanced-ad-type-<?php echo $_type->ID; ?>"
14
- value="<?php echo $_type->ID; ?>"
15
- <?php checked( $type, $_type->ID ); ?>/>
16
  <label for="advanced-ad-type-<?php echo $_type->ID; ?>"><?php echo ( empty( $_type->title ) ) ? $_type->ID : $_type->title; ?></label>
17
  <?php
18
  if ( ! empty( $_type->description ) ) :
9
  foreach ( $types as $_type ) :
10
  ?>
11
  <li class="advanced-ads-type-list-<?php echo $_type->ID; ?>">
12
+ <input type="radio" name="advanced_ad[type]" id="advanced-ad-type-<?php
13
+ echo $_type->ID; ?>" value="<?php echo $_type->ID; ?>" <?php checked( $type, $_type->ID ); ?>/>
 
 
14
  <label for="advanced-ad-type-<?php echo $_type->ID; ?>"><?php echo ( empty( $_type->title ) ) ? $_type->ID : $_type->title; ?></label>
15
  <?php
16
  if ( ! empty( $_type->description ) ) :
admin/views/ad-output-metabox.php CHANGED
@@ -3,113 +3,83 @@
3
  <div class="advads-option-list">
4
  <span class="label"><?php _e( 'Position', 'advanced-ads' ); ?></span>
5
  <div id="advanced-ad-output-position">
6
- <label><input type="radio" name="advanced_ad[output][position]" value="" title="
7
- <?php
8
  _e( '- default -', 'advanced-ads' );
9
- ?>
10
- "
11
- <?php
12
  if ( empty( $options['position'] ) ) {
13
  checked( 1, 1 ); }
14
- ?>
15
- /><?php _e( 'default', 'advanced-ads' ); ?></label>
16
- <label title="<?php _e( 'left', 'advanced-ads' ); ?>"><input type="radio" name="advanced_ad[output][position]" value="left"
17
- <?php
18
  if ( isset( $options['position'] ) ) {
19
  checked( $options['position'], 'left' ); }
20
- ?>
21
- />
22
  <img src="<?php echo ADVADS_BASE_URL; ?>admin/assets/img/output-left.png" width="60" height="45"/></label>
23
- <label title="<?php _e( 'center', 'advanced-ads' ); ?>"><input type="radio" name="advanced_ad[output][position]" value="center"
24
- <?php
25
  if ( isset( $options['position'] ) ) {
26
  checked( $options['position'], 'center' ); }
27
- ?>
28
- />
29
  <img src="<?php echo ADVADS_BASE_URL; ?>admin/assets/img/output-center.png" width="60" height="45"/></label>
30
- <label title="<?php _e( 'right', 'advanced-ads' ); ?>"><input type="radio" name="advanced_ad[output][position]" value="right"
31
- <?php
32
  if ( isset( $options['position'] ) ) {
33
  checked( $options['position'], 'right' ); }
34
- ?>
35
- />
36
  <img src="<?php echo ADVADS_BASE_URL; ?>admin/assets/img/output-right.png" width="60" height="45"/></label>
37
- <p><label><input type="checkbox" name="advanced_ad[output][clearfix]" value="1"
38
- <?php
39
  if ( isset( $options['clearfix'] ) ) {
40
  checked( $options['clearfix'], 1 ); }
41
- ?>
42
- />
43
- <?php
44
- _e( 'Check this if you don\'t want the following elements to float around the ad. (adds a clearfix)', 'advanced-ads' );
45
- ?>
46
  </label></p>
47
  </div>
48
  <hr/>
49
  <span class="label"><?php _e( 'Margin', 'advanced-ads' ); ?></span>
50
  <div id="advanced-ad-output-margin">
51
- <label><?php _e( 'top:', 'advanced-ads' ); ?> <input type="number" value="
52
- <?php
53
- if ( isset( $options['margin']['top'] ) ) {
54
- echo $options['margin']['top']; }
55
- ?>
56
- " name="advanced_ad[output][margin][top]"/>px</label>
57
- <label><?php _e( 'right:', 'advanced-ads' ); ?> <input type="number" value="
58
- <?php
59
- if ( isset( $options['margin']['right'] ) ) {
60
- echo $options['margin']['right']; }
61
- ?>
62
- " name="advanced_ad[output][margin][right]"/>px</label>
63
- <label><?php _e( 'bottom:', 'advanced-ads' ); ?> <input type="number" value="
64
- <?php
65
- if ( isset( $options['margin']['bottom'] ) ) {
66
- echo $options['margin']['bottom']; }
67
- ?>
68
- " name="advanced_ad[output][margin][bottom]"/>px</label>
69
- <label><?php _e( 'left:', 'advanced-ads' ); ?> <input type="number" value="
70
- <?php
71
- if ( isset( $options['margin']['left'] ) ) {
72
- echo $options['margin']['left']; }
73
- ?>
74
- " name="advanced_ad[output][margin][left]"/>px</label>
75
  <p class="description"><?php _e( 'tip: use this to add a margin around the ad', 'advanced-ads' ); ?></p>
76
  </div>
77
  <hr class="advads-hide-in-wizard"/>
78
  <label class='label advads-hide-in-wizard' for="advads-output-wrapper-id"><?php _e( 'container ID', 'advanced-ads' ); ?></label>
79
  <div class="advads-hide-in-wizard">
80
- <input type="text" id="advads-output-wrapper-id" name="advanced_ad[output][wrapper-id]" value="
81
- <?php
82
  if ( isset( $options['wrapper-id'] ) ) {
83
  echo $options['wrapper-id']; }
84
- ?>
85
- "/>
86
  <p class="description"><?php _e( 'Specify the id of the ad container. Leave blank for random or no id.', 'advanced-ads' ); ?></p>
87
  </div>
88
  <hr class="advads-hide-in-wizard"/>
89
  <label class='label advads-hide-in-wizard' for="advads-output-wrapper-class"><?php _e( 'container classes', 'advanced-ads' ); ?></label>
90
  <div class="advads-hide-in-wizard">
91
- <input type="text" id="advads-output-wrapper-class" name="advanced_ad[output][wrapper-class]" value="
92
- <?php
93
  if ( isset( $options['wrapper-class'] ) ) {
94
  echo $options['wrapper-class']; }
95
- ?>
96
- "/>
97
  <p class="description"><?php _e( 'Specify one or more classes for the container. Separate multiple classes with a space', 'advanced-ads' ); ?></p>
98
  </div>
99
  <hr class="advads-hide-in-wizard"/>
100
  <label for="advads-output-debugmode" class="label advads-hide-in-wizard"><?php _e( 'Enable debug mode', 'advanced-ads' ); ?></label>
101
  <div class="advads-hide-in-wizard">
102
- <input id="advads-output-debugmode" type="checkbox" name="advanced_ad[output][debugmode]" value="1"
103
- <?php
104
  if ( isset( $options['debugmode'] ) ) {
105
  checked( $options['debugmode'], 1 ); }
106
- ?>
107
- />
108
 
109
  <a href="<?php echo ADVADS_URL; ?>manual/ad-debug-mode/#utm_source=advanced-ads&utm_medium=link&utm_campaign=ad-debug-mode" target="_blank"><?php _e( 'Manual', 'advanced-ads' ); ?></a>
110
  </div>
111
 
112
-
113
  <?php do_action( 'advanced-ads-output-metabox-after', $ad ); ?>
114
 
115
  </div>
3
  <div class="advads-option-list">
4
  <span class="label"><?php _e( 'Position', 'advanced-ads' ); ?></span>
5
  <div id="advanced-ad-output-position">
6
+ <label><input type="radio" name="advanced_ad[output][position]" value="" title="<?php
 
7
  _e( '- default -', 'advanced-ads' );
8
+ ?>" <?php
 
 
9
  if ( empty( $options['position'] ) ) {
10
  checked( 1, 1 ); }
11
+ ?>/><?php _e( 'default', 'advanced-ads' ); ?></label>
12
+ <label title="<?php _e( 'left', 'advanced-ads' ); ?>"><input type="radio" name="advanced_ad[output][position]" value="left"<?php
 
 
13
  if ( isset( $options['position'] ) ) {
14
  checked( $options['position'], 'left' ); }
15
+ ?>/>
 
16
  <img src="<?php echo ADVADS_BASE_URL; ?>admin/assets/img/output-left.png" width="60" height="45"/></label>
17
+ <label title="<?php _e( 'center', 'advanced-ads' ); ?>"><input type="radio" name="advanced_ad[output][position]" value="center" <?php
 
18
  if ( isset( $options['position'] ) ) {
19
  checked( $options['position'], 'center' ); }
20
+ ?>/>
 
21
  <img src="<?php echo ADVADS_BASE_URL; ?>admin/assets/img/output-center.png" width="60" height="45"/></label>
22
+ <label title="<?php _e( 'right', 'advanced-ads' ); ?>"><input type="radio" name="advanced_ad[output][position]" value="right" <?php
 
23
  if ( isset( $options['position'] ) ) {
24
  checked( $options['position'], 'right' ); }
25
+ ?>/>
 
26
  <img src="<?php echo ADVADS_BASE_URL; ?>admin/assets/img/output-right.png" width="60" height="45"/></label>
27
+ <p><label><input type="checkbox" name="advanced_ad[output][clearfix]" value="1"<?php
 
28
  if ( isset( $options['clearfix'] ) ) {
29
  checked( $options['clearfix'], 1 ); }
30
+ ?>/>
 
 
 
 
31
  </label></p>
32
  </div>
33
  <hr/>
34
  <span class="label"><?php _e( 'Margin', 'advanced-ads' ); ?></span>
35
  <div id="advanced-ad-output-margin">
36
+ <label><?php _e( 'top:', 'advanced-ads' ); ?> <input type="number" value="<?php
37
+ if ( isset( $options['margin']['top'] ) ) {
38
+ echo $options['margin']['top']; }
39
+ ?>" name="advanced_ad[output][margin][top]"/>px</label>
40
+ <label><?php _e( 'right:', 'advanced-ads' ); ?> <input type="number" value="<?php
41
+ if ( isset( $options['margin']['right'] ) ) {
42
+ echo $options['margin']['right']; }
43
+ ?>" name="advanced_ad[output][margin][right]"/>px</label>
44
+ <label><?php _e( 'bottom:', 'advanced-ads' ); ?> <input type="number" value="<?php
45
+ if ( isset( $options['margin']['bottom'] ) ) {
46
+ echo $options['margin']['bottom']; }
47
+ ?>" name="advanced_ad[output][margin][bottom]"/>px</label>
48
+ <label><?php _e( 'left:', 'advanced-ads' ); ?> <input type="number" value="<?php
49
+ if ( isset( $options['margin']['left'] ) ) {
50
+ echo $options['margin']['left']; }
51
+ ?>" name="advanced_ad[output][margin][left]"/>px</label>
 
 
 
 
 
 
 
 
52
  <p class="description"><?php _e( 'tip: use this to add a margin around the ad', 'advanced-ads' ); ?></p>
53
  </div>
54
  <hr class="advads-hide-in-wizard"/>
55
  <label class='label advads-hide-in-wizard' for="advads-output-wrapper-id"><?php _e( 'container ID', 'advanced-ads' ); ?></label>
56
  <div class="advads-hide-in-wizard">
57
+ <input type="text" id="advads-output-wrapper-id" name="advanced_ad[output][wrapper-id]" value="<?php
 
58
  if ( isset( $options['wrapper-id'] ) ) {
59
  echo $options['wrapper-id']; }
60
+ ?>"/>
 
61
  <p class="description"><?php _e( 'Specify the id of the ad container. Leave blank for random or no id.', 'advanced-ads' ); ?></p>
62
  </div>
63
  <hr class="advads-hide-in-wizard"/>
64
  <label class='label advads-hide-in-wizard' for="advads-output-wrapper-class"><?php _e( 'container classes', 'advanced-ads' ); ?></label>
65
  <div class="advads-hide-in-wizard">
66
+ <input type="text" id="advads-output-wrapper-class" name="advanced_ad[output][wrapper-class]" value="<?php
 
67
  if ( isset( $options['wrapper-class'] ) ) {
68
  echo $options['wrapper-class']; }
69
+ ?>"/>
 
70
  <p class="description"><?php _e( 'Specify one or more classes for the container. Separate multiple classes with a space', 'advanced-ads' ); ?></p>
71
  </div>
72
  <hr class="advads-hide-in-wizard"/>
73
  <label for="advads-output-debugmode" class="label advads-hide-in-wizard"><?php _e( 'Enable debug mode', 'advanced-ads' ); ?></label>
74
  <div class="advads-hide-in-wizard">
75
+ <input id="advads-output-debugmode" type="checkbox" name="advanced_ad[output][debugmode]" value="1" <?php
 
76
  if ( isset( $options['debugmode'] ) ) {
77
  checked( $options['debugmode'], 1 ); }
78
+ ?>/>
 
79
 
80
  <a href="<?php echo ADVADS_URL; ?>manual/ad-debug-mode/#utm_source=advanced-ads&utm_medium=link&utm_campaign=ad-debug-mode" target="_blank"><?php _e( 'Manual', 'advanced-ads' ); ?></a>
81
  </div>
82
 
 
83
  <?php do_action( 'advanced-ads-output-metabox-after', $ad ); ?>
84
 
85
  </div>
admin/views/ad-parameters-size.php CHANGED
@@ -6,12 +6,10 @@
6
  $show_reserve_space = in_array( $type->ID, array( 'plain', 'content', 'group', 'adsense' ) );
7
  $enable_reserve_space = $show_reserve_space && ! empty( $ad->output['add_wrapper_sizes'] );
8
  ?>
9
- <label
10
- <?php
11
  if ( ! $show_reserve_space ) {
12
  echo 'style="display:none;"'; }
13
- ?>
14
- ><input type="checkbox" id="advads-wrapper-add-sizes" name="advanced_ad[output][add_wrapper_sizes]" value="true" <?php checked( $enable_reserve_space ); ?>><?php _e( 'reserve this space', 'advanced-ads' ); ?></label>
15
  <?php
16
  if ( 'image' === $type->ID ) :
17
  Advanced_Ads_Ad_Type_Image::show_original_image_size( $ad );
6
  $show_reserve_space = in_array( $type->ID, array( 'plain', 'content', 'group', 'adsense' ) );
7
  $enable_reserve_space = $show_reserve_space && ! empty( $ad->output['add_wrapper_sizes'] );
8
  ?>
9
+ <label <?php
 
10
  if ( ! $show_reserve_space ) {
11
  echo 'style="display:none;"'; }
12
+ ?>><input type="checkbox" id="advads-wrapper-add-sizes" name="advanced_ad[output][add_wrapper_sizes]" value="true" <?php checked( $enable_reserve_space ); ?>><?php _e( 'reserve this space', 'advanced-ads' ); ?></label>
 
13
  <?php
14
  if ( 'image' === $type->ID ) :
15
  Advanced_Ads_Ad_Type_Image::show_original_image_size( $ad );
admin/views/ad-submitbox-meta.php CHANGED
@@ -2,17 +2,13 @@
2
  $TZ = Advanced_Ads_Admin::timezone_get_name( Advanced_Ads_Admin::get_wp_timezone() );
3
  ?><div id="advanced-ads-expiry-date" class="misc-pub-section curtime misc-pub-curtime">
4
  <label onclick="advads_toggle_box('#advanced-ads-expiry-date-enable', '#advanced-ads-expiry-date .inner')">
5
- <input type="checkbox" id="advanced-ads-expiry-date-enable" name="advanced_ad[expiry_date][enabled]"
6
- value="1" <?php checked( $enabled, 1 ); ?>/><?php _e( 'Set expiry date', 'advanced-ads' ); ?>&nbsp;(<?php echo $TZ; ?>)
7
  </label>
8
  <br/>
9
 
10
- <div class="inner"
11
- <?php
12
  if ( ! $enabled ) :
13
- ?>
14
- style="display:none;"<?php endif; ?>>
15
- <?php
16
  $month = '<label><span class="screen-reader-text">' . __( 'Month', 'advanced-ads' ) . '</span><select id="advads-exp-mm" name="advanced_ad[expiry_date][month]"' . ">\n";
17
  for ( $i = 1; $i < 13; $i = $i + 1 ) {
18
  $monthnum = zeroise( $i, 2 );
2
  $TZ = Advanced_Ads_Admin::timezone_get_name( Advanced_Ads_Admin::get_wp_timezone() );
3
  ?><div id="advanced-ads-expiry-date" class="misc-pub-section curtime misc-pub-curtime">
4
  <label onclick="advads_toggle_box('#advanced-ads-expiry-date-enable', '#advanced-ads-expiry-date .inner')">
5
+ <input type="checkbox" id="advanced-ads-expiry-date-enable" name="advanced_ad[expiry_date][enabled]" value="1" <?php checked( $enabled, 1 ); ?>/><?php _e( 'Set expiry date', 'advanced-ads' ); ?>&nbsp;(<?php echo $TZ; ?>)
 
6
  </label>
7
  <br/>
8
 
9
+ <div class="inner" <?php
 
10
  if ( ! $enabled ) :
11
+ ?> style="display:none;"<?php endif; ?>><?php
 
 
12
  $month = '<label><span class="screen-reader-text">' . __( 'Month', 'advanced-ads' ) . '</span><select id="advads-exp-mm" name="advanced_ad[expiry_date][month]"' . ">\n";
13
  for ( $i = 1; $i < 13; $i = $i + 1 ) {
14
  $monthnum = zeroise( $i, 2 );
admin/views/ad-visitor-metabox.php CHANGED
@@ -45,11 +45,8 @@ if ( $empty_options ) :
45
  ?>
46
  <p><a class="button button-primary" href="<?php echo ADVADS_URL; ?>manual/visitor-conditions#utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-visitor" target="_blank">
47
  <?php _e( 'Visit the manual', 'advanced-ads' ); ?>
48
- </a></p>
49
- <?php
50
- endif;
51
- ?>
52
- <table class="advads-conditions-table"><tbody>
53
  <?php
54
  if ( isset( $options ) ) :
55
  $i = 0;
@@ -98,11 +95,9 @@ elseif ( Advanced_Ads_Checks::cache() && ! defined( 'AAP_VERSION' ) ) :
98
  <?php
99
  endif;
100
  ?>
101
- <fieldset
102
- <?php
103
  if ( $empty_options ) :
104
- ?>
105
- class="advads-hide-in-wizard"<?php endif; ?>>
106
  <legend><?php _e( 'New condition', 'advanced-ads' ); ?></legend>
107
  <div id="advads-visitor-conditions-new">
108
  <select>
45
  ?>
46
  <p><a class="button button-primary" href="<?php echo ADVADS_URL; ?>manual/visitor-conditions#utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-visitor" target="_blank">
47
  <?php _e( 'Visit the manual', 'advanced-ads' ); ?>
48
+ </a></p><?php endif;
49
+ ?><table class="advads-conditions-table"><tbody>
 
 
 
50
  <?php
51
  if ( isset( $options ) ) :
52
  $i = 0;
95
  <?php
96
  endif;
97
  ?>
98
+ <fieldset<?php
 
99
  if ( $empty_options ) :
100
+ ?> class="advads-hide-in-wizard"<?php endif; ?>>
 
101
  <legend><?php _e( 'New condition', 'advanced-ads' ); ?></legend>
102
  <div id="advads-visitor-conditions-new">
103
  <select>
admin/views/placements-ad-label-position.php CHANGED
@@ -1,36 +1,26 @@
1
- <br/><br/><p><?php _e( 'Position', 'advanced-ads' ); ?></p>
2
- <label title="<?php _e( 'default', 'advanced-ads' ); ?>">
3
- <input type="radio" name="advads[placements][<?php echo $_placement_slug; ?>][options][placement_position]" value=""
4
- <?php
5
- checked( $_position, 'default' );
6
- ?>
7
- /><?php _e( 'default', 'advanced-ads' ); ?>
8
  </label>
9
- <label title="<?php _e( 'left', 'advanced-ads' ); ?>">
10
- <input type="radio" name="advads[placements][<?php echo $_placement_slug; ?>][options][placement_position]" value="left"
11
- <?php
12
- checked( $_position, 'left' );
13
- ?>
14
- /><?php _e( 'left', 'advanced-ads' ); ?></label>
15
- <label title="<?php _e( 'center', 'advanced-ads' ); ?>">
16
- <input type="radio" name="advads[placements][<?php echo $_placement_slug; ?>][options][placement_position]" value="center"
17
- <?php
18
- checked( $_position, 'center' );
19
- ?>
20
- /><?php _e( 'center', 'advanced-ads' ); ?></label>
21
- <label title="<?php _e( 'right', 'advanced-ads' ); ?>">
22
- <input type="radio" name="advads[placements][<?php echo $_placement_slug; ?>][options][placement_position]" value="right"
23
- <?php
24
- checked( $_position, 'right' );
25
- ?>
26
- /><?php _e( 'right', 'advanced-ads' ); ?></label>
27
  <p><label>
28
- <input type="checkbox" name="advads[placements][<?php echo $_placement_slug; ?>][options][placement_clearfix]" value="1"
29
- <?php
30
- checked( $_clearfix, 1 );
31
- ?>
32
- />
33
  <?php
34
- _e( 'Check this if you don\'t want the following elements to float around the ad. (adds a placement_clearfix)', 'advanced-ads' );
35
  ?>
36
- </label></p>
1
+ <br/><br/><p><?php _e('Position', 'advanced-ads'); ?></p>
2
+ <label title="<?php _e('default', 'advanced-ads'); ?>">
3
+ <input type="radio" name="advads[placements][<?php echo $_placement_slug; ?>][options][placement_position]" value="" <?php
4
+ checked($_position, 'default');
5
+ ?>/><?php _e('default', 'advanced-ads'); ?>
 
 
6
  </label>
7
+ <label title="<?php _e('left', 'advanced-ads'); ?>">
8
+ <input type="radio" name="advads[placements][<?php echo $_placement_slug; ?>][options][placement_position]" value="left" <?php
9
+ checked($_position, 'left');
10
+ ?>/><?php _e('left', 'advanced-ads'); ?></label>
11
+ <label title="<?php _e('center', 'advanced-ads'); ?>">
12
+ <input type="radio" name="advads[placements][<?php echo $_placement_slug; ?>][options][placement_position]" value="center" <?php
13
+ checked($_position, 'center');
14
+ ?>/><?php _e('center', 'advanced-ads'); ?></label>
15
+ <label title="<?php _e('right', 'advanced-ads'); ?>">
16
+ <input type="radio" name="advads[placements][<?php echo $_placement_slug; ?>][options][placement_position]" value="right" <?php
17
+ checked($_position, 'right');
18
+ ?>/><?php _e('right', 'advanced-ads'); ?></label>
 
 
 
 
 
 
19
  <p><label>
20
+ <input type="checkbox" name="advads[placements][<?php echo $_placement_slug; ?>][options][placement_clearfix]" value="1"<?php
21
+ checked($_clearfix, 1);
22
+ ?>/>
 
 
23
  <?php
24
+ _e('Check this if you don\'t want the following elements to float around the ad. (adds a placement_clearfix)', 'advanced-ads');
25
  ?>
26
+ </label></p>
admin/views/placements-ad-label.php CHANGED
@@ -1,21 +1,15 @@
1
- <label title="<?php _e( 'default', 'advanced-ads' ); ?>">
2
- <input type="radio" name="advads[placements][<?php echo $_placement_slug; ?>][options][ad_label]" value="default"
3
- <?php
4
- checked( $_label, 'default' );
5
- ?>
6
- /><?php _e( 'default', 'advanced-ads' ); ?>
7
  </label>
8
- <label title="<?php _e( 'enabled', 'advanced-ads' ); ?>">
9
- <input type="radio" name="advads[placements][<?php echo $_placement_slug; ?>][options][ad_label]" value="enabled"
10
- <?php
11
- checked( $_label, 'enabled' );
12
- ?>
13
- /><?php _e( 'enabled', 'advanced-ads' ); ?>
14
  </label>
15
- <label title="<?php _e( 'disabled', 'advanced-ads' ); ?>">
16
- <input type="radio" name="advads[placements][<?php echo $_placement_slug; ?>][options][ad_label]" value="disabled"
17
- <?php
18
- checked( $_label, 'disabled' );
19
- ?>
20
- /><?php _e( 'disabled', 'advanced-ads' ); ?>
21
  </label>
1
+ <label title="<?php _e('default', 'advanced-ads'); ?>">
2
+ <input type="radio" name="advads[placements][<?php echo $_placement_slug; ?>][options][ad_label]" value="default" <?php
3
+ checked($_label, 'default');
4
+ ?>/><?php _e('default', 'advanced-ads'); ?>
 
 
5
  </label>
6
+ <label title="<?php _e('enabled', 'advanced-ads'); ?>">
7
+ <input type="radio" name="advads[placements][<?php echo $_placement_slug; ?>][options][ad_label]" value="enabled" <?php
8
+ checked($_label, 'enabled');
9
+ ?>/><?php _e('enabled', 'advanced-ads'); ?>
 
 
10
  </label>
11
+ <label title="<?php _e('disabled', 'advanced-ads'); ?>">
12
+ <input type="radio" name="advads[placements][<?php echo $_placement_slug; ?>][options][ad_label]" value="disabled" <?php
13
+ checked($_label, 'disabled');
14
+ ?>/><?php _e('disabled', 'advanced-ads'); ?>
 
 
15
  </label>
admin/views/setting-license.php CHANGED
@@ -1,76 +1,73 @@
1
  <?php
2
- $errortext = false;
3
- $expires = Advanced_Ads_Admin_Licenses::get_instance()->get_license_expires( $options_slug );
4
- $expired = false;
5
- $expired_error = __( 'Your license expired.', 'advanced-ads' );
6
 
7
  ob_start();
8
  ?><button type="button" class="button-secondary advads-license-activate"
9
- data-addon="<?php echo $index; ?>"
10
- data-pluginname="<?php echo $plugin_name; ?>"
11
- data-optionslug="<?php echo $options_slug; ?>"
12
- name="advads_license_activate"><?php _e( 'Update expiry date', 'advanced-ads' ); ?></button>
13
- <?php
14
- $update_button = ob_get_clean();
15
-
16
- $expired_error .= $expired_renew_link = ' ' . sprintf( __( 'Click on %2$s if you renewed it or have a subscription or <a href="%1$s" target="_blank">renew your license</a>.', 'advanced-ads' ), ADVADS_URL . 'checkout/?edd_license_key=' . esc_attr( $license_key ) . '#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings-licenses', $update_button );
17
- if ( 'lifetime' !== $expires ) {
18
- $expires_time = strtotime( $expires );
19
- $days_left = ( $expires_time - time() ) / DAY_IN_SECONDS;
20
- }
21
- if ( 'lifetime' === $expires ) {
22
- // do nothing
23
- } elseif ( $days_left <= 0 ) {
24
- $plugin_url = isset( $plugin_url ) ? $plugin_url : ADVADS_URL;
25
- $errortext = $expired_error;
26
- $expired = true;
27
- } elseif ( 0 < $days_left && 31 > $days_left ) {
28
- $errortext = sprintf( __( '(%d days left)', 'advanced-ads' ), $days_left );
29
- }
30
- $show_active = ( $license_status !== false && $license_status == 'valid' && ! $expired ) ? true : false;
31
 
32
- ?>
33
- <input type="text" class="regular-text advads-license-key" placeholder="<?php _e( 'License key', 'advanced-ads' ); ?>"
34
- name="<?php echo ADVADS_SLUG . '-licenses'; ?>[<?php echo $index; ?>]"
35
- value="<?php echo esc_attr( $license_key ); ?>"
36
- <?php
37
- if ( $license_status !== false && $license_status == 'valid' && ! $expired ) :
38
- ?>
39
- readonly="readonly"<?php endif; ?>/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
  <button type="button" class="button-secondary advads-license-deactivate"
42
- <?php
43
- if ( $license_status !== 'valid' ) {
44
- echo ' style="display: none;" ';}
45
- ?>
 
46
  data-addon="<?php echo $index; ?>"
47
  data-pluginname="<?php echo $plugin_name; ?>"
48
  data-optionslug="<?php echo $options_slug; ?>"
49
- name="advads_license_activate"><?php _e( 'Deactivate License', 'advanced-ads' ); ?></button>
50
 
51
  <button type="button" class="button-primary advads-license-activate"
52
- data-addon="<?php echo $index; ?>"
53
- data-pluginname="<?php echo $plugin_name; ?>"
54
- data-optionslug="<?php echo $options_slug; ?>"
55
- name="advads_license_activate"><?php echo ( $license_status === 'valid' && ! $expired ) ? __( 'Update License', 'advanced-ads' ) : __( 'Activate License', 'advanced-ads' ); ?></button>
56
- <?php
57
- if ( '' === trim( $license_key ) ) {
58
- $errortext = __( 'Please enter a valid license key', 'advanced-ads' );
59
- } elseif ( ! $expired && ! $errortext ) {
60
- $errortext = ( $license_status == 'invalid' ) ? __( 'License key invalid', 'advanced-ads' ) : '';
61
- }
62
- ?>
63
- &nbsp;
64
- <span class="advads-license-activate-active"
65
- <?php
66
- if ( ! $show_active ) {
67
- echo 'style="display: none;"';}
68
- ?>
69
- ><?php _e( 'active', 'advanced-ads' ); ?></span>
70
- <span class="advads-license-activate-error"
71
- <?php
72
- if ( ! $errortext ) {
73
- echo 'style="display: none;"';}
74
- ?>
75
- ><?php echo $errortext; ?></span>
76
  <span class="advads-license-expired-error advads-error-message" style="display: none;"><?php echo $expired_error; ?></span>
1
  <?php
2
+ $errortext = false;
3
+ $expires = Advanced_Ads_Admin_Licenses::get_instance()->get_license_expires($options_slug);
4
+ $expired = false;
5
+ $expired_error = __('Your license expired.', 'advanced-ads');
6
 
7
  ob_start();
8
  ?><button type="button" class="button-secondary advads-license-activate"
9
+ data-addon="<?php echo $index; ?>"
10
+ data-pluginname="<?php echo $plugin_name; ?>"
11
+ data-optionslug="<?php echo $options_slug; ?>"
12
+ name="advads_license_activate"><?php _e('Update expiry date', 'advanced-ads'); ?></button>
13
+ <?php
14
+ $update_button = ob_get_clean();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
+ $expired_error .= $expired_renew_link = ' ' . sprintf(__('Click on %2$s if you renewed it or have a subscription or <a href="%1$s" target="_blank">renew your license</a>.', 'advanced-ads'), ADVADS_URL . 'checkout/?edd_license_key=' . esc_attr($license_key) . '#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings-licenses', $update_button);
17
+ if ('lifetime' !== $expires) {
18
+ $expires_time = strtotime($expires);
19
+ $days_left = ( $expires_time - time() ) / DAY_IN_SECONDS;
20
+ }
21
+ if ('lifetime' === $expires) {
22
+ // do nothing
23
+ } elseif ($days_left <= 0) {
24
+ $plugin_url = isset($plugin_url) ? $plugin_url : ADVADS_URL;
25
+ $errortext = $expired_error;
26
+ $expired = true;
27
+ } elseif (0 < $days_left && 31 > $days_left) {
28
+ $errortext = sprintf(__('(%d days left)', 'advanced-ads'), $days_left);
29
+ }
30
+ $show_active = ( $license_status !== false && $license_status == 'valid' && !$expired ) ? true : false;
31
+ ?>
32
+ <input type="text" class="regular-text advads-license-key" placeholder="<?php _e('License key', 'advanced-ads'); ?>"
33
+ name="<?php echo ADVADS_SLUG . '-licenses'; ?>[<?php echo $index; ?>]"
34
+ value="<?php echo esc_attr($license_key); ?>"
35
+ <?php
36
+ if ($license_status !== false && $license_status == 'valid' && !$expired) :
37
+ ?>
38
+ readonly="readonly"<?php endif; ?>/>
39
 
40
  <button type="button" class="button-secondary advads-license-deactivate"
41
+ <?php
42
+ if ($license_status !== 'valid') {
43
+ echo ' style="display: none;" ';
44
+ }
45
+ ?>
46
  data-addon="<?php echo $index; ?>"
47
  data-pluginname="<?php echo $plugin_name; ?>"
48
  data-optionslug="<?php echo $options_slug; ?>"
49
+ name="advads_license_activate"><?php _e('Deactivate License', 'advanced-ads'); ?></button>
50
 
51
  <button type="button" class="button-primary advads-license-activate"
52
+ data-addon="<?php echo $index; ?>"
53
+ data-pluginname="<?php echo $plugin_name; ?>"
54
+ data-optionslug="<?php echo $options_slug; ?>"
55
+ name="advads_license_activate"><?php echo ( $license_status === 'valid' && !$expired ) ? __('Update License', 'advanced-ads') : __('Activate License', 'advanced-ads'); ?></button>
56
+ <?php
57
+ if ('' === trim($license_key)) {
58
+ $errortext = __('Please enter a valid license key', 'advanced-ads');
59
+ } elseif (!$expired && !$errortext) {
60
+ $errortext = ( $license_status == 'invalid' ) ? __('License key invalid', 'advanced-ads') : '';
61
+ }
62
+ ?>
63
+ &nbsp;
64
+ <span class="advads-license-activate-active" <?php
65
+ if (!$show_active) {
66
+ echo 'style="display: none;"';
67
+ }
68
+ ?>><?php _e('active', 'advanced-ads'); ?></span>
69
+ <span class="advads-license-activate-error" <?php
70
+ if (!$errortext) {
71
+ echo 'style="display: none;"';
72
+ } ?>><?php echo $errortext; ?></span>
 
 
 
73
  <span class="advads-license-expired-error advads-error-message" style="display: none;"><?php echo $expired_error; ?></span>
admin/views/setting-target.php CHANGED
@@ -1,6 +1,4 @@
1
- <input name="<?php echo ADVADS_SLUG; ?>[target-blank]" type="checkbox" value="1"
2
- <?php
3
- checked( 1, $target );
4
- ?>
5
- />
6
  <p class="description"><?php _e( 'Open programatically created links in a new window (use <code>target="_blank"</code>)', 'advanced-ads' ); ?></p>
1
+ <input name="<?php echo ADVADS_SLUG; ?>[target-blank]" type="checkbox" value="1" <?php
2
+ checked( 1, $target );
3
+ ?>/>
 
 
4
  <p class="description"><?php _e( 'Open programatically created links in a new window (use <code>target="_blank"</code>)', 'advanced-ads' ); ?></p>
admin/views/settings-disable-ads.php CHANGED
@@ -1,48 +1,25 @@
1
- <label><input id="advanced-ads-disable-ads-all" type="checkbox" value="1" name="<?php
2
- echo ADVADS_SLUG ?>[disabled-ads][all]"
3
- <?php
4
- checked( $disable_all, 1 );
5
- ?>
6
- ><?php _e( 'Disable all ads in frontend', 'advanced-ads' ); ?></label>
7
  <p class="description"><?php _e( 'Use this option to disable all ads in the frontend, but still be able to use the plugin.', 'advanced-ads' ); ?></p>
8
 
9
- <label><input id="advanced-ads-disable-ads-404" type="checkbox" value="1" name="
10
- <?php
11
- echo ADVADS_SLUG;
12
- ?>
13
- [disabled-ads][404]"
14
- <?php
15
  checked( $disable_404, 1 );
16
- ?>
17
- ><?php _e( 'Disable ads on 404 error pages', 'advanced-ads' ); ?></label>
18
 
19
- <br/><label><input id="advanced-ads-disable-ads-archives" type="checkbox" value="1" name="
20
- <?php
21
- echo ADVADS_SLUG;
22
- ?>
23
- [disabled-ads][archives]"
24
- <?php
25
  checked( $disable_archives, 1 );
26
- ?>
27
- ><?php _e( 'Disable ads on non-singular pages', 'advanced-ads' ); ?></label>
28
  <p class="description"><?php _e( 'e.g. archive pages like categories, tags, authors, front page (if a list)', 'advanced-ads' ); ?></p>
29
- <label><input id="advanced-ads-disable-ads-secondary" type="checkbox" value="1" name="
30
- <?php
31
  echo ADVADS_SLUG;
32
- ?>
33
- [disabled-ads][secondary]"
34
- <?php
35
  checked( $disable_secondary, 1 );
36
- ?>
37
- ><?php _e( 'Disable ads on secondary queries', 'advanced-ads' ); ?></label>
38
  <p class="description"><?php _e( 'Secondary queries are custom queries of posts outside the main query of a page. Try this option if you see ads injected on places where they shouldn’t appear.', 'advanced-ads' ); ?></p>
39
 
40
- <label><input id="advanced-ads-disable-ads-feed" type="checkbox" value="1" name="
41
- <?php
42
  echo ADVADS_SLUG;
43
- ?>
44
- [disabled-ads][feed]"
45
- <?php
46
  checked( $disable_feed, 1 );
47
- ?>
48
- ><?php _e( 'Disable ads in Feed', 'advanced-ads' ); ?></label>
1
+ <label><input id="advanced-ads-disable-ads-all" type="checkbox" value="1" name="<?php echo ADVADS_SLUG ?>[disabled-ads][all]" <?php
2
+ checked( $disable_all, 1 ); ?>><?php _e( 'Disable all ads in frontend', 'advanced-ads' ); ?></label>
 
 
 
 
3
  <p class="description"><?php _e( 'Use this option to disable all ads in the frontend, but still be able to use the plugin.', 'advanced-ads' ); ?></p>
4
 
5
+ <label><input id="advanced-ads-disable-ads-404" type="checkbox" value="1" name="<?php
6
+ echo ADVADS_SLUG; ?>[disabled-ads][404]" <?php
 
 
 
 
7
  checked( $disable_404, 1 );
8
+ ?>><?php _e( 'Disable ads on 404 error pages', 'advanced-ads' ); ?></label>
 
9
 
10
+ <br/><label><input id="advanced-ads-disable-ads-archives" type="checkbox" value="1" name="<?php echo ADVADS_SLUG; ?>[disabled-ads][archives]" <?php
 
 
 
 
 
11
  checked( $disable_archives, 1 );
12
+ ?>><?php _e( 'Disable ads on non-singular pages', 'advanced-ads' ); ?></label>
 
13
  <p class="description"><?php _e( 'e.g. archive pages like categories, tags, authors, front page (if a list)', 'advanced-ads' ); ?></p>
14
+ <label><input id="advanced-ads-disable-ads-secondary" type="checkbox" value="1" name="<?php
 
15
  echo ADVADS_SLUG;
16
+ ?>[disabled-ads][secondary]" <?php
 
 
17
  checked( $disable_secondary, 1 );
18
+ ?>><?php _e( 'Disable ads on secondary queries', 'advanced-ads' ); ?></label>
 
19
  <p class="description"><?php _e( 'Secondary queries are custom queries of posts outside the main query of a page. Try this option if you see ads injected on places where they shouldn’t appear.', 'advanced-ads' ); ?></p>
20
 
21
+ <label><input id="advanced-ads-disable-ads-feed" type="checkbox" value="1" name="<?php
 
22
  echo ADVADS_SLUG;
23
+ ?>[disabled-ads][feed]" <?php
 
 
24
  checked( $disable_feed, 1 );
25
+ ?>><?php _e( 'Disable ads in Feed', 'advanced-ads' ); ?></label>
 
advanced-ads.php CHANGED
@@ -12,7 +12,7 @@
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
- * Version: 1.10.6
16
  * Author: Thomas Maier
17
  * Author URI: https://wpadvancedads.com
18
  * Text Domain: advanced-ads
@@ -39,7 +39,7 @@ define( 'ADVADS_BASE_DIR', dirname( ADVADS_BASE ) ); // directory of the plugin
39
  // general and global slug, e.g. to store options in WP
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
- define( 'ADVADS_VERSION', '1.10.6' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
+ * Version: 1.10.7
16
  * Author: Thomas Maier
17
  * Author URI: https://wpadvancedads.com
18
  * Text Domain: advanced-ads
39
  // general and global slug, e.g. to store options in WP
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
+ define( 'ADVADS_VERSION', '1.10.7' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: ads, ad manager, ad widget, ad rotation, adsense, advertise, advertisement
5
  Requires at least: 4.6
6
  Tested up to: 4.9
7
  Requires PHP: 5.4
8
- Stable tag: 1.10.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -267,6 +267,10 @@ Yes. Advanced Ads is based on WordPress standards and therefore easily customiza
267
 
268
  == Changelog ==
269
 
 
 
 
 
270
  = 1.10.6 =
271
 
272
  * fixed HTML issue with paragraph index when saving the placement page
5
  Requires at least: 4.6
6
  Tested up to: 4.9
7
  Requires PHP: 5.4
8
+ Stable tag: 1.10.7
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
267
 
268
  == Changelog ==
269
 
270
+ = 1.10.7 =
271
+
272
+ * reverted code optimization that broke some forms
273
+
274
  = 1.10.6 =
275
 
276
  * fixed HTML issue with paragraph index when saving the placement page