Social Login - Version 2.0

Version Description

  • WC3 Compliant callback uri
  • HTTP/HTTPS Check for CSS files
  • Shortcode handler fixed
  • Wordpress Cookie now set for 14 days
  • Wordpress display_name is now populated
  • Redirection improved
  • Now Buddypress compatible
  • Link to settings page after installation
  • Caching for socialize library improved
  • Small buttons added as option
  • Localization added
  • German translation
Download this release

Release Info

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

Code changes from version 1.6.1 to 2.0

assets/js/admin.js CHANGED
@@ -20,27 +20,27 @@ jQuery(document).ready(function($) {
20
 
21
  if (response == 'error_not_all_fields_filled_out'){
22
  success = false;
23
- message = 'Please fill out each of the fields above'
24
  }
25
  else if (response == 'error_subdomain_wrong'){
26
  success = false;
27
- message = 'The subdomain does not exist. Have you filled it out correctly?'
28
  }
29
  else if (response == 'error_subdomain_wrong_syntax'){
30
  success = false;
31
- message = 'The subdomain has a wrong syntax!'
32
  }
33
  else if (response == 'error_communication'){
34
  success = false;
35
- message = 'Could not contact API. Are outoing CURL requests allowed?'
36
  }
37
  else if (response == 'error_authentication_credentials_wrong'){
38
  success = false;
39
- message = 'The API credentials are wrong';
40
  }
41
  else {
42
  success = true;
43
- message = 'The settings are correct - do not forget to save your changes!';
44
  }
45
 
46
  jQuery('#oa_social_login_api_test_result').html(message);
20
 
21
  if (response == 'error_not_all_fields_filled_out'){
22
  success = false;
23
+ message = objectL10n.oa_admin_js_1;
24
  }
25
  else if (response == 'error_subdomain_wrong'){
26
  success = false;
27
+ message = objectL10n.oa_admin_js_2;
28
  }
29
  else if (response == 'error_subdomain_wrong_syntax'){
30
  success = false;
31
+ message = objectL10n.oa_admin_js_3;
32
  }
33
  else if (response == 'error_communication'){
34
  success = false;
35
+ message = objectL10n.oa_admin_js_4;
36
  }
37
  else if (response == 'error_authentication_credentials_wrong'){
38
  success = false;
39
+ message = objectL10n.oa_admin_js_5;
40
  }
41
  else {
42
  success = true;
43
+ message = objectL10n.oa_admin_js_6;
44
  }
45
 
46
  jQuery('#oa_social_login_api_test_result').html(message);
includes/admin.php CHANGED
@@ -21,7 +21,7 @@ function oa_social_login_admin_message ()
21
  {
22
  if (get_option ('oa_social_login_activation_message') !== '1')
23
  {
24
- echo '<div class="updated"><p><strong>Thank you for using the Social Login Plugin!</strong> Please go to the <strong>Settings\Social Login</strong> page to setup the plugin.</p></div>';
25
  update_option ('oa_social_login_activation_message', '1');
26
  }
27
  }
@@ -130,6 +130,15 @@ function oa_social_login_admin_js ($hook)
130
  wp_enqueue_script ('oa_social_login_admin_js');
131
  wp_enqueue_script ('jquery');
132
 
 
 
 
 
 
 
 
 
 
133
  $oa_social_login_ajax_nonce = wp_create_nonce ('oa_social_login_ajax_nonce');
134
  wp_localize_script ('oa_social_login_admin_js', 'oa_social_login_ajax_nonce', array (
135
  'value' => $oa_social_login_ajax_nonce
@@ -186,6 +195,7 @@ function oa_social_login_settings_validate ($settings)
186
  'plugin_caption',
187
  'plugin_link_verified_accounts',
188
  'plugin_show_avatars_in_comments',
 
189
  'plugin_display_in_login_form',
190
  'plugin_login_form_redirect',
191
  'plugin_login_form_redirect_custom_url',
@@ -227,12 +237,20 @@ function oa_social_login_settings_validate ($settings)
227
  }
228
  }
229
 
230
-
231
  //Flag settings
 
232
  $sanitzed_settings ['plugin_show_avatars_in_comments'] == ((isset ($sanitzed_settings ['plugin_show_avatars_in_comments']) AND $sanitzed_settings ['plugin_show_avatars_in_comments'] == '1') ? 1 : 0);
233
  $sanitzed_settings ['plugin_link_verified_accounts'] == ((isset ($sanitzed_settings ['plugin_link_verified_accounts']) AND $sanitzed_settings ['plugin_link_verified_accounts'] == '0') ? 0 : 1);
234
- $sanitzed_settings ['plugin_login_form_redirect'] = ((isset ($sanitzed_settings ['plugin_login_form_redirect']) AND in_array ($sanitzed_settings ['plugin_login_form_redirect'], array ('dashboard', 'homepage', 'custom'))) ? $sanitzed_settings ['plugin_login_form_redirect'] : 'homepage');
235
- $sanitzed_settings ['plugin_registration_form_redirect'] = ((isset ($sanitzed_settings ['plugin_registration_form_redirect']) AND in_array ($sanitzed_settings ['plugin_registration_form_redirect'], array ('dashboard', 'homepage', 'custom'))) ? $sanitzed_settings ['plugin_registration_form_redirect'] : 'dashboard');
 
 
 
 
 
 
 
 
236
  $sanitzed_settings ['plugin_display_in_login_form'] == ((isset ($sanitzed_settings ['plugin_display_in_login_form']) AND $sanitzed_settings ['plugin_display_in_login_form'] == '0') ? 0 : 1);
237
 
238
  //Check Login Redirection Settings
@@ -274,76 +292,78 @@ function oa_display_social_login_settings ()
274
  {
275
  //Import providers
276
  GLOBAL $oa_social_login_providers;
277
- ?>
278
  <div class="wrap">
279
  <h2><?php _e ('Social Login Settings', 'oa_social_login'); ?></h2>
280
  <?php
281
  if (get_option ('oa_social_login_api_settings_verified') !== '1')
282
  {
283
- ?>
284
  <div class="oa_container oa_container_welcome">
285
  <h3>
286
- Make your blog social!
287
  </h3>
288
  <div class="oa_container_body">
289
  <p>
290
- Allow your visitors to comment, login and register with social networks like Twitter, Facebook, LinkedIn, Hyves, Вконтакте, Google or Yahoo.
291
- <strong>Draw a larger audience and increase user engagement in a few simple steps.</strong>
292
  </p>
293
  <p>
294
- To be able to use this plugin you first of all need to create a free account at <a href="https://app.oneall.com/signup/" target="_blank">http://www.oneall.com</a>
295
- and setup a Site. After having created your account and setup your Site, please enter the Site settings in the form below.
 
 
296
  </p>
297
- <h3>You are in good company, 10000+ websites already trust us!</h3>
298
  <p>
299
- <a class="button-secondary" href="https://app.oneall.com/signup/" target="_blank"><strong>Create your free account now!</strong></a>
300
  </p>
301
  </div>
302
  </div>
303
  <?php
304
- }
305
- else
306
- {
307
  ?>
308
  <div class="oa_container oa_container_welcome">
309
  <h3>
310
- <?php _e ('Your API Account is setup correctly'); ?>
311
  </h3>
312
  <div class="oa_container_body">
313
  <p>
314
- <a href="https://app.oneall.com/signin/" target="_blank">Login to your account</a> to manage your providers and access your <a href="https://app.oneall.com/insights/" target="_blank">Social Insights</a>.
315
- Determine which social networks are popular amongst your users and tailor your registration experience to increase your users' engagement.
316
  </p>
317
  <p>
318
- <a class="button-secondary" href="https://app.oneall.com/signin/" target="_blank"><strong>Signin to your account</strong></a>
319
  </p>
320
  </div>
321
  </div>
322
  <?php
323
- }
324
- ?>
325
  <div class="oa_container oa_container_links">
326
  <h3>
327
- <?php _e ('Help, Updates &amp; Documentation'); ?>
328
  </h3>
329
  <ul>
330
- <li><a target="_blank" href="http://www.twitter.com/oneall">Follow us on Twitter</a> to stay informed about updates;</li>
331
- <li><a target="_blank" href="http://docs.oneall.com/plugins/guide/social-login-wordpress/">Read the online documentation</a> for more information about this plugin;</li>
332
- <li><a target="_blank" href="http://www.oneall.com/company/contact-us/">Contact us</a> if you have feedback or need assistance.</li>
333
  </ul>
334
  </div>
335
  <form method="post" action="options.php">
336
  <?php
337
  settings_fields ('oa_social_login_settings_group');
338
  $settings = get_option ('oa_social_login_settings');
339
- ?>
340
  <table class="form-table oa_form_table">
341
  <tr>
342
  <th class="head">
343
  <?php _e ('API Settings', 'oa_social_login'); ?>
344
  </th>
345
  <th class="head">
346
- <a href="https://app.oneall.com/applications/" target="_blank">Click here to create and view your API Credentials</a>
347
  </th>
348
  </tr>
349
  <tr>
@@ -382,7 +402,7 @@ function oa_display_social_login_settings ()
382
  <table class="form-table oa_form_table">
383
  <tr>
384
  <th class="head" colspan="2">
385
- <?php _e ('Enable the social networks/identity providers of your choice');?>
386
  </th>
387
  </tr>
388
  <?php
@@ -392,15 +412,20 @@ function oa_display_social_login_settings ()
392
  ?>
393
  <tr class="<?php echo ((($i++) % 2) == 0) ? 'row_even' : 'row_odd' ?> row_provider">
394
  <td class="row">
395
- <label for="oneall_social_login_provider_<?php echo $key; ?>"><span class="oa_provider oa_provider_<?php echo $key; ?>" title="<?php echo htmlspecialchars ($provider_data['name']); ?>"><?php echo htmlspecialchars ($provider_data['name']); ?></span></label>
396
  <input type="checkbox" id="oneall_social_login_provider_<?php echo $key; ?>" name="oa_social_login_settings[providers][<?php echo $key; ?>]" value="1" <?php checked ('1', $settings ['providers'] [$key]); ?> />
397
- <label for="oneall_social_login_provider_<?php echo $key; ?>"><?php echo htmlspecialchars ($provider_data['name']); ?></label>
398
- <?php echo (isset($provider_data['note']) ? ('&nbsp;('.$provider_data['note'].')') : ''); ?>
 
 
 
 
 
399
  </td>
400
  </tr>
401
  <?php
402
- }
403
- ?>
404
  </table>
405
  <table class="form-table oa_form_table oa_form_table_settings">
406
  <tr>
@@ -410,12 +435,12 @@ function oa_display_social_login_settings ()
410
  </tr>
411
  <tr class="row_odd">
412
  <td>
413
- <?php _e ('Enter the caption to be displayed above the social network login buttons:', 'oa_social_login'); ?>
414
  </td>
415
  </tr>
416
  <tr class="row_even">
417
  <td>
418
- <input type="text" name="oa_social_login_settings[plugin_caption]" size="118" value="<?php echo (isset ($settings ['plugin_caption']) ? htmlspecialchars ($settings ['plugin_caption']) : _e ('Connect with:')); ?>" />
419
  </td>
420
  </tr>
421
  <tr class="row_odd">
@@ -428,8 +453,22 @@ function oa_display_social_login_settings ()
428
  <?php
429
  $plugin_show_avatars_in_comments = (isset ($settings ['plugin_show_avatars_in_comments']) AND $settings ['plugin_show_avatars_in_comments'] == '1');
430
  ?>
431
- <input type="radio" name="oa_social_login_settings[plugin_show_avatars_in_comments]" value="1" <?php echo ($plugin_show_avatars_in_comments ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, show user avatars from social networks if available'); ?><br />
432
- <input type="radio" name="oa_social_login_settings[plugin_show_avatars_in_comments]" value="0" <?php echo (!$plugin_show_avatars_in_comments ? 'checked="checked"' : ''); ?> /> <?php _e ('No, display the default avatars'); ?> <strong>(<?php _e ('Default') ?>)</strong>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
433
  </td>
434
  </tr>
435
  </table>
@@ -449,8 +488,8 @@ function oa_display_social_login_settings ()
449
  <?php
450
  $plugin_display_in_login_form = (!isset ($settings ['plugin_display_in_login_form']) OR $settings ['plugin_display_in_login_form'] == '1');
451
  ?>
452
- <input type="radio" name="oa_social_login_settings[plugin_display_in_login_form]" value="1" <?php echo ($plugin_display_in_login_form ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, display the social network buttons below the login form'); ?> <strong>(<?php _e ('Default') ?>)</strong><br />
453
- <input type="radio" name="oa_social_login_settings[plugin_display_in_login_form]" value="0" <?php echo (!$plugin_display_in_login_form ? 'checked="checked"' : ''); ?> /> <?php _e ('No, disable social network buttons in the login form'); ?>
454
  </td>
455
  </tr>
456
  <tr class="row_odd">
@@ -467,9 +506,9 @@ function oa_display_social_login_settings ()
467
  'custom'
468
  ))) ? 'homepage' : $settings ['plugin_login_form_redirect']);
469
  ?>
470
- <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'); ?> <strong>(<?php _e ('Default') ?>)</strong><br />
471
- <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'); ?><br />
472
- <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:'); ?><br />
473
  <input type="text" name="oa_social_login_settings[plugin_login_form_redirect_custom_url]" size="118" value="<?php echo (isset ($settings ['plugin_login_form_redirect_custom_url']) ? htmlspecialchars ($settings ['plugin_login_form_redirect_custom_url']) : ''); ?>" />
474
  </td>
475
  </tr>
@@ -490,8 +529,8 @@ function oa_display_social_login_settings ()
490
  <?php
491
  $plugin_link_verified_accounts = (!isset ($settings ['plugin_link_verified_accounts']) OR $settings ['plugin_link_verified_accounts'] == '1');
492
  ?>
493
- <input type="radio" name="oa_social_login_settings[plugin_link_verified_accounts]" value="1" <?php echo ($plugin_link_verified_accounts ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, try to link verified social network profiles to existing blog accounts'); ?> <strong>(<?php _e ('Default') ?>)</strong><br />
494
- <input type="radio" name="oa_social_login_settings[plugin_link_verified_accounts]" value="0" <?php echo (!$plugin_link_verified_accounts ? 'checked="checked"' : ''); ?> /> <?php _e ('No, disable account linking'); ?>
495
  </td>
496
  </tr>
497
  <tr class="row_odd">
@@ -504,8 +543,8 @@ function oa_display_social_login_settings ()
504
  <?php
505
  $plugin_display_in_registration_form = (!isset ($settings ['plugin_display_in_registration_form']) OR $settings ['plugin_display_in_registration_form'] == '1');
506
  ?>
507
- <input type="radio" name="oa_social_login_settings[plugin_display_in_registration_form]" value="1" <?php echo ($plugin_display_in_registration_form ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, display the social network buttons below the registration form'); ?> <strong>(<?php _e ('Default') ?>)</strong><br />
508
- <input type="radio" name="oa_social_login_settings[plugin_display_in_registration_form]" value="0" <?php echo (!$plugin_display_in_registration_form ? 'checked="checked"' : ''); ?> /> <?php _e ('No, disable social network buttons in the registration form'); ?>
509
  </td>
510
  </tr>
511
 
@@ -523,17 +562,17 @@ function oa_display_social_login_settings ()
523
  'custom'
524
  ))) ? 'dashboard' : $settings ['plugin_registration_form_redirect']);
525
  ?>
526
- <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'); ?><br />
527
- <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'); ?> <strong>(<?php _e ('Default') ?>)</strong><br />
528
- <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:'); ?><br />
529
  <input type="text" name="oa_social_login_settings[plugin_registration_form_redirect_custom_url]" size="118" value="<?php echo (isset ($settings ['plugin_registration_form_redirect_custom_url']) ? htmlspecialchars ($settings ['plugin_registration_form_redirect_custom_url']) : ''); ?>" />
530
  </td>
531
  </tr>
532
  </table>
533
  <p class="submit">
534
- <input type="submit" class="button-primary" value="<?php _e ('Save Changes') ?>" />
535
  </p>
536
  </form>
537
  </div>
538
  <?php
539
- }
21
  {
22
  if (get_option ('oa_social_login_activation_message') !== '1')
23
  {
24
+ echo '<div class="updated"><p><strong>'.__('Thank you for using the Social Login Plugin!', 'oa_social_login').'</strong> '.sprintf(__('Please go to the <strong><a href="%s">Settings\Social Login</a></strong> page to setup the plugin.', 'oa_social_login'), 'options-general.php?page=oa_social_login').'</p></div>';
25
  update_option ('oa_social_login_activation_message', '1');
26
  }
27
  }
130
  wp_enqueue_script ('oa_social_login_admin_js');
131
  wp_enqueue_script ('jquery');
132
 
133
+ wp_localize_script ('oa_social_login_admin_js', 'objectL10n', array (
134
+ 'oa_admin_js_1' => __ ('Please fill out each of the fields above.', 'oa_social_login'),
135
+ 'oa_admin_js_2' => __ ('The subdomain does not exist. Have you filled it out correctly?', 'oa_social_login'),
136
+ 'oa_admin_js_3' => __ ('The subdomain has a wrong syntax!', 'oa_social_login'),
137
+ 'oa_admin_js_4' => __ ('Could not contact API. Are outoing CURL requests allowed?', 'oa_social_login'),
138
+ 'oa_admin_js_5' => __ ('The API credentials are wrong', 'oa_social_login'),
139
+ 'oa_admin_js_6' => __ ('The settings are correct - do not forget to save your changes!', 'oa_social_login')
140
+ ));
141
+
142
  $oa_social_login_ajax_nonce = wp_create_nonce ('oa_social_login_ajax_nonce');
143
  wp_localize_script ('oa_social_login_admin_js', 'oa_social_login_ajax_nonce', array (
144
  'value' => $oa_social_login_ajax_nonce
195
  'plugin_caption',
196
  'plugin_link_verified_accounts',
197
  'plugin_show_avatars_in_comments',
198
+ 'plugin_use_small_buttons',
199
  'plugin_display_in_login_form',
200
  'plugin_login_form_redirect',
201
  'plugin_login_form_redirect_custom_url',
237
  }
238
  }
239
 
 
240
  //Flag settings
241
+ $sanitzed_settings ['plugin_use_small_buttons'] == ((isset ($sanitzed_settings ['plugin_use_small_buttons']) AND $sanitzed_settings ['plugin_use_small_buttons'] == '1') ? 1 : 0);
242
  $sanitzed_settings ['plugin_show_avatars_in_comments'] == ((isset ($sanitzed_settings ['plugin_show_avatars_in_comments']) AND $sanitzed_settings ['plugin_show_avatars_in_comments'] == '1') ? 1 : 0);
243
  $sanitzed_settings ['plugin_link_verified_accounts'] == ((isset ($sanitzed_settings ['plugin_link_verified_accounts']) AND $sanitzed_settings ['plugin_link_verified_accounts'] == '0') ? 0 : 1);
244
+ $sanitzed_settings ['plugin_login_form_redirect'] = ((isset ($sanitzed_settings ['plugin_login_form_redirect']) AND in_array ($sanitzed_settings ['plugin_login_form_redirect'], array (
245
+ 'dashboard',
246
+ 'homepage',
247
+ 'custom'
248
+ ))) ? $sanitzed_settings ['plugin_login_form_redirect'] : 'homepage');
249
+ $sanitzed_settings ['plugin_registration_form_redirect'] = ((isset ($sanitzed_settings ['plugin_registration_form_redirect']) AND in_array ($sanitzed_settings ['plugin_registration_form_redirect'], array (
250
+ 'dashboard',
251
+ 'homepage',
252
+ 'custom'
253
+ ))) ? $sanitzed_settings ['plugin_registration_form_redirect'] : 'dashboard');
254
  $sanitzed_settings ['plugin_display_in_login_form'] == ((isset ($sanitzed_settings ['plugin_display_in_login_form']) AND $sanitzed_settings ['plugin_display_in_login_form'] == '0') ? 0 : 1);
255
 
256
  //Check Login Redirection Settings
292
  {
293
  //Import providers
294
  GLOBAL $oa_social_login_providers;
295
+ ?>
296
  <div class="wrap">
297
  <h2><?php _e ('Social Login Settings', 'oa_social_login'); ?></h2>
298
  <?php
299
  if (get_option ('oa_social_login_api_settings_verified') !== '1')
300
  {
301
+ ?>
302
  <div class="oa_container oa_container_welcome">
303
  <h3>
304
+ <?php _e ('Make your blog social!', 'oa_social_login'); ?>
305
  </h3>
306
  <div class="oa_container_body">
307
  <p>
308
+ <?php _e ('Allow your visitors to comment, login and register with social networks like Twitter, Facebook, LinkedIn, Hyves, VKontakte, Google or Yahoo.', 'oa_social_login'); ?>
309
+ <strong><?php _e ('Draw a larger audience and increase user engagement in a few simple steps.', 'oa_social_login'); ?></strong>
310
  </p>
311
  <p>
312
+ <?php
313
+ 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/" target="_blank">http://www.oneall.com</a>');
314
+ _e ('After having created your account and setup your Site, please enter the Site settings in the form below.', 'oa_social_login');
315
+ ?>
316
  </p>
317
+ <h3><?php printf (__ ('You are in good company! This plugin is used on more than %s websites!', 'oa_social_login'), '25000+'); ?></h3>
318
  <p>
319
+ <a class="button-secondary" href="https://app.oneall.com/signup/" target="_blank"><strong><?php _e ('Setup my free account', 'oa_social_login'); ?></strong></a>
320
  </p>
321
  </div>
322
  </div>
323
  <?php
324
+ }
325
+ else
326
+ {
327
  ?>
328
  <div class="oa_container oa_container_welcome">
329
  <h3>
330
+ <?php _e ('Your API Account is setup correctly', 'oa_social_login'); ?>
331
  </h3>
332
  <div class="oa_container_body">
333
  <p>
334
+ <?php _e ('Login to your account to manage your providers and access your Social Insights', 'oa_social_login'); ?>.
335
+ <?php _e ("Determine which social networks are popular amongst your users and tailor your registration experience to increase your users' engagement.", 'oa_social_login'); ?>
336
  </p>
337
  <p>
338
+ <a class="button-secondary" href="https://app.oneall.com/signin/" target="_blank"><strong><?php _e ('Login to my account', 'oa_social_login'); ?></strong></a>
339
  </p>
340
  </div>
341
  </div>
342
  <?php
343
+ }
344
+ ?>
345
  <div class="oa_container oa_container_links">
346
  <h3>
347
+ <?php _e ('Help, Updates &amp; Documentation', 'oa_social_login'); ?>
348
  </h3>
349
  <ul>
350
+ <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>
351
+ <li><?php printf (__('<a target="_blank" href="%s">Read the online documentation</a> for more information about this plugin', 'oa_social_login'), 'http://docs.oneall.com/plugins/guide/social-login-wordpress/');?>;</li>
352
+ <li><?php printf (__('<a target="_blank" href="%a">Contact us</a> if you have feedback or need assistance', 'oa_social_login'), 'http://www.oneall.com/company/contact-us/');?></li>
353
  </ul>
354
  </div>
355
  <form method="post" action="options.php">
356
  <?php
357
  settings_fields ('oa_social_login_settings_group');
358
  $settings = get_option ('oa_social_login_settings');
359
+ ?>
360
  <table class="form-table oa_form_table">
361
  <tr>
362
  <th class="head">
363
  <?php _e ('API Settings', 'oa_social_login'); ?>
364
  </th>
365
  <th class="head">
366
+ <a href="https://app.oneall.com/applications/" target="_blank"><?php _e ('Click here to create and view your API Credentials', 'oa_social_login'); ?></a>
367
  </th>
368
  </tr>
369
  <tr>
402
  <table class="form-table oa_form_table">
403
  <tr>
404
  <th class="head" colspan="2">
405
+ <?php _e ('Enable the social networks/identity providers of your choice', 'oa_social_login'); ?>
406
  </th>
407
  </tr>
408
  <?php
412
  ?>
413
  <tr class="<?php echo ((($i++) % 2) == 0) ? 'row_even' : 'row_odd' ?> row_provider">
414
  <td class="row">
415
+ <label for="oneall_social_login_provider_<?php echo $key; ?>"><span class="oa_provider oa_provider_<?php echo $key; ?>" title="<?php echo htmlspecialchars ($provider_data ['name']); ?>"><?php echo htmlspecialchars ($provider_data ['name']); ?></span></label>
416
  <input type="checkbox" id="oneall_social_login_provider_<?php echo $key; ?>" name="oa_social_login_settings[providers][<?php echo $key; ?>]" value="1" <?php checked ('1', $settings ['providers'] [$key]); ?> />
417
+ <label for="oneall_social_login_provider_<?php echo $key; ?>"><?php echo htmlspecialchars ($provider_data ['name']); ?></label>
418
+ <?php
419
+ if ($key == 'vkontakte')
420
+ {
421
+ echo ' - '.sprintf (__('To enable cyrillic usernames, you might need <a target="_blank" href="%s">this plugin</a>', 'oa_social_login'), 'http://wordpress.org/extend/plugins/wordpress-special-characters-in-usernames/');
422
+ }
423
+ ?>
424
  </td>
425
  </tr>
426
  <?php
427
+ }
428
+ ?>
429
  </table>
430
  <table class="form-table oa_form_table oa_form_table_settings">
431
  <tr>
435
  </tr>
436
  <tr class="row_odd">
437
  <td>
438
+ <?php _e ('Enter the description to be displayed above the social network login buttons (leave empty for none):', 'oa_social_login'); ?>
439
  </td>
440
  </tr>
441
  <tr class="row_even">
442
  <td>
443
+ <input type="text" name="oa_social_login_settings[plugin_caption]" size="118" value="<?php echo (isset ($settings ['plugin_caption']) ? htmlspecialchars ($settings ['plugin_caption']) : _e ('Connect with:', 'oa_social_login')); ?>" />
444
  </td>
445
  </tr>
446
  <tr class="row_odd">
453
  <?php
454
  $plugin_show_avatars_in_comments = (isset ($settings ['plugin_show_avatars_in_comments']) AND $settings ['plugin_show_avatars_in_comments'] == '1');
455
  ?>
456
+ <input type="radio" name="oa_social_login_settings[plugin_show_avatars_in_comments]" value="1" <?php echo ($plugin_show_avatars_in_comments ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, show user avatars from social networks if available', 'oa_social_login'); ?><br />
457
+ <input type="radio" name="oa_social_login_settings[plugin_show_avatars_in_comments]" value="0" <?php echo (!$plugin_show_avatars_in_comments ? 'checked="checked"' : ''); ?> /> <?php _e ('No, display the default avatars', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong>
458
+ </td>
459
+ </tr>
460
+ <tr class="row_odd">
461
+ <td>
462
+ <?php _e ("Do you want to use the default or the small social network buttons?", 'oa_social_login'); ?>
463
+ </td>
464
+ </tr>
465
+ <tr class="row_even">
466
+ <td>
467
+ <?php
468
+ $plugin_use_small_buttons = (isset ($settings ['plugin_use_small_buttons']) AND $settings ['plugin_use_small_buttons'] == '1');
469
+ ?>
470
+ <input type="radio" name="oa_social_login_settings[plugin_use_small_buttons]" value="0" <?php echo (!$plugin_use_small_buttons ? '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 />
471
+ <input type="radio" name="oa_social_login_settings[plugin_use_small_buttons]" value="1" <?php echo ($plugin_use_small_buttons ? 'checked="checked"' : ''); ?> /> <?php printf (__ ('Use the small social network buttons (%s)', 'oa_social_login'), '16x16 px'); ?>
472
  </td>
473
  </tr>
474
  </table>
488
  <?php
489
  $plugin_display_in_login_form = (!isset ($settings ['plugin_display_in_login_form']) OR $settings ['plugin_display_in_login_form'] == '1');
490
  ?>
491
+ <input type="radio" name="oa_social_login_settings[plugin_display_in_login_form]" value="1" <?php echo ($plugin_display_in_login_form ? '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 />
492
+ <input type="radio" name="oa_social_login_settings[plugin_display_in_login_form]" value="0" <?php echo (!$plugin_display_in_login_form ? 'checked="checked"' : ''); ?> /> <?php _e ('No, disable social network buttons in the login form', 'oa_social_login'); ?>
493
  </td>
494
  </tr>
495
  <tr class="row_odd">
506
  'custom'
507
  ))) ? 'homepage' : $settings ['plugin_login_form_redirect']);
508
  ?>
509
+ <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 />
510
+ <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 />
511
+ <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 />
512
  <input type="text" name="oa_social_login_settings[plugin_login_form_redirect_custom_url]" size="118" value="<?php echo (isset ($settings ['plugin_login_form_redirect_custom_url']) ? htmlspecialchars ($settings ['plugin_login_form_redirect_custom_url']) : ''); ?>" />
513
  </td>
514
  </tr>
529
  <?php
530
  $plugin_link_verified_accounts = (!isset ($settings ['plugin_link_verified_accounts']) OR $settings ['plugin_link_verified_accounts'] == '1');
531
  ?>
532
+ <input type="radio" name="oa_social_login_settings[plugin_link_verified_accounts]" value="1" <?php echo ($plugin_link_verified_accounts ? '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 />
533
+ <input type="radio" name="oa_social_login_settings[plugin_link_verified_accounts]" value="0" <?php echo (!$plugin_link_verified_accounts ? 'checked="checked"' : ''); ?> /> <?php _e ('No, disable account linking', 'oa_social_login'); ?>
534
  </td>
535
  </tr>
536
  <tr class="row_odd">
543
  <?php
544
  $plugin_display_in_registration_form = (!isset ($settings ['plugin_display_in_registration_form']) OR $settings ['plugin_display_in_registration_form'] == '1');
545
  ?>
546
+ <input type="radio" name="oa_social_login_settings[plugin_display_in_registration_form]" value="1" <?php echo ($plugin_display_in_registration_form ? '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 />
547
+ <input type="radio" name="oa_social_login_settings[plugin_display_in_registration_form]" value="0" <?php echo (!$plugin_display_in_registration_form ? 'checked="checked"' : ''); ?> /> <?php _e ('No, disable social network buttons in the registration form', 'oa_social_login'); ?>
548
  </td>
549
  </tr>
550
 
562
  'custom'
563
  ))) ? 'dashboard' : $settings ['plugin_registration_form_redirect']);
564
  ?>
565
+ <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 />
566
+ <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 />
567
+ <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 />
568
  <input type="text" name="oa_social_login_settings[plugin_registration_form_redirect_custom_url]" size="118" value="<?php echo (isset ($settings ['plugin_registration_form_redirect_custom_url']) ? htmlspecialchars ($settings ['plugin_registration_form_redirect_custom_url']) : ''); ?>" />
569
  </td>
570
  </tr>
571
  </table>
572
  <p class="submit">
573
+ <input type="submit" class="button-primary" value="<?php _e ('Save Changes', 'oa_social_login') ?>" />
574
  </p>
575
  </form>
576
  </div>
577
  <?php
578
+ }
includes/settings.php CHANGED
@@ -1,52 +1,41 @@
1
  <?php
 
2
  /**
3
  * Providers that are currently enabled
4
  */
5
  $oa_social_login_providers = array (
6
  'facebook' => array (
7
- 'name' => 'Facebook',
8
- 'default_enabled' => true
9
  ),
10
  'twitter' => array (
11
- 'name' => 'Twitter',
12
- 'default_enabled' => true
13
  ),
14
  'google' => array (
15
- 'name' => 'Google',
16
- 'default_enabled' => true
17
  ),
18
  'linkedin' => array (
19
- 'name' => 'LinkedIn',
20
- 'default_enabled' => true
21
  ),
22
  'yahoo' => array (
23
- 'name' => 'Yahoo',
24
- 'default_enabled' => true
25
  ),
26
  'openid' => array (
27
- 'name' => 'OpenID',
28
- 'default_enabled' => true
29
  ),
30
  'wordpress' => array (
31
- 'name' => 'Wordpress.com',
32
- 'default_enabled' => true
33
  ),
34
  'hyves' => array (
35
- 'name' => 'Hyves',
36
- 'default_enabled' => false
37
  ),
38
  'paypal' => array (
39
- 'name' => 'PayPal',
40
- 'default_enabled' => false
41
  ),
42
  'livejournal' => array (
43
- 'name' => 'LiveJournal',
44
- 'default_enabled' => false
45
  ),
46
  'vkontakte' => array (
47
- 'name' => 'VKontakte (Вконтакте)',
48
- 'default_enabled' => false,
49
- 'note' => 'To enable cyrillic usernames, you might need <a target="_blank" href="http://wordpress.org/extend/plugins/wordpress-special-characters-in-usernames/">this plugin</a>'
50
  )
51
  );
52
 
1
  <?php
2
+
3
  /**
4
  * Providers that are currently enabled
5
  */
6
  $oa_social_login_providers = array (
7
  'facebook' => array (
8
+ 'name' => 'Facebook'
 
9
  ),
10
  'twitter' => array (
11
+ 'name' => 'Twitter'
 
12
  ),
13
  'google' => array (
14
+ 'name' => 'Google'
 
15
  ),
16
  'linkedin' => array (
17
+ 'name' => 'LinkedIn'
 
18
  ),
19
  'yahoo' => array (
20
+ 'name' => 'Yahoo'
 
21
  ),
22
  'openid' => array (
23
+ 'name' => 'OpenID'
 
24
  ),
25
  'wordpress' => array (
26
+ 'name' => 'Wordpress.com'
 
27
  ),
28
  'hyves' => array (
29
+ 'name' => 'Hyves'
 
30
  ),
31
  'paypal' => array (
32
+ 'name' => 'PayPal'
 
33
  ),
34
  'livejournal' => array (
35
+ 'name' => 'LiveJournal'
 
36
  ),
37
  'vkontakte' => array (
38
+ 'name' => 'VKontakte (Вконтакте)'
 
 
39
  )
40
  );
41
 
includes/toolbox.php CHANGED
@@ -15,16 +15,32 @@ function oa_social_login_get_user_by_token ($user_token)
15
  /**
16
  * Create a random email
17
  */
18
- function oa_social_login_create_rand_email()
19
  {
20
  do
21
  {
22
- $email = md5(uniqid(wp_rand(10000,99000)))."@example.com";
23
- } while(email_exists($email));
 
24
 
25
  return $email;
26
  }
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  /**
29
  * Handle the callback
30
  */
@@ -77,19 +93,21 @@ function oa_social_login_callback ()
77
  //Lastname
78
  $user_last_name = $identity->name->familyName;
79
 
 
 
 
80
  //Fullname
81
- $user_full_name = '';
82
- if ( ! empty ($identity->name->formatted))
83
  {
84
  $user_full_name = $identity->name->formatted;
85
  }
86
- elseif ( ! empty ($identity->name->displayName))
87
  {
88
  $user_full_name = $identity->name->displayName;
89
  }
90
  else
91
  {
92
- $user_full_name = trim ($user_first_name.' '.$user_last_name);
93
  }
94
 
95
  //Email
@@ -104,38 +122,41 @@ function oa_social_login_callback ()
104
  }
105
 
106
  //Thumbnail
107
- $user_thumbnail = '';
108
- if ( ! empty ($identity->thumbnailUrl))
109
  {
110
  $user_thumbnail = trim ($identity->thumbnailUrl);
111
  }
112
-
113
-
 
 
114
 
115
  //User Website
116
- $user_website = '';
117
- if ( ! empty ($identity->profileUrl))
118
  {
119
  $user_website = $identity->profileUrl;
120
  }
121
- elseif ( ! empty ($identity->urls [0]->value))
122
  {
123
  $user_website = $identity->urls [0]->value;
124
  }
 
 
 
 
125
 
126
  //Preferred Username
127
- $user_login = '';
128
- if ( ! empty ($identity->preferredUsername))
129
  {
130
  $user_login = $identity->preferredUsername;
131
  }
132
- elseif (! empty ($identity->displayName))
133
  {
134
  $user_login = $identity->displayName;
135
  }
136
- elseif (! empty ($identity->name->formatted))
137
  {
138
- $user_login = $identity->name->formatted;
139
  }
140
 
141
  //Sanitize Login
@@ -145,26 +166,26 @@ function oa_social_login_callback ()
145
  $user_id = oa_social_login_get_user_by_token ($user_token);
146
 
147
  //Try to link to existing account
148
- if ( ! is_numeric ($user_id))
149
  {
150
  //Linked enabled?
151
- if ( ! isset($settings['plugin_link_verified_accounts']) OR $settings['plugin_link_verified_accounts'] == '1')
152
  {
153
- //Only of email is verified
154
- if ( ! empty ($user_email) AND $user_email_is_verified === true)
155
  {
156
  //Read existing user
157
- if (($user_id_tmp = email_exists($user_email)) !== false)
158
  {
159
  if (is_numeric ($user_id_tmp))
160
  {
161
  $user_id = $user_id_tmp;
162
- delete_metadata('user', null, 'oa_social_login_user_token', $user_token, true);
163
  update_user_meta ($user_id, 'oa_social_login_user_token', $user_token);
164
  update_user_meta ($user_id, 'oa_social_login_identity_id', $user_identity_id);
165
  update_user_meta ($user_id, 'oa_social_login_identity_provider', $user_identity_provider);
166
 
167
- if ( ! empty ($user_thumbnail))
168
  {
169
  update_user_meta ($user_id, 'oa_social_login_user_thumbnail', $user_thumbnail);
170
  }
@@ -176,12 +197,12 @@ function oa_social_login_callback ()
176
 
177
 
178
  //New User
179
- if ( ! is_numeric ($user_id))
180
  {
181
  //Username is mandatory
182
- if ( ! isset ($user_login) OR strlen(trim($user_login)) == 0)
183
  {
184
- $user_login = $user_identity_provider.'User';
185
  }
186
 
187
  //Username must be unique
@@ -191,19 +212,22 @@ function oa_social_login_callback ()
191
  $user_login_tmp = $user_login;
192
  do
193
  {
194
- $user_login_tmp = $user_login.($i++);
195
- } while (username_exists ($user_login_tmp));
 
196
  $user_login = $user_login_tmp;
197
  }
198
 
199
  //Email must be unique
200
- if ( ! isset ($user_email) OR ! is_email($user_email) OR email_exists ($user_email))
201
  {
202
- $user_email = oa_social_login_create_rand_email();
203
  }
204
 
 
205
  $user_data = array (
206
  'user_login' => $user_login,
 
207
  'user_email' => $user_email,
208
  'first_name' => $user_first_name,
209
  'last_name' => $user_last_name,
@@ -213,14 +237,14 @@ function oa_social_login_callback ()
213
 
214
  // Create a new user
215
  $user_id = wp_insert_user ($user_data);
216
- if (is_numeric($user_id))
217
  {
218
- delete_metadata('user', null, 'oa_social_login_user_token', $user_token, true);
219
  update_user_meta ($user_id, 'oa_social_login_user_token', $user_token);
220
  update_user_meta ($user_id, 'oa_social_login_identity_id', $user_identity_id);
221
  update_user_meta ($user_id, 'oa_social_login_identity_provider', $user_identity_provider);
222
 
223
- if ( ! empty ($user_thumbnail))
224
  {
225
  update_user_meta ($user_id, 'oa_social_login_user_thumbnail', $user_thumbnail);
226
  }
@@ -228,58 +252,62 @@ function oa_social_login_callback ()
228
  }
229
 
230
  //Sucess
231
- if (is_object(get_userdata($user_id)))
232
  {
233
  //Setup Cookie
234
- wp_set_auth_cookie($user_id);
 
 
 
235
 
236
- //Redirect to administration area
237
- if (! empty ($_REQUEST['oa_social_login_source']) AND in_array ($_REQUEST['oa_social_login_source'], array ('login', 'registration')))
 
 
 
238
  {
239
- //Registration
240
- if ($_REQUEST['oa_social_login_source'] == 'registration')
241
- {
242
- //Default redirection
243
- $redirect_to = admin_url();
244
- $redirect_to_safe = false;
245
 
246
  //Redirection customized
247
  if (isset ($settings ['plugin_registration_form_redirect']))
248
  {
249
- switch (strtolower($settings ['plugin_registration_form_redirect']))
250
  {
251
- //Homepage
252
- case 'homepage':
253
- $redirect_to = site_url();
254
  break;
255
 
256
- //Custom
257
- case 'custom':
258
- if ( isset ($settings ['plugin_registration_form_redirect_custom_url']) AND strlen(trim($settings ['plugin_registration_form_redirect_custom_url'])) > 0)
259
- {
260
- $redirect_to = trim($settings ['plugin_registration_form_redirect_custom_url']);
261
- }
262
  break;
263
 
264
- //Default/Dashboard
265
- default:
266
- case 'dashboard':
267
- $redirect_to = admin_url();
268
  break;
269
  }
270
  }
271
- }
272
- //Login
273
- elseif ($_REQUEST['oa_social_login_source'] == 'login')
274
- {
275
- //Default redirection
276
- $redirect_to = site_url();
277
- $redirect_to_safe = false;
278
 
279
  //Redirection in URL
280
- if ( ! empty ($_GET['redirect_to']))
281
  {
282
- $redirect_to = $_GET['redirect_to'];
283
  $redirect_to_safe = true;
284
  }
285
  else
@@ -287,50 +315,82 @@ function oa_social_login_callback ()
287
  //Redirection customized
288
  if (isset ($settings ['plugin_login_form_redirect']))
289
  {
290
- switch (strtolower($settings ['plugin_login_form_redirect']))
291
  {
292
- //Dashboard
293
- case 'dashboard':
294
- $redirect_to = admin_url();
295
  break;
296
 
297
- //Custom
298
- case 'custom':
299
- if ( isset ($settings ['plugin_login_form_redirect_custom_url']) AND strlen(trim($settings ['plugin_login_form_redirect_custom_url'])) > 0)
300
- {
301
- $redirect_to = trim($settings ['plugin_login_form_redirect_custom_url']);
302
- }
303
  break;
304
 
305
- //Default/Homepage
306
- default:
307
- case 'homepage':
308
- $redirect_to = site_url();
309
  break;
310
  }
311
  }
312
  }
313
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
314
 
315
- if ($redirect_to_safe)
316
- {
317
- wp_redirect($redirect_to);
318
- }
319
- else
320
- {
321
- wp_safe_redirect($redirect_to);
322
- }
323
 
324
- exit();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
325
  }
326
- //Set current user
327
  else
328
  {
329
- wp_set_current_user($user_id);
330
  }
 
331
  }
332
  }
333
  }
334
  }
335
  }
336
-
15
  /**
16
  * Create a random email
17
  */
18
+ function oa_social_login_create_rand_email ()
19
  {
20
  do
21
  {
22
+ $email = md5 (uniqid (wp_rand (10000, 99000))) . "@example.com";
23
+ }
24
+ while (email_exists ($email));
25
 
26
  return $email;
27
  }
28
 
29
+ /**
30
+ * Initialise
31
+ */
32
+ function oa_social_login_init ()
33
+ {
34
+ //Localization
35
+ if (function_exists ('load_plugin_textdomain'))
36
+ {
37
+ load_plugin_textdomain ('oa_social_login', false, OA_SOCIAL_LOGIN_BASE_PATH . '/languages/');
38
+ }
39
+
40
+ //Callback Handler
41
+ oa_social_login_callback ();
42
+ }
43
+
44
  /**
45
  * Handle the callback
46
  */
93
  //Lastname
94
  $user_last_name = $identity->name->familyName;
95
 
96
+ //Construct a full name from first and last names
97
+ $user_constructed_name = trim ($user_first_name . ' ' . $user_last_name);
98
+
99
  //Fullname
100
+ if (!empty ($identity->name->formatted))
 
101
  {
102
  $user_full_name = $identity->name->formatted;
103
  }
104
+ elseif (!empty ($identity->name->displayName))
105
  {
106
  $user_full_name = $identity->name->displayName;
107
  }
108
  else
109
  {
110
+ $user_full_name = $user_constructed_name;
111
  }
112
 
113
  //Email
122
  }
123
 
124
  //Thumbnail
125
+ if (!empty ($identity->thumbnailUrl))
 
126
  {
127
  $user_thumbnail = trim ($identity->thumbnailUrl);
128
  }
129
+ else
130
+ {
131
+ $user_thumbnail = '';
132
+ }
133
 
134
  //User Website
135
+ if (!empty ($identity->profileUrl))
 
136
  {
137
  $user_website = $identity->profileUrl;
138
  }
139
+ elseif (!empty ($identity->urls [0]->value))
140
  {
141
  $user_website = $identity->urls [0]->value;
142
  }
143
+ else
144
+ {
145
+ $user_website = '';
146
+ }
147
 
148
  //Preferred Username
149
+ if (!empty ($identity->preferredUsername))
 
150
  {
151
  $user_login = $identity->preferredUsername;
152
  }
153
+ elseif (!empty ($identity->displayName))
154
  {
155
  $user_login = $identity->displayName;
156
  }
157
+ else
158
  {
159
+ $user_login = $user_full_name;
160
  }
161
 
162
  //Sanitize Login
166
  $user_id = oa_social_login_get_user_by_token ($user_token);
167
 
168
  //Try to link to existing account
169
+ if (!is_numeric ($user_id))
170
  {
171
  //Linked enabled?
172
+ if (!isset ($settings ['plugin_link_verified_accounts']) OR $settings ['plugin_link_verified_accounts'] == '1')
173
  {
174
+ //Only if email is verified
175
+ if (!empty ($user_email) AND $user_email_is_verified === true)
176
  {
177
  //Read existing user
178
+ if (($user_id_tmp = email_exists ($user_email)) !== false)
179
  {
180
  if (is_numeric ($user_id_tmp))
181
  {
182
  $user_id = $user_id_tmp;
183
+ delete_metadata ('user', null, 'oa_social_login_user_token', $user_token, true);
184
  update_user_meta ($user_id, 'oa_social_login_user_token', $user_token);
185
  update_user_meta ($user_id, 'oa_social_login_identity_id', $user_identity_id);
186
  update_user_meta ($user_id, 'oa_social_login_identity_provider', $user_identity_provider);
187
 
188
+ if (!empty ($user_thumbnail))
189
  {
190
  update_user_meta ($user_id, 'oa_social_login_user_thumbnail', $user_thumbnail);
191
  }
197
 
198
 
199
  //New User
200
+ if (!is_numeric ($user_id))
201
  {
202
  //Username is mandatory
203
+ if (!isset ($user_login) OR strlen (trim ($user_login)) == 0)
204
  {
205
+ $user_login = $user_identity_provider . 'User';
206
  }
207
 
208
  //Username must be unique
212
  $user_login_tmp = $user_login;
213
  do
214
  {
215
+ $user_login_tmp = $user_login . ($i++);
216
+ }
217
+ while (username_exists ($user_login_tmp));
218
  $user_login = $user_login_tmp;
219
  }
220
 
221
  //Email must be unique
222
+ if (!isset ($user_email) OR !is_email ($user_email) OR email_exists ($user_email))
223
  {
224
+ $user_email = oa_social_login_create_rand_email ();
225
  }
226
 
227
+ //Build user data
228
  $user_data = array (
229
  'user_login' => $user_login,
230
+ 'display_name' => (!empty ($user_full_name) ? $user_full_name : $user_login),
231
  'user_email' => $user_email,
232
  'first_name' => $user_first_name,
233
  'last_name' => $user_last_name,
237
 
238
  // Create a new user
239
  $user_id = wp_insert_user ($user_data);
240
+ if (is_numeric ($user_id))
241
  {
242
+ delete_metadata ('user', null, 'oa_social_login_user_token', $user_token, true);
243
  update_user_meta ($user_id, 'oa_social_login_user_token', $user_token);
244
  update_user_meta ($user_id, 'oa_social_login_identity_id', $user_identity_id);
245
  update_user_meta ($user_id, 'oa_social_login_identity_provider', $user_identity_provider);
246
 
247
+ if (!empty ($user_thumbnail))
248
  {
249
  update_user_meta ($user_id, 'oa_social_login_user_thumbnail', $user_thumbnail);
250
  }
252
  }
253
 
254
  //Sucess
255
+ if (is_object (get_userdata ($user_id)))
256
  {
257
  //Setup Cookie
258
+ wp_set_auth_cookie ($user_id, true);
259
+
260
+ //Where did the user come from?
261
+ $oa_social_login_source = (!empty ($_REQUEST ['oa_social_login_source']) ? strtolower (trim ($_REQUEST ['oa_social_login_source'])) : '');
262
 
263
+ //Use safe redirection?
264
+ $redirect_to_safe = false;
265
+
266
+ //Build the url to redirect the user to
267
+ switch ($oa_social_login_source)
268
  {
269
+ //*************** Registration ***************
270
+ case 'registration':
271
+ //Default redirection
272
+ $redirect_to = admin_url ();
 
 
273
 
274
  //Redirection customized
275
  if (isset ($settings ['plugin_registration_form_redirect']))
276
  {
277
+ switch (strtolower ($settings ['plugin_registration_form_redirect']))
278
  {
279
+ //Homepage
280
+ case 'homepage':
281
+ $redirect_to = site_url ();
282
  break;
283
 
284
+ //Custom
285
+ case 'custom':
286
+ if (isset ($settings ['plugin_registration_form_redirect_custom_url']) AND strlen (trim ($settings ['plugin_registration_form_redirect_custom_url'])) > 0)
287
+ {
288
+ $redirect_to = trim ($settings ['plugin_registration_form_redirect_custom_url']);
289
+ }
290
  break;
291
 
292
+ //Default/Dashboard
293
+ default:
294
+ case 'dashboard':
295
+ $redirect_to = admin_url ();
296
  break;
297
  }
298
  }
299
+ break;
300
+
301
+
302
+ //*************** Login ***************
303
+ case 'login':
304
+ //Default redirection
305
+ $redirect_to = site_url ();
306
 
307
  //Redirection in URL
308
+ if (!empty ($_GET ['redirect_to']))
309
  {
310
+ $redirect_to = $_GET ['redirect_to'];
311
  $redirect_to_safe = true;
312
  }
313
  else
315
  //Redirection customized
316
  if (isset ($settings ['plugin_login_form_redirect']))
317
  {
318
+ switch (strtolower ($settings ['plugin_login_form_redirect']))
319
  {
320
+ //Dashboard
321
+ case 'dashboard':
322
+ $redirect_to = admin_url ();
323
  break;
324
 
325
+ //Custom
326
+ case 'custom':
327
+ if (isset ($settings ['plugin_login_form_redirect_custom_url']) AND strlen (trim ($settings ['plugin_login_form_redirect_custom_url'])) > 0)
328
+ {
329
+ $redirect_to = trim ($settings ['plugin_login_form_redirect_custom_url']);
330
+ }
331
  break;
332
 
333
+ //Default/Homepage
334
+ default:
335
+ case 'homepage':
336
+ $redirect_to = site_url ();
337
  break;
338
  }
339
  }
340
  }
341
+ break;
342
+
343
+ // *************** Other ***************
344
+ default:
345
+ //Get request URI - Should work on Apache + IIS
346
+ $request_uri = ((!isset ($_SERVER ['REQUEST_URI'])) ? $_SERVER ['PHP_SELF'] : $_SERVER ['REQUEST_URI']);
347
+ $request_port = ((!empty ($_SERVER ['SERVER_PORT']) AND $_SERVER ['SERVER_PORT'] <> '80') ? (":" . $_SERVER ['SERVER_PORT']) : '');
348
+ $request_protocol = (is_ssl () ? 'https' : 'http') . "://";
349
+ $redirect_to = $request_protocol . $_SERVER ['SERVER_NAME'] . $request_port . $request_uri;
350
+
351
+ //Remove the oa_social_login_source argument
352
+ if (strpos ($redirect_to, 'oa_social_login_source') !== false)
353
+ {
354
+ //Break up url
355
+ list($url_part, $query_part) = array_pad (explode ('?', $redirect_to), 2, '');
356
+ parse_str ($query_part, $query_vars);
357
 
358
+ //Remove oa_social_login_source argument
359
+ if (is_array ($query_vars) AND isset ($query_vars ['oa_social_login_source']))
360
+ {
361
+ unset ($query_vars ['oa_social_login_source']);
362
+ }
 
 
 
363
 
364
+ //Build new url
365
+ $redirect_to = $url_part . ((is_array ($query_vars) AND count ($query_vars) > 0) ? ('?' . http_build_query ($query_vars)) : '');
366
+ }
367
+
368
+ //Anchor to #comments
369
+ if ($oa_social_login_source == 'comments')
370
+ {
371
+ $redirect_to .= '#comments';
372
+ }
373
+ break;
374
+ }
375
+
376
+ //Check if url set
377
+ if (!isset ($redirect_to_safe) OR strlen (trim ($redirect_to_safe)) == 0)
378
+ {
379
+ $redirect_to_safe = site_url ();
380
+ }
381
+
382
+ //Use safe redirection
383
+ if ($redirect_to_safe === true)
384
+ {
385
+ wp_safe_redirect ($redirect_to);
386
  }
 
387
  else
388
  {
389
+ wp_redirect ($redirect_to);
390
  }
391
+ exit ();
392
  }
393
  }
394
  }
395
  }
396
  }
 
includes/user_interface.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  /**
4
  * Include the Social Library
5
- **/
6
  function oa_social_login_add_javascripts ()
7
  {
8
  if (!wp_script_is ('oa_social_library', 'registered'))
@@ -12,10 +12,11 @@ function oa_social_login_add_javascripts ()
12
 
13
  if (!empty ($settings ['api_subdomain']))
14
  {
15
- wp_register_script ("oa_social_library", (is_ssl () ? 'https' : 'http') . '://' . $settings ['api_subdomain'] . '.api.oneall.com/socialize/library.js');
 
16
  }
17
  }
18
- wp_print_scripts ("oa_social_library");
19
  }
20
  add_action ('login_head', 'oa_social_login_add_javascripts');
21
  add_action ('wp_head', 'oa_social_login_add_javascripts');
@@ -23,30 +24,36 @@ add_action ('wp_head', 'oa_social_login_add_javascripts');
23
 
24
  /**
25
  * Setup Shortcode handler
26
- **/
27
  function oa_social_login_shortcode_handler ($args)
28
  {
29
- if (!is_user_logged_in ())
30
- {
31
- oa_social_login_render_login_form ('shortcode');
32
- }
33
  }
34
  add_shortcode ('oa_social_login', 'oa_social_login_shortcode_handler');
35
 
 
36
  /**
37
- * Display custom avatars
38
  */
39
  function oa_social_login_custom_avatar ()
40
  {
 
41
  global $comment;
 
 
42
  $args = func_get_args ();
43
 
 
 
 
 
 
 
 
44
  //Check if we are in a comment
45
  if (!is_null ($comment) AND !empty ($comment->user_id) AND !empty ($args [0]))
46
  {
47
- //Read settings
48
- $settings = get_option ('oa_social_login_settings');
49
- if (isset ($settings ['plugin_show_avatars_in_comments']) AND $settings ['plugin_show_avatars_in_comments'] == '1')
50
  {
51
  //Read Thumbnail
52
  if (($user_thumbnail = get_user_meta ($comment->user_id, 'oa_social_login_user_thumbnail', true)) !== false)
@@ -73,7 +80,7 @@ function oa_social_login_render_login_form_comments ()
73
  {
74
  if (comments_open () && !is_user_logged_in ())
75
  {
76
- oa_social_login_render_login_form ('comments');
77
  }
78
  }
79
  add_action ('comment_form_top', 'oa_social_login_render_login_form_comments');
@@ -93,7 +100,7 @@ function oa_social_login_render_login_form_registration ()
93
  //Display buttons if option not set or enabled
94
  if (!isset ($settings ['plugin_display_in_registration_form']) OR $settings ['plugin_display_in_registration_form'] == '1')
95
  {
96
- oa_social_login_render_login_form ('registration');
97
  }
98
  }
99
  }
@@ -111,7 +118,7 @@ function oa_social_login_render_login_form_login ()
111
  //Display buttons if option not set or enabled
112
  if (!isset ($settings ['plugin_display_in_login_form']) OR $settings ['plugin_display_in_login_form'] == '1')
113
  {
114
- oa_social_login_render_login_form ('login');
115
  }
116
  }
117
  add_action ('login_form', 'oa_social_login_render_login_form_login');
@@ -124,20 +131,34 @@ function oa_social_login_render_custom_form_login ()
124
  {
125
  if (!is_user_logged_in ())
126
  {
127
- oa_social_login_render_login_form ('custom');
128
  }
129
  }
130
  add_action ('oa_social_login', 'oa_social_login_render_custom_form_login');
131
 
132
 
 
 
 
 
 
 
 
 
 
 
 
133
  /**
134
  * Display the provider grid
135
  */
136
- function oa_social_login_render_login_form ($source)
137
  {
138
  //Import providers
139
  GLOBAL $oa_social_login_providers;
140
 
 
 
 
141
  //Read settings
142
  $settings = get_option ('oa_social_login_settings');
143
 
@@ -147,9 +168,6 @@ function oa_social_login_render_login_form ($source)
147
  //API Subdomain Required
148
  if (!empty ($api_subdomain))
149
  {
150
- //Caption
151
- $plugin_caption = (!empty ($settings ['plugin_caption']) ? $settings ['plugin_caption'] : '');
152
-
153
  //Build providers
154
  $providers = array ();
155
  if (is_array ($settings ['providers']))
@@ -163,51 +181,68 @@ function oa_social_login_render_login_form ($source)
163
  }
164
  }
165
 
 
 
 
 
 
 
 
166
  //Widget
167
  if ($source == 'widget')
168
  {
169
- $css_theme_uri = 'http://oneallcdn.com/css/api/socialize/themes/wp_widget.css';
170
- $show_title = false;
 
 
 
 
 
 
171
  }
172
- //Inline
173
  else
174
  {
175
- //For all page, except the Widget
176
- $css_theme_uri = 'http://oneallcdn.com/css/api/socialize/themes/wp_inline.css';
177
- $show_title = (empty ($plugin_caption) ? false : true);
178
 
179
- //Anchor to comments
180
- if ($source == 'comments')
181
- {
182
- $source .= '#comments';
183
- }
184
  }
185
 
 
186
  //Providers selected?
187
  if (count ($providers) > 0)
188
  {
189
  //Random integer
190
  $rand = mt_rand (99999, 9999999);
191
- ?>
192
- <div class="oneall_social_login">
193
- <?php
194
- if ($show_title)
195
- {
196
- ?>
197
- <div style="margin-bottom: 3px;"><label><?php _e ($plugin_caption, 'oa_social_login'); ?></label></div>
198
- <?php
199
- }
200
- ?>
201
- <div class="oneall_social_login_providers" id="oneall_social_login_providers_<?php echo $rand; ?>"></div>
202
- <script type="text/javascript">
203
- oneall.api.plugins.social_login.build("oneall_social_login_providers_<?php echo $rand; ?>", {
204
- 'providers' : ['<?php echo implode ("','", $providers); ?>'],
205
- 'callback_uri': (window.location.href + ((window.location.href.split('?')[1] ? '&':'?') + 'oa_social_login_source=<?php echo $source; ?>')),
206
- 'css_theme_uri' : '<?php echo $css_theme_uri; ?>'
207
- });
208
- </script>
209
- </div>
210
- <?php
211
- }
212
- }
213
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  /**
4
  * Include the Social Library
5
+ */
6
  function oa_social_login_add_javascripts ()
7
  {
8
  if (!wp_script_is ('oa_social_library', 'registered'))
12
 
13
  if (!empty ($settings ['api_subdomain']))
14
  {
15
+ //Include in header, without version appended
16
+ wp_register_script ("oa_social_library", ((is_ssl () ? 'https' : 'http') . '://' . $settings ['api_subdomain'] . '.api.oneall.com/socialize/library.js'), array (), null, false);
17
  }
18
  }
19
+ wp_print_scripts ('oa_social_library');
20
  }
21
  add_action ('login_head', 'oa_social_login_add_javascripts');
22
  add_action ('wp_head', 'oa_social_login_add_javascripts');
24
 
25
  /**
26
  * Setup Shortcode handler
27
+ */
28
  function oa_social_login_shortcode_handler ($args)
29
  {
30
+ return (is_user_logged_in () ? '' : oa_social_login_render_login_form ('shortcode'));
 
 
 
31
  }
32
  add_shortcode ('oa_social_login', 'oa_social_login_shortcode_handler');
33
 
34
+
35
  /**
36
+ * Hook to display custom avatars in comments
37
  */
38
  function oa_social_login_custom_avatar ()
39
  {
40
+ //The current comment
41
  global $comment;
42
+
43
+ //Arguments passed to this function
44
  $args = func_get_args ();
45
 
46
+ //The social login settings
47
+ static $oa_social_login_settings = null;
48
+ if (is_null ($oa_social_login_settings))
49
+ {
50
+ $oa_social_login_settings = get_option ('oa_social_login_settings');
51
+ }
52
+
53
  //Check if we are in a comment
54
  if (!is_null ($comment) AND !empty ($comment->user_id) AND !empty ($args [0]))
55
  {
56
+ if (isset ($oa_social_login_settings ['plugin_show_avatars_in_comments']) AND $oa_social_login_settings ['plugin_show_avatars_in_comments'] == '1')
 
 
57
  {
58
  //Read Thumbnail
59
  if (($user_thumbnail = get_user_meta ($comment->user_id, 'oa_social_login_user_thumbnail', true)) !== false)
80
  {
81
  if (comments_open () && !is_user_logged_in ())
82
  {
83
+ echo oa_social_login_render_login_form ('comments');
84
  }
85
  }
86
  add_action ('comment_form_top', 'oa_social_login_render_login_form_comments');
100
  //Display buttons if option not set or enabled
101
  if (!isset ($settings ['plugin_display_in_registration_form']) OR $settings ['plugin_display_in_registration_form'] == '1')
102
  {
103
+ echo oa_social_login_render_login_form ('registration');
104
  }
105
  }
106
  }
118
  //Display buttons if option not set or enabled
119
  if (!isset ($settings ['plugin_display_in_login_form']) OR $settings ['plugin_display_in_login_form'] == '1')
120
  {
121
+ echo oa_social_login_render_login_form ('login');
122
  }
123
  }
124
  add_action ('login_form', 'oa_social_login_render_login_form_login');
131
  {
132
  if (!is_user_logged_in ())
133
  {
134
+ echo oa_social_login_render_login_form ('custom');
135
  }
136
  }
137
  add_action ('oa_social_login', 'oa_social_login_render_custom_form_login');
138
 
139
 
140
+ /**
141
+ * Alternative for custom forms, where the output is not necessarily required at the place of calling
142
+ * $oa_social_login_form = apply_filters('oa_social_login_custom', '');
143
+ */
144
+ function oa_social_login_filter_login_form_custom ($value = 'custom')
145
+ {
146
+ return (is_user_logged_in () ? '' : oa_social_login_render_login_form ($value));
147
+ }
148
+ add_filter ('oa_social_login_custom', 'oa_social_login_filter_login_form_custom');
149
+
150
+
151
  /**
152
  * Display the provider grid
153
  */
154
+ function oa_social_login_render_login_form ($source, $args = array())
155
  {
156
  //Import providers
157
  GLOBAL $oa_social_login_providers;
158
 
159
+ //Container for returned value
160
+ $output = '';
161
+
162
  //Read settings
163
  $settings = get_option ('oa_social_login_settings');
164
 
168
  //API Subdomain Required
169
  if (!empty ($api_subdomain))
170
  {
 
 
 
171
  //Build providers
172
  $providers = array ();
173
  if (is_array ($settings ['providers']))
181
  }
182
  }
183
 
184
+ //Get the current protocoll
185
+ $protocol = (is_ssl () ? 'https' : 'http');
186
+
187
+ //Themes
188
+ $css_theme_uri_small = $protocol . '://oneallcdn.com/css/api/socialize/themes/wordpress/small.css';
189
+ $css_theme_uri_default = $protocol . '://oneallcdn.com/css/api/socialize/themes/wordpress/default.css';
190
+
191
  //Widget
192
  if ($source == 'widget')
193
  {
194
+ //Read widget settings
195
+ $widget_settings = (is_array ($args) ? $args : array ());
196
+
197
+ //Dont show the title - this is handled insided the widget
198
+ $plugin_caption = '';
199
+
200
+ //Buttons size
201
+ $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);
202
  }
203
+ //Other places
204
  else
205
  {
206
+ //Show title if set
207
+ $plugin_caption = (!empty ($settings ['plugin_caption']) ? $settings ['plugin_caption'] : '');
 
208
 
209
+ //Buttons size
210
+ $css_theme_uri = (!empty ($settings ['plugin_use_small_buttons']) ? $css_theme_uri_small : $css_theme_uri_default);
 
 
 
211
  }
212
 
213
+
214
  //Providers selected?
215
  if (count ($providers) > 0)
216
  {
217
  //Random integer
218
  $rand = mt_rand (99999, 9999999);
219
+
220
+ //Setup output
221
+ $output = array ();
222
+ $output [] = '<div class="oneall_social_login">';
223
+
224
+ //Add the caption?
225
+ if (!empty ($plugin_caption))
226
+ {
227
+ $output [] = ' <div style="margin-bottom: 3px;"><label>' . __ ($plugin_caption) . '</label></div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  }
229
+
230
+ //Add the Plugin
231
+ $output [] = ' <div class="oneall_social_login_providers" id="oneall_social_login_providers_' . $rand . '"></div>';
232
+ $output [] = ' <script type="text/javascript">';
233
+ $output [] = ' oneall.api.plugins.social_login.build("oneall_social_login_providers_' . $rand . '", {';
234
+ $output [] = ' "providers": ["' . implode ('","', $providers) . '"], ';
235
+ $output [] = ' "callback_uri": (window.location.href + ((window.location.href.split(\'?\')[1] ? \'&amp;\':\'?\') + "oa_social_login_source=' . $source . '")), ';
236
+ $output [] = ' "css_theme_uri": "' . $css_theme_uri . '" ';
237
+ $output [] = ' });';
238
+ $output [] = ' </script>';
239
+ $output [] = '</div>';
240
+
241
+ //Done
242
+ $output = implode ("\n", $output);
243
+ }
244
+
245
+ //Return a string and let the calling function do the actual outputting
246
+ return $output;
247
+ }
248
+ }
includes/widget.php CHANGED
@@ -11,7 +11,7 @@ class oa_social_login_widget extends WP_Widget
11
  public function __construct ()
12
  {
13
  parent::WP_Widget ('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
 
@@ -39,7 +39,7 @@ class oa_social_login_widget extends WP_Widget
39
  }
40
 
41
  //Content
42
- oa_social_login_render_login_form ('widget');
43
 
44
  //After Content
45
  if ( !empty ($instance ['widget_content_after']))
@@ -59,9 +59,10 @@ class oa_social_login_widget extends WP_Widget
59
  {
60
  //Default settings
61
  $default_settings = array (
62
- 'widget_title' => __('Connect with').':',
63
  'widget_content_before' => '',
64
  'widget_content_after' => '',
 
65
  'widget_hide_for_logged_in_users' => '1'
66
  );
67
 
@@ -73,20 +74,24 @@ class oa_social_login_widget extends WP_Widget
73
  $instance = wp_parse_args ((array) $instance, $default_settings);
74
  ?>
75
  <p>
76
- <label for="<?php echo $this->get_field_id ('widget_title'); ?>"><?php _e ('Title:', 'oa_social_login'); ?></label>
77
  <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']; ?>" />
78
  </p>
79
  <p>
80
- <label for="<?php echo $this->get_field_id ('widget_content_before'); ?>"><?php _e ('Insert content to add before the widget:', 'oa_social_login'); ?></label>
81
  <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>
82
  </p>
83
  <p>
84
- <label for="<?php echo $this->get_field_id ('widget_content_after'); ?>"><?php _e ('Insert content to add after the widget:', 'oa_social_login'); ?></label>
85
  <textarea class="widefat" id="<?php echo $this->get_field_id ('widget_content_after'); ?>" name="<?php echo $this->get_field_name ('widget_content_after'); ?>"><?php echo $instance ['widget_content_after']; ?></textarea>
86
  </p>
87
  <p>
88
- <input type="checkbox" id="<?php echo $this->get_field_id ('widget_hide_for_logged_in_users'); ?>" 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"' : ''); ?> />
89
- <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>
 
 
 
 
90
  </p>
91
  <?php
92
  }
@@ -102,6 +107,7 @@ class oa_social_login_widget extends WP_Widget
102
  $instance ['widget_content_before'] = trim($new_instance ['widget_content_before']);
103
  $instance ['widget_content_after'] = trim($new_instance ['widget_content_after']);
104
  $instance ['widget_hide_for_logged_in_users'] = (empty($new_instance ['widget_hide_for_logged_in_users']) ? 0 : 1);
 
105
  return $instance;
106
  }
107
  }
11
  public function __construct ()
12
  {
13
  parent::WP_Widget ('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
 
39
  }
40
 
41
  //Content
42
+ echo oa_social_login_render_login_form ('widget', $instance);
43
 
44
  //After Content
45
  if ( !empty ($instance ['widget_content_after']))
59
  {
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
 
74
  $instance = wp_parse_args ((array) $instance, $default_settings);
75
  ?>
76
  <p>
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>
83
  </p>
84
  <p>
85
+ <label for="<?php echo $this->get_field_id ('widget_content_after'); ?>"><?php _e ('Insert text/html to add after the widget', 'oa_social_login'); ?>:</label>
86
  <textarea class="widefat" id="<?php echo $this->get_field_id ('widget_content_after'); ?>" name="<?php echo $this->get_field_name ('widget_content_after'); ?>"><?php echo $instance ['widget_content_after']; ?></textarea>
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
  $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
  }
languages/oa_social_login-de_DE.mo ADDED
Binary file
languages/oa_social_login-de_DE.po ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Social Login\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-01-19 18:25+0100\n"
6
+ "PO-Revision-Date: 2012-01-19 18:26+0100\n"
7
+ "Last-Translator: Claude SCHLESSER <cschlesser@oneall.com>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: __;_e\n"
13
+ "X-Poedit-Basepath: ..\n"
14
+ "X-Poedit-Language: German\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #: oa-social-login.php:24
19
+ #, php-format
20
+ msgid "This plugin requires WordPress %s or newer. Please update your WordPress installation to activate this plugin."
21
+ msgstr "Dieses Plugin benötigt Wordpress %s oder höher. Bitte aktualisieren Sie Ihr Wordpress bevor Sie das Plugin installieren"
22
+
23
+ #: oa-social-login.php:30
24
+ msgid "This plugin requires the PHP libcurl extension be installed. Please contact your web host and request libcurl be <a href='http://www.php.net/manual/en/intro.curl.php'>installed</a>."
25
+ msgstr "Im dieses Plugin zu nutzen benötigen Sie die PHP libcurl Erweiterung. Bitte kontaktieren Sie Ihren Server-Administrator um PHP libcurl zu <a href='http://www.php.net/manual/en/intro.curl.php'>installieren</a>."
26
+
27
+ #: oa-social-login.php:52
28
+ msgid "Settings"
29
+ msgstr "Einstellungen"
30
+
31
+ #: includes/admin.php:24
32
+ msgid "Thank you for using the Social Login Plugin!"
33
+ msgstr "Danke dass Sie Social Login installiert haben!"
34
+
35
+ #: includes/admin.php:24
36
+ #, php-format
37
+ msgid "Please go to the <strong><a href=\"%s\">Settings\\Social Login</a></strong> page to setup the plugin."
38
+ msgstr "Bitte rufen Sie die Seite <strong><a href=\"%s\">Einstellungen\\Social Login</a></strong> auf, um das Plugin zu konfigurieren."
39
+
40
+ #: includes/admin.php:134
41
+ msgid "Please fill out each of the fields above."
42
+ msgstr "Bitte füllen Sie alle Felder aus"
43
+
44
+ #: includes/admin.php:135
45
+ msgid "The subdomain does not exist. Have you filled it out correctly?"
46
+ msgstr "Subdomain wurde nicht gefunden. Haben Sie sie richtig ausgefüllt?"
47
+
48
+ #: includes/admin.php:136
49
+ msgid "The subdomain has a wrong syntax!"
50
+ msgstr "Die Subdomain ist ungültig"
51
+
52
+ #: includes/admin.php:137
53
+ msgid "Could not contact API. Are outoing CURL requests allowed?"
54
+ msgstr "Keine Verbindung zur API. Blockiert Ihr Firewall ausgehende Anfragen?"
55
+
56
+ #: includes/admin.php:138
57
+ msgid "The API credentials are wrong"
58
+ msgstr "Die API-Nutzerdaten sind ungültig"
59
+
60
+ #: includes/admin.php:139
61
+ msgid "The settings are correct - do not forget to save your changes!"
62
+ msgstr "Die Einstellungen sind korrekt! Vergessen Sie nicht abzuspeichern!"
63
+
64
+ #: includes/admin.php:297
65
+ msgid "Social Login Settings"
66
+ msgstr "Social Login Einstellungen"
67
+
68
+ #: includes/admin.php:304
69
+ msgid "Make your blog social!"
70
+ msgstr "Verbinden Sie Ihren Blog mit den sozialen Netzwerken!"
71
+
72
+ #: includes/admin.php:308
73
+ msgid "Allow your visitors to comment, login and register with social networks like Twitter, Facebook, LinkedIn, Hyves, VKontakte, Google or Yahoo."
74
+ msgstr "Erlauben Sie Ihren Besuchern, sich mit sozialen Netzwerk wie z.B. Twitter, Facebook, LinkedIn, Hyves, VKontakte, Google oder Yahoo anzumelden, und Kommentare zu hinterlassen."
75
+
76
+ #: includes/admin.php:309
77
+ msgid "Draw a larger audience and increase user engagement in a few simple steps."
78
+ msgstr "Steigern Sie die Beteilung Ihrer Nutzer auf einfachste Art und Weise."
79
+
80
+ #: includes/admin.php:313
81
+ #, php-format
82
+ msgid "To be able to use this plugin you first of all need to create a free account at %s and setup a Site"
83
+ msgstr "Um dieses Plugin nutzen zu können, müssen Sie sich zunächst kostenlos ein Konto bei %s anmelden."
84
+
85
+ #: includes/admin.php:314
86
+ msgid "After having created your account and setup your Site, please enter the Site settings in the form below."
87
+ msgstr "Nachdem Sie Ihr Konto angemeldet haben, müssen Sie die API-Daten in nachfolgendes Formular eintragen."
88
+
89
+ #: includes/admin.php:317
90
+ #, php-format
91
+ msgid "You are in good company! This plugin is used on more than %s websites!"
92
+ msgstr "Mehr als %s Webseiten nutzen dieses Plugin. Seien Sie dabei!"
93
+
94
+ #: includes/admin.php:319
95
+ msgid "Setup my free account"
96
+ msgstr "Kostenloses Konto anmelden"
97
+
98
+ #: includes/admin.php:330
99
+ msgid "Your API Account is setup correctly"
100
+ msgstr "Die API-Daten sind korrekt"
101
+
102
+ #: includes/admin.php:334
103
+ msgid "Login to your account to manage your providers and access your Social Insights"
104
+ msgstr "Loggen Sie sich in Ihr Konto ein, um Einstellungen vorzunehmen und Statistiken einzusehen"
105
+
106
+ #: includes/admin.php:335
107
+ msgid "Determine which social networks are popular amongst your users and tailor your registration experience to increase your users' engagement."
108
+ msgstr "Finden Sie heraus, welche sozialen Netzwerke unter Ihren Besuchern beliebt sind, und steigern Sie die Beteilung Ihrer Besucher."
109
+
110
+ #: includes/admin.php:338
111
+ msgid "Login to my account"
112
+ msgstr "In mein Konto einloggen"
113
+
114
+ #: includes/admin.php:347
115
+ msgid "Help, Updates &amp; Documentation"
116
+ msgstr "Hilfe, Updates &amp; Dokumentation"
117
+
118
+ #: includes/admin.php:350
119
+ #, php-format
120
+ msgid "<a target=\"_blank\" href=\"%s\">Follow us on Twitter</a> to stay informed about updates"
121
+ msgstr "<a target=\"_blank\" href=\"%s\">Folgen Sie uns auf Twitter</a>, um auf dem Laufenden zu bleiben"
122
+
123
+ #: includes/admin.php:351
124
+ #, php-format
125
+ msgid "<a target=\"_blank\" href=\"%s\">Read the online documentation</a> for more information about this plugin"
126
+ msgstr "<a target=\"_blank\" href=\"%s\">Lesen Sie unsere Dokumentation</a> für zusätzliche Information"
127
+
128
+ #: includes/admin.php:352
129
+ msgid "<a target=\"_blank\" href=\"%a\">Contact us</a> if you have feedback or need assistance"
130
+ msgstr "<a target=\"_blank\" href=\"%a\">Schreiben Sie uns</a>, falls Sie Hilfe benötigen"
131
+
132
+ #: includes/admin.php:363
133
+ msgid "API Settings"
134
+ msgstr "API Einstellungen"
135
+
136
+ #: includes/admin.php:366
137
+ msgid "Click here to create and view your API Credentials"
138
+ msgstr "Klicken Sie hier, um Ihre API-Daten einzusehen"
139
+
140
+ #: includes/admin.php:371
141
+ msgid "API Subdomain"
142
+ msgstr "API Subdomain"
143
+
144
+ #: includes/admin.php:379
145
+ msgid "API Public Key"
146
+ msgstr "API Public Key"
147
+
148
+ #: includes/admin.php:387
149
+ msgid "API Private Key"
150
+ msgstr "API Private Key"
151
+
152
+ #: includes/admin.php:395
153
+ msgid "Verify API Settings"
154
+ msgstr "API-Einstellungen überprüfen"
155
+
156
+ #: includes/admin.php:405
157
+ msgid "Enable the social networks/identity providers of your choice"
158
+ msgstr "Wählen Sie die sozialen Netzwerke aus:"
159
+
160
+ #: includes/admin.php:421
161
+ #, php-format
162
+ msgid "To enable cyrillic usernames, you might need <a target=\"_blank\" href=\"%s\">this plugin</a>"
163
+ msgstr "Um kyrillische Zeichen zu verwenden, brauchen Sie <a target=\"_blank\" href=\"%s\">dieses Plugin</a>"
164
+
165
+ #: includes/admin.php:433
166
+ msgid "Basic Settings"
167
+ msgstr "Grundeinstellungen"
168
+
169
+ #: includes/admin.php:438
170
+ msgid "Enter the description to be displayed above the social network login buttons (leave empty for none):"
171
+ msgstr "Welcher Text soll über den Icons der sozialen Netzwerk angezeigt werden (ggf. leer lassen) ?"
172
+
173
+ #: includes/admin.php:443
174
+ msgid "Connect with:"
175
+ msgstr "Einloggen mit:"
176
+
177
+ #: includes/admin.php:448
178
+ msgid "If the user's social network profile has an avatar thumbnail, should we show it beside his comments?"
179
+ msgstr "Wollen Sie die Nutzer-Avatare der sozialen Netwerke gegebenenfalls in den Kommentaren anzeigen?"
180
+
181
+ #: includes/admin.php:456
182
+ msgid "Yes, show user avatars from social networks if available"
183
+ msgstr "Ja, zeige den sozialen Avatar des Benutzer in den Kommentaren dieses Benutzers an"
184
+
185
+ #: includes/admin.php:457
186
+ msgid "No, display the default avatars"
187
+ msgstr "Nein, zeige die Standard-Avatare"
188
+
189
+ #: includes/admin.php:457
190
+ #: includes/admin.php:470
191
+ #: includes/admin.php:491
192
+ #: includes/admin.php:509
193
+ #: includes/admin.php:532
194
+ #: includes/admin.php:546
195
+ #: includes/admin.php:566
196
+ msgid "Default"
197
+ msgstr "Standard"
198
+
199
+ #: includes/admin.php:462
200
+ msgid "Do you want to use the default or the small social network buttons?"
201
+ msgstr "Wollen Sie die standard -oder kleinere Icons für soziale Netzwerke verwenden?"
202
+
203
+ #: includes/admin.php:470
204
+ #, php-format
205
+ msgid "Use the default social network buttons (%s)"
206
+ msgstr "Standard-Icons verwenden (%s)"
207
+
208
+ #: includes/admin.php:471
209
+ #, php-format
210
+ msgid "Use the small social network buttons (%s)"
211
+ msgstr "Kleine Icons verwenden (%s)"
212
+
213
+ #: includes/admin.php:478
214
+ msgid "Login Settings"
215
+ msgstr "Einstellungen: Einloggen"
216
+
217
+ #: includes/admin.php:483
218
+ msgid "Do you want to display the social network login buttons below the login form of your blog?"
219
+ msgstr "Das Plugin auf der Login-Seite Ihres Blogs anzeigen?"
220
+
221
+ #: includes/admin.php:491
222
+ msgid "Yes, display the social network buttons below the login form"
223
+ msgstr "Ja, die Icons der sozialen Netzwerke auf der Login-Seite anzeigen"
224
+
225
+ #: includes/admin.php:492
226
+ msgid "No, disable social network buttons in the login form"
227
+ msgstr "Nein, keine Icons auf der Login-Seite anzeigen"
228
+
229
+ #: includes/admin.php:497
230
+ msgid "Where should existent users be redirected to after having logged in with their social network account?"
231
+ msgstr "Wohin sollen Nutzer weitergeleitet werden, nachdem Sie sich mit einem sozialen Netzwerk eingeloggt haben?"
232
+
233
+ #: includes/admin.php:509
234
+ #: includes/admin.php:565
235
+ msgid "Redirect users to the homepage of my blog"
236
+ msgstr "Weiterleitung zur Hauptseite meines Blogs"
237
+
238
+ #: includes/admin.php:510
239
+ #: includes/admin.php:566
240
+ msgid "Redirect users to their account dashboard"
241
+ msgstr "Weiterleitung zur Profilseite des Nutzers"
242
+
243
+ #: includes/admin.php:511
244
+ #: includes/admin.php:567
245
+ msgid "Redirect users to the following url"
246
+ msgstr "Weiterleitung zu dieser URL"
247
+
248
+ #: includes/admin.php:519
249
+ msgid "Registration Settings"
250
+ msgstr "Einstellungen: Anmeldung"
251
+
252
+ #: includes/admin.php:524
253
+ msgid "If the email address of the social network profile is verified, should we try to link it to an existing account?"
254
+ msgstr "Sollen soziale Profile mit überprüfter Email mit vorhandenen Blog-Nutzern verknüpft werden?"
255
+
256
+ #: includes/admin.php:532
257
+ msgid "Yes, try to link verified social network profiles to existing blog accounts"
258
+ msgstr "Ja, verknüpfe soziale Profile gegebenenfalls mit vorhanden Nutzern"
259
+
260
+ #: includes/admin.php:533
261
+ msgid "No, disable account linking"
262
+ msgstr "Nein, keine Verknüpfung"
263
+
264
+ #: includes/admin.php:538
265
+ msgid "Do you want to display the social network login buttons below the registration form of your blog?"
266
+ msgstr "Das Plugin auf der Anmelden-Seite Ihres Blogs anzeigen?"
267
+
268
+ #: includes/admin.php:546
269
+ msgid "Yes, display the social network buttons below the registration form"
270
+ msgstr "Ja, die Icons der sozialen Netzwerke auf der Anmelden-Seite anzeigen"
271
+
272
+ #: includes/admin.php:547
273
+ msgid "No, disable social network buttons in the registration form"
274
+ msgstr "Nein, keine Icons auf der Anmelden-Seite anzeigen"
275
+
276
+ #: includes/admin.php:553
277
+ msgid "Where should new users be redirected to after having registered with their social network account?"
278
+ msgstr "Wohin sollen Nutzer weitergeleitet werden, nach sie ein Konto mit einem sozialen Netzwerk angelegt haben?"
279
+
280
+ #: includes/admin.php:573
281
+ msgid "Save Changes"
282
+ msgstr "Einstellungen speichern"
283
+
284
+ #: includes/widget.php:14
285
+ msgid "Allow your visitors to login and register with social networks like Twitter, Facebook, LinkedIn, Hyves, Google and Yahoo."
286
+ msgstr "Erlauben Sie Ihren Nutzern, sich mit sozialen Netwerken wie z.B. Twitter, Facebook, LinkedIn, Hyves, Google und Yahoo anzumelden, und Kommentare zu schreiben"
287
+
288
+ #: includes/widget.php:62
289
+ msgid "Connect with"
290
+ msgstr "Einloggen mit"
291
+
292
+ #: includes/widget.php:77
293
+ msgid "Title"
294
+ msgstr "Titel"
295
+
296
+ #: includes/widget.php:81
297
+ msgid "Insert text/html to add before the widget"
298
+ msgstr "Text/Html vor dem Widget einfügen"
299
+
300
+ #: includes/widget.php:85
301
+ msgid "Insert text/html to add after the widget"
302
+ msgstr "Text/Html nach dem Widget einfügen"
303
+
304
+ #: includes/widget.php:90
305
+ msgid "Tick to hide widget for logged-in users"
306
+ msgstr "Widget verstecken bei eingeloggten Nutzern"
307
+
308
+ #: includes/widget.php:94
309
+ msgid "Tick to use small buttons"
310
+ msgstr "Kleine Icons verwenden"
311
+
oa-social-login.php CHANGED
@@ -3,31 +3,31 @@
3
  Plugin Name: Social Login
4
  Plugin URI: http://www.oneall.com/
5
  Description: Allow your visitors to <strong>comment, login and register with 20+ social networks</strong> like Twitter, Facebook, LinkedIn, Hyves, Вконтакте, Google or Yahoo.
6
- Version: 1.6.1
7
  Author: Claude Schlesser
8
  Author URI: http://www.oneall.com/
9
  License: GPL2
10
  */
11
 
12
  define ('OA_SOCIAL_LOGIN_PLUGIN_URL', plugins_url () . '/' . basename (dirname (__FILE__)));
 
13
 
14
  /**
15
  * Check technical requirements before activating the plugin.
16
- * Wordpress 3.0 or newer required
17
- * CURL Required
18
  */
19
  function oa_social_login_activate ()
20
  {
21
  if (!function_exists ('register_post_status'))
22
  {
23
  deactivate_plugins (basename (dirname (__FILE__)) . '/' . basename (__FILE__));
24
- echo sprintf (__ ("This plugin requires WordPress 3.0 or newer. Please update your WordPress installation to activate this plugin."));
25
  exit;
26
  }
27
  elseif (!function_exists ('curl_version'))
28
  {
29
  deactivate_plugins (basename (dirname (__FILE__)) . '/' . basename (__FILE__));
30
- echo sprintf (__ ("This plugin requires the <a href='http://www.php.net/manual/en/intro.curl.php'>PHP libcurl extension</a> be installed. Please contact your web host and request libcurl be <a href='http://www.php.net/manual/en/intro.curl.php'>installed</a>."));
31
  exit;
32
  }
33
  update_option ('oa_social_login_activation_message', 0);
@@ -49,7 +49,7 @@ function oa_social_login_add_settings_link ($links, $file)
49
 
50
  if ($file == $oa_social_login_plugin)
51
  {
52
- $settings_link = '<a href="options-general.php?page=oa_social_login">' . __ ("Settings", "oa_social_login") . '</a>';
53
  array_unshift ($links, $settings_link);
54
  }
55
  return $links;
@@ -78,9 +78,6 @@ require_once(dirname (__FILE__) . '/includes/widget.php');
78
 
79
 
80
  /**
81
- * Callback Handler
82
  */
83
- if (isset ($_POST) AND !empty ($_POST ['oa_action']) AND $_POST ['oa_action'] == 'social_login' AND !empty ($_POST ['connection_token']))
84
- {
85
- add_action ('init', 'oa_social_login_callback', 2000);
86
- }
3
  Plugin Name: Social Login
4
  Plugin URI: http://www.oneall.com/
5
  Description: Allow your visitors to <strong>comment, login and register with 20+ social networks</strong> like Twitter, Facebook, LinkedIn, Hyves, Вконтакте, Google or Yahoo.
6
+ Version: 2.0
7
  Author: Claude Schlesser
8
  Author URI: http://www.oneall.com/
9
  License: GPL2
10
  */
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
 
15
  /**
16
  * Check technical requirements before activating the plugin.
17
+ * Wordpress 3.0 or newer + CURL required
 
18
  */
19
  function oa_social_login_activate ()
20
  {
21
  if (!function_exists ('register_post_status'))
22
  {
23
  deactivate_plugins (basename (dirname (__FILE__)) . '/' . basename (__FILE__));
24
+ echo sprintf (__ ("This plugin requires WordPress %s or newer. Please update your WordPress installation to activate this plugin.", "3.0"));
25
  exit;
26
  }
27
  elseif (!function_exists ('curl_version'))
28
  {
29
  deactivate_plugins (basename (dirname (__FILE__)) . '/' . basename (__FILE__));
30
+ echo sprintf (__ ("This plugin requires the PHP libcurl extension be installed. Please contact your web host and request libcurl be <a href='http://www.php.net/manual/en/intro.curl.php'>installed</a>."));
31
  exit;
32
  }
33
  update_option ('oa_social_login_activation_message', 0);
49
 
50
  if ($file == $oa_social_login_plugin)
51
  {
52
+ $settings_link = '<a href="options-general.php?page=oa_social_login">' . __ ('Settings') . '</a>';
53
  array_unshift ($links, $settings_link);
54
  }
55
  return $links;
78
 
79
 
80
  /**
81
+ * Initialise
82
  */
83
+ add_action ('init', 'oa_social_login_init', 2000);
 
 
 
readme.txt CHANGED
@@ -2,15 +2,16 @@
2
  Contributors: ClaudeSchlesser
3
  Tags: social login, social connect, facebook login, linkedin, livejournal, google, yahoo, twitter login, openid, paypal, vkontakte, hyves, widget, plugin, social network login, comments
4
  Requires at least: 3.0
5
- Tested up to: 3.3
6
- Stable tag: 1.6.1
7
 
8
  Allow your visitors to comment and login with social networks like Twitter, Facebook, Paypal, LinkedIn, LiveJournal, OpenID, VKontakte, Google, Yahoo
9
 
10
  == Description ==
11
 
12
- The Social Login Plugin is a professional though free Wordpress plugin that allows your visitors to comment,
13
- login and register with social networks like Twitter, Facebook, LinkedIn, Paypal, LiveJournal, Hyves, Вконтакте, Google or Yahoo. <br />
 
14
 
15
  <strong>Choose where to add the Social Login Plugin:</strong>
16
  <ul>
@@ -39,14 +40,15 @@ login and register with social networks like Twitter, Facebook, LinkedIn, Paypal
39
  <li>Hyves</li>
40
  <li>VKontakte (Вконтакте)</li>
41
  </ul>
 
42
 
43
- <strong>Increase your wordpress user engagement in a few simple steps with this plugin.</strong><br />
 
44
 
45
  The Social Login Plugin is maintained by <a href="http://www.oneall.com">OneAll</a>, a technology company offering a set of web-delivered
46
  tools and services for establishing and optimizing a site's connection with social networks and identity providers such as Facebook, Twitter,
47
  Google, Yahoo!, LinkedIn, Paypal, Hyves amongst others.
48
 
49
-
50
  == Installation ==
51
 
52
  1. Upload the plugin folder to the "/wp-content/plugins/" directory of your WordPress site,
@@ -60,6 +62,11 @@ Google, Yahoo!, LinkedIn, Paypal, Hyves amongst others.
60
  You should not have to change your templates.
61
  The Social Login seamlessly integrates into your blog by using predefined hooks.
62
 
 
 
 
 
 
63
 
64
  = I have a custom template and the plugin is not displayed correctly =
65
 
@@ -98,29 +105,40 @@ http://docs.oneall.com/plugins/guide/social-login-wordpress/
98
  2. **Login** - Login formular (Social Network Buttons are included)
99
  3. **Plugin Settings** - Plugin Settings in the Wordpress Administration Area
100
  4. **Widget Settings** - Widget Settings in the Wordpress Administration Area
 
101
 
102
  == Changelog ==
103
 
104
- = 1.0 =
105
- * Initial release
 
 
 
 
 
 
 
 
 
 
 
106
 
107
- = 1.0.1 =
108
- * Hook oa_social_login fixed
109
- * Plugin description changed
110
-
111
- = 1.0.2 =
112
- * Version numbers fixed
113
-
114
- = 1.3.2 =
115
- * Stable Version
116
 
117
- = 1.3.4 =
118
- * Multisite issues with Widget fixed
 
 
 
 
119
 
120
- = 1.3.5 =
121
- * Administration area redirection fixed
122
- * Automatic email creation added
123
- * Email verification added
124
 
125
  = 1.4 =
126
  * Social Network Avatars can be displayed in comments
@@ -130,22 +148,26 @@ http://docs.oneall.com/plugins/guide/social-login-wordpress/
130
  * Select redirection target after registration
131
  * Enable account linking
132
 
133
- = 1.5 =
134
- * Social Network Avatars fixed
135
- * Social Buttons no longer displayed for customs hooks if logged in
136
- * KISS for API Settings Setup
137
 
138
- = 1.6 =
139
- * LiveJournal added
140
- * PayPal added
141
- * Settings link added
142
- * API Communication Check added
143
- * Cyrillic character support
144
 
145
- = 1.6.1 =
146
- * Provider unselect bug fixed
147
- * Sanitize user strict added
148
- * Custom namespace for add_settings_link
 
 
 
 
 
 
 
 
149
 
150
  == Testimonials ==
151
 
@@ -200,3 +222,13 @@ was easy to follow and implement. I was struggling with a couple of other plugin
200
  <em>I especially enjoy the step by step process that guides you through the Social website App creation process. In the end I would like to thank you
201
  for putting together such a great product that so many users can implement with ease.</em>
202
  <strong>Stefan C.</strong>
 
 
 
 
 
 
 
 
 
 
2
  Contributors: ClaudeSchlesser
3
  Tags: social login, social connect, facebook login, linkedin, livejournal, google, yahoo, twitter login, openid, paypal, vkontakte, hyves, widget, plugin, social network login, comments
4
  Requires at least: 3.0
5
+ Tested up to: 3.3.1
6
+ Stable tag: 2.0
7
 
8
  Allow your visitors to comment and login with social networks like Twitter, Facebook, Paypal, LinkedIn, LiveJournal, OpenID, VKontakte, Google, Yahoo
9
 
10
  == Description ==
11
 
12
+ The Social Login Plugin is a professional though free Wordpress (BuddyPress compatible) Plugin in English/German that allows your visitors to comment,
13
+ login and register with social networks like Twitter, Facebook, LinkedIn, Paypal, LiveJournal, Hyves, Вконтакте, Google or Yahoo.
14
+ <strong>Make your blog social!</strong><br />
15
 
16
  <strong>Choose where to add the Social Login Plugin:</strong>
17
  <ul>
40
  <li>Hyves</li>
41
  <li>VKontakte (Вконтакте)</li>
42
  </ul>
43
+
44
 
45
+ <strong>Increase your wordpress user engagement in a few simple steps with the Social Login Plugin!</strong>
46
+ Our users love it! Check out the <a href="http://wordpress.org/extend/plugins/oa-social-login/other_notes/">testimonials</a>!<br />
47
 
48
  The Social Login Plugin is maintained by <a href="http://www.oneall.com">OneAll</a>, a technology company offering a set of web-delivered
49
  tools and services for establishing and optimizing a site's connection with social networks and identity providers such as Facebook, Twitter,
50
  Google, Yahoo!, LinkedIn, Paypal, Hyves amongst others.
51
 
 
52
  == Installation ==
53
 
54
  1. Upload the plugin folder to the "/wp-content/plugins/" directory of your WordPress site,
62
  You should not have to change your templates.
63
  The Social Login seamlessly integrates into your blog by using predefined hooks.
64
 
65
+ = Does Social Login can be embedded through a shortcode? =
66
+
67
+ The Social Login shortcode `[oa_social_login]` can be used in any page or post within your blog.
68
+ The shortcode will automatically be replaced by the icons of the chosen
69
+ social network providers.
70
 
71
  = I have a custom template and the plugin is not displayed correctly =
72
 
105
  2. **Login** - Login formular (Social Network Buttons are included)
106
  3. **Plugin Settings** - Plugin Settings in the Wordpress Administration Area
107
  4. **Widget Settings** - Widget Settings in the Wordpress Administration Area
108
+ 5. **Login** - Login formular with small buttons (Social Network Buttons are included)
109
 
110
  == Changelog ==
111
 
112
+ = 2.0 =
113
+ * WC3 Compliant callback uri
114
+ * HTTP/HTTPS Check for CSS files
115
+ * Shortcode handler fixed
116
+ * Wordpress Cookie now set for 14 days
117
+ * Wordpress display_name is now populated
118
+ * Redirection improved
119
+ * Now Buddypress compatible
120
+ * Link to settings page after installation
121
+ * Caching for socialize library improved
122
+ * Small buttons added as option
123
+ * Localization added
124
+ * German translation
125
 
126
+ = 1.6.1 =
127
+ * Provider unselect bug fixed
128
+ * Sanitize user strict added
129
+ * Custom namespace for add_settings_link
 
 
 
 
 
130
 
131
+ = 1.6 =
132
+ * LiveJournal added
133
+ * PayPal added
134
+ * Settings link added
135
+ * API Communication Check added
136
+ * Cyrillic character support
137
 
138
+ = 1.5 =
139
+ * Social Network Avatars fixed
140
+ * Social Buttons no longer displayed for customs hooks if logged in
141
+ * KISS for API Settings Setup
142
 
143
  = 1.4 =
144
  * Social Network Avatars can be displayed in comments
148
  * Select redirection target after registration
149
  * Enable account linking
150
 
151
+ = 1.3.5 =
152
+ * Administration area redirection fixed
153
+ * Automatic email creation added
154
+ * Email verification added
155
 
156
+ = 1.3.4 =
157
+ * Multisite issues with Widget fixed
 
 
 
 
158
 
159
+ = 1.3.2 =
160
+ * Stable Version
161
+
162
+ = 1.0.2 =
163
+ * Version numbers fixed
164
+
165
+ = 1.0.1 =
166
+ * Hook oa_social_login fixed
167
+ * Plugin description changed
168
+
169
+ = 1.0 =
170
+ * Initial release
171
 
172
  == Testimonials ==
173
 
222
  <em>I especially enjoy the step by step process that guides you through the Social website App creation process. In the end I would like to thank you
223
  for putting together such a great product that so many users can implement with ease.</em>
224
  <strong>Stefan C.</strong>
225
+
226
+ <em>Thanks for a such a great plugin! I was really impressed with the simplicity of the installation directions and the clean design.</em>
227
+ <strong>Janae S.</strong>
228
+
229
+ <em>You have no idea how it THRILLED me to integrate oneall. It was SO amazingly easy, your team has simplified the whole process of signing up for
230
+ authorization on multiple social media sites. I HAD NO QUESTIONS/STEPS THAT YOU HADN'T ALREADY ANTICIPATED. It saved me HOURS of work!</em>
231
+ <strong>Kelly C.</strong>
232
+
233
+ <em>I love your service the way it is, it's amazing how easy the logging-in-via-social-network is integrated into a wordpress website!</em>
234
+ <strong>Martin S.</strong>
screenshot-5.png ADDED
Binary file