Advanced Ads - Version 1.7.4.4

Version Description

  • linked first-ad tutorials above ad list if less than 3 ads created yet
  • fixed Wizard buttons not working due to JavaScript conflict
  • fixed manual added container id not displayed for ads not added through placement
Download this release

Release Info

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

Code changes from version 1.7.4.3 to 1.7.4.4

admin/assets/js/wizard.js CHANGED
@@ -16,16 +16,16 @@ var advads_wizard = {
16
  current_box: '#post-body-content', // current active box
17
  one_column: false, // whether the edit screen is in one-column mode
18
  init: function(){
19
- self = this;
20
- jQuery('#advads-wizard-controls-next').click( function( ){ self.next(); } );
21
- jQuery('#advads-wizard-controls-prev').click( function( ){ self.prev(); } );
22
  jQuery('#advads-wizard-controls-save').click( function( ){ jQuery('#publish').click(); } ); // save ad
23
  jQuery( '#advads-start-wizard' ).click( function(){
24
- self.start();
25
  });
26
  // end wizard when the button was clicked
27
  jQuery( '.advads-stop-wizard' ).click( function(){
28
- self.close();
29
  });
30
  },
31
  show_current_box: function(){
@@ -56,7 +56,7 @@ var advads_wizard = {
56
  this.save_hide_wizard( false );
57
  // jump to next box when ad type is selected
58
  jQuery('#advanced-ad-type input').change(function(){
59
- self.next();
60
  });
61
  },
62
  close: function(){ // close the wizard by showing all elements again
16
  current_box: '#post-body-content', // current active box
17
  one_column: false, // whether the edit screen is in one-column mode
18
  init: function(){
19
+ var _this = this;
20
+ jQuery('#advads-wizard-controls-next').click( function( ){ _this.next(); } );
21
+ jQuery('#advads-wizard-controls-prev').click( function( ){ _this.prev(); } );
22
  jQuery('#advads-wizard-controls-save').click( function( ){ jQuery('#publish').click(); } ); // save ad
23
  jQuery( '#advads-start-wizard' ).click( function(){
24
+ _this.start();
25
  });
26
  // end wizard when the button was clicked
27
  jQuery( '.advads-stop-wizard' ).click( function(){
28
+ _this.close();
29
  });
30
  },
31
  show_current_box: function(){
56
  this.save_hide_wizard( false );
57
  // jump to next box when ad type is selected
58
  jQuery('#advanced-ad-type input').change(function(){
59
+ _this.next();
60
  });
61
  },
62
  close: function(){ // close the wizard by showing all elements again
admin/class-advanced-ads-admin.php CHANGED
@@ -141,6 +141,7 @@ class Advanced_Ads_Admin {
141
 
142
  // check for update logic
143
  add_action( 'admin_notices', array($this, 'admin_notices') );
 
144
 
145
  // Add an action link pointing to the options page.
146
  $plugin_basename = plugin_basename( plugin_dir_path( '__DIR__' ) . $this->plugin_slug . '.php' );
@@ -162,7 +163,7 @@ class Advanced_Ads_Admin {
162
  // display information when user is going to disable the plugin
163
  // add_filter( 'after_plugin_row_' . ADVADS_BASE, array( $this, 'display_deactivation_message' ) );
164
  }
165
-
166
  /**
167
  * Return an instance of this class.
168
  *
@@ -1562,6 +1563,27 @@ class Advanced_Ads_Admin {
1562
 
1563
  include ADVADS_BASE_PATH . 'admin/views/ad-list-filters.php';
1564
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1565
 
1566
  /**
1567
  * add a meta box to post type edit screens with ad settings
141
 
142
  // check for update logic
143
  add_action( 'admin_notices', array($this, 'admin_notices') );
144
+ add_action( 'all_admin_notices', array($this, 'no_ads_yet_notice') );
145
 
146
  // Add an action link pointing to the options page.
147
  $plugin_basename = plugin_basename( plugin_dir_path( '__DIR__' ) . $this->plugin_slug . '.php' );
163
  // display information when user is going to disable the plugin
164
  // add_filter( 'after_plugin_row_' . ADVADS_BASE, array( $this, 'display_deactivation_message' ) );
165
  }
166
+
167
  /**
168
  * Return an instance of this class.
169
  *
1563
 
1564
  include ADVADS_BASE_PATH . 'admin/views/ad-list-filters.php';
1565
  }
1566
+
1567
+ /**
1568
+ * show instructions to create first ad above the ad list
1569
+ *
1570
+ * @return type
1571
+ */
1572
+ public function no_ads_yet_notice(){
1573
+ $screen = get_current_screen();
1574
+ if ( ! isset( $screen->id ) || $screen->id !== 'edit-advanced_ads' ) {
1575
+ return;
1576
+ }
1577
+
1578
+ // get number of ads
1579
+ $recent_ads = Advanced_Ads::get_instance()->get_model()->get_ads();
1580
+
1581
+ // only display if there are no more than 2 ads
1582
+ if( 3 > count( $recent_ads ) ){
1583
+ include ADVADS_BASE_PATH . 'admin/views/ad-list-no-ads.php';
1584
+ }
1585
+ }
1586
+
1587
 
1588
  /**
1589
  * add a meta box to post type edit screens with ad settings
admin/views/ad-list-no-ads.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="advads-first-ad-links" class="postbox advads-ad-metabox" style="clear: both; margin: 10px 20px 0 2px;">
2
+ <h2><?php _e( 'Not many ads here yet. Get help from the following resources:', 'advanced-ads' ); ?></h2>
3
+ <button type="button" id="advads-first-ad-video-link" class="button-primary"><?php _e( 'Watch the “First Ad” Tutorial (Video)', 'advanced-ads'); ?></button>
4
+ <a href="<?php echo ADVADS_URL . '/manual/ad-templates#utm_source=advanced-ads&utm_medium=link&utm_campaign=first-ad-import'; ?>" target="_blank"><button type="button" class="button-primary"><?php _e( 'Import Ads (Link)', 'advanced-ads'); ?></button></a>
5
+ <a href="<?php echo ADVADS_URL . '/codex/ad-placeholder#utm_source=advanced-ads&utm_medium=link&utm_campaign=first-ad-dummy'; ?>" target="_blank"><button type="button" class="button-primary"><?php _e( 'Get dummy ad content (Link)', 'advanced-ads'); ?></button></a>
6
+ <br class="clear"/>
7
+ </div>
8
+ <script>
9
+ jQuery('#advads-first-ad-video-link').click(function(){
10
+ jQuery( '<br/><iframe width="420" height="315" src="https://www.youtube-nocookie.com/embed/R-LZuEB7MUQ?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>' ).appendTo('#advads-first-ad-links');
11
+ });
12
+ </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.7.4.3
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.4.3' );
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.4.4
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.4.4' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
classes/ad.php CHANGED
@@ -773,9 +773,8 @@ class Advanced_Ads_Ad {
773
 
774
  $wrapper_options = apply_filters( 'advanced-ads-output-wrapper-options', $this->wrapper, $this );
775
 
776
- if ( $wrapper_options == array() || ! is_array( $wrapper_options ) || empty($wrapper_options) ) { return $ad_content; }
777
-
778
- $wrapper = $ad_content;
779
 
780
  // create unique id if not yet given
781
  if ( empty($wrapper_options['id']) ){
773
 
774
  $wrapper_options = apply_filters( 'advanced-ads-output-wrapper-options', $this->wrapper, $this );
775
 
776
+ if ( ( ! isset( $this->output['wrapper-id'] ) || '' === $this->output['wrapper-id'] )
777
+ && $wrapper_options == array() || ! is_array( $wrapper_options ) ) { return $ad_content; }
 
778
 
779
  // create unique id if not yet given
780
  if ( empty($wrapper_options['id']) ){
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.5.2
7
- Stable tag: 1.7.4.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -203,6 +203,12 @@ There is no revenue share. Advanced Ads doesn’t alter your ad codes in a way t
203
 
204
  == Changelog ==
205
 
 
 
 
 
 
 
206
  = 1.7.4.3 =
207
 
208
  * changed content injection parsing from xml to html to decrease issues with broken html
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.5.2
7
+ Stable tag: 1.7.4.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
203
 
204
  == Changelog ==
205
 
206
+ = 1.7.4.4 =
207
+
208
+ * linked first-ad tutorials above ad list if less than 3 ads created yet
209
+ * fixed Wizard buttons not working due to JavaScript conflict
210
+ * fixed manual added container id not displayed for ads not added through placement
211
+
212
  = 1.7.4.3 =
213
 
214
  * changed content injection parsing from xml to html to decrease issues with broken html