WP Socializer - Version 2.4.9

Version Description

  • Added mobile optimization or small screen support for the floating sharebar
  • Facebook comments popup clipping is fixed.
  • Sharethis "undefined" object issue is fixed.
  • Social button CSS file size is reduced and notable tweaks are made to the social buttons.
  • Scripts and styles are now loaded properly in the frontend as per the API
  • Source code is revised and optimized.
  • Some minor admin UI improvements are made.
Download this release

Release Info

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

Code changes from version 2.4.8 to 2.4.9

admin/wpsr-admin-css.css CHANGED
@@ -102,7 +102,8 @@
102
  border-radius: 0px 0px 10px 10px;
103
  }
104
  .wrap .footer #wpsr_submit{
105
- /*padding: 5px 30px;*/
 
106
  }
107
 
108
  /****************************/
102
  border-radius: 0px 0px 10px 10px;
103
  }
104
  .wrap .footer #wpsr_submit{
105
+ padding: 8px 15px;
106
+ font-size: 14px !important;
107
  }
108
 
109
  /****************************/
admin/wpsr-admin-floating-bar.php CHANGED
@@ -69,7 +69,9 @@ function wpsr_admin_page_floating_bar(){
69
 
70
  <div class="wrap">
71
  <div class="header">
72
- <?php echo wpsr_admin_buttons('fbrec'); ?>
 
 
73
  <h2><img width="32" height="32" src="<?php echo WPSR_ADMIN_URL; ?>images/wp-socializer.png" align="absmiddle"/>&nbsp;WP Socializer<span class="smallText"> v<?php echo WPSR_VERSION; ?></span></h2>
74
  </div><!-- Header -->
75
 
69
 
70
  <div class="wrap">
71
  <div class="header">
72
+
73
+ <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffacebook.com%2Faakashweb&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=true&amp;action=recommend&amp;colorscheme=light&amp;font=arial&amp;height=21&amp;appId=106994469342299" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width: 126px; height:21px;float: right;margin-top: 15px;" allowtransparency="true"></iframe>
74
+
75
  <h2><img width="32" height="32" src="<?php echo WPSR_ADMIN_URL; ?>images/wp-socializer.png" align="absmiddle"/>&nbsp;WP Socializer<span class="smallText"> v<?php echo WPSR_VERSION; ?></span></h2>
76
  </div><!-- Header -->
77
 
admin/wpsr-admin-js.js CHANGED
@@ -1,7 +1,7 @@
1
  /*
2
  * WP Socializer - Admin page functions
3
  * Author: Aakash Chakravarthy
4
- * Version: 2.6
5
  *
6
  */
7
 
@@ -199,13 +199,17 @@ $j(document).ready(function(){
199
  $j('.helpTab').click(function(){
200
  $j.ajax({
201
  type: "GET",
202
- url: 'http://query.yahooapis.com/v1/public/yql?q=%20SELECT%20*%20FROM%20xml%20WHERE%20url%3D%22http%3A%2F%2Fvaakash.kodingen.com%2Fwpsr-help.xml%22&env=http%3A%2F%2Fdatatables.org%2Falltables.env',
203
  dataType: "xml",
204
  success: function(xml){
205
  ver = '[version="' + $j('.wpsrVer').text() + '"]';
 
 
 
 
206
  $j(xml).find('content' + ver).each(function(){
207
  $j('.helpBox').hide();
208
- $j('.helpBox').html($j(this).text());
209
  $j('.helpBox').fadeIn();
210
  });
211
  },
1
  /*
2
  * WP Socializer - Admin page functions
3
  * Author: Aakash Chakravarthy
4
+ * Version: 2.7
5
  *
6
  */
7
 
199
  $j('.helpTab').click(function(){
200
  $j.ajax({
201
  type: "GET",
202
+ url: 'http://query.yahooapis.com/v1/public/yql?q=%20SELECT%20*%20FROM%20xml%20WHERE%20url%3D%22http%3A%2F%2Fvaakash.koding.com%2Fwpsr-help.xml%22&env=http%3A%2F%2Fdatatables.org%2Falltables.env',
203
  dataType: "xml",
204
  success: function(xml){
205
  ver = '[version="' + $j('.wpsrVer').text() + '"]';
206
+
207
+ general = $j(xml).find('general').text();
208
+ specific = $j(xml).find('content' + ver).text();
209
+
210
  $j(xml).find('content' + ver).each(function(){
211
  $j('.helpBox').hide();
212
+ $j('.helpBox').html(general + specific);
213
  $j('.helpBox').fadeIn();
214
  });
215
  },
admin/wpsr-admin.php CHANGED
@@ -5,6 +5,27 @@
5
  */
6
 
7
  $wpsr_donate_link = 'http://bit.ly/wpsrDonation';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  function wpsr_admin_menu() {
9
 
10
  $icon = WPSR_ADMIN_URL .'images/wp-socializer-20.png';
@@ -402,7 +423,7 @@ function wpsr_admin_page(){
402
 
403
  update_option("wpsr_custom_data", $wpsr_custom);
404
 
405
- ## Placement OptionS
406
  $wpsr_templates = $_POST['wpsr_template'];
407
  $templates = get_option('wpsr_templates'); // Get the list of templates defined
408
 
@@ -438,10 +459,6 @@ function wpsr_admin_page(){
438
  update_option("wpsr_settings_data", $wpsr_settings);
439
 
440
  $wpsr_updated = true;
441
-
442
- if(get_option("wpsr_active") == 0){
443
- update_option("wpsr_active", 1);
444
- }
445
  }
446
 
447
  if(isset($wpsr_updated) && $wpsr_updated == true){
@@ -464,15 +481,8 @@ function wpsr_admin_page(){
464
  $wpsr_facebook = get_option('wpsr_facebook_data');
465
  $wpsr_socialbt = get_option('wpsr_socialbt_data');
466
  $wpsr_custom = get_option('wpsr_custom_data');
467
- $wpsr_template1 = get_option('wpsr_template1_data');
468
- $wpsr_template2 = get_option('wpsr_template2_data');
469
  $wpsr_settings = get_option('wpsr_settings_data');
470
-
471
- ## For new users set the defaults
472
- if($wpsr_template1 == '' && $wpsr_template2 == ''){
473
- wpsr_reset_values();
474
- }
475
-
476
  ## Assign the values of the template temporary
477
  $templates = get_option('wpsr_templates');
478
  foreach($templates as $k => $v){
@@ -504,7 +514,9 @@ function wpsr_admin_page(){
504
  <!-- Main ADMIN page -->
505
  <div class="wrap">
506
  <div class="header">
507
- <?php echo wpsr_admin_buttons('fbrec'); ?>
 
 
508
  <h2><img width="32" height="32" src="<?php echo WPSR_ADMIN_URL; ?>images/wp-socializer.png" align="absmiddle"/>&nbsp;WP Socializer<span class="smallText"> v<?php echo WPSR_VERSION; ?><?php echo $wpsr_is_disabled; ?></span></h2>
509
  </div><!-- Header -->
510
 
@@ -1240,18 +1252,30 @@ function wpsr_admin_page(){
1240
 
1241
  <div class="wrap">
1242
 
1243
- <p><strong>NOTE: Please refresh the page the load the new Stylesheets and Javascripts of the admin page.</strong></p>
1244
 
1245
  <h2><img width="32" height="32" src="<?php echo WPSR_ADMIN_URL; ?>images/wp-socializer.png" align="absmiddle"/> WP Socializer <span class="smallText">v<?php echo WPSR_VERSION; ?></span></h2>
1246
 
1247
  <div class="miniWrap introWrap">
1248
-
1249
- <ul class="shareList clearfix">
1250
- <li><?php echo wpsr_admin_buttons('fb'); ?></li>
1251
- <li><?php echo wpsr_admin_buttons('twitter'); ?></li>
1252
- <li><?php echo wpsr_admin_buttons('+1'); ?></li>
1253
- <li><?php echo wpsr_admin_buttons('at'); ?></li>
1254
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
1255
 
1256
  <div class="infoContent"></div>
1257
 
@@ -1268,27 +1292,6 @@ function wpsr_admin_page(){
1268
  <?php
1269
  }
1270
 
1271
- function wpsr_admin_buttons($type){
1272
- switch($type){
1273
- case 'fb':
1274
- return '<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FAakash-Web%2F102453489826234&amp;layout=button_count&amp;show_faces=true&amp;width=48&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe>';
1275
-
1276
- case '+1':
1277
- return '<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script><g:plusone size="medium" href="http://www.aakashweb.com/wordpress-plugins/wp-socializer/"></g:plusone>';
1278
-
1279
- case 'twitter':
1280
- return '<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.aakashweb.com/wordpress-plugins/wp-socializer/" data-text="Check this out !: WP Socializer - Wordpress plugin - Aakash Web" data-count="horizontal" data-via="vaakash">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>';
1281
-
1282
- case 'at':
1283
- return '<div class="addthis_toolbox addthis_default_style" addthis:url="http://www.aakashweb.com/wordpress-plugins/wp-socializer/" addthis:title="WP Socializer - Wordpress plugin - Aakash Web"><a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style"></a></div>
1284
- <script type="text/javascript">var addthis_share = { templates: {twitter: "Check out http://www.aakashweb.com/wordpress-plugins/wp-socializer/ (from @vaakash)"}}</script><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=vaakash"></script>';
1285
-
1286
- case 'fbrec':
1287
- return '<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffacebook.com%2Faakashweb&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=true&amp;action=recommend&amp;colorscheme=light&amp;font=arial&amp;height=21&amp;appId=106994469342299" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width: 126px; height:21px;float: right;margin-top: 15px;" allowtransparency="true"></iframe>';
1288
- }
1289
- }
1290
-
1291
-
1292
  function wpsr_meta_box(){
1293
  global $post;
1294
 
@@ -1342,4 +1345,42 @@ function wpsr_insert_post($post_id) {
1342
  }
1343
  }
1344
  add_action('wp_insert_post', 'wpsr_insert_post');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1345
  ?>
5
  */
6
 
7
  $wpsr_donate_link = 'http://bit.ly/wpsrDonation';
8
+
9
+ ## Initializations
10
+ function wpsr_admin_init(){
11
+ global $wpsr_default_templates;
12
+ $user_template = get_option('wpsr_templates');
13
+
14
+ if(empty($user_template)){
15
+ update_option('wpsr_templates', $wpsr_default_templates);
16
+ }else{
17
+ $merged_array = $wpsr_default_templates + $user_template;
18
+ if($user_template != $merged_array){
19
+ update_option('wpsr_templates', $merged_array);
20
+ }
21
+ }
22
+
23
+ // Include the plugin translations
24
+ // load_plugin_textdomain('wpsr', false, dirname(plugin_basename( __FILE__ )) . '/languages');
25
+ }
26
+ add_action('admin_init','wpsr_admin_init');
27
+
28
+ // Admin menu
29
  function wpsr_admin_menu() {
30
 
31
  $icon = WPSR_ADMIN_URL .'images/wp-socializer-20.png';
423
 
424
  update_option("wpsr_custom_data", $wpsr_custom);
425
 
426
+ ## Placement Options
427
  $wpsr_templates = $_POST['wpsr_template'];
428
  $templates = get_option('wpsr_templates'); // Get the list of templates defined
429
 
459
  update_option("wpsr_settings_data", $wpsr_settings);
460
 
461
  $wpsr_updated = true;
 
 
 
 
462
  }
463
 
464
  if(isset($wpsr_updated) && $wpsr_updated == true){
481
  $wpsr_facebook = get_option('wpsr_facebook_data');
482
  $wpsr_socialbt = get_option('wpsr_socialbt_data');
483
  $wpsr_custom = get_option('wpsr_custom_data');
 
 
484
  $wpsr_settings = get_option('wpsr_settings_data');
485
+
 
 
 
 
 
486
  ## Assign the values of the template temporary
487
  $templates = get_option('wpsr_templates');
488
  foreach($templates as $k => $v){
514
  <!-- Main ADMIN page -->
515
  <div class="wrap">
516
  <div class="header">
517
+
518
+ <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffacebook.com%2Faakashweb&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=true&amp;action=recommend&amp;colorscheme=light&amp;font=arial&amp;height=21&amp;appId=106994469342299" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width: 126px; height:21px;float: right;margin-top: 15px;" allowtransparency="true"></iframe>
519
+
520
  <h2><img width="32" height="32" src="<?php echo WPSR_ADMIN_URL; ?>images/wp-socializer.png" align="absmiddle"/>&nbsp;WP Socializer<span class="smallText"> v<?php echo WPSR_VERSION; ?><?php echo $wpsr_is_disabled; ?></span></h2>
521
  </div><!-- Header -->
522
 
1252
 
1253
  <div class="wrap">
1254
 
1255
+ <p><strong>NOTE: Please refresh the page to load the new Stylesheets and Javascripts of the admin page.</strong></p>
1256
 
1257
  <h2><img width="32" height="32" src="<?php echo WPSR_ADMIN_URL; ?>images/wp-socializer.png" align="absmiddle"/> WP Socializer <span class="smallText">v<?php echo WPSR_VERSION; ?></span></h2>
1258
 
1259
  <div class="miniWrap introWrap">
1260
+
1261
+ <!-- AddThis Button BEGIN -->
1262
+ <div class="shareList addthis_toolbox addthis_default_style">
1263
+ <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
1264
+ <a class="addthis_button_tweet" tw:text="Check out: WP Socializer - the best social sharing plugin for WordPress with cool all in one features," tw:via="vaakash"></a>
1265
+ <a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
1266
+ <a class="addthis_counter addthis_pill_style"></a>
1267
+ <a class="button alignright" href="http://bit.ly/wpsrDonation" target="_blank">Donate</a>
1268
+ </div>
1269
+ <script type="text/javascript">
1270
+ var addthis_share = {
1271
+ url: 'http://www.aakashweb.com/wordpress-plugins/wp-socializer/',
1272
+ title: 'WP Socializer - the best social sharing plugin for WordPress with cool all in one features',
1273
+ description: 'WP Socializer is an advanced plugin for inserting all kinds of Social bookmarking & sharing buttons. It has super cool features to insert the buttons into posts, sidebar. It also has Floating sharebar.',
1274
+ }
1275
+ var addthis_config = { data_track_clickback: false }
1276
+ </script>
1277
+ <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=vaakash"></script>
1278
+ <!-- AddThis Button END -->
1279
 
1280
  <div class="infoContent"></div>
1281
 
1292
  <?php
1293
  }
1294
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1295
  function wpsr_meta_box(){
1296
  global $post;
1297
 
1345
  }
1346
  }
1347
  add_action('wp_insert_post', 'wpsr_insert_post');
1348
+
1349
+ ## Add notification to the dashboard right now
1350
+ function wpsr_dashboard_rightnow(){
1351
+ $wpsr_settings = get_option('wpsr_settings_data');
1352
+ $wpsr_settings_disablewpsr = $wpsr_settings['disablewpsr'];
1353
+
1354
+ if($wpsr_settings_disablewpsr == 1){
1355
+ echo '<p class="message">' . __('WP Socializer is <span style="color:red;"><b>disabled</b></span>', 'wpsr') . '</p>';
1356
+ }
1357
+ }
1358
+ add_action('rightnow_end','wpsr_dashboard_rightnow');
1359
+
1360
+ ## Add the "WP Socializer" menu to the admin bar.
1361
+ function wpsr_adminbar() {
1362
+ global $wp_admin_bar, $wpdb, $post;
1363
+
1364
+ $pages = array('wp_socializer', 'wp_socializer_other', 'wp_socializer_floating_bar');
1365
+
1366
+ if ( !is_super_admin() || !is_admin_bar_showing() || (isset($_GET['page']) && (in_array($_GET['page'], $pages))) ){
1367
+ return;
1368
+ }
1369
+
1370
+ $adminPage = get_option('home') . '/wp-admin/admin.php?page=wp_socializer'; // Broken link fix v2.1
1371
+
1372
+ $wp_admin_bar->add_menu( array( 'id' => 'wpsr_adminbar_menu', 'title' => 'WP Socializer', 'href' => $adminPage));
1373
+ $wp_admin_bar->add_menu( array( 'id' => 'wpsr_adminbar_edittemplates', 'parent' => 'wpsr_adminbar_menu', 'title' => __('Edit the templates', 'wpsr'), 'href' => $adminPage . '#tab-3'));
1374
+
1375
+ if(is_single() || is_page()){
1376
+ $current_object = get_queried_object();
1377
+ $postEdit = get_option('home') . '/wp-admin/post.php?action=edit&post=' . $post->ID;
1378
+ $wp_admin_bar->add_menu( array( 'id' => 'wpsr_adminbar_disabletemplates', 'parent' => 'wpsr_adminbar_menu', 'title' => __('Disable WP Socializer in this page', 'wpsr'), 'href' => get_edit_post_link($current_object->ID) . '#wp_socializer' ));
1379
+ }
1380
+
1381
+ $wp_admin_bar->add_menu( array( 'id' => 'wpsr_adminbar_help', 'parent' => 'wpsr_adminbar_menu', 'title' => __('Help', 'wpsr'), 'href' => 'http://www.aakashweb.com/wordpress-plugins/wp-socializer/'));
1382
+
1383
+ }
1384
+ add_action('admin_bar_menu', 'wpsr_adminbar', 1000);
1385
+
1386
  ?>
includes/wpsr-floatingbar.php CHANGED
@@ -39,6 +39,9 @@ function wpsr_process_floatingbts(){
39
 
40
  $end .= '</div>';
41
 
 
 
 
42
  return $start . $content . $end;
43
 
44
  }
@@ -66,11 +69,6 @@ function wpsr_floatingbts_output(){
66
  $wpsr_floatbts = get_option('wpsr_template_floating_bar_data');
67
  if(wpsr_floatingbts_check()){
68
  echo do_shortcode(wpsr_process_floatingbts());
69
- echo '
70
- <!-- Start WP Socializer | Floating bar - JS file-->
71
- <script type="text/javascript" src="' . WPSR_PUBLIC_URL . 'js/wp-socializer-floating-bar-js.js?v=' . WPSR_VERSION . '"></script>
72
- <!-- End WP Socializer | Floating bar - JS file -->
73
- ';
74
  }
75
  }
76
  add_action('wp_footer', 'wpsr_floatingbts_output');
39
 
40
  $end .= '</div>';
41
 
42
+ if($wpsr_floatbts['position'] == 'float_left')
43
+ $end .= '<div class="wpsr_shareminbt"></div>';
44
+
45
  return $start . $content . $end;
46
 
47
  }
69
  $wpsr_floatbts = get_option('wpsr_template_floating_bar_data');
70
  if(wpsr_floatingbts_check()){
71
  echo do_shortcode(wpsr_process_floatingbts());
 
 
 
 
 
72
  }
73
  }
74
  add_action('wp_footer', 'wpsr_floatingbts_output');
includes/wpsr-retweet.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  * Retweet buttons Processor code for WP Socializer Plugin
4
- * Version : 2.3
5
  * Author : Aakash Chakravarthy
6
  */
7
 
@@ -15,7 +15,7 @@ function wpsr_retweet_topsy_script(){
15
  function wpsr_retweet_twitter_script(){
16
  // Return the script
17
  return "\n<!-- WP Socializer - Twitter Script -->\n" .
18
- '<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>' .
19
  "\n<!-- WP Socializer - End Twitter Script -->\n";
20
  }
21
 
1
  <?php
2
  /*
3
  * Retweet buttons Processor code for WP Socializer Plugin
4
+ * Version : 2.4
5
  * Author : Aakash Chakravarthy
6
  */
7
 
15
  function wpsr_retweet_twitter_script(){
16
  // Return the script
17
  return "\n<!-- WP Socializer - Twitter Script -->\n" .
18
+ '<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>' .
19
  "\n<!-- WP Socializer - End Twitter Script -->\n";
20
  }
21
 
includes/wpsr-sharethis.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  * Sharethis buttons Processor code for WP Socializer Plugin
4
- * Version : 2.3
5
  * Author : Aakash Chakravarthy
6
  */
7
 
@@ -27,7 +27,11 @@ function wpsr_sharethis_config(){
27
 
28
  // Return the script
29
  return "\n<!-- WP Socializer - ShareThis Config -->\n" .
30
- '<script type="text/javascript">stLight.options({publisher:\'' . $wpsr_sharethis_pubkey . '\'});var st_type=\'wordpress\';</script>' .
 
 
 
 
31
  "\n<!-- WP Socializer - End ShareThis Config -->\n";
32
  }
33
 
1
  <?php
2
  /*
3
  * Sharethis buttons Processor code for WP Socializer Plugin
4
+ * Version : 2.4
5
  * Author : Aakash Chakravarthy
6
  */
7
 
27
 
28
  // Return the script
29
  return "\n<!-- WP Socializer - ShareThis Config -->\n" .
30
+ '<script type="text/javascript">
31
+ var sharethisLoad = function(){ stLight.options({publisher:\'' . $wpsr_sharethis_pubkey . '\'}); }, st_type=\'wordpress\';
32
+ if(window.addEventListener) window.addEventListener("load", sharethisLoad, false);
33
+ else if (window.attachEvent) window.attachEvent("onload", sharethisLoad);
34
+ </script>' .
35
  "\n<!-- WP Socializer - End ShareThis Config -->\n";
36
  }
37
 
public/buttons/min-floatbar.png ADDED
Binary file
public/css/wp-socializer-buttons-css.css CHANGED
@@ -20,8 +20,8 @@
20
  padding: 0px !important;
21
  float: left !important;
22
  }
23
- .wp-socializer ul li:before {
24
- content: "";
25
  }
26
  .wp-socializer img, .wp-socializer-single img{
27
  float: none;
@@ -42,8 +42,7 @@
42
  clear: left;
43
  }
44
 
45
- /** Effects **/
46
-
47
  .wp-socializer-opacity li {
48
  -webkit-opacity: 0.5;
49
  -moz-opacity: 0.5;
@@ -96,7 +95,7 @@
96
  width: 48%;
97
  }
98
 
99
- /** Templates **/
100
  .wp-socializer-buttons{
101
  margin: 0px 0px 10px !important;
102
  padding: 0px !important;
@@ -110,50 +109,8 @@
110
  .wp-socializer-buttons .wpsr-btn iframe{
111
  margin: 0px !important; /** Fix for Facebook v2.4.2 **/
112
  }
113
- /** Facebook clipping fix v2.4.6 **/
114
- .wp-socializer-buttons .wpsr-btn .fb-like .fb_send_button_form_widget > span{
115
- width: 401px !important;
116
- }
117
- .floatleft{
118
- float:left !important;
119
- }
120
- .floatright{
121
- float:right !important;
122
- }
123
- .padding5{
124
- padding: 5px 0px !important;
125
- }
126
- .padding10{
127
- padding: 10px !important;
128
- }
129
- .margin15{
130
- margin: 0px 15px 0px 0px !important;
131
- }
132
- .margin10{
133
- margin: 0px 10px 0px 0px !important;
134
- }
135
- .clear-all{
136
- clear:both;
137
- }
138
- .fixed-pos{
139
- position:fixed !important;
140
- z-index:99999 !important;
141
- background: #FFFFFF;
142
- border: 1px solid #CCCCCC;
143
- }
144
- .border5{
145
- -moz-border-radius: 5px;
146
- border-radius: 5px;
147
- }
148
- .shadow{
149
- -moz-box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.2);
150
- box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.2);
151
- }
152
- .buttons-wrap{
153
- padding: 10px 0px !important;
154
- }
155
 
156
- /* Floating share bar */
157
  .wpsr-floatbar-float_left{
158
  position: absolute;
159
  border: 1px solid;
@@ -211,7 +168,7 @@
211
  height: 35px;
212
  }
213
 
214
- /* Floating bar themes */
215
  .wpsr-floatbar-bottom_fixed.wpsr-floatbar-dark{
216
  border-color: #333;
217
  background-color: #333;
@@ -235,7 +192,7 @@
235
  color: black !important;
236
  }
237
 
238
- /* Link back */
239
  .wpsr-floatbar-float_left .wpsr-linkback{
240
  margin: 15px 0 0 0;
241
  position: absolute;
@@ -316,13 +273,46 @@
316
  border: 0px;
317
  }
318
 
319
- /* Misc */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
320
  .wpsr-floatbar-float_left .wpsr_floatbt .fb-like{
321
  width: 50px !important;
322
  }
323
  .wpsr_floatbt .wp-socializer-single{
324
  margin: 0px;
325
  }
 
 
 
 
 
 
 
 
 
 
326
 
327
  /* Clearfix */
328
  .clearfix:after {
20
  padding: 0px !important;
21
  float: left !important;
22
  }
23
+ .wp-socializer ul li:before, .wp-socializer ul li:after{
24
+ display: none !important;
25
  }
26
  .wp-socializer img, .wp-socializer-single img{
27
  float: none;
42
  clear: left;
43
  }
44
 
45
+ /** EFFECTS **/
 
46
  .wp-socializer-opacity li {
47
  -webkit-opacity: 0.5;
48
  -moz-opacity: 0.5;
95
  width: 48%;
96
  }
97
 
98
+ /** TEMPLATES **/
99
  .wp-socializer-buttons{
100
  margin: 0px 0px 10px !important;
101
  padding: 0px !important;
109
  .wp-socializer-buttons .wpsr-btn iframe{
110
  margin: 0px !important; /** Fix for Facebook v2.4.2 **/
111
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
+ /* FLOATING SHARE BAR */
114
  .wpsr-floatbar-float_left{
115
  position: absolute;
116
  border: 1px solid;
168
  height: 35px;
169
  }
170
 
171
+ /* FLOATING BAR THEMES */
172
  .wpsr-floatbar-bottom_fixed.wpsr-floatbar-dark{
173
  border-color: #333;
174
  background-color: #333;
192
  color: black !important;
193
  }
194
 
195
+ /* LINK BACK */
196
  .wpsr-floatbar-float_left .wpsr-linkback{
197
  margin: 15px 0 0 0;
198
  position: absolute;
273
  border: 0px;
274
  }
275
 
276
+ /* Left float min mode */
277
+ .wpsr_floatbt_min{
278
+ left: 50% !important;
279
+ top: 50% !important;
280
+ position: fixed !important;
281
+ width: 200px;
282
+ margin-left: -100px !important;
283
+ display: none;
284
+ }
285
+ .wpsr_floatbt_min .wpsr_floatbt{
286
+ float: left;
287
+ margin: 10px;
288
+ }
289
+ .wpsr_shareminbt{
290
+ display: none;
291
+ background: url(../buttons/min-floatbar.png);
292
+ position: fixed;
293
+ top: 50%;
294
+ left: 0;
295
+ width: 64px;
296
+ height: 64px;
297
+ }
298
+
299
+ /* ADJUSTMENTS */
300
  .wpsr-floatbar-float_left .wpsr_floatbt .fb-like{
301
  width: 50px !important;
302
  }
303
  .wpsr_floatbt .wp-socializer-single{
304
  margin: 0px;
305
  }
306
+ /* Fix fbpop cliping*/
307
+ .fb-like span > iframe{
308
+ max-width: none !important;
309
+ position: static !important;
310
+ z-index: 9999 !important;
311
+ }
312
+ /* Hide fbpop to bottom_fixed */
313
+ .wpsr-floatbar-bottom_fixed .fb-like > span{
314
+ overflow: hidden !important;
315
+ }
316
 
317
  /* Clearfix */
318
  .clearfix:after {
public/js/wp-socializer-floating-bar-js.js CHANGED
@@ -1,7 +1,7 @@
1
  /*
2
- * Copyright 2012 Aakash Chakravarthy - www.aakashweb.com
3
  * Created for WP Socializer - Wordpress Plugin
4
- * v1.3
5
  */
6
 
7
  if(typeof jQuery == 'undefined'){
@@ -45,21 +45,41 @@ jQuery(document).ready(function(){
45
  }
46
  });
47
  }
48
-
49
- // On Window resize
 
 
 
 
 
50
  jQuery(window).resize(function(){
51
  wpsr_position_floatbar();
 
52
  });
53
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  if(window.addEventListener){
55
  window.addEventListener("load", wpsr_position_floatbar, false);}
56
  else if (window.attachEvent){
57
  window.attachEvent("onload", wpsr_position_floatbar);
58
  }
59
 
 
60
  wpsr_position_floatbar();
 
61
 
62
- // Hiding the bar
63
  var shareBarWidth = jQuery('.wpsr-floatbar-bottom_fixed').width();
64
 
65
  var hideShareBar = function(){
1
  /*
2
+ * Copyright 2013 Aakash Chakravarthy - www.aakashweb.com
3
  * Created for WP Socializer - Wordpress Plugin
4
+ * v1.4
5
  */
6
 
7
  if(typeof jQuery == 'undefined'){
45
  }
46
  });
47
  }
48
+
49
+ // MINIMIZE THE FLOATING BAR
50
+ jQuery('.wpsr_shareminbt').click(function(){
51
+ $floatbar.fadeToggle();
52
+ });
53
+
54
+ // **
55
  jQuery(window).resize(function(){
56
  wpsr_position_floatbar();
57
+ minLeftShareBar(); // Since v2.4.9
58
  });
59
 
60
+ // **
61
+ var minLeftShareBar = function(){
62
+ if(typeof window.innerWidth !== 'undefined' && window.innerWidth < 800 ){
63
+ $floatbar.addClass('wpsr_floatbt_min').hide();
64
+ jQuery('.wpsr_shareminbt').fadeIn();
65
+ }else{
66
+ $floatbar.removeClass('wpsr_floatbt_min').fadeIn();
67
+ jQuery('.wpsr_shareminbt').hide();
68
+ };
69
+ }
70
+
71
+ // ONLOAD POSITIONING
72
  if(window.addEventListener){
73
  window.addEventListener("load", wpsr_position_floatbar, false);}
74
  else if (window.attachEvent){
75
  window.attachEvent("onload", wpsr_position_floatbar);
76
  }
77
 
78
+ // INITS
79
  wpsr_position_floatbar();
80
+ minLeftShareBar();
81
 
82
+ // BOTTOM FIXED MINIMIZING
83
  var shareBarWidth = jQuery('.wpsr-floatbar-bottom_fixed').width();
84
 
85
  var hideShareBar = function(){
readme.txt CHANGED
@@ -6,8 +6,8 @@ Tags: social, social bookmarking, bookmarks, bookmarking, bookmarks menu, share,
6
  License: GPLv2 or later
7
  Donate Link: http://bit.ly/wpsrDonation
8
  Requires at least: 3.1
9
- Tested up to: 3.5.2
10
- Stable tag: 2.4.8
11
 
12
  Super Cool Plugin for inserting all kinds of Social Bookmarking & Sharing buttons. Has customizable Floating Share Bar, Widgets, Shortcodes also.
13
 
@@ -25,6 +25,7 @@ WP Socializer is an advanced plugin for inserting all kinds of Social bookmarkin
25
  * Has Shortcodes for all buttons.
26
  * Widgets for inserting FB like box & G+ badges in sidebar.
27
  * Template functions are available for advanced placements.
 
28
 
29
  = Buttons available =
30
 
@@ -63,14 +64,13 @@ There are whole lot of Social bookmarking buttons avaialble in WP Socializer, wh
63
  > **Donate:** If you find this plugin useful, [consider making a donation](http://bit.ly/wpsrDonation), it will make me happy for this plugin!!
64
 
65
  = New features and fixed bugs =
66
- * Floating sharebar can now be floated on right side also.
67
- * Smarter tracing of images in a post for pinterest.
68
- * Bug fixed in the "title" tag for twitter in the urlencoding of hyphen.
69
- * Bug fixed in the mailto link for the "email" button
70
- * Admin interface tweaked and now more helpful and easy
71
- * Fixed several "W3 Validator" errors
72
- * Several WordPress notices are fixed.
73
-
74
  [More changes listed in Changelog](changelog)
75
 
76
  = Reference links =
@@ -122,6 +122,15 @@ For custom placement in theme files and posts, check out the following documenta
122
 
123
  == Changelog ==
124
 
 
 
 
 
 
 
 
 
 
125
  = 2.4.8 =
126
  * Added option to adjust the distance between the floating sharebar and the post.
127
  * Sharebar can be floated on right side also.
@@ -237,7 +246,7 @@ For custom placement in theme files and posts, check out the following documenta
237
 
238
  == Upgrade Notice ==
239
 
240
- Version 2.4.x is a recommended upgrade to get all the latest social bookmarking and sharing buttons avaialble in the Internet. Various bugs are fixed and the admin UI is completely changed for easy use.
241
 
242
  == Credits ==
243
 
6
  License: GPLv2 or later
7
  Donate Link: http://bit.ly/wpsrDonation
8
  Requires at least: 3.1
9
+ Tested up to: 3.6
10
+ Stable tag: 2.4.9
11
 
12
  Super Cool Plugin for inserting all kinds of Social Bookmarking & Sharing buttons. Has customizable Floating Share Bar, Widgets, Shortcodes also.
13
 
25
  * Has Shortcodes for all buttons.
26
  * Widgets for inserting FB like box & G+ badges in sidebar.
27
  * Template functions are available for advanced placements.
28
+ * (NEW) Floating sharebar now optimized for mobile devices also.
29
 
30
  = Buttons available =
31
 
64
  > **Donate:** If you find this plugin useful, [consider making a donation](http://bit.ly/wpsrDonation), it will make me happy for this plugin!!
65
 
66
  = New features and fixed bugs =
67
+ * Added mobile optimization or small screen support for the floating sharebar
68
+ * Facebook comments popup clipping is fixed.
69
+ * Sharethis "undefined" object issue is fixed.
70
+ * Social button CSS file size is reduced and notable tweaks are made to the social buttons.
71
+ * Scripts and styles are now loaded properly in the frontend as per the API
72
+ * Source code is revised and optimized.
73
+
 
74
  [More changes listed in Changelog](changelog)
75
 
76
  = Reference links =
122
 
123
  == Changelog ==
124
 
125
+ = 2.4.9 =
126
+ * Added mobile optimization or small screen support for the floating sharebar
127
+ * Facebook comments popup clipping is fixed.
128
+ * Sharethis "undefined" object issue is fixed.
129
+ * Social button CSS file size is reduced and notable tweaks are made to the social buttons.
130
+ * Scripts and styles are now loaded properly in the frontend as per the API
131
+ * Source code is revised and optimized.
132
+ * Some minor admin UI improvements are made.
133
+
134
  = 2.4.8 =
135
  * Added option to adjust the distance between the floating sharebar and the post.
136
  * Sharebar can be floated on right side also.
246
 
247
  == Upgrade Notice ==
248
 
249
+ Version 2.4.x is a recommended upgrade to get all the latest social bookmarking and sharing buttons available in the Internet. Various bugs are fixed and the admin UI is completely changed for easy use.
250
 
251
  == Credits ==
252
 
wp-socializer.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: WP Socializer
4
- Version: 2.4.8
5
  Plugin URI: http://www.aakashweb.com/
6
  Description: WP Socializer is an advanced plugin for inserting all kinds of Social bookmarking & sharing buttons. It has super cool features to insert the buttons into posts, sidebar. It also has Floating sharebar and Smart load feature. <a href="http://youtu.be/1uimAE8rFYE" target="_blank">Check out the demo video</a>.
7
  Author: Aakash Chakravarthy
@@ -14,7 +14,7 @@ if(!defined('WP_CONTENT_URL')) {
14
  $wpsr_url = WP_CONTENT_URL . '/plugins/' . plugin_basename(dirname(__FILE__)) . '/';
15
  }
16
 
17
- define('WPSR_VERSION', '2.4.8');
18
  define('WPSR_AUTHOR', 'Aakash Chakravarthy');
19
  define('WPSR_URL', $wpsr_url);
20
  define('WPSR_PUBLIC_URL', WPSR_URL . 'public/');
@@ -976,34 +976,6 @@ $wpsr_addthis_lang_array = array(
976
  'en'=>'English', 'ar'=>'Arabic', 'zh'=>'Chinese', 'cs'=>'Czech', 'da'=>'Danish', 'nl'=>'Dutch','fa'=>'Farsi', 'fi'=>'Finnish', 'fr'=>'French', 'ga'=>'Gaelic', 'de'=>'German', 'el'=>'Greek', 'he'=>'Hebrew', 'hi'=>'Hindi', 'it'=>'Italian', 'ja'=>'Japanese', 'ko'=>'Korean', 'lv'=>'Latvian', 'lt'=>'Lithuanian', 'no'=>'Norwegian', 'pl'=>'Polish', 'pt'=>'Portugese', 'ro'=>'Romanian', 'ru'=>'Russian', 'sk'=>'Slovakian', 'sl'=>'Slovenian', 'es'=>'Spanish', 'sv'=>'Swedish', 'th'=>'Thai', 'ur'=>'Urdu', 'cy'=>'Welsh', 'vi'=>'Vietnamese'
977
  );
978
 
979
- ## Initializations
980
- function wpsr_init(){
981
- global $wpsr_default_templates;
982
- $user_template = get_option('wpsr_templates');
983
-
984
- if(empty($user_template)){
985
- update_option('wpsr_templates', $wpsr_default_templates);
986
- }else{
987
- $merged_array = $wpsr_default_templates + $user_template;
988
- if($user_template != $merged_array){
989
- update_option('wpsr_templates', $merged_array);
990
- }
991
- }
992
-
993
- // Include the plugin translations
994
- load_plugin_textdomain('wpsr', false, dirname(plugin_basename( __FILE__ )) . '/languages');
995
- }
996
- add_action('admin_init','wpsr_init');
997
-
998
- ## General function
999
- function strpos_arr($haystack, $needle) {
1000
- if(!is_array($needle)) $needle = array($needle);
1001
- foreach($needle as $what) {
1002
- if(($pos = strpos($haystack, $what))!==false) return $pos;
1003
- }
1004
- return false;
1005
- }
1006
-
1007
  ## Include WP Socializer Processer files
1008
  require_once('admin/wpsr-admin.php');
1009
  require_once('admin/wpsr-admin-other.php');
@@ -1021,66 +993,46 @@ require_once('includes/wpsr-shortcodes.php');
1021
  require_once('includes/wpsr-widgets.php'); // Since v2.3
1022
  require_once('includes/wpsr-floatingbar.php'); // Since v2.4
1023
 
1024
- ## wpsr Is active check
1025
- function wpsr_is_active(){
1026
- if (get_option("wpsr_active") == 1) {
1027
- return 1;
1028
- }else{
1029
- return 0;
1030
- }
1031
- }
1032
-
1033
- ## wpsr plugin activate
1034
  function wpsr_plugin_activate(){
1035
- // Set the defaults to the first time users
1036
- $active = get_option('wpsr_active');
1037
- if($active == ''){
1038
- wpsr_reset_values();
1039
- }
1040
- update_option("wpsr_active", 1);
1041
 
1042
  // Set the defaults to the Floating share bar
1043
  $floatbts = get_option('wpsr_template_floating_bar_data');
1044
- if($floatbts == ''){
1045
- wpsr_floatbts_reset_values();
1046
- }
1047
  }
1048
  register_activation_hook(__FILE__, 'wpsr_plugin_activate');
1049
 
1050
- ## wpsr plugin deactivate
1051
- function wpsr_plugin_deactivate(){
1052
- update_option("wpsr_active", 0);
1053
- }
1054
- register_deactivation_hook(__FILE__, 'wpsr_plugin_deactivate');
1055
-
1056
- ## Admin Notices
1057
- function wpsr_admin_notices(){
1058
- if(!wpsr_is_active() && $_GET['page'] != 'wp_socializer'){
1059
- echo '<div class="updated fade"><p>' . __('<b>WP Socializer</b> plugin is intalled. Please adjust your settings', 'wpsr') . ' <a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=wp_socializer">' . __('in this page', 'wpsr') . '.</a></p></div>';
1060
- }
1061
- }
1062
- add_action('admin_notices', 'wpsr_admin_notices');
1063
 
1064
- ## Action Links
1065
- function wpsr_plugin_actions($links, $file){
1066
- static $this_plugin;
1067
- if(!$this_plugin) $this_plugin = plugin_basename(__FILE__);
1068
- if( $file == $this_plugin ){
1069
- $settings_link = '<a href="admin.php?page=wp_socializer">' . __('Settings' ,'wpsr') . '</a> ' . '|' . ' <a href="http://bit.ly/wpsrDonation" target="_blank">' . __('Donate' ,'wpsr') . '</a>';
1070
- $links = array_merge( array($settings_link), $links);
 
 
 
 
 
 
 
 
 
 
 
 
1071
  }
1072
- return $links;
1073
- }
1074
- add_filter('plugin_action_links', 'wpsr_plugin_actions', 10, 2);
1075
 
1076
- ## Include jQuery for floating share bar.
1077
- function wpsr_enqueue_jquery(){
1078
- // jQuery
1079
- //wp_deregister_script('jquery');
1080
- //wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"), false, WPSR_VERSION); // Incompatibility fix for other jQuery plugins
1081
- wp_enqueue_script('jquery');
1082
  }
1083
- add_action('wp_enqueue_scripts', 'wpsr_enqueue_jquery');
1084
 
1085
  /**
1086
  * One function for displaying the buttons in theme files
@@ -1394,21 +1346,6 @@ class WPSR_Template_Output{
1394
  }
1395
  };
1396
 
1397
- ## Add required filters and check whether WP Socializer is disabled
1398
- $wpsr_settings = get_option('wpsr_settings_data');
1399
-
1400
- if(!$wpsr_settings['disablewpsr']){
1401
-
1402
- // Create dummy objects to hold the call type
1403
- $wpsr_content_op = new WPSR_Template_Output('content');
1404
- $wpsr_excerpt_op = new WPSR_Template_Output('excerpt');
1405
-
1406
- // Filters
1407
- add_filter('the_content', array($wpsr_content_op, 'output'));
1408
- add_filter('the_excerpt', array($wpsr_excerpt_op, 'output'));
1409
-
1410
- }
1411
-
1412
  ## Checks whether the button is used in any of the templates
1413
  function wpsr_button_used($name){
1414
  $temp_data = '';
@@ -1432,7 +1369,7 @@ function wpsr_button_used($name){
1432
 
1433
  $temp_data .= wpsr_process_floatingbts();
1434
 
1435
- $is_bt_used = strpos_arr($temp_data, $button_codes[$name]);
1436
 
1437
  if ($is_bt_used === false) {
1438
  return 0;
@@ -1445,14 +1382,6 @@ function wpsr_button_used($name){
1445
  ## Add the button scripts to the header
1446
  function wpsr_scripts_adder(){
1447
 
1448
- ## Social Button options
1449
- $wpsr_socialbt = get_option('wpsr_socialbt_data');
1450
- $wpsr_socialbt_loadcss = $wpsr_socialbt['loadcss'];
1451
-
1452
- if($wpsr_socialbt_loadcss == 1){
1453
- wpsr_socialbts_script();
1454
- }
1455
-
1456
  # Get Retweet Button Option
1457
  $wpsr_retweet = get_option('wpsr_retweet_data');
1458
  $wpsr_retweet_service = $wpsr_retweet['service'];
@@ -1470,13 +1399,13 @@ function wpsr_scripts_adder(){
1470
  }
1471
 
1472
  if(wpsr_button_used('retweet') == 1 && $wpsr_retweet_service == 'twitter'){
1473
- array_push($scripts, '"http://platform.twitter.com/widgets.js"');
1474
  }
1475
 
1476
  if(wpsr_button_used('facebook') == 1){
1477
  $fbappid = $wpsr_facebook['appid'];
1478
  $fbparam = ($fbappid == '') ? '' : '&appId=' . $fbappid;
1479
- array_push($scripts, '"http://connect.facebook.net/en_US/all.js#xfbml=1' . $fbparam . '"');
1480
  }
1481
 
1482
  if(wpsr_button_used('digg') == 1){
@@ -1485,7 +1414,7 @@ function wpsr_scripts_adder(){
1485
 
1486
  if(wpsr_button_used('addthis') == 1){
1487
  echo wpsr_addthis_config();
1488
- array_push($scripts, '"http://s7.addthis.com/js/300/addthis_widget.js"');
1489
  }
1490
 
1491
  if(wpsr_button_used('sharethis') == 1){
@@ -1498,15 +1427,15 @@ function wpsr_scripts_adder(){
1498
  }
1499
 
1500
  if(wpsr_button_used('linkedin') == 1){
1501
- array_push($scripts, '"http://platform.linkedin.com/in.js"');
1502
  }
1503
 
1504
  if(wpsr_button_used('stumbleupon') == 1){
1505
- array_push($scripts, '"http://platform.stumbleupon.com/1/widgets.js"');
1506
  }
1507
 
1508
  if(wpsr_button_used('pinterest') == 1){
1509
- array_push($scripts, '"http://assets.pinterest.com/js/pinit.js"');
1510
  }
1511
 
1512
  $scriptsCount = count($scripts);
@@ -1514,12 +1443,11 @@ function wpsr_scripts_adder(){
1514
 
1515
  if($wpsr_settings['smartload'] == 'normal' || $wpsr_settings['smartload'] == ''){
1516
  $scriptsFnc = 'wpsrload();';
1517
- /*}elseif($wpsr_settings['smartload'] == 'window'){
1518
- $scriptsFnc = 'function wpsraddload(a){if(window.addEventListener){window.addEventListener("load", a, false);}else if (window.attachEvent){window.attachEvent("onload", a);}} wpsraddload(wpsrload);';*/
1519
  }elseif($wpsr_settings['smartload'] == 'timeout'){
1520
  $scriptsFnc = 'setTimeout(wpsrload, ' . $wpsr_settings['smartload_timeout']*1000 . ');';
1521
  }
1522
 
 
1523
  if(!empty($scripts)){
1524
  echo "\n<!--WP Socializer v" . WPSR_VERSION . " - Scripts Loader-->";
1525
  echo '
@@ -1534,57 +1462,49 @@ echo "<!--End WP Socializer - Scripts Loader-->\n";
1534
 
1535
  }
1536
 
1537
- ## Add the misc/small scripts to the footer
1538
- function wpsr_footer(){
1539
- if(wpsr_addtofavorites_bt_used()){
1540
- wpsr_addtofavorites_script();
1541
- }
1542
- }
1543
-
1544
- if(!$wpsr_settings['disablewpsr']){
1545
- if($wpsr_settings['scriptsplace'] == 'header'){
1546
- add_action('wp_head', 'wpsr_scripts_adder');
1547
- }else{
1548
- add_action('wp_footer', 'wpsr_scripts_adder');
1549
- }
1550
 
1551
- add_action('wp_footer', 'wpsr_footer');
1552
-
1553
- }
1554
-
1555
- ## Add notification to the dashboard right now
1556
- function wpsr_dashboard_rightnow(){
1557
  $wpsr_settings = get_option('wpsr_settings_data');
1558
- $wpsr_settings_disablewpsr = $wpsr_settings['disablewpsr'];
1559
 
1560
- if($wpsr_settings_disablewpsr == 1){
1561
- echo '<p class="message">' . __('WP Socializer is <span style="color:red;"><b>disabled</b></span>', 'wpsr') . '</p>';
1562
- }
1563
- }
1564
- add_action('rightnow_end','wpsr_dashboard_rightnow');
1565
-
1566
- ## Add the "WP Socializer" menu to the admin bar.
1567
- function wpsr_adminbar() {
1568
- global $wp_admin_bar, $wpdb, $post;
1569
- if ( !is_super_admin() || !is_admin_bar_showing()){
1570
- return;
1571
- }
1572
 
1573
- $adminPage = get_option('home') . '/wp-admin/admin.php?page=wp_socializer'; // Broken link fix v2.1
 
 
 
 
1574
 
1575
- $wp_admin_bar->add_menu( array( 'id' => 'wpsr_adminbar_menu', 'title' => 'WP Socializer', 'href' => $adminPage));
1576
- $wp_admin_bar->add_menu( array( 'id' => 'wpsr_adminbar_edittemplates', 'parent' => 'wpsr_adminbar_menu', 'title' => __('Edit the templates', 'wpsr'), 'href' => $adminPage . '#tab-3'));
 
 
 
 
 
 
 
 
 
 
1577
 
1578
- if(is_single() || is_page()){
1579
- $current_object = get_queried_object();
1580
- $postEdit = get_option('home') . '/wp-admin/post.php?action=edit&post=' . $post->ID;
1581
- $wp_admin_bar->add_menu( array( 'id' => 'wpsr_adminbar_disabletemplates', 'parent' => 'wpsr_adminbar_menu', 'title' => __('Disable WP Socializer in this page', 'wpsr'), 'href' => get_edit_post_link($current_object->ID) . '#wp_socializer' ));
1582
  }
1583
 
1584
- $wp_admin_bar->add_menu( array( 'id' => 'wpsr_adminbar_help', 'parent' => 'wpsr_adminbar_menu', 'title' => __('Help', 'wpsr'), 'href' => 'http://www.aakashweb.com/wordpress-plugins/wp-socializer/'));
1585
-
1586
  }
1587
- add_action('admin_bar_menu', 'wpsr_adminbar', 1000);
 
 
 
 
 
 
 
 
 
 
 
 
1588
 
1589
  /*
1590
  * TinyMCE button for post editor
@@ -1615,4 +1535,13 @@ function wpsr_add_wpsrbutton_tinymce($plugin_array) {
1615
 
1616
  // init process for button control
1617
  add_action('init', 'wpsr_add_wpsr_button');
 
 
 
 
 
 
 
 
 
1618
  ?>
1
  <?php
2
  /*
3
  Plugin Name: WP Socializer
4
+ Version: 2.4.9
5
  Plugin URI: http://www.aakashweb.com/
6
  Description: WP Socializer is an advanced plugin for inserting all kinds of Social bookmarking & sharing buttons. It has super cool features to insert the buttons into posts, sidebar. It also has Floating sharebar and Smart load feature. <a href="http://youtu.be/1uimAE8rFYE" target="_blank">Check out the demo video</a>.
7
  Author: Aakash Chakravarthy
14
  $wpsr_url = WP_CONTENT_URL . '/plugins/' . plugin_basename(dirname(__FILE__)) . '/';
15
  }
16
 
17
+ define('WPSR_VERSION', '2.4.9');
18
  define('WPSR_AUTHOR', 'Aakash Chakravarthy');
19
  define('WPSR_URL', $wpsr_url);
20
  define('WPSR_PUBLIC_URL', WPSR_URL . 'public/');
976
  'en'=>'English', 'ar'=>'Arabic', 'zh'=>'Chinese', 'cs'=>'Czech', 'da'=>'Danish', 'nl'=>'Dutch','fa'=>'Farsi', 'fi'=>'Finnish', 'fr'=>'French', 'ga'=>'Gaelic', 'de'=>'German', 'el'=>'Greek', 'he'=>'Hebrew', 'hi'=>'Hindi', 'it'=>'Italian', 'ja'=>'Japanese', 'ko'=>'Korean', 'lv'=>'Latvian', 'lt'=>'Lithuanian', 'no'=>'Norwegian', 'pl'=>'Polish', 'pt'=>'Portugese', 'ro'=>'Romanian', 'ru'=>'Russian', 'sk'=>'Slovakian', 'sl'=>'Slovenian', 'es'=>'Spanish', 'sv'=>'Swedish', 'th'=>'Thai', 'ur'=>'Urdu', 'cy'=>'Welsh', 'vi'=>'Vietnamese'
977
  );
978
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
979
  ## Include WP Socializer Processer files
980
  require_once('admin/wpsr-admin.php');
981
  require_once('admin/wpsr-admin-other.php');
993
  require_once('includes/wpsr-widgets.php'); // Since v2.3
994
  require_once('includes/wpsr-floatingbar.php'); // Since v2.4
995
 
996
+ ## On plugin activate
 
 
 
 
 
 
 
 
 
997
  function wpsr_plugin_activate(){
998
+
999
+ // Set the defaults plugin when the options are not set
1000
+ $wpsr_settings = get_option('wpsr_settings_data');
1001
+ if( empty($wpsr_settings) ) wpsr_reset_values();
 
 
1002
 
1003
  // Set the defaults to the Floating share bar
1004
  $floatbts = get_option('wpsr_template_floating_bar_data');
1005
+ if( empty($floatbts) ) wpsr_floatbts_reset_values();
1006
+
 
1007
  }
1008
  register_activation_hook(__FILE__, 'wpsr_plugin_activate');
1009
 
1010
+ ## On init filters and actions
1011
+ function wpsr_init(){
 
 
 
 
 
 
 
 
 
 
 
1012
 
1013
+ ## Add required filters and check whether WP Socializer is disabled
1014
+ $wpsr_settings = get_option('wpsr_settings_data');
1015
+
1016
+ if(!$wpsr_settings['disablewpsr']){
1017
+
1018
+ // Create dummy objects to hold the call type
1019
+ $wpsr_content_op = new WPSR_Template_Output('content');
1020
+ $wpsr_excerpt_op = new WPSR_Template_Output('excerpt');
1021
+
1022
+ // Above and below content filters
1023
+ add_filter('the_content', array($wpsr_content_op, 'output'));
1024
+ add_filter('the_excerpt', array($wpsr_excerpt_op, 'output'));
1025
+
1026
+ // Add the scripts loader to the page
1027
+ if($wpsr_settings['scriptsplace'] == 'header'){
1028
+ add_action('wp_head', 'wpsr_scripts_adder');
1029
+ }else{
1030
+ add_action('wp_footer', 'wpsr_scripts_adder');
1031
+ }
1032
  }
 
 
 
1033
 
 
 
 
 
 
 
1034
  }
1035
+ add_action('init', 'wpsr_init');
1036
 
1037
  /**
1038
  * One function for displaying the buttons in theme files
1346
  }
1347
  };
1348
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1349
  ## Checks whether the button is used in any of the templates
1350
  function wpsr_button_used($name){
1351
  $temp_data = '';
1369
 
1370
  $temp_data .= wpsr_process_floatingbts();
1371
 
1372
+ $is_bt_used = wpsr_helper_strposa($temp_data, $button_codes[$name]);
1373
 
1374
  if ($is_bt_used === false) {
1375
  return 0;
1382
  ## Add the button scripts to the header
1383
  function wpsr_scripts_adder(){
1384
 
 
 
 
 
 
 
 
 
1385
  # Get Retweet Button Option
1386
  $wpsr_retweet = get_option('wpsr_retweet_data');
1387
  $wpsr_retweet_service = $wpsr_retweet['service'];
1399
  }
1400
 
1401
  if(wpsr_button_used('retweet') == 1 && $wpsr_retweet_service == 'twitter'){
1402
+ array_push($scripts, '"https://platform.twitter.com/widgets.js"');
1403
  }
1404
 
1405
  if(wpsr_button_used('facebook') == 1){
1406
  $fbappid = $wpsr_facebook['appid'];
1407
  $fbparam = ($fbappid == '') ? '' : '&appId=' . $fbappid;
1408
+ array_push($scripts, '"https://connect.facebook.net/en_US/all.js#xfbml=1' . $fbparam . '"');
1409
  }
1410
 
1411
  if(wpsr_button_used('digg') == 1){
1414
 
1415
  if(wpsr_button_used('addthis') == 1){
1416
  echo wpsr_addthis_config();
1417
+ array_push($scripts, '"https://s7.addthis.com/js/300/addthis_widget.js"');
1418
  }
1419
 
1420
  if(wpsr_button_used('sharethis') == 1){
1427
  }
1428
 
1429
  if(wpsr_button_used('linkedin') == 1){
1430
+ array_push($scripts, '"https://platform.linkedin.com/in.js"');
1431
  }
1432
 
1433
  if(wpsr_button_used('stumbleupon') == 1){
1434
+ array_push($scripts, '"https://platform.stumbleupon.com/1/widgets.js"');
1435
  }
1436
 
1437
  if(wpsr_button_used('pinterest') == 1){
1438
+ array_push($scripts, '"https://assets.pinterest.com/js/pinit.js"');
1439
  }
1440
 
1441
  $scriptsCount = count($scripts);
1443
 
1444
  if($wpsr_settings['smartload'] == 'normal' || $wpsr_settings['smartload'] == ''){
1445
  $scriptsFnc = 'wpsrload();';
 
 
1446
  }elseif($wpsr_settings['smartload'] == 'timeout'){
1447
  $scriptsFnc = 'setTimeout(wpsrload, ' . $wpsr_settings['smartload_timeout']*1000 . ');';
1448
  }
1449
 
1450
+ // Print the scripts loader
1451
  if(!empty($scripts)){
1452
  echo "\n<!--WP Socializer v" . WPSR_VERSION . " - Scripts Loader-->";
1453
  echo '
1462
 
1463
  }
1464
 
1465
+ ## Include the required scripts and stylesheets for the plugin
1466
+ function wpsr_enqueue_scripts(){
 
 
 
 
 
 
 
 
 
 
 
1467
 
1468
+ // Load the settings array
 
 
 
 
 
1469
  $wpsr_settings = get_option('wpsr_settings_data');
 
1470
 
1471
+ if(!$wpsr_settings['disablewpsr'] && !is_admin() ){
 
 
 
 
 
 
 
 
 
 
 
1472
 
1473
+ // Floating sharebar
1474
+ if(wpsr_floatingbts_check()){
1475
+ wp_enqueue_script('jquery');
1476
+ wp_enqueue_script( 'wpsr-floatingbar', WPSR_PUBLIC_URL . 'js/wp-socializer-floating-bar-js.js' , array('jquery'), WPSR_VERSION );
1477
+ }
1478
 
1479
+ // Bookmarking file.
1480
+ if(wpsr_addtofavorites_bt_used()){
1481
+ wp_enqueue_script( 'wpsr-bookmarks', WPSR_PUBLIC_URL . 'js/wp-socializer-bookmark-js.js' , false, WPSR_VERSION, true );
1482
+ }
1483
+
1484
+ // Social buttons stylesheet file
1485
+ $wpsr_socialbt = get_option('wpsr_socialbt_data');
1486
+ $wpsr_socialbt_loadcss = $wpsr_socialbt['loadcss'];
1487
+
1488
+ if($wpsr_socialbt_loadcss == 1){
1489
+ wp_enqueue_style( 'wpsr-socialbuttons', WPSR_PUBLIC_URL . 'css/wp-socializer-buttons-css.css' , false, WPSR_VERSION );
1490
+ }
1491
 
 
 
 
 
1492
  }
1493
 
 
 
1494
  }
1495
+ add_action('wp_enqueue_scripts', 'wpsr_enqueue_scripts');
1496
+
1497
+ ## Action Links
1498
+ function wpsr_plugin_actions($links, $file){
1499
+ static $this_plugin;
1500
+ if(!$this_plugin) $this_plugin = plugin_basename(__FILE__);
1501
+ if( $file == $this_plugin ){
1502
+ $settings_link = '<a href="admin.php?page=wp_socializer">' . __('Settings' ,'wpsr') . '</a> ' . '|' . ' <a href="http://bit.ly/wpsrDonation" target="_blank">' . __('Donate' ,'wpsr') . '</a>';
1503
+ $links = array_merge( array($settings_link), $links);
1504
+ }
1505
+ return $links;
1506
+ }
1507
+ add_filter('plugin_action_links', 'wpsr_plugin_actions', 10, 2);
1508
 
1509
  /*
1510
  * TinyMCE button for post editor
1535
 
1536
  // init process for button control
1537
  add_action('init', 'wpsr_add_wpsr_button');
1538
+
1539
+ ## Helpers
1540
+ function wpsr_helper_strposa($haystack, $needle) {
1541
+ if(!is_array($needle)) $needle = array($needle);
1542
+ foreach($needle as $what) {
1543
+ if(($pos = strpos($haystack, $what))!==false) return $pos;
1544
+ }
1545
+ return false;
1546
+ }
1547
  ?>