Wp-Insert - Version 2.1.7

Version Description

Download this release

Release Info

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

Code changes from version 2.1.6 to 2.1.7

includes/adwidgets.php CHANGED
@@ -89,35 +89,33 @@ function wp_insert_adwidgets_form_get_content($identifier) {
89
  echo $control->HTML;
90
  $control->clear_controls();
91
 
 
 
 
 
 
 
92
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_home'));
93
  $control->create_section('Home');
94
- $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
95
  echo $control->HTML;
96
  $control->clear_controls();
97
 
98
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_archives'));
99
  $control->create_section('Archives');
100
- $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
101
  echo $control->HTML;
102
  $control->clear_controls();
103
 
104
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_search'));
105
  $control->create_section('Search Results');
106
- $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
107
  echo $control->HTML;
108
  $control->clear_controls();
109
 
110
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_page'));
111
  $control->add_control(array('type' => 'pages-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_page_exceptions'));
112
  $control->create_section('Single Pages');
113
- $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
114
- echo $control->HTML;
115
- $control->clear_controls();
116
-
117
- $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_post'));
118
- $control->add_control(array('type' => 'posts-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_post_exceptions'));
119
- $control->add_control(array('type' => 'categories-chosen-multiselect', 'label' => 'Category Exceptions', 'optionName' => 'rules_post_categories_exceptions'));
120
- $control->create_section('Single Posts');
121
  $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
122
  echo $control->HTML;
123
  $control->clear_controls();
@@ -127,6 +125,14 @@ function wp_insert_adwidgets_form_get_content($identifier) {
127
  $control->create_section('Category Archives');
128
  $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
129
  echo $control->HTML;
 
 
 
 
 
 
 
 
130
  $control->clear_controls();
131
 
132
  echo '</div>';
@@ -188,6 +194,7 @@ function wp_insert_adwidgets_form_save_action($identifier) {
188
 
189
  $adwidgets[$identifier]['rules_exclude_loggedin'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_loggedin']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_loggedin']:'');
190
  $adwidgets[$identifier]['rules_exclude_mobile_devices'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_mobile_devices']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_mobile_devices']:'');
 
191
  $adwidgets[$identifier]['rules_exclude_home'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_home']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_home']:'');
192
  $adwidgets[$identifier]['rules_exclude_archives'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_archives']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_archives']:'');
193
  $adwidgets[$identifier]['rules_exclude_search'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_search']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_search']:'');
89
  echo $control->HTML;
90
  $control->clear_controls();
91
 
92
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_404'));
93
+ $control->create_section('404 Pages');
94
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
95
+ echo $control->HTML;
96
+ $control->clear_controls();
97
+
98
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_home'));
99
  $control->create_section('Home');
100
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
101
  echo $control->HTML;
102
  $control->clear_controls();
103
 
104
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_archives'));
105
  $control->create_section('Archives');
106
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
107
  echo $control->HTML;
108
  $control->clear_controls();
109
 
110
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_search'));
111
  $control->create_section('Search Results');
112
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
113
  echo $control->HTML;
114
  $control->clear_controls();
115
 
116
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_page'));
117
  $control->add_control(array('type' => 'pages-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_page_exceptions'));
118
  $control->create_section('Single Pages');
 
 
 
 
 
 
 
 
119
  $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
120
  echo $control->HTML;
121
  $control->clear_controls();
125
  $control->create_section('Category Archives');
126
  $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
127
  echo $control->HTML;
128
+ $control->clear_controls();
129
+
130
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_post'));
131
+ $control->add_control(array('type' => 'posts-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_post_exceptions'));
132
+ $control->add_control(array('type' => 'categories-chosen-multiselect', 'label' => 'Category Exceptions', 'optionName' => 'rules_post_categories_exceptions'));
133
+ $control->create_section('Single Posts');
134
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
135
+ echo $control->HTML;
136
  $control->clear_controls();
137
 
138
  echo '</div>';
194
 
195
  $adwidgets[$identifier]['rules_exclude_loggedin'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_loggedin']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_loggedin']:'');
196
  $adwidgets[$identifier]['rules_exclude_mobile_devices'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_mobile_devices']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_mobile_devices']:'');
197
+ $adwidgets[$identifier]['rules_exclude_404'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_404']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_404']:'');
198
  $adwidgets[$identifier]['rules_exclude_home'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_home']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_home']:'');
199
  $adwidgets[$identifier]['rules_exclude_archives'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_archives']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_archives']:'');
200
  $adwidgets[$identifier]['rules_exclude_search'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_search']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_search']:'');
includes/assets/js/wp-insert.js CHANGED
@@ -239,6 +239,7 @@ function wp_insert_inpostads_click_handler(location) {
239
 
240
  args['wp_insert_inpostads_'+location+'_rules_exclude_loggedin'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_loggedin').prop('checked');
241
  args['wp_insert_inpostads_'+location+'_rules_exclude_mobile_devices'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_mobile_devices').prop('checked');
 
242
  args['wp_insert_inpostads_'+location+'_rules_exclude_home'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_home').prop('checked');
243
  args['wp_insert_inpostads_'+location+'_rules_home_instances'] = jQuery.map(jQuery('#wp_insert_inpostads_'+location+'_rules_home_instances :selected'), function(e) { return jQuery(e).val(); });
244
  args['wp_insert_inpostads_'+location+'_rules_exclude_archives'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_archives').prop('checked');
@@ -336,6 +337,7 @@ function wp_insert_adwidgets_update(identifier) {
336
 
337
  args['wp_insert_adwidgets_'+identifier+'_rules_exclude_loggedin'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_loggedin').prop('checked');
338
  args['wp_insert_adwidgets_'+identifier+'_rules_exclude_mobile_devices'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_mobile_devices').prop('checked');
 
339
  args['wp_insert_adwidgets_'+identifier+'_rules_exclude_home'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_home').prop('checked');
340
  args['wp_insert_adwidgets_'+identifier+'_rules_exclude_archives'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_archives').prop('checked');
341
  args['wp_insert_adwidgets_'+identifier+'_rules_exclude_search'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_search').prop('checked');
@@ -455,6 +457,7 @@ function wp_insert_inthemeads_update(identifier) {
455
 
456
  args['wp_insert_inthemeads_'+identifier+'_rules_exclude_loggedin'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_loggedin').prop('checked');
457
  args['wp_insert_inthemeads_'+identifier+'_rules_exclude_mobile_devices'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_mobile_devices').prop('checked');
 
458
  args['wp_insert_inthemeads_'+identifier+'_rules_exclude_home'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_home').prop('checked');
459
  args['wp_insert_inthemeads_'+identifier+'_rules_exclude_archives'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_archives').prop('checked');
460
  args['wp_insert_inthemeads_'+identifier+'_rules_exclude_search'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_search').prop('checked');
239
 
240
  args['wp_insert_inpostads_'+location+'_rules_exclude_loggedin'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_loggedin').prop('checked');
241
  args['wp_insert_inpostads_'+location+'_rules_exclude_mobile_devices'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_mobile_devices').prop('checked');
242
+ args['wp_insert_inpostads_'+location+'_rules_exclude_404'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_404').prop('checked');
243
  args['wp_insert_inpostads_'+location+'_rules_exclude_home'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_home').prop('checked');
244
  args['wp_insert_inpostads_'+location+'_rules_home_instances'] = jQuery.map(jQuery('#wp_insert_inpostads_'+location+'_rules_home_instances :selected'), function(e) { return jQuery(e).val(); });
245
  args['wp_insert_inpostads_'+location+'_rules_exclude_archives'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_archives').prop('checked');
337
 
338
  args['wp_insert_adwidgets_'+identifier+'_rules_exclude_loggedin'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_loggedin').prop('checked');
339
  args['wp_insert_adwidgets_'+identifier+'_rules_exclude_mobile_devices'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_mobile_devices').prop('checked');
340
+ args['wp_insert_adwidgets_'+identifier+'_rules_exclude_404'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_404').prop('checked');
341
  args['wp_insert_adwidgets_'+identifier+'_rules_exclude_home'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_home').prop('checked');
342
  args['wp_insert_adwidgets_'+identifier+'_rules_exclude_archives'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_archives').prop('checked');
343
  args['wp_insert_adwidgets_'+identifier+'_rules_exclude_search'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_search').prop('checked');
457
 
458
  args['wp_insert_inthemeads_'+identifier+'_rules_exclude_loggedin'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_loggedin').prop('checked');
459
  args['wp_insert_inthemeads_'+identifier+'_rules_exclude_mobile_devices'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_mobile_devices').prop('checked');
460
+ args['wp_insert_inthemeads_'+identifier+'_rules_exclude_404'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_404').prop('checked');
461
  args['wp_insert_inthemeads_'+identifier+'_rules_exclude_home'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_home').prop('checked');
462
  args['wp_insert_inthemeads_'+identifier+'_rules_exclude_archives'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_archives').prop('checked');
463
  args['wp_insert_inthemeads_'+identifier+'_rules_exclude_search'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_search').prop('checked');
includes/common/rules.php CHANGED
@@ -34,7 +34,7 @@ function wp_insert_get_page_details() {
34
  global $post;
35
  $page_details = array(
36
  'type' => 'POST',
37
- 'ID' => $post->ID
38
  );
39
  if(is_home() || is_front_page()) {
40
  $page_details['type'] = 'HOME';
@@ -55,6 +55,8 @@ function wp_insert_get_page_details() {
55
  $page_details['type'] = 'CUSTOM';
56
  $page_details['type_name'] = $post->post_type;
57
  }
 
 
58
  }
59
  return $page_details;
60
  }
@@ -125,6 +127,11 @@ function wp_insert_get_ad_status($rules) {
125
  return false;
126
  }
127
  break;
 
 
 
 
 
128
  case 'CUSTOM':
129
  if(isset($rules['rules_exclude_cpt_'.$page_details['type_name']]) && wp_validate_boolean($rules['rules_exclude_cpt_'.$page_details['type_name']])) {
130
  return false;
34
  global $post;
35
  $page_details = array(
36
  'type' => 'POST',
37
+ 'ID' => (isset($post->ID)?$post->ID:'')
38
  );
39
  if(is_home() || is_front_page()) {
40
  $page_details['type'] = 'HOME';
55
  $page_details['type'] = 'CUSTOM';
56
  $page_details['type_name'] = $post->post_type;
57
  }
58
+ } else if(is_404()) {
59
+ $page_details['type'] = '404';
60
  }
61
  return $page_details;
62
  }
127
  return false;
128
  }
129
  break;
130
+ case '404':
131
+ if(isset($rules['rules_exclude_404']) && wp_validate_boolean($rules['rules_exclude_404'])) {
132
+ return false;
133
+ }
134
+ break;
135
  case 'CUSTOM':
136
  if(isset($rules['rules_exclude_cpt_'.$page_details['type_name']]) && wp_validate_boolean($rules['rules_exclude_cpt_'.$page_details['type_name']])) {
137
  return false;
includes/inpostads.php CHANGED
@@ -129,6 +129,12 @@ function wp_insert_inpostads_form_get_content($position) {
129
  echo $control->HTML;
130
  $control->clear_controls();
131
 
 
 
 
 
 
 
132
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_home'));
133
  $control->add_control(array('type' => 'choosen-multiselect', 'label' => 'Instances', 'optionName' => 'rules_home_instances', 'options' => $instances));
134
  $control->create_section('Home');
@@ -234,6 +240,7 @@ function wp_insert_inpostads_form_save_action($position) {
234
 
235
  $inpostAds[$position]['rules_exclude_loggedin'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_loggedin']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_loggedin']:'');
236
  $inpostAds[$position]['rules_exclude_mobile_devices'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_mobile_devices']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_mobile_devices']:'');
 
237
  $inpostAds[$position]['rules_exclude_home'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_home']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_home']:'');
238
  $inpostAds[$position]['rules_home_instances'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_home_instances']))?$_POST['wp_insert_inpostads_'.$position.'_rules_home_instances']:'');
239
  $inpostAds[$position]['rules_exclude_archives'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_archives']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_archives']:'');
129
  echo $control->HTML;
130
  $control->clear_controls();
131
 
132
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_404'));
133
+ $control->create_section('404 Pages');
134
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
135
+ echo $control->HTML;
136
+ $control->clear_controls();
137
+
138
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_home'));
139
  $control->add_control(array('type' => 'choosen-multiselect', 'label' => 'Instances', 'optionName' => 'rules_home_instances', 'options' => $instances));
140
  $control->create_section('Home');
240
 
241
  $inpostAds[$position]['rules_exclude_loggedin'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_loggedin']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_loggedin']:'');
242
  $inpostAds[$position]['rules_exclude_mobile_devices'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_mobile_devices']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_mobile_devices']:'');
243
+ $inpostAds[$position]['rules_exclude_404'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_404']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_404']:'');
244
  $inpostAds[$position]['rules_exclude_home'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_home']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_home']:'');
245
  $inpostAds[$position]['rules_home_instances'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_home_instances']))?$_POST['wp_insert_inpostads_'.$position.'_rules_home_instances']:'');
246
  $inpostAds[$position]['rules_exclude_archives'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_archives']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_archives']:'');
includes/inthemeads.php CHANGED
@@ -96,27 +96,40 @@ function wp_insert_inthemeads_form_get_content($identifier) {
96
  echo $control->HTML;
97
  $control->clear_controls();
98
 
 
 
 
 
 
 
99
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_home'));
100
  $control->create_section('Home');
101
- $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
102
  echo $control->HTML;
103
  $control->clear_controls();
104
 
105
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_archives'));
106
  $control->create_section('Archives');
107
- $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
108
  echo $control->HTML;
109
  $control->clear_controls();
110
 
111
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_search'));
112
  $control->create_section('Search Results');
113
- $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
114
  echo $control->HTML;
115
  $control->clear_controls();
116
 
117
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_page'));
118
  $control->add_control(array('type' => 'pages-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_page_exceptions'));
119
  $control->create_section('Single Pages');
 
 
 
 
 
 
 
120
  $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
121
  echo $control->HTML;
122
  $control->clear_controls();
@@ -125,13 +138,6 @@ function wp_insert_inthemeads_form_get_content($identifier) {
125
  $control->add_control(array('type' => 'posts-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_post_exceptions'));
126
  $control->add_control(array('type' => 'categories-chosen-multiselect', 'label' => 'Category Exceptions', 'optionName' => 'rules_post_categories_exceptions'));
127
  $control->create_section('Single Posts');
128
- $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
129
- echo $control->HTML;
130
- $control->clear_controls();
131
-
132
- $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_categories'));
133
- $control->add_control(array('type' => 'categories-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_categories_exceptions'));
134
- $control->create_section('Category Archives');
135
  $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
136
  echo $control->HTML;
137
  $control->clear_controls();
@@ -195,6 +201,7 @@ function wp_insert_inthemeads_form_save_action($identifier) {
195
 
196
  $inthemeads[$identifier]['rules_exclude_loggedin'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_loggedin']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_loggedin']:'');
197
  $inthemeads[$identifier]['rules_exclude_mobile_devices'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_mobile_devices']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_mobile_devices']:'');
 
198
  $inthemeads[$identifier]['rules_exclude_home'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_home']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_home']:'');
199
  $inthemeads[$identifier]['rules_exclude_archives'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_archives']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_archives']:'');
200
  $inthemeads[$identifier]['rules_exclude_search'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_search']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_search']:'');
@@ -301,7 +308,7 @@ function wp_insert_inthemeads_upgrade_database() {
301
  function wp_template_ad($identifier) { wp_intheme_ad('templateads-'.$identifier); }
302
  function wp_intheme_ad($identifier) {
303
  $inthemeads = get_option('wp_insert_inthemeads');
304
- if(wp_insert_get_ad_status($inthemeads[$identifier])) {
305
  echo '<div class="wpInsert wpInsertTemplateTag"'.(($inthemeads[$identifier]['styles'] != '')?' style="'.$inthemeads[$identifier]['styles'].'"':'').'>'.wp_insert_get_geotargeted_adcode($inthemeads[$identifier]).'</div>';
306
  }
307
  }
96
  echo $control->HTML;
97
  $control->clear_controls();
98
 
99
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_404'));
100
+ $control->create_section('404 Pages');
101
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
102
+ echo $control->HTML;
103
+ $control->clear_controls();
104
+
105
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_home'));
106
  $control->create_section('Home');
107
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
108
  echo $control->HTML;
109
  $control->clear_controls();
110
 
111
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_archives'));
112
  $control->create_section('Archives');
113
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
114
  echo $control->HTML;
115
  $control->clear_controls();
116
 
117
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_search'));
118
  $control->create_section('Search Results');
119
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
120
  echo $control->HTML;
121
  $control->clear_controls();
122
 
123
  $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_page'));
124
  $control->add_control(array('type' => 'pages-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_page_exceptions'));
125
  $control->create_section('Single Pages');
126
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
127
+ echo $control->HTML;
128
+ $control->clear_controls();
129
+
130
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_categories'));
131
+ $control->add_control(array('type' => 'categories-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_categories_exceptions'));
132
+ $control->create_section('Category Archives');
133
  $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
134
  echo $control->HTML;
135
  $control->clear_controls();
138
  $control->add_control(array('type' => 'posts-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_post_exceptions'));
139
  $control->add_control(array('type' => 'categories-chosen-multiselect', 'label' => 'Category Exceptions', 'optionName' => 'rules_post_categories_exceptions'));
140
  $control->create_section('Single Posts');
 
 
 
 
 
 
 
141
  $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
142
  echo $control->HTML;
143
  $control->clear_controls();
201
 
202
  $inthemeads[$identifier]['rules_exclude_loggedin'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_loggedin']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_loggedin']:'');
203
  $inthemeads[$identifier]['rules_exclude_mobile_devices'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_mobile_devices']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_mobile_devices']:'');
204
+ $inthemeads[$identifier]['rules_exclude_404'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_404']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_404']:'');
205
  $inthemeads[$identifier]['rules_exclude_home'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_home']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_home']:'');
206
  $inthemeads[$identifier]['rules_exclude_archives'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_archives']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_archives']:'');
207
  $inthemeads[$identifier]['rules_exclude_search'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_search']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_search']:'');
308
  function wp_template_ad($identifier) { wp_intheme_ad('templateads-'.$identifier); }
309
  function wp_intheme_ad($identifier) {
310
  $inthemeads = get_option('wp_insert_inthemeads');
311
+ if(isset($inthemeads[$identifier]) && is_array($inthemeads[$identifier]) && wp_insert_get_ad_status($inthemeads[$identifier])) {
312
  echo '<div class="wpInsert wpInsertTemplateTag"'.(($inthemeads[$identifier]['styles'] != '')?' style="'.$inthemeads[$identifier]['styles'].'"':'').'>'.wp_insert_get_geotargeted_adcode($inthemeads[$identifier]).'</div>';
313
  }
314
  }
includes/legal-pages.php CHANGED
@@ -325,17 +325,19 @@ function wp_insert_legalpages_the_content($content) {
325
  global $post;
326
  $legalPages = get_option('wp_insert_legalpages');
327
 
328
- if(isset($legalPages['privacy_policy']['assigned_page']) && ($legalPages['privacy_policy']['assigned_page'] != '') && ($post->ID == $legalPages['privacy_policy']['assigned_page'])) {
329
- return do_shortcode(stripslashes($legalPages['privacy_policy']['content']));
330
- }
331
- if(isset($legalPages['terms_conditions']['assigned_page']) && ($legalPages['terms_conditions']['assigned_page'] != '') && ($post->ID == $legalPages['terms_conditions']['assigned_page'])) {
332
- return do_shortcode(stripslashes($legalPages['terms_conditions']['content']));
333
- }
334
- if(isset($legalPages['disclaimer']['assigned_page']) && ($legalPages['disclaimer']['assigned_page'] != '') && ($post->ID == $legalPages['disclaimer']['assigned_page'])) {
335
- return do_shortcode(stripslashes($legalPages['disclaimer']['content']));
336
- }
337
- if(isset($legalPages['copyright']['assigned_page']) && ($legalPages['copyright']['assigned_page'] != '') && ($post->ID == $legalPages['copyright']['assigned_page'])) {
338
- return do_shortcode(stripslashes($legalPages['copyright']['content']));
 
 
339
  }
340
 
341
  return $content;
325
  global $post;
326
  $legalPages = get_option('wp_insert_legalpages');
327
 
328
+ if(isset($post) && (isset($post->ID))) {
329
+ if(isset($legalPages['privacy_policy']['assigned_page']) && ($legalPages['privacy_policy']['assigned_page'] != '') && ($post->ID == $legalPages['privacy_policy']['assigned_page'])) {
330
+ return do_shortcode(stripslashes($legalPages['privacy_policy']['content']));
331
+ }
332
+ if(isset($legalPages['terms_conditions']['assigned_page']) && ($legalPages['terms_conditions']['assigned_page'] != '') && ($post->ID == $legalPages['terms_conditions']['assigned_page'])) {
333
+ return do_shortcode(stripslashes($legalPages['terms_conditions']['content']));
334
+ }
335
+ if(isset($legalPages['disclaimer']['assigned_page']) && ($legalPages['disclaimer']['assigned_page'] != '') && ($post->ID == $legalPages['disclaimer']['assigned_page'])) {
336
+ return do_shortcode(stripslashes($legalPages['disclaimer']['content']));
337
+ }
338
+ if(isset($legalPages['copyright']['assigned_page']) && ($legalPages['copyright']['assigned_page'] != '') && ($post->ID == $legalPages['copyright']['assigned_page'])) {
339
+ return do_shortcode(stripslashes($legalPages['copyright']['content']));
340
+ }
341
  }
342
 
343
  return $content;
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Wp-Insert ===
2
  Contributors: Namith Jawahar
3
- Tags: ads,adsense,advertising,advertisement,google ads,ad widget,analytics,google analytics,code insertion,privacy policy,best adsense plugin
4
  Donate link: http://wpinsert.smartlogix.co.in/support/
5
  Requires at least: 4.1.0
6
- Tested up to: 4.7.2
7
- Stable tag: 2.1.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -17,6 +17,7 @@ Wp-Insert is the most powerful yet easiest to use wordpress ad management plugin
17
 
18
  = Features =
19
 
 
20
  * Insert Ad Above, Below, To the Left and Right of Page/Post Content
21
  * Insert Ad in the Middle of Page/Post Content with intelligent midpoint detection algorithms
22
  * Insert Ads into the Sidebars using Ad WIdgets
@@ -24,10 +25,11 @@ Wp-Insert is the most powerful yet easiest to use wordpress ad management plugin
24
  * Insert Ads directly into the theme files with control over when and where to display Ads
25
  * Insert Google Analytics Code easily
26
  * Insert any type of Embed codes into the Header / Footer of your Site
 
27
  * Style Ads the Way you want
28
  * Does not slow down your site (Highly Efficient Algorithms)
29
  * Legal Page Templates (Privacy Policy, Terms & Conditions, Disclaimer, Copyright) to kick start your Legal Pages
30
- * A/B Testing Facility for Ads
31
  * Geo-targeted Country Specific Ad Placement
32
  * Backed by <a href="http://www.smartlogix.co.in/" title="SmartLogix Technologies : Experts in WordPress Themes and Plugins">SmartLogix</a>, The Unparalleled WordPress Specialist
33
 
1
  === Wp-Insert ===
2
  Contributors: Namith Jawahar
3
+ Tags: ads,adsense,ad manager,advertisement,google ads,ad widget,analytics,google analytics,code insertion,privacy policy,best adsense plugin
4
  Donate link: http://wpinsert.smartlogix.co.in/support/
5
  Requires at least: 4.1.0
6
+ Tested up to: 4.8.1
7
+ Stable tag: 2.1.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
17
 
18
  = Features =
19
 
20
+ * Adsense Optimized
21
  * Insert Ad Above, Below, To the Left and Right of Page/Post Content
22
  * Insert Ad in the Middle of Page/Post Content with intelligent midpoint detection algorithms
23
  * Insert Ads into the Sidebars using Ad WIdgets
25
  * Insert Ads directly into the theme files with control over when and where to display Ads
26
  * Insert Google Analytics Code easily
27
  * Insert any type of Embed codes into the Header / Footer of your Site
28
+ * Insert Google Analytics Code, Facebook Pixel Code, Custom CSS or any other code to your site without having to edit any theme files
29
  * Style Ads the Way you want
30
  * Does not slow down your site (Highly Efficient Algorithms)
31
  * Legal Page Templates (Privacy Policy, Terms & Conditions, Disclaimer, Copyright) to kick start your Legal Pages
32
+ * A/B Testing Facility for Ads (Comply with Adsense Policies while serving other Ad Networks)
33
  * Geo-targeted Country Specific Ad Placement
34
  * Backed by <a href="http://www.smartlogix.co.in/" title="SmartLogix Technologies : Experts in WordPress Themes and Plugins">SmartLogix</a>, The Unparalleled WordPress Specialist
35
 
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.6
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
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.7
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