Blog2Social: Social Media Auto Post & Scheduler - Version 6.9.12

Version Description

Additional Security Update

Download this release

Release Info

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

Code changes from version 6.9.11 to 6.9.12

Files changed (4) hide show
  1. blog2social.php +1 -1
  2. includes/Ajax/Get.php +5 -5
  3. includes/Ajax/Post.php +32 -37
  4. readme.txt +5 -1
blog2social.php CHANGED
@@ -6,7 +6,7 @@
6
  * Author: Blog2Social, Adenion
7
  * Text Domain: blog2social
8
  * Domain Path: /languages
9
- * Version: 6.9.11
10
  * Author URI: https://www.blog2social.com
11
  * License: GPL2+
12
  */
6
  * Author: Blog2Social, Adenion
7
  * Text Domain: blog2social
8
  * Domain Path: /languages
9
+ * Version: 6.9.12
10
  * Author URI: https://www.blog2social.com
11
  * License: GPL2+
12
  */
includes/Ajax/Get.php CHANGED
@@ -265,7 +265,7 @@ class Ajax_Get {
265
 
266
  public function getPublishPostData() {
267
  if (current_user_can('read') && isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['b2s_security_nonce'])), 'b2s_security_nonce') > 0) {
268
- if ((int) $_POST['postId']) {
269
  require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Item.php');
270
  require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
271
  $postData = new B2S_Post_Item();
@@ -289,7 +289,7 @@ class Ajax_Get {
289
 
290
  public function getApprovePostData() {
291
  if (current_user_can('read') && isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['b2s_security_nonce'])), 'b2s_security_nonce') > 0) {
292
- if ((int) $_POST['postId']) {
293
  require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Item.php');
294
  require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
295
  $postData = new B2S_Post_Item();
@@ -423,7 +423,7 @@ class Ajax_Get {
423
  public function getUserTimeSettings() {
424
  if (current_user_can('read') && isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['b2s_security_nonce'])), 'b2s_security_nonce') > 0) {
425
  $lang = substr(B2S_LANGUAGE, 0, 2);
426
- $options = new B2S_Options(get_current_user_id());
427
  $userSchedData = $options->_getOption('auth_sched_time');
428
  if (isset($userSchedData['time'])) {
429
  if (is_array($userSchedData) && isset($userSchedData['delay_day']) && isset($userSchedData['time']) && is_array($userSchedData['time'])) {
@@ -540,8 +540,8 @@ class Ajax_Get {
540
  if ($item != null) {
541
  $lock_user_id = get_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . (int) $_POST['id']);
542
  if (!$lock_user_id) {
543
- update_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . (int) $_POST['id'], get_current_user_id(), false);
544
- $options = new B2S_Options(get_current_user_id());
545
  $block_old = $options->_getOption("B2S_PLUGIN_USER_CALENDAR_BLOCKED");
546
 
547
  if ($block_old) {
265
 
266
  public function getPublishPostData() {
267
  if (current_user_can('read') && isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['b2s_security_nonce'])), 'b2s_security_nonce') > 0) {
268
+ if (isset($_POST['postId']) && (int) $_POST['postId'] > 0) {
269
  require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Item.php');
270
  require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
271
  $postData = new B2S_Post_Item();
289
 
290
  public function getApprovePostData() {
291
  if (current_user_can('read') && isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['b2s_security_nonce'])), 'b2s_security_nonce') > 0) {
292
+ if (isset($_POST['postId']) && (int) $_POST['postId'] > 0) {
293
  require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Item.php');
294
  require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
295
  $postData = new B2S_Post_Item();
423
  public function getUserTimeSettings() {
424
  if (current_user_can('read') && isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['b2s_security_nonce'])), 'b2s_security_nonce') > 0) {
425
  $lang = substr(B2S_LANGUAGE, 0, 2);
426
+ $options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
427
  $userSchedData = $options->_getOption('auth_sched_time');
428
  if (isset($userSchedData['time'])) {
429
  if (is_array($userSchedData) && isset($userSchedData['delay_day']) && isset($userSchedData['time']) && is_array($userSchedData['time'])) {
540
  if ($item != null) {
541
  $lock_user_id = get_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . (int) $_POST['id']);
542
  if (!$lock_user_id) {
543
+ update_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . (int) $_POST['id'], B2S_PLUGIN_BLOG_USER_ID, false);
544
+ $options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
545
  $block_old = $options->_getOption("B2S_PLUGIN_USER_CALENDAR_BLOCKED");
546
 
547
  if ($block_old) {
includes/Ajax/Post.php CHANGED
@@ -471,15 +471,14 @@ class Ajax_Post {
471
 
472
  public function lockAutoPostImport() {
473
  if (current_user_can('read') && isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['b2s_security_nonce'])), 'b2s_security_nonce') > 0) {
474
- if (isset($_POST['userId']) && (int) $_POST['userId'] > 0) {
475
- update_option('B2S_LOCK_AUTO_POST_IMPORT_' . (int) $_POST['userId'], 1, false);
 
 
476
  }
477
- echo json_encode(array('result' => true));
478
- wp_die();
479
- } else {
480
- echo json_encode(array('result' => false, 'error' => 'nonce'));
481
- wp_die();
482
  }
 
 
483
  }
484
 
485
  public function prgLogin() {
@@ -762,36 +761,32 @@ class Ajax_Post {
762
  public function saveSocialMetaTags() {
763
  if (current_user_can('administrator') && isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['b2s_security_nonce'])), 'b2s_security_nonce') > 0) {
764
  $result = array('result' => true);
765
- if (isset($_POST['is_admin']) && (int) $_POST['is_admin'] == 1) {
766
-
767
- $options = new B2S_Options(0, 'B2S_PLUGIN_GENERAL_OPTIONS');
768
-
769
- $og_active = (!isset($_POST['b2s_og_active'])) ? 0 : 1;
770
- $options->_setOption('og_active', $og_active);
771
- $options->_setOption('og_default_title', ((B2S_PLUGIN_USER_VERSION >= 1) ? sanitize_text_field($_POST['b2s_og_default_title']) : ''));
772
- $options->_setOption('og_default_desc', ((B2S_PLUGIN_USER_VERSION >= 1) ? sanitize_text_field($_POST['b2s_og_default_desc']) : ''));
773
- $options->_setOption('og_default_image', ((B2S_PLUGIN_USER_VERSION >= 1) ? esc_url_raw($_POST['b2s_og_default_image']) : ''));
774
- $options->_setOption('og_imagedata_active', ((B2S_PLUGIN_USER_VERSION >= 1) ? (int) $_POST['b2s_og_imagedata_active'] : 1));
775
- $options->_setOption('og_objecttype_active', ((B2S_PLUGIN_USER_VERSION >= 1) ? (int) $_POST['b2s_og_objecttype_active'] : 1));
776
- $options->_setOption('og_locale_active', ((B2S_PLUGIN_USER_VERSION >= 1) ? (int) $_POST['b2s_og_locale_active'] : 1));
777
- $options->_setOption('og_locale', ((B2S_PLUGIN_USER_VERSION >= 1) ? sanitize_text_field($_POST['b2s_og_locale']) : ''));
778
-
779
- $card_active = (!isset($_POST['b2s_card_active'])) ? 0 : 1;
780
- $options->_setOption('card_active', $card_active);
781
- $options->_setOption('card_default_type', ((B2S_PLUGIN_USER_VERSION >= 1) ? sanitize_text_field($_POST['b2s_card_default_type']) : 0));
782
- $options->_setOption('card_default_title', ((B2S_PLUGIN_USER_VERSION >= 1) ? sanitize_text_field($_POST['b2s_card_default_title']) : ''));
783
- $options->_setOption('card_default_desc', ((B2S_PLUGIN_USER_VERSION >= 1) ? sanitize_text_field($_POST['b2s_card_default_desc']) : ''));
784
- $options->_setOption('card_default_image', ((B2S_PLUGIN_USER_VERSION >= 1) ? esc_url_raw($_POST['b2s_card_default_image']) : ''));
785
-
786
- $oembed_active = (!isset($_POST['b2s_oembed_active'])) ? 0 : 1;
787
- $options->_setOption('oembed_active', $oembed_active);
788
-
789
- $meta = B2S_Meta::getInstance();
790
- $result['b2s'] = ($card_active == 1 || $og_active == 1) ? true : false;
791
- $result['yoast'] = $meta->is_yoast_seo_active();
792
- $result['aioseop'] = $meta->is_aioseop_active();
793
- $result['webdados'] = $meta->is_webdados_active();
794
- }
795
 
796
  echo json_encode($result);
797
  wp_die();
471
 
472
  public function lockAutoPostImport() {
473
  if (current_user_can('read') && isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['b2s_security_nonce'])), 'b2s_security_nonce') > 0) {
474
+ if (isset($_POST['userId']) && (int) $_POST['userId'] > 0 && (int) $_POST['userId'] == B2S_PLUGIN_BLOG_USER_ID) {
475
+ update_option('B2S_LOCK_AUTO_POST_IMPORT_' . B2S_PLUGIN_BLOG_USER_ID, 1, false);
476
+ echo json_encode(array('result' => true));
477
+ wp_die();
478
  }
 
 
 
 
 
479
  }
480
+ echo json_encode(array('result' => false, 'error' => 'nonce'));
481
+ wp_die();
482
  }
483
 
484
  public function prgLogin() {
761
  public function saveSocialMetaTags() {
762
  if (current_user_can('administrator') && isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['b2s_security_nonce'])), 'b2s_security_nonce') > 0) {
763
  $result = array('result' => true);
764
+ $options = new B2S_Options(0, 'B2S_PLUGIN_GENERAL_OPTIONS');
765
+ $og_active = (!isset($_POST['b2s_og_active'])) ? 0 : 1;
766
+ $options->_setOption('og_active', $og_active);
767
+ $options->_setOption('og_default_title', ((B2S_PLUGIN_USER_VERSION >= 1) ? sanitize_text_field($_POST['b2s_og_default_title']) : ''));
768
+ $options->_setOption('og_default_desc', ((B2S_PLUGIN_USER_VERSION >= 1) ? sanitize_text_field($_POST['b2s_og_default_desc']) : ''));
769
+ $options->_setOption('og_default_image', ((B2S_PLUGIN_USER_VERSION >= 1) ? esc_url_raw($_POST['b2s_og_default_image']) : ''));
770
+ $options->_setOption('og_imagedata_active', ((B2S_PLUGIN_USER_VERSION >= 1) ? (int) $_POST['b2s_og_imagedata_active'] : 1));
771
+ $options->_setOption('og_objecttype_active', ((B2S_PLUGIN_USER_VERSION >= 1) ? (int) $_POST['b2s_og_objecttype_active'] : 1));
772
+ $options->_setOption('og_locale_active', ((B2S_PLUGIN_USER_VERSION >= 1) ? (int) $_POST['b2s_og_locale_active'] : 1));
773
+ $options->_setOption('og_locale', ((B2S_PLUGIN_USER_VERSION >= 1) ? sanitize_text_field($_POST['b2s_og_locale']) : ''));
774
+
775
+ $card_active = (!isset($_POST['b2s_card_active'])) ? 0 : 1;
776
+ $options->_setOption('card_active', $card_active);
777
+ $options->_setOption('card_default_type', ((B2S_PLUGIN_USER_VERSION >= 1) ? sanitize_text_field($_POST['b2s_card_default_type']) : 0));
778
+ $options->_setOption('card_default_title', ((B2S_PLUGIN_USER_VERSION >= 1) ? sanitize_text_field($_POST['b2s_card_default_title']) : ''));
779
+ $options->_setOption('card_default_desc', ((B2S_PLUGIN_USER_VERSION >= 1) ? sanitize_text_field($_POST['b2s_card_default_desc']) : ''));
780
+ $options->_setOption('card_default_image', ((B2S_PLUGIN_USER_VERSION >= 1) ? esc_url_raw($_POST['b2s_card_default_image']) : ''));
781
+
782
+ $oembed_active = (!isset($_POST['b2s_oembed_active'])) ? 0 : 1;
783
+ $options->_setOption('oembed_active', $oembed_active);
784
+
785
+ $meta = B2S_Meta::getInstance();
786
+ $result['b2s'] = ($card_active == 1 || $og_active == 1) ? true : false;
787
+ $result['yoast'] = $meta->is_yoast_seo_active();
788
+ $result['aioseop'] = $meta->is_aioseop_active();
789
+ $result['webdados'] = $meta->is_webdados_active();
 
 
 
 
790
 
791
  echo json_encode($result);
792
  wp_die();
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: 6.0
8
- Stable tag: 6.9.11
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -234,6 +234,8 @@ To get started with the basics of Blog2Social and maybe find some useful tips an
234
  7. Keep track of your shared posts and scheduling plan with the Social Media Calendar.
235
 
236
  == Changelog ==
 
 
237
  = 6.9.11 =
238
  Additional Security Update & Bugfix Instagram carousel post
239
  = 6.9.10 =
@@ -330,6 +332,8 @@ Usability Optimization, Rebrandly integration, url parameter settings
330
  New Image Posts, Imgur, Animated Gifs and Emojis
331
 
332
  == Upgrade Notice ==
 
 
333
  = 6.9.11 =
334
  Additional Security Update & Bugfix Instagram carousel post
335
  = 6.9.10 =
5
  Donate link: https://paypal.me/adenion
6
  Requires at least: 4.7.0
7
  Tested up to: 6.0
8
+ Stable tag: 6.9.12
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
234
  7. Keep track of your shared posts and scheduling plan with the Social Media Calendar.
235
 
236
  == Changelog ==
237
+ = 6.9.12 =
238
+ Additional Security Update
239
  = 6.9.11 =
240
  Additional Security Update & Bugfix Instagram carousel post
241
  = 6.9.10 =
332
  New Image Posts, Imgur, Animated Gifs and Emojis
333
 
334
  == Upgrade Notice ==
335
+ = 6.9.12 =
336
+ Additional Security Update
337
  = 6.9.11 =
338
  Additional Security Update & Bugfix Instagram carousel post
339
  = 6.9.10 =