Project Link: https://www.drupal.org/sandbox/tikaszvince/2461325
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/tikaszvince/2461325.git hotjar
Module description:
Adds the Hotjar tracking system to your website.
Features
- add tracking code to specific pages,
- add tracking code to specific roles
What is Hotjar?
Hotjar is a new powerful way to reveal true website user behaviour and experiences in one central tool – giving you the big picture of how you can improve your site's UX and conversion rates. All your data is securely stored in the cloud and is accessible at lightning speed.
Manual reviews of other projects:
- https://www.drupal.org/node/2484351#comment-9908843
- https://www.drupal.org/node/2414741#comment-9908901
- https://www.drupal.org/node/2481473#comment-9908943
Manual reviews of other projects, Round 2:
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | 2015-05-18_2210.png | 88.78 KB | prajaankit |
Comments
Comment #1
csakiistvanComment #2
csakiistvanComment #3
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxtikaszvince2461325git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #4
andrdrx commentedManual review
Comment #5
novitsh commentedDid a manual review and I agree with comment #4 from @andrdrx.
Suggestion(s):
Storing these as a 'hotjar' array is more clean and bundled. It will also reduce the amount of DB calls.
A small question, in the part of 'not tracked status codes' I see the 403, 404 codes. Is this something you don't want to track? And if so, should it be general or do you want the user to be able to select what he tracks?
Bottomline: great and to-the-point module. Can't wait to see it approved!
Comment #6
tikaszvince commentedThank you the manual review @Novitsh and @andrdrx
And thank you the suggestion about storing the variables. We will apply this in the future.
About the "not tracked status codes": For now, we simply do not want to track the error pages. I like the idea to let the administrators set what type of error pages should be tracked.
Comment #7
vineethaw commentedHello,
In the hotjar.module file hook_help() is mentioned but the help link is not shown up in the module list page.
In Line no.23 case 'admin/config/system/hotjar': add the case 'admin/help#hotjar': also to provide help link
Comment #8
tikaszvince commented@vineethaw Thank you the review. I fixed this in 7.x-1.0-rc5.
Comment #9
aneek commentedAutomated Review
There is still a master branch, make sure to set the correct default branch: https://www.drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in https://www.drupal.org/node/1127732
-- Make this 7.x-1.x branch as the default branch.
Manual Review
Manual Reviews
hotjar_process_htmlfunction is it really needed to break the if condition in multiple lines?hook_preprocess_htmlto add the JavaScript? We can usehook_page_alter()and inside it can add a inline/file Javascript using#attachedordrupal_add_js().variable_get()calls. So while installing the module you can initialize those inhook_install()and while uninstalling the module you can remove these as well (which is good) inhook_uninstall().$account = $GLOBALS['user'];instead this, can't we useglobal $user;?I haven't done any security review as of now. Later will do it.
This review uses the Project Application Review Template.
Suggestion: If it's possible then please review other modules as well. If you complete at-least 3 module reviews then add the review comments in this page and add the tag "PAReview: review bonus" to this issue. This will help admins notice this module and will be promoted very early.
Comment #10
aneek commentedComment #11
tikaszvince commentedComment #12
tikaszvince commentedComment #13
tikaszvince commented@aneek Thank you the rewiew.
1. That condition is one of the most important part of the code. I think with breaking the condition into multiple lines improves the readability and it draws the attention.
2. I'd like the tracking code the very end off the page. I found this way the most efficient for this.
3. In 7.x-1.0-rc6 there is an update hook to merge these variables into one. Also we use this merged variable in settings form and hook_process_html too. We created an uninstall hook to remove hotjar variables on unistall too.
4. I just really don't like to use global.
Comment #14
klausiThank you for your reviews. When finishing your review comment also set the issue status either to "needs work" (you found some problems with the project) or "reviewed & tested by the community" (you found no major flaws).
manual review:
But otherwise looks good to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to stBorchert as he might have time to take a final look at this.
Comment #15
tikaszvince commented@klausi thank you the review.
Comment #16
stborchert@tikaszvince
regarding point 4: you can simply use array_filter() to remove all unselected roles here and then check if
$rolesis empty.Comment #17
tikaszvince commented@stBorchert @klausi
I changed that condition as you requested.
But let me ask you where I can find the instructions about using
empty()in the Coding standards?In the previous form of the condition (with using
array_sum()) there was a positive condition check, achieving with a single function call. In the current code a new variable has to be created and need two function calls to get the same result. Over and above the condition is using a negative approach. I believe, at that point of the code, for the easiest understanding that condition should use a positive approach.Comment #18
stborchertThe use of
empty()is not a coding standard, but usingarray_filter()is a best practice for this use case (processing the values of checkboxes).See user_role_change_permissions() as an example.
One minor note (just a personal taste ;) ):
This could be rewritten as follows (as far as I understand your code):
Comment #19
tikaszvince commented@stBorchert
Thank you the suggestion.
Comment #20
tikaszvince commentedComment #21
prajaankit commentedI am trying this module on my local host
I face the problem see the image
Comment #22
tikaszvince commented@prajaankit,
I don't think this exception caused by this module. The report says the system module cannot create a new record in system table.
From this error all I can think is previously you had a module called hotjar and you just replaced it with this one.
I tested the download, install, configure, uninstall process with Drupal 7.37 with minimal profile installation on PHP 5.2, PHP5.3 and PHP5.5 too and cannot reproduce this error.
Please try to clear the cache or just delete manually the hotjar record (but only that record) from system table. If the error don't disappear please create a new issue and describing your environment:
Comment #23
klausino other objections for more than a week, so ...
Thanks for your contribution, tikaszvince!
I updated your account so you can 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 stay 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.