Advanced Ads - Version 1.7.8

Version Description

  • prevent any ad container output in the header
  • show advertisement label also for manually placed ads
  • fixed AdSense slot ID when delivered through cache-busting
  • fixed reserved place option not working after image upload
  • fixed placement type display
  • fixed missing translation for show/hide options
Download this release

Release Info

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

Code changes from version 1.7.7 to 1.7.8

admin/assets/css/admin.css CHANGED
@@ -193,11 +193,11 @@ fieldset.advads-group-add-ad { margin-top: 1em; }
193
  AD PLACEMENTS
194
  */
195
  .advads-placement-description { display: none; }
196
- .advads-placements-new-form .advads-placement-type { position: relative; top: 0; left: 0; float: left; }
197
  .advads-placements-new-form .advads-placement-type .ui-button { background: none; border-radius: 0; height: auto; }
198
  .advads-placements-new-form .advads-placement-type .ui-button-text { padding: 0; width: 140px; height: 105px; border: solid 1px #0085ba; border-radius: 3px; box-shadow: 0px 0px 2px #0085ba; overflow: hidden; }
199
  .advads-placements-new-form .advads-placement-type .ui-button-text img { max-width: 100%; pointer-events: none; }
200
- .advads-placements-new-form .advads-placement-type label { display: inline-block; width: 140px; text-align: center; border: 0; padding: 10px; }
201
  .advads-placements-new-form .advads-placement-type label .description { padding: 10px; }
202
  .advads-placements-new-form .advads-error-message { display: none; }
203
  .advads-placements-table { min-width: 80%; border-collapse: collapse; background: #fff; }
193
  AD PLACEMENTS
194
  */
195
  .advads-placement-description { display: none; }
196
+ .advads-placements-new-form .advads-placement-type { position: relative; top: 0; left: 0; float: left; margin: 10px 10px 0; }
197
  .advads-placements-new-form .advads-placement-type .ui-button { background: none; border-radius: 0; height: auto; }
198
  .advads-placements-new-form .advads-placement-type .ui-button-text { padding: 0; width: 140px; height: 105px; border: solid 1px #0085ba; border-radius: 3px; box-shadow: 0px 0px 2px #0085ba; overflow: hidden; }
199
  .advads-placements-new-form .advads-placement-type .ui-button-text img { max-width: 100%; pointer-events: none; }
200
+ .advads-placements-new-form .advads-placement-type label { display: inline-block; width: 140px; text-align: center; border: 0; padding: 0; }
201
  .advads-placements-new-form .advads-placement-type label .description { padding: 10px; }
202
  .advads-placements-new-form .advads-error-message { display: none; }
203
  .advads-placements-table { min-width: 80%; border-collapse: collapse; background: #fff; }
admin/assets/js/admin.js CHANGED
@@ -416,6 +416,8 @@ jQuery( document ).ready(function ($) {
416
  '" title="'+ attachment.title +'" alt="'+ attachment.alt +'" src="'+ attachment.url +'"/>';
417
  $('#advads-image-preview').html( new_image );
418
  $('#advads-image-edit-link').attr( 'href', attachment.editLink );
 
 
419
  }
420
  });
421
  });
416
  '" title="'+ attachment.title +'" alt="'+ attachment.alt +'" src="'+ attachment.url +'"/>';
417
  $('#advads-image-preview').html( new_image );
418
  $('#advads-image-edit-link').attr( 'href', attachment.editLink );
419
+ // process "reserve this space" checkbox
420
+ $( '#advanced-ads-ad-parameters-size input[type=number]:first' ).change();
421
  }
422
  });
423
  });
admin/class-advanced-ads-admin.php CHANGED
@@ -319,6 +319,10 @@ class Advanced_Ads_Admin {
319
  return __( 'Please enter a valid license key', 'advanced-ads' );
320
  }
321
 
 
 
 
 
322
  // check if license was already activated and abort activation if so
323
  /*if( $this->check_license($license_key, $plugin_name, $options_slug)){
324
  return 1;
@@ -394,6 +398,10 @@ class Advanced_Ads_Admin {
394
  */
395
  public function check_license( $license_key = '', $plugin_name = '', $options_slug = '' ){
396
 
 
 
 
 
397
  $api_params = array(
398
  'edd_action' => 'check_license',
399
  'license' => $license_key,
@@ -425,11 +433,15 @@ class Advanced_Ads_Admin {
425
 
426
  if ( '' === $addon || '' === $plugin_name || '' === $options_slug ) {
427
  return __( 'Error while trying to disable the license. Please contact support.', 'advanced-ads' );
428
- }
429
 
430
  $licenses = $this->get_licenses();
431
  $license_key = isset($licenses[$addon]) ? $licenses[$addon] : '';
432
 
 
 
 
 
433
  $api_params = array(
434
  'edd_action' => 'deactivate_license',
435
  'license' => $license_key,
319
  return __( 'Please enter a valid license key', 'advanced-ads' );
320
  }
321
 
322
+ if ( has_filter( 'advanced_ads_license_'. $options_slug ) ) {
323
+ return apply_filters( 'advanced_ads_license_' . $options_slug, false, __METHOD__, $plugin_name, $options_slug, $license_key );
324
+ }
325
+
326
  // check if license was already activated and abort activation if so
327
  /*if( $this->check_license($license_key, $plugin_name, $options_slug)){
328
  return 1;
398
  */
399
  public function check_license( $license_key = '', $plugin_name = '', $options_slug = '' ){
400
 
401
+ if ( has_filter( 'advanced_ads_license_'. $options_slug ) ) {
402
+ return apply_filters( 'advanced_ads_license_' . $options_slug, false, __METHOD__, $plugin_name, $options_slug, $license_key );
403
+ }
404
+
405
  $api_params = array(
406
  'edd_action' => 'check_license',
407
  'license' => $license_key,
433
 
434
  if ( '' === $addon || '' === $plugin_name || '' === $options_slug ) {
435
  return __( 'Error while trying to disable the license. Please contact support.', 'advanced-ads' );
436
+ }
437
 
438
  $licenses = $this->get_licenses();
439
  $license_key = isset($licenses[$addon]) ? $licenses[$addon] : '';
440
 
441
+ if ( has_filter( 'advanced_ads_license_'. $options_slug ) ) {
442
+ return apply_filters( 'advanced_ads_license_' . $options_slug, false, __METHOD__, $plugin_name, $options_slug, $license_key );
443
+ }
444
+
445
  $api_params = array(
446
  'edd_action' => 'deactivate_license',
447
  'license' => $license_key,
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.7.7
16
  * Author: Thomas Maier
17
  * Author URI: http://webgilde.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, textdomain
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
- define( 'ADVADS_VERSION', '1.7.7' );
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.7.8
16
  * Author: Thomas Maier
17
  * Author URI: http://webgilde.com
18
  * Text Domain: advanced-ads
39
  // general and global slug, e.g. to store options in WP, textdomain
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
+ define( 'ADVADS_VERSION', '1.7.8' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
classes/ad.php CHANGED
@@ -766,7 +766,10 @@ class Advanced_Ads_Ad {
766
  $wrapper['style']['height'] = intval( $this->height ) . 'px';
767
  }
768
 
769
- $wrapper['data-id'] = $this->id;
 
 
 
770
 
771
  return $wrapper;
772
  }
@@ -866,7 +869,7 @@ class Advanced_Ads_Ad {
866
  * @return str $output
867
  */
868
  public function maybe_add_label( &$output ) {
869
- if ( isset( $this->args['placement_type'] ) && $this->args['placement_type'] !== 'header' &&
870
  $this->type !== 'group' &&
871
  $label = Advanced_Ads::get_instance()->get_label()
872
  ) {
766
  $wrapper['style']['height'] = intval( $this->height ) . 'px';
767
  }
768
 
769
+ // exclude the 'Header Code' placement type
770
+ if ( ! isset( $this->args['placement_type'] ) || ! 'post_top' === $this->args['placement_type'] ) {
771
+ $wrapper['data-id'] = $this->id;
772
+ }
773
 
774
  return $wrapper;
775
  }
869
  * @return str $output
870
  */
871
  public function maybe_add_label( &$output ) {
872
+ if ( ! ( isset( $this->args['placement_type'] ) && $this->args['placement_type'] === 'header' ) &&
873
  $this->type !== 'group' &&
874
  $label = Advanced_Ads::get_instance()->get_label()
875
  ) {
classes/display-conditions.php CHANGED
@@ -201,8 +201,8 @@ class Advanced_Ads_Display_Conditions {
201
  // options
202
  ?><input type="hidden" name="<?php echo $name; ?>[type]" value="<?php echo $options['type']; ?>"/>
203
  <select name="<?php echo $name; ?>[operator]">
204
- <option value="is" <?php selected('is', $operator); ?>><?php _e('show'); ?></option>
205
- <option value="is_not" <?php selected('is_not', $operator); ?>><?php _e('hide'); ?></option>
206
  </select><?php
207
 
208
  // set defaults
@@ -246,8 +246,8 @@ class Advanced_Ads_Display_Conditions {
246
  $name = self::FORM_NAME . '[' . $index . ']';
247
  ?><input type="hidden" name="<?php echo $name; ?>[type]" value="<?php echo $options['type']; ?>"/>
248
  <select name="<?php echo $name; ?>[operator]">
249
- <option value="is" <?php selected('is', $operator); ?>><?php _e('show'); ?></option>
250
- <option value="is_not" <?php selected('is_not', $operator); ?>><?php _e('hide'); ?></option>
251
  </select><?php
252
  // set defaults
253
  $authors = get_users(array('who' => 'authors', 'orderby' => 'nicename', 'number' => 50));
@@ -299,8 +299,8 @@ class Advanced_Ads_Display_Conditions {
299
  $name = self::FORM_NAME . '[' . $index . ']';
300
  ?><input type="hidden" name="<?php echo $name; ?>[type]" value="<?php echo $options['type']; ?>"/>
301
  <select name="<?php echo $name; ?>[operator]">
302
- <option value="is" <?php selected('is', $operator); ?>><?php _e('show'); ?></option>
303
- <option value="is_not" <?php selected('is_not', $operator); ?>><?php _e('hide'); ?></option>
304
  </select><?php
305
  ?><div class="advads-conditions-single advads-buttonset"><?php
306
  self::display_term_list($taxonomy, $values, $name . '[value][]', $max_terms, $index);
@@ -374,8 +374,8 @@ class Advanced_Ads_Display_Conditions {
374
  $name = self::FORM_NAME . '[' . $index . ']';
375
  ?><input type="hidden" name="<?php echo $name; ?>[type]" value="<?php echo $options['type']; ?>"/>
376
  <select name="<?php echo $name; ?>[operator]">
377
- <option value="is" <?php selected('is', $operator); ?>><?php _e('show'); ?></option>
378
- <option value="is_not" <?php selected('is_not', $operator); ?>><?php _e('hide'); ?></option>
379
  </select><?php ?><div class="advads-conditions-single advads-buttonset advads-conditions-postid-buttons"><?php
380
  // query active post ids
381
  if ($values != array()) {
201
  // options
202
  ?><input type="hidden" name="<?php echo $name; ?>[type]" value="<?php echo $options['type']; ?>"/>
203
  <select name="<?php echo $name; ?>[operator]">
204
+ <option value="is" <?php selected('is', $operator); ?>><?php _e('show', 'advanced-ads'); ?></option>
205
+ <option value="is_not" <?php selected('is_not', $operator); ?>><?php _e('hide', 'advanced-ads' ); ?></option>
206
  </select><?php
207
 
208
  // set defaults
246
  $name = self::FORM_NAME . '[' . $index . ']';
247
  ?><input type="hidden" name="<?php echo $name; ?>[type]" value="<?php echo $options['type']; ?>"/>
248
  <select name="<?php echo $name; ?>[operator]">
249
+ <option value="is" <?php selected('is', $operator); ?>><?php _e('show', 'advanced-ads'); ?></option>
250
+ <option value="is_not" <?php selected('is_not', $operator); ?>><?php _e('hide', 'advanced-ads'); ?></option>
251
  </select><?php
252
  // set defaults
253
  $authors = get_users(array('who' => 'authors', 'orderby' => 'nicename', 'number' => 50));
299
  $name = self::FORM_NAME . '[' . $index . ']';
300
  ?><input type="hidden" name="<?php echo $name; ?>[type]" value="<?php echo $options['type']; ?>"/>
301
  <select name="<?php echo $name; ?>[operator]">
302
+ <option value="is" <?php selected('is', $operator); ?>><?php _e('show', 'advanced-ads'); ?></option>
303
+ <option value="is_not" <?php selected('is_not', $operator); ?>><?php _e('hide', 'advanced-ads'); ?></option>
304
  </select><?php
305
  ?><div class="advads-conditions-single advads-buttonset"><?php
306
  self::display_term_list($taxonomy, $values, $name . '[value][]', $max_terms, $index);
374
  $name = self::FORM_NAME . '[' . $index . ']';
375
  ?><input type="hidden" name="<?php echo $name; ?>[type]" value="<?php echo $options['type']; ?>"/>
376
  <select name="<?php echo $name; ?>[operator]">
377
+ <option value="is" <?php selected('is', $operator); ?>><?php _e('show', 'advanced-ads'); ?></option>
378
+ <option value="is_not" <?php selected('is_not', $operator); ?>><?php _e('hide', 'advanced-ads'); ?></option>
379
  </select><?php ?><div class="advads-conditions-single advads-buttonset advads-conditions-postid-buttons"><?php
380
  // query active post ids
381
  if ($values != array()) {
modules/gadsense/includes/class-ad-type-adsense.php CHANGED
@@ -161,13 +161,13 @@ class Advanced_Ads_Ad_Type_Adsense extends Advanced_Ads_Ad_Type_Abstract {
161
  }
162
 
163
  //check if passive cb is used
164
- if ( isset( $gadsense['adsense_count'] ) && $ad->global_output ) {
165
  $gadsense['adsense_count']++;
166
  } else {
167
  $gadsense['adsense_count'] = 1;
168
  }
169
 
170
- if ( $limit_per_page && 3 < $gadsense['adsense_count'] ) {
171
  // The maximum allowed adSense ad per page count is 3 (according to the current Google AdSense TOS).
172
  return '';
173
  }
161
  }
162
 
163
  //check if passive cb is used
164
+ if ( isset( $gadsense['adsense_count'] ) ) {
165
  $gadsense['adsense_count']++;
166
  } else {
167
  $gadsense['adsense_count'] = 1;
168
  }
169
 
170
+ if ( $limit_per_page && 3 < $gadsense['adsense_count'] && $ad->global_output ) {
171
  // The maximum allowed adSense ad per page count is 3 (according to the current Google AdSense TOS).
172
  return '';
173
  }
modules/marketpress-license/admin.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Module Name: MarketPress License
5
+ * Description: Advanced Ads - License Management by MarketPress GmbH - admin.php
6
+ * Author: MarketPress
7
+ * Version: 1.0
8
+ * License: GPLv3
9
+ * Author URI: https://marketpress.com
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly
14
+ }
15
+
16
+ if ( class_exists( 'Advanced_Ads', false ) ) {
17
+
18
+ add_action( 'admin_init', 'marketpress_advanced_ads_license_settings_field', 20 );
19
+
20
+ /**
21
+ * Add settings section
22
+ *
23
+ * @wp-hook admin_init
24
+ * @return void
25
+ */
26
+ function marketpress_advanced_ads_license_settings_field() {
27
+
28
+ $add_ons = apply_filters( 'advanced-ads-add-ons', array() );
29
+
30
+ if ( count( $add_ons ) >= 1 ) {
31
+
32
+ register_setting( 'marketpress-advanced-ads', 'marketpress-advanced-ads' );
33
+ register_setting( 'marketpress-advanced-ads-license', 'marketpress-advanced-ads-license' );
34
+
35
+ add_settings_field(
36
+ 'marketpress-license', __( 'MarketPress Bundle License', 'advanced-ads' ), 'render_settings_marketpress_license_callback', 'advanced-ads-settings-license-page', 'advanced_ads_settings_license_section'
37
+ );
38
+
39
+ }
40
+
41
+ }
42
+
43
+ /**
44
+ * Render MarketPress License settings field
45
+ *
46
+ * @add_settings_field
47
+ * @return void
48
+ */
49
+ function render_settings_marketpress_license_callback() {
50
+
51
+ ?><style>
52
+ div#licenses table tr:first-of-type td span.advads-license-activate-error a { display: none; }
53
+ </style>
54
+ <?php
55
+ $licenses = get_option( ADVADS_SLUG . '-licenses', array() );
56
+ $license_key = isset( $licenses[ 'marketpress-advanced-ads' ] ) ? $licenses[ 'marketpress-advanced-ads' ] : '';
57
+ $license_status = get_option( 'marketpress-advanced-ads-license-status', false );
58
+
59
+ $index = 'marketpress-advanced-ads';
60
+ $plugin_name = 'MarketPress Advanced Ads';
61
+ $options_slug = 'marketpress-advanced-ads';
62
+ $plugin_url = 'https://marketpress.com/shop/plugins/advanced-ads';
63
+
64
+ // template in main plugin
65
+ include ADVADS_BASE_PATH . 'admin/views/setting-license.php';
66
+
67
+ ?>
68
+ <tr>
69
+ <th></th>
70
+ <td style="font-style: italic; margin: 0; padding-top: 0;"><?php echo __( 'Enter your key here, if you have purchased the bundle through MarketPress.', 'advanced-ads' ); ?></td>
71
+ </tr>
72
+
73
+ <?php
74
+
75
+ }
76
+
77
+ }
modules/marketpress-license/config.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Module Name: MarketPress License
4
+ * Description: Advanced Ads - License Management by MarketPress GmbH - config.php
5
+ * Author: MarketPress
6
+ * Version: 1.0
7
+ * License: GPLv3
8
+ * Author URI: https://marketpress.com
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly
13
+ }
14
+
15
+ // module configuration
16
+
17
+ return array(
18
+ 'textdomain' => 'marketpress-license',
19
+ );
modules/marketpress-license/main.php ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Module Name: MarketPress License
4
+ * Description: Advanced Ads - License Management by MarketPress GmbH - main.php
5
+ * Author: MarketPress
6
+ * Version: 1.0
7
+ * License: GPLv3
8
+ * Author URI: https://marketpress.com
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly
13
+ }
14
+
15
+ if ( class_exists( 'Advanced_Ads', false ) ) {
16
+
17
+ add_action( 'init', 'marketpress_advanced_ads_init' );
18
+
19
+ /**
20
+ * Init module
21
+ *
22
+ * @wp-hook init
23
+ * @return void
24
+ */
25
+ function marketpress_advanced_ads_init() {
26
+
27
+ // Actions and Filters
28
+
29
+ // Activate, deactivate MarketPress Bundle License
30
+ add_filter( 'advanced_ads_license_marketpress-advanced-ads', 'marketpress_advanced_license_manager', 10, 5 );
31
+
32
+ }
33
+
34
+ /**
35
+ * License Management for MarketPress bundle
36
+ *
37
+ * @wp-hook advanced_ads_license_marketpress-advanced-ads
38
+ *
39
+ * @param Mixed $return_value
40
+ * @param String $method_name
41
+ * @param String $plugin_name
42
+ * @param String $options_slug
43
+ * @param String $license_key
44
+ *
45
+ * @return Mixed
46
+ */
47
+ function marketpress_advanced_license_manager ( $return_value, $method_name, $plugin_name, $options_slug, $license_key ) {
48
+
49
+ // Remove class from method name
50
+ $method_name = str_replace( 'Advanced_Ads_Admin::', '', $method_name );
51
+
52
+ switch ( $method_name ) {
53
+
54
+ case 'activate_license':
55
+
56
+ // Licence Management by MarketPress for
57
+
58
+ $url_key_check = 'http://marketpress.com/mp-key/' . $license_key . '/advanced-ads/' . sanitize_title_with_dashes( network_site_url() );
59
+ $remote = wp_remote_get( $url_key_check);
60
+ $response = json_decode( wp_remote_retrieve_body( $remote ) );
61
+
62
+ // If the remote is not reachable or any other errors occured
63
+ // Same check as Advanced Ads does
64
+ if ( is_wp_error( $remote ) ) {
65
+ return __( 'License couldn’t be activated. Please try again later.', 'advanced-ads' );
66
+ }
67
+
68
+ // Status is true
69
+ if ( $response->status == 'true' ) {
70
+
71
+ // New request to get expires date
72
+ $url_version_check = 'http://marketpress.com/mp-version/' . $license_key . '/advanced-ads/' . sanitize_title_with_dashes( network_site_url() );
73
+
74
+ $remote_version = wp_remote_get( $url_version_check );
75
+
76
+ if ( is_wp_error( $remote_version ) ) {
77
+ return __( 'License couldn’t be activated. Please try again later.', 'advanced-ads' );
78
+ }
79
+
80
+ // Resonse status is always true, because it was before true
81
+ $response_version = json_decode( wp_remote_retrieve_body( $remote_version ) );
82
+
83
+ // Expires date
84
+ $expires_date = $response_version->access_expires;
85
+
86
+ // Update options
87
+ update_option( 'marketpress-advanced-ads-license-status', 'valid', false );
88
+ update_option( 'marketpress-advanced-ads-license-expires', $expires_date , false );
89
+
90
+ // Get licenses
91
+ if ( is_multisite() ) {
92
+ global $current_site;
93
+ $licenses = get_blog_option( $current_site->blog_id, ADVADS_SLUG . '-licenses', array() );
94
+
95
+ } else {
96
+ $licenses = get_option( ADVADS_SLUG . '-licenses', array() );
97
+ }
98
+
99
+ // Save license
100
+ $licenses[ 'marketpress-advanced-ads' ] = $license_key;
101
+
102
+ // Now activate every module!
103
+ $add_ons = apply_filters( 'advanced-ads-add-ons', array() );
104
+
105
+ foreach ( $add_ons as $key => $add_on ) {
106
+
107
+ if ( $key == 'laye' ) {
108
+ $key = 'layer';
109
+ }
110
+
111
+ update_option( $add_on[ 'options_slug' ] . '-license-status', 'valid', false );
112
+ update_option( $add_on[ 'options_slug' ] . '-license-expires', $expires_date , false );
113
+ $licenses[ $key ] = $license_key;
114
+ }
115
+
116
+ // Save licenses
117
+ if ( is_multisite() ) {
118
+ update_blog_option( $current_site->blog_id, ADVADS_SLUG . '-licenses', $licenses );
119
+ } else {
120
+ update_option( ADVADS_SLUG . '-licenses', $licenses );
121
+ }
122
+
123
+ Advanced_Ads_Admin_Notices::get_instance()->remove_from_queue( 'license_expires' );
124
+ Advanced_Ads_Admin_Notices::get_instance()->remove_from_queue( 'license_expired' );
125
+ Advanced_Ads_Admin_Notices::get_instance()->remove_from_queue( 'license_invalid' );
126
+
127
+ return 1;
128
+
129
+ } else {
130
+
131
+ update_option( 'marketpress-advanced-ads-license-status', 'invalid', false );
132
+
133
+ if ( $response->status == 'urllimit' ) {
134
+ return __( 'There are no activations left.', 'advanced-ads' );
135
+ } else {
136
+ return __( 'This is not the correct key for this add-on.', 'advanced-ads' );
137
+ }
138
+
139
+ }
140
+
141
+ break;
142
+
143
+ case 'deactivate_license':
144
+
145
+ delete_option( 'marketpress-advanced-ads-license-status' );
146
+ delete_option( 'marketpress-advanced-ads-license-expires' );
147
+ Advanced_Ads_Admin_Notices::get_instance()->remove_from_queue( 'license_expires' );
148
+
149
+ // Get licenses
150
+ if ( is_multisite() ) {
151
+ global $current_site;
152
+ $licenses = get_blog_option( $current_site->blog_id, ADVADS_SLUG . '-licenses', array() );
153
+
154
+ } else {
155
+ $licenses = get_option( ADVADS_SLUG . '-licenses', array() );
156
+ }
157
+
158
+ $marketpress_key = $licenses[ 'marketpress-advanced-ads' ];
159
+
160
+ // Now deactivate every module!
161
+ $add_ons = apply_filters( 'advanced-ads-add-ons', array() );
162
+
163
+ foreach ( $add_ons as $key => $add_on ) {
164
+
165
+ if ( $key == 'laye' ) {
166
+ $key = 'layer';
167
+ }
168
+
169
+ if ( $licenses[ $key] == $marketpress_key ) {
170
+ delete_option( $add_on[ 'options_slug' ] . '-license-status' );
171
+ delete_option( $add_on[ 'options_slug' ] . '-license-expires' );
172
+ Advanced_Ads_Admin_Notices::get_instance()->remove_from_queue( 'license_expires' );
173
+ }
174
+
175
+ }
176
+
177
+ return 1;
178
+ break;
179
+
180
+ }
181
+
182
+ }
183
+
184
+ }
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, ad inserter, ad injection, ad manager, ads manager, ad widget, adrotate, adsense, advertise, advertisements, advertising, adverts, advert, amazon, banner, banners, buysellads, chitika, clickbank, dfp, doubleclick, geotarget, geolocation, geo location, google dfp, monetization, widget
5
  Requires at least: WP 4.2, PHP 5.3
6
  Tested up to: 4.6.1
7
- Stable tag: 1.7.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -206,6 +206,15 @@ There is no revenue share. Advanced Ads doesn’t alter your ad codes in a way t
206
 
207
  == Changelog ==
208
 
 
 
 
 
 
 
 
 
 
209
  = 1.7.7 =
210
 
211
  * allow to inject a new ad into existing placements
4
  Tags: ads, ad, ad inserter, ad injection, ad manager, ads manager, ad widget, adrotate, adsense, advertise, advertisements, advertising, adverts, advert, amazon, banner, banners, buysellads, chitika, clickbank, dfp, doubleclick, geotarget, geolocation, geo location, google dfp, monetization, widget
5
  Requires at least: WP 4.2, PHP 5.3
6
  Tested up to: 4.6.1
7
+ Stable tag: 1.7.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
206
 
207
  == Changelog ==
208
 
209
+ = 1.7.8 =
210
+
211
+ * prevent any ad container output in the header
212
+ * show advertisement label also for manually placed ads
213
+ * fixed AdSense slot ID when delivered through cache-busting
214
+ * fixed reserved place option not working after image upload
215
+ * fixed placement type display
216
+ * fixed missing translation for show/hide options
217
+
218
  = 1.7.7 =
219
 
220
  * allow to inject a new ad into existing placements