Blog2Social: Social Media Auto Post & Scheduler - Version 6.6.2

Version Description

Usability Optimization

Download this release

Release Info

Developer PR-Gateway
Plugin Icon 128x128 Blog2Social: Social Media Auto Post & Scheduler
Version 6.6.2
Comparing to
See all releases

Code changes from version 6.6.1 to 6.6.2

assets/js/b2s/curation.js CHANGED
@@ -21,20 +21,23 @@ jQuery(window).on("load", function () {
21
  jQuery('#b2s-curation-input-url').val(url);
22
  jQuery('.b2s-btn-curation-continue').trigger('click');
23
  } else if(typeof comment != "undefined" && comment != "" && comment != null) {
24
- jQuery('.b2s-curation-format-image').trigger('click');
25
- jQuery('.b2s-post-item-details-item-message-input').val(comment);
26
  if(typeof image_id != "undefined" && image_id != "" && image_id != null && typeof image_url != "undefined" && image_url != "" && image_url != null) {
 
27
  jQuery('.b2s-post-item-details-url-image').attr('src', image_url);
28
  jQuery('.b2s-image-url-hidden-field').val(image_url);
29
  jQuery('.b2s-image-id-hidden-field').val(image_id);
30
  jQuery('.b2s-image-remove-btn').show();
 
 
 
 
31
  }
32
  }
33
  });
34
 
35
  jQuery(document).on('click', '.b2s-btn-curation-continue', function () {
36
  jQuery('#b2s-curation-input-url-help').hide();
37
- var re = new RegExp(/^(https?:\/\/)+[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+(?:\.[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=%.ÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+$/);
38
  var url = jQuery('#b2s-curation-input-url').val();
39
  if (re.test(url)) {
40
  jQuery('#b2s-curation-input-url').removeClass('error');
@@ -402,7 +405,7 @@ jQuery(document).on('click', '#b2s-btn-curation-customize', function () {
402
  jQuery('#b2s-post-curation-comment').addClass('error');
403
  noContent = true;
404
  }
405
- } else {
406
  if (jQuery('.b2s-image-url-hidden-field').val().length === 0) {
407
  jQuery('.b2s-post-item-details-url-image').addClass('error');
408
  noContent = true;
@@ -411,6 +414,11 @@ jQuery(document).on('click', '#b2s-btn-curation-customize', function () {
411
  jQuery('#b2s-post-curation-comment-image').addClass('error');
412
  noContent = true;
413
  }
 
 
 
 
 
414
  }
415
  if (noContent) {
416
  return false;
@@ -445,6 +453,14 @@ jQuery(document).on('click', '#b2s-btn-curation-customize', function () {
445
  jQuery('#b2s-curation-no-data-info').show();
446
  jQuery('.b2s-curation-settings-area').show();
447
  jQuery('.b2s-curation-preview-area').show();
 
 
 
 
 
 
 
 
448
  }
449
 
450
  }
@@ -513,7 +529,7 @@ jQuery(document).on('click', '#b2s-btn-curation-draft', function () {
513
  jQuery('#b2s-post-curation-comment').addClass('error');
514
  noContent = true;
515
  }
516
- } else {
517
  if (jQuery('.b2s-image-url-hidden-field').val().length === 0) {
518
  jQuery('.b2s-post-item-details-url-image').addClass('error');
519
  noContent = true;
@@ -522,6 +538,11 @@ jQuery(document).on('click', '#b2s-btn-curation-draft', function () {
522
  jQuery('#b2s-post-curation-comment-image').addClass('error');
523
  noContent = true;
524
  }
 
 
 
 
 
525
  }
526
  if (noContent) {
527
  return false;
@@ -562,10 +583,12 @@ jQuery(document).on('click', '#b2s-btn-curation-draft', function () {
562
  jQuery('.b2s-loading-area').hide();
563
  jQuery('.b2s-curation-settings-area').show();
564
  if(jQuery('#b2s-curation-post-format').val() == '0') {
565
- jQuery('.b2s-curation-preview-area').show();
566
- } else {
567
- jQuery('.b2s-curation-image-area').show();
568
- }
 
 
569
  jQuery('.b2s-curation-select').show();
570
 
571
  }
21
  jQuery('#b2s-curation-input-url').val(url);
22
  jQuery('.b2s-btn-curation-continue').trigger('click');
23
  } else if(typeof comment != "undefined" && comment != "" && comment != null) {
 
 
24
  if(typeof image_id != "undefined" && image_id != "" && image_id != null && typeof image_url != "undefined" && image_url != "" && image_url != null) {
25
+ jQuery('.b2s-curation-format-image').trigger('click');
26
  jQuery('.b2s-post-item-details-url-image').attr('src', image_url);
27
  jQuery('.b2s-image-url-hidden-field').val(image_url);
28
  jQuery('.b2s-image-id-hidden-field').val(image_id);
29
  jQuery('.b2s-image-remove-btn').show();
30
+ jQuery('.b2s-post-item-details-item-message-input').val(comment);
31
+ } else {
32
+ jQuery('.b2s-curation-format-text').trigger('click');
33
+ jQuery('.b2s-post-item-details-item-message-input').val(comment);
34
  }
35
  }
36
  });
37
 
38
  jQuery(document).on('click', '.b2s-btn-curation-continue', function () {
39
  jQuery('#b2s-curation-input-url-help').hide();
40
+ var re = new RegExp(/^(https?:\/\/)+[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß-]+(?:\.[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=%.ÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+$/);
41
  var url = jQuery('#b2s-curation-input-url').val();
42
  if (re.test(url)) {
43
  jQuery('#b2s-curation-input-url').removeClass('error');
405
  jQuery('#b2s-post-curation-comment').addClass('error');
406
  noContent = true;
407
  }
408
+ } else if(jQuery('#b2s-curation-post-format').val() == '1') {
409
  if (jQuery('.b2s-image-url-hidden-field').val().length === 0) {
410
  jQuery('.b2s-post-item-details-url-image').addClass('error');
411
  noContent = true;
414
  jQuery('#b2s-post-curation-comment-image').addClass('error');
415
  noContent = true;
416
  }
417
+ } else {
418
+ if (jQuery('#b2s-post-curation-comment-text').val().length === 0) {
419
+ jQuery('#b2s-post-curation-comment-text').addClass('error');
420
+ noContent = true;
421
+ }
422
  }
423
  if (noContent) {
424
  return false;
453
  jQuery('#b2s-curation-no-data-info').show();
454
  jQuery('.b2s-curation-settings-area').show();
455
  jQuery('.b2s-curation-preview-area').show();
456
+ jQuery('.b2s-curation-select').show();
457
+ if(jQuery('#b2s-curation-post-format').val() == '0') {
458
+ jQuery('.b2s-curation-link-area').show();
459
+ } else if(jQuery('#b2s-curation-post-format').val() == '1') {
460
+ jQuery('.b2s-curation-image-area').show();
461
+ } else {
462
+ jQuery('.b2s-curation-text-area').show();
463
+ }
464
  }
465
 
466
  }
529
  jQuery('#b2s-post-curation-comment').addClass('error');
530
  noContent = true;
531
  }
532
+ } else if(jQuery('#b2s-curation-post-format').val() == '1') {
533
  if (jQuery('.b2s-image-url-hidden-field').val().length === 0) {
534
  jQuery('.b2s-post-item-details-url-image').addClass('error');
535
  noContent = true;
538
  jQuery('#b2s-post-curation-comment-image').addClass('error');
539
  noContent = true;
540
  }
541
+ } else {
542
+ if (jQuery('#b2s-post-curation-comment-text').val().length === 0) {
543
+ jQuery('#b2s-post-curation-comment-text').addClass('error');
544
+ noContent = true;
545
+ }
546
  }
547
  if (noContent) {
548
  return false;
583
  jQuery('.b2s-loading-area').hide();
584
  jQuery('.b2s-curation-settings-area').show();
585
  if(jQuery('#b2s-curation-post-format').val() == '0') {
586
+ jQuery('.b2s-curation-preview-area').show();
587
+ } else if(jQuery('#b2s-curation-post-format').val() == '1') {
588
+ jQuery('.b2s-curation-image-area').show();
589
+ } else {
590
+ jQuery('.b2s-curation-image-area').show();
591
+ }
592
  jQuery('.b2s-curation-select').show();
593
 
594
  }
assets/js/b2s/ship.js CHANGED
@@ -1790,7 +1790,7 @@ jQuery(document).on('click', '.scroll-to-bottom', function () {
1790
  return false;
1791
  });
1792
  jQuery(document).on('click', '.b2s-post-item-details-preview-url-reload', function () {
1793
- var re = new RegExp(/^(https?:\/\/)+[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+(?:\.[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=%.ÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+$/);
1794
  var networkAuthId = jQuery(this).attr('data-network-auth-id');
1795
  var url = jQuery('.b2s-post-item-details-item-url-input[data-network-auth-id="' + networkAuthId + '"]').val();
1796
  if (re.test(url)) {
@@ -2303,7 +2303,7 @@ jQuery.validator.addMethod("checkUrl", function (value, element, regexp) {
2303
  return this.optional(element) || re.test(value);
2304
  }, "Invalid Url");
2305
  jQuery.validator.addClassRules("b2s-post-item-details-item-url-input", {
2306
- checkUrl: /^(https?:\/\/)+[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+(?:\.[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=%.ÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+$/
2307
  });
2308
  //Twitter TOS 032018 - protected multiple accounts with same content to same time ( by all connections)
2309
  jQuery.validator.addMethod("unique", function (value, element, params) {
1790
  return false;
1791
  });
1792
  jQuery(document).on('click', '.b2s-post-item-details-preview-url-reload', function () {
1793
+ var re = new RegExp(/^(https?:\/\/)+[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß-]+(?:\.[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=%.ÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+$/);
1794
  var networkAuthId = jQuery(this).attr('data-network-auth-id');
1795
  var url = jQuery('.b2s-post-item-details-item-url-input[data-network-auth-id="' + networkAuthId + '"]').val();
1796
  if (re.test(url)) {
2303
  return this.optional(element) || re.test(value);
2304
  }, "Invalid Url");
2305
  jQuery.validator.addClassRules("b2s-post-item-details-item-url-input", {
2306
+ checkUrl: /^(https?:\/\/)+[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß-]+(?:\.[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=%.ÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+$/
2307
  });
2308
  //Twitter TOS 032018 - protected multiple accounts with same content to same time ( by all connections)
2309
  jQuery.validator.addMethod("unique", function (value, element, params) {
assets/js/b2s/wp/post-box.js CHANGED
@@ -336,7 +336,7 @@ jQuery(document).on('change', '#b2s-post-meta-box-profil-dropdown', function ()
336
  });
337
 
338
  function b2sIsValidUrl(str) {
339
- var pattern = new RegExp(/^(https?:\/\/)+[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+(?:\.[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=%.ÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+$/);
340
  if (!pattern.test(str)) {
341
  return false;
342
  }
336
  });
337
 
338
  function b2sIsValidUrl(str) {
339
+ var pattern = new RegExp(/^(https?:\/\/)+[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß-]+(?:\.[a-zA-Z0-9\wÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=%.ÄÖÜÑÁÉÍÓÚÂÃÀÇÊÔÕÆÈËÎÏŒÙÛŸØÅöäüñáéíóúâãàçêôõæèëîïœùûÿøåß]+$/);
340
  if (!pattern.test(str)) {
341
  return false;
342
  }
blog2social.php CHANGED
@@ -6,12 +6,12 @@
6
  * Author: Blog2Social, Adenion
7
  * Text Domain: blog2social
8
  * Domain Path: /languages
9
- * Version: 6.6.1
10
  * Author URI: https://www.blog2social.com
11
  * License: GPL2+
12
  */
13
 
14
- define('B2S_PLUGIN_VERSION', '661');
15
  define('B2S_PLUGIN_LANGUAGE', serialize(array('de_DE', 'en_US')));
16
  define('B2S_PLUGIN_DIR', plugin_dir_path(__FILE__));
17
  define('B2S_PLUGIN_URL', plugin_dir_url(__FILE__));
6
  * Author: Blog2Social, Adenion
7
  * Text Domain: blog2social
8
  * Domain Path: /languages
9
+ * Version: 6.6.2
10
  * Author URI: https://www.blog2social.com
11
  * License: GPL2+
12
  */
13
 
14
+ define('B2S_PLUGIN_VERSION', '662');
15
  define('B2S_PLUGIN_LANGUAGE', serialize(array('de_DE', 'en_US')));
16
  define('B2S_PLUGIN_DIR', plugin_dir_path(__FILE__));
17
  define('B2S_PLUGIN_URL', plugin_dir_url(__FILE__));
includes/Ajax/Post.php CHANGED
@@ -69,20 +69,27 @@ class Ajax_Post {
69
  //save as blog post
70
  if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') > 0) { //0-24hours lifetime
71
  if (isset($_POST['postFormat'])) {
72
- if ((int) $_POST['postFormat'] > 0) { //Imagepost
73
  if (isset($_POST['image_id']) && !empty($_POST['image_id']) && isset($_POST['comment_image']) && !empty($_POST['comment_image'])) {
74
  $data = array('title' => sanitize_text_field($_POST['comment_image']), 'content' => $_POST['comment_image'], 'image_id' => $_POST['image_id'], 'author_id' => B2S_PLUGIN_BLOG_USER_ID);
75
  } else {
76
  echo json_encode(array('result' => false, 'error' => 'NO_DATA'));
77
  wp_die();
78
  }
79
- } else { //Linkpost
80
  if (isset($_POST['title']) && !empty($_POST['title']) && isset($_POST['comment']) && !empty($_POST['comment']) && isset($_POST['url']) && !empty($_POST['url'])) {
81
  $data = array('title' => sanitize_text_field($_POST['title']), 'url' => esc_url($_POST['url']), 'content' => (isset($_POST['comment']) ? sanitize_textarea_field($_POST['comment']) : ''), 'author_id' => B2S_PLUGIN_BLOG_USER_ID);
82
  } else {
83
  echo json_encode(array('result' => false, 'error' => 'NO_DATA'));
84
  wp_die();
85
  }
 
 
 
 
 
 
 
86
  }
87
  require_once (B2S_PLUGIN_DIR . 'includes/B2S/Curation/Save.php');
88
  if (isset($_POST['b2s-draft-id']) && !empty($_POST['b2s-draft-id']) && (int) $_POST['b2s-draft-id'] > 0) {
@@ -319,7 +326,7 @@ class Ajax_Post {
319
  public function curationCustomize() {
320
  if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') > 0) {
321
  if (isset($_POST['postFormat'])) {
322
- if ((int) $_POST['postFormat'] > 0) { //Imagepost
323
  if (isset($_POST['image_id']) && !empty($_POST['image_id']) && isset($_POST['comment_image']) && !empty($_POST['comment_image'])) {
324
  $data = array('title' => sanitize_text_field($_POST['comment_image']), 'content' => $_POST['comment_image'], 'image_id' => $_POST['image_id'], 'author_id' => B2S_PLUGIN_BLOG_USER_ID);
325
  $imgUrl = (isset($_POST['image_url']) && !empty($_POST['image_url'])) ? $_POST['image_url'] : '';
@@ -327,7 +334,7 @@ class Ajax_Post {
327
  echo json_encode(array('result' => false, 'error' => 'NO_DATA'));
328
  wp_die();
329
  }
330
- } else { //Linkpost
331
  if (isset($_POST['title']) && !empty($_POST['title']) && isset($_POST['comment']) && !empty($_POST['comment']) && isset($_POST['url']) && !empty($_POST['url'])) {
332
  $data = array('title' => sanitize_text_field($_POST['title']), 'url' => esc_url($_POST['url']), 'content' => (isset($_POST['comment']) ? sanitize_textarea_field($_POST['comment']) : ''), 'author_id' => B2S_PLUGIN_BLOG_USER_ID);
333
  $imgUrl = (isset($_POST['link_image_url']) && !empty($_POST['link_image_url'])) ? $_POST['link_image_url'] : '';
@@ -335,6 +342,13 @@ class Ajax_Post {
335
  echo json_encode(array('result' => false, 'error' => 'NO_DATA'));
336
  wp_die();
337
  }
 
 
 
 
 
 
 
338
  }
339
  if (isset($_POST['b2s-draft-id']) && !empty($_POST['b2s-draft-id']) && (int) $_POST['b2s-draft-id'] > 0) {
340
  $data = array_merge($data, array('ID' => (int) $_POST['b2s-draft-id']));
69
  //save as blog post
70
  if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') > 0) { //0-24hours lifetime
71
  if (isset($_POST['postFormat'])) {
72
+ if ((int) $_POST['postFormat'] == 1) { //Imagepost
73
  if (isset($_POST['image_id']) && !empty($_POST['image_id']) && isset($_POST['comment_image']) && !empty($_POST['comment_image'])) {
74
  $data = array('title' => sanitize_text_field($_POST['comment_image']), 'content' => $_POST['comment_image'], 'image_id' => $_POST['image_id'], 'author_id' => B2S_PLUGIN_BLOG_USER_ID);
75
  } else {
76
  echo json_encode(array('result' => false, 'error' => 'NO_DATA'));
77
  wp_die();
78
  }
79
+ } else if ((int) $_POST['postFormat'] == 0) { //Linkpost
80
  if (isset($_POST['title']) && !empty($_POST['title']) && isset($_POST['comment']) && !empty($_POST['comment']) && isset($_POST['url']) && !empty($_POST['url'])) {
81
  $data = array('title' => sanitize_text_field($_POST['title']), 'url' => esc_url($_POST['url']), 'content' => (isset($_POST['comment']) ? sanitize_textarea_field($_POST['comment']) : ''), 'author_id' => B2S_PLUGIN_BLOG_USER_ID);
82
  } else {
83
  echo json_encode(array('result' => false, 'error' => 'NO_DATA'));
84
  wp_die();
85
  }
86
+ } else {
87
+ if (isset($_POST['comment_text']) && !empty($_POST['comment_text'])) {
88
+ $data = array('title' => sanitize_text_field($_POST['comment_text']), 'content' => sanitize_textarea_field($_POST['comment_text']), 'author_id' => B2S_PLUGIN_BLOG_USER_ID);
89
+ } else {
90
+ echo json_encode(array('result' => false, 'error' => 'NO_DATA'));
91
+ wp_die();
92
+ }
93
  }
94
  require_once (B2S_PLUGIN_DIR . 'includes/B2S/Curation/Save.php');
95
  if (isset($_POST['b2s-draft-id']) && !empty($_POST['b2s-draft-id']) && (int) $_POST['b2s-draft-id'] > 0) {
326
  public function curationCustomize() {
327
  if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') > 0) {
328
  if (isset($_POST['postFormat'])) {
329
+ if ((int) $_POST['postFormat'] == 1) { //Imagepost
330
  if (isset($_POST['image_id']) && !empty($_POST['image_id']) && isset($_POST['comment_image']) && !empty($_POST['comment_image'])) {
331
  $data = array('title' => sanitize_text_field($_POST['comment_image']), 'content' => $_POST['comment_image'], 'image_id' => $_POST['image_id'], 'author_id' => B2S_PLUGIN_BLOG_USER_ID);
332
  $imgUrl = (isset($_POST['image_url']) && !empty($_POST['image_url'])) ? $_POST['image_url'] : '';
334
  echo json_encode(array('result' => false, 'error' => 'NO_DATA'));
335
  wp_die();
336
  }
337
+ } else if ((int) $_POST['postFormat'] == 0) { //Linkpost
338
  if (isset($_POST['title']) && !empty($_POST['title']) && isset($_POST['comment']) && !empty($_POST['comment']) && isset($_POST['url']) && !empty($_POST['url'])) {
339
  $data = array('title' => sanitize_text_field($_POST['title']), 'url' => esc_url($_POST['url']), 'content' => (isset($_POST['comment']) ? sanitize_textarea_field($_POST['comment']) : ''), 'author_id' => B2S_PLUGIN_BLOG_USER_ID);
340
  $imgUrl = (isset($_POST['link_image_url']) && !empty($_POST['link_image_url'])) ? $_POST['link_image_url'] : '';
342
  echo json_encode(array('result' => false, 'error' => 'NO_DATA'));
343
  wp_die();
344
  }
345
+ } else if ((int) $_POST['postFormat'] == 2) {//Textpost
346
+ if (isset($_POST['comment_text']) && !empty($_POST['comment_text'])) {
347
+ $data = array('title' => sanitize_text_field($_POST['comment_text']), 'content' => $_POST['comment_text'], 'author_id' => B2S_PLUGIN_BLOG_USER_ID);
348
+ } else {
349
+ echo json_encode(array('result' => false, 'error' => 'NO_DATA'));
350
+ wp_die();
351
+ }
352
  }
353
  if (isset($_POST['b2s-draft-id']) && !empty($_POST['b2s-draft-id']) && (int) $_POST['b2s-draft-id'] > 0) {
354
  $data = array_merge($data, array('ID' => (int) $_POST['b2s-draft-id']));
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: auto post, auto publish, social media scheduling, social media calendar, s
5
  Donate link: https://paypal.me/adenion
6
  Requires at least: 4.7.0
7
  Tested up to: 5.6
8
- Stable tag: 6.6.1
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -221,6 +221,8 @@ To get started with the basics of Blog2Social and maybe find some useful tips an
221
  7. Keep track of your shared posts and scheduling plan with the Social Media Calendar.
222
 
223
  == Changelog ==
 
 
224
  = 6.6.1 =
225
  Usability Optimization
226
  = 6.6.0 =
@@ -311,6 +313,8 @@ Usability Optimization
311
  Content Curation with links, WooCommerce compatibility, gutenberg editor compatibility
312
 
313
  == Upgrade Notice ==
 
 
314
  = 6.6.1 =
315
  Usability Optimization
316
  = 6.6.0 =
5
  Donate link: https://paypal.me/adenion
6
  Requires at least: 4.7.0
7
  Tested up to: 5.6
8
+ Stable tag: 6.6.2
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
221
  7. Keep track of your shared posts and scheduling plan with the Social Media Calendar.
222
 
223
  == Changelog ==
224
+ = 6.6.2 =
225
+ Usability Optimization
226
  = 6.6.1 =
227
  Usability Optimization
228
  = 6.6.0 =
313
  Content Curation with links, WooCommerce compatibility, gutenberg editor compatibility
314
 
315
  == Upgrade Notice ==
316
+ = 6.6.2 =
317
+ Usability Optimization
318
  = 6.6.1 =
319
  Usability Optimization
320
  = 6.6.0 =