Woocommerce Social Media Share Buttons - Version 1.2.1

Version Description

Fixed pinterest, added share title and support for YITH Quickview

=

Download this release

Release Info

Developer toastiestudio
Plugin Icon 128x128 Woocommerce Social Media Share Buttons
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2.0 to 1.2.1

README.txt CHANGED
@@ -105,7 +105,7 @@ https://help.instagram.com/158826297591430
105
  = 1.1.3 = Shortcode placement fix
106
  = 1.1.4 = Small CSS fix
107
  = 1.2.0 = Added open graph option to help sharing settings.
108
-
109
 
110
 
111
 
105
  = 1.1.3 = Shortcode placement fix
106
  = 1.1.4 = Small CSS fix
107
  = 1.2.0 = Added open graph option to help sharing settings.
108
+ = 1.2.1 = Fixed pinterest, added share title and support for YITH Quickview
109
 
110
 
111
 
img/Thumbs.db CHANGED
Binary file
img/yithqv_buttons/Thumbs.db ADDED
Binary file
img/yithqv_buttons/email.png ADDED
Binary file
img/yithqv_buttons/facebook.png ADDED
Binary file
img/yithqv_buttons/googleplus.png ADDED
Binary file
img/yithqv_buttons/linkedin.png ADDED
Binary file
img/yithqv_buttons/pinterest.png ADDED
Binary file
img/yithqv_buttons/stumbleupon.png ADDED
Binary file
img/yithqv_buttons/tumblr.png ADDED
Binary file
img/yithqv_buttons/twitter.png ADDED
Binary file
img/yithqv_buttons/vkontakte.png ADDED
Binary file
index.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce Social Media Share Buttons
4
  * Plugin URI: http://www.toastiestudio.com
5
  * Description: The Woocommerce Social Media Share Buttons plugin allows visitors to your woocommerce shop to easily share your products on popular social media platforms.
6
- * Version: 1.2.0
7
  * Author: Toastie Studio
8
  * Author URI: http://www.toastiestudio.com
9
  * Requires at least: 3.5
@@ -46,6 +46,7 @@ function toastie_wc_smsb_li_reg_like_settings() {
46
  register_setting('toastie_wc_share_like', 'toastie_smsb_vk');
47
  register_setting('toastie_wc_share_like', 'toastie_smsb_em');
48
  register_setting('toastie_wc_share_like', 'toastie_smsb_format');
 
49
  register_setting('toastie_wc_share_like', 'toastie_smsb_opengraph');
50
  }
51
  if (is_admin()) {
@@ -61,11 +62,15 @@ add_option('toastie_smsb_st', 'true');
61
  add_option('toastie_smsb_vk', 'true');
62
  add_option('toastie_smsb_em', 'true');
63
  add_option('toastie_smsb_format', 'button');
 
64
  add_option('toastie_smsb_opengraph', 'false');
65
 
66
  function toastie_wc_smsb_form_code() {
67
  global $post;
68
  $social_val = '<div class="woo-social-buttons">';
 
 
 
69
  if (get_option('toastie_smsb_format') == 'button') {
70
  if (get_option('toastie_smsb_fb') == 'true') {
71
  $social_val.='<span class="smsb_facebook nocount fb-share-button" data-href="' . get_permalink($post->ID) . '" data-layout="button"></span>';
@@ -167,6 +172,9 @@ function toastie_wc_smsb_form_code() {
167
  function toastie_wc_smsb_form_short_code() {
168
  global $post;
169
  $social_val = '<div class="woo-social-buttons">';
 
 
 
170
  if (get_option('toastie_smsb_format') == 'button') {
171
  if (get_option('toastie_smsb_fb') == 'true') {
172
  $social_val.='<span class="smsb_facebook nocount fb-share-button" data-href="' . get_permalink($post->ID) . '" data-layout="button"></span>';
@@ -265,9 +273,45 @@ function toastie_wc_smsb_form_short_code() {
265
  return $social_val;
266
  }
267
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
 
269
  add_shortcode('woocommerce_social_media_share_buttons', 'toastie_wc_smsb_form_short_code');
270
  add_action('woocommerce_single_product_summary', 'toastie_wc_smsb_form_code', 31);
 
271
  add_action('admin_menu', 'toastie_wc_smsb_social_menu');
272
  add_action('wp_footer', 'toastie_wc_smsb_social_footer');
273
  load_plugin_textdomain( 'woocommerce-social-media-share-buttons', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
@@ -284,6 +328,7 @@ function toastie_wc_smsb_social_footer() {
284
  .woo-social-buttons img {vertical-align: top;}
285
  .woo-social-buttons span.nocount, .woo-social-buttons span.hcount {float:left; margin:0 5px 5px 0; height:21px;}
286
  .woo-social-buttons span.vcount {float:left; margin:0 5px 5px 0; height:65px;}
 
287
  .woo-social-buttons iframe {margin: 0px !important; padding: 0px !important; vertical-align:baseline;}
288
  .woo-social-buttons .smsb_pinterest.vcount {position:relative; top:30px}
289
  .woo-social-buttons .smsb_tumblr iframe {height:20px !important; width:50px !important;}
@@ -332,6 +377,7 @@ function toastie_wc_smsb_social_init() {
332
  $smsb_vk = sanitize_text_field($_REQUEST['smsb_vk']);
333
  $smsb_em = sanitize_text_field($_REQUEST['smsb_em']);
334
  $smsb_format = sanitize_text_field($_REQUEST['smsb_format']);
 
335
  $smsb_opengraph = sanitize_text_field($_REQUEST['smsb_opengraph']);
336
  update_option('toastie_smsb_fb', $smsb_fb);
337
  update_option('toastie_smsb_tw', $smsb_tw);
@@ -343,6 +389,7 @@ function toastie_wc_smsb_social_init() {
343
  update_option('toastie_smsb_vk', $smsb_vk);
344
  update_option('toastie_smsb_em', $smsb_em);
345
  update_option('toastie_smsb_format', $smsb_format);
 
346
  update_option('toastie_smsb_opengraph', $smsb_opengraph);
347
  $submited = 1;
348
  }
@@ -387,6 +434,15 @@ function toastie_wc_smsb_social_init() {
387
  <label> <input type="checkbox" name="smsb_em" value="true" <?php echo (get_option('toastie_smsb_em') == 'true' ? 'checked' : ''); ?> ><span style="padding-left: 5px;font-weight: bold;"><?php _e('Email', 'woocommerce-social-media-share-buttons'); ?></span></label>
388
  </fieldset></td>
389
  </tr>
 
 
 
 
 
 
 
 
 
390
  <tr><th><h3 class="smsb_optionheader" ><?php _e('What format do you want the share buttons?', 'woocommerce-social-media-share-buttons'); ?></h3></th></tr>
391
  <tr valign="top">
392
  <td><fieldset>
@@ -401,8 +457,9 @@ function toastie_wc_smsb_social_init() {
401
  <?php _e('Note: Some buttons do not show the share count until the url has been shared atleast once. Email does not show the share count at all.', 'woocommerce-social-media-share-buttons'); ?>
402
  </td>
403
  </tr>
 
404
  <tr valign="top">
405
- <td><h3 class="smsb_optionheader" ><?php _e('Open Graph Settings', 'woocommerce-social-media-share-buttons'); ?></h3>
406
  <fieldset>
407
  <label><input type="checkbox" name="smsb_opengraph" value="true" <?php echo (get_option('toastie_smsb_opengraph') == 'true' ? 'checked' : ''); ?> ><span style="padding-left: 5px;font-weight: bold;"> <?php _e('Automatically add open graph meta data to site header. ', 'woocommerce-social-media-share-buttons'); ?></span></label>
408
  </fieldset>
3
  * Plugin Name: WooCommerce Social Media Share Buttons
4
  * Plugin URI: http://www.toastiestudio.com
5
  * Description: The Woocommerce Social Media Share Buttons plugin allows visitors to your woocommerce shop to easily share your products on popular social media platforms.
6
+ * Version: 1.2.1
7
  * Author: Toastie Studio
8
  * Author URI: http://www.toastiestudio.com
9
  * Requires at least: 3.5
46
  register_setting('toastie_wc_share_like', 'toastie_smsb_vk');
47
  register_setting('toastie_wc_share_like', 'toastie_smsb_em');
48
  register_setting('toastie_wc_share_like', 'toastie_smsb_format');
49
+ register_setting('toastie_wc_share_like', 'toastie_smsb_title');
50
  register_setting('toastie_wc_share_like', 'toastie_smsb_opengraph');
51
  }
52
  if (is_admin()) {
62
  add_option('toastie_smsb_vk', 'true');
63
  add_option('toastie_smsb_em', 'true');
64
  add_option('toastie_smsb_format', 'button');
65
+ add_option('toastie_smsb_title', '');
66
  add_option('toastie_smsb_opengraph', 'false');
67
 
68
  function toastie_wc_smsb_form_code() {
69
  global $post;
70
  $social_val = '<div class="woo-social-buttons">';
71
+ if (get_option('toastie_smsb_title') != '' ) {
72
+ $social_val.='<h3 class="wsmsb_title">'.get_option('toastie_smsb_title').'</h3>';
73
+ };
74
  if (get_option('toastie_smsb_format') == 'button') {
75
  if (get_option('toastie_smsb_fb') == 'true') {
76
  $social_val.='<span class="smsb_facebook nocount fb-share-button" data-href="' . get_permalink($post->ID) . '" data-layout="button"></span>';
172
  function toastie_wc_smsb_form_short_code() {
173
  global $post;
174
  $social_val = '<div class="woo-social-buttons">';
175
+ if (get_option('toastie_smsb_title') != '' ) {
176
+ $social_val.='<h3 class="wsmsb_title">'.get_option('toastie_smsb_title').'</h3>';
177
+ };
178
  if (get_option('toastie_smsb_format') == 'button') {
179
  if (get_option('toastie_smsb_fb') == 'true') {
180
  $social_val.='<span class="smsb_facebook nocount fb-share-button" data-href="' . get_permalink($post->ID) . '" data-layout="button"></span>';
273
  return $social_val;
274
  }
275
 
276
+ function toastie_wc_smsb_form_code_yithqv() {
277
+ global $post;
278
+ $social_val = '<div class="woo-social-buttons">';
279
+
280
+ if (get_option('toastie_smsb_fb') == 'true') {
281
+ $social_val.='<span class="smsb_facebook yithqv"><a href="http://www.facebook.com/sharer.php?u='.get_permalink($post->ID).'" target="_blank"><img src="'. plugins_url( 'img/yithqv_buttons/facebook.png', __FILE__ ) . '" alt="Facebook" /></a></span>';
282
+ }
283
+ if (get_option('toastie_smsb_tw') == 'true') {
284
+ $social_val.='<span class="smsb_twitter yithqv"><a href="http://twitter.com/share?text='.get_the_title($post->ID).'&url='.get_permalink($post->ID).'" target="_blank"><img src="'. plugins_url( 'img/yithqv_buttons/twitter.png', __FILE__ ) . '" alt="Twitter" /></a></span>';
285
+ }
286
+ if (get_option('toastie_smsb_gp') == 'true') {
287
+ $social_val.='<span class="smsb_googleplus yithqv"><a href="https://plus.google.com/share?url='.get_permalink($post->ID).'" target="_blank" ><img src="'. plugins_url( 'img/yithqv_buttons/googleplus.png', __FILE__ ) . '" alt="Google Plus" /></a></span>';
288
+ }
289
+ if (get_option('toastie_smsb_pi') == 'true') {
290
+ $social_val.='<span class="smsb_pinterest yithqv"><a href="javascript:void((function()%7Bvar%20e=document.createElement(\'script\');e.setAttribute(\'type\',\'text/javascript\');e.setAttribute(\'charset\',\'UTF-8\');e.setAttribute(\'src\',\'http://assets.pinterest.com/js/pinmarklet.js?r=\'+Math.random()*99999999);document.body.appendChild(e)%7D)());"><img src="'. plugins_url( 'img/yithqv_buttons/pinterest.png', __FILE__ ) . '" alt="Pinterest" /></a></span>';
291
+ }
292
+ if (get_option('toastie_smsb_tu') == 'true') {
293
+ $social_val.='<span class="smsb_tumblr yithqv"><a href="http://www.tumblr.com/share/link?url='.get_permalink($post->ID).'&amp;title='.get_the_title($post->ID).'" target="_blank"><img src="'. plugins_url( 'img/yithqv_buttons/tumblr.png', __FILE__ ) . '" alt="Tubmlr" /></a></span>';
294
+ }
295
+ if (get_option('toastie_smsb_li') == 'true') {
296
+ $social_val.='<span class="smsb_linkedin yithqv"><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url='.get_permalink($post->ID).'" target="_blank"><img src="'. plugins_url( 'img/yithqv_buttons/linkedin.png', __FILE__ ) . '" alt="Linkedin" /></a></span>';
297
+ }
298
+ if (get_option('toastie_smsb_st') == 'true') {
299
+ $social_val.='<span class="smsb_stumbleupon yithqv"><a href="http://www.stumbleupon.com/submit?url='.get_permalink($post->ID).'&amp;title='.get_the_title($post->ID).'" target="_blank"><img src="'. plugins_url( 'img/yithqv_buttons/stumbleupon.png', __FILE__ ) . '" alt="StumbleUpon" /></a></span>';
300
+ }
301
+ if (get_option('toastie_smsb_vk') == 'true') {
302
+ $social_val.='<span class="smsb_vkontakte yithqv"><a href="http://vkontakte.ru/share.php?url='.get_permalink($post->ID).'" target="_blank"><img src="'. plugins_url( 'img/yithqv_buttons/vkontakte.png', __FILE__ ) . '" alt="Vkontakte" /></a></span>';
303
+ }
304
+ if (get_option('toastie_smsb_em') == 'true') {
305
+ $social_val.='<span class="smsb_email yithqv"><a href="mailto:?subject='.get_the_title($post->ID).'&amp;body=I%20saw%20this%20and%20thought%20of%20you!%20 ' . get_permalink($post->ID) . '"><img src="'. plugins_url( 'img/yithqv_buttons/email.png', __FILE__ ) . '" alt="Email" /></a></span>';
306
+ }
307
+
308
+ $social_val.='<div style="clear:both"></div></div>';
309
+ echo $social_val;
310
+ }
311
 
312
  add_shortcode('woocommerce_social_media_share_buttons', 'toastie_wc_smsb_form_short_code');
313
  add_action('woocommerce_single_product_summary', 'toastie_wc_smsb_form_code', 31);
314
+ add_action( 'yith_wcqv_product_summary', 'toastie_wc_smsb_form_code_yithqv', 31 );
315
  add_action('admin_menu', 'toastie_wc_smsb_social_menu');
316
  add_action('wp_footer', 'toastie_wc_smsb_social_footer');
317
  load_plugin_textdomain( 'woocommerce-social-media-share-buttons', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
328
  .woo-social-buttons img {vertical-align: top;}
329
  .woo-social-buttons span.nocount, .woo-social-buttons span.hcount {float:left; margin:0 5px 5px 0; height:21px;}
330
  .woo-social-buttons span.vcount {float:left; margin:0 5px 5px 0; height:65px;}
331
+ .woo-social-buttons span.yithqv {float:left; margin:0 5px 5px 0; height:36px;}
332
  .woo-social-buttons iframe {margin: 0px !important; padding: 0px !important; vertical-align:baseline;}
333
  .woo-social-buttons .smsb_pinterest.vcount {position:relative; top:30px}
334
  .woo-social-buttons .smsb_tumblr iframe {height:20px !important; width:50px !important;}
377
  $smsb_vk = sanitize_text_field($_REQUEST['smsb_vk']);
378
  $smsb_em = sanitize_text_field($_REQUEST['smsb_em']);
379
  $smsb_format = sanitize_text_field($_REQUEST['smsb_format']);
380
+ $smsb_title = sanitize_text_field($_REQUEST['smsb_title']);
381
  $smsb_opengraph = sanitize_text_field($_REQUEST['smsb_opengraph']);
382
  update_option('toastie_smsb_fb', $smsb_fb);
383
  update_option('toastie_smsb_tw', $smsb_tw);
389
  update_option('toastie_smsb_vk', $smsb_vk);
390
  update_option('toastie_smsb_em', $smsb_em);
391
  update_option('toastie_smsb_format', $smsb_format);
392
+ update_option('toastie_smsb_title', $smsb_title);
393
  update_option('toastie_smsb_opengraph', $smsb_opengraph);
394
  $submited = 1;
395
  }
434
  <label> <input type="checkbox" name="smsb_em" value="true" <?php echo (get_option('toastie_smsb_em') == 'true' ? 'checked' : ''); ?> ><span style="padding-left: 5px;font-weight: bold;"><?php _e('Email', 'woocommerce-social-media-share-buttons'); ?></span></label>
435
  </fieldset></td>
436
  </tr>
437
+ <tr><th><h3 class="smsb_optionheader" ><?php _e('Share button title text', 'woocommerce-social-media-share-buttons'); ?></h3></th></tr>
438
+ <tr valign="top">
439
+ <td>
440
+ <fieldset>
441
+ <label><?php _e('Add a title above the share buttons (title is set to heading 3 style format, class "wsmsb_title").', 'woocommerce-social-media-share-buttons'); ?></label><br/>
442
+ <input type="text" name="smsb_title" value="<?php echo get_option('toastie_smsb_title'); ?>"/>
443
+ </fieldset>
444
+ </td>
445
+ </tr>
446
  <tr><th><h3 class="smsb_optionheader" ><?php _e('What format do you want the share buttons?', 'woocommerce-social-media-share-buttons'); ?></h3></th></tr>
447
  <tr valign="top">
448
  <td><fieldset>
457
  <?php _e('Note: Some buttons do not show the share count until the url has been shared atleast once. Email does not show the share count at all.', 'woocommerce-social-media-share-buttons'); ?>
458
  </td>
459
  </tr>
460
+ <tr><th><h3 class="smsb_optionheader" ><?php _e('Open Graph Settings', 'woocommerce-social-media-share-buttons'); ?></h3></th></tr>
461
  <tr valign="top">
462
+ <td>
463
  <fieldset>
464
  <label><input type="checkbox" name="smsb_opengraph" value="true" <?php echo (get_option('toastie_smsb_opengraph') == 'true' ? 'checked' : ''); ?> ><span style="padding-left: 5px;font-weight: bold;"> <?php _e('Automatically add open graph meta data to site header. ', 'woocommerce-social-media-share-buttons'); ?></span></label>
465
  </fieldset>