Social Sharing Toolkit - Version 2.0.6

Version Description

Please update to version 2.0.6 for several small bug fixes and enhancements.

Download this release

Release Info

Developer MarijnRongen
Plugin Icon wp plugin Social Sharing Toolkit
Version 2.0.6
Comparing to
See all releases

Code changes from version 2.0.5 to 2.0.6

Files changed (2) hide show
  1. readme.txt +9 -1
  2. social_sharing_toolkit.php +25 -19
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=P8ZVN
4
  Tags: Facebook, Like, LinkedIn, Share, Google, Plus, +1, Pinterest, Google+, Twitter, Tweet, Buffer, Follow, StumbleUpon, Stumble, Tumblr, Delicious, Digg, Reddit, Myspace, Hyves, YouTube, Flickr, 500px, Picasa, deaviantART, mail, RSS, feed, connect, recommend, social, sharing, widget, shortcode, page, post, button, counter, icon, bitly, Open Graph
5
  Requires at least: 3.0
6
  Tested up to: 3.3.1
7
- Stable tag: 2.0.5
8
  License: GPLv2 or later
9
 
10
  Easy sharing and connecting on social networks. Display on posts or use widgets or shortcode. Also Twitter name/hashtag to link converter.
@@ -158,6 +158,10 @@ Upload the Social Sharing Toolkit plugin to the `/wp-content/plugins/` folder on
158
 
159
  == Upgrade Notice ==
160
 
 
 
 
 
161
  = 2.0.5 =
162
 
163
  Please update to version 2.0.5 for improved script handling, added buttons, bug fixes and integration of Bit.ly url shortening and Open Graph tags. Custom post types are now supported.
@@ -199,6 +203,10 @@ Please update to version 1.0.1 to prevent an unexpected printing of the page tit
199
 
200
  == Changelog ==
201
 
 
 
 
 
202
  = 2.0.5 =
203
  * Improved JavaScript handling
204
  * Integrated Open Graph tag generator
4
  Tags: Facebook, Like, LinkedIn, Share, Google, Plus, +1, Pinterest, Google+, Twitter, Tweet, Buffer, Follow, StumbleUpon, Stumble, Tumblr, Delicious, Digg, Reddit, Myspace, Hyves, YouTube, Flickr, 500px, Picasa, deaviantART, mail, RSS, feed, connect, recommend, social, sharing, widget, shortcode, page, post, button, counter, icon, bitly, Open Graph
5
  Requires at least: 3.0
6
  Tested up to: 3.3.1
7
+ Stable tag: 2.0.6
8
  License: GPLv2 or later
9
 
10
  Easy sharing and connecting on social networks. Display on posts or use widgets or shortcode. Also Twitter name/hashtag to link converter.
158
 
159
  == Upgrade Notice ==
160
 
161
+ = 2.0.6 =
162
+
163
+ Please update to version 2.0.6 for several small bug fixes and enhancements.
164
+
165
  = 2.0.5 =
166
 
167
  Please update to version 2.0.5 for improved script handling, added buttons, bug fixes and integration of Bit.ly url shortening and Open Graph tags. Custom post types are now supported.
203
 
204
  == Changelog ==
205
 
206
+ = 2.0.6 =
207
+ * Fixed buttons not appearing on pages
208
+ * Fixed Pinterest issue
209
+
210
  = 2.0.5 =
211
  * Improved JavaScript handling
212
  * Integrated Open Graph tag generator
social_sharing_toolkit.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
  Plugin Name: Social Sharing Toolkit
4
- Plugin URI: http://www.active-bits.nl/support/social_sharing_toolkit/
5
  Description: This plugin enables sharing of your content via popular social networks and can also convert Twitter names and hashtags to links. Easy & configurable.
6
- Version: 2.0.5
7
  Author: Marijn Rongen
8
  Author URI: http://www.active-bits.nl
9
  */
@@ -333,7 +333,7 @@ class MR_Social_Sharing_Toolkit {
333
  <label for="mr_social_sharing_opengraph_fixed_image" class="check"><input type="checkbox" name="mr_social_sharing_opengraph[fixed_image]" id="mr_social_sharing_opengraph_fixed_image"';
334
  if ($this->options['mr_social_sharing_opengraph']['fixed_image'] == 1) { echo ' checked="checked"';}
335
  echo ' value="1" /> '.__("Always use the default image", 'mr_social_sharing_toolkit').'</label><br/>
336
- <p><span class="description">'.__("Check this box to always display the default image with you shared content", 'mr_social_sharing_toolkit').'</span></p>
337
  </div>
338
  </div>
339
  <p class="submit">
@@ -468,7 +468,7 @@ class MR_Social_Sharing_Toolkit {
468
  /* Output functions */
469
 
470
  function print_opengraph() {
471
- echo '<!-- Open Graph tags provided by Social Sharing Toolkit v2.0.5 -->
472
  <meta property="og:locale" content="'.str_replace('-', '_', get_bloginfo('language')).'"/>';
473
  if (is_single() || is_page()) {
474
  $excerpt = get_the_excerpt();
@@ -508,7 +508,8 @@ class MR_Social_Sharing_Toolkit {
508
  $media = '';
509
  }
510
  }
511
- } else {
 
512
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches);
513
  $img = $matches[1][0];
514
  if($img != '') {
@@ -654,9 +655,9 @@ class MR_Social_Sharing_Toolkit {
654
  if ($this->options['mr_social_sharing_enable_shortcode'] == 1 && $this->options['mr_social_sharing_shortcode_buttons']['xi_xing']['enable'] == 1 && in_array($this->options['mr_social_sharing_shortcode_buttons']['xi_xing']['type'], array('none','horizontal','vertical'))) {
655
  $xing_script = true;
656
  }
657
- /*if ($this->options['mr_social_sharing_follow_buttons']['xi_xing']['enable'] == 1 && in_array($this->options['mr_social_sharing_follow_buttons']['xi_xing']['type'], array('none','horizontal'))) {
658
  $xing_script = true;
659
- }*/
660
  if (is_active_sidebar(is_active_widget( false, false, 'mr-social-sharing-toolkit-follow-widget', true))) {
661
  if ($this->options['mr_social_sharing_follow_buttons']['follow_twitter']['enable'] == 1 && in_array($this->options['mr_social_sharing_follow_buttons']['follow_twitter']['type'], array('none','horizontal'))) {
662
  $tweet_script = true;
@@ -738,7 +739,7 @@ class MR_Social_Sharing_Toolkit {
738
  $url = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
739
  }
740
  $bookmarks = '
741
- <!-- Social Sharing Toolkit v2.0.5 | http://www.active-bits.nl/support/social_sharing_toolkit/ -->
742
  <div class="mr_social_sharing_wrapper">';
743
  foreach ($this->options['mr_social_sharing_'.$type.'button_order'] as $button) {
744
  if ($this->options['mr_social_sharing_'.$type.'buttons'][$button]['enable'] == 1) {
@@ -754,7 +755,7 @@ class MR_Social_Sharing_Toolkit {
754
 
755
  function create_followers() {
756
  $followers = '
757
- <!-- Social Sharing Toolkit v2.0.5 | http://www.active-bits.nl/support/social_sharing_toolkit/ -->
758
  <div class="mr_social_sharing_wrapper">';
759
  foreach ($this->options['mr_social_sharing_follow_button_order'] as $button) {
760
  if ($this->options['mr_social_sharing_follow_buttons'][$button]['enable'] == 1) {
@@ -1190,7 +1191,7 @@ class MR_Social_Sharing_Toolkit {
1190
 
1191
  function get_follow_pinterest($type, $id) {
1192
  $url = 'http://pinterest.com/'.$id.'/';
1193
- $title = __('Follow me on','mr_social_sharing_toolkit').' Pinterest';
1194
  $text = 'Pinterest';
1195
  $icon = 'pinterest';
1196
  return $this->get_icon($type, $url, $title, $text, $icon);
@@ -1379,7 +1380,8 @@ class MR_Social_Sharing_Toolkit {
1379
  $media = '';
1380
  }
1381
  }
1382
- } else {
 
1383
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches);
1384
  $img = $matches[1][0];
1385
  if($img != '') {
@@ -1387,16 +1389,16 @@ class MR_Social_Sharing_Toolkit {
1387
  }
1388
  }
1389
  $type = get_post_type();
1390
- if (in_array($type, $this->options['mr_social_sharing_types']) && is_single()) {
1391
  if ($this->options['mr_social_sharing_position'] == 'top') {
1392
  $bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), '', $media);
1393
  $content = $bookmarks.$content;
1394
  }
1395
- if ($this->options['mr_social_sharing_position'] == 'bottom' && is_single()) {
1396
  $bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), '', $media);
1397
  $content .= $bookmarks;
1398
  }
1399
- if ($this->options['mr_social_sharing_position'] == 'both' && is_single()) {
1400
  $bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), '', $media);
1401
  $content = $bookmarks.$content.$bookmarks;
1402
  }
@@ -1414,7 +1416,8 @@ class MR_Social_Sharing_Toolkit {
1414
  $media = '';
1415
  }
1416
  }
1417
- } else {
 
1418
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches);
1419
  $img = $matches[1][0];
1420
  if($img != '') {
@@ -1441,7 +1444,8 @@ class MR_Social_Sharing_Toolkit {
1441
  $media = '';
1442
  }
1443
  }
1444
- } else {
 
1445
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches);
1446
  $img = $matches[1][0];
1447
  if($img != '') {
@@ -1483,7 +1487,8 @@ class MR_Social_Sharing_Toolkit {
1483
  $media = '';
1484
  }
1485
  }
1486
- } else {
 
1487
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', the_content(), $matches);
1488
  $img = $matches[1][0];
1489
  if($img != '') {
@@ -1552,8 +1557,9 @@ class MR_Social_Sharing_Toolkit_Widget extends WP_Widget {
1552
  $media = '';
1553
  }
1554
  }
1555
- } else {
1556
- $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches);
 
1557
  $img = $matches[1][0];
1558
  if($img != '') {
1559
  $media = $img;
1
  <?php
2
  /*
3
  Plugin Name: Social Sharing Toolkit
4
+ Plugin URI: http://www.active-bits.nl/support/social-sharing-toolkit/
5
  Description: This plugin enables sharing of your content via popular social networks and can also convert Twitter names and hashtags to links. Easy & configurable.
6
+ Version: 2.0.6
7
  Author: Marijn Rongen
8
  Author URI: http://www.active-bits.nl
9
  */
333
  <label for="mr_social_sharing_opengraph_fixed_image" class="check"><input type="checkbox" name="mr_social_sharing_opengraph[fixed_image]" id="mr_social_sharing_opengraph_fixed_image"';
334
  if ($this->options['mr_social_sharing_opengraph']['fixed_image'] == 1) { echo ' checked="checked"';}
335
  echo ' value="1" /> '.__("Always use the default image", 'mr_social_sharing_toolkit').'</label><br/>
336
+ <p><span class="description">'.__("Check this box to always display the default image woth you shared content", 'mr_social_sharing_toolkit').'</span></p>
337
  </div>
338
  </div>
339
  <p class="submit">
468
  /* Output functions */
469
 
470
  function print_opengraph() {
471
+ echo '<!-- Open Graph tags provided by Social Sharing Toolkit v2.0.6 -->
472
  <meta property="og:locale" content="'.str_replace('-', '_', get_bloginfo('language')).'"/>';
473
  if (is_single() || is_page()) {
474
  $excerpt = get_the_excerpt();
508
  $media = '';
509
  }
510
  }
511
+ }
512
+ if ($media == '') {
513
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches);
514
  $img = $matches[1][0];
515
  if($img != '') {
655
  if ($this->options['mr_social_sharing_enable_shortcode'] == 1 && $this->options['mr_social_sharing_shortcode_buttons']['xi_xing']['enable'] == 1 && in_array($this->options['mr_social_sharing_shortcode_buttons']['xi_xing']['type'], array('none','horizontal','vertical'))) {
656
  $xing_script = true;
657
  }
658
+ if ($this->options['mr_social_sharing_follow_buttons']['xi_xing']['enable'] == 1 && in_array($this->options['mr_social_sharing_follow_buttons']['xi_xing']['type'], array('none','horizontal'))) {
659
  $xing_script = true;
660
+ }
661
  if (is_active_sidebar(is_active_widget( false, false, 'mr-social-sharing-toolkit-follow-widget', true))) {
662
  if ($this->options['mr_social_sharing_follow_buttons']['follow_twitter']['enable'] == 1 && in_array($this->options['mr_social_sharing_follow_buttons']['follow_twitter']['type'], array('none','horizontal'))) {
663
  $tweet_script = true;
739
  $url = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
740
  }
741
  $bookmarks = '
742
+ <!-- Social Sharing Toolkit v2.0.6 | http://www.active-bits.nl/support/social-sharing-toolkit/ -->
743
  <div class="mr_social_sharing_wrapper">';
744
  foreach ($this->options['mr_social_sharing_'.$type.'button_order'] as $button) {
745
  if ($this->options['mr_social_sharing_'.$type.'buttons'][$button]['enable'] == 1) {
755
 
756
  function create_followers() {
757
  $followers = '
758
+ <!-- Social Sharing Toolkit v2.0.6 | http://www.active-bits.nl/support/social-sharing-toolkit/ -->
759
  <div class="mr_social_sharing_wrapper">';
760
  foreach ($this->options['mr_social_sharing_follow_button_order'] as $button) {
761
  if ($this->options['mr_social_sharing_follow_buttons'][$button]['enable'] == 1) {
1191
 
1192
  function get_follow_pinterest($type, $id) {
1193
  $url = 'http://pinterest.com/'.$id.'/';
1194
+ $title = __('Follow Me on Pinterest','mr_social_sharing_toolkit');
1195
  $text = 'Pinterest';
1196
  $icon = 'pinterest';
1197
  return $this->get_icon($type, $url, $title, $text, $icon);
1380
  $media = '';
1381
  }
1382
  }
1383
+ }
1384
+ if ($media == '') {
1385
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches);
1386
  $img = $matches[1][0];
1387
  if($img != '') {
1389
  }
1390
  }
1391
  $type = get_post_type();
1392
+ if (in_array($type, $this->options['mr_social_sharing_types']) && (is_single() || $type == 'page')) {
1393
  if ($this->options['mr_social_sharing_position'] == 'top') {
1394
  $bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), '', $media);
1395
  $content = $bookmarks.$content;
1396
  }
1397
+ if ($this->options['mr_social_sharing_position'] == 'bottom' && (is_single() || $type == 'page')) {
1398
  $bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), '', $media);
1399
  $content .= $bookmarks;
1400
  }
1401
+ if ($this->options['mr_social_sharing_position'] == 'both' && (is_single() || $type == 'page')) {
1402
  $bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), '', $media);
1403
  $content = $bookmarks.$content.$bookmarks;
1404
  }
1416
  $media = '';
1417
  }
1418
  }
1419
+ }
1420
+ if ($media == '') {
1421
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches);
1422
  $img = $matches[1][0];
1423
  if($img != '') {
1444
  $media = '';
1445
  }
1446
  }
1447
+ }
1448
+ if ($media == '') {
1449
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches);
1450
  $img = $matches[1][0];
1451
  if($img != '') {
1487
  $media = '';
1488
  }
1489
  }
1490
+ }
1491
+ if ($media == '') {
1492
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', the_content(), $matches);
1493
  $img = $matches[1][0];
1494
  if($img != '') {
1557
  $media = '';
1558
  }
1559
  }
1560
+ }
1561
+ if ($media == '') {
1562
+ $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches);
1563
  $img = $matches[1][0];
1564
  if($img != '') {
1565
  $media = $img;