Ad Inserter – WordPress Ads Management with AdSense Header Integration - Version 2.0.12

Version Description

  • Bug fix for page/post exceptions list
Download this release

Release Info

Developer spacetime
Plugin Icon 128x128 Ad Inserter – WordPress Ads Management with AdSense Header Integration
Version 2.0.12
Comparing to
See all releases

Code changes from version 2.0.11 to 2.0.12

Files changed (6) hide show
  1. ad-inserter.php +4 -1
  2. constants.php +1 -1
  3. css/ad-inserter.css +1 -1
  4. js/ad-inserter.js +1 -1
  5. readme.txt +7 -1
  6. settings.php +33 -21
ad-inserter.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Ad Inserter
4
- Version: 2.0.11
5
  Description: Insert any ad or code into Wordpress. Perfect for all kinds of ads. Simply enter any ad or HTML/Javascript/PHP code and select where and how you want to display it.
6
  Author: Igor Funa
7
  Author URI: http://igorfuna.com/
@@ -11,6 +11,9 @@ Plugin URI: http://adinserter.pro/documentation
11
  /*
12
  Change Log
13
 
 
 
 
14
  Ad Inserter 2.0.11 - 29 January 2017
15
  - Bug fix for settings page not loading
16
 
1
  <?php
2
  /*
3
  Plugin Name: Ad Inserter
4
+ Version: 2.0.12
5
  Description: Insert any ad or code into Wordpress. Perfect for all kinds of ads. Simply enter any ad or HTML/Javascript/PHP code and select where and how you want to display it.
6
  Author: Igor Funa
7
  Author URI: http://igorfuna.com/
11
  /*
12
  Change Log
13
 
14
+ Ad Inserter 2.0.12 - 29 January 2017
15
+ - Bug fix for page/post exceptions list
16
+
17
  Ad Inserter 2.0.11 - 29 January 2017
18
  - Bug fix for settings page not loading
19
 
constants.php CHANGED
@@ -11,7 +11,7 @@ if (!defined( 'AD_INSERTER_NAME'))
11
  define ('AD_INSERTER_NAME', 'Ad Inserter');
12
 
13
  if (!defined( 'AD_INSERTER_VERSION'))
14
- define ('AD_INSERTER_VERSION', '2.0.11');
15
 
16
  if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
17
  define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
11
  define ('AD_INSERTER_NAME', 'Ad Inserter');
12
 
13
  if (!defined( 'AD_INSERTER_VERSION'))
14
+ define ('AD_INSERTER_VERSION', '2.0.12');
15
 
16
  if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
17
  define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
css/ad-inserter.css CHANGED
@@ -1,5 +1,5 @@
1
  #data {
2
- font-family: "2.0.11"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
1
  #data {
2
+ font-family: "2.0.12"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
js/ad-inserter.js CHANGED
@@ -1,4 +1,4 @@
1
- var javascript_version = "2.0.11";
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
1
+ var javascript_version = "2.0.12";
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: adsense, amazon, advertising, ad, advert, html, javascript, php, code, widget, sidebar, responsive, viewport, rotating, banner, ad rotation, geo targeting, multisite, contextual, shortcodes, widgets, header, footer, mobile, desktop, phone, tablet, custom css, category, tag, filter, url, caching support
5
  Requires at least: 4.0
6
  Tested up to: 4.7.2
7
- Stable tag: 2.0.10
8
  License: GPLv3
9
 
10
  Insert any advert or code into Wordpress. Perfect for all kinds of banners and ads including AdSense and Amazon. Powerful features, simple use.
@@ -655,6 +655,9 @@ AD CODE RIGHT
655
 
656
  == Changelog ==
657
 
 
 
 
658
  = 2.0.11 =
659
  - Bug fix for settings page not loading
660
 
@@ -954,6 +957,9 @@ AD CODE RIGHT
954
 
955
  == Upgrade Notice ==
956
 
 
 
 
957
  = 2.0.11 =
958
  Bug fix for settings page not loading
959
 
4
  Tags: adsense, amazon, advertising, ad, advert, html, javascript, php, code, widget, sidebar, responsive, viewport, rotating, banner, ad rotation, geo targeting, multisite, contextual, shortcodes, widgets, header, footer, mobile, desktop, phone, tablet, custom css, category, tag, filter, url, caching support
5
  Requires at least: 4.0
6
  Tested up to: 4.7.2
7
+ Stable tag: 2.0.11
8
  License: GPLv3
9
 
10
  Insert any advert or code into Wordpress. Perfect for all kinds of banners and ads including AdSense and Amazon. Powerful features, simple use.
655
 
656
  == Changelog ==
657
 
658
+ = 2.0.12 =
659
+ - Bug fix for page/post exceptions list
660
+
661
  = 2.0.11 =
662
  - Bug fix for settings page not loading
663
 
957
 
958
  == Upgrade Notice ==
959
 
960
+ = 2.0.12 =
961
+ Bug fix for page/post exceptions list
962
+
963
  = 2.0.11 =
964
  Bug fix for settings page not loading
965
 
settings.php CHANGED
@@ -34,26 +34,38 @@ function generate_settings_form (){
34
 
35
  $default = $block_object [0];
36
 
37
- $pages = get_pages ();
38
- $posts_pages = array ('pages' => $pages);
39
-
40
- // $args = array( 'posts_per_page' => -1);
41
- // $posts_pages ['posts'] = get_posts ($args);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  $exceptions = array ();
44
- foreach ($posts_pages as $type => $post_page) {
45
- foreach ($post_page as $page) {
46
- $post_meta = get_post_meta ($page->ID, '_adinserter_block_exceptions', true);
47
- if ($post_meta == '') continue;
48
- $exceptions [$page->ID] = array ('post' => $type == 'posts', 'title' => $page->post_title, 'blocks' => $post_meta);
49
-
50
- $selected_blocks = explode (",", $post_meta);
51
- foreach ($selected_blocks as $selected_block) {
52
- $block_exceptions [$selected_block][$page->ID] = array ('post' => $type == 'posts', 'title' => $page->post_title);
53
- }
54
  }
55
  }
56
- ksort ($exceptions);
57
  ?>
58
 
59
  <div id="data" style="display: none;" version="<?php echo AD_INSERTER_VERSION; ?>" theme="<?php echo $syntax_highlighter_theme; ?>" javascript_debugging="<?php echo get_javascript_debugging () ? '1' : '0'; ?>" ></div>
@@ -444,11 +456,10 @@ function generate_settings_form (){
444
  <?php
445
 
446
  if (!empty ($block_exceptions [$ad_number])) {
447
- ksort ($block_exceptions [$ad_number])
448
  ?>
449
  <table class="exceptions" cellspacing=0 cellpadding=0><tbody>
450
  <tr>
451
- <th class="id">ID</th><th class="page page-only">&nbsp;Page / Post</th><th>
452
  <input id="clear-block-exceptions-<?php echo $ad_number; ?>"
453
  onclick="if (confirm('Are you sure you want to clear all exceptions for block <?php echo $ad_number; ?>?')) {document.getElementById ('clear-block-exceptions-<?php echo $ad_number; ?>').style.visibility = 'hidden'; document.getElementById ('clear-block-exceptions-<?php echo $ad_number; ?>').style.fontSize = '1px'; document.getElementById ('clear-block-exceptions-<?php echo $ad_number; ?>').value = '<?php echo $ad_number; ?>'; return true;} return false"
454
  title="Clear all exceptions for block <?php echo $ad_number; ?>"
@@ -462,9 +473,10 @@ function generate_settings_form (){
462
  ?>
463
  <tr>
464
  <td class="id"><a href="<?php
465
- get_permalink ($id); ?>" target="_blank" title="View" style="color: #222;"><?php
466
- echo $id; ?></a></td><td class="page page-only"><a href="<?php
467
- get_edit_post_link ($id); ?>" target="_blank" title="Edit" style="margin-left: 2px; color: #222;"><?php
 
468
  echo $exception ['title']; ?></a></td><td></td>
469
  </tr>
470
  <?php
34
 
35
  $default = $block_object [0];
36
 
37
+ $args = array (
38
+ 'posts_per_page' => - 1,
39
+ 'offset' => 0,
40
+ 'category' => '',
41
+ 'category_name' => '',
42
+ 'orderby' => 'type',
43
+ 'order' => 'ASC',
44
+ 'include' => '',
45
+ 'exclude' => '',
46
+ 'meta_key' => '_adinserter_block_exceptions',
47
+ 'meta_value' => '',
48
+ 'post_type' => array ('post', 'page'),
49
+ 'post_mime_type' => '',
50
+ 'post_parent' => '',
51
+ 'author' => '',
52
+ 'author_name' => '',
53
+ 'post_status' => '',
54
+ 'suppress_filters' => true
55
+ );
56
+ $posts_pages = get_posts ($args);
57
 
58
  $exceptions = array ();
59
+ foreach ($posts_pages as $page) {
60
+ $post_meta = get_post_meta ($page->ID, '_adinserter_block_exceptions', true);
61
+ if ($post_meta == '') continue;
62
+ $exceptions [$page->ID] = array ('type' => $page->post_type, 'title' => $page->post_title, 'blocks' => $post_meta);
63
+
64
+ $selected_blocks = explode (",", $post_meta);
65
+ foreach ($selected_blocks as $selected_block) {
66
+ $block_exceptions [$selected_block][$page->ID] = array ('type' => $page->post_type, 'title' => $page->post_title);
 
 
67
  }
68
  }
 
69
  ?>
70
 
71
  <div id="data" style="display: none;" version="<?php echo AD_INSERTER_VERSION; ?>" theme="<?php echo $syntax_highlighter_theme; ?>" javascript_debugging="<?php echo get_javascript_debugging () ? '1' : '0'; ?>" ></div>
456
  <?php
457
 
458
  if (!empty ($block_exceptions [$ad_number])) {
 
459
  ?>
460
  <table class="exceptions" cellspacing=0 cellpadding=0><tbody>
461
  <tr>
462
+ <th class="id">ID</th><th class="id">Type</th><th class="page page-only">&nbsp;Page / Post</th><th>
463
  <input id="clear-block-exceptions-<?php echo $ad_number; ?>"
464
  onclick="if (confirm('Are you sure you want to clear all exceptions for block <?php echo $ad_number; ?>?')) {document.getElementById ('clear-block-exceptions-<?php echo $ad_number; ?>').style.visibility = 'hidden'; document.getElementById ('clear-block-exceptions-<?php echo $ad_number; ?>').style.fontSize = '1px'; document.getElementById ('clear-block-exceptions-<?php echo $ad_number; ?>').value = '<?php echo $ad_number; ?>'; return true;} return false"
465
  title="Clear all exceptions for block <?php echo $ad_number; ?>"
473
  ?>
474
  <tr>
475
  <td class="id"><a href="<?php
476
+ echo get_permalink ($id); ?>" target="_blank" title="View" style="color: #222;"><?php
477
+ echo $id; ?></a></td><td><?php
478
+ echo ucfirst ($exception ['type']); ?></td><td class="page page-only"><a href="<?php
479
+ echo get_edit_post_link ($id); ?>" target="_blank" title="Edit" style="margin-left: 2px; color: #222;"><?php
480
  echo $exception ['title']; ?></a></td><td></td>
481
  </tr>
482
  <?php