Version Description
- Please upgrade immediately. Bug fixes and improvements.
=
Download this release
Release Info
Developer | hiddenpearls |
Plugin | Simple Social Media Share Buttons – Social Sharing for Everyone |
Version | 2.1.1 |
Comparing to | |
See all releases |
Code changes from version 2.1.0 to 2.1.1
- assets/css/admin.css +7 -0
- assets/js/admin.js +4 -0
- classes/ssb-settings-strucutre.php +7 -5
- classes/ssb-settings.php +169 -149
- inc/utils.php +1 -1
- readme.txt +15 -12
- simple-social-buttons.php +7 -7
- ssb-social-counts/facebook.php +15 -7
assets/css/admin.css
CHANGED
@@ -1990,5 +1990,12 @@ html[dir="rtl"] .simplesocial-inline-form-section label{
|
|
1990 |
font-size:14px;
|
1991 |
}
|
1992 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1993 |
/*===== End Code for instruction ======*/
|
1994 |
|
1990 |
font-size:14px;
|
1991 |
}
|
1992 |
|
1993 |
+
#share-count-message{
|
1994 |
+
clear: both;
|
1995 |
+
display:none;
|
1996 |
+
}
|
1997 |
+
.checkbox[checked="checked"] ~ #share-count-message{
|
1998 |
+
display:block;
|
1999 |
+
}
|
2000 |
/*===== End Code for instruction ======*/
|
2001 |
|
assets/js/admin.js
CHANGED
@@ -278,6 +278,10 @@
|
|
278 |
|
279 |
//end widget js;
|
280 |
|
|
|
|
|
|
|
|
|
281 |
|
282 |
});
|
283 |
|
278 |
|
279 |
//end widget js;
|
280 |
|
281 |
+
$(".checkbox").on( 'change' , function(){
|
282 |
+
$(this.parentElement).find('#share-count-message').slideToggle();
|
283 |
+
|
284 |
+
})
|
285 |
|
286 |
});
|
287 |
|
classes/ssb-settings-strucutre.php
CHANGED
@@ -121,6 +121,7 @@ if ( ! class_exists( 'Ssb_Settings_Structure' ) ) :
|
|
121 |
'class' => isset( $option['class'] ) ? $option['class'] : $name,
|
122 |
'label_for' => "{$section}[{$name}]",
|
123 |
'desc' => isset( $option['desc'] ) ? $option['desc'] : '',
|
|
|
124 |
'name' => $label,
|
125 |
'section' => $section,
|
126 |
'size' => isset( $option['size'] ) ? $option['size'] : null,
|
@@ -255,7 +256,8 @@ if ( ! class_exists( 'Ssb_Settings_Structure' ) ) :
|
|
255 |
<?php
|
256 |
}
|
257 |
|
258 |
-
|
|
|
259 |
echo isset( $args['desc'] ) ? $args['desc'] : '';
|
260 |
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
261 |
?>
|
@@ -265,10 +267,10 @@ if ( ! class_exists( 'Ssb_Settings_Structure' ) ) :
|
|
265 |
printf( '<input type="hidden" name="%1$s[%2$s]" value="0" />', $args['section'], $args['id'] );
|
266 |
printf( '<input type="checkbox" class="checkbox" id="%1$s[%2$s]" name="%1$s[%2$s]" value="1" %3$s />', $args['section'], $args['id'], checked( $value, '1', false ) );
|
267 |
printf( '<label class="simplesocial-switch" for="%1$s[%2$s]"></label>', $args['section'], $args['id'] );
|
|
|
268 |
?>
|
269 |
-
|
270 |
-
|
271 |
-
<?php
|
272 |
}
|
273 |
|
274 |
function callback_ssb_color( $args ) {
|
@@ -530,7 +532,7 @@ if ( ! class_exists( 'Ssb_Settings_Structure' ) ) :
|
|
530 |
function callback_number( $args ) {
|
531 |
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
532 |
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
533 |
-
$type = isset( $args['type'] ) ? $args['type'] : 'number';
|
534 |
$placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
|
535 |
$min = empty( $args['min'] ) ? '' : ' min="' . $args['min'] . '"';
|
536 |
$max = empty( $args['max'] ) ? '' : ' max="' . $args['max'] . '"';
|
121 |
'class' => isset( $option['class'] ) ? $option['class'] : $name,
|
122 |
'label_for' => "{$section}[{$name}]",
|
123 |
'desc' => isset( $option['desc'] ) ? $option['desc'] : '',
|
124 |
+
'help' => isset( $option['help'] ) ? $option['help'] : '',
|
125 |
'name' => $label,
|
126 |
'section' => $section,
|
127 |
'size' => isset( $option['size'] ) ? $option['size'] : null,
|
256 |
<?php
|
257 |
}
|
258 |
|
259 |
+
function callback_ssb_checkbox( $args ) {
|
260 |
+
|
261 |
echo isset( $args['desc'] ) ? $args['desc'] : '';
|
262 |
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
263 |
?>
|
267 |
printf( '<input type="hidden" name="%1$s[%2$s]" value="0" />', $args['section'], $args['id'] );
|
268 |
printf( '<input type="checkbox" class="checkbox" id="%1$s[%2$s]" name="%1$s[%2$s]" value="1" %3$s />', $args['section'], $args['id'], checked( $value, '1', false ) );
|
269 |
printf( '<label class="simplesocial-switch" for="%1$s[%2$s]"></label>', $args['section'], $args['id'] );
|
270 |
+
echo isset( $args['help'] ) ? $args['help'] : '';
|
271 |
?>
|
272 |
+
</div>
|
273 |
+
<?php
|
|
|
274 |
}
|
275 |
|
276 |
function callback_ssb_color( $args ) {
|
532 |
function callback_number( $args ) {
|
533 |
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
534 |
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
535 |
+
$type = isset ( $args['type'] ) ? $args['type'] : 'number';
|
536 |
$placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
|
537 |
$min = empty( $args['min'] ) ? '' : ' min="' . $args['min'] . '"';
|
538 |
$max = empty( $args['max'] ) ? '' : ' max="' . $args['max'] . '"';
|
classes/ssb-settings.php
CHANGED
@@ -9,7 +9,7 @@ class Ssb_Settings {
|
|
9 |
|
10 |
function __construct() {
|
11 |
|
12 |
-
include_once
|
13 |
$this->settings_api = new Ssb_Settings_Structure();
|
14 |
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
15 |
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
@@ -91,14 +91,14 @@ class Ssb_Settings {
|
|
91 |
return $setting_section;
|
92 |
}
|
93 |
|
94 |
-
public function sort_array( $a, $b ){
|
95 |
return $a['priority'] - $b['priority'];
|
96 |
}
|
97 |
|
98 |
public function get_current_post_types() {
|
99 |
|
100 |
$post_types_list = array(
|
101 |
-
'home' => 'Home'
|
102 |
);
|
103 |
|
104 |
$args = array(
|
@@ -120,59 +120,63 @@ class Ssb_Settings {
|
|
120 |
* @return array settings fields
|
121 |
*/
|
122 |
function get_settings_fields() {
|
123 |
-
$post_types
|
124 |
-
$ssb_positions_options = apply_filters(
|
125 |
-
'
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
|
|
|
|
131 |
|
132 |
$ssb_sidebar = array(
|
133 |
array(
|
134 |
-
'name'
|
135 |
-
'label'
|
136 |
-
'desc'
|
137 |
-
'type'
|
138 |
-
'default'
|
139 |
-
'options'
|
140 |
'left' => 'Left',
|
141 |
'right' => 'Right',
|
142 |
),
|
143 |
'priority' => '5',
|
144 |
),
|
145 |
array(
|
146 |
-
'name'
|
147 |
-
'label'
|
148 |
-
'type'
|
149 |
-
'default'
|
150 |
-
'options'
|
151 |
-
'no-animation'
|
152 |
-
'right-in'
|
153 |
-
'top-in'
|
154 |
-
'bottom-in'
|
155 |
-
'left-in'
|
156 |
-
'fade-in'
|
157 |
),
|
158 |
'priority' => '10',
|
159 |
),
|
160 |
array(
|
161 |
-
'name'
|
162 |
-
'
|
163 |
-
'
|
|
|
164 |
'priority' => '15',
|
165 |
),
|
166 |
array(
|
167 |
-
'name'
|
168 |
-
'label'
|
169 |
-
'type'
|
170 |
'priority' => '20',
|
171 |
),
|
172 |
array(
|
173 |
-
'name'
|
174 |
-
'label'
|
175 |
-
'type'
|
176 |
'priority' => '25',
|
177 |
),
|
178 |
array(
|
@@ -180,42 +184,45 @@ class Ssb_Settings {
|
|
180 |
'type' => 'ssb_text',
|
181 |
'label' => 'Enter the Space in Pixel',
|
182 |
'sanitize_callback' => 'sanitize_text_field',
|
183 |
-
'priority'
|
184 |
),
|
185 |
array(
|
186 |
-
'name'
|
187 |
-
'label'
|
188 |
-
'type'
|
189 |
'priority' => '35',
|
190 |
),
|
191 |
array(
|
192 |
-
'name'
|
193 |
-
'label'
|
194 |
-
'desc'
|
195 |
-
'type'
|
196 |
-
|
197 |
-
|
|
|
|
|
|
|
198 |
'priority' => '99',
|
199 |
),
|
200 |
array(
|
201 |
-
'name'
|
202 |
-
'type'
|
203 |
-
'label'
|
204 |
-
'desc'
|
205 |
-
'link'
|
206 |
),
|
207 |
);
|
208 |
|
209 |
-
$ssb_sidebar =
|
210 |
|
211 |
$ssb_inline = array(
|
212 |
array(
|
213 |
-
'name'
|
214 |
-
'label'
|
215 |
-
'desc'
|
216 |
-
'type'
|
217 |
-
'default'
|
218 |
-
'options'
|
219 |
'above' => 'Above The Content',
|
220 |
'below' => 'Below The Content',
|
221 |
'above_below' => 'Above + Below The Content',
|
@@ -223,11 +230,11 @@ class Ssb_Settings {
|
|
223 |
'priority' => '5',
|
224 |
),
|
225 |
array(
|
226 |
-
'name'
|
227 |
-
'label'
|
228 |
-
'type'
|
229 |
-
'default'
|
230 |
-
'options'
|
231 |
'left' => 'Left',
|
232 |
'centered' => 'Centered',
|
233 |
'right' => 'Right',
|
@@ -235,11 +242,11 @@ class Ssb_Settings {
|
|
235 |
'priority' => '10',
|
236 |
),
|
237 |
array(
|
238 |
-
'name'
|
239 |
-
'label'
|
240 |
-
'type'
|
241 |
-
'default'
|
242 |
-
'options'
|
243 |
'no-animation' => 'No',
|
244 |
'bottom-in' => 'From bottom',
|
245 |
'top-in' => 'From top',
|
@@ -250,21 +257,22 @@ class Ssb_Settings {
|
|
250 |
'priority' => '15',
|
251 |
),
|
252 |
array(
|
253 |
-
'name'
|
254 |
-
'
|
255 |
-
'
|
|
|
256 |
'priority' => '20',
|
257 |
),
|
258 |
array(
|
259 |
-
'name'
|
260 |
-
'label'
|
261 |
-
'type'
|
262 |
'priority' => '25',
|
263 |
),
|
264 |
array(
|
265 |
-
'name'
|
266 |
-
'label'
|
267 |
-
'type'
|
268 |
'priority' => '30',
|
269 |
),
|
270 |
array(
|
@@ -272,73 +280,76 @@ class Ssb_Settings {
|
|
272 |
'type' => 'ssb_text',
|
273 |
'label' => 'Enter the Space in Pixel',
|
274 |
'sanitize_callback' => 'sanitize_text_field',
|
275 |
-
'priority'
|
276 |
),
|
277 |
array(
|
278 |
-
'name'
|
279 |
-
'label'
|
280 |
-
'type'
|
281 |
'priority' => '40',
|
282 |
),
|
283 |
array(
|
284 |
-
'name'
|
285 |
-
'label'
|
286 |
-
'type'
|
287 |
'priority' => '45',
|
288 |
),
|
289 |
array(
|
290 |
-
'name'
|
291 |
-
'label'
|
292 |
-
'type'
|
293 |
'priority' => '50',
|
294 |
|
295 |
),
|
296 |
array(
|
297 |
-
'name'
|
298 |
-
'label'
|
299 |
-
'type'
|
300 |
'priority' => '55',
|
301 |
),
|
302 |
array(
|
303 |
-
'name'
|
304 |
-
'label'
|
305 |
-
'type'
|
306 |
'priority' => '56',
|
307 |
),
|
308 |
array(
|
309 |
-
'name'
|
310 |
-
'label'
|
311 |
-
'type'
|
312 |
'priority' => '57',
|
313 |
),
|
314 |
array(
|
315 |
-
'name'
|
316 |
-
'label'
|
317 |
-
'desc'
|
318 |
-
'type'
|
319 |
-
'default'
|
320 |
-
|
|
|
|
|
|
|
321 |
'priority' => '99',
|
322 |
),
|
323 |
array(
|
324 |
-
'name'
|
325 |
-
'type'
|
326 |
-
'label'
|
327 |
-
'desc'
|
328 |
-
'link'
|
329 |
),
|
330 |
);
|
331 |
|
332 |
$ssb_inline = apply_filters( 'ssb_inline_fields', $ssb_inline );
|
333 |
|
334 |
$settings_fields = array(
|
335 |
-
'ssb_networks'
|
336 |
array(
|
337 |
'name' => 'icon_selection',
|
338 |
'type' => 'ssb_icon_selection',
|
339 |
-
)
|
340 |
),
|
341 |
-
'ssb_themes'
|
342 |
array(
|
343 |
'name' => 'icon_style',
|
344 |
'label' => __( 'Icon Style', 'simple-social-buttons' ),
|
@@ -365,36 +376,36 @@ class Ssb_Settings {
|
|
365 |
),
|
366 |
|
367 |
),
|
368 |
-
'ssb_sidebar'
|
369 |
-
'ssb_inline'
|
370 |
-
'ssb_media'
|
371 |
array(
|
372 |
-
'name'
|
373 |
-
'type'
|
374 |
-
'label'
|
375 |
-
'desc'
|
376 |
-
'link'
|
377 |
),
|
378 |
),
|
379 |
-
'ssb_popup'
|
380 |
array(
|
381 |
-
'name'
|
382 |
-
'type'
|
383 |
-
'label'
|
384 |
-
'desc'
|
385 |
-
'link'
|
386 |
),
|
387 |
),
|
388 |
-
'ssb_flyin'
|
389 |
array(
|
390 |
-
'name'
|
391 |
-
'type'
|
392 |
-
'label'
|
393 |
-
'desc'
|
394 |
-
'link'
|
395 |
),
|
396 |
),
|
397 |
-
'ssb_advanced'
|
398 |
array(
|
399 |
'name' => 'twitter_handle',
|
400 |
'type' => 'ssb_text',
|
@@ -402,14 +413,25 @@ class Ssb_Settings {
|
|
402 |
'sanitize_callback' => 'sanitize_text_field',
|
403 |
),
|
404 |
array(
|
405 |
-
'name'
|
406 |
-
'type'
|
407 |
-
'label'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
408 |
),
|
409 |
),
|
410 |
);
|
411 |
|
412 |
-
$settings_fields = apply_filters( 'ssb_setting_fields'
|
413 |
|
414 |
return $settings_fields;
|
415 |
}
|
@@ -429,7 +451,7 @@ class Ssb_Settings {
|
|
429 |
* @return array page names with key value pairs
|
430 |
*/
|
431 |
function get_pages() {
|
432 |
-
$pages
|
433 |
$pages_options = array();
|
434 |
if ( $pages ) {
|
435 |
foreach ( $pages as $page ) {
|
@@ -454,18 +476,18 @@ class Ssb_Settings {
|
|
454 |
|
455 |
include SSB_PLUGIN_DIR . 'classes/ssb-logs.php';
|
456 |
|
457 |
-
$html
|
458 |
$html .= '<h2>Help & Troubleshooting</h2>';
|
459 |
$html .= sprintf( __( 'Free support is available on the %1$s plugin support forums%2$s.', 'simple-social-buttons' ), '<a href="https://wordpress.org/support/plugin/simple-social-buttons" target="_blank">', '</a>' );
|
460 |
-
$html .=
|
461 |
$html .= sprintf( __( 'For premium features, add-ons and priority email support, %1$s upgrade to pro%2$s.', 'simple-social-buttons' ), '<a href="https://wpbrigade.com/wordpress/plugins/simple-social-buttons-pro/?utm_source=simple-social-buttons-lite&utm_medium=help-page&utm_campaign=pro-upgrade" target="_blank">', '</a>' );
|
462 |
-
$html .=
|
463 |
$html .= 'Found a bug or have a feature request? Please submit an issue <a href="https://wpbrigade.com/contact/" target="_blank">here</a>!';
|
464 |
$html .= '<pre><textarea rows="25" cols="75" readonly="readonly">';
|
465 |
$html .= Ssb_Logs_Info::get_sysinfo();
|
466 |
$html .= '</textarea></pre>';
|
467 |
$html .= '<input type="button" class="button simple-social-buttons-log-file" value="' . __( 'Download Log File', 'simple-social-buttons' ) . '"/>';
|
468 |
-
$html .= '<span class="ssb-log-file-sniper"><img src="'. admin_url( 'images/wpspin_light.gif' ) .'" /></span>';
|
469 |
$html .= '<span class="ssb-log-file-text">Simple Social Buttons Log File Downloaded Successfully!</span>';
|
470 |
$html .= '</div>';
|
471 |
echo $html;
|
@@ -527,22 +549,20 @@ class Ssb_Settings {
|
|
527 |
*/
|
528 |
public function import() {
|
529 |
|
530 |
-
|
531 |
check_ajax_referer( 'ssb-import-security-check', 'security' );
|
532 |
|
533 |
if ( ! current_user_can( 'manage_options' ) ) {
|
534 |
wp_die( 'error' );
|
535 |
}
|
536 |
|
537 |
-
$ssb_imp_tmp_name =
|
538 |
$ssb_file_content = file_get_contents( $ssb_imp_tmp_name );
|
539 |
-
$ssb_json
|
540 |
-
|
541 |
|
542 |
if ( json_last_error() == JSON_ERROR_NONE ) {
|
543 |
|
544 |
-
//Check ssb settings object set
|
545 |
-
if( ! isset( $ssb_json['ssb_settings_obj'] ) ){
|
546 |
wp_die( 'error' );
|
547 |
}
|
548 |
|
@@ -550,11 +570,11 @@ class Ssb_Settings {
|
|
550 |
|
551 |
foreach ( $ssb_json as $id => $array ) {
|
552 |
if ( strpos( $id, 'ssb_' ) !== false ) {
|
553 |
-
update_option($id, $array);
|
554 |
}
|
555 |
}
|
556 |
} else {
|
557 |
-
echo
|
558 |
}
|
559 |
wp_die();
|
560 |
}
|
9 |
|
10 |
function __construct() {
|
11 |
|
12 |
+
include_once SSB_PLUGIN_DIR . '/classes/ssb-settings-strucutre.php';
|
13 |
$this->settings_api = new Ssb_Settings_Structure();
|
14 |
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
15 |
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
91 |
return $setting_section;
|
92 |
}
|
93 |
|
94 |
+
public function sort_array( $a, $b ) {
|
95 |
return $a['priority'] - $b['priority'];
|
96 |
}
|
97 |
|
98 |
public function get_current_post_types() {
|
99 |
|
100 |
$post_types_list = array(
|
101 |
+
'home' => 'Home',
|
102 |
);
|
103 |
|
104 |
$args = array(
|
120 |
* @return array settings fields
|
121 |
*/
|
122 |
function get_settings_fields() {
|
123 |
+
$post_types = $this->get_current_post_types();
|
124 |
+
$ssb_positions_options = apply_filters(
|
125 |
+
'ssb_positions_options',
|
126 |
+
array(
|
127 |
+
'sidebar' => 'Sidebar',
|
128 |
+
'inline' => 'Inline',
|
129 |
+
'media' => 'Media',
|
130 |
+
'popup' => 'Popup',
|
131 |
+
'flyin' => 'Fly In',
|
132 |
+
)
|
133 |
+
);
|
134 |
|
135 |
$ssb_sidebar = array(
|
136 |
array(
|
137 |
+
'name' => 'orientation',
|
138 |
+
'label' => __( 'Sidebar Orientation', 'simple-social-buttons' ),
|
139 |
+
'desc' => __( '<h4>Display Settings</h4>', 'simple-social-buttons' ),
|
140 |
+
'type' => 'ssb_select',
|
141 |
+
'default' => 'left',
|
142 |
+
'options' => array(
|
143 |
'left' => 'Left',
|
144 |
'right' => 'Right',
|
145 |
),
|
146 |
'priority' => '5',
|
147 |
),
|
148 |
array(
|
149 |
+
'name' => 'animation',
|
150 |
+
'label' => __( 'Intro Animation', 'simple-social-buttons' ),
|
151 |
+
'type' => 'ssb_select',
|
152 |
+
'default' => 'no-animation',
|
153 |
+
'options' => array(
|
154 |
+
'no-animation' => 'No',
|
155 |
+
'right-in' => 'From Right',
|
156 |
+
'top-in' => 'From Top',
|
157 |
+
'bottom-in' => 'From Bottom',
|
158 |
+
'left-in' => 'From Left',
|
159 |
+
'fade-in' => 'FadeIn',
|
160 |
),
|
161 |
'priority' => '10',
|
162 |
),
|
163 |
array(
|
164 |
+
'name' => 'share_counts',
|
165 |
+
'help' => __( '<p id="share-count-message" > For Facebook share count you need to add Facebook App id and secret in Advance settings tab. <br> Also For Twitter share count you need to connect your site with <a href="https://www.twitcount.com" target="_blank">twitcount.com</a> </p>', 'simple-social-buttons' ),
|
166 |
+
'label' => __( 'Display Share Counts', 'simple-social-buttons' ),
|
167 |
+
'type' => 'ssb_checkbox',
|
168 |
'priority' => '15',
|
169 |
),
|
170 |
array(
|
171 |
+
'name' => 'total_share',
|
172 |
+
'label' => __( 'Display Total Shares', 'simple-social-buttons' ),
|
173 |
+
'type' => 'ssb_checkbox',
|
174 |
'priority' => '20',
|
175 |
),
|
176 |
array(
|
177 |
+
'name' => 'icon_space',
|
178 |
+
'label' => __( 'Add Icon Spacing', 'simple-social-buttons' ),
|
179 |
+
'type' => 'ssb_checkbox',
|
180 |
'priority' => '25',
|
181 |
),
|
182 |
array(
|
184 |
'type' => 'ssb_text',
|
185 |
'label' => 'Enter the Space in Pixel',
|
186 |
'sanitize_callback' => 'sanitize_text_field',
|
187 |
+
'priority' => '30',
|
188 |
),
|
189 |
array(
|
190 |
+
'name' => 'hide_mobile',
|
191 |
+
'label' => __( 'Hide On Mobile Devices', 'simple-social-buttons' ),
|
192 |
+
'type' => 'ssb_checkbox',
|
193 |
'priority' => '35',
|
194 |
),
|
195 |
array(
|
196 |
+
'name' => 'posts',
|
197 |
+
'label' => __( 'Post type Settings', 'simple-social-buttons' ),
|
198 |
+
'desc' => __( 'Multi checkbox description', 'simple-social-buttons' ),
|
199 |
+
'type' => 'ssb_post_types',
|
200 |
+
'default' => array(
|
201 |
+
'post' => 'post',
|
202 |
+
'page' => 'page',
|
203 |
+
),
|
204 |
+
'options' => $post_types,
|
205 |
'priority' => '99',
|
206 |
),
|
207 |
array(
|
208 |
+
'name' => 'go_pro',
|
209 |
+
'type' => 'ssb_go_pro',
|
210 |
+
'label' => __( 'Want even more fine tuned control over your Sidebar Social Buttons Styling?', 'simple-social-buttons' ),
|
211 |
+
'desc' => __( 'By upgrading to Simple Social Buttons Pro, you get access to Styling Social buttons of your own choice that matches with your website color schemes. These social buttons will help in driving more engagement and traffic to your site. Some of the Pro features include: Show Social media buttons on Images/Photos, Social Popups on exit/intent, Social Flyin slides and so much more!', 'simple-social-buttons' ),
|
212 |
+
'link' => 'http://www.WPBrigade.com/wordpress/plugins/simple-social-buttons-pro/?utm_source=simple-social-buttons-lite&utm_medium=settings-sidebar&utm_campaign=pro-upgrade',
|
213 |
),
|
214 |
);
|
215 |
|
216 |
+
$ssb_sidebar = apply_filters( 'ssb_sidebar_fields', $ssb_sidebar );
|
217 |
|
218 |
$ssb_inline = array(
|
219 |
array(
|
220 |
+
'name' => 'location',
|
221 |
+
'label' => __( 'Icon Position', 'simple-social-buttons' ),
|
222 |
+
'desc' => __( '<h4>Display Settings</h4>', 'simple-social-buttons' ),
|
223 |
+
'type' => 'ssb_select',
|
224 |
+
'default' => 'above',
|
225 |
+
'options' => array(
|
226 |
'above' => 'Above The Content',
|
227 |
'below' => 'Below The Content',
|
228 |
'above_below' => 'Above + Below The Content',
|
230 |
'priority' => '5',
|
231 |
),
|
232 |
array(
|
233 |
+
'name' => 'icon_alignment',
|
234 |
+
'label' => __( 'Icon Alignment', 'simple-social-buttons' ),
|
235 |
+
'type' => 'ssb_select',
|
236 |
+
'default' => 'left',
|
237 |
+
'options' => array(
|
238 |
'left' => 'Left',
|
239 |
'centered' => 'Centered',
|
240 |
'right' => 'Right',
|
242 |
'priority' => '10',
|
243 |
),
|
244 |
array(
|
245 |
+
'name' => 'animation',
|
246 |
+
'label' => __( 'Animation', 'simple-social-buttons' ),
|
247 |
+
'type' => 'ssb_select',
|
248 |
+
'default' => 'no-animation',
|
249 |
+
'options' => array(
|
250 |
'no-animation' => 'No',
|
251 |
'bottom-in' => 'From bottom',
|
252 |
'top-in' => 'From top',
|
257 |
'priority' => '15',
|
258 |
),
|
259 |
array(
|
260 |
+
'name' => 'share_counts',
|
261 |
+
'help' => __( '<p id="share-count-message" > For Facebook share count you need to add Facebook App id and secret in Advance settings tab. <br> Also For Twitter share count you need to connect your site with <a href="https://www.twitcount.com" target="_blank">twitcount.com</a> </p>', 'simple-social-buttons' ),
|
262 |
+
'label' => __( 'Display Share Counts', 'simple-social-buttons' ),
|
263 |
+
'type' => 'ssb_checkbox',
|
264 |
'priority' => '20',
|
265 |
),
|
266 |
array(
|
267 |
+
'name' => 'total_share',
|
268 |
+
'label' => __( 'Display Total Shares', 'simple-social-buttons' ),
|
269 |
+
'type' => 'ssb_checkbox',
|
270 |
'priority' => '25',
|
271 |
),
|
272 |
array(
|
273 |
+
'name' => 'icon_space',
|
274 |
+
'label' => __( 'Add Icon Spacing', 'simple-social-buttons' ),
|
275 |
+
'type' => 'ssb_checkbox',
|
276 |
'priority' => '30',
|
277 |
),
|
278 |
array(
|
280 |
'type' => 'ssb_text',
|
281 |
'label' => 'Enter the Space in Pixel',
|
282 |
'sanitize_callback' => 'sanitize_text_field',
|
283 |
+
'priority' => '35',
|
284 |
),
|
285 |
array(
|
286 |
+
'name' => 'hide_mobile',
|
287 |
+
'label' => __( 'Hide On Mobile Devices', 'simple-social-buttons' ),
|
288 |
+
'type' => 'ssb_checkbox',
|
289 |
'priority' => '40',
|
290 |
),
|
291 |
array(
|
292 |
+
'name' => 'show_on_category',
|
293 |
+
'label' => __( 'Show at Category pages', 'simple-social-buttons' ),
|
294 |
+
'type' => 'ssb_checkbox',
|
295 |
'priority' => '45',
|
296 |
),
|
297 |
array(
|
298 |
+
'name' => 'show_on_archive',
|
299 |
+
'label' => __( 'Show at Archive pages', 'simple-social-buttons' ),
|
300 |
+
'type' => 'ssb_checkbox',
|
301 |
'priority' => '50',
|
302 |
|
303 |
),
|
304 |
array(
|
305 |
+
'name' => 'show_on_tag',
|
306 |
+
'label' => __( 'Show at Tag pages', 'simple-social-buttons' ),
|
307 |
+
'type' => 'ssb_checkbox',
|
308 |
'priority' => '55',
|
309 |
),
|
310 |
array(
|
311 |
+
'name' => 'show_on_search',
|
312 |
+
'label' => __( 'Show at Search pages', 'simple-social-buttons' ),
|
313 |
+
'type' => 'ssb_checkbox',
|
314 |
'priority' => '56',
|
315 |
),
|
316 |
array(
|
317 |
+
'name' => 'share_title',
|
318 |
+
'label' => __( 'Share Title', 'simple-social-buttons' ),
|
319 |
+
'type' => 'ssb_text',
|
320 |
'priority' => '57',
|
321 |
),
|
322 |
array(
|
323 |
+
'name' => 'posts',
|
324 |
+
'label' => __( 'Post type Settings', 'simple-social-buttons' ),
|
325 |
+
'desc' => __( 'Multi checkbox description', 'simple-social-buttons' ),
|
326 |
+
'type' => 'ssb_post_types',
|
327 |
+
'default' => array(
|
328 |
+
'post' => 'post',
|
329 |
+
'page' => 'page',
|
330 |
+
),
|
331 |
+
'options' => $post_types,
|
332 |
'priority' => '99',
|
333 |
),
|
334 |
array(
|
335 |
+
'name' => 'go_pro',
|
336 |
+
'type' => 'ssb_go_pro',
|
337 |
+
'label' => __( 'Want to style the Inline Social buttons matches your theme colors?', 'simple-social-buttons' ),
|
338 |
+
'desc' => __( 'By upgrading to Simple Social Buttons Pro, you get access to Styling Social buttons of your own choice that matches with your website color schemes. These social buttons will help in driving more engagement and traffic to your site. Some of the Pro features include: Show Social media buttons on Images/Photos, Social Popups on exit/intent, Social Flyin slides and so much more!', 'simple-social-buttons' ),
|
339 |
+
'link' => 'http://www.WPBrigade.com/wordpress/plugins/simple-social-buttons-pro/?utm_source=simple-social-buttons-lite&utm_medium=settings-inline&utm_campaign=pro-upgrade',
|
340 |
),
|
341 |
);
|
342 |
|
343 |
$ssb_inline = apply_filters( 'ssb_inline_fields', $ssb_inline );
|
344 |
|
345 |
$settings_fields = array(
|
346 |
+
'ssb_networks' => array(
|
347 |
array(
|
348 |
'name' => 'icon_selection',
|
349 |
'type' => 'ssb_icon_selection',
|
350 |
+
),
|
351 |
),
|
352 |
+
'ssb_themes' => array(
|
353 |
array(
|
354 |
'name' => 'icon_style',
|
355 |
'label' => __( 'Icon Style', 'simple-social-buttons' ),
|
376 |
),
|
377 |
|
378 |
),
|
379 |
+
'ssb_sidebar' => $ssb_sidebar,
|
380 |
+
'ssb_inline' => $ssb_inline,
|
381 |
+
'ssb_media' => array(
|
382 |
array(
|
383 |
+
'name' => 'go_pro',
|
384 |
+
'type' => 'ssb_go_pro',
|
385 |
+
'label' => __( 'Show Social Sharing buttons on images or photos in your posts/pages.', 'simple-social-buttons' ),
|
386 |
+
'desc' => __( 'By upgrading to Simple Social Buttons Pro, you get access to Styling Social buttons of your own choice that matches with your website color schemes. These social buttons will help in driving more engagement and traffic to your site. Some of the Pro features include: Show Social media buttons on Images/Photos, Social Popups on exit/intent, Social Flyin slides and so much more!', 'simple-social-buttons' ),
|
387 |
+
'link' => 'http://www.WPBrigade.com/wordpress/plugins/simple-social-buttons-pro/?utm_source=simple-social-buttons-lite&utm_medium=settings-media&utm_campaign=pro-upgrade',
|
388 |
),
|
389 |
),
|
390 |
+
'ssb_popup' => array(
|
391 |
array(
|
392 |
+
'name' => 'go_pro',
|
393 |
+
'type' => 'ssb_go_pro',
|
394 |
+
'label' => __( 'Get more engagement and shares on scrolling and exit intent to visitors.', 'simple-social-buttons' ),
|
395 |
+
'desc' => __( 'By upgrading to Simple Social Buttons Pro, you get access to Styling Social buttons of your own choice that matches with your website color schemes. These social buttons will help in driving more engagement and traffic to your site. Some of the Pro features include: Show Social media buttons on Images/Photos, Social Popups on exit/intent, Social Flyin slides and so much more!', 'simple-social-buttons' ),
|
396 |
+
'link' => 'http://www.WPBrigade.com/wordpress/plugins/simple-social-buttons-pro/?utm_source=simple-social-buttons-lite&utm_medium=settings-popup&utm_campaign=pro-upgrade',
|
397 |
),
|
398 |
),
|
399 |
+
'ssb_flyin' => array(
|
400 |
array(
|
401 |
+
'name' => 'go_pro',
|
402 |
+
'type' => 'ssb_go_pro',
|
403 |
+
'label' => __( 'Advanced Fly ins with animations to have more Social shares.', 'simple-social-buttons' ),
|
404 |
+
'desc' => __( 'By upgrading to Simple Social Buttons Pro, you get access to Styling Social buttons of your own choice that matches with your website color schemes. These social buttons will help in driving more engagement and traffic to your site. Some of the Pro features include: Show Social media buttons on Images/Photos, Social Popups on exit/intent, Social Flyin slides and so much more!', 'simple-social-buttons' ),
|
405 |
+
'link' => 'http://www.WPBrigade.com/wordpress/plugins/simple-social-buttons-pro/?utm_source=simple-social-buttons-lite&utm_medium=settings-flyin&utm_campaign=pro-upgrade',
|
406 |
),
|
407 |
),
|
408 |
+
'ssb_advanced' => array(
|
409 |
array(
|
410 |
'name' => 'twitter_handle',
|
411 |
'type' => 'ssb_text',
|
413 |
'sanitize_callback' => 'sanitize_text_field',
|
414 |
),
|
415 |
array(
|
416 |
+
'name' => 'http_https_resolve',
|
417 |
+
'type' => 'ssb_checkbox',
|
418 |
+
'label' => __( 'Http/Https counts resolve:', 'simple-social-buttons' ),
|
419 |
+
),
|
420 |
+
array(
|
421 |
+
'name' => 'facebook_app_id',
|
422 |
+
'desc' => '<h4> Facebook App</h4><a href="https://wpbrigade.com/how-to-create-facebook-app-and-get-app-id-and-secret/" target="_blank">how to make App</a>',
|
423 |
+
'type' => 'ssb_text',
|
424 |
+
'label' => __( 'Facebook App ID:', 'simple-social-buttons' ),
|
425 |
+
),
|
426 |
+
array(
|
427 |
+
'name' => 'facebook_app_secret',
|
428 |
+
'type' => 'ssb_text',
|
429 |
+
'label' => __( 'Facebook App Secret:', 'simple-social-buttons' ),
|
430 |
),
|
431 |
),
|
432 |
);
|
433 |
|
434 |
+
$settings_fields = apply_filters( 'ssb_setting_fields', $settings_fields, $post_types );
|
435 |
|
436 |
return $settings_fields;
|
437 |
}
|
451 |
* @return array page names with key value pairs
|
452 |
*/
|
453 |
function get_pages() {
|
454 |
+
$pages = get_pages();
|
455 |
$pages_options = array();
|
456 |
if ( $pages ) {
|
457 |
foreach ( $pages as $page ) {
|
476 |
|
477 |
include SSB_PLUGIN_DIR . 'classes/ssb-logs.php';
|
478 |
|
479 |
+
$html = '<div class="simple-social-buttons-help-page">';
|
480 |
$html .= '<h2>Help & Troubleshooting</h2>';
|
481 |
$html .= sprintf( __( 'Free support is available on the %1$s plugin support forums%2$s.', 'simple-social-buttons' ), '<a href="https://wordpress.org/support/plugin/simple-social-buttons" target="_blank">', '</a>' );
|
482 |
+
$html .= '<br /><br />';
|
483 |
$html .= sprintf( __( 'For premium features, add-ons and priority email support, %1$s upgrade to pro%2$s.', 'simple-social-buttons' ), '<a href="https://wpbrigade.com/wordpress/plugins/simple-social-buttons-pro/?utm_source=simple-social-buttons-lite&utm_medium=help-page&utm_campaign=pro-upgrade" target="_blank">', '</a>' );
|
484 |
+
$html .= '<br /><br />';
|
485 |
$html .= 'Found a bug or have a feature request? Please submit an issue <a href="https://wpbrigade.com/contact/" target="_blank">here</a>!';
|
486 |
$html .= '<pre><textarea rows="25" cols="75" readonly="readonly">';
|
487 |
$html .= Ssb_Logs_Info::get_sysinfo();
|
488 |
$html .= '</textarea></pre>';
|
489 |
$html .= '<input type="button" class="button simple-social-buttons-log-file" value="' . __( 'Download Log File', 'simple-social-buttons' ) . '"/>';
|
490 |
+
$html .= '<span class="ssb-log-file-sniper"><img src="' . admin_url( 'images/wpspin_light.gif' ) . '" /></span>';
|
491 |
$html .= '<span class="ssb-log-file-text">Simple Social Buttons Log File Downloaded Successfully!</span>';
|
492 |
$html .= '</div>';
|
493 |
echo $html;
|
549 |
*/
|
550 |
public function import() {
|
551 |
|
|
|
552 |
check_ajax_referer( 'ssb-import-security-check', 'security' );
|
553 |
|
554 |
if ( ! current_user_can( 'manage_options' ) ) {
|
555 |
wp_die( 'error' );
|
556 |
}
|
557 |
|
558 |
+
$ssb_imp_tmp_name = $_FILES['file']['tmp_name'];
|
559 |
$ssb_file_content = file_get_contents( $ssb_imp_tmp_name );
|
560 |
+
$ssb_json = json_decode( $ssb_file_content, true );
|
|
|
561 |
|
562 |
if ( json_last_error() == JSON_ERROR_NONE ) {
|
563 |
|
564 |
+
// Check ssb settings object set
|
565 |
+
if ( ! isset( $ssb_json['ssb_settings_obj'] ) ) {
|
566 |
wp_die( 'error' );
|
567 |
}
|
568 |
|
570 |
|
571 |
foreach ( $ssb_json as $id => $array ) {
|
572 |
if ( strpos( $id, 'ssb_' ) !== false ) {
|
573 |
+
update_option( $id, $array );
|
574 |
}
|
575 |
}
|
576 |
} else {
|
577 |
+
echo 'error';
|
578 |
}
|
579 |
wp_die();
|
580 |
}
|
inc/utils.php
CHANGED
@@ -281,7 +281,7 @@ function ssb_fetch_shares_via_curl_multi( $data, $options = array() ) {
|
|
281 |
*/
|
282 |
function ssb_whats_app_share_link( $url ){
|
283 |
$whats_share_link = '';
|
284 |
-
if(
|
285 |
$whats_share_link = 'https://api.whatsapp.com/send?text=' . $url;
|
286 |
} else {
|
287 |
$whats_share_link = 'https://web.whatsapp.com/send?text=' . $url;
|
281 |
*/
|
282 |
function ssb_whats_app_share_link( $url ){
|
283 |
$whats_share_link = '';
|
284 |
+
if( wp_is_mobile() ){
|
285 |
$whats_share_link = 'https://api.whatsapp.com/send?text=' . $url;
|
286 |
} else {
|
287 |
$whats_share_link = 'https://web.whatsapp.com/send?text=' . $url;
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: hiddenpearls, WPBrigade
|
|
3 |
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: 5.
|
7 |
-
Stable tag: 2.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -146,13 +146,16 @@ like_button_size = small(default), large
|
|
146 |
|
147 |
== Upgrade Notice ==
|
148 |
|
149 |
-
= 2.1.
|
150 |
* Please upgrade immediately. Bug fixes and improvements.
|
151 |
|
152 |
== Changelog ==
|
|
|
|
|
|
|
153 |
|
154 |
= 2.1.0 - 2019-04-15 =
|
155 |
-
*
|
156 |
* Bug Fix: Undefined index in facebook link share function
|
157 |
* Bug Fix: Widget Count api big fixes
|
158 |
|
@@ -171,7 +174,7 @@ like_button_size = small(default), large
|
|
171 |
* Bug Fix: Add Compatibility of mb_convert_encoding() function.
|
172 |
|
173 |
= 2.0.19 - 2018-09-13 =
|
174 |
-
*
|
175 |
|
176 |
= 2.0.18 - 2018-09-13 =
|
177 |
* Bug Fix: Above the content network excerpt issue.
|
@@ -181,7 +184,7 @@ like_button_size = small(default), large
|
|
181 |
* Enhancement: Getting Facebook share count algorithm.
|
182 |
|
183 |
= 2.0.16 - 2018-07-09 =
|
184 |
-
*
|
185 |
* Bug Fix: Illegal offset string.
|
186 |
* Bug Fix: Reddit Api Invalid argument supplied for foreach()
|
187 |
|
@@ -198,14 +201,14 @@ like_button_size = small(default), large
|
|
198 |
* Bug Fix: Google+ Widget error.
|
199 |
* Bug Fix: Illegal offset fix.
|
200 |
* Bug Fix: Shortcode issue on homepage.
|
201 |
-
*
|
202 |
-
*
|
203 |
|
204 |
= 2.0.12 - 2018-03-12 =
|
205 |
* New Feature: Add WhatsApp in Widget.
|
206 |
* New Feature: Fetch old stats after SSL.
|
207 |
* Bug Fix: HTML markup fix.
|
208 |
-
*
|
209 |
|
210 |
= 2.0.11 - 2018-02-27 =
|
211 |
* New Feature: Add Instagram on Widget.
|
@@ -216,9 +219,9 @@ like_button_size = small(default), large
|
|
216 |
= 2.0.10 - 2018-02-08 =
|
217 |
* New Feature: Add Facebook Messenger Share.
|
218 |
* New Feature: Twitter Card meta added.
|
219 |
-
*
|
220 |
-
*
|
221 |
-
*
|
222 |
|
223 |
= 2.0.9 - 2018-01-27 =
|
224 |
* Bug Fix: Facebook share - meta tags.
|
3 |
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: 5.1
|
7 |
+
Stable tag: 2.1.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
146 |
|
147 |
== Upgrade Notice ==
|
148 |
|
149 |
+
= 2.1.1 =
|
150 |
* Please upgrade immediately. Bug fixes and improvements.
|
151 |
|
152 |
== Changelog ==
|
153 |
+
= 2.1.1 - 2019-04-30 =
|
154 |
+
* Enhancement: Facebook share count Api deprecation fix
|
155 |
+
* Enhancement: WhatsApp Wrong link generator fix
|
156 |
|
157 |
= 2.1.0 - 2019-04-15 =
|
158 |
+
* Enhancement: Whats App share link detection mobile and desktop
|
159 |
* Bug Fix: Undefined index in facebook link share function
|
160 |
* Bug Fix: Widget Count api big fixes
|
161 |
|
174 |
* Bug Fix: Add Compatibility of mb_convert_encoding() function.
|
175 |
|
176 |
= 2.0.19 - 2018-09-13 =
|
177 |
+
* Enhancement: Warning: DOMDocument::loadHTML(): htmlParseEntityRef: no name in Entity
|
178 |
|
179 |
= 2.0.18 - 2018-09-13 =
|
180 |
* Bug Fix: Above the content network excerpt issue.
|
184 |
* Enhancement: Getting Facebook share count algorithm.
|
185 |
|
186 |
= 2.0.16 - 2018-07-09 =
|
187 |
+
* Enhancement: Like button size parameter added in short code.
|
188 |
* Bug Fix: Illegal offset string.
|
189 |
* Bug Fix: Reddit Api Invalid argument supplied for foreach()
|
190 |
|
201 |
* Bug Fix: Google+ Widget error.
|
202 |
* Bug Fix: Illegal offset fix.
|
203 |
* Bug Fix: Shortcode issue on homepage.
|
204 |
+
* Enhancement: Open Fb messenger native app on mobile.
|
205 |
+
* Enhancement: Old counts.
|
206 |
|
207 |
= 2.0.12 - 2018-03-12 =
|
208 |
* New Feature: Add WhatsApp in Widget.
|
209 |
* New Feature: Fetch old stats after SSL.
|
210 |
* Bug Fix: HTML markup fix.
|
211 |
+
* Enhancement: RTL support.
|
212 |
|
213 |
= 2.0.11 - 2018-02-27 =
|
214 |
* New Feature: Add Instagram on Widget.
|
219 |
= 2.0.10 - 2018-02-08 =
|
220 |
* New Feature: Add Facebook Messenger Share.
|
221 |
* New Feature: Twitter Card meta added.
|
222 |
+
* Enhancement: Add rel="noopener" on widget links.
|
223 |
+
* Enhancement: Add Image in Open Graph Meta.
|
224 |
+
* Enhancement: Remove extra text form WhatsApp & Viber.
|
225 |
|
226 |
= 2.0.9 - 2018-01-27 =
|
227 |
* Bug Fix: Facebook share - meta tags.
|
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.1.
|
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.1.
|
34 |
public $pluginPrefix = 'ssb_pr_';
|
35 |
public $hideCustomMetaKey = '_ssb_hide';
|
36 |
private $fb_app_id = '891268654262273';
|
@@ -113,7 +113,7 @@ class SimpleSocialButtonsPR {
|
|
113 |
add_action( 'wp_footer', array( $this, 'include_sidebar' ) );
|
114 |
add_action( 'wp_head', array( $this, 'css_file' ) );
|
115 |
|
116 |
-
//
|
117 |
add_action( 'admin_init', array( $this, 'review_update_notice' ) );
|
118 |
add_action( 'wp_footer', array( $this, 'fblike_script' ) );
|
119 |
|
@@ -246,7 +246,7 @@ class SimpleSocialButtonsPR {
|
|
246 |
document.addEventListener("DOMContentLoaded", function() {
|
247 |
var if_ssb_exist = document.getElementsByClassName( "simplesocialbuttons" ).length > 0;
|
248 |
if (if_ssb_exist) {
|
249 |
-
|
250 |
}
|
251 |
});
|
252 |
|
@@ -797,7 +797,7 @@ class SimpleSocialButtonsPR {
|
|
797 |
</button>';
|
798 |
} else {
|
799 |
|
800 |
-
$arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_blank\' );return false;" class="simplesocial-whatsapp-share" data-href="
|
801 |
}
|
802 |
break;
|
803 |
case 'viber':
|
@@ -1401,13 +1401,13 @@ class SimpleSocialButtonsPR {
|
|
1401 |
break;
|
1402 |
case 'whatsapp':
|
1403 |
if ( $this->selected_theme == 'simple-icons' ) {
|
1404 |
-
$arrButtonsCode[] = ' <button onclick="javascript:window.open(this.dataset.href, \'_blank\' );return false;" class="simplesocial-whatsapp-share ssb_whatsapp-icon" data-href="
|
1405 |
<span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 90 90" style="enable-background:new 0 0 90 90;" xml:space="preserve" class=""><g><g> <path id="WhatsApp" d="M90,43.841c0,24.213-19.779,43.841-44.182,43.841c-7.747,0-15.025-1.98-21.357-5.455L0,90l7.975-23.522 c-4.023-6.606-6.34-14.354-6.34-22.637C1.635,19.628,21.416,0,45.818,0C70.223,0,90,19.628,90,43.841z M45.818,6.982 c-20.484,0-37.146,16.535-37.146,36.859c0,8.065,2.629,15.534,7.076,21.61L11.107,79.14l14.275-4.537 c5.865,3.851,12.891,6.097,20.437,6.097c20.481,0,37.146-16.533,37.146-36.857S66.301,6.982,45.818,6.982z M68.129,53.938 c-0.273-0.447-0.994-0.717-2.076-1.254c-1.084-0.537-6.41-3.138-7.4-3.495c-0.993-0.358-1.717-0.538-2.438,0.537 c-0.721,1.076-2.797,3.495-3.43,4.212c-0.632,0.719-1.263,0.809-2.347,0.271c-1.082-0.537-4.571-1.673-8.708-5.333 c-3.219-2.848-5.393-6.364-6.025-7.441c-0.631-1.075-0.066-1.656,0.475-2.191c0.488-0.482,1.084-1.255,1.625-1.882 c0.543-0.628,0.723-1.075,1.082-1.793c0.363-0.717,0.182-1.344-0.09-1.883c-0.27-0.537-2.438-5.825-3.34-7.977 c-0.902-2.15-1.803-1.792-2.436-1.792c-0.631,0-1.354-0.09-2.076-0.09c-0.722,0-1.896,0.269-2.889,1.344 c-0.992,1.076-3.789,3.676-3.789,8.963c0,5.288,3.879,10.397,4.422,11.113c0.541,0.716,7.49,11.92,18.5,16.223 C58.2,65.771,58.2,64.336,60.186,64.156c1.984-0.179,6.406-2.599,7.312-5.107C68.398,56.537,68.398,54.386,68.129,53.938z"/> </g></g> </svg> </span>
|
1406 |
<span class="simplesocialtxt">Whatsapp</span>
|
1407 |
</button>';
|
1408 |
} else {
|
1409 |
|
1410 |
-
$arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_blank\' );return false;" class="simplesocial-whatsapp-share" data-href="
|
1411 |
}
|
1412 |
break;
|
1413 |
|
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.1.1
|
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.1.1';
|
34 |
public $pluginPrefix = 'ssb_pr_';
|
35 |
public $hideCustomMetaKey = '_ssb_hide';
|
36 |
private $fb_app_id = '891268654262273';
|
113 |
add_action( 'wp_footer', array( $this, 'include_sidebar' ) );
|
114 |
add_action( 'wp_head', array( $this, 'css_file' ) );
|
115 |
|
116 |
+
//add_action( 'admin_notices', array( $this, 'update_notice' ) );
|
117 |
add_action( 'admin_init', array( $this, 'review_update_notice' ) );
|
118 |
add_action( 'wp_footer', array( $this, 'fblike_script' ) );
|
119 |
|
246 |
document.addEventListener("DOMContentLoaded", function() {
|
247 |
var if_ssb_exist = document.getElementsByClassName( "simplesocialbuttons" ).length > 0;
|
248 |
if (if_ssb_exist) {
|
249 |
+
// ssbPlugin.fetchFacebookShares();
|
250 |
}
|
251 |
});
|
252 |
|
797 |
</button>';
|
798 |
} else {
|
799 |
|
800 |
+
$arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_blank\' );return false;" class="simplesocial-whatsapp-share" data-href="' . ssb_whats_app_share_link( $permalink ) . '"><span class="simplesocialtxt">WhatsApp</span></button>';
|
801 |
}
|
802 |
break;
|
803 |
case 'viber':
|
1401 |
break;
|
1402 |
case 'whatsapp':
|
1403 |
if ( $this->selected_theme == 'simple-icons' ) {
|
1404 |
+
$arrButtonsCode[] = ' <button onclick="javascript:window.open(this.dataset.href, \'_blank\' );return false;" class="simplesocial-whatsapp-share ssb_whatsapp-icon" data-href="=' . ssb_whats_app_share_link( $permalink ) . '"><span class="simplesocialtxt">
|
1405 |
<span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 90 90" style="enable-background:new 0 0 90 90;" xml:space="preserve" class=""><g><g> <path id="WhatsApp" d="M90,43.841c0,24.213-19.779,43.841-44.182,43.841c-7.747,0-15.025-1.98-21.357-5.455L0,90l7.975-23.522 c-4.023-6.606-6.34-14.354-6.34-22.637C1.635,19.628,21.416,0,45.818,0C70.223,0,90,19.628,90,43.841z M45.818,6.982 c-20.484,0-37.146,16.535-37.146,36.859c0,8.065,2.629,15.534,7.076,21.61L11.107,79.14l14.275-4.537 c5.865,3.851,12.891,6.097,20.437,6.097c20.481,0,37.146-16.533,37.146-36.857S66.301,6.982,45.818,6.982z M68.129,53.938 c-0.273-0.447-0.994-0.717-2.076-1.254c-1.084-0.537-6.41-3.138-7.4-3.495c-0.993-0.358-1.717-0.538-2.438,0.537 c-0.721,1.076-2.797,3.495-3.43,4.212c-0.632,0.719-1.263,0.809-2.347,0.271c-1.082-0.537-4.571-1.673-8.708-5.333 c-3.219-2.848-5.393-6.364-6.025-7.441c-0.631-1.075-0.066-1.656,0.475-2.191c0.488-0.482,1.084-1.255,1.625-1.882 c0.543-0.628,0.723-1.075,1.082-1.793c0.363-0.717,0.182-1.344-0.09-1.883c-0.27-0.537-2.438-5.825-3.34-7.977 c-0.902-2.15-1.803-1.792-2.436-1.792c-0.631,0-1.354-0.09-2.076-0.09c-0.722,0-1.896,0.269-2.889,1.344 c-0.992,1.076-3.789,3.676-3.789,8.963c0,5.288,3.879,10.397,4.422,11.113c0.541,0.716,7.49,11.92,18.5,16.223 C58.2,65.771,58.2,64.336,60.186,64.156c1.984-0.179,6.406-2.599,7.312-5.107C68.398,56.537,68.398,54.386,68.129,53.938z"/> </g></g> </svg> </span>
|
1406 |
<span class="simplesocialtxt">Whatsapp</span>
|
1407 |
</button>';
|
1408 |
} else {
|
1409 |
|
1410 |
+
$arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_blank\' );return false;" class="simplesocial-whatsapp-share" data-href="' . ssb_whats_app_share_link( $permalink ) . '"><span class="simplesocialtxt">WhatsApp</span></button>';
|
1411 |
}
|
1412 |
break;
|
1413 |
|
ssb-social-counts/facebook.php
CHANGED
@@ -2,16 +2,24 @@
|
|
2 |
|
3 |
|
4 |
function ssb_format_fbshare_response( $response ) {
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
$
|
|
|
|
|
|
|
11 |
return $total;
|
12 |
}
|
13 |
|
|
|
14 |
function ssb_fbshare_generate_link( $url ) {
|
15 |
-
|
|
|
|
|
|
|
|
|
16 |
return $link;
|
17 |
}
|
2 |
|
3 |
|
4 |
function ssb_format_fbshare_response( $response ) {
|
5 |
+
$formatted_response = json_decode( $response, true );
|
6 |
+
// Facebook share count check.
|
7 |
+
if ( ! isset( $formatted_response['engagement'] ) ) {
|
8 |
+
return 0;
|
9 |
+
}
|
10 |
+
$reaction = isset( $formatted_response['engagement']['reaction_count'] ) ? $formatted_response['engagement']['reaction_count'] : 0;
|
11 |
+
$comments = isset( $formatted_response['engagement']['comment_count'] ) ? $formatted_response['engagement']['comment_count'] : 0;
|
12 |
+
$shares = isset( $formatted_response['engagement']['share_count'] ) ? $formatted_response['engagement']['share_count'] : 0;
|
13 |
+
$total = $reaction + $comments + $shares;
|
14 |
return $total;
|
15 |
}
|
16 |
|
17 |
+
|
18 |
function ssb_fbshare_generate_link( $url ) {
|
19 |
+
global $_ssb_pr;
|
20 |
+
$advance_settings = $_ssb_pr->extra_option;
|
21 |
+
$facebook_app_id = isset( $advance_settings['facebook_app_id'] ) ? $advance_settings['facebook_app_id'] : '';
|
22 |
+
$facebook_secret_key = isset( $advance_settings['facebook_app_secret'] ) ? $advance_settings['facebook_app_secret'] : '';
|
23 |
+
$link = "https://graph.facebook.com/v3.0/?id={$url}&fields=engagement&access_token={$facebook_app_id}|{$facebook_secret_key}";
|
24 |
return $link;
|
25 |
}
|