Advanced Ads - Version 1.6.9.3

Version Description

  • order placement list by slug (which normally equals name)
  • updated Autoptimize message. If you use the Autoptimize plugin then check out the Autoptimize-Support in Advanced Ads Pro
  • unquote json request
  • added missing advertisement image for AdBlock check
  • added advanced-ads-can-inject-into-content- hook to check if individual placements can be injected into the content
Download this release

Release Info

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

Code changes from version 1.6.9.2 to 1.6.9.3

admin/assets/css/admin.css CHANGED
@@ -180,7 +180,7 @@
180
  .advads-placements-table .advads-usage input { width: 100%; }
181
  .advads-placements-table-options { text-align: right; }
182
  .advads-placement-options input, .advads-placement-options select { background: transparent; }
183
- .advads-placements-table-options input[type="number"] { width: 3em; }
184
 
185
  /**
186
  GENERAL ELEMENTS
180
  .advads-placements-table .advads-usage input { width: 100%; }
181
  .advads-placements-table-options { text-align: right; }
182
  .advads-placement-options input, .advads-placement-options select { background: transparent; }
183
+ .advads-placements-table-options input[type="number"] { width: 4em; }
184
 
185
  /**
186
  GENERAL ELEMENTS
admin/assets/img/advertisement.png ADDED
Binary file
admin/class-advanced-ads-admin.php CHANGED
@@ -217,6 +217,7 @@ class Advanced_Ads_Admin {
217
  'advanced-ads_page_advanced-ads-settings', // settings
218
  'toplevel_page_advanced-ads', // overview
219
  'admin_page_advanced-ads-debug', // debug
 
220
  'admin_page_advanced-ads-intro', // intro
221
  ));
222
 
217
  'advanced-ads_page_advanced-ads-settings', // settings
218
  'toplevel_page_advanced-ads', // overview
219
  'admin_page_advanced-ads-debug', // debug
220
+ 'advanced-ads_page_advanced-ads-support', // support
221
  'admin_page_advanced-ads-intro', // intro
222
  ));
223
 
admin/views/ad-visitor-metabox.php CHANGED
@@ -26,8 +26,10 @@ foreach ( $options as $_options ) :
26
  </div>
27
  <?php if( ! isset( $options ) || count( $options ) == 0 ) :
28
  ?><p><?php _e( 'Visitor conditions limit the number of users who can see your ad. There is no need to set visitor conditions if you want all users to see the ad.', ADVADS_SLUG ); ?></p><?php
29
- endif; ?>
30
- <hr/>
 
 
31
  <fieldset>
32
  <legend><?php _e( 'New condition', ADVADS_SLUG ); ?></legend>
33
  <div id="advads-visitor-conditions-new">
26
  </div>
27
  <?php if( ! isset( $options ) || count( $options ) == 0 ) :
28
  ?><p><?php _e( 'Visitor conditions limit the number of users who can see your ad. There is no need to set visitor conditions if you want all users to see the ad.', ADVADS_SLUG ); ?></p><?php
29
+ elseif( Advanced_Ads_Checks::cache() && ! defined('AAP_VERSION') ) :
30
+ ?><p><?php printf(__( 'Check out cache-busting in <a href="%s" target="_blank">Advanced Ads Pro</a> if dynamic features get cached.', ADVADS_SLUG ), ADVADS_URL . 'add-ons/advanced-ads-pro' ); ?></p><?php
31
+ endif;
32
+ ?><hr/>
33
  <fieldset>
34
  <legend><?php _e( 'New condition', ADVADS_SLUG ); ?></legend>
35
  <div id="advads-visitor-conditions-new">
admin/views/placements.php CHANGED
@@ -27,7 +27,9 @@
27
  </tr>
28
  </thead>
29
  <tbody>
30
- <?php foreach ( $placements as $_placement_slug => $_placement ) :
 
 
31
  $type_missing = false;
32
  if( isset( $_placement['type'] ) && ! isset( $placement_types[$_placement['type']] )) {
33
  $missed_type = $_placement['type'];
27
  </tr>
28
  </thead>
29
  <tbody>
30
+ <?php // order by slug
31
+ ksort( $placements );
32
+ foreach ( $placements as $_placement_slug => $_placement ) :
33
  $type_missing = false;
34
  if( isset( $_placement['type'] ) && ! isset( $placement_types[$_placement['type']] )) {
35
  $missed_type = $_placement['type'];
admin/views/support.php CHANGED
@@ -37,17 +37,15 @@
37
  if( Advanced_Ads_Checks::licenses_expired() ) :
38
  $messages[] = sprintf( __( '<strong>Advanced Ads</strong> license(s) expired. Support and updates are disabled. Please visit <a href="%s"> the license page</a> for more information.', ADVADS_SLUG ), admin_url( 'admin.php?page=advanced-ads-settings#top#licenses' ) );
39
  endif;
40
- if( Advanced_Ads_Checks::active_autoptimize() ) :
41
- $messages[] = __( '<strong>Autoptimize plugin detected</strong>. While this plugin is great for site performance, it is known to alter code, including scripts from ad networks. Please keep this in mind before asking for help about it.', ADVADS_SLUG );
42
  endif;
43
 
44
  if( count( $messages )) :
45
  foreach( $messages as $_message ) :
46
  ?><div class="message error"><p><?php echo $_message; ?></p></div><?php
47
  endforeach;
48
- endif;
49
-
50
- Advanced_Ads_Checks::ad_blocker_notice(); ?>
51
  <h2><?php _e( 'Contact', ADVADS_SLUG ); ?></h2>
52
  <p><?php printf(__( 'Please search the manual for a solution and take a look at <a href="%s" target="_blank">Ads not showing up?</a> before contacting me for help.', ADVADS_SLUG ), ADVADS_URL . 'manual/ads-not-showing-up/' ); ?></p>
53
  <form action="" method="post">
37
  if( Advanced_Ads_Checks::licenses_expired() ) :
38
  $messages[] = sprintf( __( '<strong>Advanced Ads</strong> license(s) expired. Support and updates are disabled. Please visit <a href="%s"> the license page</a> for more information.', ADVADS_SLUG ), admin_url( 'admin.php?page=advanced-ads-settings#top#licenses' ) );
39
  endif;
40
+ if( Advanced_Ads_Checks::active_autoptimize() && ! defined( 'AAP_VERSION' ) ) :
41
+ $messages[] = sprintf(__( '<strong>Autoptimize plugin detected</strong>. While this plugin is great for site performance, it is known to alter code, including scripts from ad networks. <a href="%s" target="_blank">Advanced Ads Pro</a> has a build-in support for Autoptimize.', ADVADS_SLUG ), ADVADS_URL . 'add-ons/advanced-ads-pro');
42
  endif;
43
 
44
  if( count( $messages )) :
45
  foreach( $messages as $_message ) :
46
  ?><div class="message error"><p><?php echo $_message; ?></p></div><?php
47
  endforeach;
48
+ endif; ?>
 
 
49
  <h2><?php _e( 'Contact', ADVADS_SLUG ); ?></h2>
50
  <p><?php printf(__( 'Please search the manual for a solution and take a look at <a href="%s" target="_blank">Ads not showing up?</a> before contacting me for help.', ADVADS_SLUG ), ADVADS_URL . 'manual/ads-not-showing-up/' ); ?></p>
51
  <form action="" method="post">
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.6.9.2
16
  * Author: Thomas Maier
17
  * Author URI: http://webgilde.com
18
  * Text Domain: advanced-ads
@@ -38,7 +38,7 @@ define( 'ADVADS_BASE_DIR', dirname( plugin_basename( __FILE__ ) ) ); // director
38
  // general and global slug, e.g. to store options in WP, textdomain
39
  define( 'ADVADS_SLUG', 'advanced-ads' );
40
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
41
- define( 'ADVADS_VERSION', '1.6.9.2' );
42
 
43
  /*----------------------------------------------------------------------------*
44
  * 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.6.9.3
16
  * Author: Thomas Maier
17
  * Author URI: http://webgilde.com
18
  * Text Domain: advanced-ads
38
  // general and global slug, e.g. to store options in WP, textdomain
39
  define( 'ADVADS_SLUG', 'advanced-ads' );
40
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
41
+ define( 'ADVADS_VERSION', '1.6.9.3' );
42
 
43
  /*----------------------------------------------------------------------------*
44
  * Autoloading, modules and functions
classes/ad-ajax.php CHANGED
@@ -43,6 +43,7 @@ class Advanced_Ads_Ajax {
43
  $id = isset( $_REQUEST['ad_id'] ) ? (string) $_REQUEST['ad_id'] : null;
44
  $arguments = isset( $_REQUEST['ad_args'] ) ? $_REQUEST['ad_args'] : array();
45
  if (is_string($arguments)) {
 
46
  $arguments = json_decode($arguments, true);
47
  }
48
  $adIds = isset( $_REQUEST['ad_ids'] ) ? $_REQUEST['ad_ids'] : null;
43
  $id = isset( $_REQUEST['ad_id'] ) ? (string) $_REQUEST['ad_id'] : null;
44
  $arguments = isset( $_REQUEST['ad_args'] ) ? $_REQUEST['ad_args'] : array();
45
  if (is_string($arguments)) {
46
+ $arguments = stripslashes($arguments);
47
  $arguments = json_decode($arguments, true);
48
  }
49
  $adIds = isset( $_REQUEST['ad_ids'] ) ? $_REQUEST['ad_ids'] : null;
public/class-advanced-ads.php CHANGED
@@ -372,6 +372,12 @@ class Advanced_Ads {
372
  foreach ( $placements as $_placement_id => $_placement ){
373
  if ( empty($_placement['item']) || ! isset($_placement['type']) ) { continue; }
374
  $_options = isset( $_placement['options'] ) ? $_placement['options'] : array();
 
 
 
 
 
 
375
  switch ( $_placement['type'] ) {
376
  case 'post_top':
377
  // TODO broken: does not serve placement but serves ad directly
372
  foreach ( $placements as $_placement_id => $_placement ){
373
  if ( empty($_placement['item']) || ! isset($_placement['type']) ) { continue; }
374
  $_options = isset( $_placement['options'] ) ? $_placement['options'] : array();
375
+
376
+ // check if injection is ok for a specific placement id
377
+ if( ! apply_filters( 'advanced-ads-can-inject-into-content-' . $_placement_id, true, $content, $_placement_id )){
378
+ continue;
379
+ }
380
+
381
  switch ( $_placement['type'] ) {
382
  case 'post_top':
383
  // TODO broken: does not serve placement but serves ad directly
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 4.2, PHP 5.3
6
  Tested up to: 4.3.1
7
- Stable tag: 1.6.9.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -185,6 +185,14 @@ There is no revenue share. Advanced Ads doesn’t alter your ad codes in a way t
185
 
186
  == Changelog ==
187
 
 
 
 
 
 
 
 
 
188
  = 1.6.9.2 =
189
 
190
  * small adjustment to make cache-busting from [Advanced Ads Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/) compatible with [Sticky Ads](https://wpadvancedads.com/add-ons/sticky-ads/)
4
  Tags: ads, ad, adsense, display, banner, advertisements, adverts, advert, monetization
5
  Requires at least: WP 4.2, PHP 5.3
6
  Tested up to: 4.3.1
7
+ Stable tag: 1.6.9.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
185
 
186
  == Changelog ==
187
 
188
+ = 1.6.9.3 =
189
+
190
+ * order placement list by slug (which normally equals name)
191
+ * updated Autoptimize message. If you use the Autoptimize plugin then check out the Autoptimize-Support in [Advanced Ads Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/)
192
+ * unquote json request
193
+ * added missing advertisement image for AdBlock check
194
+ * added `advanced-ads-can-inject-into-content-` hook to check if individual placements can be injected into the content
195
+
196
  = 1.6.9.2 =
197
 
198
  * small adjustment to make cache-busting from [Advanced Ads Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/) compatible with [Sticky Ads](https://wpadvancedads.com/add-ons/sticky-ads/)