Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Aug 2012 at 20:29 UTC
Updated:
4 Jan 2014 at 02:24 UTC
Jump to comment: Most recent
Comments
Comment #1
Milena commentedYou did not put a link to your project page.
While waiting for manual review please fix issues found in automated review:
http://ventral.org/pareview/httpgitdrupalorgsandboxtomseidel1743022git
What's more consider participating in Review bonus to get your application reviewed sooner.
Comment #2
Anks commentedAfter Enable and put block at one of the sidebar i got this error.
So the main functionality is not working..!!
Manual Review :
1. You can not use t() at the hook_menu.
2. There are lots of spacing issue are there. So make it as drupal standard.
eg. space after comma , Use an indent of 2 spaces, with no tabs.
Comment #3
Anks commentedComment #4
tomseidel commentedHi Anks,
can you please help me here. Its working properly on my installation. I used the content (the side wont be large enough anyway).
Do you see the options dialog? Have you maybe tried to change a setting!? How can I find out, why its not running on your install?
It should look like the screen attached.
Many thanks
Thomas
Comment #5
Anks commentedhi.. Thomas
I got the issue whenever i set size equals to "default" from the setting page it is working fine.. But when i changes it to large it will throws errors.
Comment #6
tomseidel commentedHi Anks,
thanks for testing and your reply. Found the typo and also removed the t() on the menu hook, as well as redundant spacings.
Something else I should adjust!?
Thanks,
Thomas
Comment #7
Anks commentedHey Thomas..
- Your readme.txt file should README.txt
There are still some issues..
You can find automated review from this link
http://ventral.org/pareview/httpgitdrupalorgsandboxtomseidel1743022git
Hope this will help you to solve issues..
Note- Dont forget to change status "needs review", when you want to make review of your module.
Comment #8
tomseidel commentedHi Anks,
changed README.txt and resolved all coding standard issues.
Thanks for you review again.
Thomas
Comment #9
schnitzel commenteddid some review of the code:
System Settings Form
- you don't provide default settings in your variables, which would lead that the user of this module has to configure the module first. Because the settings are not so super important to use the sudoku. You should provide default variables. So the User can enable the module, but the block somewhere and directly use it.
- If you have only 2 possible selections in a select field you should use radiobuttons (usability), or why you don't use checkboxes directly? would make it easier.
- In the field "mypuzzle_sudoku_size" you are using options with no keys, so drupal uses the default and later you do some crazy stuff with intval(). Why all this? See http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.ht... you can define return values for the options and then directly check for this return value in the mypuzzle_sudoku_block_view()
- Options Arrays values whould be put in t() for translation
mypuzzle_sudoku_block_view
-
please try to use boolean variables, so it would look like:
which makes it much more easy to understand.
- don't put any html code in the block directly, ether use an theme function or a template.
-
<div align='center'>themer will hate you for this ;) don't put layouting into the html code directly, use classes and CSS so it can be overridden.mypuzzle_sudoku_getRndAnchor
- no camelcase in function names see http://drupal.org/coding-standards#naming
- why do you need this overall? I'm not sure about modules on drupal.org which have link to external sites and don't have a nofollow link. This sounds for me like Keyword stuffing?
-
$md5str = strtolower(substr(strval(md5(strtolower($_SERVER['HTTP_HOST']))), 0, 1));oha! if you need this why you dont use rand() and echex()mypuzzle_sudoku_block_info
why DRUPAL_NO_CACHE? this would lead into loading the block all the time, which is bad for performance, so caching would make it faster
mypuzzle_sudoku_menu
- Implementation documentation missing, see: http://drupal.org/node/1354#hookimpl
readme.txt
- don't put HTML in there
- typo:
4. Enjoy the Pluing on pages using that block- if you mention the settings, try to explain them
mypuzzle_sudoku.info
-
this will be added automatically please remove it.
Comment #10
tomseidel commentedHi Schnitzel,
thank you for your detailed feedback. I change the following things accordingly:
Many thanks
Thomas
Comment #11
pnemes commentedHi!
I installed you module, and it works correctly.
Only a few little things:
- When enable the module, first i must to go to admin page and setup something, because without this, the game didnt appear.
(there is some default value problem). After saving, everything appears and works correctly
- You should check you coding with pareview, it finds a few error.
- The pareview can't find it, but there is still a problem: you have a whitespace before <?php in the first row of the .module file.
It can cause a few serious problems on sites with a lot of installed modules. (I experienced it very often)
Comment #12
tomseidel commentedHi,
thanks for your feedback!
I found the default error on the show print and fixed it.
Also I removed the leading blank before the <?php thanks
Thanks for testing again!
Thomas
Comment #13
rob holmes commentedHi there, just spotted a few minor things that i've listed below.
Manual Review
Could do with a configure = admin/settings/mypuzzle_sudoku in the .info file
Not too keen on the credit links attached to each sudoku, these could be optional and should definately include the rel="nofollow" tag.
You have hard coded 'font-size: 10px' in a style tag, this makes it a pain to override for themers.... maybe a tag instead, or give it a class so that it can be targeted.
Use the l() function to create links instead of writing the markup directly.
You have created 7 variables, might it be better to create just 1 and set '#tree' = TRUE using the FAPI to keep all the settings in one place.
line #176 t("VeryHard") missing space.
Comment #14
tomseidel commentedHi there,
thanks for your feedback again.
So I fixed those minor things:
Would appreciate your final positive feedback.
Many thanks
Thomas
The Project Sandbox Page is:
http://drupal.org/sandbox/tomseidel/1743022
Comment #15
cubeinspire commentedMinor problems
1. The config page is on the root level of the admin menu, it would be more user friendly to put it on a sublevel (under configuration for example)
2. You still have code standard problems. See: http://ventral.org/pareview/httpgitdrupalorgsandboxtomseidel1743022git
3. You should really add your project sandbox page on this issue by editing it... otherwise reviewers could pass this module as they cannot easily find the needed information.
4. On the project description it sais that I can show the sudokus on the theme files. Maybe you should explain better or remove that part.
Other Issues
5. mypuzzle_sudoku_getrndanchor().
If you want to get a random item of the array, why dont use the php function rand() ?
http://be2.php.net/manual/fr/function.rand.php
6. Line 23, 24, 160 and 161. There are texts not translated. Use t() for that.
Check also other strings shown to the users without translation.
The rest looks good to me.
I'm following this module, change those things and I set it as RTBC next week.
You can also apply to the review bonus to get a faster answer from administrators.
Regards,
Sergio
Comment #16
tomseidel commentedHi Sergio,
thanks for your feedback. I'm just back from holiday.
So I hopefully fixed those errors:
Thanks for your feedback again!
Thomas
Comment #17
cubeinspire commented1. You forgot to add the random function... that produces a fatal error.
2. The variables are created but not deleted.
You should create an install file to delete those variables using variable_del().
3. There is a security issue here. this is vulnerable to XSS exploits. Variables are user provided input and need to be sanitized before printing into HTML. See http://drupal.org/node/28984 . Please also check the other variables used in this function and whether the field content has been sanitized already or not.
Putting this on the background value:
'></iframe><script>alert('hello');</script>Shows an alert.
Comment #18
tomseidel commentedHi there,
I removed the random function. (1)
created an install scriped to uninstall the variables (2)
and added specific checks for each input variable before rendering them in html (3).
I choosed to do that not with check_plain() but speifically, because I know the expected content.
Thanks for your review again.
Thomas
The Project Sandbox Page is:
http://drupal.org/sandbox/tomseidel/1743022
Comment #19
51Degrees.mobi commentedHi Thomas,
It seems a lot issues have been addressed and I had no problems while testing, although I did notice a few issues -
1) Some of the code has over 80 characters per line. I don't think this is a strict requirement of Drupal but it will neaten up your module file.
2) There's a typo in your description (embeded rather than embedded).
3) I wasn't able to trigger any kind of scripting from user inputs, although non-numeric data can still be put into the cells and rendered if pasted in - perhaps someone with greater knowledge of XSS can verify if this a problem that can be exploited.
Thanks,
Tom
Comment #20
tomseidel commentedHi there,
I fixed the typo on 2)
Regarding 3) I guess my regex expression for checking the color hex code should be fine.
Would appreciate a finalization for the first version.
Thanks, Thomas
Comment #21
petreej commentedHi Thomas,
I had no problems while testing your module, but did notice that PAReview did come back with a couple errors:
FILE: /var/www/drupal-7-pareview/pareview_temp/mypuzzle_sudoku.module
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
41 | ERROR | Case breaking statements must be followed by a single blank line
42 | ERROR | Line indented incorrectly; expected 4 spaces, found 6
--------------------------------------------------------------------------------
It would also be nice if the project link was included at the top of this page with the Issue Summary.
Regards,
Pete
Comment #22
klausiMinor coding standard issues are surely no application blockers. Anything else?
Comment #23
darrenwh commentedmypuzzle_sudoku_menu()
Just needs to say Implements hook_menu()
you do not need to re comment parameters
mypuzzle_sudoku_block_view() $block not defined/initiated as array
Perhaps return array('content'=>$content); ?
mypuzzle_sudoku_block_view()
perhaps use some theaming and a template placing markup in there?
Comment #23.0
darrenwh commentedremoved reference to themes
Comment #24
tomseidel commentedHi Pete, Klausi, Darren... thanks for your feedback again.
- fixed the code formatting spaces
- adjusted the hook_menu header comment
- fixed the uninitialized variable $block
The themeing is something I will add in a second version. As well as more language support.
Just want to get the first version online first to get some user feedback.
Anything else? Are we read to go?
Thanks
Thomas
Comment #25
DebtConsolidationCare commentedHi Thomas,
I found your current code in the module really clean and easy to read.
But, in the README.txt file I think you should add a line under REQUIREMENTS section.
You can add as follows:-
-- REQUIREMENTS --
* Client machine should be able to access http://mypuzzle.org
As per my manual review of 'mypuzzle_sudoku' module, what it does is, it defines a drupal block and puts an iframe linked to
http://mypuzzle.org/sudoku/sudoku_plugin.php with various GET parameters set as configured from settings.
So, the whole functionality of this module is dependent on "Accessibility of the client machine/browser to mypuzzle.org site"
Comment #26
tomseidel commentedHi,
thanks. Absolutely make sense. I just added the requirement to the README.txt.
Anything else?
Thanks,
Thomas
Comment #27
likebtn commentedManual review:
1. mypuzzle_sudoku.module:
- mypuzzle_sudoku_help(): what about formatting "mypuzzle.org" as a link:
return '<p>' . t("Includes a mypuzzle.org 9x9 Sudoku on your drupal site or blog.") . '</p>';- mypuzzle_sudoku_help(): what about using t() for
$content .= "<div><a href='http://mypuzzle.org/sudoku/' rel='nofolllow'>Sudoku</a> by mypuzzle.org</div>";- line 88:
If admin enters "AAA" as color he will see white background, as "AAA" is not passing the validation. What about using validation for the admin form: http://drupal.org/project/fapi_validation (see regexp).
Comment #28
davidam commentedI'm finding a warning in your code:
Comment #29
kscheirermypuzzle_sudoku_block_view() is crazy! I'm not sure what you're setting up there, but try and refactor this into some simpler functions that make clear what you're calculating.
This and the notes above are fairly minor, RTBC from me.
Comment #30
kscheirerIt appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
You should also use a theme function to generate the output on mypuzzle_sudoku_block_view() - this will allow users to override the block content to their liking.
Neither issue is a blocker though, so...
Thanks for your contribution, tomseidel!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
----
Top Shelf Modules - Enterprise modules from the community for the community.
Comment #31.0
(not verified) commentedadded project link to top-level comment