Wp-Insert - Version 2.1.4

Version Description

Download this release

Release Info

Developer namith.jawahar
Plugin Icon 128x128 Wp-Insert
Version 2.1.4
Comparing to
See all releases

Code changes from version 2.1.3 to 2.1.4

Files changed (3) hide show
  1. includes/common/rules.php +9 -9
  2. readme.txt +1 -1
  3. wp-insert.php +2 -2
includes/common/rules.php CHANGED
@@ -69,11 +69,11 @@ function wp_insert_get_ad_status($rules) {
69
  return false;
70
  }
71
 
72
- if(isset($rules['rules_exclude_loggedin']) && filter_var($rules['rules_exclude_loggedin'], FILTER_VALIDATE_BOOLEAN) && is_user_logged_in()) {
73
  return false;
74
  }
75
 
76
- if(isset($rules['rules_exclude_mobile_devices']) && filter_var($rules['rules_exclude_mobile_devices'], FILTER_VALIDATE_BOOLEAN) && wp_is_mobile()) {
77
  return false;
78
  }
79
 
@@ -81,35 +81,35 @@ function wp_insert_get_ad_status($rules) {
81
  $page_details = wp_insert_get_page_details();
82
  switch($page_details['type']) {
83
  case 'HOME':
84
- if(isset($rules['rules_exclude_home']) && filter_var($rules['rules_exclude_home'], FILTER_VALIDATE_BOOLEAN)) {
85
  return false;
86
  } else if(isset($rules['rules_home_instances']) && is_array($rules['rules_home_instances']) && (in_array($wpInsertPostInstance, $rules['rules_home_instances']))) {
87
  return false;
88
  }
89
  break;
90
  case 'ARCHIVE':
91
- if(isset($rules['rules_exclude_archives']) && filter_var($rules['rules_exclude_archives'], FILTER_VALIDATE_BOOLEAN)) {
92
  return false;
93
  } else if(isset($rules['rules_archives_instances']) && is_array($rules['rules_archives_instances']) && (in_array($wpInsertPostInstance, $rules['rules_archives_instances']))) {
94
  return false;
95
  }
96
  break;
97
  case 'SEARCH':
98
- if(isset($rules['rules_exclude_search']) && filter_var($rules['rules_exclude_search'], FILTER_VALIDATE_BOOLEAN)) {
99
  return false;
100
  } else if(isset($rules['rules_search_instances']) && is_array($rules['rules_search_instances']) && (in_array($wpInsertPostInstance, $rules['rules_search_instances']))) {
101
  return false;
102
  }
103
  break;
104
  case 'PAGE':
105
- if(isset($rules['rules_exclude_page']) && filter_var($rules['rules_exclude_page'], FILTER_VALIDATE_BOOLEAN)) {
106
  return false;
107
  } else if(isset($rules['rules_page_exceptions']) && is_array($rules['rules_page_exceptions']) && (in_array($page_details['ID'], $rules['rules_page_exceptions']))) {
108
  return false;
109
  }
110
  break;
111
  case 'POST':
112
- if(isset($rules['rules_exclude_post']) && filter_var($rules['rules_exclude_post'], FILTER_VALIDATE_BOOLEAN)) {
113
  return false;
114
  } else if(isset($rules['rules_post_exceptions']) && is_array($rules['rules_post_exceptions']) && (in_array($page_details['ID'], $rules['rules_post_exceptions']))) {
115
  return false;
@@ -118,7 +118,7 @@ function wp_insert_get_ad_status($rules) {
118
  }
119
  break;
120
  case 'CATEGORY':
121
- if(isset($rules['rules_exclude_categories']) && filter_var($rules['rules_exclude_categories'], FILTER_VALIDATE_BOOLEAN)) {
122
  return false;
123
  } else if(isset($rules['rules_categories_exceptions']) && is_array($rules['rules_categories_exceptions']) && (in_array($page_details['ID'], $rules['rules_categories_exceptions']))) {
124
  return false;
@@ -127,7 +127,7 @@ function wp_insert_get_ad_status($rules) {
127
  }
128
  break;
129
  case 'CUSTOM':
130
- if(isset($rules['rules_exclude_cpt_'.$page_details['type_name']]) && filter_var($rules['rules_exclude_cpt_'.$page_details['type_name']], FILTER_VALIDATE_BOOLEAN)) {
131
  return false;
132
  }
133
  break;
69
  return false;
70
  }
71
 
72
+ if(isset($rules['rules_exclude_loggedin']) && wp_validate_boolean($rules['rules_exclude_loggedin']) && is_user_logged_in()) {
73
  return false;
74
  }
75
 
76
+ if(isset($rules['rules_exclude_mobile_devices']) && wp_validate_boolean($rules['rules_exclude_mobile_devices']) && wp_is_mobile()) {
77
  return false;
78
  }
79
 
81
  $page_details = wp_insert_get_page_details();
82
  switch($page_details['type']) {
83
  case 'HOME':
84
+ if(isset($rules['rules_exclude_home']) && wp_validate_boolean($rules['rules_exclude_home']) ) {
85
  return false;
86
  } else if(isset($rules['rules_home_instances']) && is_array($rules['rules_home_instances']) && (in_array($wpInsertPostInstance, $rules['rules_home_instances']))) {
87
  return false;
88
  }
89
  break;
90
  case 'ARCHIVE':
91
+ if(isset($rules['rules_exclude_archives']) && wp_validate_boolean($rules['rules_exclude_archives']) ) {
92
  return false;
93
  } else if(isset($rules['rules_archives_instances']) && is_array($rules['rules_archives_instances']) && (in_array($wpInsertPostInstance, $rules['rules_archives_instances']))) {
94
  return false;
95
  }
96
  break;
97
  case 'SEARCH':
98
+ if(isset($rules['rules_exclude_search']) && wp_validate_boolean($rules['rules_exclude_search']) ) {
99
  return false;
100
  } else if(isset($rules['rules_search_instances']) && is_array($rules['rules_search_instances']) && (in_array($wpInsertPostInstance, $rules['rules_search_instances']))) {
101
  return false;
102
  }
103
  break;
104
  case 'PAGE':
105
+ if(isset($rules['rules_exclude_page']) && wp_validate_boolean($rules['rules_exclude_page']) ) {
106
  return false;
107
  } else if(isset($rules['rules_page_exceptions']) && is_array($rules['rules_page_exceptions']) && (in_array($page_details['ID'], $rules['rules_page_exceptions']))) {
108
  return false;
109
  }
110
  break;
111
  case 'POST':
112
+ if(isset($rules['rules_exclude_post']) && wp_validate_boolean($rules['rules_exclude_post']) ) {
113
  return false;
114
  } else if(isset($rules['rules_post_exceptions']) && is_array($rules['rules_post_exceptions']) && (in_array($page_details['ID'], $rules['rules_post_exceptions']))) {
115
  return false;
118
  }
119
  break;
120
  case 'CATEGORY':
121
+ if(isset($rules['rules_exclude_categories']) && wp_validate_boolean($rules['rules_exclude_categories']) ) {
122
  return false;
123
  } else if(isset($rules['rules_categories_exceptions']) && is_array($rules['rules_categories_exceptions']) && (in_array($page_details['ID'], $rules['rules_categories_exceptions']))) {
124
  return false;
127
  }
128
  break;
129
  case 'CUSTOM':
130
+ if(isset($rules['rules_exclude_cpt_'.$page_details['type_name']]) && wp_validate_boolean($rules['rules_exclude_cpt_'.$page_details['type_name']])) {
131
  return false;
132
  }
133
  break;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: ads,adsense,advertising,advertisement,google ads,ad widget,analytics,googl
4
  Donate link: http://wpinsert.smartlogix.co.in/support/
5
  Requires at least: 4.1.0
6
  Tested up to: 4.4
7
- Stable tag: 2.1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
4
  Donate link: http://wpinsert.smartlogix.co.in/support/
5
  Requires at least: 4.1.0
6
  Tested up to: 4.4
7
+ Stable tag: 2.1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
wp-insert.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Wp-Insert
4
  Plugin URI: http://www.wp-insert.smartlogix.co.in/
5
  Description: WP-INSERT by SMARTLOGIX : The Ultimate Adsense / Ad-Management Plugin for WordPress
6
- Version: 2.1.3
7
  Author: Namith Jawahar
8
  Author URI: http://www.smartlogix.co.in/
9
  WP-INSERT by SMARTLOGIX : The Ultimate Adsense / Ad-Management Plugin for WordPress
@@ -31,7 +31,7 @@ if(!defined('WP_INSERT_URL'))
31
  if(!defined('WP_INSERT_DIR'))
32
  define('WP_INSERT_DIR', plugin_dir_path(__FILE__));
33
  if(!defined('WP_INSERT_VERSION'))
34
- define('WP_INSERT_VERSION', '2.1.3');
35
  /*Includes*/
36
  require_once(dirname(__FILE__).'/includes/common/common.php');
37
  require_once(dirname(__FILE__).'/includes/controls/controls.php');
3
  Plugin Name: Wp-Insert
4
  Plugin URI: http://www.wp-insert.smartlogix.co.in/
5
  Description: WP-INSERT by SMARTLOGIX : The Ultimate Adsense / Ad-Management Plugin for WordPress
6
+ Version: 2.1.4
7
  Author: Namith Jawahar
8
  Author URI: http://www.smartlogix.co.in/
9
  WP-INSERT by SMARTLOGIX : The Ultimate Adsense / Ad-Management Plugin for WordPress
31
  if(!defined('WP_INSERT_DIR'))
32
  define('WP_INSERT_DIR', plugin_dir_path(__FILE__));
33
  if(!defined('WP_INSERT_VERSION'))
34
+ define('WP_INSERT_VERSION', '2.1.4');
35
  /*Includes*/
36
  require_once(dirname(__FILE__).'/includes/common/common.php');
37
  require_once(dirname(__FILE__).'/includes/controls/controls.php');