Alan,
Thanks for your patience and access to your server. I've definitely narrowed it down to some sort of a communications issue. I don't know what, because from just FTP access, it's not possible to determine what's causing the slow down. I'll describe my test below though.
I edited the /libraries/joomla/http/transport/curl.php file. cURL is what's used to make an outgoing request from your server using PHP. Around line 149, I added extra debugging commands around the curl_exec so that it looks like:
echo time() . " Making request<br/>";
print_r($ch);
echo "<br/>";
$content = curl_exec($ch);
echo time() . " Request complete!<br/>";
print_r($content);
exit;
All that's doing is reporting the time before the request, the request information, performing the request, and then reporting the time after the request is done. The output looks like:
1394821998 Making request
Resource id #151
1394822062 Request complete!
HTTP/1.1 200 OK Cache-Control: no-cache, .... <a lot more data returned here>
The key point is the difference in time, which is in seconds: 64
The request being made is only to get the user's ID from Google. Subsequent requests would have to be made to get that user's profile information (email, name, etc). At 1-minute a piece, multiple requests could easily add up to the multiple-minute sign-in time you're seeing.
Taking it one step further, I printed out the cURL stats, and below is the output:
Array (
=> accounts.google.com/o/oauth2/token
[content_type] => application/json; charset=utf-8
[http_code] => 200
[header_size] => 471
[request_size] => 512
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 64.296276
[namelookup_time] => 0.015591
[connect_time] => 63.135362
[pretransfer_time] => 63.166707
[size_upload] => 354
[size_download] => 1150
[speed_download] => 17
[speed_upload] => 5
[download_content_length] => -1
[upload_content_length] => 354
[starttransfer_time] => 64.295313
[redirect_time] => 0
[certinfo] => Array ( ) [redirect_url] =>
)
It may be hard to read, but the namelookup and download time looks right. The pretransfer_time is 63 seconds (which is pretty much the whole time). I'm not sure why it's taking that long. Some searching of Google indicates that SSL connectivity issues could be the problem (you're connecting to Google securely, which is a requirement). However, there's no bullet-proof solution.
I'm not sure what's causing the drastic delay you're seeing. The curl_exec call is a raw PHP function though. It's the lowest level call we can make, and there's nothing else in between those times that Joomla or JFBConnect is doing.
With all that said, it's definitely not an issue with JFBConnect directly. There is definitely some sort of server issue that is making cURL requests (or something lower level than cURL) perform very, very slowly. I hope this helps narrow things down for you. I've gone ahead and left the 8 lines I added to the curl.php file, though commented out, so that you can uncomment them and see the result for yourself if you'd like.
Hopefully, this helps get you somewhere. I'd recommend contacting your host to help diagnose from here since, as I said, that's the lowest level call in PHP and there's nothing we could do at a higher level to speed things up.
Thanks,
Alex