Version Description
- Relaunched with a whole set of NEW FEATURES and Improvement. Please upgrade immediately and provide your feedback. highly recommended. Aplogies in advance, if anything breaks!
=
Download this release
Release Info
| Developer | hiddenpearls |
| Plugin | |
| Version | 2.0.4 |
| Comparing to | |
| See all releases | |
Code changes from version 2.0.3 to 2.0.4
- assets/css/front.css +17 -0
- assets/images/fblike.png +0 -0
- classes/ssb-admin.php +5 -2
- classes/ssb-settings-strucutre.php +1 -1
- inc/utils.php +1 -1
- readme.txt +6 -2
- simple-social-buttons.php +42 -9
assets/css/front.css
CHANGED
|
@@ -1322,6 +1322,18 @@ div[class*="simplesocialbuttons-float"].simplesocialbuttons-fade-in{
|
|
| 1322 |
-webkit-animation-fill-mode: forwards; /* Safari 4.0 - 8.0 */
|
| 1323 |
animation-fill-mode: forwards;
|
| 1324 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1325 |
@-webkit-keyframes ssb_fade {
|
| 1326 |
from {opacity: 0;}
|
| 1327 |
to {opacity: 1;}
|
|
@@ -1602,3 +1614,8 @@ div[class*="simplesocialbuttons-float-left-post"] button .ssb_counter{
|
|
| 1602 |
div[class*="simplesocialbuttons-float"].simplesocial-simple-round button[class*="-share"]:not(:hover):before{
|
| 1603 |
width: 0;
|
| 1604 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1322 |
-webkit-animation-fill-mode: forwards; /* Safari 4.0 - 8.0 */
|
| 1323 |
animation-fill-mode: forwards;
|
| 1324 |
}
|
| 1325 |
+
.ssb-fb-like{
|
| 1326 |
+
height: 38px;
|
| 1327 |
+
line-height: 38px;
|
| 1328 |
+
margin: 0 5px;
|
| 1329 |
+
vertical-align: middle;
|
| 1330 |
+
}
|
| 1331 |
+
.ssb-fb-like span{
|
| 1332 |
+
vertical-align: middle !important;
|
| 1333 |
+
}
|
| 1334 |
+
div[class*="simplesocialbuttons-float"].simplesocialbuttons .ssb-fb-like{
|
| 1335 |
+
margin: 10px 0;
|
| 1336 |
+
}
|
| 1337 |
@-webkit-keyframes ssb_fade {
|
| 1338 |
from {opacity: 0;}
|
| 1339 |
to {opacity: 1;}
|
| 1614 |
div[class*="simplesocialbuttons-float"].simplesocial-simple-round button[class*="-share"]:not(:hover):before{
|
| 1615 |
width: 0;
|
| 1616 |
}
|
| 1617 |
+
@media screen and (max-width: 767px) {
|
| 1618 |
+
.simplesocialbuttons-mobile-hidden{
|
| 1619 |
+
display: none !important;
|
| 1620 |
+
}
|
| 1621 |
+
}
|
assets/images/fblike.png
ADDED
|
Binary file
|
classes/ssb-admin.php
CHANGED
|
@@ -60,7 +60,7 @@ if ( ! class_exists( 'SimpleSocialButtonsPR_Admin' ) ) :
|
|
| 60 |
* Register meta box to hide/show SSB plugin on single post or page
|
| 61 |
*/
|
| 62 |
public function ssb_meta_box() {
|
| 63 |
-
$postId = $_GET['post'];
|
| 64 |
$postType = get_post_type( $postId );
|
| 65 |
|
| 66 |
if ( $postType != 'page' && $postType != 'post' ) {
|
|
@@ -108,12 +108,15 @@ if ( ! class_exists( 'SimpleSocialButtonsPR_Admin' ) ) :
|
|
| 108 |
*/
|
| 109 |
public function ssb_save_meta( $post_id, $post ) {
|
| 110 |
$postId = (int) $post_id;
|
| 111 |
-
|
| 112 |
// Verify if this is an auto save routine.
|
| 113 |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
| 114 |
return;
|
| 115 |
}
|
| 116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
// Verify this came from the our screen and with proper authorization
|
| 118 |
if ( ! wp_verify_nonce( $_POST['ssb_noncename'], plugin_basename( __FILE__ ) ) ) {
|
| 119 |
return;
|
| 60 |
* Register meta box to hide/show SSB plugin on single post or page
|
| 61 |
*/
|
| 62 |
public function ssb_meta_box() {
|
| 63 |
+
$postId = isset( $_GET['post'] ) ? $_GET['post'] : false;
|
| 64 |
$postType = get_post_type( $postId );
|
| 65 |
|
| 66 |
if ( $postType != 'page' && $postType != 'post' ) {
|
| 108 |
*/
|
| 109 |
public function ssb_save_meta( $post_id, $post ) {
|
| 110 |
$postId = (int) $post_id;
|
|
|
|
| 111 |
// Verify if this is an auto save routine.
|
| 112 |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
| 113 |
return;
|
| 114 |
}
|
| 115 |
|
| 116 |
+
if ( ! isset( $_POST['ssb_noncename'] ) ) {
|
| 117 |
+
return;
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
// Verify this came from the our screen and with proper authorization
|
| 121 |
if ( ! wp_verify_nonce( $_POST['ssb_noncename'], plugin_basename( __FILE__ ) ) ) {
|
| 122 |
return;
|
classes/ssb-settings-strucutre.php
CHANGED
|
@@ -358,7 +358,7 @@ if ( ! class_exists( 'Ssb_Settings_Structure' ) ) :
|
|
| 358 |
<ul id="ssb_active_icons" class="items" style="min-height:35px">
|
| 359 |
<?php
|
| 360 |
$ssb_icons_order = array();
|
| 361 |
-
$arrKnownButtons = array( 'googleplus', 'twitter', 'pinterest', 'fbshare', 'linkedin', 'reddit', 'whatsapp', 'viber');
|
| 362 |
foreach ($arrKnownButtons as $button_name) {
|
| 363 |
$ssb_icons_order[$button_name] = isset( $settings[$button_name] ) ? $settings[$button_name] : '' ;
|
| 364 |
}
|
| 358 |
<ul id="ssb_active_icons" class="items" style="min-height:35px">
|
| 359 |
<?php
|
| 360 |
$ssb_icons_order = array();
|
| 361 |
+
$arrKnownButtons = array( 'googleplus', 'twitter', 'pinterest', 'fbshare', 'linkedin', 'reddit', 'whatsapp', 'viber', 'fblike' );
|
| 362 |
foreach ($arrKnownButtons as $button_name) {
|
| 363 |
$ssb_icons_order[$button_name] = isset( $settings[$button_name] ) ? $settings[$button_name] : '' ;
|
| 364 |
}
|
inc/utils.php
CHANGED
|
@@ -146,7 +146,7 @@ function ssb_fetch_shares_via_curl_multi( $data, $options = array() ) {
|
|
| 146 |
$total = 0;
|
| 147 |
|
| 148 |
foreach ( $stats as $social_name => $counts ) {
|
| 149 |
-
if ( 'totalshare' == $social_name || 'fblike' == $social_name || 'viber' == $social_name ) { continue; }
|
| 150 |
$stats_counts = call_user_func( 'ssb_format_' . $social_name . '_response', $counts );
|
| 151 |
$stats_result[ $social_name ] = $stats_counts;
|
| 152 |
update_post_meta( $post_id, 'ssb_' . $social_name . '_counts', $stats_counts );
|
| 146 |
$total = 0;
|
| 147 |
|
| 148 |
foreach ( $stats as $social_name => $counts ) {
|
| 149 |
+
if ( 'totalshare' == $social_name || 'fblike' == $social_name || 'viber' == $social_name || 'whatsapp' == $social_name ) { continue; }
|
| 150 |
$stats_counts = call_user_func( 'ssb_format_' . $social_name . '_response', $counts );
|
| 151 |
$stats_result[ $social_name ] = $stats_counts;
|
| 152 |
update_post_meta( $post_id, 'ssb_' . $social_name . '_counts', $stats_counts );
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Donate link: https://wpbrigade.com/
|
|
| 4 |
Tags: Social share, Social buttons, Whatsapp, Viber, LinkedIn, facebook, google, twitter, pinterest, plus one
|
| 5 |
Requires at least: 4.0
|
| 6 |
Tested up to: 4.9
|
| 7 |
-
Stable tag: 2.0.
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
|
@@ -134,12 +134,16 @@ Yes, you can use `<?php get_ssb(); ?>` in your template file (see installation s
|
|
| 134 |
|
| 135 |
== Upgrade Notice ==
|
| 136 |
|
| 137 |
-
= 2.0.
|
| 138 |
* Relaunched with a whole set of NEW FEATURES and Improvement. Please upgrade immediately and provide your feedback. highly recommended. Aplogies in advance, if anything breaks!
|
| 139 |
|
| 140 |
|
| 141 |
== Changelog ==
|
| 142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
= 2.0.3 - 2017-11-13 =
|
| 144 |
* Bug Fix: Social media Counter
|
| 145 |
* Enhancement: Compatible with 4.9
|
| 4 |
Tags: Social share, Social buttons, Whatsapp, Viber, LinkedIn, facebook, google, twitter, pinterest, plus one
|
| 5 |
Requires at least: 4.0
|
| 6 |
Tested up to: 4.9
|
| 7 |
+
Stable tag: 2.0.4
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
| 134 |
|
| 135 |
== Upgrade Notice ==
|
| 136 |
|
| 137 |
+
= 2.0.4 =
|
| 138 |
* Relaunched with a whole set of NEW FEATURES and Improvement. Please upgrade immediately and provide your feedback. highly recommended. Aplogies in advance, if anything breaks!
|
| 139 |
|
| 140 |
|
| 141 |
== Changelog ==
|
| 142 |
|
| 143 |
+
= 2.0.4 - 2017-11-17 =
|
| 144 |
+
* Bug Fix: Undefined index error when creating new post or page.
|
| 145 |
+
* Enhancement: Facebook likes button is back.
|
| 146 |
+
|
| 147 |
= 2.0.3 - 2017-11-13 =
|
| 148 |
* Bug Fix: Social media Counter
|
| 149 |
* Enhancement: Compatible with 4.9
|
simple-social-buttons.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
* Plugin Name: Simple Social Buttons
|
| 4 |
* Plugin URI: http://www.WPBrigade.com/wordpress/plugins/simple-social-buttons/
|
| 5 |
* Description: Simple Social Buttons adds an advanced set of social media sharing buttons to your WordPress sites, such as: Google +1, Facebook, WhatsApp, Viber, Twitter, Reddit, LinkedIn and Pinterest. This makes it the most <code>Flexible Social Sharing Plugin ever for Everyone.</code>
|
| 6 |
-
* Version: 2.0.
|
| 7 |
* Author: WPBrigade
|
| 8 |
* Author URI: http://www.WPBrigade.com/
|
| 9 |
* Text Domain: simple-social-buttons
|
|
@@ -30,7 +30,7 @@
|
|
| 30 |
|
| 31 |
class SimpleSocialButtonsPR {
|
| 32 |
public $pluginName = 'Simple Social Buttons';
|
| 33 |
-
public $pluginVersion = '2.0.
|
| 34 |
public $pluginPrefix = 'ssb_pr_';
|
| 35 |
public $hideCustomMetaKey = '_ssb_hide';
|
| 36 |
|
|
@@ -46,12 +46,13 @@ class SimpleSocialButtonsPR {
|
|
| 46 |
'beforearchive' => '0',
|
| 47 |
'afterarchive' => '0',
|
| 48 |
'fbshare' => '0',
|
|
|
|
| 49 |
'linkedin' => '0',
|
| 50 |
'cache' => 'on',
|
| 51 |
);
|
| 52 |
|
| 53 |
// defined buttons
|
| 54 |
-
public $arrKnownButtons = array( 'googleplus', 'twitter', 'pinterest', 'fbshare', 'linkedin', 'reddit', 'whatsapp', 'viber' );
|
| 55 |
|
| 56 |
// an array to store current settings, to avoid passing them between functions
|
| 57 |
public $settings = array();
|
|
@@ -108,7 +109,7 @@ class SimpleSocialButtonsPR {
|
|
| 108 |
|
| 109 |
add_action( 'admin_notices', array( $this, 'update_notice' ) );
|
| 110 |
add_action( 'admin_init', array( $this, 'review_update_notice' ) );
|
| 111 |
-
|
| 112 |
}
|
| 113 |
|
| 114 |
function set_selected_networks() {
|
|
@@ -154,7 +155,7 @@ class SimpleSocialButtonsPR {
|
|
| 154 |
|
| 155 |
$_share_links = array();
|
| 156 |
foreach ( $order as $social_name => $priority ) {
|
| 157 |
-
if ( 'totalshare' == $social_name || 'viber' == $social_name ) {
|
| 158 |
continue; }
|
| 159 |
$_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', get_permalink( $post_id ) );
|
| 160 |
}
|
|
@@ -458,7 +459,8 @@ class SimpleSocialButtonsPR {
|
|
| 458 |
$extra_class .= ' simplesocialbuttons-mobile-hidden'; }
|
| 459 |
$extra_class .= ' simplesocialbuttons-inline-' . $this->_get_settings( 'inline', 'animation', 'no-animation' );
|
| 460 |
|
| 461 |
-
$
|
|
|
|
| 462 |
|
| 463 |
if ( in_array( $this->get_post_type(), $this->inline_option['posts'] ) ) {
|
| 464 |
if ( $this->inline_option['location'] == 'above' || $this->inline_option['location'] == 'above_below' ) {
|
|
@@ -510,7 +512,7 @@ class SimpleSocialButtonsPR {
|
|
| 510 |
|
| 511 |
$_share_links = array();
|
| 512 |
foreach ( $arrButtons as $social_name => $priority ) {
|
| 513 |
-
if ( 'totalshare' == $social_name || 'viber' == $social_name ) {
|
| 514 |
continue; }
|
| 515 |
$_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', get_permalink() );
|
| 516 |
}
|
|
@@ -622,6 +624,14 @@ class SimpleSocialButtonsPR {
|
|
| 622 |
case 'viber':
|
| 623 |
$arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_self\' );return false;" class="simplesocial-viber-share" data-href="viber://forward?text=' . $permalink . '"><span class="simplesocialtxt">Share on Viber</span></button>';
|
| 624 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 625 |
}
|
| 626 |
}
|
| 627 |
|
|
@@ -684,8 +694,9 @@ class SimpleSocialButtonsPR {
|
|
| 684 |
if ( $this->sidebar_option['hide_mobile'] ) {
|
| 685 |
$class .= ' simplesocialbuttons-mobile-hidden'; }
|
| 686 |
$class .= ' simplesocialbuttons-slide-' . $this->_get_settings( 'sidebar', 'animation', 'no-animation' );
|
| 687 |
-
|
| 688 |
-
|
|
|
|
| 689 |
}
|
| 690 |
}
|
| 691 |
|
|
@@ -754,6 +765,28 @@ class SimpleSocialButtonsPR {
|
|
| 754 |
<?php
|
| 755 |
}
|
| 756 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 757 |
} // end class
|
| 758 |
|
| 759 |
|
| 3 |
* Plugin Name: Simple Social Buttons
|
| 4 |
* Plugin URI: http://www.WPBrigade.com/wordpress/plugins/simple-social-buttons/
|
| 5 |
* Description: Simple Social Buttons adds an advanced set of social media sharing buttons to your WordPress sites, such as: Google +1, Facebook, WhatsApp, Viber, Twitter, Reddit, LinkedIn and Pinterest. This makes it the most <code>Flexible Social Sharing Plugin ever for Everyone.</code>
|
| 6 |
+
* Version: 2.0.4
|
| 7 |
* Author: WPBrigade
|
| 8 |
* Author URI: http://www.WPBrigade.com/
|
| 9 |
* Text Domain: simple-social-buttons
|
| 30 |
|
| 31 |
class SimpleSocialButtonsPR {
|
| 32 |
public $pluginName = 'Simple Social Buttons';
|
| 33 |
+
public $pluginVersion = '2.0.4';
|
| 34 |
public $pluginPrefix = 'ssb_pr_';
|
| 35 |
public $hideCustomMetaKey = '_ssb_hide';
|
| 36 |
|
| 46 |
'beforearchive' => '0',
|
| 47 |
'afterarchive' => '0',
|
| 48 |
'fbshare' => '0',
|
| 49 |
+
'fblike' => '0',
|
| 50 |
'linkedin' => '0',
|
| 51 |
'cache' => 'on',
|
| 52 |
);
|
| 53 |
|
| 54 |
// defined buttons
|
| 55 |
+
public $arrKnownButtons = array( 'googleplus', 'twitter', 'pinterest', 'fbshare', 'linkedin', 'reddit', 'whatsapp', 'viber', 'fblike' );
|
| 56 |
|
| 57 |
// an array to store current settings, to avoid passing them between functions
|
| 58 |
public $settings = array();
|
| 109 |
|
| 110 |
add_action( 'admin_notices', array( $this, 'update_notice' ) );
|
| 111 |
add_action( 'admin_init', array( $this, 'review_update_notice' ) );
|
| 112 |
+
add_action( 'wp_footer', array( $this, 'fblike_script' ) );
|
| 113 |
}
|
| 114 |
|
| 115 |
function set_selected_networks() {
|
| 155 |
|
| 156 |
$_share_links = array();
|
| 157 |
foreach ( $order as $social_name => $priority ) {
|
| 158 |
+
if ( 'totalshare' == $social_name || 'viber' == $social_name || 'fblike' == $social_name || 'whatsapp' == $social_name ) {
|
| 159 |
continue; }
|
| 160 |
$_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', get_permalink( $post_id ) );
|
| 161 |
}
|
| 459 |
$extra_class .= ' simplesocialbuttons-mobile-hidden'; }
|
| 460 |
$extra_class .= ' simplesocialbuttons-inline-' . $this->_get_settings( 'inline', 'animation', 'no-animation' );
|
| 461 |
|
| 462 |
+
$_selected_network = apply_filters( 'ssb_inline_social_networks', $this->selected_networks );
|
| 463 |
+
$ssb_buttonscode = $this->generate_buttons_code( $_selected_network, $show_count, $show_total, $extra_class );
|
| 464 |
|
| 465 |
if ( in_array( $this->get_post_type(), $this->inline_option['posts'] ) ) {
|
| 466 |
if ( $this->inline_option['location'] == 'above' || $this->inline_option['location'] == 'above_below' ) {
|
| 512 |
|
| 513 |
$_share_links = array();
|
| 514 |
foreach ( $arrButtons as $social_name => $priority ) {
|
| 515 |
+
if ( 'totalshare' == $social_name || 'viber' == $social_name || 'fblike' == $social_name || 'whatsapp' == $social_name ) {
|
| 516 |
continue; }
|
| 517 |
$_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', get_permalink() );
|
| 518 |
}
|
| 624 |
case 'viber':
|
| 625 |
$arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_self\' );return false;" class="simplesocial-viber-share" data-href="viber://forward?text=' . $permalink . '"><span class="simplesocialtxt">Share on Viber</span></button>';
|
| 626 |
break;
|
| 627 |
+
|
| 628 |
+
case 'fblike':
|
| 629 |
+
|
| 630 |
+
$_html = '<div class="fb-like ssb-fb-like" data-href="'. $permalink .'" data-layout="button_count" data-action="like" data-size="large" data-show-faces="false" data-share="false"></div>';
|
| 631 |
+
|
| 632 |
+
$arrButtonsCode[] = $_html;
|
| 633 |
+
|
| 634 |
+
break;
|
| 635 |
}
|
| 636 |
}
|
| 637 |
|
| 694 |
if ( $this->sidebar_option['hide_mobile'] ) {
|
| 695 |
$class .= ' simplesocialbuttons-mobile-hidden'; }
|
| 696 |
$class .= ' simplesocialbuttons-slide-' . $this->_get_settings( 'sidebar', 'animation', 'no-animation' );
|
| 697 |
+
$_selected_network = apply_filters( 'ssb_sidebar_social_networks', $this->selected_networks );
|
| 698 |
+
echo $this->generate_buttons_code( $_selected_network, $show_count, $show_total, $class );
|
| 699 |
+
}
|
| 700 |
}
|
| 701 |
}
|
| 702 |
|
| 765 |
<?php
|
| 766 |
}
|
| 767 |
|
| 768 |
+
/**
|
| 769 |
+
* Add Facebook Like script.
|
| 770 |
+
*
|
| 771 |
+
* @since 2.0.4
|
| 772 |
+
*/
|
| 773 |
+
function fblike_script(){
|
| 774 |
+
|
| 775 |
+
if ( ! array_key_exists( "fblike", array_filter( $this->selected_networks ) ) ) {
|
| 776 |
+
return;
|
| 777 |
+
}
|
| 778 |
+
?>
|
| 779 |
+
<div id="fb-root"></div>
|
| 780 |
+
<script>(function(d, s, id) {
|
| 781 |
+
var js, fjs = d.getElementsByTagName(s)[0];
|
| 782 |
+
if (d.getElementById(id)) return;
|
| 783 |
+
js = d.createElement(s); js.id = id;
|
| 784 |
+
js.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.11&appId=1158761637505872';
|
| 785 |
+
fjs.parentNode.insertBefore(js, fjs);
|
| 786 |
+
}(document, 'script', 'facebook-jssdk'));</script>
|
| 787 |
+
<?php
|
| 788 |
+
}
|
| 789 |
+
|
| 790 |
} // end class
|
| 791 |
|
| 792 |
|
