Version Description
- 2020-12-18 =
- Bug fix: Security vulnerabilities fixed, Upgrade immediately.
Download this release
Release Info
| Developer | hiddenpearls |
| Plugin | |
| Version | 3.2.1 |
| Comparing to | |
| See all releases | |
Code changes from version 3.2.0 to 3.2.1
- assets/js/blocks.frontend.js.map +1 -1
- classes/ssb-admin.php +4 -3
- classes/ssb-settings.php +1 -1
- inc/ssb-widget-fields.php +2 -2
- inc/upgrade-routine.php +7 -7
- inc/utils.php +5 -5
- readme.txt +5 -2
- simple-social-buttons.php +13 -14
- ssb-social-counts/tumblr.php +6 -4
assets/js/blocks.frontend.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"./assets/js/blocks.frontend.js","sources":["webpack:///webpack/bootstrap 313b63f2d1480143345d","webpack:///blocks/frontend.js"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 97);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 313b63f2d1480143345d","console.log('
|
| 1 |
+
{"version":3,"file":"./assets/js/blocks.frontend.js","sources":["webpack:///webpack/bootstrap 313b63f2d1480143345d","webpack:///blocks/frontend.js"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 97);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 313b63f2d1480143345d","console.log('');\n\n\n// WEBPACK FOOTER //\n// blocks/frontend.js"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7DA;;;;A","sourceRoot":""}
|
classes/ssb-admin.php
CHANGED
|
@@ -71,7 +71,7 @@ if ( ! class_exists( 'SimpleSocialButtonsPR_Admin' ) ) :
|
|
| 71 |
wp_enqueue_style( 'ssb-blocks-editor-css', plugins_url( 'assets/css/blocks.editor.css', plugin_dir_path( __FILE__ ) ), array(), SSB_VERSION );
|
| 72 |
wp_enqueue_style( 'ssb-front-css', plugins_url( 'assets/css/front.css', plugin_dir_path( __FILE__ ) ), false, SSB_VERSION );
|
| 73 |
|
| 74 |
-
$is_pro =
|
| 75 |
wp_localize_script( 'ssb-blocks-editor-js', 'SSB', array( 'plugin_url' => SSB_PLUGIN_URL, 'is_pro' => $is_pro ) );
|
| 76 |
|
| 77 |
}
|
|
@@ -84,7 +84,7 @@ if ( ! class_exists( 'SimpleSocialButtonsPR_Admin' ) ) :
|
|
| 84 |
* @return void
|
| 85 |
*/
|
| 86 |
public function ssb_meta_box() {
|
| 87 |
-
$postId = isset( $_GET['post'] ) ? $_GET['post'] : false;
|
| 88 |
$postType = get_post_type( $postId );
|
| 89 |
$ssb_positions = get_option( 'ssb_positions' );
|
| 90 |
$selected_post_type = array();
|
|
@@ -183,9 +183,10 @@ if ( ! class_exists( 'SimpleSocialButtonsPR_Admin' ) ) :
|
|
| 183 |
}
|
| 184 |
|
| 185 |
// Saving data
|
| 186 |
-
$newValue = ( isset( $_POST[ $this->hideCustomMetaKey ] ) ) ? $_POST[ $this->hideCustomMetaKey ] :
|
| 187 |
|
| 188 |
update_post_meta( $postId, $this->hideCustomMetaKey, $newValue );
|
|
|
|
| 189 |
}
|
| 190 |
|
| 191 |
|
| 71 |
wp_enqueue_style( 'ssb-blocks-editor-css', plugins_url( 'assets/css/blocks.editor.css', plugin_dir_path( __FILE__ ) ), array(), SSB_VERSION );
|
| 72 |
wp_enqueue_style( 'ssb-front-css', plugins_url( 'assets/css/front.css', plugin_dir_path( __FILE__ ) ), false, SSB_VERSION );
|
| 73 |
|
| 74 |
+
$is_pro = class_exists( 'Simple_Social_Buttons_Pro') ? rest_sanitize_boolean( true ) : rest_sanitize_boolean( false );
|
| 75 |
wp_localize_script( 'ssb-blocks-editor-js', 'SSB', array( 'plugin_url' => SSB_PLUGIN_URL, 'is_pro' => $is_pro ) );
|
| 76 |
|
| 77 |
}
|
| 84 |
* @return void
|
| 85 |
*/
|
| 86 |
public function ssb_meta_box() {
|
| 87 |
+
$postId = isset( $_GET['post'] ) ? sanitize_post( $_GET['post'] ) : rest_sanitize_boolean( false );
|
| 88 |
$postType = get_post_type( $postId );
|
| 89 |
$ssb_positions = get_option( 'ssb_positions' );
|
| 90 |
$selected_post_type = array();
|
| 183 |
}
|
| 184 |
|
| 185 |
// Saving data
|
| 186 |
+
$newValue = ( isset( $_POST[ $this->hideCustomMetaKey ] ) ) ? sanitize_text_field( $_POST[ $this->hideCustomMetaKey ] ) : 'false';
|
| 187 |
|
| 188 |
update_post_meta( $postId, $this->hideCustomMetaKey, $newValue );
|
| 189 |
+
|
| 190 |
}
|
| 191 |
|
| 192 |
|
classes/ssb-settings.php
CHANGED
|
@@ -582,7 +582,7 @@ class Ssb_Settings {
|
|
| 582 |
wp_die( 'error' );
|
| 583 |
}
|
| 584 |
|
| 585 |
-
$ssb_imp_tmp_name = $_FILES['file']['tmp_name'];
|
| 586 |
$ssb_file_content = file_get_contents( $ssb_imp_tmp_name );
|
| 587 |
$ssb_json = json_decode( $ssb_file_content, true );
|
| 588 |
|
| 582 |
wp_die( 'error' );
|
| 583 |
}
|
| 584 |
|
| 585 |
+
$ssb_imp_tmp_name = sanitize_text_field( $_FILES['file']['tmp_name'] );
|
| 586 |
$ssb_file_content = file_get_contents( $ssb_imp_tmp_name );
|
| 587 |
$ssb_json = json_decode( $ssb_file_content, true );
|
| 588 |
|
inc/ssb-widget-fields.php
CHANGED
|
@@ -100,7 +100,7 @@
|
|
| 100 |
<p>
|
| 101 |
<label for="<?php echo esc_attr( $this->get_field_id( 'youtube_type' ) ); ?> "><?php esc_attr_e( 'Type :', 'simple-social-buttons' ); ?></label>
|
| 102 |
<select class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'youtube_type' ) ); ?>">
|
| 103 |
-
<option <?php selected( $youtube_type, 'channel'); ?> value="
|
| 104 |
<option <?php selected( $youtube_type, 'user'); ?> value="user">Username</option>
|
| 105 |
</select>
|
| 106 |
</p>
|
|
@@ -114,7 +114,7 @@
|
|
| 114 |
|
| 115 |
<div class="youtube_api_key" style="display: <?php echo ( $display == $youtube_show_counter )? 'block' : 'none' ?>">
|
| 116 |
<p>
|
| 117 |
-
<label for="<?php echo esc_attr( $this->get_field_id( 'youtube_api_key' ) ); ?>"><?php esc_attr_e( 'YouTube Api Key: ', 'simple-social-buttons' ); ?><a href="
|
| 118 |
</label>
|
| 119 |
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'youtube_api_key' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'youtube_api_key' ) ); ?>" type="text" value="<?php echo esc_attr( $youtube_api_key ); ?>">
|
| 120 |
</p>
|
| 100 |
<p>
|
| 101 |
<label for="<?php echo esc_attr( $this->get_field_id( 'youtube_type' ) ); ?> "><?php esc_attr_e( 'Type :', 'simple-social-buttons' ); ?></label>
|
| 102 |
<select class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'youtube_type' ) ); ?>">
|
| 103 |
+
<option <?php selected( $youtube_type, 'channel'); ?> value="c">Channel</option>
|
| 104 |
<option <?php selected( $youtube_type, 'user'); ?> value="user">Username</option>
|
| 105 |
</select>
|
| 106 |
</p>
|
| 114 |
|
| 115 |
<div class="youtube_api_key" style="display: <?php echo ( $display == $youtube_show_counter )? 'block' : 'none' ?>">
|
| 116 |
<p>
|
| 117 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'youtube_api_key' ) ); ?>"><?php esc_attr_e( 'YouTube Api Key: ', 'simple-social-buttons' ); ?><a href="https://developers.google.com/youtube/registering_an_application" target="_blank">How to get the YouTube API Key</a>
|
| 118 |
</label>
|
| 119 |
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'youtube_api_key' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'youtube_api_key' ) ); ?>" type="text" value="<?php echo esc_attr( $youtube_api_key ); ?>">
|
| 120 |
</p>
|
inc/upgrade-routine.php
CHANGED
|
@@ -32,8 +32,8 @@ function ssb_upgrade_routine_2() {
|
|
| 32 |
$_old_value = get_option( 'ssb_pr_settings' );
|
| 33 |
|
| 34 |
// Set Position of Inline Icons.
|
| 35 |
-
$before_post = isset( $_old_value['beforepost'] ) && $_old_value['beforepost'] == '1' ? true : false;
|
| 36 |
-
$after_post = isset( $_old_value['afterpost'] ) && $_old_value['afterpost'] == '1' ? true : false;
|
| 37 |
|
| 38 |
if ( $before_post && $after_post ) {
|
| 39 |
$inline_location = 'above_below';
|
|
@@ -44,8 +44,8 @@ function ssb_upgrade_routine_2() {
|
|
| 44 |
}
|
| 45 |
|
| 46 |
// Page.
|
| 47 |
-
$before_page = isset( $_old_value['beforepage'] ) && $_old_value['beforepage'] == '1' ? true : false;
|
| 48 |
-
$after_page = isset( $_old_value['afterpage'] ) && $_old_value['afterpage'] == '1' ? true : false;
|
| 49 |
|
| 50 |
$inline_posts = array(
|
| 51 |
'post' => 'post',
|
|
@@ -60,9 +60,9 @@ function ssb_upgrade_routine_2() {
|
|
| 60 |
'posts' => $inline_posts,
|
| 61 |
);
|
| 62 |
|
| 63 |
-
$on_archive = isset( $_old_value['showarchive'] ) && $_old_value['showarchive'] == '1' ? true : false;
|
| 64 |
-
$on_tag = isset( $_old_value['showtag'] ) && $_old_value['showtag'] == '1' ? true : false;
|
| 65 |
-
$on_category = isset( $_old_value['showcategory'] ) && $_old_value['showcategory'] == '1' ? true : false;
|
| 66 |
|
| 67 |
if ( $on_archive ) {
|
| 68 |
$_default_inline['show_on_archive'] = 1;
|
| 32 |
$_old_value = get_option( 'ssb_pr_settings' );
|
| 33 |
|
| 34 |
// Set Position of Inline Icons.
|
| 35 |
+
$before_post = rest_sanitize_boolean( isset( $_old_value['beforepost'] ) && $_old_value['beforepost'] == '1' ? true : false );
|
| 36 |
+
$after_post = rest_sanitize_boolean( isset( $_old_value['afterpost'] ) && $_old_value['afterpost'] == '1' ? true : false );
|
| 37 |
|
| 38 |
if ( $before_post && $after_post ) {
|
| 39 |
$inline_location = 'above_below';
|
| 44 |
}
|
| 45 |
|
| 46 |
// Page.
|
| 47 |
+
$before_page = rest_sanitize_boolean( isset( $_old_value['beforepage'] ) && $_old_value['beforepage'] == '1' ? true : false );
|
| 48 |
+
$after_page = rest_sanitize_boolean( isset( $_old_value['afterpage'] ) && $_old_value['afterpage'] == '1' ? true : false );
|
| 49 |
|
| 50 |
$inline_posts = array(
|
| 51 |
'post' => 'post',
|
| 60 |
'posts' => $inline_posts,
|
| 61 |
);
|
| 62 |
|
| 63 |
+
$on_archive = rest_sanitize_boolean( isset( $_old_value['showarchive'] ) && $_old_value['showarchive'] == '1' ? true : false );
|
| 64 |
+
$on_tag = rest_sanitize_boolean( isset( $_old_value['showtag'] ) && $_old_value['showtag'] == '1' ? true : false );
|
| 65 |
+
$on_category = rest_sanitize_boolean( isset( $_old_value['showcategory'] ) && $_old_value['showcategory'] == '1' ? true : false );
|
| 66 |
|
| 67 |
if ( $on_archive ) {
|
| 68 |
$_default_inline['show_on_archive'] = 1;
|
inc/utils.php
CHANGED
|
@@ -153,7 +153,7 @@ function ssb_fetch_fresh_counts( $stats, $post_id, $alt_share_link ) {
|
|
| 153 |
}
|
| 154 |
|
| 155 |
foreach ( $stats as $social_name => $counts ) {
|
| 156 |
-
if ( !
|
| 157 |
continue; }
|
| 158 |
$stats_counts = call_user_func( 'ssb_format_' . $social_name . '_response', $counts );
|
| 159 |
$new_counts = $stats_counts + $networks[ $social_name ];
|
|
@@ -206,7 +206,7 @@ function ssb_fetch_http_or_https_counts( $stats, $post_id ) {
|
|
| 206 |
$stats_result = array();
|
| 207 |
$networks = array();
|
| 208 |
foreach ( $stats as $social_name => $counts ) {
|
| 209 |
-
if ( !
|
| 210 |
continue; }
|
| 211 |
$stats_counts = call_user_func( 'ssb_format_' . $social_name . '_response', $counts );
|
| 212 |
$networks[ $social_name ] = $stats_counts;
|
|
@@ -248,7 +248,7 @@ function ssb_fetch_cached_counts( $network_name, $post_id ) {
|
|
| 248 |
*
|
| 249 |
* @since 2.0.13
|
| 250 |
*/
|
| 251 |
-
function
|
| 252 |
|
| 253 |
$useragent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : 'none';
|
| 254 |
|
|
@@ -303,13 +303,13 @@ function ssb_linkdin_share_link( $url ) {
|
|
| 303 |
}
|
| 304 |
|
| 305 |
/**
|
| 306 |
-
* Check
|
| 307 |
*
|
| 308 |
* @since 2.1.4
|
| 309 |
* @param string $network network name.
|
| 310 |
* @return boolean
|
| 311 |
*/
|
| 312 |
-
function
|
| 313 |
$no_count_networks = array( 'totalshare', 'viber', 'fblike', 'whatsapp', 'print', 'email', 'messenger', 'linkedin' );
|
| 314 |
if ( in_array( $network, $no_count_networks ) ) {
|
| 315 |
return false;
|
| 153 |
}
|
| 154 |
|
| 155 |
foreach ( $stats as $social_name => $counts ) {
|
| 156 |
+
if ( ! ssb_is_network_has_counts( $social_name ) ) {
|
| 157 |
continue; }
|
| 158 |
$stats_counts = call_user_func( 'ssb_format_' . $social_name . '_response', $counts );
|
| 159 |
$new_counts = $stats_counts + $networks[ $social_name ];
|
| 206 |
$stats_result = array();
|
| 207 |
$networks = array();
|
| 208 |
foreach ( $stats as $social_name => $counts ) {
|
| 209 |
+
if ( ! ssb_is_network_has_counts( $social_name ) ) {
|
| 210 |
continue; }
|
| 211 |
$stats_counts = call_user_func( 'ssb_format_' . $social_name . '_response', $counts );
|
| 212 |
$networks[ $social_name ] = $stats_counts;
|
| 248 |
*
|
| 249 |
* @since 2.0.13
|
| 250 |
*/
|
| 251 |
+
function ssb_is_mobile() {
|
| 252 |
|
| 253 |
$useragent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : 'none';
|
| 254 |
|
| 303 |
}
|
| 304 |
|
| 305 |
/**
|
| 306 |
+
* Check if SSB network has count/s.
|
| 307 |
*
|
| 308 |
* @since 2.1.4
|
| 309 |
* @param string $network network name.
|
| 310 |
* @return boolean
|
| 311 |
*/
|
| 312 |
+
function ssb_is_network_has_counts( $network ) {
|
| 313 |
$no_count_networks = array( 'totalshare', 'viber', 'fblike', 'whatsapp', 'print', 'email', 'messenger', 'linkedin' );
|
| 314 |
if ( in_array( $network, $no_count_networks ) ) {
|
| 315 |
return false;
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Donate link: https://simplesocialbuttons.com/
|
|
| 4 |
Tags: Social share, Social buttons, Whatsapp, Viber, LinkedIn, facebook, twitter, pinterest, plus one
|
| 5 |
Requires at least: 4.0
|
| 6 |
Tested up to: 5.6
|
| 7 |
-
Stable tag: 3.2.
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
|
@@ -147,6 +147,9 @@ like_button_size = small(default), large
|
|
| 147 |
|
| 148 |
== Changelog ==
|
| 149 |
|
|
|
|
|
|
|
|
|
|
| 150 |
= 3.2.0 - 2020-12-15 =
|
| 151 |
* Bug fix: Security vulnerability fixed, Upgrade immediately.
|
| 152 |
* Bug fix: Remove deprecated PHP function.
|
|
@@ -444,5 +447,5 @@ like_button_size = small(default), large
|
|
| 444 |
|
| 445 |
== Upgrade Notice ==
|
| 446 |
|
| 447 |
-
= 3.2.
|
| 448 |
* Please upgrade immediately.
|
| 4 |
Tags: Social share, Social buttons, Whatsapp, Viber, LinkedIn, facebook, twitter, pinterest, plus one
|
| 5 |
Requires at least: 4.0
|
| 6 |
Tested up to: 5.6
|
| 7 |
+
Stable tag: 3.2.1
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
| 147 |
|
| 148 |
== Changelog ==
|
| 149 |
|
| 150 |
+
= 3.2.1 - 2020-12-18 =
|
| 151 |
+
* Bug fix: Security vulnerabilities fixed, Upgrade immediately.
|
| 152 |
+
|
| 153 |
= 3.2.0 - 2020-12-15 =
|
| 154 |
* Bug fix: Security vulnerability fixed, Upgrade immediately.
|
| 155 |
* Bug fix: Remove deprecated PHP function.
|
| 447 |
|
| 448 |
== Upgrade Notice ==
|
| 449 |
|
| 450 |
+
= 3.2.1 =
|
| 451 |
* Please upgrade immediately.
|
simple-social-buttons.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
* Plugin Name: Simple Social Buttons
|
| 4 |
* Plugin URI: https://simplesocialbuttons.com/
|
| 5 |
* Description: Simple Social Buttons adds an advanced set of social media sharing buttons to your WordPress sites, such as: Facebook, Twitter, WhatsApp, Viber, Reddit, LinkedIn and Pinterest. This makes it the most <code>Flexible Social Sharing Plugin ever for Everyone.</code>
|
| 6 |
-
* Version: 3.2.
|
| 7 |
* Author: WPBrigade
|
| 8 |
* Author URI: https://www.WPBrigade.com/
|
| 9 |
* Text Domain: simple-social-buttons
|
|
@@ -44,7 +44,7 @@ class SimpleSocialButtonsPR {
|
|
| 44 |
* @isnce
|
| 45 |
* @var string
|
| 46 |
*/
|
| 47 |
-
public $pluginVersion = '3.2.
|
| 48 |
|
| 49 |
/**
|
| 50 |
* Plugin Prefix
|
|
@@ -308,7 +308,7 @@ class SimpleSocialButtonsPR {
|
|
| 308 |
|
| 309 |
$_share_links = array();
|
| 310 |
foreach ( $order as $social_name => $priority ) {
|
| 311 |
-
if ( !
|
| 312 |
continue; }
|
| 313 |
$_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', get_permalink( $post_id ) );
|
| 314 |
}
|
|
@@ -387,7 +387,6 @@ class SimpleSocialButtonsPR {
|
|
| 387 |
};
|
| 388 |
jQuery.post(ssb_admin_ajax, data, function(data, textStatus, xhr) {
|
| 389 |
var array = JSON.parse(data);
|
| 390 |
-
// console.log( array );
|
| 391 |
jQuery.each( array, function( index, value ){
|
| 392 |
|
| 393 |
if( index == 'total' ){
|
|
@@ -421,8 +420,8 @@ class SimpleSocialButtonsPR {
|
|
| 421 |
|
| 422 |
}
|
| 423 |
|
| 424 |
-
$activity = $_POST['share_counts'];
|
| 425 |
-
$post_id = $_POST['post_id'];
|
| 426 |
|
| 427 |
$previous_activity = get_post_meta( $post_id, 'ssb_fbshare_counts', true );
|
| 428 |
|
|
@@ -452,7 +451,7 @@ class SimpleSocialButtonsPR {
|
|
| 452 |
if ( ( $this->is_ssb_on( 'sidebar' ) || $this->is_ssb_on( 'inline' ) ) || ! empty( $_GET['ssb_cache'] ) ) {
|
| 453 |
|
| 454 |
// Fetch a few variables.
|
| 455 |
-
$info['postID'] = get_the_ID();
|
| 456 |
$info['footer_output'] = '';
|
| 457 |
|
| 458 |
// Pass the array through our custom filters.
|
|
@@ -816,7 +815,7 @@ class SimpleSocialButtonsPR {
|
|
| 816 |
// get post permalink and title
|
| 817 |
$permalink = get_permalink();
|
| 818 |
$title = urlencode( html_entity_decode( get_the_title(), ENT_COMPAT, 'UTF-8' ) );
|
| 819 |
-
$post_id = get_the_id();
|
| 820 |
$theme = isset( $extra_data['theme'] ) ? $extra_data['theme'] : $this->selected_theme;
|
| 821 |
|
| 822 |
// Sorting the buttons
|
|
@@ -862,7 +861,7 @@ class SimpleSocialButtonsPR {
|
|
| 862 |
|
| 863 |
$_share_links = array();
|
| 864 |
foreach ( $arrButtons as $social_name => $priority ) {
|
| 865 |
-
if ( !
|
| 866 |
continue; }
|
| 867 |
$_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', $permalink );
|
| 868 |
}
|
|
@@ -1078,7 +1077,7 @@ class SimpleSocialButtonsPR {
|
|
| 1078 |
break;
|
| 1079 |
case 'messenger':
|
| 1080 |
$link = urlencode( $permalink );
|
| 1081 |
-
$messenger_share_url =
|
| 1082 |
|
| 1083 |
if ( $theme == 'simple-icons' ) {
|
| 1084 |
$arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_blank\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\' );return false;" class="simplesocial-viber-share ssb_msng-icon" data-href=' . $messenger_share_url . '>
|
|
@@ -1124,7 +1123,7 @@ class SimpleSocialButtonsPR {
|
|
| 1124 |
$tumblr_score = $share_counts['tumblr'] ? $share_counts['tumblr'] : 0;
|
| 1125 |
|
| 1126 |
$link = urlencode( $permalink );
|
| 1127 |
-
$tumblr_share_url = "http://tumblr.com/widgets/share/tool?canonicalUrl=$link";
|
| 1128 |
if ( $theme == 'simple-icons' ) {
|
| 1129 |
$_html = '<button class="ssb_tumblr-icon" data-href="' . $tumblr_share_url . '" onclick="javascript:window.open(this.dataset.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;">
|
| 1130 |
<span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
@@ -1618,7 +1617,7 @@ class SimpleSocialButtonsPR {
|
|
| 1618 |
* @return string Meta tag og:image for meta
|
| 1619 |
*/
|
| 1620 |
public function generate_og_image() {
|
| 1621 |
-
$_post_id = get_the_ID();
|
| 1622 |
|
| 1623 |
if ( has_post_thumbnail( $_post_id ) ) {
|
| 1624 |
return '<meta property="og:image" content="' . wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ) . '" />' . PHP_EOL;
|
|
@@ -1650,7 +1649,7 @@ class SimpleSocialButtonsPR {
|
|
| 1650 |
* @return mixed
|
| 1651 |
*/
|
| 1652 |
public function generate_twitter_image() {
|
| 1653 |
-
$_post_id = get_the_ID();
|
| 1654 |
|
| 1655 |
if ( has_post_thumbnail( $_post_id ) ) {
|
| 1656 |
return '<meta property="twitter:image" content="' . wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ) . '" />' . PHP_EOL;
|
|
@@ -1721,7 +1720,7 @@ class SimpleSocialButtonsPR {
|
|
| 1721 |
public function http_or_https_link_generate( $permalink ) {
|
| 1722 |
|
| 1723 |
foreach ( $this->arrKnownButtons as $social_name ) {
|
| 1724 |
-
if ( !
|
| 1725 |
continue; }
|
| 1726 |
$url = $this->http_or_https_resolve_url( $permalink );
|
| 1727 |
// get alt hurl to cover http or https issue
|
| 3 |
* Plugin Name: Simple Social Buttons
|
| 4 |
* Plugin URI: https://simplesocialbuttons.com/
|
| 5 |
* Description: Simple Social Buttons adds an advanced set of social media sharing buttons to your WordPress sites, such as: Facebook, Twitter, WhatsApp, Viber, Reddit, LinkedIn and Pinterest. This makes it the most <code>Flexible Social Sharing Plugin ever for Everyone.</code>
|
| 6 |
+
* Version: 3.2.1
|
| 7 |
* Author: WPBrigade
|
| 8 |
* Author URI: https://www.WPBrigade.com/
|
| 9 |
* Text Domain: simple-social-buttons
|
| 44 |
* @isnce
|
| 45 |
* @var string
|
| 46 |
*/
|
| 47 |
+
public $pluginVersion = '3.2.1';
|
| 48 |
|
| 49 |
/**
|
| 50 |
* Plugin Prefix
|
| 308 |
|
| 309 |
$_share_links = array();
|
| 310 |
foreach ( $order as $social_name => $priority ) {
|
| 311 |
+
if ( ! ssb_is_network_has_counts( $social_name ) ) {
|
| 312 |
continue; }
|
| 313 |
$_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', get_permalink( $post_id ) );
|
| 314 |
}
|
| 387 |
};
|
| 388 |
jQuery.post(ssb_admin_ajax, data, function(data, textStatus, xhr) {
|
| 389 |
var array = JSON.parse(data);
|
|
|
|
| 390 |
jQuery.each( array, function( index, value ){
|
| 391 |
|
| 392 |
if( index == 'total' ){
|
| 420 |
|
| 421 |
}
|
| 422 |
|
| 423 |
+
$activity = (int) $_POST['share_counts'];
|
| 424 |
+
$post_id = (int) $_POST['post_id'];
|
| 425 |
|
| 426 |
$previous_activity = get_post_meta( $post_id, 'ssb_fbshare_counts', true );
|
| 427 |
|
| 451 |
if ( ( $this->is_ssb_on( 'sidebar' ) || $this->is_ssb_on( 'inline' ) ) || ! empty( $_GET['ssb_cache'] ) ) {
|
| 452 |
|
| 453 |
// Fetch a few variables.
|
| 454 |
+
$info['postID'] = (int) get_the_ID();
|
| 455 |
$info['footer_output'] = '';
|
| 456 |
|
| 457 |
// Pass the array through our custom filters.
|
| 815 |
// get post permalink and title
|
| 816 |
$permalink = get_permalink();
|
| 817 |
$title = urlencode( html_entity_decode( get_the_title(), ENT_COMPAT, 'UTF-8' ) );
|
| 818 |
+
$post_id = (int) get_the_id();
|
| 819 |
$theme = isset( $extra_data['theme'] ) ? $extra_data['theme'] : $this->selected_theme;
|
| 820 |
|
| 821 |
// Sorting the buttons
|
| 861 |
|
| 862 |
$_share_links = array();
|
| 863 |
foreach ( $arrButtons as $social_name => $priority ) {
|
| 864 |
+
if ( ! ssb_is_network_has_counts( $social_name ) ) {
|
| 865 |
continue; }
|
| 866 |
$_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', $permalink );
|
| 867 |
}
|
| 1077 |
break;
|
| 1078 |
case 'messenger':
|
| 1079 |
$link = urlencode( $permalink );
|
| 1080 |
+
$messenger_share_url = ssb_is_mobile() ? "fb-messenger://share/?link=$link?app_id=$this->fb_app_id" : "http://www.facebook.com/dialog/send?app_id=$this->fb_app_id&redirect_uri=$link&link=$link&display=popup";
|
| 1081 |
|
| 1082 |
if ( $theme == 'simple-icons' ) {
|
| 1083 |
$arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_blank\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\' );return false;" class="simplesocial-viber-share ssb_msng-icon" data-href=' . $messenger_share_url . '>
|
| 1123 |
$tumblr_score = $share_counts['tumblr'] ? $share_counts['tumblr'] : 0;
|
| 1124 |
|
| 1125 |
$link = urlencode( $permalink );
|
| 1126 |
+
$tumblr_share_url = esc_url( "http://tumblr.com/widgets/share/tool?canonicalUrl=$link" );
|
| 1127 |
if ( $theme == 'simple-icons' ) {
|
| 1128 |
$_html = '<button class="ssb_tumblr-icon" data-href="' . $tumblr_share_url . '" onclick="javascript:window.open(this.dataset.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;">
|
| 1129 |
<span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
| 1617 |
* @return string Meta tag og:image for meta
|
| 1618 |
*/
|
| 1619 |
public function generate_og_image() {
|
| 1620 |
+
$_post_id = (int) get_the_ID();
|
| 1621 |
|
| 1622 |
if ( has_post_thumbnail( $_post_id ) ) {
|
| 1623 |
return '<meta property="og:image" content="' . wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ) . '" />' . PHP_EOL;
|
| 1649 |
* @return mixed
|
| 1650 |
*/
|
| 1651 |
public function generate_twitter_image() {
|
| 1652 |
+
$_post_id = (int) get_the_ID();
|
| 1653 |
|
| 1654 |
if ( has_post_thumbnail( $_post_id ) ) {
|
| 1655 |
return '<meta property="twitter:image" content="' . wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ) . '" />' . PHP_EOL;
|
| 1720 |
public function http_or_https_link_generate( $permalink ) {
|
| 1721 |
|
| 1722 |
foreach ( $this->arrKnownButtons as $social_name ) {
|
| 1723 |
+
if ( ! ssb_is_network_has_counts( $social_name ) ) {
|
| 1724 |
continue; }
|
| 1725 |
$url = $this->http_or_https_resolve_url( $permalink );
|
| 1726 |
// get alt hurl to cover http or https issue
|
ssb-social-counts/tumblr.php
CHANGED
|
@@ -12,12 +12,14 @@ function ssb_format_tumblr_response( $response ) {
|
|
| 12 |
$counts = 0;
|
| 13 |
$response = json_decode( $response, true );
|
| 14 |
// Check is valid api response
|
| 15 |
-
if ( isset( $response['meta']['status'] ) && $response['response']['note_count']
|
| 16 |
-
if
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
}
|
|
|
|
| 19 |
}
|
| 20 |
-
return $counts;
|
| 21 |
}
|
| 22 |
|
| 23 |
/**
|
| 12 |
$counts = 0;
|
| 13 |
$response = json_decode( $response, true );
|
| 14 |
// Check is valid api response
|
| 15 |
+
if ( isset( $response['meta']['status'] ) && isset( $response['response']['note_count'] ) ) {
|
| 16 |
+
if( $response['response']['note_count'] > 0 ) {
|
| 17 |
+
if ( $response['meta']['status'] == 200 ) {
|
| 18 |
+
$counts = $response['response']['note_count'];
|
| 19 |
+
}
|
| 20 |
}
|
| 21 |
+
return $counts;
|
| 22 |
}
|
|
|
|
| 23 |
}
|
| 24 |
|
| 25 |
/**
|
