Advanced Ads - Version 1.1.2

Version Description

  • composer bugfix
  • changes some unclear descriptions
  • use group names instead of slug on placement page
  • reenabled handles for metaboxes on ad edit screen
  • added success message for placement updates
Download this release

Release Info

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

Code changes from version 1.1.1 to 1.1.2

admin/assets/css/admin.css CHANGED
@@ -2,8 +2,6 @@
2
  * AD EDIT PAGE
3
  */
4
  #ad-main-box { overflow: hidden; }
5
- .post-type-advanced_ads .meta-box-sortables .hndle { display: none; }
6
- .post-type-advanced_ads .meta-box-sortables .handlediv { display: none; }
7
  .post-type-advanced_ads #poststuff .meta-box-sortables .inside {
8
  margin: 0;
9
  padding: 0;
2
  * AD EDIT PAGE
3
  */
4
  #ad-main-box { overflow: hidden; }
 
 
5
  .post-type-advanced_ads #poststuff .meta-box-sortables .inside {
6
  margin: 0;
7
  padding: 0;
admin/class-advanced-ads-admin.php CHANGED
@@ -199,7 +199,12 @@ class Advanced_Ads_Admin {
199
  $return = Advads_Ad_Placements::save_placements($_POST['advads']['placements']);
200
  }
201
  $error = false;
202
- if(isset($return) && $return !== true) $error = $return;
 
 
 
 
 
203
  $placements = Advanced_Ads::get_ad_placements_array();
204
  // load ads and groups for select field
205
 
@@ -364,19 +369,19 @@ class Advanced_Ads_Admin {
364
  */
365
  public function add_meta_boxes() {
366
  add_meta_box(
367
- 'ad-main-box', __('Ad Main', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
368
  );
369
  add_meta_box(
370
- 'ad-parameters-box', __('Fine tune your ad', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
371
  );
372
  add_meta_box(
373
- 'ad-display-box', __('Where to display this ads', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
374
  );
375
  add_meta_box(
376
- 'ad-visitor-box', __('For whom to display this ads', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
377
  );
378
  add_meta_box(
379
- 'ad-inject-box', __('Auto injection of ads', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
380
  );
381
  }
382
 
199
  $return = Advads_Ad_Placements::save_placements($_POST['advads']['placements']);
200
  }
201
  $error = false;
202
+ $success = false;
203
+ if(isset($return) && $return !== true) {
204
+ $error = $return;
205
+ } elseif(isset($return) && $return === true){
206
+ $success = __('Placements updated', ADVADS_SLUG);
207
+ }
208
  $placements = Advanced_Ads::get_ad_placements_array();
209
  // load ads and groups for select field
210
 
369
  */
370
  public function add_meta_boxes() {
371
  add_meta_box(
372
+ 'ad-main-box', __('Ad Type', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
373
  );
374
  add_meta_box(
375
+ 'ad-parameters-box', __('Ad Parameters', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
376
  );
377
  add_meta_box(
378
+ 'ad-display-box', __('Display Conditions', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
379
  );
380
  add_meta_box(
381
+ 'ad-visitor-box', __('Visitor Conditions', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
382
  );
383
  add_meta_box(
384
+ 'ad-inject-box', __('Auto injection', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
385
  );
386
  }
387
 
admin/views/ad-display-metabox.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php $types = Advanced_Ads::get_instance()->ad_types; ?>
2
- <h4><?php _e('Display conditions', $this->plugin_slug); ?></h4>
3
- <p class="description"><?php _e('Display conditions that are based on the content type.', ADVADS_SLUG); ?></p>
4
  <div id="advanced-ad-conditions-enable">
5
  <?php $conditions_enabled = (empty($ad->conditions['enabled'])) ? 0 : 1; ?>
6
  <label><input type="radio" name="advanced_ad[conditions][enabled]" value="0" <?php checked($conditions_enabled, 0); ?>/><?php _e('Display ad everywhere', ADVADS_SLUG); ?></label>
1
  <?php $types = Advanced_Ads::get_instance()->ad_types; ?>
2
+ <p class="description"><?php _e('Choose where to display the ad and where not.', ADVADS_SLUG); ?></p>
 
3
  <div id="advanced-ad-conditions-enable">
4
  <?php $conditions_enabled = (empty($ad->conditions['enabled'])) ? 0 : 1; ?>
5
  <label><input type="radio" name="advanced_ad[conditions][enabled]" value="0" <?php checked($conditions_enabled, 0); ?>/><?php _e('Display ad everywhere', ADVADS_SLUG); ?></label>
admin/views/ad-group-edit.php CHANGED
@@ -37,7 +37,7 @@ wp_nonce_field('update-group_' . $group_id); ?>
37
  <tr class="form-field">
38
  <th scope="row" valign="top"><label for="slug"><?php _ex('Slug', 'Taxonomy Slug'); ?></label></th>
39
  <td><input name="slug" id="slug" type="text" value="<?php if (isset($tag->slug)) echo esc_attr(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
40
- <p class="description"><?php _e('An id-like string with only letters in lower case, numbers, and hyphens. Can be used to query a group.', $this->plugin_slug); ?></p></td>
41
  </tr>
42
  <?php } ?>
43
  <?php if (is_taxonomy_hierarchical($taxonomy)) : ?>
37
  <tr class="form-field">
38
  <th scope="row" valign="top"><label for="slug"><?php _ex('Slug', 'Taxonomy Slug'); ?></label></th>
39
  <td><input name="slug" id="slug" type="text" value="<?php if (isset($tag->slug)) echo esc_attr(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
40
+ <p class="description"><?php _e('An id-like string with only letters in lower case, numbers, and hyphens.', $this->plugin_slug); ?></p></td>
41
  </tr>
42
  <?php } ?>
43
  <?php if (is_taxonomy_hierarchical($taxonomy)) : ?>
admin/views/ad-inject-metabox.php CHANGED
@@ -1,4 +1,3 @@
1
- <h4><?php _e('Auto Injection', ADVADS_SLUG); ?></h4>
2
  <p class="description"><?php _e('Include ads on specific places automatically without shortcodes or functions.', ADVADS_SLUG); ?></p>
3
  <?php $options = $ad->options('injection'); ?>
4
  <ul id="advanced-ad-injection">
 
1
  <p class="description"><?php _e('Include ads on specific places automatically without shortcodes or functions.', ADVADS_SLUG); ?></p>
2
  <?php $options = $ad->options('injection'); ?>
3
  <ul id="advanced-ad-injection">
admin/views/ad-main-metabox.php CHANGED
@@ -2,7 +2,6 @@
2
  <?php if (empty($types)) : ?>
3
  <p><?php _e('No ad types defined', $this->plugin_slug); ?></p>
4
  <?php else : ?>
5
- <h4><?php _e('Ad Type and Content', $this->plugin_slug); ?></h4>
6
  <ul id="advanced-ad-type">
7
  <?php
8
  // choose first type if none set
2
  <?php if (empty($types)) : ?>
3
  <p><?php _e('No ad types defined', $this->plugin_slug); ?></p>
4
  <?php else : ?>
 
5
  <ul id="advanced-ad-type">
6
  <?php
7
  // choose first type if none set
admin/views/ad-parameters-metabox.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php $types = Advanced_Ads::get_instance()->ad_types; ?>
2
- <h4><?php _e('Ad Parameters', Advanced_Ads::TD); ?></h4>
3
  <?php
4
  /**
5
  * when changing ad type ad parameter content is loaded via ajax
1
  <?php $types = Advanced_Ads::get_instance()->ad_types; ?>
 
2
  <?php
3
  /**
4
  * when changing ad type ad parameter content is loaded via ajax
admin/views/ad-visitor-metabox.php CHANGED
@@ -1,4 +1,3 @@
1
- <h4><?php _e('Visitor conditions', ADVADS_SLUG); ?></h4>
2
  <p class="description"><?php _e('Display conditions that are based on the user. Use with caution on cached websites.', ADVADS_SLUG); ?></p>
3
  <?php $options = $ad->options('visitor'); ?>
4
  <ul id="advanced-ad-visitor-mobile">
 
1
  <p class="description"><?php _e('Display conditions that are based on the user. Use with caution on cached websites.', ADVADS_SLUG); ?></p>
2
  <?php $options = $ad->options('visitor'); ?>
3
  <ul id="advanced-ad-visitor-mobile">
admin/views/placements.php CHANGED
@@ -8,6 +8,9 @@
8
  <?php if ($error) : ?>
9
  <div id="message" class="error"><p><?php echo $error; ?></p></div>
10
  <?php endif; ?>
 
 
 
11
  <?php screen_icon(); ?>
12
  <h1><?php echo esc_html(get_admin_page_title()); ?></h1>
13
  <p class="description"><?php _e('Placements are physically places in your theme and posts. You can use them if you plan to change ads and ad groups on the same place without the need to change your templates.', ADVADS_SLUG); ?></p>
8
  <?php if ($error) : ?>
9
  <div id="message" class="error"><p><?php echo $error; ?></p></div>
10
  <?php endif; ?>
11
+ <?php if ($success) : ?>
12
+ <div id="message" class="updated"><p><?php echo $success; ?></p></div>
13
+ <?php endif; ?>
14
  <?php screen_icon(); ?>
15
  <h1><?php echo esc_html(get_admin_page_title()); ?></h1>
16
  <p class="description"><?php _e('Placements are physically places in your theme and posts. You can use them if you plan to change ads and ad groups on the same place without the need to change your templates.', ADVADS_SLUG); ?></p>
advanced-ads.php CHANGED
@@ -12,7 +12,7 @@
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: http://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
- * Version: 1.1.1
16
  * Author: Thomas Maier
17
  * Author URI: http://webgilde.com
18
  * Text Domain: advanced-ads
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: http://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
+ * Version: 1.1.2
16
  * Author: Thomas Maier
17
  * Author URI: http://webgilde.com
18
  * Text Domain: advanced-ads
classes/ad_placements.php CHANGED
@@ -96,7 +96,7 @@ class Advads_Ad_Placements {
96
  // load all ad groups
97
  $groups = $advads_admin->get_ad_groups();
98
  foreach($groups as $_group){
99
- $select['groups']['group_' . $_group->term_id] = $_group->slug;
100
  }
101
 
102
  return $select;
@@ -117,8 +117,9 @@ class Advads_Ad_Placements {
117
  if(isset($placements[$id]['item'])) {
118
  $_item = explode('_', $placements[$id]['item']);
119
 
120
- $_item_id = absint($_item[1]);
121
- if(empty($_item_id)) return;
 
122
 
123
  // return either ad or group content
124
  if($_item[0] == 'ad'){
@@ -131,6 +132,5 @@ class Advads_Ad_Placements {
131
  }
132
 
133
  return;
134
-
135
  }
136
  }
96
  // load all ad groups
97
  $groups = $advads_admin->get_ad_groups();
98
  foreach($groups as $_group){
99
+ $select['groups']['group_' . $_group->term_id] = $_group->name;
100
  }
101
 
102
  return $select;
117
  if(isset($placements[$id]['item'])) {
118
  $_item = explode('_', $placements[$id]['item']);
119
 
120
+ if(isset($_item[1]))
121
+ $_item_id = absint($_item[1]);
122
+ elseif(empty($_item_id)) return;
123
 
124
  // return either ad or group content
125
  if($_item[0] == 'ad'){
132
  }
133
 
134
  return;
 
135
  }
136
  }
public/class-advanced-ads.php CHANGED
@@ -25,7 +25,7 @@ class Advanced_Ads {
25
  * @var string
26
  */
27
 
28
- const VERSION = '1.1.1';
29
 
30
  /**
31
  * post type slug
25
  * @var string
26
  */
27
 
28
+ const VERSION = '1.1.2';
29
 
30
  /**
31
  * post type slug
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: webzunft
3
  Tags: ads, ad, adsense
4
  Requires at least: 3.5
5
  Tested up to: 3.9.2
6
- Stable tag: 1.1.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -118,6 +118,14 @@ There is no revenue share. Advanced Ads doesn’t alter your ad codes in a way t
118
 
119
  == Changelog ==
120
 
 
 
 
 
 
 
 
 
121
  = 1.1.1 =
122
 
123
  * added filter to be able to add own checks whether to display an ad or not
3
  Tags: ads, ad, adsense
4
  Requires at least: 3.5
5
  Tested up to: 3.9.2
6
+ Stable tag: 1.1.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
118
 
119
  == Changelog ==
120
 
121
+ = 1.1.2 =
122
+
123
+ * composer bugfix
124
+ * changes some unclear descriptions
125
+ * use group names instead of slug on placement page
126
+ * reenabled handles for metaboxes on ad edit screen
127
+ * added success message for placement updates
128
+
129
  = 1.1.1 =
130
 
131
  * added filter to be able to add own checks whether to display an ad or not