Insert Post Ads - Version 1.3.1

Version Description

  • Bug fixes
Download this release

Release Info

Developer insertpostads
Plugin Icon 128x128 Insert Post Ads
Version 1.3.1
Comparing to
See all releases

Code changes from version 1.3 to 1.3.1

css/admin.css CHANGED
@@ -103,7 +103,7 @@ div[aria-describedby="insert_ads_vi_signup_dialog"] .ui-dialog-titlebar button{
103
  .insert_ads_rule_block {
104
  width: calc(100% - 40px) !important;
105
  }
106
- .postbox.vi-choose .insert_ads_popup_content_wrapper div p:nth-child(3), .postbox.vi-choose .insert_ads_popup_content_wrapper h3, .postbox.vi-choose .insert_ads_popup_content_wrapper{
107
  display:none;
108
  }
109
  .postbox.vi-choose .plugin-card-bottom{
@@ -326,4 +326,6 @@ body.post-new-php.post-type-insertpostads #title{
326
  .blurb-info{
327
  max-width: 550px;
328
  }
 
 
329
  }
103
  .insert_ads_rule_block {
104
  width: calc(100% - 40px) !important;
105
  }
106
+ .postbox.vi-choose .insert_ads_popup_content_wrapper div p:nth-child(3), .postbox.vi-choose .insert_ads_popup_content_wrapper h3{
107
  display:none;
108
  }
109
  .postbox.vi-choose .plugin-card-bottom{
326
  .blurb-info{
327
  max-width: 550px;
328
  }
329
+ }.insert_ads_popup_content_wrapper + .insert_ads_popup_content_wrapper{
330
+ display:none;
331
  }
includes/inpostads.php CHANGED
@@ -356,6 +356,8 @@ function insert_ads_inpostads_form_save_action($position) {
356
  $inpostAds[$position]['paragraph_buffer_count'] = ((isset($_POST['insert_ads_inpostads_'.$position.'_paragraph_buffer_count']))?$_POST['insert_ads_inpostads_'.$position.'_paragraph_buffer_count']:'');
357
  }
358
  update_option('insert_ads_inpostads', $inpostAds);
 
 
359
  }
360
  /* End Shared UI Functions */
361
 
356
  $inpostAds[$position]['paragraph_buffer_count'] = ((isset($_POST['insert_ads_inpostads_'.$position.'_paragraph_buffer_count']))?$_POST['insert_ads_inpostads_'.$position.'_paragraph_buffer_count']:'');
357
  }
358
  update_option('insert_ads_inpostads', $inpostAds);
359
+
360
+ echo $inpostAds['above']['status'];
361
  }
362
  /* End Shared UI Functions */
363
 
includes/vi-integration.php CHANGED
@@ -263,7 +263,7 @@ function insert_ads_vi_customize_adcode_form_get_content() {
263
  $control->add_control(array('type' => 'textarea', 'label' => 'Keywords', 'optionName' => 'keywords', 'helpText' => '</small><span class="tooltipWrapper"><span class="tooltip">Comma separated values describing the content of the page e.g. \'cooking, grilling, pulled pork\'</span></span><small>'));
264
  $control->HTML .= '<p><span class="keys-desc">Comma separated values describing the content of the page e.g. \'cooking, grilling, pulled pork\'</span><small></small></p>';
265
  $IABParentCategories = array(
266
- array('text' => 'Select tier 1 category', 'value' => 'select'),
267
  array('text' => 'Arts & Entertainment', 'value' => 'IAB1'),
268
  array('text' => 'Automotive', 'value' => 'IAB2'),
269
  array('text' => 'Business', 'value' => 'IAB3'),
@@ -293,7 +293,7 @@ function insert_ads_vi_customize_adcode_form_get_content() {
293
  );
294
  $control->add_control(array('type' => 'select', 'label' => 'IAB Category*', 'optionName' => 'iab_category_parent', 'options' => $IABParentCategories));
295
  $IABChildCategories = array(
296
- array('text' => 'Select tier 2 category', 'value' => 'select'),
297
  array('text' => 'Books & Literature', 'value' => 'IAB1-1', 'metadata' => array('parent' => 'IAB1')),
298
  array('text' => 'Celebrity Fan/Gossip', 'value' => 'IAB1-2', 'metadata' => array('parent' => 'IAB1')),
299
  array('text' => 'Fine Art', 'value' => 'IAB1-3', 'metadata' => array('parent' => 'IAB1')),
@@ -664,7 +664,7 @@ function insert_ads_vi_customize_adcode_form_get_content() {
664
  $control->add_control(array('type' => 'select', 'label' => '&nbsp;', 'optionName' => 'iab_category_child', 'helpText' => '&nbsp;', 'options' => $IABChildCategories));
665
  $languages = insert_ads_vi_api_get_languages();
666
  $languageOptions = array(
667
- array('text' => 'Select language', 'value' => 'select'),
668
  );
669
  if($languages != false) {
670
  foreach($languages as $key => $value) {
263
  $control->add_control(array('type' => 'textarea', 'label' => 'Keywords', 'optionName' => 'keywords', 'helpText' => '</small><span class="tooltipWrapper"><span class="tooltip">Comma separated values describing the content of the page e.g. \'cooking, grilling, pulled pork\'</span></span><small>'));
264
  $control->HTML .= '<p><span class="keys-desc">Comma separated values describing the content of the page e.g. \'cooking, grilling, pulled pork\'</span><small></small></p>';
265
  $IABParentCategories = array(
266
+ //array('text' => 'Select tier 1 category', 'value' => 'select'),
267
  array('text' => 'Arts & Entertainment', 'value' => 'IAB1'),
268
  array('text' => 'Automotive', 'value' => 'IAB2'),
269
  array('text' => 'Business', 'value' => 'IAB3'),
293
  );
294
  $control->add_control(array('type' => 'select', 'label' => 'IAB Category*', 'optionName' => 'iab_category_parent', 'options' => $IABParentCategories));
295
  $IABChildCategories = array(
296
+ //array('text' => 'Select tier 2 category', 'value' => 'select'),
297
  array('text' => 'Books & Literature', 'value' => 'IAB1-1', 'metadata' => array('parent' => 'IAB1')),
298
  array('text' => 'Celebrity Fan/Gossip', 'value' => 'IAB1-2', 'metadata' => array('parent' => 'IAB1')),
299
  array('text' => 'Fine Art', 'value' => 'IAB1-3', 'metadata' => array('parent' => 'IAB1')),
664
  $control->add_control(array('type' => 'select', 'label' => '&nbsp;', 'optionName' => 'iab_category_child', 'helpText' => '&nbsp;', 'options' => $IABChildCategories));
665
  $languages = insert_ads_vi_api_get_languages();
666
  $languageOptions = array(
667
+ //array('text' => 'Select language', 'value' => 'select'),
668
  );
669
  if($languages != false) {
670
  foreach($languages as $key => $value) {
insert-post-ads.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Insert Post Ads
4
  * Plugin URI: http://www.insertpostads.com/
5
- * Version: 1.3
6
  * Author: InsertPostAds
7
  * Author URI: http://www.insertpostads.com/
8
  * Description: Allows you to insert ads after paragraphs of your post content
2
  /**
3
  * Plugin Name: Insert Post Ads
4
  * Plugin URI: http://www.insertpostads.com/
5
+ * Version: 1.3.1
6
  * Author: InsertPostAds
7
  * Author URI: http://www.insertpostads.com/
8
  * Description: Allows you to insert ads after paragraphs of your post content
js/admin.js CHANGED
@@ -669,7 +669,7 @@ function insert_ads_legalpages_generate_page(target, title) {
669
  );
670
  }
671
  jQuery(document).on('click', '#insert_ads_vi_signup2', function(){
672
- console.log(location.search);
673
  if(location.search == '?post_type=insertpostads&page=insert-post-ads'){
674
  jQuery('#insert_ads_vi_signup').trigger('click');
675
  } else {
@@ -678,8 +678,8 @@ jQuery(document).on('click', '#insert_ads_vi_signup2', function(){
678
  })
679
  function insert_ads_click_handler(target, title, width, height, openAction, UpdateAction, closeAction) {
680
  jQuery('#'+target).click(function() {
681
- console.log(jQuery('#insert_ads_nonce').val(), jQuery('#insert_ads_admin_ajax').val());
682
- console.log(target);
683
  jQuery('<div id="'+target+'_dialog"></div>').html('<div class="insert_ads_ajaxloader"></div>').dialog({
684
  'modal': true,
685
  'resizable': false,
@@ -839,11 +839,11 @@ function insert_ads_vi_login_handler() {
839
  }, function(response) {
840
  if(response.indexOf('###SUCCESS###') !== -1) {
841
  //jQuery('.wrap #poststuff').before(response.replace('###SUCCESS###', ''));
842
- console.log('succ');
843
  location.reload();
844
  } else if(response.indexOf('###FAIL###') !== -1) {
845
  jQuery('.wrap #poststuff').before(response.replace('###FAIL###', ''));
846
- console.log('fail')
847
  //setTimeout(function(){location.reload()}, 2000);
848
  } else {
849
  }
@@ -1162,7 +1162,7 @@ jQuery(document).ready(function() {
1162
  }
1163
  })
1164
 
1165
- function showInp(){
1166
  var loadSel = jQuery('input[name="cur-pos-rad"]:checked').val();
1167
  if(loadSel == 'above'){
1168
  jQuery('.vi-choose .insert_ads_popup_content_wrapper:first').show();
@@ -1173,7 +1173,7 @@ jQuery(document).ready(function() {
1173
  } else {
1174
  jQuery('.vi-choose .insert_ads_popup_content_wrapper').hide();
1175
  }
1176
- }
1177
  function notifyInp(){
1178
  jQuery('.funcnot').each(function(){
1179
  var getCheck = jQuery(this).parent('div').find('input:checkbox').is(':checked'),
@@ -1186,10 +1186,10 @@ jQuery(document).ready(function() {
1186
  })
1187
  }
1188
  notifyInp();
1189
- showInp();
1190
  jQuery('#cur-pos-sel input').on('click', function(){
1191
- showInp();
1192
- console.log(jQuery('input[name="cur-pos-rad"]:checked').val());
1193
  })
1194
  jQuery('.postbox.vi-choose .ipcheckbox').on('click', function(){
1195
  notifyInp();
@@ -1210,8 +1210,30 @@ jQuery(document).ready(function() {
1210
  }, function(response) { }
1211
  );
1212
  });
 
 
 
 
 
 
 
 
1213
  jQuery('body').on('click', '#set-update', function(){
1214
- console.log('fdsfs');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1215
  var insert_ads_vi_code_settings_ad_unit_type = jQuery('#insert_ads_vi_code_settings_ad_unit_type').val();
1216
  var insert_ads_vi_code_settings_keywords = jQuery('#insert_ads_vi_code_settings_keywords').val();
1217
  var insert_ads_vi_code_settings_iab_category_parent = jQuery('#insert_ads_vi_code_settings_iab_category_parent').val();
@@ -1225,7 +1247,8 @@ jQuery(document).ready(function() {
1225
  var insert_ads_vi_code_settings_optional_2 = jQuery('#insert_ads_vi_code_settings_optional_2').val();
1226
  var insert_ads_vi_code_settings_optional_3 = jQuery('#insert_ads_vi_code_settings_optional_3').val();
1227
  var curLoc = jQuery('input[name="cur-pos-rad"]:checked').val();
1228
- var curStat = jQuery('#insert_ads_inpostads_'+curLoc+'_status').is(':checked') ? true : false;
 
1229
  jQuery('.ui-dialog-content').html('<div class="insert_ads_ajaxloader"></div>');
1230
  jQuery('.insert_ads_ajaxloader').show();
1231
  jQuery.post(
@@ -1250,7 +1273,7 @@ jQuery(document).ready(function() {
1250
  var successText = '<div id="sucessText" class="notice notice-success is-dismissible insert-post-ads-notice-welcome"><p>Settings saved!</p></div>';
1251
  jQuery('#poststuff').before(successText);
1252
  jQuery(document).find('#sucessText').delay('2000').fadeOut('1000');
1253
- console.log('othe');
1254
  var ajData= {},
1255
  ajAction = 'action',
1256
  ajActionVal = 'insert_ads_inpostads_'+curLoc+'_form_save_action',
@@ -1266,7 +1289,7 @@ jQuery(document).ready(function() {
1266
  ajData[ajType] = ajTypeVal;
1267
  jQuery.post(
1268
  jQuery('#insert_ads_admin_ajax').val(), ajData, function(response){
1269
- console.log('saved');
1270
  var sucdial = jQuery('<div id="sucdial">Succesfully updated!</div>').hide().fadeIn('1000');
1271
  if(jQuery('#sucdial').length){
1272
  jQuery(document).find('#sucdial').fadeIn('1000').delay('2000').fadeOut('1000');
@@ -1299,7 +1322,7 @@ jQuery(document).ready(function() {
1299
  e.preventDefault();
1300
  var dataForm = jQuery(this).parents('form').serializeArray();
1301
  dataForm.push({name: 'submit', value: 'Save Settings'});
1302
- console.log(dataForm);
1303
  jQuery.ajax({
1304
  url : 'edit.php?post_type=insertpostads&page=insert-post-ads',
1305
  method : 'POST',
@@ -1315,4 +1338,15 @@ jQuery(document).ready(function() {
1315
  }
1316
  })
1317
  })
 
 
 
 
 
 
 
 
 
 
 
1318
  });
669
  );
670
  }
671
  jQuery(document).on('click', '#insert_ads_vi_signup2', function(){
672
+ //console.log(location.search);
673
  if(location.search == '?post_type=insertpostads&page=insert-post-ads'){
674
  jQuery('#insert_ads_vi_signup').trigger('click');
675
  } else {
678
  })
679
  function insert_ads_click_handler(target, title, width, height, openAction, UpdateAction, closeAction) {
680
  jQuery('#'+target).click(function() {
681
+ //console.log(jQuery('#insert_ads_nonce').val(), jQuery('#insert_ads_admin_ajax').val());
682
+ //console.log(target);
683
  jQuery('<div id="'+target+'_dialog"></div>').html('<div class="insert_ads_ajaxloader"></div>').dialog({
684
  'modal': true,
685
  'resizable': false,
839
  }, function(response) {
840
  if(response.indexOf('###SUCCESS###') !== -1) {
841
  //jQuery('.wrap #poststuff').before(response.replace('###SUCCESS###', ''));
842
+ //console.log('succ');
843
  location.reload();
844
  } else if(response.indexOf('###FAIL###') !== -1) {
845
  jQuery('.wrap #poststuff').before(response.replace('###FAIL###', ''));
846
+ //console.log('fail')
847
  //setTimeout(function(){location.reload()}, 2000);
848
  } else {
849
  }
1162
  }
1163
  })
1164
 
1165
+ /*function showInp(){
1166
  var loadSel = jQuery('input[name="cur-pos-rad"]:checked').val();
1167
  if(loadSel == 'above'){
1168
  jQuery('.vi-choose .insert_ads_popup_content_wrapper:first').show();
1173
  } else {
1174
  jQuery('.vi-choose .insert_ads_popup_content_wrapper').hide();
1175
  }
1176
+ }*/
1177
  function notifyInp(){
1178
  jQuery('.funcnot').each(function(){
1179
  var getCheck = jQuery(this).parent('div').find('input:checkbox').is(':checked'),
1186
  })
1187
  }
1188
  notifyInp();
1189
+ //showInp();
1190
  jQuery('#cur-pos-sel input').on('click', function(){
1191
+ //showInp();
1192
+ //console.log(jQuery('input[name="cur-pos-rad"]:checked').val());
1193
  })
1194
  jQuery('.postbox.vi-choose .ipcheckbox').on('click', function(){
1195
  notifyInp();
1210
  }, function(response) { }
1211
  );
1212
  });
1213
+
1214
+ jQuery('#insert_ads_inpostads_above_status + div').click(function(){
1215
+ if(jQuery('#insert_ads_inpostads_above_status').is(':checked')){
1216
+ //console.log('true');
1217
+ } else {
1218
+ //console.log('false')
1219
+ }
1220
+ })
1221
  jQuery('body').on('click', '#set-update', function(){
1222
+ jQuery.post(
1223
+ jQuery('#insert_ads_admin_ajax').val(), {
1224
+ 'action':'insert_ads_inpostads_above_form_save_action',
1225
+ 'insert_ads_nonce': jQuery('#insert_ads_nonce').val(),
1226
+ 'insert_ads_inpostads_above_status':'false',
1227
+ 'insert_ads_inpostads_above_primary_ad_code_type':'vicode'
1228
+ })
1229
+ jQuery.post(
1230
+ jQuery('#insert_ads_admin_ajax').val(), {
1231
+ 'action':'insert_ads_inpostads_middle_form_save_action',
1232
+ 'insert_ads_nonce': jQuery('#insert_ads_nonce').val(),
1233
+ 'insert_ads_inpostads_middle_status':'false',
1234
+ 'insert_ads_inpostads_middle_primary_ad_code_type':'vicode'
1235
+ })
1236
+ //console.log('fdsfs');
1237
  var insert_ads_vi_code_settings_ad_unit_type = jQuery('#insert_ads_vi_code_settings_ad_unit_type').val();
1238
  var insert_ads_vi_code_settings_keywords = jQuery('#insert_ads_vi_code_settings_keywords').val();
1239
  var insert_ads_vi_code_settings_iab_category_parent = jQuery('#insert_ads_vi_code_settings_iab_category_parent').val();
1247
  var insert_ads_vi_code_settings_optional_2 = jQuery('#insert_ads_vi_code_settings_optional_2').val();
1248
  var insert_ads_vi_code_settings_optional_3 = jQuery('#insert_ads_vi_code_settings_optional_3').val();
1249
  var curLoc = jQuery('input[name="cur-pos-rad"]:checked').val();
1250
+ var disLoc = jQuery('input[name="cur-pos-rad"]').not(':checked').val();
1251
+ var curStat = jQuery('#insert_ads_inpostads_above_status').is(':checked') ? true : false;
1252
  jQuery('.ui-dialog-content').html('<div class="insert_ads_ajaxloader"></div>');
1253
  jQuery('.insert_ads_ajaxloader').show();
1254
  jQuery.post(
1273
  var successText = '<div id="sucessText" class="notice notice-success is-dismissible insert-post-ads-notice-welcome"><p>Settings saved!</p></div>';
1274
  jQuery('#poststuff').before(successText);
1275
  jQuery(document).find('#sucessText').delay('2000').fadeOut('1000');
1276
+ //console.log(curLoc, disLoc);
1277
  var ajData= {},
1278
  ajAction = 'action',
1279
  ajActionVal = 'insert_ads_inpostads_'+curLoc+'_form_save_action',
1289
  ajData[ajType] = ajTypeVal;
1290
  jQuery.post(
1291
  jQuery('#insert_ads_admin_ajax').val(), ajData, function(response){
1292
+ //console.log('saved');
1293
  var sucdial = jQuery('<div id="sucdial">Succesfully updated!</div>').hide().fadeIn('1000');
1294
  if(jQuery('#sucdial').length){
1295
  jQuery(document).find('#sucdial').fadeIn('1000').delay('2000').fadeOut('1000');
1322
  e.preventDefault();
1323
  var dataForm = jQuery(this).parents('form').serializeArray();
1324
  dataForm.push({name: 'submit', value: 'Save Settings'});
1325
+ //console.log(dataForm);
1326
  jQuery.ajax({
1327
  url : 'edit.php?post_type=insertpostads&page=insert-post-ads',
1328
  method : 'POST',
1338
  }
1339
  })
1340
  })
1341
+
1342
+ var statAbove = jQuery('#insert_ads_inpostads_above_status').attr('checked');
1343
+ var statMiddle = jQuery('#insert_ads_inpostads_middle_status').attr('checked');
1344
+ console.log(statAbove, statMiddle);
1345
+
1346
+ if(statMiddle === 'checked'){
1347
+ jQuery('#insert_ads_inpostads_above_status').attr('checked', true);
1348
+ jQuery('#insert_ads_inpostads_above_status + div').addClass('checked');
1349
+ jQuery('#cur-pos-above').attr('checked', false);
1350
+ jQuery('#cur-pos-middle').attr('checked', true);
1351
+ }
1352
  });
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: insertpostads
3
  Tags: ad injection, ads, ads plugin, adsense, adsense injection, google adsense, insert ads in post, insert post ads, wordpress ads plugin, advertising plugin, banners plugin, post ads
4
  Requires at least: 3.6
5
- Tested up to: 4.9.2
6
- Stable tag: 1.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -68,6 +68,8 @@ I feel that we have done that here. I hope you enjoy using Insert Post Ads.
68
  Thank you
69
 
70
  == Changelog ==
 
 
71
 
72
  = 1.3 =
73
  * Improved UI for vi stories customization
2
  Contributors: insertpostads
3
  Tags: ad injection, ads, ads plugin, adsense, adsense injection, google adsense, insert ads in post, insert post ads, wordpress ads plugin, advertising plugin, banners plugin, post ads
4
  Requires at least: 3.6
5
+ Tested up to: 4.9.4
6
+ Stable tag: 1.3.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
68
  Thank you
69
 
70
  == Changelog ==
71
+ = 1.3.1 =
72
+ * Bug fixes
73
 
74
  = 1.3 =
75
  * Improved UI for vi stories customization