blaenk / wp-recaptcha

I gave ownership of this project to Google many years ago
Other
38 stars 16 forks source link

avoid recaptcha conflicts #31

Open blaenk opened 13 years ago

blaenk commented 13 years ago

check to see if the recaptcha library is already loaded before loading it ourselves, perhaps something like

if (!function_exists('some_recaptcha_function')) { require_once('blah'); }

WraithKenny commented 12 years ago

There are WordPress functions that handle some functions of what recaptchalib.php does such as wp_remote_post():

$url = "http://www.google.com/recaptcha/api/verify";
$args = array(
    'body' => array(
        'privatekey' => $option[ 'private_key' ],
        'remoteip' => $_SERVER[ 'REMOTE_ADDR' ],
        'challenge' => $_POST[ 'recaptcha_challenge_field' ],
        'response' => $_POST[ 'recaptcha_response_field' ]
    )
);
$result = wp_remote_post( $url, $args );

Other functions in the library aren't tough to do. It's probably best to avoid the library at this point.

blaenk commented 12 years ago

Sounds reasonable.