Advanced Ads - Version 1.8.15

Version Description

  • use code highlighting by default for plain text ad type
  • fixed newsletter signup form
  • fixed bug that shows install message for Genesis add-on even if already installed
Download this release

Release Info

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

Code changes from version 1.8.14 to 1.8.15

admin/class-advanced-ads-admin.php CHANGED
@@ -355,6 +355,11 @@ class Advanced_Ads_Admin {
355
  * @return array $links
356
  */
357
  public function add_plugin_links( $links ) {
 
 
 
 
 
358
  // add link to settings
359
  //$settings_link = '<a href="' . admin_url( 'admin.php?page=advanced_ads&page=advanced-ads-settings' ) . '">' . __( 'Settings', 'advanced-ads' ) . '</a>';
360
  //array_unshift( $links, $settings_link );
355
  * @return array $links
356
  */
357
  public function add_plugin_links( $links ) {
358
+
359
+ if( ! is_array( $links ) ){
360
+ return $links;
361
+ }
362
+
363
  // add link to settings
364
  //$settings_link = '<a href="' . admin_url( 'admin.php?page=advanced_ads&page=advanced-ads-settings' ) . '">' . __( 'Settings', 'advanced-ads' ) . '</a>';
365
  //array_unshift( $links, $settings_link );
admin/includes/class-ad-type.php CHANGED
@@ -41,6 +41,7 @@ class Advanced_Ads_Admin_Ad_Type {
41
  add_action( 'edit_form_after_title', array($this, 'edit_form_below_title') );
42
  add_action( 'dbx_post_sidebar', array($this, 'edit_form_end') );
43
  add_action( 'post_submitbox_misc_actions', array($this, 'add_submit_box_meta') );
 
44
 
45
  // ad updated messages
46
  add_filter( 'post_updated_messages', array($this, 'ad_update_messages') );
@@ -476,6 +477,38 @@ class Advanced_Ads_Admin_Ad_Type {
476
 
477
  include ADVADS_BASE_PATH . 'admin/views/ad-submitbox-meta.php';
478
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479
 
480
  /**
481
  * edit ad update messages
41
  add_action( 'edit_form_after_title', array($this, 'edit_form_below_title') );
42
  add_action( 'dbx_post_sidebar', array($this, 'edit_form_end') );
43
  add_action( 'post_submitbox_misc_actions', array($this, 'add_submit_box_meta') );
44
+ add_action( 'admin_enqueue_scripts', array($this, 'use_code_editor') );
45
 
46
  // ad updated messages
47
  add_filter( 'post_updated_messages', array($this, 'ad_update_messages') );
477
 
478
  include ADVADS_BASE_PATH . 'admin/views/ad-submitbox-meta.php';
479
  }
480
+
481
+ /**
482
+ * use CodeMirror for plain text input field
483
+ *
484
+ * needs WordPress 4.9 and higher
485
+ *
486
+ * @since 1.8.15
487
+ */
488
+ public function use_code_editor(){
489
+ global $wp_version;
490
+ if ( 'advanced_ads' !== get_current_screen()->id
491
+ || defined( 'ADVANCED_ADS_DISABLE_CODE_HIGHLIGHTING' )
492
+ || -1 === version_compare( $wp_version, '4.9' ) ) {
493
+ return;
494
+ }
495
+
496
+ // Enqueue code editor and settings for manipulating HTML.
497
+ $settings = wp_enqueue_code_editor( array( 'type' => 'application/x-httpd-php' ) );
498
+
499
+ // Bail if user disabled CodeMirror.
500
+ if ( false === $settings ) {
501
+ return;
502
+ }
503
+
504
+ wp_add_inline_script(
505
+ 'code-editor',
506
+ sprintf(
507
+ 'jQuery( function() { wp.codeEditor.initialize( "advads-ad-content-plain", %s ); } );',
508
+ wp_json_encode( $settings )
509
+ )
510
+ );
511
+ }
512
 
513
  /**
514
  * edit ad update messages
admin/includes/class-overview-widgets.php CHANGED
@@ -198,14 +198,6 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
198
  'link' => ADVADS_URL . 'add-ons/slider/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
199
  'order' => 5,
200
  ),
201
- 'code-highlighter' => array(
202
- 'title' => 'Code Highlighter',
203
- 'desc' => __( 'Are you using the plain text & code ad type a lot? Install this add-on to show the code highlighted like in a real IDE.', 'advanced-ads' ),
204
- 'class' => 'free',
205
- 'link' => wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . 'advanced-ads-code-highlighter'), 'install-plugin_' . 'advanced-ads-code-highlighter'),
206
- 'link_title' => __( 'Install now', 'advanced-ads' ),
207
- 'order' => 9,
208
- ),
209
  'adsense-in-feed' => array(
210
  'title' => 'AdSense In-feed',
211
  'desc' => __( 'Place AdSense In-feed ads between posts on homepage, category, and archive pages.', 'advanced-ads' ),
@@ -220,12 +212,6 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
220
  $installed_plugins = get_plugins();
221
  $installed_pro_plugins = 0;
222
 
223
- // handle Code Highlighter if already installed or not activated
224
- if( isset( $installed_plugins['advanced-ads-code-highlighter/advanced-ads-code-highlighter.php'] ) ) {
225
- // remove plugin from the list
226
- unset( $add_ons['code-highlighter'] );
227
- }
228
-
229
  // handle AdSense In-feed if already installed or not activated
230
  if( isset( $installed_plugins['advanced-ads-adsense-in-feed/advanced-ads-in-feed.php'] ) ){ // is installed, but not active
231
  // remove plugin from the list
@@ -393,9 +379,9 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
393
  'link_title' => __( 'Install now', 'advanced-ads' ),
394
  );
395
  // handle install link as long as we can not be sure this is done by the Genesis plugin itself
396
- if( isset( $installed_plugins['genesis-ads/genesis-ads.php'] ) ){ // is installed, but not active
397
  unset( $add_ons['genesis'] );
398
- }
399
  }
400
 
401
  // add Visual Composer Ads, if VC was detected
@@ -409,7 +395,7 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
409
  'link_title' => __( 'Install now', 'advanced-ads' ),
410
  );
411
  // handle install link as long as we can not be sure this is done by the Genesis plugin itself
412
- if( isset( $installed_plugins['ads-for-visual-composer/advanced-ads-vc.php'] ) ){ // is installed, but not activated
413
  unset( $add_ons['visual_composer'] );
414
  }
415
  }
198
  'link' => ADVADS_URL . 'add-ons/slider/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
199
  'order' => 5,
200
  ),
 
 
 
 
 
 
 
 
201
  'adsense-in-feed' => array(
202
  'title' => 'AdSense In-feed',
203
  'desc' => __( 'Place AdSense In-feed ads between posts on homepage, category, and archive pages.', 'advanced-ads' ),
212
  $installed_plugins = get_plugins();
213
  $installed_pro_plugins = 0;
214
 
 
 
 
 
 
 
215
  // handle AdSense In-feed if already installed or not activated
216
  if( isset( $installed_plugins['advanced-ads-adsense-in-feed/advanced-ads-in-feed.php'] ) ){ // is installed, but not active
217
  // remove plugin from the list
379
  'link_title' => __( 'Install now', 'advanced-ads' ),
380
  );
381
  // handle install link as long as we can not be sure this is done by the Genesis plugin itself
382
+ if( isset( $installed_plugins['advanced-ads-genesis/genesis-ads.php'] ) ){ // is installed (active or not)
383
  unset( $add_ons['genesis'] );
384
+ }
385
  }
386
 
387
  // add Visual Composer Ads, if VC was detected
395
  'link_title' => __( 'Install now', 'advanced-ads' ),
396
  );
397
  // handle install link as long as we can not be sure this is done by the Genesis plugin itself
398
+ if( isset( $installed_plugins['ads-for-visual-composer/advanced-ads-vc.php'] ) ){ // is installed (active or not)
399
  unset( $add_ons['visual_composer'] );
400
  }
401
  }
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.8.14
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, textdomain
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
- define( 'ADVADS_VERSION', '1.8.14' );
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.8.15
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, textdomain
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
+ define( 'ADVADS_VERSION', '1.8.15' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
classes/ad_ajax_callbacks.php CHANGED
@@ -197,7 +197,7 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
197
  check_ajax_referer('advanced-ads-admin-ajax-nonce', 'nonce');
198
 
199
  if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_see_interface') )
200
- || empty( $_POST['notice'] )
201
  ) {
202
  die();
203
  }
197
  check_ajax_referer('advanced-ads-admin-ajax-nonce', 'nonce');
198
 
199
  if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_see_interface') )
200
+ || empty( $_POST['notice'] )
201
  ) {
202
  die();
203
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: ads, ad, ad inserter, ad injection, ad manager, ads manager, ad widget, ad
5
  Requires at least: 4.6
6
  Tested up to: 4.9
7
  Requires PHP: 5.2
8
- Stable tag: 1.8.14
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -224,12 +224,18 @@ Yes. Advanced Ads is based on WordPress standards and therefore easily customiza
224
 
225
  1. Placements that let you inject ads anywhere into your site without coding (7 in Advanced Ads + 14 through add-ons).
226
  2. Support for all kinds of ad types, including dedicated AdSense type. AMP is included in the Responsive add-on.
227
- 3. Flexible ad input with the Plain Text ad type.
228
  4. Align your ads within the content.
229
  5. Choose from various conditions where and to whom to display your ads.
230
 
231
  == Changelog ==
232
 
 
 
 
 
 
 
233
  = 1.8.14 =
234
 
235
  * prevent ad injection on BuddyPress image upload pages
5
  Requires at least: 4.6
6
  Tested up to: 4.9
7
  Requires PHP: 5.2
8
+ Stable tag: 1.8.15
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
224
 
225
  1. Placements that let you inject ads anywhere into your site without coding (7 in Advanced Ads + 14 through add-ons).
226
  2. Support for all kinds of ad types, including dedicated AdSense type. AMP is included in the Responsive add-on.
227
+ 3. Flexible ad input with the Plain Text ad type and code highlighting.
228
  4. Align your ads within the content.
229
  5. Choose from various conditions where and to whom to display your ads.
230
 
231
  == Changelog ==
232
 
233
+ = 1.8.15 =
234
+
235
+ * use code highlighting by default for plain text ad type
236
+ * fixed newsletter signup form
237
+ * fixed bug that shows install message for Genesis add-on even if already installed
238
+
239
  = 1.8.14 =
240
 
241
  * prevent ad injection on BuddyPress image upload pages