-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Create a single reCaptcha plugin for both versions. #5888
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
Conversation
@test Works fine. Old version:New version: |
showon="version:2.0" | ||
filter=""> | ||
<option | ||
value="light">PLG_RECAPTCHA_THEME_LIGHT</option> |
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.
Could you fix the spacing here? :)
Typo: testing now. |
@@ -7,16 +7,22 @@ PLG_CAPTCHA_RECAPTCHA_XML_DESCRIPTION="This CAPTCHA plugin uses the reCAPTCHA se | |||
PLG_CAPTCHA_RECAPTCHA="Captcha - ReCaptcha" |
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.
CAPTCHA - reCAPTCHA
As defined in style guide
I suggest to make it clearer that the new version (Version2 ?) does NOT accept Global keys. |
I agree with with @infograf768 Perhaps |
@test Success 👍 In detail:
Tested with front-end user registration and com_contact. |
@test Just needs the improvements for the versions and we can merge, as we freeze langs tomorrow |
Seems a bit weird that version 2.0 is the 'Recommended version.', but version 1.0 is the default active one. |
Thanks for testing everybody. I have updated the language files and believe they are good now. |
@nonumber Having read the past discussions, this strange default value seems to spring from the need to have a continuity for people using global keys. Version 2 API doesn't support global keys. If version 2 was the default, sites using global keys upgrading to Joomla! 3.4 would no longer have a functioning ReCAPTCHA misleading users into believing that Joomla! 3.4 is "broken". I'm not a fan of this default value either, but it's the only compromise solution to cater for the people who don't read the release notes, i.e. virtually everybody using Joomla!. |
OK for me @nonumber |
Indeed that 1.0 is the default value, only reason is for backwards compatibility reasons. Those using global keys would on update have a broken reCAPTCHA. This way we ensure that keeps working. |
|
||
; Params | ||
PLG_RECAPTCHA_VERSION_LABEL="Version" | ||
PLG_RECAPTCHA_VERSION_DESC="Version 1.0 is required if using Global CAPTCHA keys. Version 2.0 is the recommended version." |
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.
Being picky I think it's worth saying deprecated Global CAPTCHA keys
to make it clear it's google not allowing these keys which is why we cannot accept them
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.
Agreed but it MUST say reCAPTCHA not CAPTCHA
reCAPTCHA is the service from google. CAPTCHA is the generic name
Updated the strings again :) |
|
||
; Params | ||
PLG_RECAPTCHA_VERSION_LABEL="Version" | ||
PLG_RECAPTCHA_VERSION_DESC="Version 1.0 is required if using deprecated Global reCAPTCHA keys. Version 2.0 is the recommended version." |
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.
Sorry to be a PIA
Can you switch the order
+PLG_RECAPTCHA_VERSION_DESC="Version 2.0 is the recommended version. Version 1.0 is required if using the deprecated Global reCAPTCHA keys. "
@@ -36,12 +46,13 @@ | |||
size="50" /> | |||
|
|||
<field | |||
name="theme" | |||
name="theme1" |
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.
You can't rename the existing parameter as it would break the plugin for updating users who selected a custom theme. Just leave that as theme
and change the code to fit. The new param for v2 is fine with theme2
.
Can we show a deprecated warning in the module parameter view when v1 is selected or the version param is not yet saved? Could be done simple with a dummy formfield above the version field and the |
@Bakual Thanks on the theme parameter. It's fixed now. As for showing the message, that is fine by me. Just need to know what the text needs to be :) |
case '1.0': | ||
$theme = $this->params->get('theme', 'clean'); | ||
|
||
$server = self::RECAPTCHA_API_SERVER; |
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.
No biggy, but to make it more in line with the code for v2:
$server = $app->isSSLConnection() ? self::RECAPTCHA_API_SERVER : self::RECAPTCHA_API_SECURE_SERVER;
Or even just remove these global vars and do:
$file = $app->isSSLConnection() ? 'https' : 'http';
$file .= '://www.google.com/recaptcha/api/js/recaptcha_ajax.js';
JHtml::_('script', $file);
@nonumber Thanks for the suggestion, I have cleaned up the code per your suggestion. |
Nice |
Would need input from @brianteeman, but I would do something like "You have selected the deprecated version of this plugin. It's recommended to select version 2. Make sure you have supported keys for that version before switching." |
Displaying a message is good but I think the tone and meaning of that proposed text is not right. I think it needs to say something like |
|
||
; Params | ||
PLG_RECAPTCHA_VERSION_1_WARNING_LABEL="You have selected Version 1. All new sites should be using Version 2. Version 1 is only maintained to provide support for Global Site keys which are no longer available from Google." |
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.
@roland-d @brianteeman I think we should use also here Version 1.0
and Version 2.0
or not?
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.
Technically both would be wrong.
On 26 Jan 2015 17:53, "zero-24" notifications@github.com wrote:
In administrator/language/en-GB/en-GB.plg_captcha_recaptcha.ini
#5888 (comment):; Params
+PLG_RECAPTCHA_VERSION_1_WARNING_LABEL="You have selected Version 1. All new sites should be using Version 2. Version 1 is only maintained to provide support for Global Site keys which are no longer available from Google."@roland-d https://github.com/roland-d @brianteeman
https://github.com/brianteeman I think we should use also here Version
1.0 and Version 2.0 or not?—
Reply to this email directly or view it on GitHub
https://github.com/joomla/joomla-cms/pull/5888/files#r23549545.
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.
Oops my mistake the api is indeed 1.0 and 2.0 I had thought they were higher numbers
Is it all good now or do we need more language updates? |
All good to me - thanks |
Thanks for testing and review moving to RTC based on various tests. Thanks! This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5888. |
Thanks. Merged after correcting also the installation sql files and en-GB.install.xml |
I want to work on it for Joomla but I am too late. 😔 Still I have submitted new plugin on JED for reCaptcha2. |
This PR removes the noCaptcha plugin and merges it with the reCaptcha plugin. This way we have 1 reCaptcha plugin capable of using both the old and new keys depending on selected version.
Testing
To test, use reCaptcha version 1.0 with global keys and specific keys, all should continue to work as-is.
Also test version 2.0 with the new keys and you should get the new reCaptcha. The new keys also work with version 1.0.
After selecting the reCaptcha version, putting in the keys and selecting a theme. Check if the reCaptcha works on the front-end of the site.