Notifications
Clear all

wpForo 1.x.x [Solved] hCaptcha Integration?

9 Posts
3 Users
3 Reactions
1,718 Views
Tutrix
Posts: 1491
(@tutrix)
Noble Member
Joined: 5 years ago

@ktalos

can you describe here what you have customized
that will help other users who also want to use hCaptcha

Posts: 14
Topic starter
(@ktalos)
Eminent Member
Joined: 2 years ago

Below is a description of what I did to get hCaptcha working on my site. These steps are accurate as of wpForo v1.9.9.1 

ALWAYS backup your original files before making any changes. This way if something goes sideways, you can always revert back to the original and try again.

 

REQUIRED TO MAKE IT WORK:

wpforo\wpf-includes\class-api.php
  1. Locate " https://www.google.com/recaptcha/api.js " (found at line 1159)
    Replace it with " https://js.hcaptcha.com/1/api.js "
  2. Locate "g-recaptcha-response"
    (there were two instances: one at line 1247 and the other at 1251)
    Replace them both with "h-captcha-response"
  3. Locate " https://www.google.com/recaptcha/api/siteverify " (found at line 1251)
    Replace it with " https://hcaptcha.com/siteverify "

In wpForo's settings area in the WP dashboard, enter and save your hCaptcha site key and secret key in the same fields as is done with reCAPTCHA.

 

NOT REQUIRED, BUT MAKES IT LOOK CONSISTENT:
Replace ONLY strings. For any search hits you get that are not strings - leave them as is. Do not change them. Look for verbiage such as "Google reCAPTCHA" or "reCAPTCHA" and also change the link from Google's reCAPTCHA site (line: 247 in "antispam.php") to hCaptcha's site. 

wpforo\wpf-admin\tools-tabs\antispam.php
wpforo\wpf-admin\xml\english.xml
wpforo\wpf-includes\class-api.php

I only looked at English language files. If you edited the files locally, then upload them back to your server.

Now go back to your browser and reload your wpForo login/register page. The hCaptcha function should now be visible and active.

Posts: 14
Topic starter
(@ktalos)
Eminent Member
Joined: 2 years ago

Below is a description of what I did to get hCaptcha working on my site. This time, instead of using a separate code editor, I used the WordPress Plugin File Editor. These steps are accurate as of wpForo v1.9.9.2

ALWAYS backup your original files before making any changes. This way if something goes sideways, you can always revert back to the original and try again.

 

REQUIRED TO MAKE IT WORK:

wpforo\wpf-includes\class-api.php
  1. Locate " https://www.google.com/recaptcha/api.js " (found at line 580)
    Replace it with " https://js.hcaptcha.com/1/api.js "
  2. Locate "g-recaptcha-response"
    (there were two instances: one at line 624 and the other at 626)
    Replace them both with "h-captcha-response"
  3. Locate " https://www.google.com/recaptcha/api/siteverify " (found at line 626)
    Replace it with " https://hcaptcha.com/siteverify "

In wpForo's settings area in the WP dashboard, enter and save your hCaptcha site key and secret key in the same fields as is done with reCAPTCHA.

 

NOT REQUIRED, BUT MAKES IT LOOK CONSISTENT:
Replace ONLY strings. For any search hits you get that are not strings - leave them as is. Do not change them. Look for verbiage such as "Google reCAPTCHA" or "reCAPTCHA" and also change the link from Google's reCAPTCHA site (line: 124 in "antispam.php") to hCaptcha's site. 

wpforo\wpf-admin\tools-tabs\antispam.php
wpforo\wpf-admin\xml\english.xml
wpforo\wpf-includes\class-api.php

I only looked at English language files. If you edited the files locally, then upload them back to your server.

Now go back to your browser and reload your wpForo login/register page. The hCaptcha function should now be visible and active.

Page 2 / 2