Synopsis
This module is used to Show a count of nodes of a particular content-type
and also number of Users of particular role type.
This module will be used for statistical and dev purposes only.
Requirements:
You can view the report of the count for Node and count of user in the following relative URL after installation of Node Type count module
Node Count : "/admin/reports/node-type-count"
User Count : "/admin/reports/node-type-count/user"
Similar projects and how they are different
Count : https://www.drupal.org/project/count
Difference : Count module create a block for every content type. It make administrator to show less or more count of actual nodes.
Rather this module will give exact count of the nodes by its content type and User Count by its role.
Uses:
1. Will count the number of published and unpublished nodes in particular content type which will be useful in content audit to take the report of node status.
2. This module is used to count the number of users in particular Role
Note: This module is for statistical and development purpose only.
Git Clone URL : git clone --branch 7.x-1.x http://git.drupal.org/sandbox/devarajjohnson/2535180.git node_type_count
Sanbox URL : https://www.drupal.org/sandbox/devarajjohnson/2535180
Manual reviews of other projects
https://www.drupal.org/node/2298559#comment-10148088
https://www.drupal.org/node/2537108#comment-10141966
https://www.drupal.org/node/2155969#comment-10148122
pareview.sh URL: http://git.drupal.org/sandbox/devarajjohnson/2535180.git
| Comment | File | Size | Author |
|---|---|---|---|
| #41 | d8foundations.png | 14.7 KB | devaraj johnson |
| #14 | nodetypecount_code_review-2536668.patch | 642 bytes | heykarthikwithu |
| node_type_count.png | 40.89 KB | devaraj johnson |
Comments
Comment #1
devaraj johnson commentedComment #2
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxdevarajjohnson2535180git
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 #3
devaraj johnson commentedUpdated the changes in the module
Comment #4
devaraj johnson commentedComment #5
Vimala vinisha commentedHi Devaraj johnson,
This module is working perfectly. Good job. :)
Thanks,
Vimala
Comment #6
neerajsinghHi Devaraj johnson,
I have reviewed your project, below are my findings:
In info file(Line no 5)
configure = admin/admin/reports/node-type-countYou have mentioned a configuration path but there is no items in hook menu for it.
In module file(Line no 36, 41, 47)
'access callback' => TRUE,You have specified access callback to TRUE, which I feel is a security concern.
Hence, I am updating the status to 'Needs Work'.
Also note that, once you have completed 3 manual reviews of separate project applications then add the 'PAReview: review bonus' tag. For more on review Bonus Refer: https://www.drupal.org/node/1975228
Regards,
Neeraj Singh
Comment #7
ashish.verma85 commentedHi, the module works fine, one issue i found:
1) It is recommended to always implement hook_install(). Here you can find an example.
Comment #8
viswanathan6 commentedHi Devaraj,
This module is working fine.
Comment #9
devaraj johnson commentedAll mentioned changes are done.
Comment #10
devaraj johnson commentedComment #11
devaraj johnson commentedComment #12
devaraj johnson commentedupdated pareview.sh URL
Comment #13
devaraj johnson commentedpareview.sh URL updated
Comment #14
heykarthikwithuReviewed by Coder module.
File name: node_type_count.install
Error:
Line 13: Potential problem: drupal_set_message() only accepts filtered text, be sure all !placeholders for $variables in t() are fully sanitized using check_plain(), filter_xss() or similar. (Drupal Docs) [security_3]
drupal_set_message($t("Node Type Count Module settings are available under !link", array('!link' => l($t('Reports > Node Type Count'), 'admin/reports/node-type-count'))));
Solution: Find the attached patch.
Comment #15
ajay_reddyHello Devaraj johnson,
This module is working perfectly in Drupal 7.38 . Good job.
Found small syntax issue in .install file
node_type_count.install
Line 13: Potential problem: drupal_set_message() only accepts filtered text, be sure all !placeholders for $variables in t() are fully sanitized using check_plain(), filter_xss() or similar. (Drupal Docs) [security_3]
drupal_set_message($t("Node Type Count Module settings are available under !link", array('!link' => l($t('Reports > Node Type Count'), 'admin/reports/node-type-count'))));
and change it as
drupal_set_message(check_plain($t("Node Type Count Module settings are available under !link", array('!link' => l($t('Reports > Node Type Count'), 'admin/reports/node-type-count')))));
So changing status to Needs Work.
Comment #16
klausi@ajaykumarreddy1392: that is a false positive from the old coder review module. Since there is no user provided text involved you should NOT run check_plain() here. Make sure to read https://www.drupal.org/node/28984 again and don't blindly fix issues reported by the old coder review, since it has known false positives.
Comment #17
devaraj johnson commentedsanitized drupal_set_message()
drupal_set_message($t("Node Type Count Module settings are available under @link", array('@link' => l($t('Reports > Node Type Count'), 'admin/reports/node-type-count'))));
Comment #18
Torvald commentedHi Devaraj johnson,
I have reviewed your project.
This module is working perfectly.
Pareview / Coder review: OK
But below are my findings:
Thanks!
Comment #19
devaraj johnson commentedHI Torvald
Thanks for your review.
1. What do you mean by "Please see what's what with the case letters on the help page :)" please explain
2. "Please add PHP version into your .info file." its option not a mandatory one please refer https://www.drupal.org/node/542202#php for more details.
Comment #20
devaraj johnson commentedComment #21
Torvald commentedDevaraj,
I mean, it would be nice if you set words to one register ("published and Unpublished").
I think, it is not critical issue,but it would be better :)
I agree with the second point.
Thanks!
Comment #22
devaraj johnson commentedHi Torvald,
Modified the changes
Thanks!
Comment #23
devaraj johnson commentedComment #24
devaraj johnson commentedComment #25
devaraj johnson commentedComment #26
pravin ajaaz commentedManual Review:
In .install file:
In .module file:
In .admin.inc file:
These are just minor changes and I couldn't see any blockers here. So setting the status to RTBC, for the final review by a git admin.
Comment #27
devaraj johnson commentedHi Pravin Ajaaz,
Thanks for the review, Requested changes are implemented. Waiting for the final review
Comment #28
mpdonadioI'll look at this tonight or tomorrow.
Comment #29
mpdonadioAutomated Review
Review of the 7.x-1.x branch (commit 1beef7e):
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
(*) theme_table() does not sanitize output. The content type name and user role name are both user input and need to be run through check_plain().
Test this by using.
for each.
node_type_count_page_node() doesn't need to call theme. It can just build up and return a render array.
node_type_count_page_user() doesn't need to call theme. It can just build up and return a render array.
The row headers are untranslated. Run them through t().
node_type_count_published(), use NODE_PUBLISHED and NODE_NOT_PUBLISHED instead of the values.
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.
If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.
This review uses the Project Application Review Template.
Comment #30
devaraj johnson commentedHi Matthew Donadio,
Automated Review:
1. Fixed Coder Sniffer error
Manual Review:
1. The content type name and user role name run through check_plain() - Fixed
2. Reviews 7.x-1.x branch. 8.x-1.x branch appears identical - Removed branch 8.x-1.x
3. node_type_count_page_node() doesn't need to call theme. It can just build up and return a render array. - Fixed
4. node_type_count_page_user() doesn't need to call theme. It can just build up and return a render array. - Fixed
5. The row headers are untranslated. Run them through t(). - Fixed
6. node_type_count_published(), use NODE_PUBLISHED and NODE_NOT_PUBLISHED instead of the values. - Fixed
Comment #31
devaraj johnson commentedComment #32
klausimanual review:
<script>alert('XSS');</script>then I will get a nasty javascript popup. You need to sanitize user provided text before printing, make sure to read https://www.drupal.org/node/28984 again. Strictly speaking this is not a big security problem because it requires a trusted permission to create that content type, but this should be fixed anyway.Comment #33
devaraj johnson commentedComment #34
devaraj johnson commentedHi Klausi,
Thank you for reviewing.
1. I have added the difference in the project description.
2. I have changed the above requested changes. If my Understanding is correct I have changed the
$content['title']in thenode_type_count_page_node()function withcheck_plain($content['title']), Since content title can have<script>alert('XSS');</script>as a content type name. I have added check_plain to this part.Comment #35
klausiI meant that you add the difference to existing projects to the project page of the sandbox (your later full project page), not the issue summary here.
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 mpdonadio as he might have time to take a final look at this.
Comment #36
mpdonadioAutomated Review
Review of the 7.x-1.x branch (commit c73b11e):
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
My XSS concerns were addressed and explicitly tested. Read `git diff 1beef7e` and changes look good.
Don't see any blocking issues.
Comment #37
mpdonadioThanks for your contribution, Devaraj johnson!
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 #38
devaraj johnson commentedThanks Matthew Donadio :)
Comment #39
heykarthikwithuComment #40
devaraj johnson commentedComment #41
devaraj johnson commentedJust adding image