Advanced Ads - Version 1.10.12

Version Description

  • added function that allows Advanced Ads Pro to prevent script optimizing plugins to break ad codes
  • fixed JS conflict for plain text ads using PHP or shortcodes
Download this release

Release Info

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

Code changes from version 1.10.11 to 1.10.12

admin/assets/js/admin.js CHANGED
@@ -385,6 +385,13 @@ jQuery( document ).ready(function ($) {
385
  parent.find('.advads-license-activate-active').fadeIn();
386
  parent.find('input').prop('readonly', 'readonly');
387
  } else if( r === 'ex' ){
 
 
 
 
 
 
 
388
  parent.find('.advads-license-activate-error').remove();
389
  parent.find('.advads-license-expired-error').show();
390
  button.show();
@@ -967,8 +974,8 @@ window.Advanced_Ads_Admin = window.Advanced_Ads_Admin || {
967
  },
968
  check_ad_source: function(){
969
  var text = Advanced_Ads_Admin.get_ad_source_editor_text();
970
- var enabled_php = $('#advads-parameters-php').prop('checked');
971
- var enabled_sc = $('#advads-parameters-shortcodes').prop('checked');
972
  if (enabled_php && ! /\<\?php/.test(text)){
973
  jQuery('#advads-parameters-php-warning').show();
974
  }
385
  parent.find('.advads-license-activate-active').fadeIn();
386
  parent.find('input').prop('readonly', 'readonly');
387
  } else if( r === 'ex' ){
388
+ var input = parent.find('input.advads-license-key');
389
+ var link = parent.find('a.advads-renewal-link');
390
+ if (input && link){
391
+ var license_key = input.val();
392
+ var href = link.prop('href');
393
+ link.prop('href', href.replace("%LICENSE_KEY%", license_key));
394
+ }
395
  parent.find('.advads-license-activate-error').remove();
396
  parent.find('.advads-license-expired-error').show();
397
  button.show();
974
  },
975
  check_ad_source: function(){
976
  var text = Advanced_Ads_Admin.get_ad_source_editor_text();
977
+ var enabled_php = jQuery('#advads-parameters-php').prop('checked');
978
+ var enabled_sc = jQuery('#advads-parameters-shortcodes').prop('checked');
979
  if (enabled_php && ! /\<\?php/.test(text)){
980
  jQuery('#advads-parameters-php-warning').show();
981
  }
admin/views/setting-license.php CHANGED
@@ -13,7 +13,8 @@ ob_start();
13
  <?php
14
  $update_button = ob_get_clean();
15
 
16
- $expired_error .= $expired_renew_link = ' ' . sprintf(__('Click on %2$s if you renewed it or have a subscription or <a href="%1$s" target="_blank">renew your license</a>.', 'advanced-ads'), ADVADS_URL . 'checkout/?edd_license_key=' . esc_attr($license_key) . '#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings-licenses', $update_button);
 
17
  if ('lifetime' !== $expires) {
18
  $expires_time = strtotime($expires);
19
  $days_left = ( $expires_time - time() ) / DAY_IN_SECONDS;
13
  <?php
14
  $update_button = ob_get_clean();
15
 
16
+ $license_key_for_expired_link = $license_key ? $license_key : "%LICENSE_KEY%";
17
+ $expired_error .= $expired_renew_link = ' ' . sprintf(__('Click on %2$s if you renewed it or have a subscription or <a href="%1$s" class="advads-renewal-link" target="_blank">renew your license</a>.', 'advanced-ads'), ADVADS_URL . 'checkout/?edd_license_key=' . esc_attr($license_key_for_expired_link) . '#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings-licenses', $update_button);
18
  if ('lifetime' !== $expires) {
19
  $expires_time = strtotime($expires);
20
  $days_left = ( $expires_time - time() ) / DAY_IN_SECONDS;
advanced-ads.php CHANGED
@@ -12,7 +12,7 @@
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
- * Version: 1.10.11
16
  * Author: Thomas Maier
17
  * Author URI: https://wpadvancedads.com
18
  * Text Domain: advanced-ads
@@ -39,7 +39,7 @@ define( 'ADVADS_BASE_DIR', dirname( ADVADS_BASE ) ); // directory of the plugin
39
  // general and global slug, e.g. to store options in WP
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
- define( 'ADVADS_VERSION', '1.10.11' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
+ * Version: 1.10.12
16
  * Author: Thomas Maier
17
  * Author URI: https://wpadvancedads.com
18
  * Text Domain: advanced-ads
39
  // general and global slug, e.g. to store options in WP
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
+ define( 'ADVADS_VERSION', '1.10.12' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
classes/checks.php CHANGED
@@ -150,6 +150,41 @@ class Advanced_Ads_Checks {
150
 
151
  return false;
152
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
 
154
  /**
155
  * check for additional conflicting plugins
150
 
151
  return false;
152
  }
153
+
154
+ /**
155
+ * WP rocket plugin installed
156
+ *
157
+ * @return bool true if WP rocket is installed
158
+ */
159
+ public static function active_wp_rocket(){
160
+ if( defined( 'WP_ROCKET_SLUG' ) ){
161
+ return true;
162
+ }
163
+
164
+ return false;
165
+ }
166
+
167
+ /**
168
+ * checks the settings of wp rocket to find out if combining of javascript files is enabled
169
+ * @return boolean true, when "Combine JavaScript files" is enabled
170
+ */
171
+ public static function is_wp_rocket_combine_js_enabled(){
172
+ if (self::active_wp_rocket()){
173
+ $settings = get_option("wp_rocket_settings");
174
+ if ($settings){
175
+ if (isset($settings['minify_concatenate_js']) && $settings['minify_concatenate_js']) return true;
176
+ }
177
+ }
178
+ return false;
179
+ }
180
+
181
+ /**
182
+ * checks if the preconditions are met to wrap an ad with <!--noptimize--> comments
183
+ * @return boolean
184
+ */
185
+ public static function requires_noptimize_wrapping(){
186
+ return Advanced_Ads_Checks::active_autoptimize() || Advanced_Ads_Checks::is_wp_rocket_combine_js_enabled();
187
+ }
188
 
189
  /**
190
  * check for additional conflicting plugins
classes/utils.php CHANGED
@@ -79,7 +79,7 @@ class Advanced_Ads_Utils {
79
  * @return str $content
80
  */
81
  public static function get_inline_asset( $content ) {
82
- if ( Advanced_Ads_Checks::active_autoptimize() ) {
83
  return '<!--noptimize-->' . $content . '<!--/noptimize-->';
84
  }
85
  return $content;
79
  * @return str $content
80
  */
81
  public static function get_inline_asset( $content ) {
82
+ if ( Advanced_Ads_Checks::active_autoptimize() || Advanced_Ads_Checks::active_wp_rocket() ) {
83
  return '<!--noptimize-->' . $content . '<!--/noptimize-->';
84
  }
85
  return $content;
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: webzunft
3
  Donate link:https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5RRRCEBGN3UT2
4
  Tags: ads, ad manager, ad widget, ad rotation, adsense, advertise, advertisements, advertising, adverts, advert, amazon, banner, banner ads, banners, buysellads, chitika, clickbank, dfp, doubleclick, double click, geotarget, geolocation, geo location, google dfp, google ad manager, monetization, widget, wordpress, wordpress ads
5
  Requires at least: 4.6
6
- Tested up to: 4.9
7
  Requires PHP: 5.4
8
- Stable tag: 1.10.11
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -276,6 +276,11 @@ Yes. Advanced Ads is based on WordPress standards and therefore easily customiza
276
 
277
  == Changelog ==
278
 
 
 
 
 
 
279
  = 1.10.11 =
280
 
281
  * added `advanced-ads-frontend-prefix` to adjust the frontend prefix dynamically
3
  Donate link:https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5RRRCEBGN3UT2
4
  Tags: ads, ad manager, ad widget, ad rotation, adsense, advertise, advertisements, advertising, adverts, advert, amazon, banner, banner ads, banners, buysellads, chitika, clickbank, dfp, doubleclick, double click, geotarget, geolocation, geo location, google dfp, google ad manager, monetization, widget, wordpress, wordpress ads
5
  Requires at least: 4.6
6
+ Tested up to: 5.0
7
  Requires PHP: 5.4
8
+ Stable tag: 1.10.12
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
276
 
277
  == Changelog ==
278
 
279
+ = 1.10.12 =
280
+
281
+ * added function that allows Advanced Ads Pro to prevent script optimizing plugins to break ad codes
282
+ * fixed JS conflict for plain text ads using PHP or shortcodes
283
+
284
  = 1.10.11 =
285
 
286
  * added `advanced-ads-frontend-prefix` to adjust the frontend prefix dynamically