The module offers an easy integration of daily sudoku puzzles into the site.

Major features in this version include:

  • The sudoku puzzles can be inserted everywhere in your posts and pages.
  • Seven different levels from simple to diabolic are available
  • Use pencilmarks by pressing ALT and Number key
  • they are daily updated (upto 10 history entries) sudokus and can be used as daily sudoku
  • You can change appearance, size and visible features
  • printable sudokus for offline esolving are available too

Link to git:
tomseidel@git.drupal.org:sandbox/tomseidel/1743022.git mypuzzle_sudoku

Drupal Version used for development is 7.1.5

Many thanks
Thomas

Comments

Milena’s picture

You 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.

Anks’s picture

Status: Needs work » Needs review

After Enable and put block at one of the sidebar i got this error.

Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.
Error 404

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.

Anks’s picture

Status: Needs review » Needs work
tomseidel’s picture

Hi 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

Anks’s picture

hi.. 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.

tomseidel’s picture

Status: Needs review » Needs work

Hi 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

Anks’s picture

Hey 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.

tomseidel’s picture

Status: Needs work » Needs review

Hi Anks,

changed README.txt and resolved all coding standard issues.

Thanks for you review again.

Thomas

schnitzel’s picture

Status: Needs review » Needs work

did 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

-

      if ($showtimer == "0" && $showprint == "0") {
        $iheight -= 20;
      }

please try to use boolean variables, so it would look like:

      if (!$showtimer && !$showprint) {
        $iheight -= 20;
      }

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

-

; Information added by drupal.org packaging script on 2011-04-19
core = "7.x"

this will be added automatically please remove it.

tomseidel’s picture

Status: Needs work » Needs review

Hi Schnitzel,

thank you for your detailed feedback. I change the following things accordingly:

  • I entered default values for the block_view so the user does not has to use the settings dialog first. The target php sets defaults anyway
  • implemented checkboxed for the Yes/No settings...even looks better
  • default for size should be int too, dont want drupal_map_assoc therefor
  • did put the other options in t()
  • changed the cache option to default 'BLOCK_CACHE_PER_ROLE'
  • added some _menu call documentation
  • changed to if clauses to be boolean
  • deleted the
    tag - CSS styles as options or themes might be for a later version
  • changed the camelcase in mypuzzle_sudoku_getRndAnchor but have no idea how to apply rand() and echex()
  • removed html from the README and explained options, and fixed the typo
  • removed the information from info-file
  • Many thanks
    Thomas

pnemes’s picture

Hi!

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)

tomseidel’s picture

Hi,
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

rob holmes’s picture

Hi 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.

tomseidel’s picture

Status: Needs work » Needs review

Hi there,

thanks for your feedback again.
So I fixed those minor things:

  • the configure in the .info
  • the link to rel nofollow
  • the fix font size
  • the typo in Very Hard

Would appreciate your final positive feedback.

Many thanks
Thomas

The Project Sandbox Page is:
http://drupal.org/sandbox/tomseidel/1743022

cubeinspire’s picture

Status: Needs review » Needs work

Minor 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

tomseidel’s picture

Title: MyPuzzle Sudoku » MyPuzzle Sudoku - preparing to launch

Hi Sergio,

thanks for your feedback. I'm just back from holiday.
So I hopefully fixed those errors:

  1. The configuration is now on the config/media level. Dont know how to create a games section here
  2. Fixed the coding standards
  3. Added the sandbox-link to my post before your answer
  4. Removed the reference to the themes
  5. Removed the random function all together
  6. Added translation to the later lines. Cant do that on the hook_menu entries

Thanks for your feedback again!

Thomas

cubeinspire’s picture

Status: Needs review » Needs work
Issue tags: +PAreview: security

1. You forgot to add the random function... that produces a fatal error.

function mypuzzle_sudoku_getrndanchor(){
	return rand();
}

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.

tomseidel’s picture

Status: Needs work » Needs review

Hi 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

51Degrees.mobi’s picture

Hi 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

tomseidel’s picture

Hi 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

petreej’s picture

Status: Needs review » Needs work

Hi 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

klausi’s picture

Status: Needs work » Needs review

Minor coding standard issues are surely no application blockers. Anything else?

darrenwh’s picture

Status: Needs review » Needs work

mypuzzle_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?

darrenwh’s picture

Issue summary: View changes

removed reference to themes

tomseidel’s picture

Status: Needs work » Needs review

Hi 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

DebtConsolidationCare’s picture

Status: Needs review » Needs work

Hi 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"

tomseidel’s picture

Status: Needs work » Needs review

Hi,

thanks. Absolutely make sense. I just added the requirement to the README.txt.
Anything else?

Thanks,
Thomas

likebtn’s picture

Manual 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:

  $bgcolor = variable_get('mypuzzle_sudoku_bgcolor', '#ffffff');
  if (!preg_match('/^[a-f0-9]{6}$/i', $bgcolor)) {
    $bgcolor = 'FFFFFF';
  }

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).

davidam’s picture

I'm finding a warning in your code:

Coder Sniffer has found some issues with your code (please check the Drupal coding standards).

FILE: /var/www/drupal-7-pareview/pareview_temp/mypuzzle_sudoku.module
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
38 | WARNING | Code after RETURN statement cannot be executed
--------------------------------------------------------------------------------
kscheirer’s picture

Status: Needs review » Reviewed & tested by the community

mypuzzle_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.

kscheirer’s picture

Title: MyPuzzle Sudoku - preparing to launch » [D7] MyPuzzle Sudoku
Status: Reviewed & tested by the community » Fixed

It 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.

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

added project link to top-level comment