Advanced Ads - Version 1.16.1

Version Description

  • fixed JavaScript that broke privacy module check in the frontend
  • allow to change size of AdSense ads loaded from the AdSense account
Download this release

Release Info

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

Code changes from version 1.16 to 1.16.1

admin/assets/css/admin.css CHANGED
@@ -177,6 +177,7 @@ select + .advads-conditions-single { padding-left: 10px }
177
  .advads-option-list > .label { display: block; float: left; width: 10em; padding: 10px; font-weight: bold; text-transform: capitalize; color: #444; text-align: left; font-size: 100%; }
178
  .advads-option-list > .label + div { display: block; float: left; padding: 10px; max-width: calc(100% - (10em + 40px)); }
179
  .advads-option-list > hr { clear: both; float: none; display: block; }
 
180
 
181
  .advads-option { clear: both; float: none; display: block; overflow: hidden; }
182
  .advads-option > span { display: block; float: left; width: 10em; padding: 10px; font-weight: bold; text-transform: capitalize; }
@@ -359,6 +360,7 @@ tr:hover .on-hover { display: block; }
359
  .advads-tab.active { display: block; }
360
  .advads-license-activate-active { color: green; }
361
  .advads-license-activate-error { color: red; }
 
362
  .advads-tab-sub-menu ul { overflow: hidden; }
363
  .advads-tab-sub-menu ul li { float: left; padding-right: 0.5em; }
364
  .advads-tab-sub-menu ul li a { cursor: pointer; }
177
  .advads-option-list > .label { display: block; float: left; width: 10em; padding: 10px; font-weight: bold; text-transform: capitalize; color: #444; text-align: left; font-size: 100%; }
178
  .advads-option-list > .label + div { display: block; float: left; padding: 10px; max-width: calc(100% - (10em + 40px)); }
179
  .advads-option-list > hr { clear: both; float: none; display: block; }
180
+ .advads-option-list div[style*="display: none"] + hr { display: none; }
181
 
182
  .advads-option { clear: both; float: none; display: block; overflow: hidden; }
183
  .advads-option > span { display: block; float: left; width: 10em; padding: 10px; font-weight: bold; text-transform: capitalize; }
360
  .advads-tab.active { display: block; }
361
  .advads-license-activate-active { color: green; }
362
  .advads-license-activate-error { color: red; }
363
+ .advads-license-activate-error a { color: inherit; }
364
  .advads-tab-sub-menu ul { overflow: hidden; }
365
  .advads-tab-sub-menu ul li { float: left; padding-right: 0.5em; }
366
  .advads-tab-sub-menu ul li a { cursor: pointer; }
admin/assets/js/admin-global.js CHANGED
@@ -129,7 +129,7 @@ jQuery( document ).ready(function () {
129
  advads_deactivate_link.click(function ( e ) {
130
  e.preventDefault();
131
  // only show feedback form once per 30 days
132
- var c_value = advads_admin_get_cookie( "advads_hide_deactivate_feedback" );
133
  if (c_value === undefined){
134
  jQuery( '#advanced-ads-feedback-overlay' ).show();
135
  } else {
@@ -154,7 +154,7 @@ jQuery( document ).ready(function () {
154
  // set cookie for 30 days
155
  var exdate = new Date();
156
  exdate.setSeconds( exdate.getSeconds() + 2592000 );
157
- document.cookie = "advads_hide_deactivate_feedback=1; expires=" + exdate.toUTCString() + "; path=/";
158
  // save if plugin should be disabled
159
  var disable_plugin = self.hasClass('advanced-ads-feedback-not-deactivate') ? false : true;
160
 
129
  advads_deactivate_link.click(function ( e ) {
130
  e.preventDefault();
131
  // only show feedback form once per 30 days
132
+ var c_value = advads_admin_get_cookie( "advanced_ads_hide_deactivate_feedback" );
133
  if (c_value === undefined){
134
  jQuery( '#advanced-ads-feedback-overlay' ).show();
135
  } else {
154
  // set cookie for 30 days
155
  var exdate = new Date();
156
  exdate.setSeconds( exdate.getSeconds() + 2592000 );
157
+ document.cookie = "advanced_ads_hide_deactivate_feedback=1; expires=" + exdate.toUTCString() + "; path=/";
158
  // save if plugin should be disabled
159
  var disable_plugin = self.hasClass('advanced-ads-feedback-not-deactivate') ? false : true;
160
 
admin/assets/js/admin.js CHANGED
@@ -324,7 +324,7 @@ jQuery( document ).ready( function ( $ ) {
324
  parent.find( '.advads-license-expired-error' ).show()
325
  advads_disable_license_buttons( false )
326
  } else {
327
- parent.find( '.advads-license-activate-error' ).show().text( r )
328
  advads_disable_license_buttons( false )
329
  }
330
  } )
324
  parent.find( '.advads-license-expired-error' ).show()
325
  advads_disable_license_buttons( false )
326
  } else {
327
+ parent.find( '.advads-license-activate-error' ).show().html( r )
328
  advads_disable_license_buttons( false )
329
  }
330
  } )
admin/includes/class-licenses.php CHANGED
@@ -188,7 +188,13 @@ class Advanced_Ads_Admin_Licenses {
188
  $errors = array(
189
  'license_not_activable' => __( 'This is the bundle license key.', 'advanced-ads' ),
190
  'item_name_mismatch' => __( 'This is not the correct key for this add-on.', 'advanced-ads' ),
191
- 'no_activations_left' => __( 'There are no activations left.', 'advanced-ads' ),
 
 
 
 
 
 
192
  );
193
  $error = isset( $errors[ $license_data->error ] ) ? $errors[ $license_data->error ] : $license_data->error;
194
  if ( 'expired' === $license_data->error ) {
188
  $errors = array(
189
  'license_not_activable' => __( 'This is the bundle license key.', 'advanced-ads' ),
190
  'item_name_mismatch' => __( 'This is not the correct key for this add-on.', 'advanced-ads' ),
191
+ 'no_activations_left' => __( 'There are no activations left.', 'advanced-ads' )
192
+ . ' '
193
+ . sprintf( // translators: %1$s is a starting link tag, %2$s is the closing one.
194
+ __( 'You can manage activations in %1$syour account%2$s.', 'advanced-ads' ),
195
+ '<a href="' . ADVADS_URL . 'account/" target="_blank">',
196
+ '</a>'
197
+ ),
198
  );
199
  $error = isset( $errors[ $license_data->error ] ) ? $errors[ $license_data->error ] : $license_data->error;
200
  if ( 'expired' === $license_data->error ) {
admin/views/ad-list-no-ads.php CHANGED
@@ -1,8 +1,15 @@
1
  <div id="advads-first-ad-links">
2
- <button type="button" id="advads-first-ad-video-link" class="button-primary"><span class="dashicons dashicons-format-video" style="line-height: inherit"></span>&nbsp;<?php _e( 'Watch the “First Ad” Tutorial (Video)', 'advanced-ads' ); ?></button>
 
 
 
3
  </div>
4
  <script>
5
- jQuery('#advads-first-ad-video-link').click(function(){
6
- jQuery( '<br class="clear"/><br/><iframe width="420" height="315" src="https://www.youtube-nocookie.com/embed/A5jKAzqyWwA?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>' ).appendTo('#advads-first-ad-links');
7
- });
 
 
 
 
8
  </script>
1
  <div id="advads-first-ad-links">
2
+ <button type="button" id="advads-first-ad-video-link" class="button-primary">
3
+ <span class="dashicons dashicons-format-video"></span>
4
+ &nbsp;<?php esc_attr_e( 'Watch the “First Ad” Tutorial (Video)', 'advanced-ads' ); ?>
5
+ </button>
6
  </div>
7
  <script>
8
+ (function ($) {
9
+ var $videoLink = $('#advads-first-ad-video-link');
10
+ $videoLink.click(function () {
11
+ $('<br class="clear"/><br/><iframe width="420" height="315" src="https://www.youtube-nocookie.com/embed/A5jKAzqyWwA?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>').appendTo('#advads-first-ad-links');
12
+ })
13
+ .children('.dashicons').css('line-height', $videoLink.css('line-height'));
14
+ })(jQuery)
15
  </script>
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.16
16
  * Author: Thomas Maier, Advanced Ads GmbH
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.16' );
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.16.1
16
  * Author: Thomas Maier, Advanced Ads GmbH
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.16.1' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
classes/ad_type_image.php CHANGED
@@ -63,7 +63,7 @@ class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract{
63
  if ( ! defined( 'AAT_VERSION' ) ) : ?>
64
  <label for="advads-url" class="label"><?php _e( 'URL', 'advanced-ads' ); ?></label>
65
  <div>
66
- <input type="url" name="advanced_ad[url]" id="advads-url" class="advads-ad-url" value="<?php echo $url; ?>" placeholder="<?php _e( 'https://www.example.com/', 'advanced-ads' ); ?>"/>
67
  <p class="description">
68
  <?php _e( 'Link to target site including http(s)', 'advanced-ads' ); ?>
69
  </p>
63
  if ( ! defined( 'AAT_VERSION' ) ) : ?>
64
  <label for="advads-url" class="label"><?php _e( 'URL', 'advanced-ads' ); ?></label>
65
  <div>
66
+ <input type="url" name="advanced_ad[url]" id="advads-url" class="advads-ad-url" value="<?php echo $url; ?>" placeholder="https://www.example.com/"/>
67
  <p class="description">
68
  <?php _e( 'Link to target site including http(s)', 'advanced-ads' ); ?>
69
  </p>
classes/plugin.php CHANGED
@@ -188,27 +188,14 @@ class Advanced_Ads_Plugin {
188
  ob_start();
189
  ?>
190
  <script>
 
191
  <?php if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
192
  readfile( ADVADS_BASE_PATH . 'public/assets/js/ready.js' );
193
  } else { ?>
194
- advanced_ads_ready = function () {
195
- var fns = [], listener, doc = typeof document === 'object' && document,
196
- hack = doc && doc.documentElement.doScroll, domContentLoaded = 'DOMContentLoaded',
197
- loaded = doc && (hack ? /^loaded|^c/ : /^loaded|^i|^c/).test( doc.readyState )
198
- if ( ! loaded && doc ) {
199
- listener = function () {
200
- doc.removeEventListener( domContentLoaded, listener )
201
- window.removeEventListener( 'load', listener )
202
- loaded = 1
203
- while ( listener = fns.shift() ) listener()
204
- }
205
- doc.addEventListener( domContentLoaded, listener )
206
- window.addEventListener( 'load', listener )
207
- }
208
- return function ( fn ) {loaded ? setTimeout( fn, 0 ) : fns.push( fn )}
209
- }()
210
  <?php
211
  }
 
212
 
213
  // Output privacy options.
214
  $privacy_options = Advanced_Ads_Privacy::get_instance()->options();
@@ -474,7 +461,7 @@ class Advanced_Ads_Plugin {
474
 
475
  // disable Ad Health by default for new users.
476
  if ( ! isset( $this->options['disable-notices'] )
477
- && self::show_to_new_users( 1575892800, 'b' ) ) {
478
  $this->options['disable-notices'] = 1;
479
  }
480
 
188
  ob_start();
189
  ?>
190
  <script>
191
+ //@formatter:off
192
  <?php if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
193
  readfile( ADVADS_BASE_PATH . 'public/assets/js/ready.js' );
194
  } else { ?>
195
+ advanced_ads_ready=function(){var fns=[],listener,doc=typeof document==="object"&&document,hack=doc&&doc.documentElement.doScroll,domContentLoaded="DOMContentLoaded",loaded=doc&&(hack?/^loaded|^c/:/^loaded|^i|^c/).test(doc.readyState);if(!loaded&&doc){listener=function(){doc.removeEventListener(domContentLoaded,listener);window.removeEventListener("load",listener);loaded=1;while(listener=fns.shift())listener()};doc.addEventListener(domContentLoaded,listener);window.addEventListener("load",listener)}return function(fn){loaded?setTimeout(fn,0):fns.push(fn)}}();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  <?php
197
  }
198
+ //@formatter:on
199
 
200
  // Output privacy options.
201
  $privacy_options = Advanced_Ads_Privacy::get_instance()->options();
461
 
462
  // disable Ad Health by default for new users.
463
  if ( ! isset( $this->options['disable-notices'] )
464
+ && self::show_to_new_users( 1575892800, 'b' ) ) {
465
  $this->options['disable-notices'] = 1;
466
  }
467
 
languages/advanced-ads.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Advanved Ads\n"
5
  "Report-Msgid-Bugs-To: http://wordpress.org/plugins/plugin-name\n"
6
- "POT-Creation-Date: 2019-12-09 08:38+0000\n"
7
  "POT-Revision-Date: Wed Jul 13 2016 13:23:05 GMT+0200 (CEST)\n"
8
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
9
  "Last-Translator: Thomas Maier <post@webzunft.de>\n"
@@ -330,10 +330,6 @@ msgstr ""
330
  msgid "edit"
331
  msgstr ""
332
 
333
- #: classes/ad_type_image.php:66
334
- msgid "https://www.example.com/"
335
- msgstr ""
336
-
337
  #: classes/ad_type_image.php:68
338
  msgid "Link to target site including http(s)"
339
  msgstr ""
@@ -1281,33 +1277,39 @@ msgstr ""
1281
  msgid "There are no activations left."
1282
  msgstr ""
1283
 
1284
- #: admin/includes/class-licenses.php:202
 
 
 
 
 
 
1285
  #, php-format
1286
  msgid "License is invalid. Reason: %s"
1287
  msgstr ""
1288
 
1289
  #. %s is a list of server information like IP address. Just keep it as is.
1290
- #: admin/includes/class-licenses.php:238
1291
  #, php-format
1292
  msgid ""
1293
  "Your request was blocked by our firewall. Please send us the following "
1294
  "information to unblock you: %s."
1295
  msgstr ""
1296
 
1297
- #: admin/includes/class-licenses.php:296
1298
  msgid "Error while trying to disable the license. Please contact support."
1299
  msgstr ""
1300
 
1301
- #: admin/includes/class-licenses.php:331 admin/includes/class-licenses.php:354
1302
  msgid "License couldn’t be deactivated. Please try again later."
1303
  msgstr ""
1304
 
1305
- #: admin/includes/class-licenses.php:584
1306
  #, php-format
1307
  msgid "Download failed. <a href=\"%s\">Click here to try another method</a>."
1308
  msgstr ""
1309
 
1310
- #: admin/includes/class-licenses.php:586
1311
  #, php-format
1312
  msgid ""
1313
  "Download failed. <a href=\"%s\" target=\"_blank\">Click here to learn why</a>"
@@ -2215,7 +2217,7 @@ msgstr ""
2215
  msgid "all ad groups"
2216
  msgstr ""
2217
 
2218
- #: admin/views/ad-list-no-ads.php:2
2219
  msgid "Watch the “First Ad” Tutorial (Video)"
2220
  msgstr ""
2221
 
3
  msgstr ""
4
  "Project-Id-Version: Advanved Ads\n"
5
  "Report-Msgid-Bugs-To: http://wordpress.org/plugins/plugin-name\n"
6
+ "POT-Creation-Date: 2019-12-15 09:05+0000\n"
7
  "POT-Revision-Date: Wed Jul 13 2016 13:23:05 GMT+0200 (CEST)\n"
8
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
9
  "Last-Translator: Thomas Maier <post@webzunft.de>\n"
330
  msgid "edit"
331
  msgstr ""
332
 
 
 
 
 
333
  #: classes/ad_type_image.php:68
334
  msgid "Link to target site including http(s)"
335
  msgstr ""
1277
  msgid "There are no activations left."
1278
  msgstr ""
1279
 
1280
+ #. %1$s is a starting link tag, %2$s is the closing one.
1281
+ #: admin/includes/class-licenses.php:194
1282
+ #, php-format
1283
+ msgid "You can manage activations in %1$syour account%2$s."
1284
+ msgstr ""
1285
+
1286
+ #: admin/includes/class-licenses.php:208
1287
  #, php-format
1288
  msgid "License is invalid. Reason: %s"
1289
  msgstr ""
1290
 
1291
  #. %s is a list of server information like IP address. Just keep it as is.
1292
+ #: admin/includes/class-licenses.php:244
1293
  #, php-format
1294
  msgid ""
1295
  "Your request was blocked by our firewall. Please send us the following "
1296
  "information to unblock you: %s."
1297
  msgstr ""
1298
 
1299
+ #: admin/includes/class-licenses.php:302
1300
  msgid "Error while trying to disable the license. Please contact support."
1301
  msgstr ""
1302
 
1303
+ #: admin/includes/class-licenses.php:337 admin/includes/class-licenses.php:360
1304
  msgid "License couldn’t be deactivated. Please try again later."
1305
  msgstr ""
1306
 
1307
+ #: admin/includes/class-licenses.php:590
1308
  #, php-format
1309
  msgid "Download failed. <a href=\"%s\">Click here to try another method</a>."
1310
  msgstr ""
1311
 
1312
+ #: admin/includes/class-licenses.php:592
1313
  #, php-format
1314
  msgid ""
1315
  "Download failed. <a href=\"%s\" target=\"_blank\">Click here to learn why</a>"
2217
  msgid "all ad groups"
2218
  msgstr ""
2219
 
2220
+ #: admin/views/ad-list-no-ads.php:4
2221
  msgid "Watch the “First Ad” Tutorial (Video)"
2222
  msgstr ""
2223
 
modules/gadsense/admin/assets/js/adsense.js CHANGED
@@ -526,7 +526,6 @@ class AdvancedAdsNetworkAdsense extends AdvancedAdsAdNetwork{
526
  * legacy method - adds readonly to relevant inputs
527
  */
528
  makeReadOnly() {
529
- jQuery( '#unit-code,#ad-layout,#ad-layout-key,[name="advanced_ad[width]"],[name="advanced_ad[height]"]' ).prop( 'readonly', true );
530
  jQuery( '#unit-type option:not(:selected)' ).prop( 'disabled', true );
531
  }
532
 
526
  * legacy method - adds readonly to relevant inputs
527
  */
528
  makeReadOnly() {
 
529
  jQuery( '#unit-type option:not(:selected)' ).prop( 'disabled', true );
530
  }
531
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: ads, ad manager, ad rotation, adsense, banner
4
  Requires at least: 4.6
5
  Tested up to: 5.3
6
  Requires PHP: 5.6
7
- Stable tag: 1.16
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -304,6 +304,11 @@ Yes. Advanced Ads is based on WordPress standards and therefore easily customiza
304
 
305
  == Changelog ==
306
 
 
 
 
 
 
307
  = 1.16 =
308
 
309
  * moved all users to the new content injection logic and removed opt-out option
4
  Requires at least: 4.6
5
  Tested up to: 5.3
6
  Requires PHP: 5.6
7
+ Stable tag: 1.16.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
304
 
305
  == Changelog ==
306
 
307
+ = 1.16.1 =
308
+
309
+ * fixed JavaScript that broke privacy module check in the frontend
310
+ * allow to change size of AdSense ads loaded from the AdSense account
311
+
312
  = 1.16 =
313
 
314
  * moved all users to the new content injection logic and removed opt-out option