i am aware that if i login the it will create my account if i dont have one, but how i can login next time directly? because what password i should use?
]]>One issue I had with this plugin that after logging in, the user was directed to the homepage rather than the page s/he signed up from. Here’s what I did to redirect:
In /includes/lib/PkliLogin.php, somewhere around line 115:
// This function displays the login button on the default WP login page
public function display_login_button() {
// User is not logged in, display login button
echo "<p><a rel='nofollow' href='" . $this->get_auth_url() . "'>
<img alt='LinkedIn' src='" . PKLI_URL . "includes/assets/img/linkedin-button.png' />
</a></p>";
}
Becomes:
// This function displays the login button on the default WP login page
public function display_login_button() {
$currentURL = "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
setcookie('li_redirect', $currentURL, 0, COOKIEPATH, COOKIE_DOMAIN, false);
// User is not logged in, display login button
echo "<p><a rel='nofollow' href='" . $this->get_auth_url() . "'>
<img alt='LinkedIn' src='" . PKLI_URL . "includes/assets/img/linkedin-button.png' />
</a></p>";
}
Around line 406, change:
// Default fields
return "<a href='" . $auth_url . "' class='$class'><img src='" . $img . "' /></a>";
}
to:
// Default fields
$currentURL = "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
setcookie('li_redirect', $currentURL, 0, COOKIEPATH, COOKIE_DOMAIN, false);
return "<a href='" . $auth_url . "' class='$class'><img src='" . $img . "' /></a>";
}
This sets a cookie called “li_redirect” with the page URL of the page that they last saw the login button on.
Under Ultimate LinkedIn Integration Plugin Settings, set the Login Redirect URL and Sign-Up Redirect URL to https://www.yourdomain.com/?li=1
Modify your child theme’s header.php to include a hook to look for the ‘li’ variable in the URL and that the ‘li_redirect’ cookie is set:
<?php
if((isset($_COOKIE['li_redirect'])) && ($_GET['li'])) {
$li_redirect = $_COOKIE['li_redirect'];
unset($_COOKIE['li_redirect']);
header("Location: ". $li_redirect);
}
?>
(Make sure any caching you have in place excludes https://www.yourdomain.com/?li=1)
]]>this plugin stopped working, and I have had to make changes to it to get it going again – posted here to help others !
These changes the api URL to https://api.linkedin.com/v2/me to conform with V2, and take out the ‘sharing’ scope whoch is not allowed under default access (you need a partnership set-up to get this, which we don’t need!)
\linkedin-login.1.1.3\linkedin-login\includes\lib\PkliLogin.php
line 25 changed to
const _BASE_URL = 'https://api.linkedin.com/v2/me';
around line 217 changed to
`// Get first name, last name and email address, and user picture
$xml = $this->oauth->get(‘https://api.linkedin.com/v2/me’) ;
$xml = json_decode($xml);
$email_data = $this->oauth->get(‘https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))’);
$email_data = json_decode($email_data);
$profile_pic = $this->oauth->get(‘https://api.linkedin.com/v2/me?projection=(id,profilePicture(displayImage~:playableStreams))’) ;
$profile_pic = json_decode($profile_pic);
$locale_lastName = $xml->lastName->preferredLocale->language.’_’.$xml->lastName->preferredLocale->country;
$lastName = $xml->lastName->localized->$locale_lastName;
$locale_firstName = $xml->firstName->preferredLocale->language.’_’.$xml->firstName->preferredLocale->country;
$firstName = $xml->firstName->localized->$locale_firstName;
$data = [
‘id’=>$xml->id,
‘first-name’=>$firstName,
‘last-name’=>$lastName,
’email-address’=>$email_data->elements[0]->{‘handle~’}->{’emailAddress’},
‘picture-url’=>$profile_pic->profilePicture->{‘displayImage~’}->elements[0]->identifiers[0]->identifier,
];
return (object)$data;`
linkedin-login.1.1.3\linkedin-login\includes\lib\class-pkli-scopes.php
line 29 commented OUT
//const SHARING = 'w_member_social';
\linkedin-login.1.1.3\linkedin-login\includes\lib\class-pkli-settings.php
line 181 commented OUT to prevent error
// Pkli_Scopes::SHARING => 'Share',
If an Administrator has not logged in via LinkedIn profile, locked content remains invisible to them.
To fix this, I modified line 429 of includes/lib/PkliLogin.php:
if((get_user_meta(wp_get_current_user()->ID, 'pkli_linkedin_id') != false) || (current_user_can( 'manage_options' ))){
Thank you for your help with this great plugin.
My only concern was that the user’s email address (username) was the default display name, so would be exposed when they’re making comments. Instead, I opted to change the display_name to firstName lastName.
To do so, I modified line 481 of includes/lib/PkliLogin.php
$result = wp_update_user(array('ID' => $user_id, 'first_name' => $first_name, 'last_name' => $last_name, 'description' => $description, 'user_url' => $linkedin_url, 'display_name' => $first_name .' '. $last_name));
Again, thanks for your hard work, especially in keeping up with LinkedIn’s oAuth 2.0 requirements, which seem to be plaguing the majority of social login plugins.
]]>Hi there we use WP Hide Login to change our admin login URL: https://en-gb.www.ads-software.com/plugins/wps-hide-login/
Even when the correct URL is entered in OAuth 2.0 settings for the Linkedin Developers App the redirect breaks when trying to login using the Linkedin login option.
Is there a work around to this so we can use both plugins at the same time?
Thanks
Dariush
]]>Hello,
I’m having trouble. I click on the register button, which takes me to the LinkedIn login page and when I do, it returns me a page with a list of errors similar to these:
All errors occur from line 449 to 457 of PkliLogin.php. It seems that LinkedIn is not sending back the requested information from the user’s profile or something. However, when I check the worpdress users list as admin, I can see that the user is indeed being created.
How can I avoid these errors?
Has this plugin been abandoned? website doesn’t work
]]>Hi,
Great plugin!
Will it get updated to the new API V2?
]]>How do I get logged in users LinkedIn profile.
]]>Hi,
I’m using your plugin to allow users to login to my site via linked in but I’m also using this plugin https://www.ads-software.com/plugins/user-login-history/ to track user login history but I’ve noticed that it isn’t tracking users who login via linkedin can you check and help me with this issue.
Best Regards
Ylli
Hi, I have this plugin set up on my site and I’m just wondering will I be notified when someone logs in via LinkedIn and how does that work?
Thanks,
Katie
Hello,
It show like this in multisite
]]>Helloo have installed your plugin ,it is awesome .But i have a small problem ,it seems that the linkedin button for login is displayed at the admin login area from default ,and i can t find any settings to not show the button on the admin area login
]]>Hi Samer
Great plugin thanks for sharing. Is there anyway to get/fetch the Linkedin profile and display it after we register a user with your plugin ?
Thank you,
Nuno
Hello. I got the LinkedIn part connected. It shows the button and takes you to the linkedIn sign in. I enter my linked in details and press allow access. It then redirects to my login screen where it asks me to enter my login. I enter in the same login as linked in and it tells me no account found. When I look at wordpress admin it is not showing any kind of account related to linkedin details. The link it takes me to on authorise is like so:
I left all the redirect options blank in WP settings page. Also using BuudyPress on this site if that makes a difference.
What should be happening once I press “allow access”?
]]>I notice that in the get_linked_in function you request the company for each position
$xml = simplexml_load_string($this->oauth->get('https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,headline,specialties,positions:(id,title,summary,start-date,end-date,is-current,company),summary,site-standard-profile-request,picture-url,location:(name,country:(code)),industry)'));
But in update_user_data you don’t store the company.
foreach ($xml->positions->position as $position) {
$user_positions[] = array('title' => (string) $position->{'title'}, 'summary' => (string) $position->{'summary'});
}
If I were to submit a patch that stored the full data for the position, would you take it?
]]>Hi,
Is it possible to set the redirect after login/register to the same page the person was before (not specific page, any page)?
]]>The provided shortcode isn’t working
[wpli_login_link]
How can I display it in a page?
]]>“Use the shortcode [wpli_login_link] to display the sign in link anywhere on your site.”
What if I want to add it to the Register Page?
]]>Hi,
you did not mention anywhere in the install process that I’ll need to install Piklist plugin too. Is that normal process?
Thanks
]]>Hi,
I’ve been working with Linkedin for 9 months to try and resolve this issue, but when I use LinkedIn-Login, it sends me to the authorization page, but my picture is missing, it shows my app’s picture, it fills in all the username and passwords, but I get a big red notice at the top
X Server encountered an error
LinkedIn can’t seem to solve it, I’m wondering if you have seen this before.
I have had LinkedIn look into my account, and it seems fine
I’ve deleted all my LinkedIn cookies
I’ve deleted my LinkedIn app and created a new one.
I’m very lost on this!
Thanks in advnace
]]>Hello Samer, and crongratulations for this nice plugin.
I sugest integration with buddypress will be a nice feature. It’s possible match some Linkedin profile fields with Buddypress Profile Custom Fields?
For Example:
Linikedin Fields | Buddypress Fields
first-name -> Name
last-name -> Last Name
headline -> Description
positions -> Position
picture-url -> The Image for User
etc…
If you can say me how find into the plugin’s code i will try to match…
Thank you very much
]]>Hi,
After login it goes directly to the profile and not the redirect page.
Please help.
Hello,
I have integrated plugin in my localhost.
I am not able to login with linked in i have done some trace and it seems that i am not able to get access token from the linked in api.
In file, PkliLogin.php $xml = $this->get_linkedin_profile(); function does not returns anything.
Note: I have installed and activated Piklist plugin.
Please help.
Thanks.
]]>Your plugin no longer works for me on the latest version of WordPress.
The Shortcodes dont load.
]]>Hi,
I get this error when clicking on the button:
invalid redirect_uri. This value must match a URL registered with the API Key.
I have the correct https://thelinkedinman.com/wp-login as the Auto 2.0
and the domain name https://thelinkedinman.com/ as the URL in settings.
Please help. Thanks.
]]>Hi,
I hope that you’re having a good day
Is it possible to add LinkedIn user fields to a WP user meta fields?, what I mean is in LinkedIn user I’d like to get other info like Country, Phone Number, Company, Job Title and save it as WP user custom meta on login is it possible? or perhaps guide me how I can add hook to do that?
Thanks,
Ryscript
Hello
I am using your plugin it seems to be good but not working
It have all thing what i need if it work perfact
But it gives me fatel error when I am trying to login via linkdin over my wordpress site
Fatal error: Uncaught exception ‘Exception’ with message ‘The Authorization Service has return: ‘ in /home/fd120215/public_html/wrise/wp-content/plugins/wordpress-linkedin-login-master/includes/lib/Pkli_OAuth2Client.php:84 Stack trace: #0 /home/fd120215/public_html/wrise/wp-content/plugins/wordpress-linkedin-login-master/includes/lib/PkliLogin.php(187): Pkli_OAuth2Client->authenticate(‘AQRPYM8Ds1eVIAl…’) #1 /home/fd120215/public_html/wrise/wp-content/plugins/wordpress-linkedin-login-master/includes/lib/PkliLogin.php(148): PkliLogin->get_linkedin_profile() #2 [internal function]: PkliLogin->process_login(”) #3 /home/fd120215/public_html/wrise/wp-includes/plugin.php(503): call_user_func_array(Array, Array) #4 /home/fd120215/public_html/wrise/wp-settings.php(353): do_action(‘init’) #5 /home/fd120215/public_html/wrise/wp-config.php(89): require_once(‘/home/fd120215/…’) #6 /home/fd120215/public_html/wrise/wp-load.php(37): require_once(‘/home/fd120215/…’) #7 /home/fd120215/public_html/wrise/wp-login.php(12): require(‘/ho in /home/fd120215/public_html/wrise/wp-content/plugins/wordpress-linkedin-login-master/includes/lib/Pkli_OAuth2Client.php on line 84
This is the above error I am facing
Here is site in case you also want to see issue https://fairdealpower.in/wrise/ Click on join in header navigation
please respond asap
I will be really appreciate
Thanks
]]>Hi,
I have gone through the install procedure on two different servers: NGINX and APACHE. I have it working on the APACHE server but not on NGINX.
What are the server requirements in order to run LinkedIn login?
A description of the error on NGINX occurs after the authentication process where the returned information from LinkedIn returns a white screen with a url end of: “/wp-login.php?action=pkli_login&code=[code]"
Can you advise me of what my need installed on the NGINX server? PHP Curl is already installed on the server.
Thanks,
Graham
]]>