Social Login - Version 5.4.1

Version Description

  • User website URL truncated (WordPress restriction)
Download this release

Release Info

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

Code changes from version 5.4.0 to 5.4.1

Files changed (3) hide show
  1. includes/communication.php +47 -15
  2. oa-social-login.php +2 -2
  3. readme.txt +4 -1
includes/communication.php CHANGED
@@ -97,18 +97,43 @@ function oa_social_login_callback ()
97
  }
98
  }
99
 
100
- //User Website
 
 
 
 
 
 
101
  if (!empty ($identity->profileUrl))
102
  {
103
- $user_website = $identity->profileUrl;
104
  }
105
- elseif (!empty ($identity->urls [0]->value))
 
 
106
  {
107
- $user_website = $identity->urls [0]->value;
 
 
 
 
 
 
108
  }
109
- else
 
 
110
  {
111
- $user_website = '';
 
 
 
 
 
 
 
 
 
112
  }
113
 
114
  //Preferred Username
@@ -210,23 +235,30 @@ function oa_social_login_callback ()
210
  $placeholder_email_used = true;
211
  }
212
 
213
- //Setup the user's password
214
- $user_password = wp_generate_password ();
215
- $user_password = apply_filters ('oa_social_login_filter_new_user_password', $user_password);
216
 
217
- //Setup the user's role
218
  $user_role = get_option ('default_role');
219
  $user_role = apply_filters ('oa_social_login_filter_new_user_role', $user_role);
220
 
 
 
 
221
  //Build user data
222
  $user_fields = array (
223
- 'user_login' => $user_login,
224
- 'display_name' => (!empty ($user_full_name) ? $user_full_name : $user_login),
225
- 'user_email' => $user_email,
 
 
 
 
 
 
226
  'first_name' => $user_first_name,
227
  'last_name' => $user_last_name,
228
- 'user_url' => $user_website,
229
- 'user_pass' => $user_password,
230
  'role' => $user_role
231
  );
232
 
97
  }
98
  }
99
 
100
+ // Website to be used.
101
+ $user_website = '';
102
+
103
+ // List of websites.
104
+ $user_websites = array ();
105
+
106
+ // Profile.
107
  if (!empty ($identity->profileUrl))
108
  {
109
+ $user_websites[] = trim ($identity->profileUrl);
110
  }
111
+
112
+ // Website URLs.
113
+ if (isset ($identity->urls) && is_array ($identity->urls))
114
  {
115
+ foreach ($identity->urls AS $identity_url)
116
+ {
117
+ if ( ! empty ($identity_url->value))
118
+ {
119
+ $user_websites[] = trim ($identity_url->value);
120
+ }
121
+ }
122
  }
123
+
124
+ // Do we have any websites?
125
+ if (count ($user_websites) > 0)
126
  {
127
+ $user_websites = array_unique ($user_websites);
128
+
129
+ // Compute a website to be used.
130
+ while (empty ($user_website) && list($key, $value) = each($user_websites))
131
+ {
132
+ if ( ! empty ($value) && strlen ($value) < 100)
133
+ {
134
+ $user_website = $value;
135
+ }
136
+ }
137
  }
138
 
139
  //Preferred Username
235
  $placeholder_email_used = true;
236
  }
237
 
238
+ // Setup the user's password.
239
+ $user_pass = wp_generate_password ();
240
+ $user_pass = apply_filters ('oa_social_login_filter_new_user_password', $user_pass);
241
 
242
+ // Setup the user's role.
243
  $user_role = get_option ('default_role');
244
  $user_role = apply_filters ('oa_social_login_filter_new_user_role', $user_role);
245
 
246
+ // Setup the name to display.
247
+ $user_display_name = (!empty ($user_full_name) ? $user_full_name : $user_login);
248
+
249
  //Build user data
250
  $user_fields = array (
251
+
252
+ // User Table.
253
+ 'user_login' => substr ($user_login, 0, 60),
254
+ 'user_pass' => $user_pass,
255
+ 'display_name' => substr ($user_display_name, 0, 250),
256
+ 'user_email' => substr ($user_email, 0, 100),
257
+ 'user_url' => substr ($user_website, 0, 100),
258
+
259
+ // Meta Table.
260
  'first_name' => $user_first_name,
261
  'last_name' => $user_last_name,
 
 
262
  'role' => $user_role
263
  );
264
 
oa-social-login.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Social Login
4
  Plugin URI: http://www.oneall.com/
5
  Description: Social Login allows your users to <strong>comment, login and register with 35+ social networks</strong> like Twitter, Facebook, LinkedIn, Instagram, Вконтакте, Google or Yahoo.
6
- Version: 5.4.0
7
  Author: OneAll - Social Network Integration <support@oneall.com>
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.4.0');
15
 
16
  /**
17
  * Check technical requirements before activating the plugin (Wordpress 3.0 or newer required)
3
  Plugin Name: Social Login
4
  Plugin URI: http://www.oneall.com/
5
  Description: Social Login allows your users to <strong>comment, login and register with 35+ social networks</strong> like Twitter, Facebook, LinkedIn, Instagram, Вконтакте, Google or Yahoo.
6
+ Version: 5.4.1
7
  Author: OneAll - Social Network Integration <support@oneall.com>
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.4.1');
15
 
16
  /**
17
  * Check technical requirements before activating the plugin (Wordpress 3.0 or newer required)
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: OneAll.com, ClaudeSchlesser
3
  Tags: social login, social network login, social connect, facebook login, twitter login, linkedin login
4
  Requires at least: 3.0
5
  Tested up to: 4.9.6
6
- Stable tag: 5.4.0
7
  License: GPLv2 or later
8
 
9
  Social Login is fully GDPR compliant and allows your users to login, register and comment with 35+ Social Networks.
@@ -148,6 +148,9 @@ http://docs.oneall.com/plugins/guide/social-login-wordpress/
148
 
149
  == Changelog ==
150
 
 
 
 
151
  = 5.4.0 =
152
  * Social Network "Discord" added
153
  * Social Network "Line" added
3
  Tags: social login, social network login, social connect, facebook login, twitter login, linkedin login
4
  Requires at least: 3.0
5
  Tested up to: 4.9.6
6
+ Stable tag: 5.4.1
7
  License: GPLv2 or later
8
 
9
  Social Login is fully GDPR compliant and allows your users to login, register and comment with 35+ Social Networks.
148
 
149
  == Changelog ==
150
 
151
+ = 5.4.1 =
152
+ * User website URL truncated (WordPress restriction)
153
+
154
  = 5.4.0 =
155
  * Social Network "Discord" added
156
  * Social Network "Line" added