Tether Stats is a module for tracking hits, clicks, and impressions over a JSON callback. As such, event data is only collected from Javascript enabled users.
Intended for intermediate to advanced Drupal users, Tether Stats provides a framework for tracking impressions and link clicks, in addition to page hits, by introducing special classes and attributes into your page HTML. The API also allows activity data to relate back to any type of Drupal entity such as a node or taxonomy term for simplified data mining.
See the project page:
https://www.drupal.org/sandbox/rzan/2329491
Git clone command:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/rzan/2329491.git
Reviews of other projects:
https://www.drupal.org/node/2395139#comment-9456999
https://www.drupal.org/node/2356849#comment-9459415
https://www.drupal.org/node/2396539#comment-9459565
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | coder-results.txt | 7 KB | klausi |
| #6 | screen.png | 74.19 KB | rashid_786 |
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxrzan2329491git
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 #2
rzan commentedSetting status back to "Needs review." All errors reported by the automated tools have been resolved.
Comment #3
myhemant commentedInstalled in drupal 7.32 showing
Notice: Undefined index: in charts_pre_render_element() (line 207 of /var/www/html/drupal/sites/all/modules/charts/charts.module).
Notice: Undefined index: in charts_pre_render_element() (line 207 of /var/www/html/drupal/sites/all/modules/charts/charts.module).
Notice: Undefined index: in charts_pre_render_element() (line 207 of /var/www/html/drupal/sites/all/modules/charts/charts.module).
Notice: Undefined index: in charts_pre_render_element() (line 207 of /var/www/html/drupal/sites/all/modules/charts/charts.module).
Notice: Undefined index: in charts_pre_render_element() (line 207 of /var/www/html/drupal/sites/all/modules/charts/charts.module).
Comment #4
dbt102 commentedhi @rzan
I’ve downloaded and installed your code and have conducted a manual review according to the review templete found at https://www.drupal.org/node/1587704 . My review comments are as follows…
1.1 Your application issue DOES contains a link to the project page and a working "git clone" command.
1.2 The realm of collecting site statistics in Drupal seems dominated by Google Analytics. Your sandbox page indicates the basic types of stats collected by Tether Stats includes Page Hits, Link Clicks, and Impressions. The impressions concept seems unique to this code, but I’m not an analytics expert.
1.3 I’ve checked for multiple application and see you only have this one project.
2.1 (+) I’ve cloned from your sandbox version control and that works OK. When I view the project directory however its named 2329491. This make it somewhat difficult, I’d suggest fixing that now to make it easier for other reviewers.
2.2 Git Status tells me that “Your branch is up-to-date with ‘origin/7.x-1.x’ “ which is good, you are using major version branches (e.g., 7.x-1.x, 6.x-1.x).
3.1 (+) I’ve checked for use of the t() function and find that it is only used once, in tether_stats.install, in the form of
// Ensure translations don't break during installation.
$t = get_t();
I’ve also checked your use of the database abstraction layer to avoid SQL injection attacks. I note that ‘db_select’ is used 6 times in tether_stats.module . To me this usage appears correct but I call it out for other reviewers expert in the use of the DB layer in Drupal to review more closely.
4.1 The repository does not contain a license.txt file.
4.2 (+) Tether_Stats, and Tether_Stats_Charts both include .js files which appear to have been authored by you? There is no associated licensing files tagged in or packaged with these, so is it right to assume this is NOT third party code?
If it is third party code, a dependency should be declared on Libraries and the .js files placed accordingly. If not, you may want to consider doing this anyways, but I don’t think its required by Drupal. IMHO, the way you are handing it now works best, if they are indeed your work.
I call this out explicitly because third party code is not generally allowed on Drupal.org and should be deleted. This policy is described in the getting involved handbook. It also appears in the terms and conditions you agreed to when you signed up for Git access, which you may want to re-read, to be sure you're not violating other terms.
The Libraries API module is a recommended method for adding 3rd party dependencies without directly including the code on drupal.org.
5.1 The Project pages are helpful and provide a clear way to understand what a project does.
5.2 The README.txt files in the package are very good!
5.3 Your code is well commented and clearly understandable by other developers. Very nice job on that!
6.1 Automated review is clean.
7.1 (+) In the Project description you indicate the capability to write and retrieve data to/from a third party db . When reading this data back in, it may be this is from an untrusted source? If so, are the proper checks in place to scrub the data and present it securely?
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
Please note that I've changing status back to needs work so you can respond primarily to the licensing question .
Comment #5
rzan commentedThank you very much for the feedback.
In response to Mr Sharma's issue, I believe what has happened is that a default chart library for the Charts module was missing. This is not a full dependency because either the Google or Highcharts libraries for the Charts module would be sufficient.
I did, however, add a test for the existence of a default library before rendering any of the pages with charting examples. Hopefully this resolves your issue. My apologies for missing it.
Now for everything else I'll go through all of the flagged items below:
2.1 - I'm still pretty new to contributing, but I think the project is locked in as a sandbox project until I pass a review. Once I pass, I can move the repository to a full project url with something other than the node-id, most likely "tether_stats."
3.1 - I've used the t() function in various places throughout the two modules. The pareview automated code review was pretty good in catching that. The install page in question was based on how other modules had built their install files. I didn't think the t() method was directly accessible during install which is why the wrapper was used. Is there a better way to go about doing it?
4.2 - All of the js files associated with the project were crafted by myself. There is absolutely no third party code which may be one of the advantages of this module. The main tether_stats.js file is not added using hook_library because it is only added to pages where stats data is being collected.
The Tether Stats Charts module makes use of third party chart solutions such as Google Charts, but that is all handled through the contributed Charts module.
7.1 - There may be a little confusion. This module has a number of subtle moving parts which I found challenging to get across. All it does is give you the option of using a separate database. The database would still have to be setup in your Drupal settings file just like any other database.
As Drupal others a nifty way of registering multiple databases, the Tether Stats module simply gives you the option of setting up shop in a registered db other than the default. There is no third party offering, the db would still be owned and maintained by the whoever was running the instance.
I understand this is an unusual option to provide. The tether_stats_activity_log table, however, can grow quite dramatically so for larger sites it might be prudent to separate your stats data from your Drupal site data. For the site I developed, we used the local database for Drupal and had an offsite AWS RDS for stats.
Thank you for all the nice comments. I know there is a plethora of stat modules out there but I do feel this project is unique. It is not intended to replace Google Analytics, but to augment it or other similar services. It is completely self-contained which should give developers greater control and security over their data.
Comment #6
rashid_786 commentedHi Rzan,
I installed module and go to configuration and click on "Tether Statistics" and then found following error.
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drawing.tether_stats_derivative' doesn't exist in menu_local_tasks() (line 1941 of C:\xampp\htdocs\janfence\includes\menu.inc).Please find the attached screen shot for your reference.
Comment #7
rashid_786 commentedComment #8
rzan commentedHi rashid_786,
Thanks for the screenshot. I've tried to replicate your issue but haven't had much success, my apologies. The db_select call in menu_local_tasks should be querying the 'menu_router' table so the problem has me perplexed.
I spun up another fresh Drupal 7 install but I didn't encounter the same issue. What version of Drupal were you using? I can only suspect it might have something to do with the hook_menu declarations but I don't see what it could be. Any additional clues might be a big help.
Comment #9
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #10
rzan commentedAlthough I couldn't isolate rashid_786's issue, I added a number of integrity checks which hopefully should help prevent such crashes from occurring in the future.
I would be grateful if anyone had any additional incite. It's been while, but I'm setting the project back to 'Needs Review' with these new updates.
Comment #11
zeeshan_khan commentedHi rzan,
I've download and installed your module, and found no issue the module is working fine to me so I am changing the status to fixed.
Best,
Zeeshan
Comment #12
klausiThen this should be RTBC instead.
Comment #13
rzan commentedHi zeeshan_khan and klausi,
Thank you! Such a prompt response. I'm looking forward to publishing my first project for the community and seeing who might be interested in this niche module.
Cheers,
Rust
Comment #14
zeeshan_khan commentedGreat!
get cool things going!!!!!!!!
Cheers!
Comment #15
rzan commentedComment #16
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).
Review of the 7.x-1.x branch (commit a02321e):
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.
manual review:
<script>alert('XSS');</script>then this will trigger a nasty javascript popup. Make sure to read https://www.drupal.org/node/28984 again.Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #17
rzan commentedHello klausi,
Thank you for your careful review. I know this is probably not the easiest module to go though. I have made several updates to correct the flaws you pointed out as seen below:
1. I have taken an even closer look at jStats and have updated the project page to hopefully help clarify why this module is different from the plethora of Drupal stats module. As in most cases, this module was developed out of need. While there is some overlap with jStats, Tether Stats does quite a bit more with the tracking of impressions, clicks, and the organization of data by entity and not a simple access log. jStats is important as a lightweight module for tracking page views where Tether Stats would cater to the data hungry custom Drupal sites.
2. I have taken your advice on this. The requirement has been removed, and the module itself has been significantly simplified. I did, however, leave the option of using an alternative database but the power users would be responsible for creating the tables themselves in that case.
3. Thank you for pointing this out. I understand the security implications here. There definitely should have been confirmation forms in place and I have added them there an in a couple of other places. My apologies.
4. I have made the change as requested.
5. You are right, this method definitely needed to be reworked. It went through several phases. I have broken it down with two helper methods so hopefully it should be clearer to read.
6. Thank you for pointing out this oversight. I think I have sanitized all of the vulnerable output. Hopefully there aren't any other security concerns.
Comment #18
klausiSorry for the delay. Make sure to review more project applications and get a new review bonus and this will get finished faster.
Review of the 7.x-1.x branch (commit e2db844):
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.
manual review:
But otherwise looks RTBC to me.
Assigning to heddn as he might have time to take a final look at this.
Comment #19
rzan commentedThank you klausi for the great input. You have a good eye.
No worries about the delay. I have been busy with other projects and I was working on a minor update for this module. I was going to add a few more reviews once I had a good opportunity.
Thanks again for the additional review:
1. You are right. I missed that and have since removed the outdated comment.
2. This was a remnant of the version prior to your initial review. It had slipped through the cracks and is no longer in use so I removed it.
3. Thank you. This was adapted from another project that didn't have translation concerns. I reviewed the entire code again and hopefully I have everything wrapped in a t() method where there should be.
4. Great tip! Thank you.
Comment #20
heddnThe starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
None of these are blockers though so...
Thanks for your contribution, rzan!
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.
Comment #21
rzan commentedThank you heddn!
I made some more clean-up changes today. Everyone has been very helpful during this process. I think I addressed most of your concerns above and learned from it.
With the charts_info() method, however, this method does exist but it is defined in the Charts module to which tether_stats_charts is dependent on. I figured it was best to integrate with the Charts module instead of rendering to Google Charts directly. Calling this method is necessary for the integration.
Thank you to everyone who took the time to review this module.
Comment #23
avpaderno