rodrigoprimo / social-connect

WordPress plugin for signup/login using social media providers.
http://wordpress.org/extend/plugins/social-connect/
GNU General Public License v3.0
73 stars 40 forks source link

Implementing WP_Http #14

Closed rmathis closed 10 years ago

rmathis commented 12 years ago

In order to get around a proxy server and allow SC to work, I implemented a change in the utils.php.

I would highly recommend you include this in a future release, as it uses Wordpress' built-in http request object instead of curl, which also allows you to define Proxy constants in wp-config.php to use proxy servers.

function sc_curl_get_contents( $url ) { /* $curl = curl_init(); curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $curl, CURLOPT_URL, $url ); curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );

curl_close( $curl );

*/

if( !class_exists( 'WP_Http' ) )
    include_once( ABSPATH . WPINC. '/class-http.php' );

$request = new WP_Http;
$result = $request->request( $url );
$html = $result['body'];

return $html;

}

Thanks, Ryan Mathis

rodrigoprimo commented 10 years ago

Care to open a PR?

Thanks