Advanced Ads - Version 1.6.5

Version Description

  • removed "use strict" from js
  • hide error message caused by third party code that uses post_updated_messages filter wrong
  • hide licenses tab on non-main-blogs on multisites
  • made plugin name untranslatable
Download this release

Release Info

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

Code changes from version 1.6.4.1 to 1.6.5

admin/assets/js/admin.js CHANGED
@@ -1,6 +1,4 @@
1
  jQuery( document ).ready(function ($) {
2
- "use strict";
3
-
4
  function advads_load_ad_type_parameter_metabox(ad_type) {
5
  $( '#advanced-ads-ad-parameters' ).html( '<span class="spinner advads-ad-parameters-spinner advads-spinner"></span>' );
6
  $.ajax({
1
  jQuery( document ).ready(function ($) {
 
 
2
  function advads_load_ad_type_parameter_metabox(ad_type) {
3
  $( '#advanced-ads-ad-parameters' ).html( '<span class="spinner advads-ad-parameters-spinner advads-spinner"></span>' );
4
  $.ajax({
admin/class-advanced-ads-admin.php CHANGED
@@ -220,7 +220,7 @@ class Advanced_Ads_Admin {
220
 
221
  // add main menu item with overview page
222
  add_menu_page(
223
- __( 'Overview', ADVADS_SLUG ), __( 'Advanced Ads', ADVADS_SLUG ), 'manage_options', $this->plugin_slug, array($this, 'display_overview_page'), 'dashicons-chart-line', '58.74'
224
  );
225
 
226
  add_submenu_page(
@@ -617,9 +617,14 @@ class Advanced_Ads_Admin {
617
  *
618
  * @see wp-admin/edit-form-advanced.php
619
  */
620
- public function ad_update_messages(array $messages){
621
  $post = get_post();
622
 
 
 
 
 
 
623
  $messages[Advanced_Ads::POST_TYPE_SLUG] = array(
624
  0 => '', // Unused. Messages start at index 1.
625
  1 => __( 'Ad updated.', ADVADS_SLUG ),
@@ -688,8 +693,6 @@ class Advanced_Ads_Admin {
688
 
689
  // register settings
690
  register_setting( ADVADS_SLUG, ADVADS_SLUG, array($this, 'sanitize_settings') );
691
- // register license settings
692
- register_setting( ADVADS_SLUG . '-licenses', ADVADS_SLUG . '-licenses', array( $this, 'sanitize_license_keys' ) );
693
 
694
  // general settings section
695
  add_settings_section(
@@ -699,13 +702,20 @@ class Advanced_Ads_Admin {
699
  $hook
700
  );
701
 
702
- // licenses section
703
- add_settings_section(
704
- 'advanced_ads_settings_license_section',
705
- __( 'Licenses', ADVADS_SLUG ),
706
- array($this, 'render_settings_licenses_section_callback'),
707
- 'advanced-ads-settings-license-page'
708
- );
 
 
 
 
 
 
 
709
 
710
  // add setting fields to disable ads
711
  add_settings_field(
@@ -768,6 +778,23 @@ class Advanced_Ads_Admin {
768
  do_action( 'advanced-ads-settings-init', $hook );
769
  }
770
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
771
  /**
772
  * render settings section
773
  *
220
 
221
  // add main menu item with overview page
222
  add_menu_page(
223
+ __( 'Overview', ADVADS_SLUG ), 'Advanced Ads', 'manage_options', $this->plugin_slug, array($this, 'display_overview_page'), 'dashicons-chart-line', '58.74'
224
  );
225
 
226
  add_submenu_page(
617
  *
618
  * @see wp-admin/edit-form-advanced.php
619
  */
620
+ public function ad_update_messages($messages = array()){
621
  $post = get_post();
622
 
623
+ // added to hide error message caused by third party code that uses post_updated_messages filter wrong
624
+ if( ! is_array( $messages )){
625
+ return $messages;
626
+ }
627
+
628
  $messages[Advanced_Ads::POST_TYPE_SLUG] = array(
629
  0 => '', // Unused. Messages start at index 1.
630
  1 => __( 'Ad updated.', ADVADS_SLUG ),
693
 
694
  // register settings
695
  register_setting( ADVADS_SLUG, ADVADS_SLUG, array($this, 'sanitize_settings') );
 
 
696
 
697
  // general settings section
698
  add_settings_section(
702
  $hook
703
  );
704
 
705
+ // licenses section only for main blog
706
+ if( is_main_site( get_current_blog_id() ) ){
707
+ // register license settings
708
+ register_setting( ADVADS_SLUG . '-licenses', ADVADS_SLUG . '-licenses', array( $this, 'sanitize_license_keys' ) );
709
+
710
+ add_settings_section(
711
+ 'advanced_ads_settings_license_section',
712
+ __( 'Licenses', ADVADS_SLUG ),
713
+ array($this, 'render_settings_licenses_section_callback'),
714
+ 'advanced-ads-settings-license-page'
715
+ );
716
+
717
+ add_filter( 'advanced-ads-setting-tabs', array( $this, 'license_tab') );
718
+ }
719
 
720
  // add setting fields to disable ads
721
  add_settings_field(
778
  do_action( 'advanced-ads-settings-init', $hook );
779
  }
780
 
781
+ /**
782
+ * add license tab
783
+ *
784
+ * arr $tabs setting tabs
785
+ */
786
+ public function license_tab( array $tabs ){
787
+
788
+ $tabs['licenses'] = array(
789
+ 'page' => 'advanced-ads-settings-license-page',
790
+ 'group' => ADVADS_SLUG . '-licenses',
791
+ 'tabid' => 'licenses',
792
+ 'title' => __( 'Licenses', ADVADS_SLUG )
793
+ );
794
+
795
+ return $tabs;
796
+ }
797
+
798
  /**
799
  * render settings section
800
  *
admin/views/settings.php CHANGED
@@ -10,12 +10,6 @@ $setting_tabs = apply_filters('advanced-ads-setting-tabs', array(
10
  'group' => ADVADS_SLUG,
11
  'tabid' => 'general',
12
  'title' => __( 'General', ADVADS_SLUG )
13
- ),
14
- 'licenses' => array(
15
- 'page' => 'advanced-ads-settings-license-page',
16
- 'group' => ADVADS_SLUG . '-licenses',
17
- 'tabid' => 'licenses',
18
- 'title' => __( 'Licenses', ADVADS_SLUG )
19
  )
20
  ));
21
  ?><div class="wrap">
10
  'group' => ADVADS_SLUG,
11
  'tabid' => 'general',
12
  'title' => __( 'General', ADVADS_SLUG )
 
 
 
 
 
 
13
  )
14
  ));
15
  ?><div class="wrap">
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.4.1
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.4.1' );
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.5
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.5' );
42
 
43
  /*----------------------------------------------------------------------------*
44
  * Autoloading, modules and functions
classes/widget.php CHANGED
@@ -18,7 +18,7 @@ class Advanced_Ads_Widget extends WP_Widget {
18
  function __construct() {
19
  $widget_ops = array('classname' => 'advads_widget', 'description' => __( 'Display Ads and Ad Groups.', ADVADS_SLUG ));
20
  $control_ops = array();
21
- parent::__construct( 'advads_ad_widget', __( 'Advanced Ads', ADVADS_SLUG ), $widget_ops, $control_ops );
22
  }
23
 
24
  function widget($args, $instance) {
18
  function __construct() {
19
  $widget_ops = array('classname' => 'advads_widget', 'description' => __( 'Display Ads and Ad Groups.', ADVADS_SLUG ));
20
  $control_ops = array();
21
+ parent::__construct( 'advads_ad_widget','Advanced Ads', $widget_ops, $control_ops );
22
  }
23
 
24
  function widget($args, $instance) {
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 3.5, PHP 5.3
6
  Tested up to: 4.2.2
7
- Stable tag: 1.6.4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -178,6 +178,13 @@ There is no revenue share. Advanced Ads doesn’t alter your ad codes in a way t
178
 
179
  == Changelog ==
180
 
 
 
 
 
 
 
 
181
  = 1.6.4.1 =
182
 
183
  * fixed free-add-on notice not closing forever
4
  Tags: ads, ad, adsense, display, banner, advertisements, adverts, advert, monetization
5
  Requires at least: WP 3.5, PHP 5.3
6
  Tested up to: 4.2.2
7
+ Stable tag: 1.6.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
178
 
179
  == Changelog ==
180
 
181
+ = 1.6.5 =
182
+
183
+ * removed "use strict" from js
184
+ * hide error message caused by third party code that uses post_updated_messages filter wrong
185
+ * hide licenses tab on non-main-blogs on multisites
186
+ * made plugin name untranslatable
187
+
188
  = 1.6.4.1 =
189
 
190
  * fixed free-add-on notice not closing forever