Description of module:
A simple module that tracks each time a user logs in and stores a historical record in your database. This data is then exposed to views so you can report on it if required.
Sandbox page: https://drupal.org/sandbox/leewillis77/2288283
Git repo: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/leewillis77/2288283.git login_tracker
Comparison with other similar modules
https://drupal.org/project/login_history - Logs more information than is necessary. Doesn't have views integration currently (There was a proposed patch, but that's been sat for 2 years with no real traction).
https://drupal.org/project/login_activity - Logs more information that is necessarily required, and is planning more. Has additional dependencies which aren't necessary for simple statistical tracking. No views integration (currently) although that is on the roadmap.
This module
- Stores simplest amount of data by default (UID & timestamp)
- Has permissions to provide coarse grained control over which logins are tracked
- Has hooks to allow implementation of fine grained control over which logins are tracked if required.
- Has hooks that can be used to store additional information with each login if required.
- No dependencies.
My reviews of other projects
Clientside hierarchical select: https://www.drupal.org/node/2288389#comment-8893053 / https://www.drupal.org/node/2288389#comment-8895131
Link icons: https://www.drupal.org/node/2287461#comment-8893181
Actionkit: https://www.drupal.org/node/2131947#comment-8895241
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | minor_coding_standard-2288335-1.patch | 2.23 KB | valderama |
Comments
Comment #1
Smartling commentedMost of the code seems good to me, but:
1. Please follow the instructions of the Pareview: http://pareview.sh/pareview/httpgitdrupalorgsandboxleewillis772288283git...
For example you should add type of the @param in the comments, etc.
2. Please review other modules as it is recommended by the checklist:
https://drupal.org/node/1011698
https://drupal.org/node/1975228
if you like.
Comment #2
valderama commentedHi leewillis77,
Overall impression
the overall impression of the module is very good.
Functionality
The logging itself, the exclusion via a permission and the views integration is working.
PAReview
Using PAReview.org I found a few minor coding/doc standard issues like missing full-stops. See the report here: http://pareview.sh/pareview/httpgitdrupalorgsandboxleewillis772288283git
I have attached a patch which should fix those issues.
Comments
You are using a permission to exclude users from the tracking - as the user-1 automatically has every permission, this user is always excluded from tracking. However, thanks to the hook_login_tracker_track_login_alter the behavior can easily be altered via a simple hook implementation, therefor i think it is OK. You could point this out in the README, however.
Another thing is that there are already two modules which implement very similar functionality - Do you think it is an option to cooperate with the maintainer of login_history on a 2.x version of login_history?
PS: I would need a review of my project-application over here: https://drupal.org/node/2288389
Comment #3
leewillis77 commented@Smartling - thanks - ironically I'd checked it was all clear before I submitted for review, then added the api file, and README which has some issues. I've fixed all of those now, and it's all clear in PAreview - thanks.
Comment #4
leewillis77 commentedHi @valderama,
Thanks - I've fixed the coding standards issues, and PAreview now gives it a clean bill of health. Great spot about user 1 - I've added a note to the README about this.
I considered submitting a patch to login_history to add what I needed (View integration specifically, and hooks to control whether specific requests were logged). However, there are two reasons I didn't:
1. That module already logs more information than I believe is needed - certainly more than is needed in our particular client case right now. Specifically it logs IP address, user-agent, and whether the login is a "first-time" login. For a large site (Which is what we'll be using this on - ~160,000 users) - the volume of data we log needs to be the bare minimum. Removing that data from an existing module wouldn't seem practical.
2. There have already been patches proposed for the module to add views integration that haven't been actively progressed so it seems it's not under particularly active development.
Point 2 may suggest "taking over" the project - however point 1 means it's not really feasible in our case, and we needed a module that logs the minimum information by default.
Hope that clarifies the thinking.
Comment #5
leewillis77 commentedComment #6
PA robot commentedWe 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 #7
valderama commentedAs my concerns where fixed, I'll put this as RTBC.
I agree on your thoughts about the similar modules.
Comment #8
PA robot commentedProject 1: https://www.drupal.org/node/2288335
Project 2: https://www.drupal.org/node/1609068
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #9
leewillis77 commentedComment #10
mpdonadioIf that fails for whatever reason please get back to us and set this back to "needs review".
Comment #11
leewillis77 commentedHi,
I flagged the Login History project in my initial report, and provided information about why I can't use that module in the project I'm working on. See the original issue description, and comment #4 - https://www.drupal.org/node/2288335#comment-8892975
Login history already does *too much*, and stripping things out of that isn't practical - hence this module. Re-opening for further review.
Comment #12
klausiPlease add the differences to the existing projects to the project page and follow https://drupal.org/node/997024
Comment #13
leewillis77 commentedI've updated the project page to include features, screenshot and comparison with similar modules:
https://www.drupal.org/sandbox/leewillis77/2288283
Comment #14
gisleAutomated Review
PAReview came up clean.
Manual Review
In #10, it is said the delta functionality can be implemented as a patch to Login History. The applicant, however, wants a lightweight module, and extending an existing one will not accomplish that. Personally, I don't think that duplication should not be regarded as a blocking issue if the module is otherwise useful and fulfils a specific need (her: lightweight and simple) that the similar module does not.
However, users need to be informed about possible functional overlap. This should be made is section discussing similar projects on the project page that:
This requirement is fulfilled here, so that is why I am setting this to "Yes".
The project contains a markdown README.md instead of README.txt. Technically, this does not follow the guidelines for in-project documentation (which does not mention README.md or markdown formatting). But I think README.md and the markdown format has been allowed in the past, so we can't start regard this as a blocking issue now.
It is too simple to count as a real module, as it have no hook_menu, no configuration settings, no user input, and no user facing text output.
It does not follow the guidelines for project length and complexity.
However, it looks useful and well executed, and deserves to be promoted to a full project.
IMHO, a larger and more complex project should have been submitted for review for full git access, so I don't think this application is complex enough to lead to full git access. (But a git admin will make the final call on this.)
hook_help(). It is good coding practice to have this hook for every enabled module, but this is not a blocker.There are IMHO no more blockers. Moving to RTBC. Note that promotion will not happen until a git administrator has given this a second set of eyeballs.
Comment #15
gisleAdding tag.
Comment #16
leewillis77 commentedRather than having to go through this process again just because this module is too simple - it'd be great if my previous applications (Approved bar a suggestion to patch to another module : https://www.drupal.org/node/1609068), sandbox module (https://www.drupal.org/sandbox/leewillis77/2301743), and previous patches and commits (https://www.drupal.org/user/1588990/track/code) were taken into consideration and move this back to full approval?
Comment #17
mpdonadioAutomated Review
Review of the 7.x-1.x (b0716a7) branch:
No issues.
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
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.
I am not seeing any blocking issues to do a single project promotion of this. However, it is not complex enough for vetted access.
I will investigate the other contributions to see if they are adequate for vetted access.
However, I don't really think this module is usable by a wider audience as-is. The module looks well written, and does things properly. The hook definitions you define are a good approach to the "store what you need", which gives people flexibility. Views integration is good. However, points 2-4 mentioned above are really needed to make this a complete module. If you can take care of these, then you will definitely meet the complexity requirements, and we can do vetted access after the new features have been reviewed.
Let me know how you want to proceed, but my preference would be the paragraph before this one.
Comment #18
leewillis77 commentedHi,
Thanks for looking through the module, for your comments, and for offering to review the other resources I linked to. Here's an update / comments on the points you raised:
Now done and committed.
I disagree, on the site I'm using this for I'd still want to know that there was a login at a point in time, even if that user account has been removed - the information still has statistical value. If users only want information relating to non-deleted users then they can do so by requiring the relationship to the User in views.
I'd be happy to add that functionality if there was user demand for it, but at this stage I don't think it's hugely important in what is designed to be a slimline module. For me, it's important to understand real demand as this could take many shapes (For example - is querying by single UID enough, or would the API need to accept multiple. Would the API need to support data-based querying as well to be useful?).
The data stored per-login is simple (and therefore small), and in my case at least we want to store it indefinitely. Again I'd be happy to look at adding housekeeping features if user-demand was there, but at this stage it's a little early to tell :)
Again, I'd see this as a feature request
Comment #19
mpdonadioI went ahead and promoted this to a full project. I will evaluate the patches you reference when I have a chance. I you rethink the suggestions I made, and implement these features, we can use login_tracker for vetted access...
Thanks for your contribution, leewillis77!
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 #20
leewillis77 commentedThanks @mpdonadio :)
Comment #21
mpdonadioI looked at the commits from the links above.
e_commerce_mailcheck is essentially a one hook module to a jQuery library. It has a dependency on Libraries, but doesn't really use the API (no hook_libraries(), no libraries_load(). The JS doesn't follow Drupal conventions. I cannot find any commits to mailcheck. This is something I would push back to Needs Work.
The other commits (and I admit I could have missed some) are one or two line patches for bugfixes, and not new/substantial features.
solr_boost_by_node_type looks like it has promise, but it is currently (commit dadb6e3) two functions, and about 90 lines.
The review process 'ensure[s] you are writing secure code, following the coding standards, generally following best practices, familiar with proper usage of the Drupal APIs, and promoting collaboration over competition (i.e., not duplicating functionality already available in other modules).' Part of this process is make sure reviews are looking at substantial enough code, which is where the five function / 120 line guideline comes from. This is not a strict rule, and admins do stray from this from time to time.
I am not seeing enough support to grant vetted access. The biggest area I am seeing a lack in is a demonstration of writing secure code in the context of a complete module, especially with handling user input. While we don't require all modules to handle user input, or interface with other APIs in a secure manner, I think this is a competency we would like to see demonstrated if we want to grant vetted access based on a lean module.
Comment #22
mpdonadio@leewillis77 I also encourage you to continue with your public contributions to the Drupal community, and to not be discouraged by the review process. When you have something ready for us to review again, we will take a look.
Comment #23
leewillis77 commentedHi - no worries. Thanks for taking the time to review. It's great to hear that you've got some solid reasons for the decision based on what you've seen / not seen. That make sense to me, and is much more encouraging than someone blindly rejecting based on number of lines of code ...
I'll raise the next module for review when appropriate!
Comment #24
mpdonadioJust removing myself from this issue. I will still follow it, though, in case there is any activity.
Comment #26
avpaderno