Social Login - Version 5.3

Version Description

  • New icon set added
  • Social Login interface improved
  • Social Network avatar removed when unlinking account
  • Social Link reviewed and improved
  • Undefined index fixed
Download this release

Release Info

Developer ClaudeSchlesser
Plugin Icon 128x128 Social Login
Version 5.3
Comparing to
See all releases

Code changes from version 5.2 to 5.3

assets/css/admin.css CHANGED
@@ -46,6 +46,10 @@
46
  padding: 10px 15px;
47
  }
48
 
 
 
 
 
49
  .oa_social_login_box .oa_social_login_box_title {
50
  border-bottom: 1px solid #ccc;
51
  font-size: 15px;
@@ -94,6 +98,12 @@
94
 
95
  #oa_social_login_box_status {
96
  background-color: #E1EDFF;
 
 
 
 
 
 
97
  }
98
 
99
  #oa_social_login_box_notice {
@@ -141,12 +151,16 @@
141
  }
142
 
143
  .oa_social_login_table tr.row_head th {
144
- font-size: 13px;
145
  font-weight: bold;
146
  background-color: #3E687B;
147
  color: #fff;
148
  text-shadow: 0 1px 0 #333;
149
- padding-left: 10px;
 
 
 
 
150
  }
151
 
152
  .oa_social_login_table tr.row_head th a {
46
  padding: 10px 15px;
47
  }
48
 
49
+ .oa_social_login_box p{
50
+ font-size:14px;
51
+ }
52
+
53
  .oa_social_login_box .oa_social_login_box_title {
54
  border-bottom: 1px solid #ccc;
55
  font-size: 15px;
98
 
99
  #oa_social_login_box_status {
100
  background-color: #E1EDFF;
101
+ margin-bottom: 10px;
102
+ }
103
+
104
+ #oa_social_login_box_status p{
105
+ text-align:center;
106
+ font-size: 15px;
107
  }
108
 
109
  #oa_social_login_box_notice {
151
  }
152
 
153
  .oa_social_login_table tr.row_head th {
154
+ font-size: 14px;
155
  font-weight: bold;
156
  background-color: #3E687B;
157
  color: #fff;
158
  text-shadow: 0 1px 0 #333;
159
+ padding: 15px 10px;
160
+ }
161
+
162
+ .oa_social_login_table tr td img{
163
+ vertical-align:middle;
164
  }
165
 
166
  .oa_social_login_table tr.row_head th a {
assets/img/loudvoice.png CHANGED
Binary file
assets/img/theme_classic.png ADDED
Binary file
assets/img/theme_modern.png ADDED
Binary file
assets/img/theme_small.png ADDED
Binary file
includes/admin.php CHANGED
@@ -29,22 +29,30 @@ function oa_social_login_admin_user_colum_display ($value, $column_name, $user_i
29
  return $value;
30
  }
31
 
32
- //Read Identity Provider
33
- $meta_identity_providers = trim (strval (get_user_meta ($user_id, 'oa_social_login_identity_provider', true)));
34
- if (strlen ($meta_identity_providers) > 0)
 
 
35
  {
36
- $meta_identity_providers = array_unique (explode ("|", $meta_identity_providers));
 
 
 
 
 
 
37
  }
38
 
39
- //Social Login Registration
40
- if (is_array ($meta_identity_providers) AND count ($meta_identity_providers) > 0)
41
  {
42
- return '<strong>Social Login</strong>: ' . implode (", ", $meta_identity_providers);
43
  }
44
  //Traditional Registration
45
  else
46
  {
47
- return __ ('Registration Form', 'oa_social_login');
48
  }
49
  }
50
  add_action ('manage_users_custom_column', 'oa_social_login_admin_user_colum_display', 10, 3);
@@ -54,7 +62,7 @@ add_action ('manage_users_custom_column', 'oa_social_login_admin_user_colum_disp
54
  * Add administration area links
55
  **/
56
  function oa_social_login_admin_menu ()
57
- {
58
  //Setup
59
  $page = add_menu_page ('OneAll Social Login ' . __ ('Setup', 'oa_social_login'), 'Social Login', 'manage_options', 'oa_social_login_setup', 'oa_display_social_login_setup');
60
  add_action ('admin_print_styles-' . $page, 'oa_social_login_admin_css');
@@ -66,7 +74,7 @@ function oa_social_login_admin_menu ()
66
  //Sharing
67
  $page = add_submenu_page ('oa_social_login_setup', 'OneAll Social Login ' . __ ('+More'), __ ('+More'), 'manage_options', 'oa_social_login_more', 'oa_display_social_login_more');
68
  add_action ('admin_print_styles-' . $page, 'oa_social_login_admin_css');
69
-
70
  //Fix Setup title
71
  global $submenu;
72
  if (is_array ($submenu) AND isset ($submenu ['oa_social_login_setup']))
@@ -471,7 +479,7 @@ function oa_social_login_settings_validate ($settings)
471
  'plugin_caption',
472
  'plugin_link_verified_accounts',
473
  'plugin_show_avatars_in_comments',
474
- 'plugin_use_small_buttons',
475
  'plugin_display_in_login_form',
476
  'plugin_login_form_redirect',
477
  'plugin_login_form_redirect_custom_url',
@@ -508,15 +516,15 @@ function oa_social_login_settings_validate ($settings)
508
  $sanitzed_settings ['plugin_require_email'] = ($sanitzed_settings ['plugin_require_email'] == '1' ? 1 : 0);
509
  $sanitzed_settings ['plugin_comment_show'] = ($sanitzed_settings ['plugin_comment_show'] == '0' ? 0 : 1);
510
  $sanitzed_settings ['plugin_comment_show_if_members_only'] = ($sanitzed_settings ['plugin_comment_show_if_members_only'] == '0' ? 0 : 1);
511
- $sanitzed_settings ['plugin_use_small_buttons'] = ($sanitzed_settings ['plugin_use_small_buttons'] == '1' ? 1 : 0);
512
  $sanitzed_settings ['plugin_display_in_login_form'] = ($sanitzed_settings ['plugin_display_in_login_form'] == '0' ? 0 : 1);
513
  $sanitzed_settings ['plugin_display_in_registration_form'] = ($sanitzed_settings ['plugin_display_in_registration_form'] == '0' ? 0 : 1);
514
  $sanitzed_settings ['plugin_link_verified_accounts'] = ($sanitzed_settings ['plugin_link_verified_accounts'] == '0' ? 0 : 1);
515
  $sanitzed_settings ['plugin_comment_auto_approve'] = ($sanitzed_settings ['plugin_comment_auto_approve'] == '1' ? 1 : 0);
516
  $sanitzed_settings ['plugin_protect_registration_redirect_url'] = ($sanitzed_settings ['plugin_protect_registration_redirect_url'] == '1' ? 1 : 0);
517
  $sanitzed_settings ['plugin_protect_login_redirect_url'] = ($sanitzed_settings ['plugin_protect_login_redirect_url'] == '1' ? 1 : 0);
518
-
519
-
520
  //Multiple settings
521
  $sanitzed_settings ['plugin_show_avatars_in_comments'] = (in_array ($sanitzed_settings ['plugin_show_avatars_in_comments'], array (0, 1, 2)) ? $sanitzed_settings ['plugin_show_avatars_in_comments'] : 0);
522
 
@@ -591,22 +599,19 @@ function oa_social_login_settings_validate ($settings)
591
  **/
592
  function oa_display_social_login_more ()
593
  {
594
- // Plugin URLs
595
- $more_url = admin_url('plugin-install.php?s=OneAll.com&tab=search&type=author');
596
-
597
  ?>
598
  <div class="wrap">
599
- <div id="oa_social_login_page" class="oa_social_login_more">
600
  <h2>OneAll Social Login <?php echo (defined ('OA_SOCIAL_LOGIN_VERSION') ? OA_SOCIAL_LOGIN_VERSION : ''); ?></h2>
601
-
602
  <h2 class="nav-tab-wrapper">
603
  <a class="nav-tab" href="admin.php?page=oa_social_login_setup"><?php _e ('Setup', 'oa_social_login'); ?></a>
604
  <a class="nav-tab" href="admin.php?page=oa_social_login_settings"><?php _e ('Settings', 'oa_social_login'); ?></a>
605
  <a class="nav-tab nav-tab-active" href="admin.php?page=oa_social_login_more"><?php _e ('+More', 'oa_social_login'); ?></a>
606
  </h2>
607
-
608
  <p></p>
609
-
610
  <div class="oa_social_login_box" id="oa_social_login_box_help">
611
  <ul>
612
  <li><?php printf (__ ('<a target="_blank" href="%s">Follow us on Twitter</a> to stay informed about updates', 'oa_social_login'), 'http://www.twitter.com/oneall'); ?>;</li>
@@ -616,32 +621,39 @@ function oa_display_social_login_more ()
616
  </li>
617
  </ul>
618
  </div>
619
-
620
  <h1><?php _e ('Discover our other plugins!', 'oa_social_login'); ?></h1>
 
 
 
621
  <div class="oa_social_login_plugin">
622
  <div class="oa_social_login_plugin_img">
623
  <a href="<?php echo $more_url; ?>"><img src="<?php echo plugin_dir_url( __FILE__ ) . '../assets/img/social_sharing.png' ?>" alt="<?php _e ('Social Login', 'oa_social_login') ?>" /></a>
624
- </div>
625
- <div class="oa_social_login_plugin_desc">
626
  <?php _e ('Allow your visitors to comment, login and register with 30+ social networks like for example Twitter, Facebook, Pinterest, Instagram, Paypal, LinkedIn, OpenID, VKontakte or Google+. Easy to use and 100% FREE.', 'oa_social_login'); ?>
627
  <a href="<?php echo $more_url; ?>" class="button-primary"><?php _e ('More Info', 'oa_social_login'); ?></a>
628
- </div>
629
  </div>
 
 
 
 
630
  <div class="oa_social_login_plugin">
631
  <div class="oa_social_login_plugin_img">
632
  <a href="<?php echo $more_url; ?>"><img src="<?php echo plugin_dir_url( __FILE__ ) . '../assets/img/loudvoice.png' ?>" alt="<?php _e ('LoudVoice Comment System', 'oa_social_login') ?>" /></a>
633
  </div>
634
- <div class="oa_social_login_plugin_desc">
635
  <?php _e ('LoudVoice replaces the basic WordPress comments by a powerful comment system that includes logging in with 30+ social networks, spam filters and more. Easy to use and 100% FREE. Existing comments can be imported!', 'oa_social_login'); ?>
636
  <a href="<?php echo $more_url; ?>" class="button-primary"><?php _e ('More Info', 'oa_social_login'); ?></a>
637
  </div>
638
- </div>
639
  </div>
640
  </div>
641
  <?php
642
- }
 
643
 
644
-
645
  /**
646
  * Display Settings Page
647
  **/
@@ -668,18 +680,21 @@ function oa_display_social_login_setup ()
668
  </p>
669
  <div class="oa_social_login_box" id="oa_social_login_box_started">
670
  <div class="oa_social_login_box_title">
671
- <?php _e ('Get Started!', 'oa_social_login'); ?>
672
  </div>
673
  <p>
674
- <?php printf (__ ('To be able to use this plugin you first of all need to create a free account at %s and setup a Site.', 'oa_social_login'), '<a href="https://app.oneall.com/signup/wp" target="_blank">http://www.oneall.com</a>'); ?>
675
- <?php _e ('After having created your account and setup your Site, please enter the Site settings in the form below.', 'oa_social_login'); ?>
 
 
676
  <?php _e ("Don't worry the setup is free and takes only a few minutes!", 'oa_social_login'); ?>
 
677
  </p>
678
  <p class="oa_social_login_button_wrap">
679
  <a class="button-secondary" href="https://app.oneall.com/signup/wp" target="_blank"><strong><?php _e ('Click here to setup your free account', 'oa_social_login'); ?></strong></a>
680
  </p>
681
  <h3>
682
- <?php printf (__ ('You are in good company! This plugin is used on more than %s websites!', 'oa_social_login'), '300,000'); ?>
683
  </h3>
684
  </div>
685
  <?php
@@ -689,21 +704,26 @@ function oa_display_social_login_setup ()
689
  ?>
690
  <p></p>
691
  <div class="oa_social_login_box" id="oa_social_login_box_status">
692
- <div class="oa_social_login_box_title">
693
- <?php _e ('Your API Account is setup correctly', 'oa_social_login'); ?>
694
- </div>
695
  <p>
696
- <?php _e ('Login to your OneAll account to manage your social networks and to access your User Insights.', 'oa_social_login'); ?>
697
- <?php _e ("Determine which social networks are popular amongst your users and tailor your registration experience to increase your users' engagement.", 'oa_social_login'); ?>
698
  </p>
699
  <p class="oa_social_login_button_wrap">
700
  <a class="button-secondary" href="https://app.oneall.com/signin/" target="_blank"><strong><?php _e ('Login to my OneAll account', 'oa_social_login'); ?></strong> </a>
701
- <a class="button-secondary" href="https://app.oneall.com/insights/" target="_blank"><strong><?php _e ('Access my User Insights', 'oa_social_login'); ?></strong> </a>
702
  </p>
703
  </div>
704
  <?php
705
  }
706
-
 
 
 
 
 
 
 
 
 
707
  if (!empty ($_REQUEST ['settings-updated']) AND strtolower ($_REQUEST ['settings-updated']) == 'true')
708
  {
709
  ?>
@@ -968,16 +988,17 @@ function oa_display_social_login_settings ()
968
  </tr>
969
  <tr class="row_odd">
970
  <td>
971
- <strong><?php _e ("Do you want to use the default or the small social network buttons?", 'oa_social_login'); ?></strong>
972
  </td>
973
  </tr>
974
  <tr class="row_even">
975
  <td>
976
- <?php
977
- $plugin_use_small_buttons = ((isset ($settings ['plugin_use_small_buttons']) AND in_array ($settings ['plugin_use_small_buttons'], array (0, 1))) ? $settings ['plugin_use_small_buttons'] : 0);
978
- ?>
979
- <input type="radio" name="oa_social_login_settings[plugin_use_small_buttons]" value="0" <?php echo ($plugin_use_small_buttons == 0 ? 'checked="checked"' : ''); ?> /> <?php printf (__ ('Use the default social network buttons (%s)', 'oa_social_login'), '32x32 px'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
980
- <input type="radio" name="oa_social_login_settings[plugin_use_small_buttons]" value="1" <?php echo ($plugin_use_small_buttons == 1 ? 'checked="checked"' : ''); ?> /> <?php printf (__ ('Use the small social network buttons (%s)', 'oa_social_login'), '16x16 px'); ?>
 
981
  </td>
982
  </tr>
983
  <tr class="row_odd">
@@ -990,8 +1011,8 @@ function oa_display_social_login_settings ()
990
  <?php
991
  $plugin_add_column_user_list = ((isset ($settings ['plugin_add_column_user_list']) AND in_array ($settings ['plugin_add_column_user_list'], array (0, 1))) ? $settings ['plugin_add_column_user_list'] : 0);
992
  ?>
993
- <input type="radio" name="oa_social_login_settings[plugin_add_column_user_list]" value="1" <?php echo ($plugin_add_column_user_list == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, add a new column to the user list and display the social network that the user connected with', 'oa_social_login'); ?> <br />
994
- <input type="radio" name="oa_social_login_settings[plugin_add_column_user_list]" value="0" <?php echo ($plugin_add_column_user_list == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, do not display the social networks in the user list', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong>
995
  </td>
996
  </tr>
997
  <tr class="row_odd">
@@ -1004,8 +1025,8 @@ function oa_display_social_login_settings ()
1004
  <?php
1005
  $plugin_notify_admin = ((isset ($settings ['plugin_notify_admin']) AND in_array ($settings ['plugin_notify_admin'], array (0, 1))) ? $settings ['plugin_notify_admin'] : 1);
1006
  ?>
1007
- <input type="radio" name="oa_social_login_settings[plugin_notify_admin]" value="1" <?php echo ($plugin_notify_admin == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, send me an email whenever a new user registers with Social Login', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1008
- <input type="radio" name="oa_social_login_settings[plugin_notify_admin]" value="0" <?php echo ($plugin_notify_admin == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, do not send me any emails', 'oa_social_login'); ?>
1009
  </td>
1010
  </tr>
1011
  </table>
@@ -1025,8 +1046,8 @@ function oa_display_social_login_settings ()
1025
  <?php
1026
  $plugin_require_email = ((isset ($settings ['plugin_require_email']) AND in_array ($settings ['plugin_require_email'], array (0, 1))) ? $settings ['plugin_require_email'] : 0);
1027
  ?>
1028
- <input type="radio" name="oa_social_login_settings[plugin_require_email]" value="0" <?php echo ($plugin_require_email == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, simplify the registration by automatically creating a placeholder email', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1029
- <input type="radio" name="oa_social_login_settings[plugin_require_email]" value="1" <?php echo ($plugin_require_email == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, require the user to enter his email address manually and display this message:', 'oa_social_login'); ?> <br />
1030
  <textarea name="oa_social_login_settings[plugin_require_email_text]" cols="100" rows="3"><?php echo (isset ($settings ['plugin_require_email_text']) ? htmlspecialchars ($settings ['plugin_require_email_text']) : _e ('<strong>We unfortunately could not retrieve your email address from %s.</strong> Please enter your email address in the form below in order to continue.', 'oa_social_login')); ?></textarea>
1031
  <span class="description"><?php _e ('HTML is allowed, the placeholder %s is replaced by the name of the social network used to connect.', 'oa_social_login'); ?></span>
1032
  </td>
@@ -1041,8 +1062,8 @@ function oa_display_social_login_settings ()
1041
  <?php
1042
  $plugin_link_verified_accounts = ((isset ($settings ['plugin_link_verified_accounts']) AND in_array ($settings ['plugin_link_verified_accounts'], array (0, 1))) ? $settings ['plugin_link_verified_accounts'] : 1);
1043
  ?>
1044
- <input type="radio" name="oa_social_login_settings[plugin_link_verified_accounts]" value="1" <?php echo ($plugin_link_verified_accounts == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, try to link verified social network profiles to existing blog accounts', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1045
- <input type="radio" name="oa_social_login_settings[plugin_link_verified_accounts]" value="0" <?php echo ($plugin_link_verified_accounts == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, disable account linking', 'oa_social_login'); ?>
1046
  </td>
1047
  </tr>
1048
  <tr class="row_odd">
@@ -1055,9 +1076,9 @@ function oa_display_social_login_settings ()
1055
  <?php
1056
  $plugin_show_avatars_in_comments = ((isset ($settings ['plugin_show_avatars_in_comments']) AND in_array ($settings ['plugin_show_avatars_in_comments'], array (0, 1, 2))) ? $settings ['plugin_show_avatars_in_comments'] : 0);
1057
  ?>
1058
- <input type="radio" name="oa_social_login_settings[plugin_show_avatars_in_comments]" value="0" <?php echo ($plugin_show_avatars_in_comments == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, do not use avatars from social networks', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1059
- <input type="radio" name="oa_social_login_settings[plugin_show_avatars_in_comments]" value="1" <?php echo ($plugin_show_avatars_in_comments == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, use small avatars from social networks if available', 'oa_social_login'); ?><br />
1060
- <input type="radio" name="oa_social_login_settings[plugin_show_avatars_in_comments]" value="2" <?php echo ($plugin_show_avatars_in_comments == 2 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, use large avatars from social networks if available', 'oa_social_login'); ?>
1061
  </td>
1062
  </tr>
1063
  </table>
@@ -1077,8 +1098,8 @@ function oa_display_social_login_settings ()
1077
  <?php
1078
  $plugin_comment_show = ((isset ($settings ['plugin_comment_show']) AND in_array ($settings ['plugin_comment_show'], array (0, 1))) ? $settings ['plugin_comment_show'] : 1);
1079
  ?>
1080
- <input type="radio" name="oa_social_login_settings[plugin_comment_show]" value="1" <?php echo ($plugin_comment_show == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, show the Social Login buttons', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1081
- <input type="radio" name="oa_social_login_settings[plugin_comment_show]" value="0" <?php echo ($plugin_comment_show == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, do not show the Social Login buttons', 'oa_social_login'); ?><br />
1082
  </td>
1083
  </tr>
1084
  <tr class="row_odd">
@@ -1092,8 +1113,8 @@ function oa_display_social_login_settings ()
1092
  $plugin_comment_show_if_members_only = ((isset ($settings ['plugin_comment_show_if_members_only']) AND in_array ($settings ['plugin_comment_show_if_members_only'], array (0, 1))) ? $settings ['plugin_comment_show_if_members_only'] : 1);
1093
  ?>
1094
  <span class="description"><?php _e ('The buttons will be displayed below the "You must be logged in to leave a comment" notice.'); ?> </span><br />
1095
- <input type="radio" name="oa_social_login_settings[plugin_comment_show_if_members_only]" value="1" <?php echo ($plugin_comment_show_if_members_only == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, show the Social Login buttons', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1096
- <input type="radio" name="oa_social_login_settings[plugin_comment_show_if_members_only]" value="0" <?php echo ($plugin_comment_show_if_members_only == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, do not show the Social Login buttons', 'oa_social_login'); ?>
1097
  </td>
1098
  </tr>
1099
  <tr class="row_odd">
@@ -1106,8 +1127,8 @@ function oa_display_social_login_settings ()
1106
  <?php
1107
  $plugin_comment_auto_approve = ((isset ($settings ['plugin_comment_auto_approve']) AND in_array ($settings ['plugin_comment_auto_approve'], array (0, 1))) ? $settings ['plugin_comment_auto_approve'] : 0);
1108
  ?>
1109
- <input type="radio" name="oa_social_login_settings[plugin_comment_auto_approve]" value="1" <?php echo ($plugin_comment_auto_approve == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, automatically approve comments made by users that connected with Social Login', 'oa_social_login'); ?><br />
1110
- <input type="radio" name="oa_social_login_settings[plugin_comment_auto_approve]" value="0" <?php echo ($plugin_comment_auto_approve == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, do not automatically approve', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)
1111
  </strong><br />
1112
  </td>
1113
  </tr>
@@ -1130,8 +1151,8 @@ function oa_display_social_login_settings ()
1130
  <?php
1131
  $plugin_profile_show = ((isset ($settings ['plugin_profile_show']) AND in_array ($settings ['plugin_profile_show'], array (0, 1))) ? $settings ['plugin_profile_show'] : 1);
1132
  ?>
1133
- <input type="radio" name="oa_social_login_settings[plugin_profile_show]" value="1" <?php echo ($plugin_profile_show == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, show the Social Link buttons', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1134
- <input type="radio" name="oa_social_login_settings[plugin_profile_show]" value="0" <?php echo ($plugin_profile_show == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, do not show the Social Link buttons', 'oa_social_login'); ?><br />
1135
  </td>
1136
  </tr>
1137
  </table>
@@ -1151,8 +1172,8 @@ function oa_display_social_login_settings ()
1151
  <?php
1152
  $plugin_display_in_login_form = ((isset ($settings ['plugin_display_in_login_form']) AND in_array ($settings ['plugin_display_in_login_form'], array (0, 1))) ? $settings ['plugin_display_in_login_form'] : 1);
1153
  ?>
1154
- <input type="radio" name="oa_social_login_settings[plugin_display_in_login_form]" value="1" <?php echo ($plugin_display_in_login_form == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, display the social network buttons below the login form', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1155
- <input type="radio" name="oa_social_login_settings[plugin_display_in_login_form]" value="0" <?php echo ($plugin_display_in_login_form == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, disable social network buttons in the login form', 'oa_social_login'); ?>
1156
  </td>
1157
  </tr>
1158
  <tr class="row_odd">
@@ -1166,10 +1187,10 @@ function oa_display_social_login_settings ()
1166
  $plugin_login_form_redirect = ((isset ($settings ['plugin_login_form_redirect']) AND in_array ($settings ['plugin_login_form_redirect'], array ('current','homepage','dashboard','custom'))) ? $settings ['plugin_login_form_redirect'] : 'homepage');
1167
  $plugin_login_form_redirect_custom_url = (isset ($settings ['plugin_login_form_redirect_custom_url']) ? $settings ['plugin_login_form_redirect_custom_url'] : '');
1168
  ?>
1169
- <input type="radio" name="oa_social_login_settings[plugin_login_form_redirect]" value="current" <?php echo ($plugin_login_form_redirect == 'current' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users back to the current page', 'oa_social_login'); ?><br />
1170
- <input type="radio" name="oa_social_login_settings[plugin_login_form_redirect]" value="homepage" <?php echo ($plugin_login_form_redirect == 'homepage' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to the homepage of my blog', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1171
- <input type="radio" name="oa_social_login_settings[plugin_login_form_redirect]" value="dashboard" <?php echo ($plugin_login_form_redirect == 'dashboard' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to their account dashboard', 'oa_social_login'); ?><br />
1172
- <input type="radio" name="oa_social_login_settings[plugin_login_form_redirect]" value="custom" <?php echo ($plugin_login_form_redirect == 'custom' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to the following url', 'oa_social_login'); ?>:<br />
1173
  <input type="text" name="oa_social_login_settings[plugin_login_form_redirect_custom_url]" size="90" value="<?php echo htmlspecialchars ($plugin_login_form_redirect_custom_url); ?>" />
1174
  </td>
1175
  </tr>
@@ -1183,13 +1204,13 @@ function oa_display_social_login_settings ()
1183
  <?php
1184
  $plugin_protect_login_redirect_url = (empty ($settings ['plugin_protect_login_redirect_url']) ? 0 : 1);
1185
  ?>
1186
- <input type="radio" name="oa_social_login_settings[plugin_protect_login_redirect_url]" value="0" <?php echo ($plugin_protect_login_redirect_url == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, allow plugins to change the redirection url', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1187
- <input type="radio" name="oa_social_login_settings[plugin_protect_login_redirect_url]" value="1" <?php echo ($plugin_protect_login_redirect_url == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, protect the redirection url (Use this option if the redirection does not work correctly)', 'oa_social_login'); ?>
1188
  </td>
1189
  </tr>
1190
-
1191
-
1192
-
1193
  </table>
1194
  <table class="form-table oa_social_login_table">
1195
  <tr class="row_head">
@@ -1207,8 +1228,8 @@ function oa_display_social_login_settings ()
1207
  <?php
1208
  $plugin_display_in_registration_form = ((isset ($settings ['plugin_display_in_registration_form']) AND in_array ($settings ['plugin_display_in_registration_form'], array (0, 1))) ? $settings ['plugin_display_in_registration_form'] : 1);
1209
  ?>
1210
- <input type="radio" name="oa_social_login_settings[plugin_display_in_registration_form]" value="1" <?php echo ($plugin_display_in_registration_form == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, display the social network buttons below the registration form', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1211
- <input type="radio" name="oa_social_login_settings[plugin_display_in_registration_form]" value="0" <?php echo ($plugin_display_in_registration_form == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, disable social network buttons in the registration form', 'oa_social_login'); ?>
1212
  </td>
1213
  </tr>
1214
  <tr class="row_odd">
@@ -1222,10 +1243,10 @@ function oa_display_social_login_settings ()
1222
  $plugin_registration_form_redirect = ((isset ($settings ['plugin_registration_form_redirect']) AND in_array ($settings ['plugin_registration_form_redirect'], array ('current','homepage','dashboard','custom'))) ? $settings ['plugin_registration_form_redirect'] : 'dashboard');
1223
  $plugin_registration_form_redirect_custom_url = (isset ($settings ['plugin_registration_form_redirect_custom_url']) ? $settings ['plugin_registration_form_redirect_custom_url'] : '');
1224
  ?>
1225
- <input type="radio" name="oa_social_login_settings[plugin_registration_form_redirect]" value="current" <?php echo ($plugin_registration_form_redirect == 'current' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users back to the current page', 'oa_social_login'); ?><br />
1226
- <input type="radio" name="oa_social_login_settings[plugin_registration_form_redirect]" value="homepage" <?php echo ($plugin_registration_form_redirect == 'homepage' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to the homepage of my blog', 'oa_social_login'); ?><br />
1227
- <input type="radio" name="oa_social_login_settings[plugin_registration_form_redirect]" value="dashboard" <?php echo ($plugin_registration_form_redirect == 'dashboard' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to their account dashboard', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1228
- <input type="radio" name="oa_social_login_settings[plugin_registration_form_redirect]" value="custom" <?php echo ($plugin_registration_form_redirect == 'custom' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to the following url', 'oa_social_login'); ?>:<br />
1229
  <input type="text" name="oa_social_login_settings[plugin_registration_form_redirect_custom_url]" size="90" value="<?php echo htmlspecialchars ($plugin_registration_form_redirect_custom_url); ?>" />
1230
  </td>
1231
  </tr>
@@ -1239,8 +1260,8 @@ function oa_display_social_login_settings ()
1239
  <?php
1240
  $plugin_protect_registration_redirect_url = (empty ($settings ['plugin_protect_registration_redirect_url']) ? 0 : 1);
1241
  ?>
1242
- <input type="radio" name="oa_social_login_settings[plugin_protect_registration_redirect_url]" value="0" <?php echo ($plugin_protect_registration_redirect_url == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, allow plugins to change the redirection url', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1243
- <input type="radio" name="oa_social_login_settings[plugin_protect_registration_redirect_url]" value="1" <?php echo ($plugin_protect_registration_redirect_url == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, protect the redirection url (Use this option if the redirection does not work correctly)', 'oa_social_login'); ?>
1244
  </td>
1245
  </tr>
1246
  </table>
@@ -1261,10 +1282,10 @@ function oa_display_social_login_settings ()
1261
  $plugin_shortcode_login_redirect = ((isset ($settings ['plugin_shortcode_login_redirect']) AND in_array ($settings ['plugin_shortcode_login_redirect'], array ('current', 'dashboard', 'homepage', 'custom'))) ? $settings ['plugin_shortcode_login_redirect'] : 'current');
1262
  $plugin_shortcode_login_redirect_url = (isset ($settings ['plugin_shortcode_login_redirect_url']) ? $settings ['plugin_shortcode_login_redirect_url'] : '');
1263
  ?>
1264
- <input type="radio" name="oa_social_login_settings[plugin_shortcode_login_redirect]" value="current" <?php echo ($plugin_shortcode_login_redirect == 'current' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users back to the current page', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1265
- <input type="radio" name="oa_social_login_settings[plugin_shortcode_login_redirect]" value="homepage" <?php echo ($plugin_shortcode_login_redirect == 'homepage' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to the homepage of my blog', 'oa_social_login'); ?> <br />
1266
- <input type="radio" name="oa_social_login_settings[plugin_shortcode_login_redirect]" value="dashboard" <?php echo ($plugin_shortcode_login_redirect == 'dashboard' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to their account dashboard', 'oa_social_login'); ?><br />
1267
- <input type="radio" name="oa_social_login_settings[plugin_shortcode_login_redirect]" value="custom" <?php echo ($plugin_shortcode_login_redirect == 'custom' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to the following url', 'oa_social_login'); ?>:<br />
1268
  <input type="text" name="oa_social_login_settings[plugin_shortcode_login_redirect_url]" size="90" value="<?php echo htmlspecialchars ($plugin_shortcode_login_redirect_url); ?>" />
1269
  </td>
1270
  </tr>
@@ -1279,10 +1300,10 @@ function oa_display_social_login_settings ()
1279
  $plugin_shortcode_register_redirect = ((isset ($settings ['plugin_shortcode_register_redirect']) AND in_array ($settings ['plugin_shortcode_register_redirect'], array ('current', 'dashboard', 'homepage', 'custom'))) ? $settings ['plugin_shortcode_register_redirect'] : 'current');
1280
  $plugin_shortcode_register_redirect_url = (isset ($settings ['plugin_shortcode_register_redirect_url']) ? $settings ['plugin_shortcode_register_redirect_url'] : '');
1281
  ?>
1282
- <input type="radio" name="oa_social_login_settings[plugin_shortcode_register_redirect]" value="current" <?php echo ($plugin_shortcode_register_redirect == 'current' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users back to the current page', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
1283
- <input type="radio" name="oa_social_login_settings[plugin_shortcode_register_redirect]" value="homepage" <?php echo ($plugin_shortcode_register_redirect == 'homepage' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to the homepage of my blog', 'oa_social_login'); ?><br />
1284
- <input type="radio" name="oa_social_login_settings[plugin_shortcode_register_redirect]" value="dashboard" <?php echo ($plugin_shortcode_register_redirect == 'dashboard' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to their account dashboard', 'oa_social_login'); ?><br />
1285
- <input type="radio" name="oa_social_login_settings[plugin_shortcode_register_redirect]" value="custom" <?php echo ($plugin_shortcode_register_redirect == 'custom' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to the following url', 'oa_social_login'); ?>:<br />
1286
  <input type="text" name="oa_social_login_settings[plugin_shortcode_register_redirect_url]" size="90" value="<?php echo htmlspecialchars ($plugin_shortcode_register_redirect_url); ?>" />
1287
  </td>
1288
  </tr>
29
  return $value;
30
  }
31
 
32
+ //Read Identity Providers
33
+ $identity_providers = trim (strval (get_user_meta ($user_id, 'oa_social_login_identity_provider', true)));
34
+
35
+ // Some have been found
36
+ if ( ! empty ($identity_providers))
37
  {
38
+ $identity_providers = array_unique (explode ("|", $identity_providers));
39
+ $identity_providers = array_map("ucwords", $identity_providers);
40
+ }
41
+ // None found
42
+ else
43
+ {
44
+ $identity_providers = array ();
45
  }
46
 
47
+ // Social Login Registration
48
+ if (count ($identity_providers) > 0)
49
  {
50
+ return '<strong>Social Login</strong>: ' . implode (", ", $identity_providers);
51
  }
52
  //Traditional Registration
53
  else
54
  {
55
+ return __ ('Registration Form', 'oa_social_login');
56
  }
57
  }
58
  add_action ('manage_users_custom_column', 'oa_social_login_admin_user_colum_display', 10, 3);
62
  * Add administration area links
63
  **/
64
  function oa_social_login_admin_menu ()
65
+ {
66
  //Setup
67
  $page = add_menu_page ('OneAll Social Login ' . __ ('Setup', 'oa_social_login'), 'Social Login', 'manage_options', 'oa_social_login_setup', 'oa_display_social_login_setup');
68
  add_action ('admin_print_styles-' . $page, 'oa_social_login_admin_css');
74
  //Sharing
75
  $page = add_submenu_page ('oa_social_login_setup', 'OneAll Social Login ' . __ ('+More'), __ ('+More'), 'manage_options', 'oa_social_login_more', 'oa_display_social_login_more');
76
  add_action ('admin_print_styles-' . $page, 'oa_social_login_admin_css');
77
+
78
  //Fix Setup title
79
  global $submenu;
80
  if (is_array ($submenu) AND isset ($submenu ['oa_social_login_setup']))
479
  'plugin_caption',
480
  'plugin_link_verified_accounts',
481
  'plugin_show_avatars_in_comments',
482
+ 'plugin_icon_theme',
483
  'plugin_display_in_login_form',
484
  'plugin_login_form_redirect',
485
  'plugin_login_form_redirect_custom_url',
516
  $sanitzed_settings ['plugin_require_email'] = ($sanitzed_settings ['plugin_require_email'] == '1' ? 1 : 0);
517
  $sanitzed_settings ['plugin_comment_show'] = ($sanitzed_settings ['plugin_comment_show'] == '0' ? 0 : 1);
518
  $sanitzed_settings ['plugin_comment_show_if_members_only'] = ($sanitzed_settings ['plugin_comment_show_if_members_only'] == '0' ? 0 : 1);
519
+ $sanitzed_settings ['plugin_icon_theme'] = (in_array ($sanitzed_settings ['plugin_icon_theme'], array (0, 1, 2)) ? $sanitzed_settings ['plugin_icon_theme'] : 0);
520
  $sanitzed_settings ['plugin_display_in_login_form'] = ($sanitzed_settings ['plugin_display_in_login_form'] == '0' ? 0 : 1);
521
  $sanitzed_settings ['plugin_display_in_registration_form'] = ($sanitzed_settings ['plugin_display_in_registration_form'] == '0' ? 0 : 1);
522
  $sanitzed_settings ['plugin_link_verified_accounts'] = ($sanitzed_settings ['plugin_link_verified_accounts'] == '0' ? 0 : 1);
523
  $sanitzed_settings ['plugin_comment_auto_approve'] = ($sanitzed_settings ['plugin_comment_auto_approve'] == '1' ? 1 : 0);
524
  $sanitzed_settings ['plugin_protect_registration_redirect_url'] = ($sanitzed_settings ['plugin_protect_registration_redirect_url'] == '1' ? 1 : 0);
525
  $sanitzed_settings ['plugin_protect_login_redirect_url'] = ($sanitzed_settings ['plugin_protect_login_redirect_url'] == '1' ? 1 : 0);
526
+
527
+
528
  //Multiple settings
529
  $sanitzed_settings ['plugin_show_avatars_in_comments'] = (in_array ($sanitzed_settings ['plugin_show_avatars_in_comments'], array (0, 1, 2)) ? $sanitzed_settings ['plugin_show_avatars_in_comments'] : 0);
530
 
599
  **/
600
  function oa_display_social_login_more ()
601
  {
 
 
 
602
  ?>
603
  <div class="wrap">
604
+ <div id="oa_social_login_page" class="oa_social_login_more">
605
  <h2>OneAll Social Login <?php echo (defined ('OA_SOCIAL_LOGIN_VERSION') ? OA_SOCIAL_LOGIN_VERSION : ''); ?></h2>
606
+
607
  <h2 class="nav-tab-wrapper">
608
  <a class="nav-tab" href="admin.php?page=oa_social_login_setup"><?php _e ('Setup', 'oa_social_login'); ?></a>
609
  <a class="nav-tab" href="admin.php?page=oa_social_login_settings"><?php _e ('Settings', 'oa_social_login'); ?></a>
610
  <a class="nav-tab nav-tab-active" href="admin.php?page=oa_social_login_more"><?php _e ('+More', 'oa_social_login'); ?></a>
611
  </h2>
612
+
613
  <p></p>
614
+
615
  <div class="oa_social_login_box" id="oa_social_login_box_help">
616
  <ul>
617
  <li><?php printf (__ ('<a target="_blank" href="%s">Follow us on Twitter</a> to stay informed about updates', 'oa_social_login'), 'http://www.twitter.com/oneall'); ?>;</li>
621
  </li>
622
  </ul>
623
  </div>
624
+
625
  <h1><?php _e ('Discover our other plugins!', 'oa_social_login'); ?></h1>
626
+ <?php
627
+ $more_url = admin_url('plugin-install.php?s=share+buttons+oneall&tab=search&type=term');
628
+ ?>
629
  <div class="oa_social_login_plugin">
630
  <div class="oa_social_login_plugin_img">
631
  <a href="<?php echo $more_url; ?>"><img src="<?php echo plugin_dir_url( __FILE__ ) . '../assets/img/social_sharing.png' ?>" alt="<?php _e ('Social Login', 'oa_social_login') ?>" /></a>
632
+ </div>
633
+ <div class="oa_social_login_plugin_desc">
634
  <?php _e ('Allow your visitors to comment, login and register with 30+ social networks like for example Twitter, Facebook, Pinterest, Instagram, Paypal, LinkedIn, OpenID, VKontakte or Google+. Easy to use and 100% FREE.', 'oa_social_login'); ?>
635
  <a href="<?php echo $more_url; ?>" class="button-primary"><?php _e ('More Info', 'oa_social_login'); ?></a>
636
+ </div>
637
  </div>
638
+
639
+ <?php
640
+ $more_url = admin_url('plugin-install.php?s=loudvoice+oneall&tab=search&type=term');
641
+ ?>
642
  <div class="oa_social_login_plugin">
643
  <div class="oa_social_login_plugin_img">
644
  <a href="<?php echo $more_url; ?>"><img src="<?php echo plugin_dir_url( __FILE__ ) . '../assets/img/loudvoice.png' ?>" alt="<?php _e ('LoudVoice Comment System', 'oa_social_login') ?>" /></a>
645
  </div>
646
+ <div class="oa_social_login_plugin_desc">
647
  <?php _e ('LoudVoice replaces the basic WordPress comments by a powerful comment system that includes logging in with 30+ social networks, spam filters and more. Easy to use and 100% FREE. Existing comments can be imported!', 'oa_social_login'); ?>
648
  <a href="<?php echo $more_url; ?>" class="button-primary"><?php _e ('More Info', 'oa_social_login'); ?></a>
649
  </div>
650
+ </div>
651
  </div>
652
  </div>
653
  <?php
654
+ }
655
+
656
 
 
657
  /**
658
  * Display Settings Page
659
  **/
680
  </p>
681
  <div class="oa_social_login_box" id="oa_social_login_box_started">
682
  <div class="oa_social_login_box_title">
683
+ <?php _e ('Thank you for using Social Login', 'oa_social_login'); ?>
684
  </div>
685
  <p>
686
+ <?php printf (__ ('To be able to use this plugin you first of all need to create a free account at %s. By using OneAll you will be sure that your social media integration will always run smoothly and with the most up-to-date calls.', 'oa_social_login'), '<a href="https://app.oneall.com/signup/wp" target="_blank">http://www.oneall.com</a>'); ?>
687
+ </p>
688
+ <p>
689
+ <?php _e ('After having created your account and setup a Site, please enter the Site settings below.', 'oa_social_login'); ?>
690
  <?php _e ("Don't worry the setup is free and takes only a few minutes!", 'oa_social_login'); ?>
691
+ <?php printf (__ ('You are in good company! This plugin is used on more than %s websites!', 'oa_social_login'), '300,000'); ?>
692
  </p>
693
  <p class="oa_social_login_button_wrap">
694
  <a class="button-secondary" href="https://app.oneall.com/signup/wp" target="_blank"><strong><?php _e ('Click here to setup your free account', 'oa_social_login'); ?></strong></a>
695
  </p>
696
  <h3>
697
+
698
  </h3>
699
  </div>
700
  <?php
704
  ?>
705
  <p></p>
706
  <div class="oa_social_login_box" id="oa_social_login_box_status">
 
 
 
707
  <p>
708
+ <?php _e ('Login to your OneAll account to manage your social networks and to access your Social Analytics, Graphs &amp; Statistics.', 'oa_social_login'); ?>
 
709
  </p>
710
  <p class="oa_social_login_button_wrap">
711
  <a class="button-secondary" href="https://app.oneall.com/signin/" target="_blank"><strong><?php _e ('Login to my OneAll account', 'oa_social_login'); ?></strong> </a>
712
+ <a class="button-secondary" href="https://app.oneall.com/insights/" target="_blank"><strong><?php _e ('Access my Social Analytics', 'oa_social_login'); ?></strong> </a>
713
  </p>
714
  </div>
715
  <?php
716
  }
717
+
718
+ ?>
719
+
720
+ <div class="oa_social_login_box" id="oa_social_login_box_help">
721
+ <ul>
722
+ <li><?php printf (__ ('Checkout the <a target="_blank" href="%s">online documentation</a> for more information about this plugin', 'oa_social_login'), 'http://docs.oneall.com/plugins/guide/social-login-wordpress/'); ?>;</li>
723
+ <li><?php printf (__ ('Do not hesitate to <a target="_blank" href="%s">contact us</a> if you have feedback or need assistance', 'oa_social_login'), 'http://www.oneall.com/company/contact-us/'); ?>.</li>
724
+ </ul>
725
+ </div>
726
+ <?php
727
  if (!empty ($_REQUEST ['settings-updated']) AND strtolower ($_REQUEST ['settings-updated']) == 'true')
728
  {
729
  ?>
988
  </tr>
989
  <tr class="row_odd">
990
  <td>
991
+ <strong><?php _e ("Please select the icon theme to use per default:", 'oa_social_login'); ?></strong>
992
  </td>
993
  </tr>
994
  <tr class="row_even">
995
  <td>
996
+ <?php
997
+ $plugin_icon_theme = ((isset ($settings ['plugin_icon_theme']) AND in_array ($settings ['plugin_icon_theme'], array (0, 1, 2))) ? $settings ['plugin_icon_theme'] : 0);
998
+ ?>
999
+ <input type="radio" id="plugin_icon_theme_0" name="oa_social_login_settings[plugin_icon_theme]" value="0" <?php echo ($plugin_icon_theme == 0 ? 'checked="checked"' : ''); ?> /> <label for="plugin_icon_theme_0"><img src="<?php echo plugin_dir_url( __FILE__ ) . '../assets/img/theme_classic.png' ?>" alt="<?php _e('Classic', 'oa_social_login'); ?>" /></label>
1000
+ <input type="radio" id="plugin_icon_theme_1" name="oa_social_login_settings[plugin_icon_theme]" value="1" <?php echo ($plugin_icon_theme == 1 ? 'checked="checked"' : ''); ?> /> <label for="plugin_icon_theme_1"><img src="<?php echo plugin_dir_url( __FILE__ ) . '../assets/img/theme_modern.png' ?>" alt="<?php _e('Modern', 'oa_social_login'); ?>" /></label>
1001
+ <input type="radio" id="plugin_icon_theme_2" name="oa_social_login_settings[plugin_icon_theme]" value="2" <?php echo ($plugin_icon_theme == 2 ? 'checked="checked"' : ''); ?> /> <label for="plugin_icon_theme_2"><img src="<?php echo plugin_dir_url( __FILE__ ) . '../assets/img/theme_small.png' ?>" alt="<?php _e('Small', 'oa_social_login'); ?>" /></label>
1002
  </td>
1003
  </tr>
1004
  <tr class="row_odd">
1011
  <?php
1012
  $plugin_add_column_user_list = ((isset ($settings ['plugin_add_column_user_list']) AND in_array ($settings ['plugin_add_column_user_list'], array (0, 1))) ? $settings ['plugin_add_column_user_list'] : 0);
1013
  ?>
1014
+ <input type="radio" id="plugin_add_column_user_list_1" name="oa_social_login_settings[plugin_add_column_user_list]" value="1" <?php echo ($plugin_add_column_user_list == 1 ? 'checked="checked"' : ''); ?> /> <label for="plugin_add_column_user_list_1"><?php _e ('Yes, add a new column to the user list and display the social network that the user connected with', 'oa_social_login'); ?></label> <br />
1015
+ <input type="radio" id="plugin_add_column_user_list_0" name="oa_social_login_settings[plugin_add_column_user_list]" value="0" <?php echo ($plugin_add_column_user_list == 0 ? 'checked="checked"' : ''); ?> /> <label for="plugin_add_column_user_list_0"><?php _e ('No, do not display the social networks in the user list', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label>
1016
  </td>
1017
  </tr>
1018
  <tr class="row_odd">
1025
  <?php
1026
  $plugin_notify_admin = ((isset ($settings ['plugin_notify_admin']) AND in_array ($settings ['plugin_notify_admin'], array (0, 1))) ? $settings ['plugin_notify_admin'] : 1);
1027
  ?>
1028
+ <input type="radio" id="plugin_notify_admin_1" name="oa_social_login_settings[plugin_notify_admin]" value="1" <?php echo ($plugin_notify_admin == 1 ? 'checked="checked"' : ''); ?> /> <label for="plugin_notify_admin_1"><?php _e ('Yes, send me an email whenever a new user registers with Social Login', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1029
+ <input type="radio" id="plugin_notify_admin_0" name="oa_social_login_settings[plugin_notify_admin]" value="0" <?php echo ($plugin_notify_admin == 0 ? 'checked="checked"' : ''); ?> /> <label for="plugin_notify_admin_0"><?php _e ('No, do not send me any emails', 'oa_social_login'); ?></label>
1030
  </td>
1031
  </tr>
1032
  </table>
1046
  <?php
1047
  $plugin_require_email = ((isset ($settings ['plugin_require_email']) AND in_array ($settings ['plugin_require_email'], array (0, 1))) ? $settings ['plugin_require_email'] : 0);
1048
  ?>
1049
+ <input type="radio" id="plugin_require_email_0" name="oa_social_login_settings[plugin_require_email]" value="0" <?php echo ($plugin_require_email == 0 ? 'checked="checked"' : ''); ?> /> <label for="plugin_require_email_0"><?php _e ('No, simplify the registration by automatically creating a placeholder email', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1050
+ <input type="radio" id="plugin_require_email_1" name="oa_social_login_settings[plugin_require_email]" value="1" <?php echo ($plugin_require_email == 1 ? 'checked="checked"' : ''); ?> /> <label for="plugin_require_email_1"><?php _e ('Yes, require the user to enter his email address manually and display this message:', 'oa_social_login'); ?></label> <br />
1051
  <textarea name="oa_social_login_settings[plugin_require_email_text]" cols="100" rows="3"><?php echo (isset ($settings ['plugin_require_email_text']) ? htmlspecialchars ($settings ['plugin_require_email_text']) : _e ('<strong>We unfortunately could not retrieve your email address from %s.</strong> Please enter your email address in the form below in order to continue.', 'oa_social_login')); ?></textarea>
1052
  <span class="description"><?php _e ('HTML is allowed, the placeholder %s is replaced by the name of the social network used to connect.', 'oa_social_login'); ?></span>
1053
  </td>
1062
  <?php
1063
  $plugin_link_verified_accounts = ((isset ($settings ['plugin_link_verified_accounts']) AND in_array ($settings ['plugin_link_verified_accounts'], array (0, 1))) ? $settings ['plugin_link_verified_accounts'] : 1);
1064
  ?>
1065
+ <input type="radio" id="plugin_link_verified_accounts_1" name="oa_social_login_settings[plugin_link_verified_accounts]" value="1" <?php echo ($plugin_link_verified_accounts == 1 ? 'checked="checked"' : ''); ?> /> <label for="plugin_link_verified_accounts_1"><?php _e ('Yes, try to link verified social network profiles to existing blog accounts', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1066
+ <input type="radio" id="plugin_link_verified_accounts_0" name="oa_social_login_settings[plugin_link_verified_accounts]" value="0" <?php echo ($plugin_link_verified_accounts == 0 ? 'checked="checked"' : ''); ?> /> <label for="plugin_link_verified_accounts_0"><?php _e ('No, disable account linking', 'oa_social_login'); ?></label>
1067
  </td>
1068
  </tr>
1069
  <tr class="row_odd">
1076
  <?php
1077
  $plugin_show_avatars_in_comments = ((isset ($settings ['plugin_show_avatars_in_comments']) AND in_array ($settings ['plugin_show_avatars_in_comments'], array (0, 1, 2))) ? $settings ['plugin_show_avatars_in_comments'] : 0);
1078
  ?>
1079
+ <input type="radio" id="plugin_show_avatars_in_comments_0" name="oa_social_login_settings[plugin_show_avatars_in_comments]" value="0" <?php echo ($plugin_show_avatars_in_comments == 0 ? 'checked="checked"' : ''); ?> /> <label for="plugin_show_avatars_in_comments_0"><?php _e ('No, do not use avatars from social networks', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1080
+ <input type="radio" id="plugin_show_avatars_in_comments_1" name="oa_social_login_settings[plugin_show_avatars_in_comments]" value="1" <?php echo ($plugin_show_avatars_in_comments == 1 ? 'checked="checked"' : ''); ?> /> <label for="plugin_show_avatars_in_comments_1"><?php _e ('Yes, use small avatars from social networks if available', 'oa_social_login'); ?></label><br />
1081
+ <input type="radio" id="plugin_show_avatars_in_comments_2" name="oa_social_login_settings[plugin_show_avatars_in_comments]" value="2" <?php echo ($plugin_show_avatars_in_comments == 2 ? 'checked="checked"' : ''); ?> /> <label for="plugin_show_avatars_in_comments_2"><?php _e ('Yes, use large avatars from social networks if available', 'oa_social_login'); ?></label>
1082
  </td>
1083
  </tr>
1084
  </table>
1098
  <?php
1099
  $plugin_comment_show = ((isset ($settings ['plugin_comment_show']) AND in_array ($settings ['plugin_comment_show'], array (0, 1))) ? $settings ['plugin_comment_show'] : 1);
1100
  ?>
1101
+ <input type="radio" id="plugin_comment_show_1" name="oa_social_login_settings[plugin_comment_show]" value="1" <?php echo ($plugin_comment_show == 1 ? 'checked="checked"' : ''); ?> /> <label for="plugin_comment_show_1"><?php _e ('Yes, show the Social Login buttons', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1102
+ <input type="radio" id="plugin_comment_show_0" name="oa_social_login_settings[plugin_comment_show]" value="0" <?php echo ($plugin_comment_show == 0 ? 'checked="checked"' : ''); ?> /> <label for="plugin_comment_show_0"><?php _e ('No, do not show the Social Login buttons', 'oa_social_login'); ?></label><br />
1103
  </td>
1104
  </tr>
1105
  <tr class="row_odd">
1113
  $plugin_comment_show_if_members_only = ((isset ($settings ['plugin_comment_show_if_members_only']) AND in_array ($settings ['plugin_comment_show_if_members_only'], array (0, 1))) ? $settings ['plugin_comment_show_if_members_only'] : 1);
1114
  ?>
1115
  <span class="description"><?php _e ('The buttons will be displayed below the "You must be logged in to leave a comment" notice.'); ?> </span><br />
1116
+ <input type="radio" id="plugin_comment_show_if_members_only_1" name="oa_social_login_settings[plugin_comment_show_if_members_only]" value="1" <?php echo ($plugin_comment_show_if_members_only == 1 ? 'checked="checked"' : ''); ?> /> <label for="plugin_comment_show_if_members_only_1"><?php _e ('Yes, show the Social Login buttons', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1117
+ <input type="radio" id="plugin_comment_show_if_members_only_0" name="oa_social_login_settings[plugin_comment_show_if_members_only]" value="0" <?php echo ($plugin_comment_show_if_members_only == 0 ? 'checked="checked"' : ''); ?> /> <label for="plugin_comment_show_if_members_only_0"><?php _e ('No, do not show the Social Login buttons', 'oa_social_login'); ?></label>
1118
  </td>
1119
  </tr>
1120
  <tr class="row_odd">
1127
  <?php
1128
  $plugin_comment_auto_approve = ((isset ($settings ['plugin_comment_auto_approve']) AND in_array ($settings ['plugin_comment_auto_approve'], array (0, 1))) ? $settings ['plugin_comment_auto_approve'] : 0);
1129
  ?>
1130
+ <input type="radio" id="plugin_comment_auto_approve_1" name="oa_social_login_settings[plugin_comment_auto_approve]" value="1" <?php echo ($plugin_comment_auto_approve == 1 ? 'checked="checked"' : ''); ?> /> <label for="plugin_comment_auto_approve_1"><?php _e ('Yes, automatically approve comments made by users that connected with Social Login', 'oa_social_login'); ?></label><br />
1131
+ <input type="radio" id="plugin_comment_auto_approve_0" name="oa_social_login_settings[plugin_comment_auto_approve]" value="0" <?php echo ($plugin_comment_auto_approve == 0 ? 'checked="checked"' : ''); ?> /> <label for="plugin_comment_auto_approve_0"><?php _e ('No, do not automatically approve', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</label>
1132
  </strong><br />
1133
  </td>
1134
  </tr>
1151
  <?php
1152
  $plugin_profile_show = ((isset ($settings ['plugin_profile_show']) AND in_array ($settings ['plugin_profile_show'], array (0, 1))) ? $settings ['plugin_profile_show'] : 1);
1153
  ?>
1154
+ <input type="radio" id="plugin_profile_show_1" name="oa_social_login_settings[plugin_profile_show]" value="1" <?php echo ($plugin_profile_show == 1 ? 'checked="checked"' : ''); ?> /> <label for="plugin_profile_show_1"><?php _e ('Yes, show the Social Link buttons', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1155
+ <input type="radio" id="plugin_profile_show_0" name="oa_social_login_settings[plugin_profile_show]" value="0" <?php echo ($plugin_profile_show == 0 ? 'checked="checked"' : ''); ?> /> <label for="plugin_profile_show_0"><?php _e ('No, do not show the Social Link buttons', 'oa_social_login'); ?></label><br />
1156
  </td>
1157
  </tr>
1158
  </table>
1172
  <?php
1173
  $plugin_display_in_login_form = ((isset ($settings ['plugin_display_in_login_form']) AND in_array ($settings ['plugin_display_in_login_form'], array (0, 1))) ? $settings ['plugin_display_in_login_form'] : 1);
1174
  ?>
1175
+ <input type="radio" id="plugin_display_in_login_form_1" name="oa_social_login_settings[plugin_display_in_login_form]" value="1" <?php echo ($plugin_display_in_login_form == 1 ? 'checked="checked"' : ''); ?> /> <label for="plugin_display_in_login_form_1"><?php _e ('Yes, display the social network buttons below the login form', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1176
+ <input type="radio" id="plugin_display_in_login_form_0" name="oa_social_login_settings[plugin_display_in_login_form]" value="0" <?php echo ($plugin_display_in_login_form == 0 ? 'checked="checked"' : ''); ?> /> <label for="plugin_display_in_login_form_0"><?php _e ('No, disable social network buttons in the login form', 'oa_social_login'); ?></label>
1177
  </td>
1178
  </tr>
1179
  <tr class="row_odd">
1187
  $plugin_login_form_redirect = ((isset ($settings ['plugin_login_form_redirect']) AND in_array ($settings ['plugin_login_form_redirect'], array ('current','homepage','dashboard','custom'))) ? $settings ['plugin_login_form_redirect'] : 'homepage');
1188
  $plugin_login_form_redirect_custom_url = (isset ($settings ['plugin_login_form_redirect_custom_url']) ? $settings ['plugin_login_form_redirect_custom_url'] : '');
1189
  ?>
1190
+ <input type="radio" id="plugin_login_form_redirect_current" name="oa_social_login_settings[plugin_login_form_redirect]" value="current" <?php echo ($plugin_login_form_redirect == 'current' ? 'checked="checked"' : ''); ?> /> <label for="plugin_login_form_redirect_current"><?php _e ('Redirect users back to the current page', 'oa_social_login'); ?></label><br />
1191
+ <input type="radio" id="plugin_login_form_redirect_homepage" name="oa_social_login_settings[plugin_login_form_redirect]" value="homepage" <?php echo ($plugin_login_form_redirect == 'homepage' ? 'checked="checked"' : ''); ?> /> <label for="plugin_login_form_redirect_homepage"><?php _e ('Redirect users to the homepage of my blog', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1192
+ <input type="radio" id="plugin_login_form_redirect_dashboard" name="oa_social_login_settings[plugin_login_form_redirect]" value="dashboard" <?php echo ($plugin_login_form_redirect == 'dashboard' ? 'checked="checked"' : ''); ?> /> <label for="plugin_login_form_redirect_dashboard"><?php _e ('Redirect users to their account dashboard', 'oa_social_login'); ?></label><br />
1193
+ <input type="radio" id="plugin_login_form_redirect_custom" name="oa_social_login_settings[plugin_login_form_redirect]" value="custom" <?php echo ($plugin_login_form_redirect == 'custom' ? 'checked="checked"' : ''); ?> /> <label for="plugin_login_form_redirect_custom"><?php _e ('Redirect users to the following url', 'oa_social_login'); ?>:</label><br />
1194
  <input type="text" name="oa_social_login_settings[plugin_login_form_redirect_custom_url]" size="90" value="<?php echo htmlspecialchars ($plugin_login_form_redirect_custom_url); ?>" />
1195
  </td>
1196
  </tr>
1204
  <?php
1205
  $plugin_protect_login_redirect_url = (empty ($settings ['plugin_protect_login_redirect_url']) ? 0 : 1);
1206
  ?>
1207
+ <input type="radio" id="plugin_protect_login_redirect_url_0" name="oa_social_login_settings[plugin_protect_login_redirect_url]" value="0" <?php echo ($plugin_protect_login_redirect_url == 0 ? 'checked="checked"' : ''); ?> /> <label for="plugin_protect_login_redirect_url_0"><?php _e ('Yes, allow plugins to change the redirection url', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1208
+ <input type="radio" id="plugin_protect_login_redirect_url_1" name="oa_social_login_settings[plugin_protect_login_redirect_url]" value="1" <?php echo ($plugin_protect_login_redirect_url == 1 ? 'checked="checked"' : ''); ?> /> <label for="plugin_protect_login_redirect_url_1"><?php _e ('No, protect the redirection url (Use this option if the redirection does not work correctly)', 'oa_social_login'); ?></label>
1209
  </td>
1210
  </tr>
1211
+
1212
+
1213
+
1214
  </table>
1215
  <table class="form-table oa_social_login_table">
1216
  <tr class="row_head">
1228
  <?php
1229
  $plugin_display_in_registration_form = ((isset ($settings ['plugin_display_in_registration_form']) AND in_array ($settings ['plugin_display_in_registration_form'], array (0, 1))) ? $settings ['plugin_display_in_registration_form'] : 1);
1230
  ?>
1231
+ <input type="radio" id="plugin_display_in_registration_form_1" name="oa_social_login_settings[plugin_display_in_registration_form]" value="1" <?php echo ($plugin_display_in_registration_form == 1 ? 'checked="checked"' : ''); ?> /> <label for="plugin_display_in_registration_form_1"><?php _e ('Yes, display the social network buttons below the registration form', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1232
+ <input type="radio" id="plugin_display_in_registration_form_0" name="oa_social_login_settings[plugin_display_in_registration_form]" value="0" <?php echo ($plugin_display_in_registration_form == 0 ? 'checked="checked"' : ''); ?> /> <label for="plugin_display_in_registration_form_0"><?php _e ('No, disable social network buttons in the registration form', 'oa_social_login'); ?></label>
1233
  </td>
1234
  </tr>
1235
  <tr class="row_odd">
1243
  $plugin_registration_form_redirect = ((isset ($settings ['plugin_registration_form_redirect']) AND in_array ($settings ['plugin_registration_form_redirect'], array ('current','homepage','dashboard','custom'))) ? $settings ['plugin_registration_form_redirect'] : 'dashboard');
1244
  $plugin_registration_form_redirect_custom_url = (isset ($settings ['plugin_registration_form_redirect_custom_url']) ? $settings ['plugin_registration_form_redirect_custom_url'] : '');
1245
  ?>
1246
+ <input type="radio" id="plugin_registration_form_redirect_current" name="oa_social_login_settings[plugin_registration_form_redirect]" value="current" <?php echo ($plugin_registration_form_redirect == 'current' ? 'checked="checked"' : ''); ?> /> <label for="plugin_registration_form_redirect_current"><?php _e ('Redirect users back to the current page', 'oa_social_login'); ?></label><br />
1247
+ <input type="radio" id="plugin_registration_form_redirect_homepage" name="oa_social_login_settings[plugin_registration_form_redirect]" value="homepage" <?php echo ($plugin_registration_form_redirect == 'homepage' ? 'checked="checked"' : ''); ?> /> <label for="plugin_registration_form_redirect_homepage"><?php _e ('Redirect users to the homepage of my blog', 'oa_social_login'); ?></label><br />
1248
+ <input type="radio" id="plugin_registration_form_redirect_dashboard" name="oa_social_login_settings[plugin_registration_form_redirect]" value="dashboard" <?php echo ($plugin_registration_form_redirect == 'dashboard' ? 'checked="checked"' : ''); ?> /> <label for="plugin_registration_form_redirect_dashboard"><?php _e ('Redirect users to their account dashboard', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1249
+ <input type="radio" id="plugin_registration_form_redirect_custom" name="oa_social_login_settings[plugin_registration_form_redirect]" value="custom" <?php echo ($plugin_registration_form_redirect == 'custom' ? 'checked="checked"' : ''); ?> /> <label for="plugin_registration_form_redirect_custom"><?php _e ('Redirect users to the following url', 'oa_social_login'); ?>:</label><br />
1250
  <input type="text" name="oa_social_login_settings[plugin_registration_form_redirect_custom_url]" size="90" value="<?php echo htmlspecialchars ($plugin_registration_form_redirect_custom_url); ?>" />
1251
  </td>
1252
  </tr>
1260
  <?php
1261
  $plugin_protect_registration_redirect_url = (empty ($settings ['plugin_protect_registration_redirect_url']) ? 0 : 1);
1262
  ?>
1263
+ <input type="radio" id="plugin_protect_registration_redirect_url_0" name="oa_social_login_settings[plugin_protect_registration_redirect_url]" value="0" <?php echo ($plugin_protect_registration_redirect_url == 0 ? 'checked="checked"' : ''); ?> /> <label for="plugin_protect_registration_redirect_url_0"><?php _e ('Yes, allow plugins to change the redirection url', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1264
+ <input type="radio" id="plugin_protect_registration_redirect_url_1" name="oa_social_login_settings[plugin_protect_registration_redirect_url]" value="1" <?php echo ($plugin_protect_registration_redirect_url == 1 ? 'checked="checked"' : ''); ?> /> <label for="plugin_protect_registration_redirect_url_1"><?php _e ('No, protect the redirection url (Use this option if the redirection does not work correctly)', 'oa_social_login'); ?></label>
1265
  </td>
1266
  </tr>
1267
  </table>
1282
  $plugin_shortcode_login_redirect = ((isset ($settings ['plugin_shortcode_login_redirect']) AND in_array ($settings ['plugin_shortcode_login_redirect'], array ('current', 'dashboard', 'homepage', 'custom'))) ? $settings ['plugin_shortcode_login_redirect'] : 'current');
1283
  $plugin_shortcode_login_redirect_url = (isset ($settings ['plugin_shortcode_login_redirect_url']) ? $settings ['plugin_shortcode_login_redirect_url'] : '');
1284
  ?>
1285
+ <input type="radio" id="plugin_shortcode_login_redirect_current" name="oa_social_login_settings[plugin_shortcode_login_redirect]" value="current" <?php echo ($plugin_shortcode_login_redirect == 'current' ? 'checked="checked"' : ''); ?> /> <label for="plugin_shortcode_login_redirect_current"><?php _e ('Redirect users back to the current page', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1286
+ <input type="radio" id="plugin_shortcode_login_redirect_homepage" name="oa_social_login_settings[plugin_shortcode_login_redirect]" value="homepage" <?php echo ($plugin_shortcode_login_redirect == 'homepage' ? 'checked="checked"' : ''); ?> /> <label for="plugin_shortcode_login_redirect_homepage"><?php _e ('Redirect users to the homepage of my blog', 'oa_social_login'); ?></label><br />
1287
+ <input type="radio" id="plugin_shortcode_login_redirect_dashboard" name="oa_social_login_settings[plugin_shortcode_login_redirect]" value="dashboard" <?php echo ($plugin_shortcode_login_redirect == 'dashboard' ? 'checked="checked"' : ''); ?> /> <label for="plugin_shortcode_login_redirect_dashboard"><?php _e ('Redirect users to their account dashboard', 'oa_social_login'); ?></label><br />
1288
+ <input type="radio" id="plugin_shortcode_login_redirect_custom" name="oa_social_login_settings[plugin_shortcode_login_redirect]" value="custom" <?php echo ($plugin_shortcode_login_redirect == 'custom' ? 'checked="checked"' : ''); ?> /> <label for="plugin_shortcode_login_redirect_custom"><?php _e ('Redirect users to the following url', 'oa_social_login'); ?>:</label><br />
1289
  <input type="text" name="oa_social_login_settings[plugin_shortcode_login_redirect_url]" size="90" value="<?php echo htmlspecialchars ($plugin_shortcode_login_redirect_url); ?>" />
1290
  </td>
1291
  </tr>
1300
  $plugin_shortcode_register_redirect = ((isset ($settings ['plugin_shortcode_register_redirect']) AND in_array ($settings ['plugin_shortcode_register_redirect'], array ('current', 'dashboard', 'homepage', 'custom'))) ? $settings ['plugin_shortcode_register_redirect'] : 'current');
1301
  $plugin_shortcode_register_redirect_url = (isset ($settings ['plugin_shortcode_register_redirect_url']) ? $settings ['plugin_shortcode_register_redirect_url'] : '');
1302
  ?>
1303
+ <input type="radio" id="plugin_shortcode_register_redirect_current" name="oa_social_login_settings[plugin_shortcode_register_redirect]" value="current" <?php echo ($plugin_shortcode_register_redirect == 'current' ? 'checked="checked"' : ''); ?> /> <label for="plugin_shortcode_register_redirect_current"><?php _e ('Redirect users back to the current page', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong></label><br />
1304
+ <input type="radio" id="plugin_shortcode_register_redirect_homepage" name="oa_social_login_settings[plugin_shortcode_register_redirect]" value="homepage" <?php echo ($plugin_shortcode_register_redirect == 'homepage' ? 'checked="checked"' : ''); ?> /> <label for="plugin_shortcode_register_redirect_homepage"><?php _e ('Redirect users to the homepage of my blog', 'oa_social_login'); ?></label><br />
1305
+ <input type="radio" id="plugin_shortcode_register_redirect_dashboard" name="oa_social_login_settings[plugin_shortcode_register_redirect]" value="dashboard" <?php echo ($plugin_shortcode_register_redirect == 'dashboard' ? 'checked="checked"' : ''); ?> /> <label for="plugin_shortcode_register_redirect_dashboard"><?php _e ('Redirect users to their account dashboard', 'oa_social_login'); ?></label><br />
1306
+ <input type="radio" id="plugin_shortcode_register_redirect_custom" name="oa_social_login_settings[plugin_shortcode_register_redirect]" value="custom" <?php echo ($plugin_shortcode_register_redirect == 'custom' ? 'checked="checked"' : ''); ?> /> <label for="plugin_shortcode_register_redirect_custom"><?php _e ('Redirect users to the following url', 'oa_social_login'); ?>:</label><br />
1307
  <input type="text" name="oa_social_login_settings[plugin_shortcode_register_redirect_url]" size="90" value="<?php echo htmlspecialchars ($plugin_shortcode_register_redirect_url); ?>" />
1308
  </td>
1309
  </tr>
includes/communication.php CHANGED
@@ -30,7 +30,7 @@ function oa_social_login_callback ()
30
  $api_opts = array ();
31
  $api_opts['api_key'] = (!empty ($settings ['api_key']) ? $settings ['api_key'] : '');
32
  $api_opts['api_secret'] = (!empty ($settings ['api_secret']) ? $settings ['api_secret'] : '');
33
-
34
  //Retrieve connection details
35
  $result = oa_social_login_do_api_request ($api_connection_handler, $api_resource_url, $api_opts);
36
 
@@ -40,7 +40,7 @@ function oa_social_login_callback ()
40
  //Decode result
41
  $decoded_result = @json_decode ($result->http_data);
42
  if (is_object ($decoded_result) AND isset ($decoded_result->response->result->data->user))
43
- {
44
  //User data
45
  $user_data = $decoded_result->response->result->data->user;
46
 
@@ -476,12 +476,12 @@ function oa_social_login_callback ()
476
  // New User (Registration)
477
  if ($new_registration === true)
478
  {
479
- // Apply the WordPress filters
480
  if (empty ($settings['plugin_protect_registration_redirect_url']))
481
- {
482
  $redirect_to = apply_filters ('registration_redirect', $redirect_to);
483
  }
484
-
485
  // Apply our filters
486
  $redirect_to = apply_filters ('oa_social_login_filter_registration_redirect_url', $redirect_to, $user_data);
487
  }
@@ -532,7 +532,7 @@ function oa_social_login_do_api_request ($handler, $url, $opts = array (), $time
532
  $opts['proxy_username'] = (defined('WP_PROXY_USERNAME') ? WP_PROXY_USERNAME : '');
533
  $opts['proxy_password'] = (defined('WP_PROXY_PASSWORD') ? WP_PROXY_PASSWORD : '');
534
  }
535
-
536
  //FSOCKOPEN
537
  if ($handler == 'fsockopen')
538
  {
@@ -610,7 +610,7 @@ function oa_social_login_fsockopen_request ($url, $options = array (), $timeout
610
  {
611
  $result->http_error = 'invalid_uri';
612
  return $result;
613
- }
614
 
615
  //Check the scheme
616
  if ($uri ['scheme'] == 'https')
@@ -627,85 +627,85 @@ function oa_social_login_fsockopen_request ($url, $options = array (), $timeout
627
  $url_protocol = 'http://';
628
  $url_prefix = '';
629
  }
630
-
631
  //Construct the path to act on
632
  $path = (isset ($uri ['path']) ? $uri ['path'] : '/').( ! empty ($uri ['query']) ? ('?'.$uri ['query']) : '');
633
-
634
  //HTTP Headers
635
  $headers = array();
636
-
637
  // We are using a proxy
638
  if (! empty ($options ['proxy_url']) && ! empty ($options ['proxy_port']))
639
  {
640
  // Open Socket
641
  $fp = @fsockopen ($options ['proxy_url'], $options ['proxy_port'], $errno, $errstr, $timeout);
642
-
643
  //Make sure that the socket has been opened properly
644
  if (!$fp)
645
  {
646
  $result->http_error = trim ($errstr);
647
  return $result;
648
  }
649
-
650
  // HTTP Headers
651
  $headers[] = "GET " . $url_protocol . $url . $path . " HTTP/1.0";
652
  $headers[] = "Host: " . $url . ":" . $port;
653
-
654
  // Proxy Authentication
655
  if ( ! empty ($options ['proxy_username']) && ! empty ($options ['proxy_password']))
656
  {
657
  $headers [] = 'Proxy-Authorization: Basic ' . base64_encode ($options ['proxy_username'] . ":" . $options ['proxy_password']);
658
  }
659
-
660
  }
661
  // We are not using a proxy
662
  else
663
  {
664
  // Open Socket
665
  $fp = @fsockopen ($url_prefix . $url, $port, $errno, $errstr, $timeout);
666
-
667
  //Make sure that the socket has been opened properly
668
  if (!$fp)
669
  {
670
  $result->http_error = trim ($errstr);
671
  return $result;
672
  }
673
-
674
  // HTTP Headers
675
  $headers[] = "GET " . $path." HTTP/1.0";
676
  $headers[] = "Host: " . $url;
677
  }
678
-
679
  //Enable basic authentication
680
  if (isset ($options ['api_key']) AND isset ($options ['api_secret']))
681
  {
682
  $headers [] = 'Authorization: Basic ' . base64_encode ($options ['api_key'] . ":" . $options ['api_secret']);
683
  }
684
-
685
  //Build and send request
686
  fwrite ($fp, (implode ("\r\n", $headers). "\r\n\r\n"));
687
-
688
  //Fetch response
689
  $response = '';
690
  while (!feof ($fp))
691
  {
692
  $response .= fread ($fp, 1024);
693
  }
694
-
695
  //Close connection
696
  fclose ($fp);
697
-
698
  //Parse response
699
  list($response_header, $response_body) = explode ("\r\n\r\n", $response, 2);
700
-
701
  //Parse header
702
  $response_header = preg_split ("/\r\n|\n|\r/", $response_header);
703
  list($header_protocol, $header_code, $header_status_message) = explode (' ', trim (array_shift ($response_header)), 3);
704
-
705
  //Build result
706
  $result->http_code = $header_code;
707
  $result->http_data = $response_body;
708
-
709
  //Done
710
  return $result;
711
  }
@@ -779,24 +779,24 @@ function oa_social_login_curl_request ($url, $options = array (), $timeout = 15)
779
  curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
780
  curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);
781
  curl_setopt ($curl, CURLOPT_SSL_VERIFYHOST, 0);
782
- curl_setopt ($curl, CURLOPT_USERAGENT, 'SocialLogin ' . OA_SOCIAL_LOGIN_VERSION . 'WP (+http://www.oneall.com/)');
783
-
784
  // BASIC AUTH?
785
  if (isset ($options ['api_key']) AND isset ($options ['api_secret']))
786
  {
787
  curl_setopt ($curl, CURLOPT_USERPWD, $options ['api_key'] . ":" . $options ['api_secret']);
788
  }
789
-
790
  // Proxy Settings
791
  if ( ! empty ($options ['proxy_url']) && ! empty ($options ['proxy_port']))
792
  {
793
  // Proxy Location
794
  curl_setopt ($curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
795
  curl_setopt ($curl, CURLOPT_PROXY, $options ['proxy_url']);
796
-
797
  // Proxy Port
798
- curl_setopt ($curl, CURLOPT_PROXYPORT, $options ['proxy_port']);
799
-
800
  // Proxy Authentication
801
  if ( ! empty ($options ['proxy_username']) && ! empty ($options ['proxy_password']))
802
  {
30
  $api_opts = array ();
31
  $api_opts['api_key'] = (!empty ($settings ['api_key']) ? $settings ['api_key'] : '');
32
  $api_opts['api_secret'] = (!empty ($settings ['api_secret']) ? $settings ['api_secret'] : '');
33
+
34
  //Retrieve connection details
35
  $result = oa_social_login_do_api_request ($api_connection_handler, $api_resource_url, $api_opts);
36
 
40
  //Decode result
41
  $decoded_result = @json_decode ($result->http_data);
42
  if (is_object ($decoded_result) AND isset ($decoded_result->response->result->data->user))
43
+ {
44
  //User data
45
  $user_data = $decoded_result->response->result->data->user;
46
 
476
  // New User (Registration)
477
  if ($new_registration === true)
478
  {
479
+ // Apply the WordPress filters
480
  if (empty ($settings['plugin_protect_registration_redirect_url']))
481
+ {
482
  $redirect_to = apply_filters ('registration_redirect', $redirect_to);
483
  }
484
+
485
  // Apply our filters
486
  $redirect_to = apply_filters ('oa_social_login_filter_registration_redirect_url', $redirect_to, $user_data);
487
  }
532
  $opts['proxy_username'] = (defined('WP_PROXY_USERNAME') ? WP_PROXY_USERNAME : '');
533
  $opts['proxy_password'] = (defined('WP_PROXY_PASSWORD') ? WP_PROXY_PASSWORD : '');
534
  }
535
+
536
  //FSOCKOPEN
537
  if ($handler == 'fsockopen')
538
  {
610
  {
611
  $result->http_error = 'invalid_uri';
612
  return $result;
613
+ }
614
 
615
  //Check the scheme
616
  if ($uri ['scheme'] == 'https')
627
  $url_protocol = 'http://';
628
  $url_prefix = '';
629
  }
630
+
631
  //Construct the path to act on
632
  $path = (isset ($uri ['path']) ? $uri ['path'] : '/').( ! empty ($uri ['query']) ? ('?'.$uri ['query']) : '');
633
+
634
  //HTTP Headers
635
  $headers = array();
636
+
637
  // We are using a proxy
638
  if (! empty ($options ['proxy_url']) && ! empty ($options ['proxy_port']))
639
  {
640
  // Open Socket
641
  $fp = @fsockopen ($options ['proxy_url'], $options ['proxy_port'], $errno, $errstr, $timeout);
642
+
643
  //Make sure that the socket has been opened properly
644
  if (!$fp)
645
  {
646
  $result->http_error = trim ($errstr);
647
  return $result;
648
  }
649
+
650
  // HTTP Headers
651
  $headers[] = "GET " . $url_protocol . $url . $path . " HTTP/1.0";
652
  $headers[] = "Host: " . $url . ":" . $port;
653
+
654
  // Proxy Authentication
655
  if ( ! empty ($options ['proxy_username']) && ! empty ($options ['proxy_password']))
656
  {
657
  $headers [] = 'Proxy-Authorization: Basic ' . base64_encode ($options ['proxy_username'] . ":" . $options ['proxy_password']);
658
  }
659
+
660
  }
661
  // We are not using a proxy
662
  else
663
  {
664
  // Open Socket
665
  $fp = @fsockopen ($url_prefix . $url, $port, $errno, $errstr, $timeout);
666
+
667
  //Make sure that the socket has been opened properly
668
  if (!$fp)
669
  {
670
  $result->http_error = trim ($errstr);
671
  return $result;
672
  }
673
+
674
  // HTTP Headers
675
  $headers[] = "GET " . $path." HTTP/1.0";
676
  $headers[] = "Host: " . $url;
677
  }
678
+
679
  //Enable basic authentication
680
  if (isset ($options ['api_key']) AND isset ($options ['api_secret']))
681
  {
682
  $headers [] = 'Authorization: Basic ' . base64_encode ($options ['api_key'] . ":" . $options ['api_secret']);
683
  }
684
+
685
  //Build and send request
686
  fwrite ($fp, (implode ("\r\n", $headers). "\r\n\r\n"));
687
+
688
  //Fetch response
689
  $response = '';
690
  while (!feof ($fp))
691
  {
692
  $response .= fread ($fp, 1024);
693
  }
694
+
695
  //Close connection
696
  fclose ($fp);
697
+
698
  //Parse response
699
  list($response_header, $response_body) = explode ("\r\n\r\n", $response, 2);
700
+
701
  //Parse header
702
  $response_header = preg_split ("/\r\n|\n|\r/", $response_header);
703
  list($header_protocol, $header_code, $header_status_message) = explode (' ', trim (array_shift ($response_header)), 3);
704
+
705
  //Build result
706
  $result->http_code = $header_code;
707
  $result->http_data = $response_body;
708
+
709
  //Done
710
  return $result;
711
  }
779
  curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
780
  curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);
781
  curl_setopt ($curl, CURLOPT_SSL_VERIFYHOST, 0);
782
+ curl_setopt ($curl, CURLOPT_USERAGENT, 'SocialLogin/' . OA_SOCIAL_LOGIN_VERSION . ' WordPress/' . oa_social_login_get_wp_version() . ' (+http://www.oneall.com/)');
783
+
784
  // BASIC AUTH?
785
  if (isset ($options ['api_key']) AND isset ($options ['api_secret']))
786
  {
787
  curl_setopt ($curl, CURLOPT_USERPWD, $options ['api_key'] . ":" . $options ['api_secret']);
788
  }
789
+
790
  // Proxy Settings
791
  if ( ! empty ($options ['proxy_url']) && ! empty ($options ['proxy_port']))
792
  {
793
  // Proxy Location
794
  curl_setopt ($curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
795
  curl_setopt ($curl, CURLOPT_PROXY, $options ['proxy_url']);
796
+
797
  // Proxy Port
798
+ curl_setopt ($curl, CURLOPT_PROXYPORT, $options ['proxy_port']);
799
+
800
  // Proxy Authentication
801
  if ( ! empty ($options ['proxy_username']) && ! empty ($options ['proxy_password']))
802
  {
includes/toolbox.php CHANGED
@@ -176,6 +176,48 @@ function oa_social_login_get_disabled_functions ()
176
  return $disabled_functions;
177
  }
178
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
 
180
  /**
181
  * Escape an attribute
@@ -201,7 +243,7 @@ function oa_social_login_esc_attr ($string)
201
  */
202
  function oa_social_login_get_userid_by_token ($token)
203
  {
204
- global $wpdb;
205
 
206
  // Sanitize token.
207
  $token = trim (strval ($token));
@@ -223,7 +265,7 @@ function oa_social_login_get_userid_by_token ($token)
223
  */
224
  function oa_social_login_get_token_by_userid ($userid)
225
  {
226
- global $wpdb;
227
  $sql = "SELECT um.meta_value FROM " . $wpdb->usermeta . " AS um INNER JOIN " . $wpdb->users . " AS u ON (um.user_id=u.ID) WHERE um.meta_key = 'oa_social_login_user_token' AND u.ID=%d";
228
  return $wpdb->get_var ($wpdb->prepare ($sql, $userid));
229
  }
@@ -255,7 +297,7 @@ function oa_social_login_create_rand_email ()
255
  function oa_social_login_has_bp_user_uploaded_avatar ($user_id)
256
  {
257
  $has_bp_user_uploaded_avatar = false;
258
-
259
  // Use build-in function
260
  if (function_exists ('bp_get_user_has_avatar'))
261
  {
@@ -264,22 +306,22 @@ function oa_social_login_has_bp_user_uploaded_avatar ($user_id)
264
  // Do custom processing
265
  else
266
  {
267
- // Make sure we can actually do this
268
  if (function_exists ('bp_core_fetch_avatar') && function_exists ('bp_core_avatar_default'))
269
  {
270
  // Fetch the custom BuddyPress avatar for this user
271
  $bp_user_avatar = strtolower (trim (strval (bp_core_fetch_avatar (array ('item_id' => $user_id, 'no_grav' => true, 'html' => false, 'type' => 'full')))));
272
-
273
  // Fetch the default BuddyPress avatar
274
  $bp_default_avatar = strtolower (trim (strval (bp_core_avatar_default ('local'))));
275
-
276
  // Custom Avatar?
277
  $has_bp_user_uploaded_avatar = (($bp_user_avatar == $bp_default_avatar) ? false : true);
278
-
279
  // Done
280
  $has_bp_user_uploaded_avatar = apply_filters('bp_get_user_has_avatar', $has_bp_user_uploaded_avatar, $user_id);
281
  }
282
  }
283
-
284
  return $has_bp_user_uploaded_avatar;
285
  }
176
  return $disabled_functions;
177
  }
178
 
179
+ /**
180
+ * Return the URL of the CSS theme
181
+ */
182
+ function oa_social_login_get_theme_css_url ($theme_id = 0)
183
+ {
184
+ // Themes are served from the CDN
185
+ $cdn_uri = (oa_social_login_https_on () ? 'https://secure.oneallcdn.com' : 'http://public.oneallcdn.com');
186
+
187
+ // Build Theme
188
+ switch ($theme_id)
189
+ {
190
+ case '1':
191
+ return ($cdn_uri . '/css/api/socialize/themes/wordpress/modern.css');
192
+
193
+ case '2':
194
+ return ($cdn_uri . '/css/api/socialize/themes/wordpress/small.css');
195
+
196
+ default:
197
+ return ($cdn_uri . '/css/api/socialize/themes/wordpress/default.css');
198
+ }
199
+ }
200
+
201
+ /**
202
+ * Return the current WordPress Version
203
+ */
204
+ function oa_social_login_get_wp_version ()
205
+ {
206
+ GLOBAL $wp_version;
207
+
208
+ // Version
209
+ $version = (isset ($wp_version) ? trim ($wp_version) : '');
210
+ if (empty ($wp_version))
211
+ {
212
+ if (function_exists ('get_bloginfo'))
213
+ {
214
+ $version = get_bloginfo('version');
215
+ }
216
+ }
217
+
218
+ return (empty ($version) ? '?' : $version);
219
+ }
220
+
221
 
222
  /**
223
  * Escape an attribute
243
  */
244
  function oa_social_login_get_userid_by_token ($token)
245
  {
246
+ GLOBAL $wpdb;
247
 
248
  // Sanitize token.
249
  $token = trim (strval ($token));
265
  */
266
  function oa_social_login_get_token_by_userid ($userid)
267
  {
268
+ GLOBAL $wpdb;
269
  $sql = "SELECT um.meta_value FROM " . $wpdb->usermeta . " AS um INNER JOIN " . $wpdb->users . " AS u ON (um.user_id=u.ID) WHERE um.meta_key = 'oa_social_login_user_token' AND u.ID=%d";
270
  return $wpdb->get_var ($wpdb->prepare ($sql, $userid));
271
  }
297
  function oa_social_login_has_bp_user_uploaded_avatar ($user_id)
298
  {
299
  $has_bp_user_uploaded_avatar = false;
300
+
301
  // Use build-in function
302
  if (function_exists ('bp_get_user_has_avatar'))
303
  {
306
  // Do custom processing
307
  else
308
  {
309
+ // Make sure we can actually do this
310
  if (function_exists ('bp_core_fetch_avatar') && function_exists ('bp_core_avatar_default'))
311
  {
312
  // Fetch the custom BuddyPress avatar for this user
313
  $bp_user_avatar = strtolower (trim (strval (bp_core_fetch_avatar (array ('item_id' => $user_id, 'no_grav' => true, 'html' => false, 'type' => 'full')))));
314
+
315
  // Fetch the default BuddyPress avatar
316
  $bp_default_avatar = strtolower (trim (strval (bp_core_avatar_default ('local'))));
317
+
318
  // Custom Avatar?
319
  $has_bp_user_uploaded_avatar = (($bp_user_avatar == $bp_default_avatar) ? false : true);
320
+
321
  // Done
322
  $has_bp_user_uploaded_avatar = apply_filters('bp_get_user_has_avatar', $has_bp_user_uploaded_avatar, $user_id);
323
  }
324
  }
325
+
326
  return $has_bp_user_uploaded_avatar;
327
  }
includes/user_interface.php CHANGED
@@ -131,7 +131,7 @@ function oa_social_login_render_link_form ($source, $user)
131
  $result = oa_social_login_do_api_request ($api_connection_handler, $api_resource_url, array ('api_key' => $api_key, 'api_secret' => $api_secret));
132
 
133
  //Parse result
134
- if (is_object ($result) AND property_exists ($result, 'http_code') AND property_exists ($result, 'http_data') AND $result->http_code == 200)
135
  {
136
  //Decode
137
  $json_decoded = json_decode ($result->http_data);
@@ -142,171 +142,162 @@ function oa_social_login_render_link_form ($source, $user)
142
  //Extract data
143
  $data = $json_decoded->response->result->data;
144
 
 
145
  //Check for plugin status
146
- if (is_object ($data) AND property_exists ($data, 'plugin') AND $data->plugin->key == 'social_link' AND $data->plugin->data->status == 'success')
147
  {
148
- //Get the id of the linked user - Can be empty
149
- $userid_by_token = oa_social_login_get_userid_by_token ($data->user->user_token);
150
-
151
- //Link identity
152
- if ($data->plugin->data->action == 'link_identity')
153
- {
154
- //Hook for other plugins
155
- do_action ('oa_social_login_action_before_user_link', $user->data, $data->user->identity, $userid_by_token);
156
-
157
- // The user already has a user_token
158
- if (is_numeric ($userid_by_token))
159
- {
160
- //Already connected to this user
161
- if ($userid_by_token == $userid)
162
- {
163
- $success_message = sprintf (__ ('You have successfully linked your %s account.', 'oa_social_login'), $data->user->identity->source->name);
164
-
165
- //Read provider list
166
- $meta_identity_providers = trim (strval (get_user_meta ($userid, 'oa_social_login_identity_provider', true)));
167
- $meta_identity_providers = explode ("|", $meta_identity_providers);
168
-
169
- //Update new provider list
170
- $identity_providers = array (
171
- trim ($data->user->identity->source->name)
172
- );
173
- foreach ($meta_identity_providers AS $meta_identity_provider)
174
- {
175
- if (strlen (trim ($meta_identity_provider)) > 0)
176
- {
177
- $identity_providers [] = trim ($meta_identity_provider);
178
- }
179
- }
180
-
181
- //First Provider
182
- if (count ($identity_providers) == 1)
183
- {
184
- update_user_meta ($userid, 'oa_social_login_identity_provider', array_shift ($identity_providers));
185
- }
186
- //Multiple Providers
187
- else
188
- {
189
- update_user_meta ($userid, 'oa_social_login_identity_provider', implode ("|", $identity_providers));
190
- }
191
- }
192
- //Connected to a different user
193
- else
194
- {
195
- $error_message = sprintf (__ ('This %s account is already used by another user of this website.', 'oa_social_login'), $data->user->identity->source->name);
196
- }
197
- }
198
- // The user does not have a user_token yet
199
- else
200
- {
201
- $success_message = sprintf (__ ('You have successfully linked your %s account.', 'oa_social_login'), $data->user->identity->source->name);
202
-
203
- //Clean Cache
204
- wp_cache_delete ($userid, 'users');
205
-
206
- //User Meta Data
207
- update_user_meta ($userid, 'oa_social_login_user_token', $data->user->user_token);
208
- update_user_meta ($userid, 'oa_social_login_identity_provider', $data->user->identity->source->name);
209
-
210
- //Thumbnail
211
- if (!empty ($data->user->identity->thumbnailUrl))
212
- {
213
- update_user_meta ($userid, 'oa_social_login_user_thumbnail', $data->user->identity->thumbnailUrl);
214
- }
215
- }
216
-
217
- //Hook for other plugins
218
- do_action ('oa_social_login_action_after_user_link', $user->data, $data->user->identity, $userid_by_token);
219
- }
220
- //UnLink identity
221
- elseif ($data->plugin->data->action == 'unlink_identity')
222
- {
223
- //Hook for other plugins
224
- do_action ('oa_social_login_action_before_user_unlink', $user->data, $data->user->identity, $userid_by_token);
225
-
226
- // The user already has a user_token
227
- if (is_numeric ($userid_by_token))
228
- {
229
- //Was connected to this user
230
- if ($userid_by_token == $userid)
231
- {
232
- $success_message = sprintf (__ ('You have successfully unlinked your %s account.', 'oa_social_login'), $data->user->identity->source->name);
233
-
234
- //Read provider list
235
- $meta_identity_providers = trim (strval (get_user_meta ($userid, 'oa_social_login_identity_provider', true)));
236
- $meta_identity_providers = explode ("|", $meta_identity_providers);
237
-
238
- //Update new provider list
239
- $identity_providers = array ();
240
- $discard_existing_identity_provider = true;
241
- foreach ($meta_identity_providers AS $meta_identity_provider)
242
- {
243
- if (strlen (trim ($meta_identity_provider)) > 0)
244
- {
245
- $meta_identity_provider = trim ($meta_identity_provider);
246
-
247
- //Different from the one that has been unlinked
248
- if ($meta_identity_provider <> $data->user->identity->source->name)
249
- {
250
- $identity_providers [] = $meta_identity_provider;
251
- }
252
- //The same as the one that has been unlinked
253
- else
254
- {
255
- //Only discard the first
256
- if ($discard_existing_identity_provider)
257
- {
258
- $discard_existing_identity_provider = false;
259
- }
260
- //Keep the others
261
- else
262
- {
263
- $identity_providers [] = $meta_identity_provider;
264
- }
265
- }
266
- }
267
- }
268
-
269
- //One provider linked
270
- if (count ($identity_providers) == 1)
271
- {
272
- update_user_meta ($userid, 'oa_social_login_identity_provider', array_shift ($identity_providers));
273
- }
274
- //Zero, two or more
275
- else
276
- {
277
- //No providers linked
278
- if (count ($identity_providers) == 0)
279
- {
280
- $error_message = __ ("You might no longer be able to login to this website if you don't link at least one social network.", 'oa_social_login');
281
- update_user_meta ($userid, 'oa_social_login_identity_provider', '');
282
- }
283
- else
284
- {
285
- update_user_meta ($userid, 'oa_social_login_identity_provider', implode ("|", $identity_providers));
286
- }
287
- }
288
- }
289
- //Connected to a different user
290
- else
291
- {
292
- $error_message = sprintf (__ ('This %s account is already used by another user of this website.', 'oa_social_login'), $data->user->identity->source->name);
293
- }
294
- }
295
- // The user does not have a user_token yet
296
- else
297
- {
298
- //Nothing to do
299
- }
300
-
301
- //Hook for other plugins
302
- do_action ('oa_social_login_action_after_user_unlink', $user->data, $data->user->identity, $userid_by_token);
303
- }
304
  }
305
  }
306
  }
307
  }
308
 
309
- //Custom CSS
 
 
 
 
 
 
310
  $css_theme_uri = apply_filters ('oa_social_login_link_css', $css_theme_uri);
311
 
312
  //OneAll user_token
@@ -319,7 +310,7 @@ function oa_social_login_render_link_form ($source, $user)
319
  $callback_uri = oa_social_login_get_current_url ();
320
  $callback_uri .= (strlen (parse_url ($callback_uri, PHP_URL_QUERY)) == 0 ? '?' : '&') . 'oa_social_login_source=' . $source . '#oa_social_link';
321
  $callback_uri = wp_nonce_url($callback_uri, 'update-user_' . $userid);
322
-
323
  //Setup Social Container
324
  $containerid = 'oneall_social_login_providers_' . mt_rand (99999, 9999999);
325
 
@@ -327,7 +318,7 @@ function oa_social_login_render_link_form ($source, $user)
327
  $social_link = array ();
328
  $social_link [] = '<div class="oneall_social_link">';
329
  $social_link [] = ' <div class="oneall_social_login_providers" id="' . $containerid . '"></div>';
330
- $social_link [] = ' <script type="text/javascript">';
331
 
332
  //Synchronous JavaScript: This is the default to stay compatible with existing installations.
333
  if (empty ($settings ['asynchronous_javascript']))
@@ -597,14 +588,14 @@ function oa_social_login_custom_avatar ($avatar, $mixed, $size, $default, $alt =
597
  {
598
  //Override current avatar ?
599
  $override_avatar = true;
600
-
601
  //BuddyPress (Thumbnails in the default WordPress toolbar)
602
  if (oa_social_login_has_bp_user_uploaded_avatar ($user_id) === true)
603
  {
604
  // Keep avatar is user has uploaded one
605
  $override_avatar = false;
606
- }
607
-
608
  //Override if no avatar, from Buddypress:
609
  if ($override_avatar)
610
  {
@@ -774,7 +765,7 @@ function oa_social_login_render_login_form_wp_login ()
774
 
775
  //Add our query argument
776
  $args ['callback_uri'] = add_query_arg (array ('oa_social_login_source' => 'login'), $args ['callback_uri']);
777
-
778
  //Add redirect_to
779
  if ( ! empty ($_REQUEST['redirect_to']))
780
  {
@@ -809,31 +800,31 @@ function oa_social_login_render_login_form_wp_registration ()
809
  {
810
  // Bugfix for Social Login being displayed twice on the WooCommerce Registration Form
811
  if ( ! did_action ('woocommerce_register_form'))
812
- {
813
  //Additional arguments for the icon builder
814
  $args = array ();
815
-
816
  //Only on the registration page
817
  if (strpos (oa_social_login_get_current_url (), 'wp-login.php') !== false)
818
  {
819
  //This is the default WordPress registration url
820
  $args ['callback_uri'] = site_url ('wp-login.php?action=register', 'login_post');
821
-
822
  //Add our query argument
823
  $args ['callback_uri'] = add_query_arg (array ('oa_social_login_source' => 'registration'), $args ['callback_uri']);
824
-
825
  //Add redirect_to
826
  if ( ! empty ($_REQUEST['redirect_to']))
827
  {
828
  $args ['callback_uri'] = add_query_arg (array ('redirect_to' => urlencode ($_REQUEST['redirect_to'])), $args ['callback_uri']);
829
  }
830
-
831
  //Hook to customize the callback uri
832
  $args ['callback_uri'] = apply_filters ('oa_social_login_filter_wp_registration_callback_uri', $args ['callback_uri']);
833
  }
834
-
835
  echo oa_social_login_render_login_form ('registration', $args);
836
- }
837
  }
838
  }
839
  }
@@ -901,13 +892,6 @@ function oa_social_login_render_login_form ($source, $args = array ())
901
  }
902
  }
903
 
904
- //Themes are served from the CDN
905
- $theme_uri_prefix = (oa_social_login_https_on () ? 'https://secure.oneallcdn.com' : 'http://public.oneallcdn.com');
906
-
907
- //Themes
908
- $css_theme_uri_small = $theme_uri_prefix . '/css/api/socialize/themes/wordpress/small.css';
909
- $css_theme_uri_default = $theme_uri_prefix . '/css/api/socialize/themes/wordpress/default.css';
910
-
911
  //Widget
912
  if ($source == 'widget')
913
  {
@@ -917,10 +901,13 @@ function oa_social_login_render_login_form ($source, $args = array ())
917
  //Don't show the title - this is handled insided the widget
918
  $plugin_caption = '';
919
 
920
- //Buttons size
921
- $css_theme_uri = ((array_key_exists ('widget_use_small_buttons', $widget_settings) AND !empty ($widget_settings ['widget_use_small_buttons'])) ? $css_theme_uri_small : $css_theme_uri_default);
922
 
923
- //Custom CSS
 
 
 
924
  $css_theme_uri = apply_filters ('oa_social_login_widget_css', $css_theme_uri);
925
  }
926
  //Other places
@@ -929,10 +916,13 @@ function oa_social_login_render_login_form ($source, $args = array ())
929
  //Show title if set
930
  $plugin_caption = (!empty ($settings ['plugin_caption']) ? $settings ['plugin_caption'] : '');
931
 
932
- //Buttons size
933
- $css_theme_uri = (!empty ($settings ['plugin_use_small_buttons']) ? $css_theme_uri_small : $css_theme_uri_default);
 
 
 
934
 
935
- //Custom CSS
936
  $css_theme_uri = apply_filters ('oa_social_login_default_css', $css_theme_uri);
937
  }
938
 
@@ -945,7 +935,7 @@ function oa_social_login_render_login_form ($source, $args = array ())
945
  {
946
  $callback_uri = "(window.location.href + ((window.location.href.split('?')[1] ? '&amp;': '?') + \"oa_social_login_source=" . $source . "\"))";
947
  }
948
-
949
  // Filter for callback uri
950
  $callback_uri = apply_filters ('oa_social_login_filter_callback_uri', $callback_uri, $source);
951
 
@@ -972,7 +962,7 @@ function oa_social_login_render_login_form ($source, $args = array ())
972
  //Add the Plugin
973
  $containerid = 'oneall_social_login_providers_' . mt_rand (99999, 9999999);
974
  $output [] = ' <div class="oneall_social_login_providers" id="' . $containerid . '"></div>';
975
- $output [] = ' <script type="text/javascript">';
976
 
977
  //Synchronous JavaScript: This is the default to stay compatible with existing installations.
978
  if (empty ($settings ['asynchronous_javascript']))
@@ -1064,7 +1054,7 @@ function oa_social_login_request_email ()
1064
  }
1065
  elseif (email_exists ($user_email))
1066
  {
1067
-
1068
  $message = __ ('This email is already used by another account', 'oa_social_login');
1069
  }
1070
  else
@@ -1075,17 +1065,17 @@ function oa_social_login_request_email ()
1075
  {
1076
  //Store old email
1077
  $old_user_email = $user_data->user_email;
1078
-
1079
  //Update user
1080
  wp_update_user (array ('ID' => $user_data->ID, 'user_email' => $user_email));
1081
  delete_user_meta ($user_data->ID, 'oa_social_login_request_email');
1082
-
1083
  //Set new email for hook
1084
  $user_data->user_email = $user_email;
1085
-
1086
  //Hook after having updated the email
1087
  do_action ('oa_social_login_action_on_user_enter_email', $user_id, $user_data, $old_user_email);
1088
-
1089
  //No longer needed
1090
  $display_modal = false;
1091
  }
@@ -1093,7 +1083,7 @@ function oa_social_login_request_email ()
1093
  }
1094
  }
1095
  }
1096
-
1097
  //Display modal dialog?
1098
  if ($display_modal === true)
1099
  {
@@ -1108,11 +1098,11 @@ function oa_social_login_request_email ()
1108
 
1109
  // Create Nonce
1110
  $oa_nonce = wp_create_nonce ('request_email_cancel-'.$user_id);
1111
-
1112
  // Compute logout url
1113
  $logout_url = wp_logout_url (oa_social_login_get_current_url ());
1114
- $logout_url .= ((parse_url ($logout_url, PHP_URL_QUERY) ? '&' : '?') . 'oa_action=request_email_cancel&oa_nonce='.$oa_nonce);
1115
-
1116
  //Add CSS
1117
  oa_social_login_add_site_css ();
1118
 
@@ -1182,26 +1172,26 @@ function oa_social_login_request_email_cancel ()
1182
  {
1183
  //Get the current user
1184
  $current_user = wp_get_current_user ();
1185
-
1186
  // Check Nonce
1187
  if (wp_verify_nonce ($_GET ['oa_nonce'], 'request_email_cancel-'.$current_user->ID))
1188
- {
1189
  // Check if email was requested
1190
  $oa_social_login_request_email = get_user_meta ($current_user->ID, 'oa_social_login_request_email', true);
1191
-
1192
- // Yes, email was requested
1193
  if (!empty ($oa_social_login_request_email))
1194
  {
1195
  // Make sure it was our placeholder email
1196
  if (preg_match ('/example\.com$/i', $current_user->user_email))
1197
- {
1198
  wp_delete_user ($current_user->ID);
1199
  }
1200
  else
1201
  {
1202
  delete_user_meta ($current_user->ID, 'oa_social_login_request_email');
1203
  }
1204
- }
1205
  }
1206
  }
1207
  }
131
  $result = oa_social_login_do_api_request ($api_connection_handler, $api_resource_url, array ('api_key' => $api_key, 'api_secret' => $api_secret));
132
 
133
  //Parse result
134
+ if (is_object ($result) AND property_exists ($result, 'http_code') AND property_exists ($result, 'http_data'))
135
  {
136
  //Decode
137
  $json_decoded = json_decode ($result->http_data);
142
  //Extract data
143
  $data = $json_decoded->response->result->data;
144
 
145
+
146
  //Check for plugin status
147
+ if (is_object ($data) AND property_exists ($data, 'plugin') AND $data->plugin->key == 'social_link')
148
  {
149
+ if ($data->plugin->data->status == 'success')
150
+ {
151
+ //Get the id of the linked user - Can be empty
152
+ $userid_by_token = oa_social_login_get_userid_by_token ($data->user->user_token);
153
+
154
+ //Link identity
155
+ if ($data->plugin->data->action == 'link_identity')
156
+ {
157
+ //Hook for other plugins
158
+ do_action ('oa_social_login_action_before_user_link', $user->data, $data->user->identity, $userid_by_token);
159
+
160
+ // The user already has a user_token
161
+ if (is_numeric ($userid_by_token))
162
+ {
163
+ //Already connected to this user
164
+ if ($userid_by_token == $userid)
165
+ {
166
+ $success_message = sprintf (__ ('You have successfully linked your %s account.', 'oa_social_login'), $data->user->identity->source->name);
167
+
168
+ // Linked Social Network
169
+ $linked_social_networks = array ();
170
+ if (isset ($data->user->identities) && is_array ($data->user->identities))
171
+ {
172
+ foreach ($data->user->identities AS $identity)
173
+ {
174
+ $linked_social_networks[] = $identity->provider;
175
+ }
176
+ $linked_social_networks = array_unique ($linked_social_networks);
177
+ }
178
+
179
+ // Update
180
+ update_user_meta ($userid, 'oa_social_login_identity_provider', implode ("|", $linked_social_networks));
181
+ }
182
+ //Connected to a different user
183
+ else
184
+ {
185
+ $error_message = sprintf (__ ('This %s account is already used by another user of this website.', 'oa_social_login'), $data->user->identity->source->name);
186
+ }
187
+ }
188
+ // The user does not have a user_token yet
189
+ else
190
+ {
191
+ $success_message = sprintf (__ ('You have successfully linked your %s account.', 'oa_social_login'), $data->user->identity->source->name);
192
+
193
+ //Clean Cache
194
+ wp_cache_delete ($userid, 'users');
195
+
196
+ //User Meta Data
197
+ update_user_meta ($userid, 'oa_social_login_user_token', $data->user->user_token);
198
+
199
+
200
+ // Linked Social Network
201
+ $linked_social_networks = array ();
202
+ if (isset ($data->user->identities) && is_array ($data->user->identities))
203
+ {
204
+ foreach ($data->user->identities AS $identity)
205
+ {
206
+ $linked_social_networks[] = $identity->provider;
207
+ }
208
+ $linked_social_networks = array_unique ($linked_social_networks);
209
+ }
210
+
211
+ // Update
212
+ update_user_meta ($userid, 'oa_social_login_identity_provider', implode ("|", $linked_social_networks));
213
+ }
214
+
215
+ // Thumbnail
216
+ if (!empty ($data->user->identity->thumbnailUrl))
217
+ {
218
+ update_user_meta ($userid, 'oa_social_login_user_thumbnail', $data->user->identity->thumbnailUrl);
219
+ }
220
+
221
+ // Picture
222
+ if (!empty ($data->user->identity->pictureUrl))
223
+ {
224
+ update_user_meta ($userid, 'oa_social_login_user_picture', $data->user->identity->pictureUrl);
225
+ }
226
+
227
+ //Hook for other plugins
228
+ do_action ('oa_social_login_action_after_user_link', $user->data, $data->user->identity, $userid_by_token);
229
+ }
230
+ //UnLink identity
231
+ elseif ($data->plugin->data->action == 'unlink_identity')
232
+ {
233
+ //Hook for other plugins
234
+ do_action ('oa_social_login_action_before_user_unlink', $user->data, $data->user->identity, $userid_by_token);
235
+
236
+ //The user already has a user_token
237
+ if (is_numeric ($userid_by_token))
238
+ {
239
+ //Was connected to this user
240
+ if ($userid_by_token == $userid)
241
+ {
242
+ $success_message = __ ('You have successfully unlinked your social network account.', 'oa_social_login');
243
+
244
+ //Remove avatar
245
+ delete_user_meta ($userid, 'oa_social_login_user_thumbnail');
246
+ delete_user_meta ($userid, 'oa_social_login_user_picture');
247
+
248
+ // Linked Social Network
249
+ $linked_social_networks = array ();
250
+
251
+ if (isset ($data->user->identities) && is_array ($data->user->identities))
252
+ {
253
+ foreach ($data->user->identities AS $identity)
254
+ {
255
+ $linked_social_networks[] = $identity->provider;
256
+ }
257
+ $linked_social_networks = array_unique ($linked_social_networks);
258
+ }
259
+
260
+ //No providers linked
261
+ if (count ($linked_social_networks) == 0)
262
+ {
263
+ $error_message = __ ("You might no longer be able to login to this website if you don't link at least one social network.", 'oa_social_login');
264
+ delete_user_meta ($userid, 'oa_social_login_identity_provider');
265
+ }
266
+ else
267
+ {
268
+ update_user_meta ($userid, 'oa_social_login_identity_provider', implode ("|", $linked_social_networks));
269
+ }
270
+ }
271
+ //Connected to a different user
272
+ else
273
+ {
274
+ $error_message = sprintf (__ ('This %s account is already used by another user of this website.', 'oa_social_login'), $data->user->identity->source->name);
275
+ }
276
+ }
277
+
278
+ //Hook for other plugins
279
+ do_action ('oa_social_login_action_after_user_unlink', $user->data, $data->user->identity, $userid_by_token);
280
+ }
281
+ }
282
+ else
283
+ {
284
+ if ($data->plugin->data->status == 'error' && $data->plugin->data->reason = 'identity_is_linked_to_another_user')
285
+ {
286
+ $error_message = __ ('This social network account is already used by another user.', 'oa_social_login');
287
+ }
288
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289
  }
290
  }
291
  }
292
  }
293
 
294
+ //Button Theme
295
+ $theme_id = (array_key_exists ('plugin_icon_theme', $settings) ? $settings['plugin_icon_theme'] : null);
296
+
297
+ // Grab theme URI
298
+ $css_theme_uri = oa_social_login_get_theme_css_url ($theme_id);
299
+
300
+ // Apply filters
301
  $css_theme_uri = apply_filters ('oa_social_login_link_css', $css_theme_uri);
302
 
303
  //OneAll user_token
310
  $callback_uri = oa_social_login_get_current_url ();
311
  $callback_uri .= (strlen (parse_url ($callback_uri, PHP_URL_QUERY)) == 0 ? '?' : '&') . 'oa_social_login_source=' . $source . '#oa_social_link';
312
  $callback_uri = wp_nonce_url($callback_uri, 'update-user_' . $userid);
313
+
314
  //Setup Social Container
315
  $containerid = 'oneall_social_login_providers_' . mt_rand (99999, 9999999);
316
 
318
  $social_link = array ();
319
  $social_link [] = '<div class="oneall_social_link">';
320
  $social_link [] = ' <div class="oneall_social_login_providers" id="' . $containerid . '"></div>';
321
+ $social_link [] = ' <script data-cfasync="false" type="text/javascript">';
322
 
323
  //Synchronous JavaScript: This is the default to stay compatible with existing installations.
324
  if (empty ($settings ['asynchronous_javascript']))
588
  {
589
  //Override current avatar ?
590
  $override_avatar = true;
591
+
592
  //BuddyPress (Thumbnails in the default WordPress toolbar)
593
  if (oa_social_login_has_bp_user_uploaded_avatar ($user_id) === true)
594
  {
595
  // Keep avatar is user has uploaded one
596
  $override_avatar = false;
597
+ }
598
+
599
  //Override if no avatar, from Buddypress:
600
  if ($override_avatar)
601
  {
765
 
766
  //Add our query argument
767
  $args ['callback_uri'] = add_query_arg (array ('oa_social_login_source' => 'login'), $args ['callback_uri']);
768
+
769
  //Add redirect_to
770
  if ( ! empty ($_REQUEST['redirect_to']))
771
  {
800
  {
801
  // Bugfix for Social Login being displayed twice on the WooCommerce Registration Form
802
  if ( ! did_action ('woocommerce_register_form'))
803
+ {
804
  //Additional arguments for the icon builder
805
  $args = array ();
806
+
807
  //Only on the registration page
808
  if (strpos (oa_social_login_get_current_url (), 'wp-login.php') !== false)
809
  {
810
  //This is the default WordPress registration url
811
  $args ['callback_uri'] = site_url ('wp-login.php?action=register', 'login_post');
812
+
813
  //Add our query argument
814
  $args ['callback_uri'] = add_query_arg (array ('oa_social_login_source' => 'registration'), $args ['callback_uri']);
815
+
816
  //Add redirect_to
817
  if ( ! empty ($_REQUEST['redirect_to']))
818
  {
819
  $args ['callback_uri'] = add_query_arg (array ('redirect_to' => urlencode ($_REQUEST['redirect_to'])), $args ['callback_uri']);
820
  }
821
+
822
  //Hook to customize the callback uri
823
  $args ['callback_uri'] = apply_filters ('oa_social_login_filter_wp_registration_callback_uri', $args ['callback_uri']);
824
  }
825
+
826
  echo oa_social_login_render_login_form ('registration', $args);
827
+ }
828
  }
829
  }
830
  }
892
  }
893
  }
894
 
 
 
 
 
 
 
 
895
  //Widget
896
  if ($source == 'widget')
897
  {
901
  //Don't show the title - this is handled insided the widget
902
  $plugin_caption = '';
903
 
904
+ //Button Theme
905
+ $theme_id = (array_key_exists ('widget_icon_theme', $widget_settings) ? $widget_settings['widget_icon_theme'] : null);
906
 
907
+ // Grab theme URI
908
+ $css_theme_uri = oa_social_login_get_theme_css_url ($theme_id);
909
+
910
+ // Apply filters
911
  $css_theme_uri = apply_filters ('oa_social_login_widget_css', $css_theme_uri);
912
  }
913
  //Other places
916
  //Show title if set
917
  $plugin_caption = (!empty ($settings ['plugin_caption']) ? $settings ['plugin_caption'] : '');
918
 
919
+ //Button Theme
920
+ $theme_id = (array_key_exists ('plugin_icon_theme', $settings) ? $settings['plugin_icon_theme'] : null);
921
+
922
+ // Grab theme URI
923
+ $css_theme_uri = oa_social_login_get_theme_css_url ($theme_id);
924
 
925
+ // Apply filters
926
  $css_theme_uri = apply_filters ('oa_social_login_default_css', $css_theme_uri);
927
  }
928
 
935
  {
936
  $callback_uri = "(window.location.href + ((window.location.href.split('?')[1] ? '&amp;': '?') + \"oa_social_login_source=" . $source . "\"))";
937
  }
938
+
939
  // Filter for callback uri
940
  $callback_uri = apply_filters ('oa_social_login_filter_callback_uri', $callback_uri, $source);
941
 
962
  //Add the Plugin
963
  $containerid = 'oneall_social_login_providers_' . mt_rand (99999, 9999999);
964
  $output [] = ' <div class="oneall_social_login_providers" id="' . $containerid . '"></div>';
965
+ $output [] = ' <script data-cfasync="false" type="text/javascript">';
966
 
967
  //Synchronous JavaScript: This is the default to stay compatible with existing installations.
968
  if (empty ($settings ['asynchronous_javascript']))
1054
  }
1055
  elseif (email_exists ($user_email))
1056
  {
1057
+
1058
  $message = __ ('This email is already used by another account', 'oa_social_login');
1059
  }
1060
  else
1065
  {
1066
  //Store old email
1067
  $old_user_email = $user_data->user_email;
1068
+
1069
  //Update user
1070
  wp_update_user (array ('ID' => $user_data->ID, 'user_email' => $user_email));
1071
  delete_user_meta ($user_data->ID, 'oa_social_login_request_email');
1072
+
1073
  //Set new email for hook
1074
  $user_data->user_email = $user_email;
1075
+
1076
  //Hook after having updated the email
1077
  do_action ('oa_social_login_action_on_user_enter_email', $user_id, $user_data, $old_user_email);
1078
+
1079
  //No longer needed
1080
  $display_modal = false;
1081
  }
1083
  }
1084
  }
1085
  }
1086
+
1087
  //Display modal dialog?
1088
  if ($display_modal === true)
1089
  {
1098
 
1099
  // Create Nonce
1100
  $oa_nonce = wp_create_nonce ('request_email_cancel-'.$user_id);
1101
+
1102
  // Compute logout url
1103
  $logout_url = wp_logout_url (oa_social_login_get_current_url ());
1104
+ $logout_url .= ((parse_url ($logout_url, PHP_URL_QUERY) ? '&' : '?') . 'oa_action=request_email_cancel&oa_nonce='.$oa_nonce);
1105
+
1106
  //Add CSS
1107
  oa_social_login_add_site_css ();
1108
 
1172
  {
1173
  //Get the current user
1174
  $current_user = wp_get_current_user ();
1175
+
1176
  // Check Nonce
1177
  if (wp_verify_nonce ($_GET ['oa_nonce'], 'request_email_cancel-'.$current_user->ID))
1178
+ {
1179
  // Check if email was requested
1180
  $oa_social_login_request_email = get_user_meta ($current_user->ID, 'oa_social_login_request_email', true);
1181
+
1182
+ // Yes, email was requested
1183
  if (!empty ($oa_social_login_request_email))
1184
  {
1185
  // Make sure it was our placeholder email
1186
  if (preg_match ('/example\.com$/i', $current_user->user_email))
1187
+ {
1188
  wp_delete_user ($current_user->ID);
1189
  }
1190
  else
1191
  {
1192
  delete_user_meta ($current_user->ID, 'oa_social_login_request_email');
1193
  }
1194
+ }
1195
  }
1196
  }
1197
  }
includes/widget.php CHANGED
@@ -11,7 +11,7 @@ class oa_social_login_widget extends WP_Widget
11
  public function __construct ()
12
  {
13
  parent::__construct ('oa_social_login', 'Social Login', array (
14
- 'description' => __ ('Allow your visitors to login and register with social networks like Twitter, Facebook, LinkedIn, Hyves, Google and Yahoo.', 'oa_social_login')
15
  ));
16
  }
17
 
@@ -60,9 +60,9 @@ class oa_social_login_widget extends WP_Widget
60
  //Default settings
61
  $default_settings = array (
62
  'widget_title' => __ ('Connect with', 'oa_social_login') . ':',
 
63
  'widget_content_before' => '',
64
  'widget_content_after' => '',
65
- 'widget_use_small_buttons' => '0',
66
  'widget_hide_for_logged_in_users' => '1'
67
  );
68
 
@@ -77,6 +77,14 @@ class oa_social_login_widget extends WP_Widget
77
  <label for="<?php echo $this->get_field_id ('widget_title'); ?>"><?php _e ('Title', 'oa_social_login'); ?>:</label>
78
  <input class="widefat" id="<?php echo $this->get_field_id ('widget_title'); ?>" name="<?php echo $this->get_field_name ('widget_title'); ?>" type="text" value="<?php echo $instance ['widget_title']; ?>" />
79
  </p>
 
 
 
 
 
 
 
 
80
  <p>
81
  <label for="<?php echo $this->get_field_id ('widget_content_before'); ?>"><?php _e ('Insert text/html to add before the widget', 'oa_social_login'); ?>:</label>
82
  <textarea class="widefat" id="<?php echo $this->get_field_id ('widget_content_before'); ?>" name="<?php echo $this->get_field_name ('widget_content_before'); ?>"><?php echo $instance ['widget_content_before']; ?></textarea>
@@ -87,11 +95,7 @@ class oa_social_login_widget extends WP_Widget
87
  </p>
88
  <p>
89
  <input type="checkbox" id="<?php echo $this->get_field_id ('widget_hide_for_logged_in_users', 'oa_social_login'); ?>" name="<?php echo $this->get_field_name ('widget_hide_for_logged_in_users'); ?>" type="text" value="1" <?php echo (!empty ($instance ['widget_hide_for_logged_in_users']) ? 'checked="checked"' : ''); ?> />
90
- <label for="<?php echo $this->get_field_id ('widget_hide_for_logged_in_users'); ?>"><?php _e ('Tick to hide widget for logged-in users', 'oa_social_login'); ?></label>
91
- </p>
92
- <p>
93
- <input type="checkbox" id="<?php echo $this->get_field_id ('widget_use_small_buttons', 'oa_social_login'); ?>" name="<?php echo $this->get_field_name ('widget_use_small_buttons'); ?>" type="text" value="1" <?php echo (!empty ($instance ['widget_use_small_buttons']) ? 'checked="checked"' : ''); ?> />
94
- <label for="<?php echo $this->get_field_id ('widget_use_small_buttons'); ?>"><?php _e ('Tick to use small buttons', 'oa_social_login'); ?></label>
95
  </p>
96
  <?php
97
  }
@@ -107,7 +111,7 @@ class oa_social_login_widget extends WP_Widget
107
  $instance ['widget_content_before'] = trim ($new_instance ['widget_content_before']);
108
  $instance ['widget_content_after'] = trim ($new_instance ['widget_content_after']);
109
  $instance ['widget_hide_for_logged_in_users'] = (empty ($new_instance ['widget_hide_for_logged_in_users']) ? 0 : 1);
110
- $instance ['widget_use_small_buttons'] = (empty ($new_instance ['widget_use_small_buttons']) ? 0 : 1);
111
  return $instance;
112
  }
113
  }
11
  public function __construct ()
12
  {
13
  parent::__construct ('oa_social_login', 'Social Login', array (
14
+ 'description' => __ ('Allows your users to login and register with their social network accounts.', 'oa_social_login')
15
  ));
16
  }
17
 
60
  //Default settings
61
  $default_settings = array (
62
  'widget_title' => __ ('Connect with', 'oa_social_login') . ':',
63
+ 'widget_icon_theme' => '0',
64
  'widget_content_before' => '',
65
  'widget_content_after' => '',
 
66
  'widget_hide_for_logged_in_users' => '1'
67
  );
68
 
77
  <label for="<?php echo $this->get_field_id ('widget_title'); ?>"><?php _e ('Title', 'oa_social_login'); ?>:</label>
78
  <input class="widefat" id="<?php echo $this->get_field_id ('widget_title'); ?>" name="<?php echo $this->get_field_name ('widget_title'); ?>" type="text" value="<?php echo $instance ['widget_title']; ?>" />
79
  </p>
80
+ <p>
81
+ <label for="<?php echo $this->get_field_id ('widget_icon_theme'); ?>"><?php _e ('Icon Theme', 'oa_social_login'); ?>:</label>
82
+ <select class="widefat" id="<?php echo $this->get_field_id ('widget_icon_theme'); ?>" name="<?php echo $this->get_field_name ('widget_icon_theme'); ?>">
83
+ <option value="0"<?php echo ($instance ['widget_icon_theme'] == 0 ? ' selected="selected"' : ''); ?>><?php _e ('Classic Icons', 'oa_social_login'); ?></option>
84
+ <option value="1"<?php echo ($instance ['widget_icon_theme'] == 1 ? ' selected="selected"' : ''); ?>><?php _e ('Modern Icons', 'oa_social_login'); ?></option>
85
+ <option value="2"<?php echo ($instance ['widget_icon_theme'] == 2 ? ' selected="selected"' : ''); ?>><?php _e ('Small Icons', 'oa_social_login'); ?></option>
86
+ </select>
87
+ </p>
88
  <p>
89
  <label for="<?php echo $this->get_field_id ('widget_content_before'); ?>"><?php _e ('Insert text/html to add before the widget', 'oa_social_login'); ?>:</label>
90
  <textarea class="widefat" id="<?php echo $this->get_field_id ('widget_content_before'); ?>" name="<?php echo $this->get_field_name ('widget_content_before'); ?>"><?php echo $instance ['widget_content_before']; ?></textarea>
95
  </p>
96
  <p>
97
  <input type="checkbox" id="<?php echo $this->get_field_id ('widget_hide_for_logged_in_users', 'oa_social_login'); ?>" name="<?php echo $this->get_field_name ('widget_hide_for_logged_in_users'); ?>" type="text" value="1" <?php echo (!empty ($instance ['widget_hide_for_logged_in_users']) ? 'checked="checked"' : ''); ?> />
98
+ <label for="<?php echo $this->get_field_id ('widget_hide_for_logged_in_users'); ?>"><?php _e ('Tick to hide the widget for logged-in users', 'oa_social_login'); ?></label>
 
 
 
 
99
  </p>
100
  <?php
101
  }
111
  $instance ['widget_content_before'] = trim ($new_instance ['widget_content_before']);
112
  $instance ['widget_content_after'] = trim ($new_instance ['widget_content_after']);
113
  $instance ['widget_hide_for_logged_in_users'] = (empty ($new_instance ['widget_hide_for_logged_in_users']) ? 0 : 1);
114
+ $instance ['widget_icon_theme'] = $new_instance ['widget_icon_theme'];
115
  return $instance;
116
  }
117
  }
oa-social-login.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
3
  Plugin Name: Social Login
4
  Plugin URI: http://www.oneall.com/
5
- Description: Allow your visitors to <strong>comment, login and register with 25+ social networks</strong> like Twitter, Facebook, LinkedIn, Instagram, Вконтакте, Google or Yahoo.
6
- Version: 5.2
7
  Author: Claude Schlesser
8
  Author URI: http://www.oneall.com/
9
  License: GPL2
@@ -11,7 +11,7 @@ License: GPL2
11
 
12
  define ('OA_SOCIAL_LOGIN_PLUGIN_URL', plugins_url () . '/' . basename (dirname (__FILE__)));
13
  define ('OA_SOCIAL_LOGIN_BASE_PATH', dirname (plugin_basename (__FILE__)));
14
- define ('OA_SOCIAL_LOGIN_VERSION', '5.2');
15
 
16
  /**
17
  * Check technical requirements before activating the plugin (Wordpress 3.0 or newer required)
2
  /*
3
  Plugin Name: Social Login
4
  Plugin URI: http://www.oneall.com/
5
+ Description: Allow your visitors to <strong>comment, login and register with 30+ social networks</strong> like Twitter, Facebook, LinkedIn, Instagram, Вконтакте, Google or Yahoo.
6
+ Version: 5.3
7
  Author: Claude Schlesser
8
  Author URI: http://www.oneall.com/
9
  License: GPL2
11
 
12
  define ('OA_SOCIAL_LOGIN_PLUGIN_URL', plugins_url () . '/' . basename (dirname (__FILE__)));
13
  define ('OA_SOCIAL_LOGIN_BASE_PATH', dirname (plugin_basename (__FILE__)));
14
+ define ('OA_SOCIAL_LOGIN_VERSION', '5.3');
15
 
16
  /**
17
  * Check technical requirements before activating the plugin (Wordpress 3.0 or newer required)
readme.txt CHANGED
@@ -1,73 +1,73 @@
1
  === Social Login ===
2
- Contributors: ClaudeSchlesser, OneAll.com
3
- Tags: social login, social connect, facebook, linkedin, livejournal, google, yahoo, twitter, openid, pinterest, paypal, google, instagram, widget, plugin, social network login, comments
4
  Requires at least: 3.0
5
- Tested up to: 4.7.2
6
- Stable tag: 5.2
7
 
8
- Allow your visitors to comment and login with social networks like Twitter, Facebook, Paypal, LinkedIn, Instagram, OpenID, VKontakte, Google, Pinterest
9
 
10
  == Description ==
11
 
12
- Social Login is a professionally developed and free Wordpress (BuddyPress compatible) plugin that allows your visitors to comment,
13
- login and register with 30+ Social Networks like for example Facebook, Twitter, Google, LinkedIn, PayPal, LiveJournal, Instagram, Вконтакте and Yahoo.<br /><br />
14
- <strong>Make your blog social!</strong><br />
15
-
16
- <strong>Choose where to add the Social Login Plugin:</strong>
17
- <ul>
18
- <li>On the comment formular</li>
19
- <li>On the login page</li>
20
- <li>On the registration page</li>
21
- <li>In your sidebar</li>
22
- <li>With a shortcode</li>
23
- </ul>
24
-
25
- <strong>Optionally add the Social Login widget:</strong>
26
- <ul>
27
- <li>A login widget that you can easily attach to your sidebar is provided</li>
28
- </ul>
29
-
30
- <strong>30+ Social Networks Availabe!</strong>
31
- <ul>
32
- <li>Amazon</li>
33
- <li>Battle.net</li>
34
- <li>Blogger</li>
35
- <li>Disqus</li>
36
- <li>Dribbble</li>
37
- <li>Facebook</li>
38
- <li>Foursquare</li>
39
- <li>Github.com</li>
40
- <li>Google</li>
41
- <li>Instagram</li>
42
- <li>LinkedIn</li>
43
- <li>LiveJournal</li>
44
- <li>Mail.ru</li>
45
- <li>Odnoklassniki</li>
46
- <li>OpenID</li>
47
- <li>PayPal</li>
48
- <li>Pinterest</li>
49
- <li>PixelPin</li>
50
- <li>Reddit</li>
51
- <li>Skyrock.com</li>
52
- <li>StackExchange</li>
53
- <li>Steam</li>
54
- <li>Twitch.tv</li>
55
- <li>Twitter</li>
56
- <li>Vimeo</li>
57
- <li>VKontakte</li>
58
- <li>Windows Live</li>
59
- <li>WordPress.com</li>
60
- <li>Yahoo</li>
61
- <li>YouTube</li>
62
- </ul>
63
-
64
-
65
- <strong>Increase your wordpress/buddypress user engagement in a few simple steps with the Social Login Plugin!</strong>
66
- Our users love it! Check out the <a href="http://wordpress.org/extend/plugins/oa-social-login/other_notes/">testimonials</a>!<br />
67
-
68
- Social Login is maintained by <a href="http://www.oneall.com">OneAll</a>, a technology company offering a set of web-delivered
69
- tools and services for establishing and optimizing a site's connection with social networks and identity providers such as Facebook, Twitter,
70
- Google, Yahoo!, LinkedIn, Paypal, Instagram amongst others.
71
 
72
  == Installation ==
73
 
@@ -88,17 +88,17 @@ In order to enable the plugin you must connect with the OneAll API and create a
88
  = Do I have to add template tags to my theme? =
89
 
90
  You should not have to change your templates.
91
- The Social Login seamlessly integrates into your blog by using predefined hooks.
92
 
93
  = Can Social Login be embedded through a shortcode? =
94
 
95
- The Social Login shortcode `[oa_social_login]` can be used in any page or post within your blog.
96
  The shortcode will automatically be replaced by the icons of the social networks that you have
97
  enabled in the Social Login settings in your WordPress administration area.
98
 
99
  = I have a custom template and the plugin is not displayed correctly =
100
 
101
- The plugin uses predefined hooks. If your theme does not support these hooks,
102
  you can add the Social Login form manually to your theme by inserting the following code
103
  in your template (at the location where it should be displayed, i.e. above the comments).
104
 
@@ -115,7 +115,7 @@ usernames, please consider installing the following plugin to fix the problem:
115
 
116
  = Do I have to change my Rewrite Settings? =
117
 
118
- The plugins does not rely on mod_rewrite and does not need any additional rules.
119
  It should work out of the box.
120
 
121
 
@@ -137,6 +137,13 @@ http://docs.oneall.com/plugins/guide/social-login-wordpress/
137
 
138
  == Changelog ==
139
 
 
 
 
 
 
 
 
140
  = 5.2 =
141
  * Buddypress avatar bugfix
142
  * Do not create users without email addresses when plugin set to request emails
1
  === Social Login ===
2
+ Contributors: OneAll.com, ClaudeSchlesser
3
+ Tags: social login, social networks, login, register, comment, social network login, buddypress, facebook, google, openid, twitter, linkedin, instagram, pinterest, instagram, vkontakte, github, steam, dribbble, twitch.tv
4
  Requires at least: 3.0
5
+ Tested up to: 4.8
6
+ Stable tag: 5.3
7
 
8
+ Social Login allows your users to comment, register and login with 30+ Social Networks like Twitter, Facebook, Paypal, LinkedIn, Instagram, OpenID, VKontakte, Google, Pinterest ...
9
 
10
  == Description ==
11
 
12
+ = Social Login Plugin =
13
+
14
+ Social Login is a **professionally developed** and free Wordpress plugin that allows your visitors to **comment, login and register with 30+ Social Networks** like for example Facebook, Twitter, Google, LinkedIn, PayPal, LiveJournal, Instagram, Вконтакте or Yahoo amongst other.
15
+
16
+ **Seamlessly Integrates**<br />
17
+ Social Login is fully customizable and seamlessly integrates with your existing login/registration system so that your users don't have to start from scratch. Existing existing accounts can add/remove their social network accounts in their WordPress profile settings and then also use the linked social networks to login.
18
+
19
+ **Eliminates Spam and Bot Registrations**<br />
20
+ Get rid of long and complicated forms, improve your data quality and instantly eliminate spam and bot registrations. Social Login increases registration rates by up to 50% and provides permission-based access to users' social network profile data, allowing you to start delivering a personalized experience.
21
+
22
+ **Robust and Maintenance Free**<br />
23
+ Do not take the risk of loosing any users or customers due to outdated social network integrations. Unlike other Social Login providers we monitor the APIs and technologies of the different social networks and update our service as soon as changes arise.
24
+
25
+ By using OneAll you can be sure that your social media integration will always run smoothly and with the most up-to-date calls.
26
+
27
+ **Fully Customizable**<br />
28
+ You can easily configure which social accounts to enable/disable for login and on which areas of the website social login should be displayed:
29
+ * On the comment formular
30
+ * On the login page
31
+ * On the registration page
32
+ * In your sidebar
33
+ * With a shortcode
34
+
35
+ **30+ Social Networks**
36
+ * Amazon
37
+ * Battle.net
38
+ * Blogger
39
+ * Disqus
40
+ * Dribbble
41
+ * Facebook
42
+ * Foursquare
43
+ * Github.com
44
+ * Google
45
+ * Instagram
46
+ * LinkedIn
47
+ * LiveJournal
48
+ * Mail.ru
49
+ * Odnoklassniki
50
+ * OpenID
51
+ * PayPal
52
+ * Pinterest
53
+ * PixelPin
54
+ * Reddit
55
+ * Skyrock.com
56
+ * StackExchange
57
+ * Steam
58
+ * Twitch.tv
59
+ * Twitter
60
+ * Vimeo
61
+ * VKontakte
62
+ * Windows Live
63
+ * WordPress.com
64
+ * Yahoo
65
+ * YouTube
66
+
67
+ **Professionally Developed and Maintained**
68
+ Social Login is maintained by [OneAll](http://www.oneall.com), a technology company offering a set of web-delivered tools to simplify the integration of 30+ social networks into business and personal websites and apps.
69
+
70
+ The OneAll API unifies 30+ Social Networks and consolidates the most powerful social network features in a single solution. You can work with multiple social networks at once and you will obtain a standardized field structure for data received from any of the social networks. Save time and development resources and focus on your core business.
71
 
72
  == Installation ==
73
 
88
  = Do I have to add template tags to my theme? =
89
 
90
  You should not have to change your templates.
91
+ The Social Login plugin seamlessly integrates into your blog by using standard WordPress hooks.
92
 
93
  = Can Social Login be embedded through a shortcode? =
94
 
95
+ The Social Login shortcode `[oa_social_login]` can be used in any page or post within your WordPress blog.
96
  The shortcode will automatically be replaced by the icons of the social networks that you have
97
  enabled in the Social Login settings in your WordPress administration area.
98
 
99
  = I have a custom template and the plugin is not displayed correctly =
100
 
101
+ Social Login uses standard WordPress hooks. If your theme does not support these hooks,
102
  you can add the Social Login form manually to your theme by inserting the following code
103
  in your template (at the location where it should be displayed, i.e. above the comments).
104
 
115
 
116
  = Do I have to change my Rewrite Settings? =
117
 
118
+ Social Login does not rely on mod_rewrite and does not need any additional rules.
119
  It should work out of the box.
120
 
121
 
137
 
138
  == Changelog ==
139
 
140
+ = 5.3 =
141
+ * New icon set added
142
+ * Social Login interface improved
143
+ * Social Network avatar removed when unlinking account
144
+ * Social Link reviewed and improved
145
+ * Undefined index fixed
146
+
147
  = 5.2 =
148
  * Buddypress avatar bugfix
149
  * Do not create users without email addresses when plugin set to request emails