-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recaptcha invisible #16599
Recaptcha invisible #16599
Conversation
}); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
element = element.parentNode; | ||
} | ||
while (element.nodeName != 'FORM'); | ||
element.addEventListener('submit', function(event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't make functions within a loop.
|
||
window.sentForm.submit(); | ||
delete window.sentForm; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
}); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
element = element.parentNode; | ||
} | ||
while (element.nodeName != 'FORM'); | ||
element.addEventListener('submit', function(event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't make functions within a loop.
|
||
window.sentForm.submit(); | ||
delete window.sentForm; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
@@ -33,6 +34,11 @@ PLG_RECAPTCHA_SIZE_LABEL="Size" | |||
PLG_RECAPTCHA_SIZE_DESC="Select the size for the reCAPTCHA field." | |||
PLG_RECAPTCHA_THEME_NORMAL="Normal" | |||
PLG_RECAPTCHA_THEME_COMPACT="Compact" | |||
PLG_RECAPTCHA_BADGE="Reposition the reCAPTCHA badge" | |||
PLG_RECAPTCHA_BADGE_DESC="Reposition the reCAPTCHA badge. 'inline' allows you to control the CSS." | |||
PLG_RECAPTCHA_BADGE_BOTTOMRIGHT="Bottomright" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bottom right, two words
PLG_RECAPTCHA_BADGE="Reposition the reCAPTCHA badge" | ||
PLG_RECAPTCHA_BADGE_DESC="Reposition the reCAPTCHA badge. 'inline' allows you to control the CSS." | ||
PLG_RECAPTCHA_BADGE_BOTTOMRIGHT="Bottomright" | ||
PLG_RECAPTCHA_BADGE_BOTTOMLEFT="Bottomleft" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bottom left, two words
I have tested this item ✅ successfully on 9debe28 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16599. |
General question: Are you sure you want to add this to the current recaptcha plugin instead of creating a new one? It has a slightly different API + markup + other JS include (so we have a lot if else now) .. Not sure if it's worth it, but personally i have the feeling that having two plugins would make people's life easier. |
@yvesh To create a new plug-in, you need to make changes to all the templates that use captcha |
I think it is OK to do it in this plugin, for the end user it is just another version they can select. For J4 we could decide to drop V1, is anybody still using that is something we can wonder. Edit: When I created the invisible key, I can't even create a version 1 key anymore. |
@kernusr All is working fine, the only thing I have a question about is how things are rendered. With the icon set to the right or left bottom it looks like this: We have a Captcha field with a * that it is required and that may look confusing. I guess when we render the invisible captcha we shouldn't show the captcha field at all. |
Version 1.0 of the reCAPTCHA API is no longer supported, please upgrade to Version 2.0. No more reCaptcha 1.0 so we can drop that I guess, it only leads to problems if that option does not function. thanks for this PR and the people that made an effort to test it This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16599. |
Version 1 is not supported but still works So if you had used wildcards and we remove support for v1 we break captcha on that site and they will need to get a new key for each domain |
I completely agree with @brianteeman . At the moment, many people continue to use ReCaptcha v1 and disabling this feature will lead to problems in the operation of sites. |
I will try to solve this problem in the near future |
We can't remove Version 1 now anyway because that would be a B/C break :) Having the discussion on where it is going is good.
Good. Let me know and I will test again. |
Quote from developers.google.com:
Google will no longer support ReCaptcha 1 and strongly recommends that you upgrade keys to reCaptcha 2. Why should we leave compatibility with a product that is no longer being accompanied? |
I would go via a postinstall and not a message like the PHP one as not all sites uses this catcha and also not all of them use version 1. But i think this sould be a different issue. Can you open a new issue for that? I think i can build a postinstall for that issue than. And we can focus here on the catcha v3 ;) |
If this PR get no Response, it will be closed at 17th September 2017. |
@kernusr Do you have time to follow up on this? |
This should not be closed since we have many requirements from users on the forums for this patch |
That is why I asked if @kernusr is going to follow-up. If not, I can redo the patch. |
element = element.parentNode; | ||
} | ||
while (element.nodeName != 'FORM'); | ||
element.addEventListener('submit', function(event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to hide the captcha field from the form (and just have the badge on the right or left bottom), we could add, in the if (widgetId !== ''):
if (item.getAttribute('data-badge') == 'bottomright' || item.getAttribute('data-badge') == 'bottomleft') {
var bloc = element.parentNode.parentNode;
bloc.style.margin = '0';
if (bloc.hasChildNodes()) {
bloc.children[0].style.display = 'none';
}
}
as this got Response Status is set on "Discussion". This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16599. |
Hi - this seems a good feature to implement :) |
no update with this? |
Sounds great |
@roland-d Do you have time to redo this PR? Thanks. |
Why should we redo this PR? We have #18146 |
I agree, let's keep this in 1 PR and the other PR also makes it a standalone plugin which seems to be way to go. |
Pull Request for Issue # .
Summary of Changes
Added invisible captcha on plg_captcha_recaptcha
Testing Instructions
2.1. Insert your public and private keys
2.2. Select the Invisible version of catcha
2.3. Chose any of reposition the reCAPTCHA badge
(plagin setings http://joxi.ru/n2YVXzYUXBLOA6)
Tested it on frontend!
Expected result
If you fill out the form manually and press "send" - captcha recognizes the person in you and allows sending. You will see a message about the successful sending of the form http://joxi.ru/EA4Z4paiLydbmb
To capture the robot in you, execute this code several times in the browser console
jQuery('#display-form').collapse('show'); var form = document.getElementById('contact-form'), inputCollection = form.getElementsByTagName('input'), inputCount = inputCollection.length; for(var i = 0; i < inputCount; i++){ item = inputCollection[i]; if(item.type == 'text'){ item.value = "blah-blah-blah"; } else if(item.type == 'email'){ item.value = "blah@blah.blah"; } else if(item.type == 'checkbox'){ item.checked = true; } else{ continue; } } var textareaCollection = form.getElementsByTagName('textarea'), textareaCount = textareaCollection.length; for(var i = 0; i < textareaCount; i++){ item = textareaCollection[i]; if(item.id === 'g-recaptcha-response') continue; item.value = "blah_blah_blah"; } form.submit();
If everything is done correctly, you will see an error message http://joxi.ru/8An9b03sYQqx2O
After several unsuccessful attempts, try sending the form manually. Captcha will show suspicion to you
http://joxi.ru/YmE03kqHdxnWr6
Thanks!