Advanced Ads - Version 1.2.7

Version Description

  • fixed translation files (thanks to sangkavr)
  • fixed inconsistent text domains
  • started with German translation
Download this release

Release Info

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

Code changes from version 1.2.6 to 1.2.7

admin/class-advanced-ads-admin.php CHANGED
@@ -151,7 +151,7 @@ class Advanced_Ads_Admin {
151
  }
152
 
153
  wp_enqueue_script($this->plugin_slug . '-admin-script', plugins_url('assets/js/admin.js', __FILE__), array('jquery', 'jquery-ui-autocomplete'), Advanced_Ads::VERSION);
154
-
155
  // just register this script for later inclusion on ad group list page
156
  wp_register_script('inline-edit-group-ads', plugins_url('assets/js/inline-edit-group-ads.js', __FILE__), array('jquery'), Advanced_Ads::VERSION);
157
 
@@ -193,27 +193,27 @@ class Advanced_Ads_Admin {
193
 
194
  // add main menu item with overview page
195
  add_menu_page(
196
- __('Overview', $this->plugin_slug), __('Advanced Ads', $this->plugin_slug), 'manage_options', $this->plugin_slug, array($this, 'display_overview_page'), '', '58.74'
197
  );
198
 
199
  add_submenu_page(
200
- $this->plugin_slug, __('Ads', $this->plugin_slug), __('Ads', $this->plugin_slug), 'manage_options', 'edit.php?post_type=' . Advanced_Ads::POST_TYPE_SLUG
201
  );
202
 
203
  $this->ad_group_hook_suffix = add_submenu_page(
204
- $this->plugin_slug, __('Ad Groups', $this->plugin_slug), __('Groups', $this->plugin_slug), 'manage_options', $this->plugin_slug . '-groups', array($this, 'ad_group_admin_page')
205
  );
206
 
207
  // add placements page
208
  add_submenu_page(
209
- $this->plugin_slug, __('Ad Placements', $this->plugin_slug), __('Placements', $this->plugin_slug), 'manage_options', $this->plugin_slug . '-placements', array($this, 'display_placements_page')
210
  );
211
  // add settings page
212
  $this->plugin_screen_hook_suffix = add_submenu_page(
213
- $this->plugin_slug, __('Advanced Ads Settings', $this->plugin_slug), __('Settings', $this->plugin_slug), 'manage_options', $this->plugin_slug . '-settings', array($this, 'display_plugin_settings_page')
214
  );
215
  add_submenu_page(
216
- null, __('Advanced Ads Debugging', $this->plugin_slug), __('Debug', $this->plugin_slug), 'manage_options', $this->plugin_slug . '-debug', array($this, 'display_plugin_debug_page')
217
  );
218
  }
219
 
@@ -388,7 +388,7 @@ class Advanced_Ads_Admin {
388
 
389
  return array_merge(
390
  array(
391
- 'settings' => '<a href="' . admin_url('edit.php?post_type=advanced_ads&page=advanced-ads-settings') . '">' . __('Settings', $this->plugin_slug) . '</a>'
392
  ), $links
393
  );
394
  }
@@ -413,19 +413,19 @@ class Advanced_Ads_Admin {
413
  */
414
  public function add_meta_boxes() {
415
  add_meta_box(
416
- 'ad-main-box', __('Ad Type', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
417
  );
418
  add_meta_box(
419
- 'ad-parameters-box', __('Ad Parameters', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
420
  );
421
  add_meta_box(
422
- 'ad-display-box', __('Display Conditions', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
423
  );
424
  add_meta_box(
425
- 'ad-visitor-box', __('Visitor Conditions', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
426
  );
427
  add_meta_box(
428
- 'ad-inject-box', __('Auto injection', $this->plugin_slug), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
429
  );
430
  }
431
 
151
  }
152
 
153
  wp_enqueue_script($this->plugin_slug . '-admin-script', plugins_url('assets/js/admin.js', __FILE__), array('jquery', 'jquery-ui-autocomplete'), Advanced_Ads::VERSION);
154
+
155
  // just register this script for later inclusion on ad group list page
156
  wp_register_script('inline-edit-group-ads', plugins_url('assets/js/inline-edit-group-ads.js', __FILE__), array('jquery'), Advanced_Ads::VERSION);
157
 
193
 
194
  // add main menu item with overview page
195
  add_menu_page(
196
+ __('Overview', ADVADS_SLUG), __('Advanced Ads', ADVADS_SLUG), 'manage_options', $this->plugin_slug, array($this, 'display_overview_page'), '', '58.74'
197
  );
198
 
199
  add_submenu_page(
200
+ $this->plugin_slug, __('Ads', ADVADS_SLUG), __('Ads', ADVADS_SLUG), 'manage_options', 'edit.php?post_type=' . Advanced_Ads::POST_TYPE_SLUG
201
  );
202
 
203
  $this->ad_group_hook_suffix = add_submenu_page(
204
+ $this->plugin_slug, __('Ad Groups', ADVADS_SLUG), __('Groups', ADVADS_SLUG), 'manage_options', $this->plugin_slug . '-groups', array($this, 'ad_group_admin_page')
205
  );
206
 
207
  // add placements page
208
  add_submenu_page(
209
+ $this->plugin_slug, __('Ad Placements', ADVADS_SLUG), __('Placements', ADVADS_SLUG), 'manage_options', $this->plugin_slug . '-placements', array($this, 'display_placements_page')
210
  );
211
  // add settings page
212
  $this->plugin_screen_hook_suffix = add_submenu_page(
213
+ $this->plugin_slug, __('Advanced Ads Settings', ADVADS_SLUG), __('Settings', ADVADS_SLUG), 'manage_options', $this->plugin_slug . '-settings', array($this, 'display_plugin_settings_page')
214
  );
215
  add_submenu_page(
216
+ null, __('Advanced Ads Debugging', ADVADS_SLUG), __('Debug', ADVADS_SLUG), 'manage_options', $this->plugin_slug . '-debug', array($this, 'display_plugin_debug_page')
217
  );
218
  }
219
 
388
 
389
  return array_merge(
390
  array(
391
+ 'settings' => '<a href="' . admin_url('edit.php?post_type=advanced_ads&page=advanced-ads-settings') . '">' . __('Settings', ADVADS_SLUG) . '</a>'
392
  ), $links
393
  );
394
  }
413
  */
414
  public function add_meta_boxes() {
415
  add_meta_box(
416
+ 'ad-main-box', __('Ad Type', ADVADS_SLUG), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
417
  );
418
  add_meta_box(
419
+ 'ad-parameters-box', __('Ad Parameters', ADVADS_SLUG), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
420
  );
421
  add_meta_box(
422
+ 'ad-display-box', __('Display Conditions', ADVADS_SLUG), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
423
  );
424
  add_meta_box(
425
+ 'ad-visitor-box', __('Visitor Conditions', ADVADS_SLUG), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
426
  );
427
  add_meta_box(
428
+ 'ad-inject-box', __('Auto injection', ADVADS_SLUG), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
429
  );
430
  }
431
 
admin/includes/class-ad-groups-list-table.php CHANGED
@@ -54,7 +54,7 @@ class AdvAds_Groups_List_Table extends AdvAds_List_Table {
54
  function column_cb($tag) {
55
  $default_term = get_option('default_' . $this->screen->taxonomy);
56
 
57
- return '<label class="screen-reader-text" for="cb-select-' . $tag->term_id . '">' . sprintf(__('Select %s', Advanced_Ads::TD), $tag->name) . '</label>'
58
  . '<input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" id="cb-select-' . $tag->term_id . '" />';
59
 
60
  return '&nbsp;';
@@ -91,12 +91,12 @@ class AdvAds_Groups_List_Table extends AdvAds_List_Table {
91
  );
92
  $edit_link = Advanced_Ads_Admin::group_page_url($args);
93
 
94
- $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr(sprintf(__('Edit &#8220;%s&#8221;', Advanced_Ads::TD), $name)) . '">' . $name . '</a></strong><br />';
95
  $out .= '<p class="description">' . $tag->description . '</p>';
96
 
97
  $actions = array();
98
  if (current_user_can($tax->cap->edit_terms)) {
99
- $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit', Advanced_Ads::TD) . '</a>';
100
  // $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick&nbsp;Edit') . '</a>';
101
  }
102
  if (current_user_can($tax->cap->delete_terms) && $tag->term_id != $default_term){
@@ -159,12 +159,12 @@ class AdvAds_Groups_List_Table extends AdvAds_List_Table {
159
  $ads->the_post();
160
  $out .= '<tr><td><a href="' . get_edit_post_link(get_the_ID()) . '">' . get_the_title() . '</a>';
161
  $_weight = (isset($weights[get_the_ID()])) ? $weights[get_the_ID()] : Advads_Ad_Group::MAX_AD_GROUP_WEIGHT;
162
- $out .= '<td class="ad-weight ad-weight-' . get_the_ID() . '" title="'.__('Ad weight', Advanced_Ads::TD).'">' . $_weight . '</td></tr>';
163
  $out .= '</tr>';
164
  }
165
  $out .= '</table>';
166
  // include actions
167
- $actions['edit'] = '<a href="#" class="edit-ad-group-ads">' . __('Edit', Advanced_Ads::TD) . '</a>';
168
  $out .= $this->row_actions($actions);
169
  // row with the group id
170
  $out .= '<input type="hidden" class="ad-group-id" value="'. $tag->term_id .'"/>';
54
  function column_cb($tag) {
55
  $default_term = get_option('default_' . $this->screen->taxonomy);
56
 
57
+ return '<label class="screen-reader-text" for="cb-select-' . $tag->term_id . '">' . sprintf(__('Select %s', ADVADS_SLUG), $tag->name) . '</label>'
58
  . '<input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" id="cb-select-' . $tag->term_id . '" />';
59
 
60
  return '&nbsp;';
91
  );
92
  $edit_link = Advanced_Ads_Admin::group_page_url($args);
93
 
94
+ $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr(sprintf(__('Edit &#8220;%s&#8221;', ADVADS_SLUG), $name)) . '">' . $name . '</a></strong><br />';
95
  $out .= '<p class="description">' . $tag->description . '</p>';
96
 
97
  $actions = array();
98
  if (current_user_can($tax->cap->edit_terms)) {
99
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit', ADVADS_SLUG) . '</a>';
100
  // $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick&nbsp;Edit') . '</a>';
101
  }
102
  if (current_user_can($tax->cap->delete_terms) && $tag->term_id != $default_term){
159
  $ads->the_post();
160
  $out .= '<tr><td><a href="' . get_edit_post_link(get_the_ID()) . '">' . get_the_title() . '</a>';
161
  $_weight = (isset($weights[get_the_ID()])) ? $weights[get_the_ID()] : Advads_Ad_Group::MAX_AD_GROUP_WEIGHT;
162
+ $out .= '<td class="ad-weight ad-weight-' . get_the_ID() . '" title="'.__('Ad weight', ADVADS_SLUG).'">' . $_weight . '</td></tr>';
163
  $out .= '</tr>';
164
  }
165
  $out .= '</table>';
166
  // include actions
167
+ $actions['edit'] = '<a href="#" class="edit-ad-group-ads">' . __('Edit', ADVADS_SLUG) . '</a>';
168
  $out .= $this->row_actions($actions);
169
  // row with the group id
170
  $out .= '<input type="hidden" class="ad-group-id" value="'. $tag->term_id .'"/>';
admin/includes/class-display-condition-callbacks.php CHANGED
@@ -164,7 +164,7 @@ class AdvAds_Display_Condition_Callbacks {
164
  _e('Display on all <strong>category archive pages</strong>.', ADVADS_SLUG); ?></label></h4><?php
165
  $taxonomies = get_taxonomies(array('public' => true, 'publicly_queryable' => true), 'objects', 'or');
166
  ?><div class="advads-conditions-single"><table>
167
- <p class="description"><?php _e('Choose the terms from public categories, tags and other taxonomies on whichs archive page ads can appear', ADVADS_SLUG); ?></p>
168
  <table><?php
169
  foreach($taxonomies as $_tax):
170
  if($_tax->name === 'advanced_ads_groups') continue; // exclude adv ads groups
@@ -193,7 +193,7 @@ class AdvAds_Display_Condition_Callbacks {
193
  $_excludes = array();
194
  }
195
 
196
- ?><h5 class="header"><?php _e('Hide from here', ADVADS_SLUG); ?></h5><p class="description"><?php _e('Choose the terms from public categories, tags and other taxonomies on whichs archive pages ads are hidden.', ADVADS_SLUG); ?></p>
197
  <table><?php
198
  foreach($taxonomies as $_tax):
199
  if($_tax->name === 'advanced_ads_groups') continue; // exclude adv ads groups
164
  _e('Display on all <strong>category archive pages</strong>.', ADVADS_SLUG); ?></label></h4><?php
165
  $taxonomies = get_taxonomies(array('public' => true, 'publicly_queryable' => true), 'objects', 'or');
166
  ?><div class="advads-conditions-single"><table>
167
+ <p class="description"><?php _e('Choose the terms from public categories, tags and other taxonomies on which\'s archive page ads can appear', ADVADS_SLUG); ?></p>
168
  <table><?php
169
  foreach($taxonomies as $_tax):
170
  if($_tax->name === 'advanced_ads_groups') continue; // exclude adv ads groups
193
  $_excludes = array();
194
  }
195
 
196
+ ?><h5 class="header"><?php _e('Hide from here', ADVADS_SLUG); ?></h5><p class="description"><?php _e('Choose the terms from public categories, tags and other taxonomies on which\'s archive pages ads are hidden.', ADVADS_SLUG); ?></p>
197
  <table><?php
198
  foreach($taxonomies as $_tax):
199
  if($_tax->name === 'advanced_ads_groups') continue; // exclude adv ads groups
admin/views/ad-display-metabox.php CHANGED
@@ -11,7 +11,7 @@ require_once(ADVADS_BASE_PATH . 'admin/includes/class-display-condition-callback
11
  </div>
12
  <div id="advanced-ad-conditions">
13
  <ul id="advads-how-it-works">
14
- <li><?php _e('If you want to display the ad everywhere, dont do anything here. ', ADVADS_SLUG); ?></li>
15
  <li><?php _e('The fewer conditions you enter, the better the performance will be.', ADVADS_SLUG); ?></li>
16
  <li><?php printf(__('Learn more about display conditions from the <a href="%s" target="_blank">manual</a>.', ADVADS_SLUG), 'http://wpadvancedads.com/advancedads/manual/display-conditions/'); ?></li>
17
  </ul>
11
  </div>
12
  <div id="advanced-ad-conditions">
13
  <ul id="advads-how-it-works">
14
+ <li><?php _e('If you want to display the ad everywhere, don\'t do anything here. ', ADVADS_SLUG); ?></li>
15
  <li><?php _e('The fewer conditions you enter, the better the performance will be.', ADVADS_SLUG); ?></li>
16
  <li><?php printf(__('Learn more about display conditions from the <a href="%s" target="_blank">manual</a>.', ADVADS_SLUG), 'http://wpadvancedads.com/advancedads/manual/display-conditions/'); ?></li>
17
  </ul>
admin/views/ad-group-ads-inline-form.php CHANGED
@@ -7,7 +7,7 @@
7
  <td><?php echo $_ad->post_title; ?></td>
8
  <td class="ad-group-ads-weight">
9
  <label>
10
- <span class="title"><?php _ex('weight', 'ad group ads form', Advanced_Ads::TD); ?></span>
11
  <select name="weight[<?php echo $_ad->ID; ?>]">
12
  <?php $ad_weight = (isset($weights[$_ad->ID])) ? $weights[$_ad->ID] : Advads_Ad_Group::MAX_AD_GROUP_WEIGHT; ?>
13
  <?php for($i = 0; $i <= Advads_Ad_Group::MAX_AD_GROUP_WEIGHT; $i++) : ?>
@@ -21,8 +21,8 @@
21
  </tbody>
22
  </table>
23
  <p class="inline-edit-save submit">
24
- <a href="#inline-edit" class="cancel button-secondary alignleft"><?php _e('Cancel', Advanced_Ads::TD); ?></a>
25
- <a href="#inline-edit" class="save button-primary alignright"><?php _e('Update', Advanced_Ads::TD); ?></a>
26
  <span class="spinner"></span>
27
  <?php wp_nonce_field('ad-groups-inline-edit-nonce', 'advads-ad-groups-inline-form-nonce', false); ?>
28
  <input type="hidden" name="taxonomy" value="<?php echo $group->id; ?>" />
@@ -30,5 +30,5 @@
30
  </p>
31
  </form>
32
  <?php else : ?>
33
- <p><?php _e('There are no ads in this group', Advanced_Ads::TD); ?></p>
34
  <?php endif; ?>
7
  <td><?php echo $_ad->post_title; ?></td>
8
  <td class="ad-group-ads-weight">
9
  <label>
10
+ <span class="title"><?php _ex('weight', 'ad group ads form', ADVADS_SLUG); ?></span>
11
  <select name="weight[<?php echo $_ad->ID; ?>]">
12
  <?php $ad_weight = (isset($weights[$_ad->ID])) ? $weights[$_ad->ID] : Advads_Ad_Group::MAX_AD_GROUP_WEIGHT; ?>
13
  <?php for($i = 0; $i <= Advads_Ad_Group::MAX_AD_GROUP_WEIGHT; $i++) : ?>
21
  </tbody>
22
  </table>
23
  <p class="inline-edit-save submit">
24
+ <a href="#inline-edit" class="cancel button-secondary alignleft"><?php _e('Cancel', ADVADS_SLUG); ?></a>
25
+ <a href="#inline-edit" class="save button-primary alignright"><?php _e('Update', ADVADS_SLUG); ?></a>
26
  <span class="spinner"></span>
27
  <?php wp_nonce_field('ad-groups-inline-edit-nonce', 'advads-ad-groups-inline-form-nonce', false); ?>
28
  <input type="hidden" name="taxonomy" value="<?php echo $group->id; ?>" />
30
  </p>
31
  </form>
32
  <?php else : ?>
33
+ <p><?php _e('There are no ads in this group', ADVADS_SLUG); ?></p>
34
  <?php endif; ?>
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.', $this->plugin_slug); ?></p></td>
41
  </tr>
42
  <?php } ?>
43
  <?php if (is_taxonomy_hierarchical($taxonomy)) : ?>
@@ -65,9 +65,9 @@ wp_nonce_field('update-group_' . $group_id); ?>
65
  do_action($taxonomy . '_edit_form', $tag, $taxonomy);
66
 
67
  if($group_id == 0){
68
- submit_button(__('Create new Ad Group', $this->plugin_slug));
69
  } else {
70
- submit_button(__('Update', $this->plugin_slug));
71
  }
72
  ?>
73
  </form>
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.', ADVADS_SLUG); ?></p></td>
41
  </tr>
42
  <?php } ?>
43
  <?php if (is_taxonomy_hierarchical($taxonomy)) : ?>
65
  do_action($taxonomy . '_edit_form', $tag, $taxonomy);
66
 
67
  if($group_id == 0){
68
+ submit_button(__('Create new Ad Group', ADVADS_SLUG));
69
  } else {
70
+ submit_button(__('Update', ADVADS_SLUG));
71
  }
72
  ?>
73
  </form>
admin/views/ad-group.php CHANGED
@@ -30,12 +30,12 @@ if (current_user_can($tax->cap->edit_terms)) {
30
 
31
  $messages[$taxonomy] = array(
32
  0 => '', // Unused. Messages start at index 1.
33
- 1 => __('Ad Group added.', $this->plugin_slug),
34
- 2 => __('Ad Group deleted.', $this->plugin_slug),
35
- 3 => __('Ad Group updated.', $this->plugin_slug),
36
- 4 => __('Ad Group not added.', $this->plugin_slug),
37
- 5 => __('Ad Group not updated.', $this->plugin_slug),
38
- 6 => __('Ad Group deleted.', $this->plugin_slug)
39
  );
40
 
41
  $message = false;
30
 
31
  $messages[$taxonomy] = array(
32
  0 => '', // Unused. Messages start at index 1.
33
+ 1 => __('Ad Group added.', ADVADS_SLUG),
34
+ 2 => __('Ad Group deleted.', ADVADS_SLUG),
35
+ 3 => __('Ad Group updated.', ADVADS_SLUG),
36
+ 4 => __('Ad Group not added.', ADVADS_SLUG),
37
+ 5 => __('Ad Group not updated.', ADVADS_SLUG),
38
+ 6 => __('Ad Group deleted.', ADVADS_SLUG)
39
  );
40
 
41
  $message = false;
admin/views/ad-main-metabox.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php $types = Advanced_Ads::get_instance()->ad_types; ?>
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
1
  <?php $types = Advanced_Ads::get_instance()->ad_types; ?>
2
  <?php if (empty($types)) : ?>
3
+ <p><?php _e('No ad types defined', ADVADS_SLUG); ?></p>
4
  <?php else : ?>
5
  <ul id="advanced-ad-type">
6
  <?php
admin/views/debug.php CHANGED
@@ -5,18 +5,18 @@
5
  ?>
6
 
7
  <div class="wrap">
8
- <h2 style="color:red;"><?php _e('Work in progress', $this->plugin_slug); ?></h2>
9
- <p><?php _e('This screen is work in progress. You can use the information if you understand them, but there is nothing to do here yet.', $this->plugin_slug); ?></p>
10
  <?php screen_icon(); ?>
11
  <h1><?php echo esc_html(get_admin_page_title()); ?></h1>
12
 
13
- <h2><?php _e('Settings', $this->plugin_slug); ?></h2>
14
  <pre><?php print_r($plugin_options); ?></pre>
15
 
16
- <h2><?php _e('Ad Condition Overview', $this->plugin_slug); ?></h2>
17
  <pre><?php print_r($ads_by_conditions); ?></pre>
18
 
19
- <h2><?php _e('Ad Placements', $this->plugin_slug); ?></h2>
20
  <pre><?php print_r($ad_placements); ?></pre>
21
 
22
  </div>
5
  ?>
6
 
7
  <div class="wrap">
8
+ <h2 style="color:red;"><?php _e('Work in progress', ADVADS_SLUG); ?></h2>
9
+ <p><?php _e('This screen is work in progress. You can use the information if you understand them, but there is nothing to do here yet.', ADVADS_SLUG); ?></p>
10
  <?php screen_icon(); ?>
11
  <h1><?php echo esc_html(get_admin_page_title()); ?></h1>
12
 
13
+ <h2><?php _e('Settings', ADVADS_SLUG); ?></h2>
14
  <pre><?php print_r($plugin_options); ?></pre>
15
 
16
+ <h2><?php _e('Ad Condition Overview', ADVADS_SLUG); ?></h2>
17
  <pre><?php print_r($ads_by_conditions); ?></pre>
18
 
19
+ <h2><?php _e('Ad Placements', ADVADS_SLUG); ?></h2>
20
  <pre><?php print_r($ad_placements); ?></pre>
21
 
22
  </div>
admin/views/placements.php CHANGED
@@ -45,9 +45,9 @@
45
  </form>
46
  <?php if (isset($placements) && is_array($placements)) : ?>
47
  <h2><?php _e('Placements', ADVADS_SLUG); ?></h2>
48
- <a onclick="advads_toggle('#advads-ad-place-display-info')"><?php _e('How to use the default Ad Placement?', ADVADS_SLUG); ?></a>
49
  <div id="advads-ad-place-display-info" style="display: none;">
50
- <p><?php printf(__('Examples on how to use the default ad placement? Find more help and examples in the <a href="%s" target="_blank">manual</a>', ADVADS_SLUG), 'http://wpadvancedads.com/advanced-ads/manual/placements/'); ?></p>
51
  <h4><?php _e('shortcode', ADVADS_SLUG); ?></h4>
52
  <p class="description"><?php _e('To use an ad placement with the ID skyscraper_left in content fields', ADVADS_SLUG); ?></p>
53
  <pre><input type="text" onclick="this.select();" style="width: 400px;" value='[the_ad_placement id="skyscraper_left"]'/></pre>
45
  </form>
46
  <?php if (isset($placements) && is_array($placements)) : ?>
47
  <h2><?php _e('Placements', ADVADS_SLUG); ?></h2>
48
+ <a onclick="advads_toggle('#advads-ad-place-display-info')"><?php _e('How to use the <i>default</i> Ad Placement?', ADVADS_SLUG); ?></a>
49
  <div id="advads-ad-place-display-info" style="display: none;">
50
+ <p><?php printf(__('Examples on how to use the <i>default</i> ad placement? Find more help and examples in the <a href="%s" target="_blank">manual</a>', ADVADS_SLUG), 'http://wpadvancedads.com/advanced-ads/manual/placements/'); ?></p>
51
  <h4><?php _e('shortcode', ADVADS_SLUG); ?></h4>
52
  <p class="description"><?php _e('To use an ad placement with the ID skyscraper_left in content fields', ADVADS_SLUG); ?></p>
53
  <pre><input type="text" onclick="this.select();" style="width: 400px;" value='[the_ad_placement id="skyscraper_left"]'/></pre>
admin/views/settings.php CHANGED
@@ -20,9 +20,9 @@
20
  </form>
21
  <hr/>
22
  <ul>
23
- <li><a href="/wp-admin/admin.php?page=advanced-ads-debug"><?php _e('Debug Page', $this->plugin_slug); ?></a></li>
24
- <li><a href="http://wordpress.org/plugins/advanced-ads/" title="<?php _e('Advanced Ads on WordPress.org', $this->plugin_slug); ?>"><?php _e('Advanced Ads on wp.org', $this->plugin_slug); ?></a></li>
25
- <li><a href="http://webgilde.com" title="<?php _e('the company behind Advanced Ads', $this->plugin_slug); ?>"><?php _e('webgilde GmbH', $this->plugin_slug); ?></a></li>
26
  </ul>
27
 
28
  </div>
20
  </form>
21
  <hr/>
22
  <ul>
23
+ <li><a href="/wp-admin/admin.php?page=advanced-ads-debug"><?php _e('Debug Page', ADVADS_SLUG); ?></a></li>
24
+ <li><a href="http://wordpress.org/plugins/advanced-ads/" title="<?php _e('Advanced Ads on WordPress.org', ADVADS_SLUG); ?>"><?php _e('Advanced Ads on wp.org', ADVADS_SLUG); ?></a></li>
25
+ <li><a href="http://webgilde.com" title="<?php _e('the company behind Advanced Ads', ADVADS_SLUG); ?>"><?php _e('webgilde GmbH', ADVADS_SLUG); ?></a></li>
26
  </ul>
27
 
28
  </div>
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.2.6
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.2.7
16
  * Author: Thomas Maier
17
  * Author URI: http://webgilde.com
18
  * Text Domain: advanced-ads
classes/ad.php CHANGED
@@ -651,7 +651,6 @@ class Advads_Ad {
651
 
652
  $plugin = Advanced_Ads::get_instance();
653
  $ads_by_conditions = $plugin->get_ads_by_conditions_array();
654
- $plugin_slug = $plugin->get_plugin_slug();
655
 
656
  // remove current ad from general ad condition array
657
  $ads_by_conditions = $this->remove_ad_from_general_ad_conditions($this->id, $ads_by_conditions);
@@ -661,7 +660,7 @@ class Advads_Ad {
661
  // iterate through the ads display condition
662
  foreach($conditions as $_condition_key => $_condition){
663
  if(!isset($advanced_ads_ad_conditions[$_condition_key]['type'])) {
664
- $plugin->log(sprintf(__('A "%s" display condition does not exist', $plugin_slug), $_condition_key));
665
  return;
666
  }
667
  // add conditions based on type
651
 
652
  $plugin = Advanced_Ads::get_instance();
653
  $ads_by_conditions = $plugin->get_ads_by_conditions_array();
 
654
 
655
  // remove current ad from general ad condition array
656
  $ads_by_conditions = $this->remove_ad_from_general_ad_conditions($this->id, $ads_by_conditions);
660
  // iterate through the ads display condition
661
  foreach($conditions as $_condition_key => $_condition){
662
  if(!isset($advanced_ads_ad_conditions[$_condition_key]['type'])) {
663
+ $plugin->log(sprintf(__('A "%s" display condition does not exist', ADVADS_SLUG), $_condition_key));
664
  return;
665
  }
666
  // add conditions based on type
classes/ad_placements.php CHANGED
@@ -71,7 +71,7 @@ class Advads_Ad_Placements {
71
 
72
  // check if slug already exists
73
  if ($new_placement['slug'] == '')
74
- return __('Slug cant be empty.', ADVADS_SLUG);
75
  if (isset($placements[$new_placement['slug']]))
76
  return __('Slug already exists.', ADVADS_SLUG);
77
 
71
 
72
  // check if slug already exists
73
  if ($new_placement['slug'] == '')
74
+ return __('Slug can\'t be empty.', ADVADS_SLUG);
75
  if (isset($placements[$new_placement['slug']]))
76
  return __('Slug already exists.', ADVADS_SLUG);
77
 
classes/ad_type_content.php CHANGED
@@ -32,8 +32,8 @@ class Advads_Ad_Type_Content extends Advads_Ad_Type_Abstract{
32
  * @since 1.0.0
33
  */
34
  public function __construct() {
35
- $this->title = __('Rich Content', Advanced_Ads::TD);
36
- $this->description = __('The full content editor from WordPress with all features like image upload or styling, but also simple text/html mode for scripts and code.', Advanced_Ads::TD);
37
  $this->parameters = array(
38
  'content' => ''
39
  );
32
  * @since 1.0.0
33
  */
34
  public function __construct() {
35
+ $this->title = __('Rich Content', ADVADS_SLUG);
36
+ $this->description = __('The full content editor from WordPress with all features like image upload or styling, but also simple text/html mode for scripts and code.', ADVADS_SLUG);
37
  $this->parameters = array(
38
  'content' => ''
39
  );
classes/ad_type_plain.php CHANGED
@@ -28,8 +28,8 @@ class Advads_Ad_Type_Plain extends Advads_Ad_Type_Abstract{
28
  * @since 1.0.0
29
  */
30
  public function __construct() {
31
- $this->title = __('Plain Text and Code', Advanced_Ads::TD);
32
- $this->description = __('Simple text editor without any filters. You might use it to display unfiltered content, php code or javascript. Shortcodes and other WordPress content field magic does not work here.', Advanced_Ads::TD);
33
  $this->parameters = array(
34
  'content' => ''
35
  );
@@ -52,7 +52,7 @@ class Advads_Ad_Type_Plain extends Advads_Ad_Type_Abstract{
52
  * build the tinymc editor
53
  * @link http://codex.wordpress.org/Function_Reference/wp_editor
54
  */
55
- ?><p class="description"><?php _e('Insert plain text or code into this field.', Advanced_Ads::TD); ?></p>
56
  <textarea id="advads-ad-content-plain" cols="40" rows="10" name="advanced_ad[content]"><?php echo $content; ?></textarea>
57
  <?php
58
  }
28
  * @since 1.0.0
29
  */
30
  public function __construct() {
31
+ $this->title = __('Plain Text and Code', ADVADS_SLUG);
32
+ $this->description = __('Simple text editor without any filters. You might use it to display unfiltered content, php code or javascript. Shortcodes and other WordPress content field magic does not work here.', ADVADS_SLUG);
33
  $this->parameters = array(
34
  'content' => ''
35
  );
52
  * build the tinymc editor
53
  * @link http://codex.wordpress.org/Function_Reference/wp_editor
54
  */
55
+ ?><p class="description"><?php _e('Insert plain text or code into this field.', ADVADS_SLUG); ?></p>
56
  <textarea id="advads-ad-content-plain" cols="40" rows="10" name="advanced_ad[content]"><?php echo $content; ?></textarea>
57
  <?php
58
  }
includes/array_ad_conditions.php CHANGED
@@ -49,32 +49,32 @@ $advanced_ads_ad_conditions = array(
49
  ),
50
  'is_front_page' => array(
51
  'label' => __('Home Page', $advanced_ads_slug),
52
- 'description' => __('(dont) show on Home page', $advanced_ads_slug),
53
  'type' => 'radio',
54
  ),
55
  'is_singular' => array(
56
  'label' => __('Singular Pages', $advanced_ads_slug),
57
- 'description' => __('(dont) show on singular pages/posts', $advanced_ads_slug),
58
  'type' => 'radio',
59
  ),
60
  'is_archive' => array(
61
  'label' => __('Archive Pages', $advanced_ads_slug),
62
- 'description' => __('(dont) show on any type of archive page (category, tag, author and date)', $advanced_ads_slug),
63
  'type' => 'radio',
64
  ),
65
  'is_search' => array(
66
  'label' => __('Search Results', $advanced_ads_slug),
67
- 'description' => __('(dont) show on search result pages', $advanced_ads_slug),
68
  'type' => 'radio',
69
  ),
70
  'is_404' => array(
71
  'label' => __('404 Page', $advanced_ads_slug),
72
- 'description' => __('(dont) show on 404 error page', $advanced_ads_slug),
73
  'type' => 'radio',
74
  ),
75
  'is_attachment' => array(
76
  'label' => __('Attachment Pages', $advanced_ads_slug),
77
- 'description' => __('(dont) show on attachment pages', $advanced_ads_slug),
78
  'type' => 'radio',
79
  )
80
  );
49
  ),
50
  'is_front_page' => array(
51
  'label' => __('Home Page', $advanced_ads_slug),
52
+ 'description' => __('(don\'t) show on Home page', $advanced_ads_slug),
53
  'type' => 'radio',
54
  ),
55
  'is_singular' => array(
56
  'label' => __('Singular Pages', $advanced_ads_slug),
57
+ 'description' => __('(don\'t) show on singular pages/posts', $advanced_ads_slug),
58
  'type' => 'radio',
59
  ),
60
  'is_archive' => array(
61
  'label' => __('Archive Pages', $advanced_ads_slug),
62
+ 'description' => __('(don\'t) show on any type of archive page (category, tag, author and date)', $advanced_ads_slug),
63
  'type' => 'radio',
64
  ),
65
  'is_search' => array(
66
  'label' => __('Search Results', $advanced_ads_slug),
67
+ 'description' => __('(don\'t) show on search result pages', $advanced_ads_slug),
68
  'type' => 'radio',
69
  ),
70
  'is_404' => array(
71
  'label' => __('404 Page', $advanced_ads_slug),
72
+ 'description' => __('(don\'t) show on 404 error page', $advanced_ads_slug),
73
  'type' => 'radio',
74
  ),
75
  'is_attachment' => array(
76
  'label' => __('Attachment Pages', $advanced_ads_slug),
77
+ 'description' => __('(don\'t) show on attachment pages', $advanced_ads_slug),
78
  'type' => 'radio',
79
  )
80
  );
public/class-advanced-ads.php CHANGED
@@ -25,7 +25,7 @@ class Advanced_Ads {
25
  * @var string
26
  */
27
 
28
- const VERSION = '1.2.6';
29
 
30
  /**
31
  * post type slug
@@ -35,14 +35,6 @@ class Advanced_Ads {
35
  */
36
  const POST_TYPE_SLUG = 'advanced_ads';
37
 
38
- /**
39
- * text domain
40
- *
41
- * @since 1.0.0
42
- * @var string
43
- */
44
- const TD = 'advanced-ads';
45
-
46
  /**
47
  * ad group slug
48
  *
@@ -93,7 +85,7 @@ class Advanced_Ads {
93
  private function __construct() {
94
 
95
  // Load plugin text domain
96
- add_action('init', array($this, 'load_plugin_textdomain'));
97
 
98
  // activate plugin when new blog is added on multisites
99
  add_action('wpmu_new_blog', array($this, 'activate_new_site'));
@@ -291,10 +283,9 @@ class Advanced_Ads {
291
  */
292
  public function load_plugin_textdomain() {
293
 
294
- $domain = self::TD;
295
- $locale = apply_filters('advanced-ads-plugin-locale', get_locale(), $domain);
296
 
297
- load_textdomain($domain, trailingslashit(WP_LANG_DIR) . $domain . '/' . $domain . '-' . $locale . '.mo');
298
  }
299
 
300
  /**
@@ -486,18 +477,18 @@ class Advanced_Ads {
486
  */
487
  protected function get_group_taxonomy_params(){
488
  $labels = array(
489
- 'name' => _x('Ad Groups', 'ad group general name', $this->plugin_slug),
490
- 'singular_name' => _x('Ad Group', 'ad group singular name', $this->plugin_slug),
491
- 'search_items' => __('Search Ad Groups', $this->plugin_slug),
492
- 'all_items' => __('All Ad Groups', $this->plugin_slug),
493
- 'parent_item' => __('Parent Ad Groups', $this->plugin_slug),
494
- 'parent_item_colon' => __('Parent Ad Groups:', $this->plugin_slug),
495
- 'edit_item' => __('Edit Ad Group', $this->plugin_slug),
496
- 'update_item' => __('Update Ad Group', $this->plugin_slug),
497
- 'add_new_item' => __('Add New Ad Group', $this->plugin_slug),
498
- 'new_item_name' => __('New Ad Groups Name', $this->plugin_slug),
499
- 'menu_name' => __('Groups', $this->plugin_slug),
500
- 'not_found' => __('No Ad Group found', $this->plugin_slug),
501
  );
502
 
503
  $args = array(
@@ -522,31 +513,31 @@ class Advanced_Ads {
522
  */
523
  protected function get_post_type_params() {
524
  $labels = array(
525
- 'name' => __('Ads', $this->plugin_slug),
526
- 'singular_name' => __('Ad', $this->plugin_slug),
527
- 'add_new' => 'New Ad',
528
- 'add_new_item' => __('Add New Ad', $this->plugin_slug),
529
- 'edit' => __('Edit', $this->plugin_slug),
530
- 'edit_item' => __('Edit Ad', $this->plugin_slug),
531
- 'new_item' => __('New Ad', $this->plugin_slug),
532
- 'view' => __('View', $this->plugin_slug),
533
- 'view_item' => __('View the Ad', $this->plugin_slug),
534
- 'search_items' => __('Search Ads', $this->plugin_slug),
535
- 'not_found' => __('No Ads found', $this->plugin_slug),
536
- 'not_found_in_trash' => __('No Ads found in Trash', $this->plugin_slug),
537
- 'parent' => __('Parent Ad', $this->plugin_slug),
538
  );
539
 
540
  $post_type_params = array(
541
  'labels' => $labels,
542
- 'singular_label' => __('Ad', $this->plugin_slug),
543
  'public' => false,
544
  'show_ui' => true,
545
  'show_in_menu' => false,
546
  'hierarchical' => false,
547
  'capability_type' => 'page',
548
  'has_archive' => false,
549
- 'rewrite' => array('slug' => $this->plugin_slug),
550
  'query_var' => true,
551
  'supports' => array('title'),
552
  'taxonomies' => array(self::AD_GROUP_TAXONOMY)
@@ -587,10 +578,10 @@ class Advanced_Ads {
587
  public function log($message) {
588
  if (WP_DEBUG === true) {
589
  if (is_array($message) || is_object($message)) {
590
- error_log('Advanced Ads Error following:', $this->plugin_slug);
591
  error_log(print_r($message, true));
592
  } else {
593
- $message = sprintf(__('Advanced Ads Error: %s', $this->plugin_slug), $message);
594
  error_log($message);
595
  }
596
  }
25
  * @var string
26
  */
27
 
28
+ const VERSION = '1.2.7';
29
 
30
  /**
31
  * post type slug
35
  */
36
  const POST_TYPE_SLUG = 'advanced_ads';
37
 
 
 
 
 
 
 
 
 
38
  /**
39
  * ad group slug
40
  *
85
  private function __construct() {
86
 
87
  // Load plugin text domain
88
+ add_action('plugins_loaded', array($this, 'load_plugin_textdomain'));
89
 
90
  // activate plugin when new blog is added on multisites
91
  add_action('wpmu_new_blog', array($this, 'activate_new_site'));
283
  */
284
  public function load_plugin_textdomain() {
285
 
286
+ // $locale = apply_filters('advanced-ads-plugin-locale', get_locale(), $domain);
 
287
 
288
+ load_plugin_textdomain(ADVADS_SLUG, false, 'advanced-ads/languages');
289
  }
290
 
291
  /**
477
  */
478
  protected function get_group_taxonomy_params(){
479
  $labels = array(
480
+ 'name' => _x('Ad Groups', 'ad group general name', ADVADS_SLUG),
481
+ 'singular_name' => _x('Ad Group', 'ad group singular name', ADVADS_SLUG),
482
+ 'search_items' => __('Search Ad Groups', ADVADS_SLUG),
483
+ 'all_items' => __('All Ad Groups', ADVADS_SLUG),
484
+ 'parent_item' => __('Parent Ad Groups', ADVADS_SLUG),
485
+ 'parent_item_colon' => __('Parent Ad Groups:', ADVADS_SLUG),
486
+ 'edit_item' => __('Edit Ad Group', ADVADS_SLUG),
487
+ 'update_item' => __('Update Ad Group', ADVADS_SLUG),
488
+ 'add_new_item' => __('Add New Ad Group', ADVADS_SLUG),
489
+ 'new_item_name' => __('New Ad Groups Name', ADVADS_SLUG),
490
+ 'menu_name' => __('Groups', ADVADS_SLUG),
491
+ 'not_found' => __('No Ad Group found', ADVADS_SLUG),
492
  );
493
 
494
  $args = array(
513
  */
514
  protected function get_post_type_params() {
515
  $labels = array(
516
+ 'name' => __('Ads', ADVADS_SLUG),
517
+ 'singular_name' => __('Ad', ADVADS_SLUG),
518
+ 'add_new' => __('New Ad', ADVADS_SLUG),
519
+ 'add_new_item' => __('Add New Ad', ADVADS_SLUG),
520
+ 'edit' => __('Edit', ADVADS_SLUG),
521
+ 'edit_item' => __('Edit Ad', ADVADS_SLUG),
522
+ 'new_item' => __('New Ad', ADVADS_SLUG),
523
+ 'view' => __('View', ADVADS_SLUG),
524
+ 'view_item' => __('View the Ad', ADVADS_SLUG),
525
+ 'search_items' => __('Search Ads', ADVADS_SLUG),
526
+ 'not_found' => __('No Ads found', ADVADS_SLUG),
527
+ 'not_found_in_trash' => __('No Ads found in Trash', ADVADS_SLUG),
528
+ 'parent' => __('Parent Ad', ADVADS_SLUG),
529
  );
530
 
531
  $post_type_params = array(
532
  'labels' => $labels,
533
+ 'singular_label' => __('Ad', ADVADS_SLUG),
534
  'public' => false,
535
  'show_ui' => true,
536
  'show_in_menu' => false,
537
  'hierarchical' => false,
538
  'capability_type' => 'page',
539
  'has_archive' => false,
540
+ 'rewrite' => array('slug' => ADVADS_SLUG),
541
  'query_var' => true,
542
  'supports' => array('title'),
543
  'taxonomies' => array(self::AD_GROUP_TAXONOMY)
578
  public function log($message) {
579
  if (WP_DEBUG === true) {
580
  if (is_array($message) || is_object($message)) {
581
+ error_log('Advanced Ads Error following:', ADVADS_SLUG);
582
  error_log(print_r($message, true));
583
  } else {
584
+ $message = sprintf(__('Advanced Ads Error: %s', ADVADS_SLUG), $message);
585
  error_log($message);
586
  }
587
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id
4
  Tags: ads, ad, adsense, display, banner, advertisements, adverts, advert, monetization
5
  Requires at least: WP 3.5, PHP 5.3
6
  Tested up to: 4.0.0
7
- Stable tag: 1.2.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -36,10 +36,10 @@ Learn more on the [plugin homepage](http://wpadvancedads.com).
36
 
37
  deliver ads based on conditions like
38
 
 
39
  * post type
40
- * post id
41
- * category
42
- * single, category and archive pages
43
  * special page types like 404, attachment and front page
44
 
45
  = visitor conditions =
@@ -134,6 +134,12 @@ There is no revenue share. Advanced Ads doesn’t alter your ad codes in a way t
134
 
135
  == Changelog ==
136
 
 
 
 
 
 
 
137
  = 1.2.6 =
138
 
139
  * layout updates to display condition box
4
  Tags: ads, ad, adsense, display, banner, advertisements, adverts, advert, monetization
5
  Requires at least: WP 3.5, PHP 5.3
6
  Tested up to: 4.0.0
7
+ Stable tag: 1.2.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
36
 
37
  deliver ads based on conditions like
38
 
39
+ * individual posts, pages and other post type
40
  * post type
41
+ * posts by category, tags, taxonomies
42
+ * archive pages by category, tags, taxonomies
 
43
  * special page types like 404, attachment and front page
44
 
45
  = visitor conditions =
134
 
135
  == Changelog ==
136
 
137
+ = 1.2.7 =
138
+
139
+ * fixed translation files (thanks to sangkavr)
140
+ * fixed inconsistent text domains
141
+ * started with German translation
142
+
143
  = 1.2.6 =
144
 
145
  * layout updates to display condition box