Hello,

Rankingalive is a simple module I developed few weeks ago that provides integration with Rankingalive tool into Drupal.

This module has been tested and works well, so I think it's now time for it to live its own life as a module not anymore as a sandbox :p

Basics
This module is simple, it doesn't have that much code and similar to the google_analytics module, it adds a javascript to loads a tracking script into the page and the user can choose where to place the script (header/footer) and allow or deny urls on which adding the js. To see the tracking results the admin has to go on RankingAlive's website

Requirements
Project page: https://drupal.org/sandbox/JulienD/1841746
GIT clone: git clone --recursive http://git.drupal.org/sandbox/JulienD/1841746.git rankingalive
Pareview: http://ventral.org/pareview/httpgitdrupalorgsandboxjuliend1841746git
Drupal version: Drupal 7


I've read the project application checklist and validated each point.

Reviews of other projects :
http://drupal.org/node/1897876#comment-6983166
http://drupal.org/node/1919058#comment-7078770
http://drupal.org/node/1914020#comment-7079358

Comments

aendra’s picture

Status: Reviewed & tested by the community » Needs work

Automated review:
Review of the 7.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.


FILE: /var/www/drupal-7-pareview/pareview_temp/rankingalive.admin.inc
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
 54 | ERROR | If the line declaring an array spans longer than 80 characters,
    |       | each element should be broken into its own line
--------------------------------------------------------------------------------

Source: http://ventral.org/pareview - PAReview.sh online service

This is fixable by breaking that line into multiple lines, as follows:

    $description = t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.",
        array(
          '%blog' => 'blog',
          '%blog-wildcard' => 'blog/*',
          '%front' => '<front>',
        )
    );

Manual review:

  • ✓ README.txt -- Great documentation in the README. Minor nitpicks:
    • You have a superfluous space under the heading at ln. 12 col. 1.
    • ln. 57, col. 51 -- "copies"
  • ✓ rankingalive.test -- Nicely done with the tests. Tests are admittedly not my strong suit, but yours seem complete and well-documented.
  • ✓ rankingalive.module -- Looks good! I like that you explained how the $visibility var worked -- though maybe move that up into the function declaration block comment?
  • ✓ rankingalive.install -- Deletes all module variables on uninstall; displays module requirements (Configuration) on install.
  • ✓ rankingalive.admin.inc -- Looks good, apart from code style note above.
  • ✓ rankingalive.info -- No problems here.

Looks good to me. Fix those few incredibly minor nitpicks and you'll be on your way.

JulienD’s picture

Thanks Ændrew, for your code review and the time you gave to me

I've fixed those minor remarks and run Ventral again who found nothing. I don't know why but I was sure this coding error was a false positive for a watchdog.

I really like how you do your code review, I certainly will use it as a template for my reviews :p

aendra’s picture

Status: Needs review » Needs work

Hi JulienD!
Thanks for the note! Thinking about it, neither of those two issues really should've been blocking in the first place, and you've fixed them both already. That said, one other thing I've noticed in the meantime is that you print a variable on page and don't really sanitize it anywhere, beyond doing a trim() on ln. 121 in rankingalive.admin.inc. At some point you should do a filter_xss() or check_plain() on that variable (Probably the latter). All user input that gets put on page needs to be sanitized beforehand.

Didn't realize that FAPI text field attribute #default_value gets auto check_plain'd.

aendra’s picture

Status: Needs work » Reviewed & tested by the community

In light of my realization in #3, setting to RTBC.

klausi’s picture

Issue tags: +PAreview: security

manual review:

  1. rankingalive_permission(): at least the PHP execution permission needs to be marked as restrict access => TRUE, because a user can easily p0wn a site with that. See the hook_permission() documentation.
  2. rankingalive_page_alter(): all JS code should live in a dedicated JS file. You can use Drupal.settings to pass down variables from PHP to JS. See http://drupal.org/node/756722
  3. "protected function testRankingAlivePageVisibilityAllExcepted()": does this even work? I think all test methods need to be public?

The permissions issue is a security blocker. Make sure to review more project applications and complete the review bonus and this will get finished faster.

JulienD’s picture

Status: Needs review » Needs work

Thanks klausi for your review and for your time !

  1. I've set the "restrict access" param to TRUE. Besides the fact that will display a warning message, does this setting provides something else ? I know the risk to let user playing directly with PHP, that's why I had set the warning message in the permission's description, I didn't know about the 'restrict access' param.
  2. I've updated the module and placed the js script in a dedicated file.
  3. Yes it's working. Here is an other example with mollom (click on View source at the bottom)

I'm working on the bonus review :)

JulienD’s picture

Issue summary: View changes

Fixed broken link to project page

JulienD’s picture

Issue summary: View changes

added project review link

JulienD’s picture

Status: Needs work » Needs review
JulienD’s picture

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

Added the review bonus

klausi’s picture

Issue tags: +PAreview: security

Please don't remove the security tag, we keep that for statistics and to show examples of security problems.

klausi’s picture

Assigned: Unassigned » michelle
Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

rankingalive.js: this should use Drupal.behaviors, see http://drupal.org/node/756722

But otherwise looks RTBC to me now. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

Assigning to Michelle as she might have time to finally approve this.

JulienD’s picture

Thx Klausi for your time !

I've fixed the use of Drupal.behaviors commit

I just have to do 3 more reviews

jthorson’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution, JulienD!

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.

aendra’s picture

Congrats, JulienD!

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

Anonymous’s picture

Issue summary: View changes

Added module review link