WP Socializer - Version 5.2

Version Description

  • New: Support for shortcodes in custom HTML.
  • New: Separate share URLs for desktop and mobile which enables support for app linking.
  • Fix: Major changes to the internal metadata system.
  • Fix: Made FontAwesome 5 as the default font icon system.
Download this release

Release Info

Developer vaakash
Plugin Icon 128x128 WP Socializer
Version 5.2
Comparing to
See all releases

Code changes from version 5.1 to 5.2

admin/css/style.css CHANGED
@@ -1564,7 +1564,7 @@ select[name="ft_status"]{
1564
  /** Promo **/
1565
 
1566
  .coffee_box h2{
1567
- background-color: #5fab07;
1568
  color: #fff;
1569
  }
1570
  .coffee_box .coffee_amt {
@@ -1582,10 +1582,7 @@ select[name="ft_status"]{
1582
  width: 100%;
1583
  }
1584
 
1585
- .ufw h2{
1586
- background-color: #4a81d1;
1587
- color: #fff;
1588
- }
1589
  .ufw h2 i{
1590
  color: #FF5722;
1591
  }
1564
  /** Promo **/
1565
 
1566
  .coffee_box h2{
1567
+ background-color: #762e15;
1568
  color: #fff;
1569
  }
1570
  .coffee_box .coffee_amt {
1582
  width: 100%;
1583
  }
1584
 
1585
+
 
 
 
1586
  .ufw h2 i{
1587
  color: #FF5722;
1588
  }
admin/icons_editor.php CHANGED
@@ -153,7 +153,7 @@ class WPSR_Icons_Editor{
153
  'html' => array(
154
  'type' => 'textarea',
155
  'helper' => __( 'Custom HTML', 'wpsr' ),
156
- 'placeholder' => __( 'Enter custom HTML to occur. You can use the parameters <code>{url}</code> and <code>{title}</code> to replace them with the current page URL and title respectively.<br/><strong>Note:</strong> For any formatting issues, please use custom CSS to adjust the output as required.', 'wpsr' )
157
  )
158
  );
159
 
153
  'html' => array(
154
  'type' => 'textarea',
155
  'helper' => __( 'Custom HTML', 'wpsr' ),
156
+ 'placeholder' => __( 'Enter custom HTML to occur. You can use the parameters <code>{url}</code> and <code>{title}</code> to replace them with the current page URL and title respectively. Shortcodes can also be used here.<br/><strong>Note:</strong> For any formatting issues, please use custom CSS to adjust the output as required.', 'wpsr' )
157
  )
158
  );
159
 
admin/social_icons.php CHANGED
@@ -209,7 +209,8 @@ class wpsr_admin_social_icons{
209
  'name' => 'tmpl[' . $i . '][custom_html_below]',
210
  'value' => $values[ 'tmpl' ][ $i ][ 'custom_html_below' ],
211
  'class' => '',
212
- 'placeholder' => 'Below'
 
213
  ))),
214
 
215
  );
209
  'name' => 'tmpl[' . $i . '][custom_html_below]',
210
  'value' => $values[ 'tmpl' ][ $i ][ 'custom_html_below' ],
211
  'class' => '',
212
+ 'placeholder' => 'Below',
213
+ 'helper' => 'Supports any HTML and shortcodes'
214
  ))),
215
 
216
  );
core/lists.php CHANGED
@@ -169,8 +169,7 @@ class WPSR_Lists{
169
  'name' => 'Comments',
170
  'title' => __('', 'wpsr') . 'Comments',
171
  'icon' => array('fa4'=> 'fa fa-comment', 'fa5' => 'fa fa-comments'),
172
- 'link' => '#',
173
- 'onclick' => 'document.querySelector(\'' . $g_settings[ 'sb_comment_sec' ] . '\').scrollIntoView(true);',
174
  'options' => array(),
175
  'features' => array( 'internal', 'for_tsb' ),
176
  'colors' => array( '#333' ),
@@ -179,7 +178,7 @@ class WPSR_Lists{
179
  'delicious' => array(
180
  'name' => 'Delicious',
181
  'title' => __('Post this on ', 'wpsr') . 'Delicious',
182
- 'icon' => array('fa4'=> 'fa fa-delicous', 'fa5' => 'fab fa-delicious'),
183
  'link' => 'https://delicious.com/post?url={url}&title={title}&notes={excerpt}',
184
  'options' => array(),
185
  'features' => array( 'for_share' ),
@@ -252,7 +251,8 @@ class WPSR_Lists{
252
  'name' => 'Facebook messenger',
253
  'title' => __('', 'wpsr') . 'Facebook messenger',
254
  'icon' => array('fa4'=> 'fa fa-comment', 'fa5' => 'fab fa-facebook-messenger'),
255
- 'link' => 'fb-messenger://share?link={url}',
 
256
  'options' => array(),
257
  'features' => array( 'mobile_only', 'for_share' ),
258
  'colors' => array( '#2998ff' ),
@@ -472,7 +472,7 @@ class WPSR_Lists{
472
  'name' => 'Short link',
473
  'title' => __('', 'wpsr') . 'Short link',
474
  'icon' => array('fa4'=> 'fa fa-link', 'fa5' => 'fa fa-link'),
475
- 'link' => '{s-url}',
476
  'onclick' => 'socializer_shortlink( event, this )',
477
  'options' => array(),
478
  'features' => array( 'internal', 'requires_js', 'for_share' ),
@@ -617,6 +617,7 @@ class WPSR_Lists{
617
  'icon' => array('fa4'=> 'fa fa-whatsapp', 'fa5' => 'fab fa-whatsapp'),
618
  'link' => 'https://api.whatsapp.com/send?text={title}%20{url}',
619
  'link_tsb' => 'https://api.whatsapp.com/send?text={excerpt}%20{url}',
 
620
  'options' => array(),
621
  'features' => array( 'for_share', 'for_tsb' ),
622
  'colors' => array( '#60b82d' ),
@@ -906,7 +907,7 @@ class WPSR_Lists{
906
 
907
  if( $page == 'gsettings_misc' ){
908
  return array(
909
- 'font_icon' => 'fa4',
910
  'misc_additional_css' => '',
911
  'skip_res_load' => ''
912
  );
169
  'name' => 'Comments',
170
  'title' => __('', 'wpsr') . 'Comments',
171
  'icon' => array('fa4'=> 'fa fa-comment', 'fa5' => 'fa fa-comments'),
172
+ 'link' => '#{comments-section}',
 
173
  'options' => array(),
174
  'features' => array( 'internal', 'for_tsb' ),
175
  'colors' => array( '#333' ),
178
  'delicious' => array(
179
  'name' => 'Delicious',
180
  'title' => __('Post this on ', 'wpsr') . 'Delicious',
181
+ 'icon' => array('fa4'=> 'fa fa-delicious', 'fa5' => 'fab fa-delicious'),
182
  'link' => 'https://delicious.com/post?url={url}&title={title}&notes={excerpt}',
183
  'options' => array(),
184
  'features' => array( 'for_share' ),
251
  'name' => 'Facebook messenger',
252
  'title' => __('', 'wpsr') . 'Facebook messenger',
253
  'icon' => array('fa4'=> 'fa fa-comment', 'fa5' => 'fab fa-facebook-messenger'),
254
+ 'link' => 'https://www.facebook.com/dialog/send?app_id={fb-app-id}&link={url}&redirect_uri={url}',
255
+ 'link_mobile' => 'fb-messenger://share?link={url}',
256
  'options' => array(),
257
  'features' => array( 'mobile_only', 'for_share' ),
258
  'colors' => array( '#2998ff' ),
472
  'name' => 'Short link',
473
  'title' => __('', 'wpsr') . 'Short link',
474
  'icon' => array('fa4'=> 'fa fa-link', 'fa5' => 'fa fa-link'),
475
+ 'link' => '{short-url}',
476
  'onclick' => 'socializer_shortlink( event, this )',
477
  'options' => array(),
478
  'features' => array( 'internal', 'requires_js', 'for_share' ),
617
  'icon' => array('fa4'=> 'fa fa-whatsapp', 'fa5' => 'fab fa-whatsapp'),
618
  'link' => 'https://api.whatsapp.com/send?text={title}%20{url}',
619
  'link_tsb' => 'https://api.whatsapp.com/send?text={excerpt}%20{url}',
620
+ 'link_mobile' => 'whatsapp://send?text={title}%20-%20{url}',
621
  'options' => array(),
622
  'features' => array( 'for_share', 'for_tsb' ),
623
  'colors' => array( '#60b82d' ),
907
 
908
  if( $page == 'gsettings_misc' ){
909
  return array(
910
+ 'font_icon' => 'fa5',
911
  'misc_additional_css' => '',
912
  'skip_res_load' => ''
913
  );
core/metadata.php CHANGED
@@ -5,36 +5,66 @@
5
  */
6
 
7
  class WPSR_Metadata{
8
-
 
 
9
  public static function init(){
10
-
11
- }
12
-
13
- public static function metadata(){
14
-
15
- global $post;
16
-
17
- $d = array();
18
- $defaults = array(
19
- 'post_id' => '',
20
- 'title' => '',
21
  'url' => '',
 
22
  'excerpt' => '',
23
  'short_url' => '',
24
  'comments_count' => '',
 
 
25
  'post_image' => '',
26
- 'rss_url' => get_bloginfo( 'rss2_url' )
 
 
 
27
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- if( in_the_loop()) {
 
 
 
 
 
 
 
 
30
 
31
- $d = self::meta_by_id( get_the_ID() );
32
 
33
  }else{
34
 
35
  if( is_home() && get_option( 'show_on_front' ) == 'page' ){
36
 
37
- $d = self::meta_by_id( get_option( 'page_for_posts' ) );
38
 
39
  }elseif( is_front_page() || ( is_home() && ( get_option( 'show_on_front' ) == 'posts' || !get_option( 'page_for_posts' ) ) ) ){
40
 
@@ -47,7 +77,7 @@ class WPSR_Metadata{
47
 
48
  }elseif( is_singular() ){
49
 
50
- $d = self::meta_by_id( $post->ID );
51
 
52
  }elseif( is_tax() || is_tag() || is_category() ){
53
 
@@ -118,20 +148,18 @@ class WPSR_Metadata{
118
  }
119
  }
120
 
121
- $meta = WPSR_Lists::set_defaults( $d, $defaults );
122
- $meta = array_map( 'trim', $meta );
123
- $meta = apply_filters( 'wpsr_mod_metadata', $meta );
124
-
125
- return $meta;
126
 
 
 
127
  }
128
-
129
- public static function meta_by_id( $id ){
130
-
131
  global $post;
132
-
133
  $d = array();
134
-
135
  if( $id ){
136
  $d = array(
137
  'post_id' => $id,
@@ -144,7 +172,7 @@ class WPSR_Metadata{
144
  );
145
  }
146
 
147
- return apply_filters( 'wpsr_mod_meta_by_id', $d );
148
 
149
  }
150
 
@@ -169,46 +197,31 @@ class WPSR_Metadata{
169
 
170
  }
171
 
172
- public static function process_url( $url, $pinfo ){
173
 
174
- $g_settings = get_option( 'wpsr_general_settings' );
175
- $g_settings = WPSR_Lists::set_defaults( $g_settings, WPSR_Lists::defaults( 'gsettings_twitter' ) );
176
- $t_username = ( $g_settings[ 'twitter_username' ] != '' ) ? '@' . $g_settings[ 'twitter_username' ] : '';
177
-
178
- $pinfo = wp_parse_args( $pinfo, array(
179
- 'url' => '',
180
- 'title' => '',
181
- 'excerpt' => '',
182
- 'short_url' => '',
183
- 'rss_url' => '',
184
- 'post_image' => ''
185
- ));
186
-
187
- $search = array(
188
- '{url}',
189
- '{title}',
190
- '{excerpt}',
191
- '{s-url}',
192
- '{rss-url}',
193
- '{image}',
194
- '{twitter-username}',
195
- '{title-plain}',
196
- '{excerpt-plain}'
197
- );
198
-
199
- $replace = array(
200
- $pinfo[ 'url' ],
201
- urlencode( $pinfo[ 'title' ] ),
202
- urlencode( $pinfo[ 'excerpt' ] ),
203
- $pinfo[ 'short_url' ],
204
- $pinfo[ 'rss_url' ],
205
- $pinfo[ 'post_image' ],
206
- $t_username,
207
- $pinfo[ 'title' ],
208
- $pinfo[ 'excerpt' ]
209
  );
210
-
211
- return str_replace( $search, $replace, $url );
 
 
 
212
 
213
  }
214
 
5
  */
6
 
7
  class WPSR_Metadata{
8
+
9
+ public static $defaults = array();
10
+
11
  public static function init(){
12
+
13
+ self::$defaults = array(
 
 
 
 
 
 
 
 
 
14
  'url' => '',
15
+ 'title' => '',
16
  'excerpt' => '',
17
  'short_url' => '',
18
  'comments_count' => '',
19
+ 'comments_section' => '',
20
+ 'post_id' => '',
21
  'post_image' => '',
22
+ 'rss_url' => '',
23
+ 'twitter_username' => '',
24
+ 'fb_app_id' => '',
25
+ 'fb_app_secret' => ''
26
  );
27
+
28
+ }
29
+
30
+ public static function metadata(){
31
+
32
+ $page_info = self::page_info();
33
+
34
+ $g_settings = get_option( 'wpsr_general_settings' );
35
+ $twitter_config = WPSR_Lists::set_defaults( $g_settings, WPSR_Lists::defaults( 'gsettings_twitter' ) );
36
+ $facebook_config = WPSR_Lists::set_defaults( $g_settings, WPSR_Lists::defaults( 'gsettings_facebook' ) );
37
+
38
+ $misc_info = array(
39
+ 'rss_url' => get_bloginfo( 'rss2_url' ),
40
+ 'twitter_username' => ( empty( $twitter_config[ 'twitter_username' ] ) ? '' : '@' . $twitter_config[ 'twitter_username' ] ),
41
+ 'fb_app_id' => $facebook_config[ 'facebook_app_id' ],
42
+ 'fb_app_secret' => $facebook_config[ 'facebook_app_secret' ]
43
+ );
44
+
45
+ $metadata = array_merge( $page_info, $misc_info );
46
+ $metadata = WPSR_Lists::set_defaults( $metadata, self::$defaults );
47
+ $metadata = apply_filters( 'wpsr_mod_metadata', $metadata );
48
+
49
+ return $metadata;
50
 
51
+ }
52
+
53
+ public static function page_info(){
54
+
55
+ global $post;
56
+
57
+ $d = array();
58
+
59
+ if( in_the_loop() ) {
60
 
61
+ $d = self::post_info_by_id( get_the_ID() );
62
 
63
  }else{
64
 
65
  if( is_home() && get_option( 'show_on_front' ) == 'page' ){
66
 
67
+ $d = self::post_info_by_id( get_option( 'page_for_posts' ) );
68
 
69
  }elseif( is_front_page() || ( is_home() && ( get_option( 'show_on_front' ) == 'posts' || !get_option( 'page_for_posts' ) ) ) ){
70
 
77
 
78
  }elseif( is_singular() ){
79
 
80
+ $d = self::post_info_by_id( $post->ID );
81
 
82
  }elseif( is_tax() || is_tag() || is_category() ){
83
 
148
  }
149
  }
150
 
151
+ $d = array_map( 'trim', $d );
 
 
 
 
152
 
153
+ return $d;
154
+
155
  }
156
+
157
+ public static function post_info_by_id( $id ){
158
+
159
  global $post;
160
+
161
  $d = array();
162
+
163
  if( $id ){
164
  $d = array(
165
  'post_id' => $id,
172
  );
173
  }
174
 
175
+ return $d;
176
 
177
  }
178
 
197
 
198
  }
199
 
200
+ public static function replace_params( $text, $metadata = array() ){
201
 
202
+ $metadata = wp_parse_args( $metadata, self::$defaults);
203
+
204
+ $all_params = array(
205
+ '{url}' => $metadata[ 'url' ],
206
+ '{title}' => urlencode( $metadata[ 'title' ] ),
207
+ '{excerpt}' => urlencode( $metadata[ 'excerpt' ] ),
208
+ '{title-plain}' => $metadata[ 'title' ],
209
+ '{excerpt-plain}' => $metadata[ 'excerpt' ],
210
+ '{image}' => $metadata[ 'post_image' ],
211
+
212
+ '{short-url}' => $metadata[ 'short_url' ],
213
+ '{rss-url}' => $metadata[ 'rss_url' ],
214
+ '{comments-section}' => $metadata[ 'comments_section' ],
215
+
216
+ '{twitter-username}' => $metadata[ 'twitter_username' ],
217
+ '{fb-app-id}' => $metadata[ 'fb_app_id' ],
218
+ '{fb-app-secret}' => $metadata[ 'fb_app_secret' ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  );
220
+
221
+ $params = array_keys( $all_params );
222
+ $param_values = array_values( $all_params );
223
+
224
+ return str_ireplace( $params, $param_values, $text );
225
 
226
  }
227
 
core/templates.php CHANGED
@@ -430,10 +430,6 @@ class WPSR_Template_Text_Sharebar{
430
  $page_info = WPSR_Metadata::metadata();
431
  $html = '';
432
 
433
- $g_settings = get_option( 'wpsr_general_settings' );
434
- $g_settings = WPSR_Lists::set_defaults( $g_settings, WPSR_Lists::defaults( 'gsettings_twitter' ) );
435
- $t_username = ( $g_settings[ 'twitter_username' ] != '' ) ? '@' . $g_settings[ 'twitter_username' ] : '';
436
-
437
  if( !is_array( $btns ) || empty( $btns ) ){
438
  return '';
439
  }
@@ -446,7 +442,7 @@ class WPSR_Template_Text_Sharebar{
446
  $html .= '<li><a href="#" title="' . esc_attr( $sb_info[ 'title' ] ) . '" data-link="' . esc_attr( $link ) . '" style="color: ' . esc_attr( $opts[ 'icon_color' ] ) . '" ' . $onclick . '><i class="' . esc_attr( $sb_info[ 'icon' ] ) . '"></i></a></li>';
447
  }
448
 
449
- $html = '<ul class="wpsr-text-sb wpsr-tsb-' . esc_attr( $opts[ 'size' ] ) . ' wpsr-clearfix" data-content="' . esc_attr( $opts[ 'content' ] ) . '" data-tcount="' . esc_attr( $opts[ 'text_count' ] ) . '" style="background-color: ' . esc_attr( $opts[ 'bg_color' ] ) . '" data-url="' . esc_attr( $page_info[ 'url' ] ) . '" data-title="' . esc_attr( $page_info[ 'title' ] ) . '" data-surl="' . esc_attr( $page_info[ 'short_url' ] ) . '" data-tuname="' . esc_attr( $t_username ) . '">' . $html . '</ul>';
450
 
451
  return $html;
452
 
@@ -483,6 +479,7 @@ class WPSR_Template_Mobile_Sharebar{
483
  $btns = json_decode( $decoded );
484
  $sb_sites = WPSR_Lists::social_icons();
485
  $page_info = WPSR_Metadata::metadata();
 
486
  $html = '';
487
 
488
  if( !is_array( $btns ) || empty( $btns ) ){
@@ -501,7 +498,13 @@ class WPSR_Template_Mobile_Sharebar{
501
  }
502
 
503
  $sb_info = $sb_sites[ $id ];
504
- $link = WPSR_Metadata::process_url( $sb_info[ 'link' ], $page_info );
 
 
 
 
 
 
505
  $onclick = array_key_exists( 'onclick', $sb_info ) ? 'onclick="' . esc_attr( $sb_info[ 'onclick' ] ) . '"' : '';
506
 
507
  $html .= '<span class="sr-' . $id . '"><a rel="nofollow" target="_blank" href="' . esc_attr( $link ) . '" title="' . esc_attr( $sb_info[ 'title' ] ) . '" style="' . $style . '" ' . $onclick . '><i class="' . esc_attr( $sb_info[ 'icon' ] ) . '" tar></i></a></span>';
@@ -560,6 +563,7 @@ class WPSR_Template_Social_Icons{
560
  $page_info = WPSR_Metadata::metadata();
561
  $counter_services = WPSR_Share_Counter::counter_services();
562
  $selected_icons = json_decode( base64_decode( $tmpl[ 'selected_icons' ] ) );
 
563
 
564
  $classes = array( 'socializer', 'sr-popup' );
565
 
@@ -622,20 +626,18 @@ class WPSR_Template_Social_Icons{
622
 
623
  // If custom HTML button
624
  if( $id == 'html' ){
625
- $tags = array();
626
- $replace_with = array();
627
- foreach( $page_info as $id => $val ){
628
- array_push( $tags, '{' . $id . '}' );
629
- array_push( $replace_with, $val );
630
- }
631
- $custom_html = str_replace( $tags, $replace_with, $settings[ 'html' ] );
632
-
633
- $ihtml = '<div class="sr-custom-html">' . $custom_html . '</div>';
634
  array_push( $icons_html, $ihtml );
635
  continue;
636
  }
637
 
638
- $url = WPSR_Metadata::process_url( $props[ 'link' ], $page_info );
 
 
 
 
 
639
  $onclick = isset( $props[ 'onclick' ] ) ? 'onclick="' . $props[ 'onclick' ] . '"' : '';
640
 
641
  $text = '';
@@ -825,20 +827,18 @@ class WPSR_Template_Floating_Sharebar{
825
 
826
  // If custom HTML button
827
  if( $id == 'html' ){
828
- $tags = array();
829
- $replace_with = array();
830
- foreach( $page_info as $id => $val ){
831
- array_push( $tags, '{' . $id . '}' );
832
- array_push( $replace_with, $val );
833
- }
834
- $custom_html = str_replace( $tags, $replace_with, $settings[ 'html' ] );
835
-
836
- $ihtml = '<div class="sr-custom-html">' . $custom_html . '</div>';
837
  array_push( $icons_html, $ihtml );
838
  continue;
839
  }
840
 
841
- $url = WPSR_Metadata::process_url( $props[ 'link' ], $page_info );
 
 
 
 
 
842
  $onclick = isset( $props[ 'onclick' ] ) ? 'onclick="' . $props[ 'onclick' ] . '"' : '';
843
 
844
  $icon = '';
430
  $page_info = WPSR_Metadata::metadata();
431
  $html = '';
432
 
 
 
 
 
433
  if( !is_array( $btns ) || empty( $btns ) ){
434
  return '';
435
  }
442
  $html .= '<li><a href="#" title="' . esc_attr( $sb_info[ 'title' ] ) . '" data-link="' . esc_attr( $link ) . '" style="color: ' . esc_attr( $opts[ 'icon_color' ] ) . '" ' . $onclick . '><i class="' . esc_attr( $sb_info[ 'icon' ] ) . '"></i></a></li>';
443
  }
444
 
445
+ $html = '<ul class="wpsr-text-sb wpsr-tsb-' . esc_attr( $opts[ 'size' ] ) . ' wpsr-clearfix" data-content="' . esc_attr( $opts[ 'content' ] ) . '" data-tcount="' . esc_attr( $opts[ 'text_count' ] ) . '" style="background-color: ' . esc_attr( $opts[ 'bg_color' ] ) . '" data-url="' . esc_attr( $page_info[ 'url' ] ) . '" data-title="' . esc_attr( $page_info[ 'title' ] ) . '" data-surl="' . esc_attr( $page_info[ 'short_url' ] ) . '" data-tuname="' . esc_attr( $page_info[ 'twitter_username' ] ) . '">' . $html . '</ul>';
446
 
447
  return $html;
448
 
479
  $btns = json_decode( $decoded );
480
  $sb_sites = WPSR_Lists::social_icons();
481
  $page_info = WPSR_Metadata::metadata();
482
+ $is_mobile = wp_is_mobile();
483
  $html = '';
484
 
485
  if( !is_array( $btns ) || empty( $btns ) ){
498
  }
499
 
500
  $sb_info = $sb_sites[ $id ];
501
+
502
+ $icon_link = $sb_info[ 'link' ];
503
+ if( $is_mobile && array_key_exists( 'link_mobile', $sb_info ) ){
504
+ $icon_link = $sb_info[ 'link_mobile' ];
505
+ }
506
+
507
+ $link = WPSR_Metadata::replace_params( $icon_link, $page_info );
508
  $onclick = array_key_exists( 'onclick', $sb_info ) ? 'onclick="' . esc_attr( $sb_info[ 'onclick' ] ) . '"' : '';
509
 
510
  $html .= '<span class="sr-' . $id . '"><a rel="nofollow" target="_blank" href="' . esc_attr( $link ) . '" title="' . esc_attr( $sb_info[ 'title' ] ) . '" style="' . $style . '" ' . $onclick . '><i class="' . esc_attr( $sb_info[ 'icon' ] ) . '" tar></i></a></span>';
563
  $page_info = WPSR_Metadata::metadata();
564
  $counter_services = WPSR_Share_Counter::counter_services();
565
  $selected_icons = json_decode( base64_decode( $tmpl[ 'selected_icons' ] ) );
566
+ $is_mobile = wp_is_mobile();
567
 
568
  $classes = array( 'socializer', 'sr-popup' );
569
 
626
 
627
  // If custom HTML button
628
  if( $id == 'html' ){
629
+ $custom_html = WPSR_Metadata::replace_params( $settings[ 'html' ], $page_info );
630
+ $ihtml = '<div class="sr-custom-html">' . do_shortcode( $custom_html ) . '</div>';
 
 
 
 
 
 
 
631
  array_push( $icons_html, $ihtml );
632
  continue;
633
  }
634
 
635
+ $icon_link = $props[ 'link' ];
636
+ if( $is_mobile && array_key_exists( 'link_mobile', $props ) ){
637
+ $icon_link = $props[ 'link_mobile' ];
638
+ }
639
+
640
+ $url = WPSR_Metadata::replace_params( $icon_link, $page_info );
641
  $onclick = isset( $props[ 'onclick' ] ) ? 'onclick="' . $props[ 'onclick' ] . '"' : '';
642
 
643
  $text = '';
827
 
828
  // If custom HTML button
829
  if( $id == 'html' ){
830
+ $custom_html = WPSR_Metadata::replace_params( $settings[ 'html' ], $page_info );
831
+ $ihtml = '<div class="sr-custom-html">' . do_shortcode( $custom_html ) . '</div>';
 
 
 
 
 
 
 
832
  array_push( $icons_html, $ihtml );
833
  continue;
834
  }
835
 
836
+ $icon_link = $props[ 'link' ];
837
+ if( $is_mobile && array_key_exists( 'link_mobile', $props ) ){
838
+ $icon_link = $props[ 'link_mobile' ];
839
+ }
840
+
841
+ $url = WPSR_Metadata::replace_params( $icon_link, $page_info );
842
  $onclick = isset( $props[ 'onclick' ] ) ? 'onclick="' . $props[ 'onclick' ] . '"' : '';
843
 
844
  $icon = '';
readme.txt CHANGED
@@ -1,19 +1,19 @@
1
- === WP Socializer ===
2
  Contributors: vaakash
3
  Donate link: https://www.paypal.me/vaakash/6
4
  Tags: sharing, social media icons, share icons, share buttons, follow buttons, widgets, floating share buttons, profile buttons, mobile sharebar, profile icons, social bar, share counter, excerpt, shortcode, linkedin, pinterest, pocket, reddit, sharethis, addthis, whatsapp, tweet, vkontakte, socializer, wp socializer, weibo, line, mix, odnoklassniki, renren, skype
5
  Requires at least: 4.6
6
- Tested up to: 5.3.2
7
- Stable tag: 5.1
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
  Requires PHP: 5.3
11
 
12
- BEAUTIFUL - POWERFUL - EASY social media share buttons, sharebar, follow icons, text and mobile sharebar
13
 
14
  == Description ==
15
 
16
- WP Socializer is a complete social media plugin to add social media icons, floating sharebar, follow us buttons, profile icons, mobile sharebar and selected text share popups easily with **TONS** of customization.
17
 
18
  = Key features =
19
 
@@ -27,15 +27,14 @@ WP Socializer is a complete social media plugin to add social media icons, float
27
  * Has support for **shortcodes**.
28
  * Has support for native **social media sidebar widgets**.
29
  * Extensive options with **no restrictions** to customize.
30
-
31
- [youtube https://www.youtube.com/watch?v=50aJq223TB0]
32
 
33
  = Faster page loads =
34
 
35
  WP Socializer **loads webpages faster** since scripts required by buttons are loaded only once and also when necessary. This increases the page load faster even when multiple buttons are used in the same page.
36
 
37
 
38
- = Mobile ready with responsiveness =
39
 
40
  WP Socializer is 100% mobile ready and looks beautiful in any device with options to set the responsiveness to mobile devices.
41
 
@@ -43,6 +42,7 @@ WP Socializer is 100% mobile ready and looks beautiful in any device with option
43
  * Dedicated mobile sharebar.
44
  * Social icons are **retina ready** and displays sharp icons even deep zoom in mobile devices.
45
  * Faster on both mobile and desktop devices as resources are loaded conditionally.
 
46
 
47
 
48
  = Create your own design for your website =
@@ -150,6 +150,12 @@ Please refer [this page](https://goo.gl/Ge7riC) for the full list of FAQs.
150
 
151
  == Changelog ==
152
 
 
 
 
 
 
 
153
  = 5.1 =
154
  * New: Custom HTML can now be added above and below the social icons.
155
  * New: Add custom HTML in between social icons and in floating sharebar.
1
+ === Social Media Sharing Icons, Sharebar & Widgets - WP Socializer ===
2
  Contributors: vaakash
3
  Donate link: https://www.paypal.me/vaakash/6
4
  Tags: sharing, social media icons, share icons, share buttons, follow buttons, widgets, floating share buttons, profile buttons, mobile sharebar, profile icons, social bar, share counter, excerpt, shortcode, linkedin, pinterest, pocket, reddit, sharethis, addthis, whatsapp, tweet, vkontakte, socializer, wp socializer, weibo, line, mix, odnoklassniki, renren, skype
5
  Requires at least: 4.6
6
+ Tested up to: 5.4
7
+ Stable tag: 5.2
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
  Requires PHP: 5.3
11
 
12
+ Add 30+ powerful social media sharing icons, follow social profile icons, floating, text & mobile sharebar easily with services like Facebook, Twitter, LinkedIn, Pinterest, Instagram etc.
13
 
14
  == Description ==
15
 
16
+ WP Socializer is a complete social media plugin to add social media icons, floating sharebar, follow social profile icons, mobile sharebar and selected text share popups easily with **TONS** of customization.
17
 
18
  = Key features =
19
 
27
  * Has support for **shortcodes**.
28
  * Has support for native **social media sidebar widgets**.
29
  * Extensive options with **no restrictions** to customize.
30
+ * Set **custom icon image** for social icons.
 
31
 
32
  = Faster page loads =
33
 
34
  WP Socializer **loads webpages faster** since scripts required by buttons are loaded only once and also when necessary. This increases the page load faster even when multiple buttons are used in the same page.
35
 
36
 
37
+ = Mobile ready with responsiveness & app linking =
38
 
39
  WP Socializer is 100% mobile ready and looks beautiful in any device with options to set the responsiveness to mobile devices.
40
 
42
  * Dedicated mobile sharebar.
43
  * Social icons are **retina ready** and displays sharp icons even deep zoom in mobile devices.
44
  * Faster on both mobile and desktop devices as resources are loaded conditionally.
45
+ * Apps like WhatsApp and Facebook messenger open directly when users share page.
46
 
47
 
48
  = Create your own design for your website =
150
 
151
  == Changelog ==
152
 
153
+ = 5.2 =
154
+ * New: Support for shortcodes in custom HTML.
155
+ * New: Separate share URLs for desktop and mobile which enables support for app linking.
156
+ * Fix: Major changes to the internal metadata system.
157
+ * Fix: Made FontAwesome 5 as the default font icon system.
158
+
159
  = 5.1 =
160
  * New: Custom HTML can now be added above and below the social icons.
161
  * New: Add custom HTML in between social icons and in floating sharebar.
services/social_icons.php CHANGED
@@ -109,7 +109,7 @@ class wpsr_service_social_icons{
109
  continue;
110
 
111
  $temp_url = ( $opts[ 'custom_url' ] == '' ) ? $props[ 'link' ] : urldecode( $opts[ 'custom_url' ] );
112
- $url = WPSR_Metadata::process_url( $temp_url, $page_info );
113
 
114
  $onclick = isset( $props[ 'onclick' ] ) ? 'onclick="' . $props[ 'onclick' ] . '"' : '';
115
 
109
  continue;
110
 
111
  $temp_url = ( $opts[ 'custom_url' ] == '' ) ? $props[ 'link' ] : urldecode( $opts[ 'custom_url' ] );
112
+ $url = WPSR_Metadata::replace_params( $temp_url, $page_info );
113
 
114
  $onclick = isset( $props[ 'onclick' ] ) ? 'onclick="' . $props[ 'onclick' ] . '"' : '';
115
 
wpsr.php CHANGED
@@ -3,14 +3,14 @@
3
  * Plugin Name: WP Socializer
4
  * Plugin URI: https://www.aakashweb.com/wordpress-plugins/wp-socializer/
5
  * Description: WP Socializer is an all in one complete social media plugin to add native social media buttons, icons, floating sharebar, follow us buttons, profile icons, mobile sharebar and selected text share popups easily with complete control and customization.
6
- * Version: 5.1
7
  * Author: Aakash Chakravarthy
8
  * Author URI: https://www.aakashweb.com
9
  * Text Domain: wpsr
10
  * Domain Path: /languages
11
  */
12
 
13
- define( 'WPSR_VERSION', '5.1' );
14
  define( 'WPSR_PATH', plugin_dir_path( __FILE__ ) ); // All have trailing slash
15
  define( 'WPSR_URL', plugin_dir_url( __FILE__ ) );
16
  define( 'WPSR_ADMIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) . 'admin' ) );
3
  * Plugin Name: WP Socializer
4
  * Plugin URI: https://www.aakashweb.com/wordpress-plugins/wp-socializer/
5
  * Description: WP Socializer is an all in one complete social media plugin to add native social media buttons, icons, floating sharebar, follow us buttons, profile icons, mobile sharebar and selected text share popups easily with complete control and customization.
6
+ * Version: 5.2
7
  * Author: Aakash Chakravarthy
8
  * Author URI: https://www.aakashweb.com
9
  * Text Domain: wpsr
10
  * Domain Path: /languages
11
  */
12
 
13
+ define( 'WPSR_VERSION', '5.2' );
14
  define( 'WPSR_PATH', plugin_dir_path( __FILE__ ) ); // All have trailing slash
15
  define( 'WPSR_URL', plugin_dir_url( __FILE__ ) );
16
  define( 'WPSR_ADMIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) . 'admin' ) );