Blog2Social: Social Media Auto Post & Scheduler - Version 6.9.2

Version Description

Bugfixing Pinterest Connection

Download this release

Release Info

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

Code changes from version 6.9.0 to 6.9.2

assets/js/b2s/general.js CHANGED
@@ -350,3 +350,30 @@ jQuery(document).on('click', '.b2s-network-auth-info-close', function() {
350
  jQuery(this).closest('.b2s-network-auth-info').hide();
351
  });
352
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
350
  jQuery(this).closest('.b2s-network-auth-info').hide();
351
  });
352
 
353
+ jQuery(document).on('click', '.b2s-metrics-banner-close', function() {
354
+ jQuery('#b2s-metrics-banner-modal').modal('hide');
355
+ jQuery.ajax({
356
+ url: ajaxurl,
357
+ type: "POST",
358
+ dataType: "json",
359
+ cache: false,
360
+ data: {
361
+ 'action': 'b2s_metrics_banner_close',
362
+ 'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
363
+ },
364
+ error: function () {
365
+ jQuery('.b2s-server-connection-fail').show();
366
+ return false;
367
+ },
368
+ success: function (data) {
369
+ if (data.result == false) {
370
+ if (data.error == 'nonce') {
371
+ jQuery('.b2s-nonce-check-fail').show();
372
+ } else {
373
+ jQuery('.b2s-server-connection-fail').show();
374
+ }
375
+ }
376
+ return true;
377
+ }
378
+ });
379
+ });
assets/js/b2s/metrics.js CHANGED
@@ -177,17 +177,13 @@ jQuery(document).on('click', '.b2sGetB2SPostsByWpPost', function () {
177
  jQuery('.b2s-nonce-check-fail').show();
178
  }
179
  }
180
- // wp.heartbeat.connectNow();
181
  }
182
  });
183
- // jQuery(this).find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up').addClass('isload').addClass('isShow');
184
  } else {
185
  if (jQuery('.b2s-post-publish-area[data-post-id="' + postId + '"]').is(':visible')) {
186
  jQuery('.b2s-post-publish-area[data-post-id="' + postId + '"]').hide();
187
- // jQuery(this).find('i').removeClass('isShow').addClass('isHide').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down');
188
  } else {
189
  jQuery('.b2s-post-publish-area[data-post-id="' + postId + '"]').show();
190
- // jQuery(this).find('i').removeClass('isHide').addClass('isShow').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up');
191
  }
192
  }
193
  });
@@ -336,6 +332,20 @@ jQuery(document).on('click', '.b2s-metrics-starting-confirm-btn', function () {
336
  data: {
337
  'action': 'b2s_metrics_starting_confirm',
338
  'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  }
340
  });
341
  });
177
  jQuery('.b2s-nonce-check-fail').show();
178
  }
179
  }
 
180
  }
181
  });
 
182
  } else {
183
  if (jQuery('.b2s-post-publish-area[data-post-id="' + postId + '"]').is(':visible')) {
184
  jQuery('.b2s-post-publish-area[data-post-id="' + postId + '"]').hide();
 
185
  } else {
186
  jQuery('.b2s-post-publish-area[data-post-id="' + postId + '"]').show();
 
187
  }
188
  }
189
  });
332
  data: {
333
  'action': 'b2s_metrics_starting_confirm',
334
  'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
335
+ },
336
+ error: function () {
337
+ jQuery('.b2s-server-connection-fail').show();
338
+ return false;
339
+ },
340
+ success: function (data) {
341
+ if (data.result == false) {
342
+ if (data.error == 'nonce') {
343
+ jQuery('.b2s-nonce-check-fail').show();
344
+ } else {
345
+ jQuery('.b2s-server-connection-fail').show();
346
+ }
347
+ }
348
+ return true;
349
  }
350
  });
351
  });
blog2social.php CHANGED
@@ -6,12 +6,12 @@
6
  * Author: Blog2Social, Adenion
7
  * Text Domain: blog2social
8
  * Domain Path: /languages
9
- * Version: 6.9.0
10
  * Author URI: https://www.blog2social.com
11
  * License: GPL2+
12
  */
13
 
14
- define('B2S_PLUGIN_VERSION', '690');
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.9.2
10
  * Author URI: https://www.blog2social.com
11
  * License: GPL2+
12
  */
13
 
14
+ define('B2S_PLUGIN_VERSION', '692');
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
@@ -65,6 +65,7 @@ class Ajax_Post {
65
  add_action('wp_ajax_b2s_auto_post_assign_by_disconnect', array($this, 'autoPostAssignByDisconnect'));
66
  add_action('wp_ajax_b2s_network_check_user_data', array($this, 'networkCheckUserData'));
67
  add_action('wp_ajax_b2s_metrics_starting_confirm', array($this, 'metricsStartingConfirm'));
 
68
  }
69
 
70
  public function curationDraft() {
@@ -2597,7 +2598,20 @@ class Ajax_Post {
2597
  require_once (B2S_PLUGIN_DIR . '/includes/Options.php');
2598
  $option = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
2599
  $option->_setOption('metrics_started', true);
2600
- echo json_encode(array('result' => false));
 
 
 
 
 
 
 
 
 
 
 
 
 
2601
  wp_die();
2602
  } else {
2603
  echo json_encode(array('result' => false, 'error_reason' => 'nonce'));
65
  add_action('wp_ajax_b2s_auto_post_assign_by_disconnect', array($this, 'autoPostAssignByDisconnect'));
66
  add_action('wp_ajax_b2s_network_check_user_data', array($this, 'networkCheckUserData'));
67
  add_action('wp_ajax_b2s_metrics_starting_confirm', array($this, 'metricsStartingConfirm'));
68
+ add_action('wp_ajax_b2s_metrics_banner_close', array($this, 'metricsBannerClose'));
69
  }
70
 
71
  public function curationDraft() {
2598
  require_once (B2S_PLUGIN_DIR . '/includes/Options.php');
2599
  $option = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
2600
  $option->_setOption('metrics_started', true);
2601
+ echo json_encode(array('result' => true));
2602
+ wp_die();
2603
+ } else {
2604
+ echo json_encode(array('result' => false, 'error_reason' => 'nonce'));
2605
+ wp_die();
2606
+ }
2607
+ }
2608
+
2609
+ public function metricsBannerClose() {
2610
+ if (isset($_POST['b2s_security_nonce']) && (int) wp_verify_nonce($_POST['b2s_security_nonce'], 'b2s_security_nonce') > 0) {
2611
+ require_once (B2S_PLUGIN_DIR . '/includes/Options.php');
2612
+ $option = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
2613
+ $option->_setOption('metrics_banner', true);
2614
+ echo json_encode(array('result' => true));
2615
  wp_die();
2616
  } else {
2617
  echo json_encode(array('result' => false, 'error_reason' => 'nonce'));
includes/B2S/{Network → Api/Network}/Pinterest.php RENAMED
@@ -111,7 +111,7 @@ class B2S_Api_Network_Pinterest {
111
  }
112
  if (empty($csrfToken)) {
113
  $error_data = trim(str_replace(array("\r\n", "\r", "\n"), " | ", strip_tags($this->cutFromTo($content, '</head>', '</body>'))));
114
- return array('error' => 1, 'error_pos' => 2, 'location' => $this->route . 'login/', 'error_data' => 'CSRF verification failed - RESPONSE: ' . serialize($error_data) . ' COOKIE: ' . serialize($cookie));
115
  }
116
  $headerData = $this->setHeader($this->route . 'login/', $this->route, 'POST', true);
117
  $headerData['X-APP-VERSION'] = $appVersion;
@@ -137,7 +137,7 @@ class B2S_Api_Network_Pinterest {
137
  $content = $result['body'];
138
  $response = json_decode($content, true);
139
  } else {
140
- return array('error' => 1, 'error_pos' => 5, 'error_data' => serialize($result));
141
  }
142
  if (is_array($response) && empty($response['resource_response']['error'])) {
143
  $this->cookie = $result['cookies'];
@@ -170,6 +170,14 @@ class B2S_Api_Network_Pinterest {
170
  //$this->setRoute();
171
  $headerData = $this->setHeader($this->route, $this->route, 'JSON', true, false);
172
  $headerData['X-APP-VERSION'] = $this->appVersion;
 
 
 
 
 
 
 
 
173
  $pinBoardUrl = $this->route . 'resource/BoardPickerBoardsResource/get/';
174
  $requestData = array('headers' => $headerData, 'cookies' => $this->cookie, 'timeout' => $this->timeout);
175
  $result = wp_remote_get($pinBoardUrl, $requestData);
@@ -178,6 +186,11 @@ class B2S_Api_Network_Pinterest {
178
  }
179
  $content = $result['body'];
180
  $response = json_decode($content, true);
 
 
 
 
 
181
  if (!empty($response['resource_data_cache']) || !empty($response['resource_response'])) {
182
  if (!empty($response['resource_data_cache'])) {
183
  $boardsData = $response['resource_data_cache'];
111
  }
112
  if (empty($csrfToken)) {
113
  $error_data = trim(str_replace(array("\r\n", "\r", "\n"), " | ", strip_tags($this->cutFromTo($content, '</head>', '</body>'))));
114
+ return array('error' => 1, 'error_pos' => 2, 'location' => $this->route . 'login/', 'error_data' => 'CSRF verification failed - RESPONSE: ' . serialize($error_data) . ' COOKIE: ' . serialize($cookie), 'error_code' => 'invalid');
115
  }
116
  $headerData = $this->setHeader($this->route . 'login/', $this->route, 'POST', true);
117
  $headerData['X-APP-VERSION'] = $appVersion;
137
  $content = $result['body'];
138
  $response = json_decode($content, true);
139
  } else {
140
+ return array('error' => 1, 'error_pos' => 5, 'error_data' => serialize($result), 'error_code' => 'invalid');
141
  }
142
  if (is_array($response) && empty($response['resource_response']['error'])) {
143
  $this->cookie = $result['cookies'];
170
  //$this->setRoute();
171
  $headerData = $this->setHeader($this->route, $this->route, 'JSON', true, false);
172
  $headerData['X-APP-VERSION'] = $this->appVersion;
173
+ if(is_array($this->cookie) && !empty($this->cookie)) {
174
+ foreach($this->cookie as $cookie) {
175
+ if(isset($cookie->name) && !empty($cookie->name) && $cookie->name == "_auth" && isset($cookie->domain) && !empty($cookie->domain)) {
176
+ $this->route = 'https://' . $cookie->domain . '/';
177
+ break;
178
+ }
179
+ }
180
+ }
181
  $pinBoardUrl = $this->route . 'resource/BoardPickerBoardsResource/get/';
182
  $requestData = array('headers' => $headerData, 'cookies' => $this->cookie, 'timeout' => $this->timeout);
183
  $result = wp_remote_get($pinBoardUrl, $requestData);
186
  }
187
  $content = $result['body'];
188
  $response = json_decode($content, true);
189
+ if($response == null || !is_array($response) || empty($response)) {
190
+ if(isset($result['response']) && !empty($result['response']) && isset($result['response']['code']) && $result['response']['code'] == 403) {
191
+ return array('error' => 403, 'error_pos' => 1, 'error_data' => 'access_denied', 'error_code' => 'limit');
192
+ }
193
+ }
194
  if (!empty($response['resource_data_cache']) || !empty($response['resource_response'])) {
195
  if (!empty($response['resource_data_cache'])) {
196
  $boardsData = $response['resource_data_cache'];
includes/B2S/{Network → Api/Network}/public_key.pem RENAMED
File without changes
includes/B2S/Heartbeat.php CHANGED
@@ -336,7 +336,7 @@ class B2S_Heartbeat {
336
 
337
  private function updateInsights() {
338
  global $wpdb;
339
- $sql = "SELECT user.token, insights.network_post_id, insights.insight, network_details.network_auth_id, network_details.network_id, network_details.network_type FROM {$wpdb->prefix}b2s_posts_insights as insights LEFT JOIN {$wpdb->prefix}b2s_user AS user on insights.blog_user_id = user.blog_user_id LEFT JOIN {$wpdb->prefix}b2s_posts_network_details AS network_details on insights.b2s_posts_network_details_id = network_details.id WHERE insights.active = %d AND insights.last_update < %s LIMIT 500";
340
  $sendData = $wpdb->get_results($wpdb->prepare($sql, 1, date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . ' -1 day'))), ARRAY_A);
341
  if (is_array($sendData) && !empty($sendData) && isset($sendData[0])) {
342
  $tempData = array('action' => 'updateInsights', 'data' => $sendData);
336
 
337
  private function updateInsights() {
338
  global $wpdb;
339
+ $sql = "SELECT user.token, insights.network_post_id, insights.insight, network_details.network_auth_id, network_details.network_id, network_details.network_type FROM {$wpdb->prefix}b2s_posts_insights as insights LEFT JOIN {$wpdb->prefix}b2s_user AS user on insights.blog_user_id = user.blog_user_id LEFT JOIN {$wpdb->prefix}b2s_posts_network_details AS network_details on insights.b2s_posts_network_details_id = network_details.id WHERE insights.active = %d AND insights.last_update < %s LIMIT 50";
340
  $sendData = $wpdb->get_results($wpdb->prepare($sql, 1, date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . ' -1 day'))), ARRAY_A);
341
  if (is_array($sendData) && !empty($sendData) && isset($sendData[0])) {
342
  $tempData = array('action' => 'updateInsights', 'data' => $sendData);
includes/B2S/Metrics/Item.php CHANGED
@@ -8,7 +8,7 @@ class B2S_Metrics_Item {
8
 
9
  public function getNetworkCount() {
10
  global $wpdb;
11
- $getNetworks = $wpdb->get_results("SELECT network_id, count(*) as networkCount FROM {$wpdb->prefix}b2s_network_insights as insights LEFT JOIN {$wpdb->prefix}b2s_posts_network_details as network ON insights.b2s_posts_network_details_id = network.id WHERE (network_id = 2) OR (network_id = 1 AND network_type = 1) GROUP BY network_id");
12
  $networkCount = array(1 => 0, 2 => 0);
13
  if($getNetworks != null) {
14
  foreach($getNetworks as $key => $network) {
@@ -125,30 +125,27 @@ class B2S_Metrics_Item {
125
  $sqlGetPosts = "SELECT posts.id, insights.insight, insights.last_update, posts.post_id, posts.publish_date, b2s_favorites.blog_user_id as favorites_blog_user_id, insights.active "
126
  . "FROM {$wpdb->prefix}b2s_posts as posts "
127
  . "LEFT JOIN {$wpdb->prefix}b2s_posts_insights as insights ON posts.id = insights.b2s_posts_id ";
128
- // if((int) $filter_network_id > 0) {
129
  $sqlGetPosts .="LEFT JOIN {$wpdb->prefix}b2s_posts_network_details as networkDetails ON posts.network_details_id = networkDetails.id ";
130
- // }
131
  $sqlGetPosts .= "LEFT JOIN ( SELECT post_id, blog_user_id FROM {$wpdb->prefix}b2s_posts_favorites WHERE blog_user_id = " . B2S_PLUGIN_BLOG_USER_ID . " ) as b2s_favorites ON posts.post_id = b2s_favorites.post_id "
132
  . "WHERE insights.id IS NOT NULL "
133
  . "AND posts.publish_date >= '". $compareDate1. " 00:00:00' "
134
- . "AND posts.publish_date <= '". $compareDate2. " 23:59:59' "
135
  . "AND posts.hide = 0 ";
136
- // if((int) $filter_network_id > 0) {
137
  $sqlGetPosts .="AND networkDetails.network_id IN(" . $filterNetworks . ") ";
138
- // }
139
 
140
  $sqlGetPosts .= " ORDER BY insights.id DESC ";
141
 
142
  $getPosts = $wpdb->get_results($sqlGetPosts);
143
 
144
  $postsData = array();
 
145
  $postsTotal = 0;
146
  $postsCountCompare = 0;
147
  $impressionsTotal = 0;
148
  $engagementsTotal = 0;
149
  if($getPosts != null) {
150
  foreach($getPosts as $key => $post) {
151
- if(isset($post->id) && (int) $post->id > 0 && isset($post->post_id) && (int) $post->post_id > 0 && isset($post->insight) && !empty($post->insight)) {
152
  $postInsights = json_decode($post->insight, true);
153
  if($postInsights !== false && isset($postInsights['insights']) && !empty($postInsights['insights']) && isset($postInsights['insights']['data'])) {
154
  $postImpressions = 0;
@@ -207,6 +204,7 @@ class B2S_Metrics_Item {
207
 
208
  $postsData[$post->post_id]['favorite'] = ((isset($post->favorites_blog_user_id) && $post->favorites_blog_user_id != NULL && $post->favorites_blog_user_id == B2S_PLUGIN_BLOG_USER_ID) ? true : false);
209
  }
 
210
  }
211
 
212
  }
8
 
9
  public function getNetworkCount() {
10
  global $wpdb;
11
+ $getNetworks = $wpdb->get_results("SELECT count(*) as networkCount, innerSelect.network_id FROM (SELECT network_id FROM {$wpdb->prefix}b2s_posts_insights as insights LEFT JOIN {$wpdb->prefix}b2s_posts_network_details as network ON insights.b2s_posts_network_details_id = network.id WHERE (network_id = 2) OR (network_id = 1 AND network_type = 1) GROUP BY b2s_posts_network_details_id) as innerSelect GROUP BY innerSelect.network_id");
12
  $networkCount = array(1 => 0, 2 => 0);
13
  if($getNetworks != null) {
14
  foreach($getNetworks as $key => $network) {
125
  $sqlGetPosts = "SELECT posts.id, insights.insight, insights.last_update, posts.post_id, posts.publish_date, b2s_favorites.blog_user_id as favorites_blog_user_id, insights.active "
126
  . "FROM {$wpdb->prefix}b2s_posts as posts "
127
  . "LEFT JOIN {$wpdb->prefix}b2s_posts_insights as insights ON posts.id = insights.b2s_posts_id ";
 
128
  $sqlGetPosts .="LEFT JOIN {$wpdb->prefix}b2s_posts_network_details as networkDetails ON posts.network_details_id = networkDetails.id ";
 
129
  $sqlGetPosts .= "LEFT JOIN ( SELECT post_id, blog_user_id FROM {$wpdb->prefix}b2s_posts_favorites WHERE blog_user_id = " . B2S_PLUGIN_BLOG_USER_ID . " ) as b2s_favorites ON posts.post_id = b2s_favorites.post_id "
130
  . "WHERE insights.id IS NOT NULL "
131
  . "AND posts.publish_date >= '". $compareDate1. " 00:00:00' "
132
+ . "AND posts.publish_date <= '". ((isset($filter_dates) && !empty($filter_dates)) ? $compareDate2 : $todayDate). " 23:59:59' "
133
  . "AND posts.hide = 0 ";
 
134
  $sqlGetPosts .="AND networkDetails.network_id IN(" . $filterNetworks . ") ";
 
135
 
136
  $sqlGetPosts .= " ORDER BY insights.id DESC ";
137
 
138
  $getPosts = $wpdb->get_results($sqlGetPosts);
139
 
140
  $postsData = array();
141
+ $doneB2sPostsIds = array();
142
  $postsTotal = 0;
143
  $postsCountCompare = 0;
144
  $impressionsTotal = 0;
145
  $engagementsTotal = 0;
146
  if($getPosts != null) {
147
  foreach($getPosts as $key => $post) {
148
+ if(isset($post->id) && (int) $post->id > 0 && !in_array($post->id, $doneB2sPostsIds) && isset($post->post_id) && (int) $post->post_id > 0 && isset($post->insight) && !empty($post->insight)) {
149
  $postInsights = json_decode($post->insight, true);
150
  if($postInsights !== false && isset($postInsights['insights']) && !empty($postInsights['insights']) && isset($postInsights['insights']['data'])) {
151
  $postImpressions = 0;
204
 
205
  $postsData[$post->post_id]['favorite'] = ((isset($post->favorites_blog_user_id) && $post->favorites_blog_user_id != NULL && $post->favorites_blog_user_id == B2S_PLUGIN_BLOG_USER_ID) ? true : false);
206
  }
207
+ $doneB2sPostsIds[] = $post->id;
208
  }
209
 
210
  }
includes/B2S/Post/Item.php CHANGED
@@ -736,6 +736,7 @@ class B2S_Post_Item {
736
  $sqlData = $wpdb->prepare("SELECT `{$wpdb->prefix}b2s_posts`.`id`,`{$wpdb->prefix}b2s_posts`.`blog_user_id`, `sched_date`,`publish_date`,`publish_link`,`sched_type`,`publish_error_code`,`sched_details_id`,`post_format`,`{$wpdb->prefix}b2s_posts_sched_details`.`sched_data`,`{$wpdb->prefix}b2s_posts_network_details`.`network_id`,`{$wpdb->prefix}b2s_posts_network_details`.`network_type`, `{$wpdb->prefix}b2s_posts_network_details`.`network_auth_id`, `{$wpdb->prefix}b2s_posts_network_details`.`network_display_name`, `{$wpdb->prefix}b2s_posts_insights`.`insight`, `{$wpdb->prefix}b2s_posts_insights`.`active` as insightsActive FROM `{$wpdb->prefix}b2s_posts` LEFT JOIN `{$wpdb->prefix}b2s_posts_network_details` ON `{$wpdb->prefix}b2s_posts`.`network_details_id` = `{$wpdb->prefix}b2s_posts_network_details`.`id` LEFT JOIN `{$wpdb->prefix}b2s_posts_sched_details` ON `{$wpdb->prefix}b2s_posts`.`sched_details_id` = `{$wpdb->prefix}b2s_posts_sched_details`.`id` LEFT JOIN `{$wpdb->prefix}b2s_posts_insights` ON `{$wpdb->prefix}b2s_posts`.`id` = `{$wpdb->prefix}b2s_posts_insights`.`b2s_posts_id` WHERE `{$wpdb->prefix}b2s_posts`.`hide` = 0 AND `{$wpdb->prefix}b2s_posts`.`post_for_approve`= 0 AND (`{$wpdb->prefix}b2s_posts`.`sched_date` = '0000-00-00 00:00:00' OR (`{$wpdb->prefix}b2s_posts`.`sched_type` = 3 AND `{$wpdb->prefix}b2s_posts`.`publish_date` != '0000-00-00 00:00:00')) $addWhere $addNotAdminPosts $addSharedByUser $addSharedOnNetwork $addSearchShowByDate AND `{$wpdb->prefix}b2s_posts`.`post_id` = %d ORDER BY `{$wpdb->prefix}b2s_posts`.`publish_date` DESC", $post_id);
737
  $result = $wpdb->get_results($sqlData);
738
  $specialPostingData = array(3 => esc_html__('Auto-Posting', 'blog2social'), 4 => esc_html__('Retweet', 'blog2social'), 5 => esc_html__('Re-Share', 'blog2social'));
 
739
  if (!empty($result) && is_array($result)) {
740
  $networkType = unserialize(B2S_PLUGIN_NETWORK_TYPE);
741
  $networkName = unserialize(B2S_PLUGIN_NETWORK);
@@ -744,6 +745,9 @@ class B2S_Post_Item {
744
  $content .= '<li class="list-group-item"><label class="checkbox-inline checkbox-all-label"><input class="checkbox-all" data-blog-post-id="' . esc_attr($post_id) . '" name="selected-checkbox-all" value="" type="checkbox"> ' . esc_html__('select all', 'blog2social') . '</label></li>';
745
  foreach ($result as $var) {
746
  if($type == 'metrics') {
 
 
 
747
  if($var->insight == null || empty($var->insight) || $var->insightsActive == 0) {
748
  continue;
749
  }
@@ -751,6 +755,7 @@ class B2S_Post_Item {
751
  if($postInsights == false || !isset($postInsights['insights']) || empty($postInsights['insights'])) {
752
  continue;
753
  }
 
754
  }
755
 
756
  $specialPosting = (isset($var->sched_type) && isset($specialPostingData[$var->sched_type])) ? ' - <strong>' . esc_html($specialPostingData[$var->sched_type]) . '</strong>' : '';
736
  $sqlData = $wpdb->prepare("SELECT `{$wpdb->prefix}b2s_posts`.`id`,`{$wpdb->prefix}b2s_posts`.`blog_user_id`, `sched_date`,`publish_date`,`publish_link`,`sched_type`,`publish_error_code`,`sched_details_id`,`post_format`,`{$wpdb->prefix}b2s_posts_sched_details`.`sched_data`,`{$wpdb->prefix}b2s_posts_network_details`.`network_id`,`{$wpdb->prefix}b2s_posts_network_details`.`network_type`, `{$wpdb->prefix}b2s_posts_network_details`.`network_auth_id`, `{$wpdb->prefix}b2s_posts_network_details`.`network_display_name`, `{$wpdb->prefix}b2s_posts_insights`.`insight`, `{$wpdb->prefix}b2s_posts_insights`.`active` as insightsActive FROM `{$wpdb->prefix}b2s_posts` LEFT JOIN `{$wpdb->prefix}b2s_posts_network_details` ON `{$wpdb->prefix}b2s_posts`.`network_details_id` = `{$wpdb->prefix}b2s_posts_network_details`.`id` LEFT JOIN `{$wpdb->prefix}b2s_posts_sched_details` ON `{$wpdb->prefix}b2s_posts`.`sched_details_id` = `{$wpdb->prefix}b2s_posts_sched_details`.`id` LEFT JOIN `{$wpdb->prefix}b2s_posts_insights` ON `{$wpdb->prefix}b2s_posts`.`id` = `{$wpdb->prefix}b2s_posts_insights`.`b2s_posts_id` WHERE `{$wpdb->prefix}b2s_posts`.`hide` = 0 AND `{$wpdb->prefix}b2s_posts`.`post_for_approve`= 0 AND (`{$wpdb->prefix}b2s_posts`.`sched_date` = '0000-00-00 00:00:00' OR (`{$wpdb->prefix}b2s_posts`.`sched_type` = 3 AND `{$wpdb->prefix}b2s_posts`.`publish_date` != '0000-00-00 00:00:00')) $addWhere $addNotAdminPosts $addSharedByUser $addSharedOnNetwork $addSearchShowByDate AND `{$wpdb->prefix}b2s_posts`.`post_id` = %d ORDER BY `{$wpdb->prefix}b2s_posts`.`publish_date` DESC", $post_id);
737
  $result = $wpdb->get_results($sqlData);
738
  $specialPostingData = array(3 => esc_html__('Auto-Posting', 'blog2social'), 4 => esc_html__('Retweet', 'blog2social'), 5 => esc_html__('Re-Share', 'blog2social'));
739
+ $metricsDoneB2SPostsIds = array();
740
  if (!empty($result) && is_array($result)) {
741
  $networkType = unserialize(B2S_PLUGIN_NETWORK_TYPE);
742
  $networkName = unserialize(B2S_PLUGIN_NETWORK);
745
  $content .= '<li class="list-group-item"><label class="checkbox-inline checkbox-all-label"><input class="checkbox-all" data-blog-post-id="' . esc_attr($post_id) . '" name="selected-checkbox-all" value="" type="checkbox"> ' . esc_html__('select all', 'blog2social') . '</label></li>';
746
  foreach ($result as $var) {
747
  if($type == 'metrics') {
748
+ if(in_array($var->id, $metricsDoneB2SPostsIds)) {
749
+ continue;
750
+ }
751
  if($var->insight == null || empty($var->insight) || $var->insightsActive == 0) {
752
  continue;
753
  }
755
  if($postInsights == false || !isset($postInsights['insights']) || empty($postInsights['insights'])) {
756
  continue;
757
  }
758
+ $metricsDoneB2SPostsIds[] = $var->id;
759
  }
760
 
761
  $specialPosting = (isset($var->sched_type) && isset($specialPostingData[$var->sched_type])) ? ' - <strong>' . esc_html($specialPostingData[$var->sched_type]) . '</strong>' : '';
includes/B2S/Ship/Save.php CHANGED
@@ -128,11 +128,11 @@ class B2S_Ship_Save {
128
  $this->postData['post'] = serialize($this->postData['post']);
129
  $result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, $this->postData,90));
130
 
 
131
  foreach ($postData as $k => $v) {
132
  $found = false;
133
  $networkId = (isset($v['network_id']) && (int) $v['network_id'] > 0) ? (int) $v['network_id'] : 0;
134
  if (isset($result->data) && is_array($result->data)) {
135
- $insertInsights = false;
136
  foreach ($result->data as $key => $post) {
137
  if (isset($post->internal_post_id) && (int) $post->internal_post_id == (int) $v['internal_post_id']) {
138
  $data = array('publish_link' => $post->publishUrl, 'publish_error_code' => isset($post->error_code) ? $post->error_code : '');
@@ -157,7 +157,7 @@ class B2S_Ship_Save {
157
 
158
  $found = true;
159
  }
160
- if ($insertInsights == false && isset($post->external_post_id) && !empty($post->external_post_id) && isset($post->insights) && !empty($post->insights)) {
161
  $sql = "SELECT id FROM {$wpdb->prefix}b2s_posts_network_details WHERE network_auth_id = %d";
162
  $postsNetworkDetailsId = $wpdb->get_results($wpdb->prepare($sql, $post->network_auth_id), ARRAY_A);
163
  if(isset($postsNetworkDetailsId[0]['id']) && (int) $postsNetworkDetailsId[0]['id'] > 0) {
@@ -171,10 +171,10 @@ class B2S_Ship_Save {
171
  'active' => 1
172
  );
173
  $wpdb->insert($wpdb->prefix.'b2s_posts_insights', $insightData, array('%s', '%s', '%d', '%d', '%d', '%s', '%d'));
174
- $insertInsights = true;
175
  }
176
  }
177
  }
 
178
  }
179
  //DEFAULT ERROR
180
  if ($found == false) {
128
  $this->postData['post'] = serialize($this->postData['post']);
129
  $result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, $this->postData,90));
130
 
131
+ $insertInsights = true;
132
  foreach ($postData as $k => $v) {
133
  $found = false;
134
  $networkId = (isset($v['network_id']) && (int) $v['network_id'] > 0) ? (int) $v['network_id'] : 0;
135
  if (isset($result->data) && is_array($result->data)) {
 
136
  foreach ($result->data as $key => $post) {
137
  if (isset($post->internal_post_id) && (int) $post->internal_post_id == (int) $v['internal_post_id']) {
138
  $data = array('publish_link' => $post->publishUrl, 'publish_error_code' => isset($post->error_code) ? $post->error_code : '');
157
 
158
  $found = true;
159
  }
160
+ if ($insertInsights == true && isset($post->external_post_id) && !empty($post->external_post_id) && isset($post->insights) && !empty($post->insights)) {
161
  $sql = "SELECT id FROM {$wpdb->prefix}b2s_posts_network_details WHERE network_auth_id = %d";
162
  $postsNetworkDetailsId = $wpdb->get_results($wpdb->prepare($sql, $post->network_auth_id), ARRAY_A);
163
  if(isset($postsNetworkDetailsId[0]['id']) && (int) $postsNetworkDetailsId[0]['id'] > 0) {
171
  'active' => 1
172
  );
173
  $wpdb->insert($wpdb->prefix.'b2s_posts_insights', $insightData, array('%s', '%s', '%d', '%d', '%d', '%s', '%d'));
 
174
  }
175
  }
176
  }
177
+ $insertInsights = false;
178
  }
179
  //DEFAULT ERROR
180
  if ($found == false) {
includes/Loader.php CHANGED
@@ -1025,7 +1025,7 @@ class B2S_Loader {
1025
  $subPages[] = add_submenu_page('blog2social', esc_html__('Share Website & Blog Content', 'blog2social'), esc_html__('Site & Blog Content', 'blog2social'), 'blog2social_access', 'blog2social-post', array($this, 'b2sPost'));
1026
  $subPages[] = add_submenu_page('blog2social', esc_html__('Create Social Media Posts', 'blog2social'), esc_html__('Social Media Posts', 'blog2social'), 'blog2social_access', 'blog2social-curation', array($this, 'b2sContentCuration'));
1027
  $subPages[] = add_submenu_page('blog2social', esc_html__('Calendar', 'blog2social'), esc_html__('Calendar', 'blog2social'), 'blog2social_access', 'blog2social-calendar', array($this, 'b2sPostCalendar'));
1028
- if((B2S_PLUGIN_USER_VERSION >= 3 && (!defined("B2S_PLUGIN_TRAIL_END") || (defined("B2S_PLUGIN_TRAIL_END") && strtotime(B2S_PLUGIN_TRAIL_END) < time()))) || (defined('B2S_PLUGIN_PERMISSION_INSIGHTS') && B2S_PLUGIN_PERMISSION_INSIGHTS == 1)) {
1029
  $subPages[] = add_submenu_page('blog2social', '', esc_html__('Social Media Metrics', 'blog2social') . ' <span class="label label-success label-sm">' . esc_html__("BETA", "blog2social") . '</span>', 'blog2social_access', 'blog2social-metrics', array($this, 'b2sMetrics'));
1030
  }
1031
  $subPages[] = add_submenu_page('blog2social', esc_html__('Networks', 'blog2social'), esc_html__('Networks', 'blog2social'), 'blog2social_access', 'blog2social-network', array($this, 'b2sNetwork'));
@@ -1088,7 +1088,7 @@ class B2S_Loader {
1088
  'parent' => 'blog2social'
1089
  ));
1090
 
1091
- if((B2S_PLUGIN_USER_VERSION >= 3 && (!defined("B2S_PLUGIN_TRAIL_END") || (defined("B2S_PLUGIN_TRAIL_END") && strtotime(B2S_PLUGIN_TRAIL_END) < time()))) || (defined('B2S_PLUGIN_PERMISSION_INSIGHTS') && B2S_PLUGIN_PERMISSION_INSIGHTS == 1)) {
1092
  $wp_admin_bar->add_node(array(
1093
  'id' => 'blog2social-metrics',
1094
  'title' => esc_html__('Social Media Metrics', 'blog2social') . ' <span class="label label-success label-sm">' . esc_html__("BETA", "blog2social") . '</span>',
@@ -1946,20 +1946,28 @@ class B2S_Loader {
1946
  `b2s_posts_id` int(11) NOT NULL,
1947
  `network_post_id` varchar(50) NOT NULL,
1948
  `b2s_posts_network_details_id` int(11) NOT NULL,
1949
- `insight` json NOT NULL,
1950
  `last_update` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
1951
  `active` tinyint(4) NOT NULL DEFAULT 1,
1952
  PRIMARY KEY (`id`),
1953
  INDEX `blog_user_id` (`blog_user_id`), INDEX `b2s_posts_id` (`b2s_posts_id`)
1954
  ) DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci AUTO_INCREMENT=1;";
1955
  $wpdb->query($sqlCreateInsightsPosts);
1956
-
 
 
 
 
 
 
 
 
1957
 
1958
  $sqlCreateInsightsNetwork = "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}b2s_network_insights` (
1959
  `id` int(11) NOT NULL AUTO_INCREMENT,
1960
  `blog_user_id` int(11) NOT NULL,
1961
  `b2s_posts_network_details_id` int(11) NOT NULL,
1962
- `insight` json NOT NULL,
1963
  `create_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
1964
  PRIMARY KEY (`id`),
1965
  INDEX `b2s_posts_network_details_id` (`b2s_posts_network_details_id`)
@@ -1968,6 +1976,15 @@ class B2S_Loader {
1968
  if (!$wpdb->query($sqlCreateInsightsNetwork)) {
1969
  $mySqlPermission = false;
1970
  }
 
 
 
 
 
 
 
 
 
1971
 
1972
  /*
1973
  * SET SAFETY AUTO-INCREMENT
1025
  $subPages[] = add_submenu_page('blog2social', esc_html__('Share Website & Blog Content', 'blog2social'), esc_html__('Site & Blog Content', 'blog2social'), 'blog2social_access', 'blog2social-post', array($this, 'b2sPost'));
1026
  $subPages[] = add_submenu_page('blog2social', esc_html__('Create Social Media Posts', 'blog2social'), esc_html__('Social Media Posts', 'blog2social'), 'blog2social_access', 'blog2social-curation', array($this, 'b2sContentCuration'));
1027
  $subPages[] = add_submenu_page('blog2social', esc_html__('Calendar', 'blog2social'), esc_html__('Calendar', 'blog2social'), 'blog2social_access', 'blog2social-calendar', array($this, 'b2sPostCalendar'));
1028
+ if((defined("B2S_PLUGIN_USER_VERSION") && B2S_PLUGIN_USER_VERSION >= 3 && (!defined("B2S_PLUGIN_TRAIL_END") || (defined("B2S_PLUGIN_TRAIL_END") && strtotime(B2S_PLUGIN_TRAIL_END) < time()))) || (defined('B2S_PLUGIN_PERMISSION_INSIGHTS') && B2S_PLUGIN_PERMISSION_INSIGHTS == 1)) {
1029
  $subPages[] = add_submenu_page('blog2social', '', esc_html__('Social Media Metrics', 'blog2social') . ' <span class="label label-success label-sm">' . esc_html__("BETA", "blog2social") . '</span>', 'blog2social_access', 'blog2social-metrics', array($this, 'b2sMetrics'));
1030
  }
1031
  $subPages[] = add_submenu_page('blog2social', esc_html__('Networks', 'blog2social'), esc_html__('Networks', 'blog2social'), 'blog2social_access', 'blog2social-network', array($this, 'b2sNetwork'));
1088
  'parent' => 'blog2social'
1089
  ));
1090
 
1091
+ if((defined("B2S_PLUGIN_USER_VERSION") && B2S_PLUGIN_USER_VERSION >= 3 && (!defined("B2S_PLUGIN_TRAIL_END") || (defined("B2S_PLUGIN_TRAIL_END") && strtotime(B2S_PLUGIN_TRAIL_END) < time()))) || (defined('B2S_PLUGIN_PERMISSION_INSIGHTS') && B2S_PLUGIN_PERMISSION_INSIGHTS == 1)) {
1092
  $wp_admin_bar->add_node(array(
1093
  'id' => 'blog2social-metrics',
1094
  'title' => esc_html__('Social Media Metrics', 'blog2social') . ' <span class="label label-success label-sm">' . esc_html__("BETA", "blog2social") . '</span>',
1946
  `b2s_posts_id` int(11) NOT NULL,
1947
  `network_post_id` varchar(50) NOT NULL,
1948
  `b2s_posts_network_details_id` int(11) NOT NULL,
1949
+ `insight` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
1950
  `last_update` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
1951
  `active` tinyint(4) NOT NULL DEFAULT 1,
1952
  PRIMARY KEY (`id`),
1953
  INDEX `blog_user_id` (`blog_user_id`), INDEX `b2s_posts_id` (`b2s_posts_id`)
1954
  ) DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci AUTO_INCREMENT=1;";
1955
  $wpdb->query($sqlCreateInsightsPosts);
1956
+
1957
+ $b2sPostsInsightsCols = $wpdb->get_results('SHOW COLUMNS FROM ' . $wpdb->prefix . 'b2s_posts_insights');
1958
+ if (is_array($b2sPostsInsightsCols) && isset($b2sPostsInsightsCols[0])) {
1959
+ foreach ($b2sPostsInsightsCols as $key => $value) {
1960
+ if (isset($value->Field) && !empty($value->Field) && $value->Field == 'insight') {
1961
+ $wpdb->query("ALTER TABLE {$wpdb->prefix}b2s_posts_insights MODIFY insight longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;");
1962
+ }
1963
+ }
1964
+ }
1965
 
1966
  $sqlCreateInsightsNetwork = "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}b2s_network_insights` (
1967
  `id` int(11) NOT NULL AUTO_INCREMENT,
1968
  `blog_user_id` int(11) NOT NULL,
1969
  `b2s_posts_network_details_id` int(11) NOT NULL,
1970
+ `insight` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
1971
  `create_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
1972
  PRIMARY KEY (`id`),
1973
  INDEX `b2s_posts_network_details_id` (`b2s_posts_network_details_id`)
1976
  if (!$wpdb->query($sqlCreateInsightsNetwork)) {
1977
  $mySqlPermission = false;
1978
  }
1979
+
1980
+ $b2sNetworkInsightsCols = $wpdb->get_results('SHOW COLUMNS FROM ' . $wpdb->prefix . 'b2s_network_insights');
1981
+ if (is_array($b2sNetworkInsightsCols) && isset($b2sNetworkInsightsCols[0])) {
1982
+ foreach ($b2sNetworkInsightsCols as $key => $value) {
1983
+ if (isset($value->Field) && !empty($value->Field) && $value->Field == 'insight') {
1984
+ $wpdb->query("ALTER TABLE {$wpdb->prefix}b2s_network_insights MODIFY insight longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;");
1985
+ }
1986
+ }
1987
+ }
1988
 
1989
  /*
1990
  * SET SAFETY AUTO-INCREMENT
includes/Tools.php CHANGED
@@ -27,8 +27,9 @@ class B2S_Tools {
27
  define('B2S_PLUGIN_TRAIL_END', $tokenInfo['B2S_PLUGIN_TRAIL_END']);
28
  }
29
 
30
- $tokenInfo['B2S_PLUGIN_PERMISSION_INSIGHTS'] = $version->permission_insight;
31
-
 
32
  if (!defined("B2S_PLUGIN_PERMISSION_INSIGHTS")) {
33
  define('B2S_PLUGIN_PERMISSION_INSIGHTS', $tokenInfo['B2S_PLUGIN_PERMISSION_INSIGHTS']);
34
  }
27
  define('B2S_PLUGIN_TRAIL_END', $tokenInfo['B2S_PLUGIN_TRAIL_END']);
28
  }
29
 
30
+ }
31
+ if(isset($version->permission_insight)) {
32
+ $tokenInfo['B2S_PLUGIN_PERMISSION_INSIGHTS'] = (int) $version->permission_insight;
33
  if (!defined("B2S_PLUGIN_PERMISSION_INSIGHTS")) {
34
  define('B2S_PLUGIN_PERMISSION_INSIGHTS', $tokenInfo['B2S_PLUGIN_PERMISSION_INSIGHTS']);
35
  }
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.9
8
- Stable tag: 6.9.0
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -133,20 +133,20 @@ The Blog2Social Plugin is available in the following language versions
133
 
134
  **Contributors**
135
 
136
- * Thanks to [Almaz] (https://optimay.ru/ "Almaz") for translating this plugin into Russian
137
- * Thanks to [Olivier] (https://extraspeech.com/ "Olivier") for translating this plugin into French
138
- * Thanks to [Daniel] (https://bananklubben.se/ "Daniel Guldstrand") for translating this plugin into Swedish
139
- * Thanks to [Olga] (https://jascin.net "Olga Jascin"), [Francesco] (https://ceotech.it "Francesco Palmieri") and [Stefano] (https://stefanocassone.com "Stefano Cassone") for translating this plugin into Italian
140
- * Thanks to [Xavier] (https://www.xaviersanchez.es "Xavier Sánchez") for translating this plugin into Spanish
141
 
142
  **Reviews**
143
 
144
- * Discover feedback and reviews from enthusiastic Blog2Social users in [German] (https://www.blog2social.com/de/blog/testberichte/ "German")
145
- * Discover feedback and reviews from enthusiastic Blog2Social users in [English] (https://www.blog2social.com/en/blog/reviews/ "English")
146
- * Discover feedback and reviews from enthusiastic Blog2Social users in [Spanish] (https://www.blog2social.com/de/blog/revisiones/ "Spanish")
147
- * Discover feedback and reviews from enthusiastic Blog2Social users in [Italian] (https://www.blog2social.com/de/blog/referenze/ "Italian")
148
- * Discover feedback and reviews from enthusiastic Blog2Social users in [French] (https://www.blog2social.com/de/blog/revisions/ "French")
149
- * Discover feedback and reviews from enthusiastic Blog2Social users in [Russian] (https://www.blog2social.com/de/blog/отзывы/ "Russian")
150
 
151
  == Installation ==
152
  1. Go to the Admin Panel of your WordPress dashboard
@@ -234,6 +234,10 @@ 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.0 =
238
  Social Media Metrics and more
239
  = 6.8.7 =
@@ -308,6 +312,10 @@ Usability Optimization, Rebrandly integration, url parameter settings
308
  New Image Posts, Imgur, Animated Gifs and Emojis
309
 
310
  == Upgrade Notice ==
 
 
 
 
311
  = 6.9.0 =
312
  Social Media Metrics and more
313
  = 6.8.7 =
5
  Donate link: https://paypal.me/adenion
6
  Requires at least: 4.7.0
7
  Tested up to: 5.9
8
+ Stable tag: 6.9.2
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
133
 
134
  **Contributors**
135
 
136
+ * Thanks to [Almaz](https://optimay.ru/ "Almaz") for translating this plugin into Russian
137
+ * Thanks to [Olivier](https://extraspeech.com/ "Olivier") for translating this plugin into French
138
+ * Thanks to [Daniel](https://bananklubben.se/ "Daniel Guldstrand") for translating this plugin into Swedish
139
+ * Thanks to [Olga](https://jascin.net "Olga Jascin"), [Francesco](https://ceotech.it "Francesco Palmieri") and [Stefano](https://stefanocassone.com "Stefano Cassone") for translating this plugin into Italian
140
+ * Thanks to [Xavier](https://www.xaviersanchez.es "Xavier Sánchez") for translating this plugin into Spanish
141
 
142
  **Reviews**
143
 
144
+ * Discover feedback and reviews from enthusiastic Blog2Social users in [German](https://www.blog2social.com/de/blog/testberichte/ "German")
145
+ * Discover feedback and reviews from enthusiastic Blog2Social users in [English](https://www.blog2social.com/en/blog/reviews/ "English")
146
+ * Discover feedback and reviews from enthusiastic Blog2Social users in [Spanish](https://www.blog2social.com/de/blog/revisiones/ "Spanish")
147
+ * Discover feedback and reviews from enthusiastic Blog2Social users in [Italian](https://www.blog2social.com/de/blog/referenze/ "Italian")
148
+ * Discover feedback and reviews from enthusiastic Blog2Social users in [French](https://www.blog2social.com/de/blog/revisions/ "French")
149
+ * Discover feedback and reviews from enthusiastic Blog2Social users in [Russian](https://www.blog2social.com/de/blog/отзывы/ "Russian")
150
 
151
  == Installation ==
152
  1. Go to the Admin Panel of your WordPress dashboard
234
  7. Keep track of your shared posts and scheduling plan with the Social Media Calendar.
235
 
236
  == Changelog ==
237
+ = 6.9.2 =
238
+ Bugfixing Pinterest Connection
239
+ = 6.9.1 =
240
+ Bugfixing Installing
241
  = 6.9.0 =
242
  Social Media Metrics and more
243
  = 6.8.7 =
312
  New Image Posts, Imgur, Animated Gifs and Emojis
313
 
314
  == Upgrade Notice ==
315
+ = 6.9.2 =
316
+ Bugfixing Pinterest Connection
317
+ = 6.9.1 =
318
+ Bugfixing Installing
319
  = 6.9.0 =
320
  Social Media Metrics and more
321
  = 6.8.7 =
views/b2s/html/header.php CHANGED
@@ -35,7 +35,7 @@ if (!B2S_System::isblockedArea('B2S_USER_POLICY', B2S_PLUGIN_ADMIN)) {
35
  }
36
 
37
  $optionMetricsBanner = true;
38
- if((B2S_PLUGIN_USER_VERSION >= 3 && (!defined("B2S_PLUGIN_TRAIL_END") || (defined("B2S_PLUGIN_TRAIL_END") && strtotime(B2S_PLUGIN_TRAIL_END) < time()))) || (defined('B2S_PLUGIN_PERMISSION_INSIGHTS') && B2S_PLUGIN_PERMISSION_INSIGHTS == 1)) {
39
  $optionMetricsBanner = $options->_getOption('metrics_banner');
40
  if($optionMetricsBanner == false) {
41
  $optionMetricsBanner = false;
@@ -500,11 +500,12 @@ if (!B2S_System::isblockedArea('B2S_MENU_MODUL_RATING', B2S_PLUGIN_ADMIN)) {
500
  </div>
501
  </div>
502
 
503
- <input type="hidden" id="b2s-metrics-banner-show" value="<?php echo (($optionMetricsBanner == true) ? '1' : '0'); ?>">
504
  <div class="modal fade" id="b2s-metrics-banner-modal" tabindex="-1" role="dialog" aria-labelledby="b2s-metrics-banner-modal" aria-hidden="true" data-backdrop="false" style="display:none; z-index: 1070;">
505
  <div class="modal-dialog">
506
  <div class="modal-content">
507
  <div class="modal-body text-center" style="background-color: #f4f4f4;">
 
508
  <img src="<?php echo plugins_url('/assets/images/metrics/social-symbols.png', B2S_PLUGIN_FILE); ?>" style="width: 80px; float: right; margin-left: -65px;" alt="blog2social">
509
  <br>
510
  <h3><?php echo esc_html__('Social Media Metrics', 'blog2social') . ' <span class="label label-success label-sm">' . esc_html__("BETA", "blog2social") . '</span>' ?></h3>
35
  }
36
 
37
  $optionMetricsBanner = true;
38
+ if((defined("B2S_PLUGIN_USER_VERSION") && B2S_PLUGIN_USER_VERSION >= 3 && (!defined("B2S_PLUGIN_TRAIL_END") || (defined("B2S_PLUGIN_TRAIL_END") && strtotime(B2S_PLUGIN_TRAIL_END) < time()))) || (defined('B2S_PLUGIN_PERMISSION_INSIGHTS') && B2S_PLUGIN_PERMISSION_INSIGHTS == 1)) {
39
  $optionMetricsBanner = $options->_getOption('metrics_banner');
40
  if($optionMetricsBanner == false) {
41
  $optionMetricsBanner = false;
500
  </div>
501
  </div>
502
 
503
+ <input type="hidden" id="b2s-metrics-banner-show" value="<?php echo (($optionMetricsBanner) ? 1 : 0); ?>">
504
  <div class="modal fade" id="b2s-metrics-banner-modal" tabindex="-1" role="dialog" aria-labelledby="b2s-metrics-banner-modal" aria-hidden="true" data-backdrop="false" style="display:none; z-index: 1070;">
505
  <div class="modal-dialog">
506
  <div class="modal-content">
507
  <div class="modal-body text-center" style="background-color: #f4f4f4;">
508
+ <button type="button" class="close b2s-metrics-banner-close" data-dismiss="modal">&times;</button>
509
  <img src="<?php echo plugins_url('/assets/images/metrics/social-symbols.png', B2S_PLUGIN_FILE); ?>" style="width: 80px; float: right; margin-left: -65px;" alt="blog2social">
510
  <br>
511
  <h3><?php echo esc_html__('Social Media Metrics', 'blog2social') . ' <span class="label label-success label-sm">' . esc_html__("BETA", "blog2social") . '</span>' ?></h3>
views/b2s/html/sidebar.php CHANGED
@@ -130,7 +130,7 @@ $customizeArea = B2S_System::customizeArea();
130
  </ul>
131
  <hr>
132
  <ul>
133
- <?php if((B2S_PLUGIN_USER_VERSION >= 3 && (!defined("B2S_PLUGIN_TRAIL_END") || (defined("B2S_PLUGIN_TRAIL_END") && strtotime(B2S_PLUGIN_TRAIL_END) < time()))) || (defined('B2S_PLUGIN_PERMISSION_INSIGHTS') && B2S_PLUGIN_PERMISSION_INSIGHTS == 1)) { ?>
134
  <li class="b2s-list-margin-left-10">
135
  <i class="glyphicon glyphicon-signal glyphicon-success"></i> <a href="admin.php?page=blog2social-metrics" class="b2s-sidebar-menu-item"><?php esc_html_e("Social Media Metrics", "blog2social") ?> <span class="label label-success label-sm"><?php esc_html_e("BETA", "blog2social"); ?></span></a>
136
  </li>
130
  </ul>
131
  <hr>
132
  <ul>
133
+ <?php if((defined("B2S_PLUGIN_USER_VERSION") && B2S_PLUGIN_USER_VERSION >= 3 && (!defined("B2S_PLUGIN_TRAIL_END") || (defined("B2S_PLUGIN_TRAIL_END") && strtotime(B2S_PLUGIN_TRAIL_END) < time()))) || (defined('B2S_PLUGIN_PERMISSION_INSIGHTS') && B2S_PLUGIN_PERMISSION_INSIGHTS == 1)) { ?>
134
  <li class="b2s-list-margin-left-10">
135
  <i class="glyphicon glyphicon-signal glyphicon-success"></i> <a href="admin.php?page=blog2social-metrics" class="b2s-sidebar-menu-item"><?php esc_html_e("Social Media Metrics", "blog2social") ?> <span class="label label-success label-sm"><?php esc_html_e("BETA", "blog2social"); ?></span></a>
136
  </li>
views/b2s/metrics.php CHANGED
@@ -4,7 +4,6 @@ wp_nonce_field('b2s_security_nonce', 'b2s_security_nonce');
4
  require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Filter.php');
5
  require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
6
  require_once (B2S_PLUGIN_DIR . 'includes/B2S/Metrics/Item.php');
7
- $b2sShowByDate = isset($_GET['b2sShowByDate']) ? (preg_match("#^[0-9\-.\]]+$#", trim($_GET['b2sShowByDate'])) ? trim($_GET['b2sShowByDate']) : "") : ""; //YYYY-mm-dd
8
 
9
  $metrics = new B2S_Metrics_Item();
10
  $networkCount = $metrics->getNetworkCount();
@@ -15,7 +14,7 @@ $optionMetricsStarted = $options->_getOption('metrics_started');
15
  if($optionMetricsStarted !== false) {
16
  $optionMetricsStarted = true;
17
  }
18
- if(isset($_GET['metrics_banner']) && $_GET['metrics_banner'] == '1') {
19
  $options->_setOption('metrics_banner', true);
20
  }
21
  ?>
@@ -44,7 +43,6 @@ if(isset($_GET['metrics_banner']) && $_GET['metrics_banner'] == '1') {
44
  <!-- Filter Post Start-->
45
  <form class="b2sSortForm form-inline pull-left" action="#">
46
  <input id="b2sType" type="hidden" value="publish" name="b2sType">
47
- <input id="b2sShowByDate" type="hidden" value="<?php echo $b2sShowByDate; ?>" name="b2sShowByDate">
48
  <input id="b2sPagination" type="hidden" value="1" name="b2sPagination">
49
  <div class="col-md-10 b2s-calendar-filter form-inline del-padding-left del-padding-right">
50
  <div class="b2s-calendar-filter-network-list" style="display: block ruby;">
4
  require_once (B2S_PLUGIN_DIR . 'includes/B2S/Post/Filter.php');
5
  require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
6
  require_once (B2S_PLUGIN_DIR . 'includes/B2S/Metrics/Item.php');
 
7
 
8
  $metrics = new B2S_Metrics_Item();
9
  $networkCount = $metrics->getNetworkCount();
14
  if($optionMetricsStarted !== false) {
15
  $optionMetricsStarted = true;
16
  }
17
+ if(isset($_GET['metrics_banner']) && (int) $_GET['metrics_banner'] == 1) {
18
  $options->_setOption('metrics_banner', true);
19
  }
20
  ?>
43
  <!-- Filter Post Start-->
44
  <form class="b2sSortForm form-inline pull-left" action="#">
45
  <input id="b2sType" type="hidden" value="publish" name="b2sType">
 
46
  <input id="b2sPagination" type="hidden" value="1" name="b2sPagination">
47
  <div class="col-md-10 b2s-calendar-filter form-inline del-padding-left del-padding-right">
48
  <div class="b2s-calendar-filter-network-list" style="display: block ruby;">