Skip to content

Port the NoCaptcha implementation of ReCaptcha from gh-5315 #5323

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

Closed
wants to merge 13 commits into from
Closed

Port the NoCaptcha implementation of ReCaptcha from gh-5315 #5323

wants to merge 13 commits into from

Conversation

nikosdion
Copy link
Contributor

Close gh-5315

Executive summary

This is a fork of the work done in gh-5315 by @nonumber to implement the new NoCaptcha feature of reCAPTCHA. Since the new noCAPTCHA API is incompatible with the parameters of the old reCAPTCHA implementation we have no implemented it as a new plugin called "Captcha-NoCaptcha". The same tests as gh-5315 apply to this PR.

Close gh-5315

# Executive summary

This is a fork of the work done in gh-5315 by @nonumber to implement the new NoCaptcha feature of reCAPTCHA. Since the new noCAPTCHA API is incompatible with the parameters of the old reCAPTCHA implementation we have no implemented it as a new plugin called "Captcha-NoCaptcha". The same tests as gh-5315 apply to this PR.
PLG_NOCAPTCHA_PUBLIC_KEY_LABEL="Site key"
PLG_NOCAPTCHA_PUBLIC_KEY_DESC="Used in the JavaScript code that is served to your users. See the plugin description for instructions on getting a site key."
PLG_NOCAPTCHA_PRIVATE_KEY_LABEL="Secret key"
PLG_NOCAPTCHA_PRIVATE_KEY_DESC="Used in the communication between your server and the ReCaptha server. Be sure to keep it a secret. See the plugin description for instructions on getting a secret key."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReCaptha ?? Shouldnt that be reCAPTCHA

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add you write it reCAPTCHA on line 6 and ReCaptha here
So it should be consistent and spelt correctly

@brianteeman
Copy link
Contributor

Great work - thanks - I made a few small comments on the english language file

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5323.

@nikosdion
Copy link
Contributor Author

@brianteeman I used the same capitalization as the reCAPTCHA plugin. Yeah, it's inconsistent with the product branding but I had two choices:

  • be inconsistent with Joomla!; or
  • be inconsistent with reCAPTCHA

Regarding index.html, it is not required by JED for third party extensions. The core plugins still have those files.

@brianteeman
Copy link
Contributor

The same caps but not the same spelling ;)

re index.html see #3788

On 4 December 2014 at 15:39, Nicholas K. Dionysopoulos <
notifications@github.com> wrote:

@brianteeman https://github.com/brianteeman I used the same
capitalization as the reCAPTCHA plugin. Yeah, it's inconsistent with the
product branding but I had two choices:

  • be inconsistent with Joomla!; or
  • be inconsistent with reCAPTCHA

Regarding index.html, it is not required by JED for third party
extensions. The core plugins still have those files.


Reply to this email directly or view it on GitHub
#5323 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

@waader
Copy link
Contributor

waader commented Dec 4, 2014

@test success! I tested with postgresql and mssql on the user registration form.

@@ -610,6 +610,7 @@ INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`
(449, 'plg_authentication_cookie', 'plugin', 'cookie', 'authentication', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(450, 'plg_twofactorauth_yubikey', 'plugin', 'yubikey', 'twofactorauth', 0, 0, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(451, 'plg_search_tags', 'plugin', 'tags', 'search', 0, 1, 1, 0, '', '{"search_limit":"50","show_tagged_items":"1"}', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(452, 'plg_captcha_nocaptcha', 'plugin', 'nocaptcha', 'captcha', 0, 0, 1, 0, '', '{"public_key":"","private_key":"","theme":"clean"}', '', '', 0, '0000-00-00 00:00:00', 0, 0),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shoundn't the theme be light instead of clean? The new API only supports light and dark

@peterlose
Copy link
Contributor

Could we perhaps include the data-type attribute?

@nikosdion
Copy link
Contributor Author

I fixed the language strings and the default theme. I am not sure what you mean regarding the data-type attribute @losedk

@peterlose
Copy link
Contributor

@nikosdion Cool!

Included a screenshot from the API documentation:
skaermbillede 2014-12-04 kl 17 20 47

Perhaps it could be a setting in the plugin?

@nikosdion
Copy link
Contributor Author

I think it shouldn't. We have not implemented it for the old reCAPTCHA plugin. Moreover –if I understand it correctly– Google will serve the correct type (image or audio) depending on the user's accessibility settings. I wonder if we have any people with impaired vision who can test it for us using their real world browser settings?

@peterlose
Copy link
Contributor

Point taken! :)

@brianteeman
Copy link
Contributor

@test Almost but there are issues with the captcha responsiveness which you can see if you use Isis and the testing data (or have anything in both left and right columns)

screen shot 2014-12-04 at 10 28 09

screen shot 2014-12-04 at 10 28 15

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5323.

@brianteeman
Copy link
Contributor

Correction - the old captcha plugin has the exact same issues. And as you;ve corrected the test I am marking this as a successful test

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5323.

@nikosdion
Copy link
Contributor Author

FYI @brianteeman the responsiveness is one part Google problem and one part Joomla! issue. If/when Joomla! switches to Bootstrap 3 this issue will go away. BS3 renders forms differently on extra small widths. Instead of having the label left and the fields to the right it moves the label on top of the fields and this fixes the layout.

@mbabker
Copy link
Contributor

mbabker commented Dec 4, 2014

Installed the plugin on developer.joomla.org, working fine.

@zero-24
Copy link
Contributor

zero-24 commented Dec 4, 2014

@nikosdion can you disable the CS stuff for the google lib and fix the CS stuff for the new file?

FILE: .../travis/build/joomla/joomla-cms/plugins/captcha/nocaptcha/nocaptcha.php
--------------------------------------------------------------------------------
FOUND 6 ERROR(S) AFFECTING 4 LINE(S)
--------------------------------------------------------------------------------
 31 | ERROR | Expected 2 spaces after the longest type
 31 | ERROR | Expected 2 spaces after the longest variable name
 69 | ERROR | Expected 2 spaces after the longest type
 71 | ERROR | Expected 2 spaces after the longest variable name
 86 | ERROR | Expected 2 spaces after the longest type
 86 | ERROR | Expected 2 spaces after the longest variable name
--------------------------------------------------------------------------------

See: https://travis-ci.org/joomla/joomla-cms/jobs/42998686

@zero-24
Copy link
Contributor

zero-24 commented Dec 4, 2014

@nikosdion i have add a CS PR to fix the issues: https://github.com/nikosdion/joomla-cms/pull/3

Fix CS for Port the NoCaptcha implementation of ReCaptcha from gh-5315
@nikosdion
Copy link
Contributor Author

Thank you! I just merged your PR.

```
FILE: .../travis/build/joomla/joomla-cms/plugins/captcha/nocaptcha/nocaptcha.php
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
 31 | ERROR | Expected 2 spaces after the longest type
 71 | ERROR | Expected 2 spaces after the longest variable name
--------------------------------------------------------------------------------
```

Sorry @nikosdion
@zero-24
Copy link
Contributor

zero-24 commented Dec 4, 2014

Thanks but it looks like i have missed two errors. https://github.com/nikosdion/joomla-cms/pull/4 Sorry @nikosdion

hmm looks like i have missed two errors
@nikosdion
Copy link
Contributor Author

There you go, merged :)

@zero-24
Copy link
Contributor

zero-24 commented Dec 4, 2014

thanks Travis is happy now 😄

@jessicadunbar
Copy link

Thank you! I tested it on developer.joomla.org and everything tested fine.

@nikosdion
Copy link
Contributor Author

Awesome! I guess we can set it RTC now that we have tested it on project property and Travis is happy? :)

@zero-24
Copy link
Contributor

zero-24 commented Dec 4, 2014

moving to RTC but i think @Bakual @phproberto @mbabker @dbhurley or others form the PLT need to accept it bevor we can merge this 😄

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5323.

@brianteeman
Copy link
Contributor

@nikosdion Can you correct the spelling mistake in the english as I commented on github. Once thats done I will set it RTC

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5323.

brianteeman and others added 2 commits December 4, 2014 22:30
Corrected spelling mistake
Update en-GB.plg_captcha_nocaptcha.ini
@jissues-bot jissues-bot added the RTC This Pull Request is Ready To Commit label Dec 4, 2014
@brianteeman
Copy link
Contributor

Thanks for merging that spelling correction

@infograf768
Copy link
Member

Why add deprecated strings in a new plugin?

@infograf768
Copy link
Member

@committer
a new line has to be added in en-GB.install.xml for the new plugin if merged in 3.4.0 beta

zero-24 and others added 3 commits December 6, 2014 11:22
Add the new language files to the install.xml & remove the not longer used lang strings
@nikosdion
Copy link
Contributor Author

@infograf768 Issues fixed thanks to @zero-24's speedy PR :)

@infograf768
Copy link
Member

Works great!
Looks like we are covered for all these languages;
https://developers.google.com/recaptcha/docs/language

@infograf768 infograf768 added this to the Joomla! 3.4.0 milestone Dec 7, 2014
@zero-24 zero-24 removed the RTC This Pull Request is Ready To Commit label Oct 14, 2015
@joomla-cms-bot joomla-cms-bot added the Language Change This is for Translators label Oct 14, 2015
@810 810 mentioned this pull request Nov 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Language Change This is for Translators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants