Re: Support Thread for Google reCAPTCHA
OK, for number 1 (having, again read the readme file provided by the plugin): Replace the line <?php echo recaptcha_get_html(); ?>, removing the other one. The default "style" without arguments is the light-colored one, which is the styling you want.
For the "emails not sending", a couple of questions:
1. Did your contact-us emails send before the change?
2. When you click the "send" button from the contact-us page, do you receive a message that the email has been sent?
3. Are there any myDEBUG*.log files present in your store's /logs directory? If so, try to send the contact-us message again and see if one is generated when you do that; post its contents if found.
4. What is the value for your store's Configuration->Email Options->Set "Contact Us" Email Dropdown List?
Re: Support Thread for Google reCAPTCHA
Thank you.
I will remove the original line <?php echo recaptcha_get_html($publickey, $resp->error,$request_type == 'SSL'); ?>
and will replace it with the line <?php echo recaptcha_get_html(); ?>
1. Yes, I have originally installed captcha plugin v.2.0 in 2012 and I have never had any problems with it since installation. I am reversing my files back to that version after each unsuccessful upgrade to Google captcha v.2. to allow customers to contact us and to register on the site.
2. When I am using the original version of the plugin (v.2.0 that operates) after I click on the send button, the contact form disappears and a message "your message has been successfully sent" appears instead. When I am sending a message after the upgraded plugin (v.3.2 for Google captcha v.2 upgrade) is installed, clicking on the send button does not produce anything - the form remains there with all fields filled in and no message of any kind (errors or success) appears. Of course, nothing arrives into the dedicated email address.
3. I have never used myDEBUG. I need your instructions on how to find it and how to use it.
4. I am using Numinix email configuration plugin and Configuration->Email Options->Set "Contact Us" Email Dropdown List is an empty text box with nothing in it.
Thank you again. I will try to upgrade again after I receive your reply to this message.
Re: Support Thread for Google reCAPTCHA
@epilot, thanks for the responses:
2. That implies to me that either there's an HTML validation or javascript/jQuery error preventing the submission of the form.
3. Look in your store's /logs directory (it's at the same "level" as your store's /includes directory) for files named myDEBUG*.log; they'll identify any PHP-related issues with the formatting.
4. I'd asked about that setting because some stores have been having issues when that value is improperly formatted.
Do you have a publicly-available link you could share (either via direct forum posting or sent to me via PM)?
Re: Support Thread for Google reCAPTCHA
Thank you for the reply. I will send you a link via PM.
Now that you identified the myDEBUG's location, I recall that have used it in the past when I had issues with the site. I have several logs available related to the captcha update dated March 1 and March 2. How to send them to you? Can I do it via PM as well?
Re: Support Thread for Google reCAPTCHA
Re: Support Thread for Google reCAPTCHA
@epilot, got your link. The captcha displayed looks like the older version. I was able to (I think) send you a test message, did you receive it?
Are you sure that you removed/replaced all the older captcha files with the updated version?
Regarding the debug-logs, find one that identifies an issue with the captcha and post its contents here, in the support thread, using "CODE" tags (the big # in the menu-bar when you write your reply).
Re: Support Thread for Google reCAPTCHA
@lat9 Got you test message, thank you. I had to reverse to the older version since the new version does not operate. Or you would not be able to send a test message.
I think I replaced all files of the older version. I read both READ ME files (for the original version and the version I am installing) and I saw that the new version should overwrite the older files as they have the same names.
Here is the debug file information.
Code:
[01-Mar-2018 17:05:13] PHP Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /includes/classes/observers/google/ReCaptcha/RequestMethod/Post.php on line 68
[01-Mar-2018 17:05:13] PHP Warning: file_get_contents(https://www.google.com/recaptcha/api/siteverify): failed to open stream: no suitable wrapper could be found in /includes/classes/observers/google/ReCaptcha/RequestMethod/Post.php on line 68
[01-Mar-2018 17:05:13] PHP Warning: implode(): Invalid arguments passed in /includes/classes/observers/google/ReCaptcha/Response.php on line 128
Re: Support Thread for Google reCAPTCHA
Since file_get_contents is not configured on your site for non-local files, you'll need to edit /includes/classes/observers/class.google_recaptcha.php. Find the section:
Code:
function update(&$class, $eventID, $paramsArray = array()) {
global $messageStack, $error, $privatekey;
require_once __DIR__ . '/google/autoload.php';
$recaptcha = new \ReCaptcha\ReCaptcha($privatekey);
// If file_get_contents() is locked down on your PHP installation to disallow
// its use with URLs, then you can use the alternative request method instead.
// This makes use of fsockopen() instead.
//$recaptcha = new \ReCaptcha\ReCaptcha($privatekey, new \ReCaptcha\RequestMethod\SocketPost());
// This makes use of curl instead
//$recaptcha = new \ReCaptcha\ReCaptcha($privatekey, new \ReCaptcha\RequestMethod\Curl());
$resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
if (!$resp->isSuccess()) {
$event_array = array('NOTIFY_CONTACT_US_CAPTCHA_CHECK' => 'contact', 'NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK' => 'create_account', 'NOTIFY_REVIEWS_WRITE_CAPTCHA_CHECK' => 'review_text');
$messageStack->add($event_array[$eventID], $resp->getErrors());
$error = true;
}
return $error;
}
and change that as below, adding comments before the one line and removing the comments (//) from the other
Code:
function update(&$class, $eventID, $paramsArray = array()) {
global $messageStack, $error, $privatekey;
require_once __DIR__ . '/google/autoload.php';
// $recaptcha = new \ReCaptcha\ReCaptcha($privatekey);
// If file_get_contents() is locked down on your PHP installation to disallow
// its use with URLs, then you can use the alternative request method instead.
// This makes use of fsockopen() instead.
//$recaptcha = new \ReCaptcha\ReCaptcha($privatekey, new \ReCaptcha\RequestMethod\SocketPost());
// This makes use of curl instead
$recaptcha = new \ReCaptcha\ReCaptcha($privatekey, new \ReCaptcha\RequestMethod\Curl());
$resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
if (!$resp->isSuccess()) {
$event_array = array('NOTIFY_CONTACT_US_CAPTCHA_CHECK' => 'contact', 'NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK' => 'create_account', 'NOTIFY_REVIEWS_WRITE_CAPTCHA_CHECK' => 'review_text');
$messageStack->add($event_array[$eventID], $resp->getErrors());
$error = true;
}
return $error;
}
Re: Support Thread for Google reCAPTCHA
Thank you, lat9.
I will do what you suggested above and make another upload and then report in here.
Re: Support Thread for Google reCAPTCHA
Thank you very much for your help, lat9. It works in both "contact us' and 'create account'.
Could you please send me your information via PM on how to engage your services once Zen Cart v.1.6 is coming out.
Thank you again.