This module is used to find the php filter format used in nodes, blocks and views. The main advantage of this module is, it is used to exactly find the particular nodes or views or blocks on which php filter format is used. Thus enabling the developer to reduce the time in finding out on which particular node or view or block on which the php filter is used and make the corresponding changes accordingly.
This module will be listed in the Reports section of the main admin section.
git clone --branch 7.x-1.x https://git.drupal.org/sandbox/muthukumarsri/2621270.git php_finder
Pareview URL
http://pareview.sh/pareview/httpgitdrupalorgsandboxmuthukumarsri2621270git
Sandbox URL
https://www.drupal.org/sandbox/muthukumarsri/2621270
Manual reviews of other project:
https://www.drupal.org/node/2833038#comment-11818526
https://www.drupal.org/node/2834321#comment-11819244
https://www.drupal.org/node/2833485#comment-11818518
https://www.drupal.org/node/2699075#comment-11036313
https://www.drupal.org/node/2704759#comment-11065061
https://www.drupal.org/node/2649336#comment-11040289
https://www.drupal.org/node/2683891#comment-11051917
Similar projects and how they are different.
Count : https://www.drupal.org/project/security_review
Difference : PHP FINDER tracks both the php tag and the node which has used the php format. It also tracks the views and the block which has used the php in it. The security review module doesnt track the views and blocks.
PHP FINDER is developer's friendly. If the site has large number of views and blocks, it is difficult to track all the views and blocks. PHP FINDER helps the developer's to track the views and blocks and also lists the views and the blocks in the link(url).
| Comment | File | Size | Author |
|---|---|---|---|
| php_in_nodes.jpg | 25.61 KB | muthukumar sri |
Comments
Comment #2
muthukumar sri commentedComment #3
muthukumar sri commentedComment #4
PA robot commentedFixed the git clone URL in the issue summary for non-maintainer users.
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 #5
skullhole commentedHello @muthukumar sri,
Automated Review
No issues detected.
Manual Review
Based on https://www.drupal.org/node/1587704
1. Basic application checks
1.1 Ensure your application contains a repository and project page link.
https://www.drupal.org/sandbox/muthukumarsri/26212701.2 Ensure your project is not a duplication.
No duplication.
2. Basic repository checks
2.1 Ensure the repository actually contains code.
Repo contains code.
3. Security Review
3.1 Ensure the project does not contain any security issues.
No security vulnerabilities.
4. Licensing checks
4.1 Ensure the repository does not contain a ‘LICENSE.txt’ file.
Yes.
4.2 Ensure the repository does not contain any 3rd party (non-GPL) code.
Yes.
5. Documentation checks
5.1 Ensure the project page contains detailed information.
Yes.
5.2 Ensure the repository contains a detailed README.txt.
Readme does not follow the README Template.
5.3 Ensure the code contains a well-balanced amount of inline-comments.
The module lacks the inline comments, however what it's doing is pretty straightforward.
6. Coding standards and style
6.1 Run an automated review and ensure there are no major issues.
No issues detected.
7. API and best practices Review
7.1 Ensure you are using Drupals API correctly.
$search_php = 'php';does not seem reasonable.Comment #6
muthukumar sri commentedComment #7
skullhole commentedComment #8
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 #9
muthukumar sri commentedHi skullhole,
Thanks for your review. Kindly check my feedback.
Line #3 : I have checked the 'field_info_instances' function. It will retrieve all the information. But i cant match the exact result for this case.
Line #8 : I need to add some additional features. I will rearrange the structure in next version.
Other issues are fixed. Kindly check and let us know your feedback.
Comment #10
muthukumar sri commentedComment #11
manojbisht_drupal commentedHi,
In Line 47, you can instead of querying the DB for getting node type, title and status, You can use node_load_multiple, as relying heavily on query is not a gud idea.
https://api.drupal.org/api/drupal/modules%21node%21node.module/function/...
You can also implement hook_help, so that users gets more idea about the module.
Comment #12
manojbisht_drupal commentedComment #13
klausiComment #14
klausi@manojbisht_drupal: I think the code only wants to query for nodes, so node_load_multiple() would be wrong here. An improvement would be to use EntityFieldQuery instead, but also not a hard requirement.
There is a security vulnerability in this module and as part of our git admin training I'm assigning this to th_tushar so that he can take a look. If he does not find anything I'm going to post the vulnerability details in one week. And please don't remove the security tag, we keep that for statistics and to show examples of security problems.
Comment #15
th_tushar commentedHi @muthukumar sri,
There is security vulnerability in the module, below are the line of code that may violate security,
In php_finder.pages.inc file, php_finder_node_report() function.
$result_node->titleshould be passed throughfilter_xss()orfilter_xss_admin()function to sanitize the values fetched from the database.$result_block->infoshould be passed throughfilter_xss()orfilter_xss_admin()function to sanitize the values.$result_view->nameshould be passed throughfilter_xss()orfilter_xss_admin()function to sanitize the values fetched from the database.Also, as the Drupal node data is being fetched from the database, it would be efficient to use EntityFieldQuery.
Changing the status to "Needs work". Please fix the above issues and and change the status back to "Needs review".
Comment #16
manojbisht_drupal commentedHi,
I have enabled this module in my local instance, and I have placed Twitter Widget ID in it, but it is not loading my twitter.
Also please mention in your documentation, how to get twitter widget ID.
Comment #17
manojbisht_drupal commentedHi,
Sorry for above comment, this was meant for another project.
Really sorry for the same.
Comment #18
klausi@th_tushar: while filter_xss() would also be fine in this context I would recommend check_plain() instead. Node titles for example should never be interpreted as markup, so check_plain() for escaping is appropriate.
Comment #19
muthukumar sri commentedThanks klausi and Tushar for the review and suggestion.
Comment #20
muthukumar sri commentedThanks manojbisht_drupal for the review and suggestion.
Comment #21
muthukumar sri commentedComment #22
muthukumar sri commentedComment #23
muthukumar sri commentedHi manojbisht,
I have fixed the mentioned issue.
Comment #24
muthukumar sri commentedHi klausi & th_tushar,
I have fixed the mentioned issue.
Comment #25
PA robot commentedFixed the git clone URL in the issue summary for non-maintainer users.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #26
D.push commentedHi, I reviewed your module and can make one notice: it's good practice to use function t() for text strings in the interface.
Comment #27
muthukumar sri commentedHi D.push,
Thanks for the review and suggestion...
Comment #28
muthukumar sri commentedComment #29
PA robot commentedTimeout when invoking pareview.sh for https://git.drupal.org/sandbox/muthukumarsri/2621270.git at http://pareview.sh/pareview/httpsgitdrupalorgsandboxmuthukumarsri2621270git
Do you have any third-party files committed? 3rd 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.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #30
klausiSilly bot problems, sorry.
Comment #31
muthukumar sri commentedComment #32
muthukumar sri commentedComment #33
muthukumar sri commentedComment #34
muthukumar sri commentedComment #35
muthukumar sri commentedComment #36
muthukumar sri commentedComment #37
th_tushar commentedHi muthukumar sri,
Please fix the issues pointed in #15 of this issue.
Changing the status to "Needs work".
Comment #38
muthukumar sri commentedComment #39
muthukumar sri commentedComment #40
muthukumar sri commentedHi th_tushar,
I have fixed the mentioned issue.
Comment #41
muthukumar sri commentedComment #42
PA robot commentedFixed the git clone URL in the issue summary for non-maintainer users.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #43
muthukumar sri commentedComment #44
muthukumar sri commentedComment #45
muthukumar sri commentedComment #46
muthukumar sri commentedComment #47
muthukumar sri commentedComment #48
muthukumar sri commentedComment #49
muthukumar sri commentedComment #50
muthukumar sri commentedComment #51
klausifixing tags
Comment #52
harings_rob commentedHello,
Below are a few issues that I found:
Blockers:
1. On line 83/122/165 of php_finder.pages.inc, you use the variable $more, if no results are fetched from the database, this can result in an undefined error.
2. In php_finder.pages.inc there is some text, this text should be wrapped in a t() function to have them translatable.
Other issues / remarks:
1. Is there a reason you mix single and double quotes? I think it's good practice to always use single quotes.
2. I want a second opinion on this, but I would keep them lowercase, so they only get translated once (capitalize), then wrap in strtoupper() if you want to have them upper case..
3. All helper functions (non hook functions) should start with an underscore, followed by the module name.
4. I don't know the reason for the ;id in the info file?
5. Tip: Instead of setting $output and returning it at the end, you can remove every else and just return. Example (php_finder_view_report):
For the rest it seems to be fine. But setting it needs work for the small issues.
Comment #53
muthukumar sri commentedHi Rob,
Thanks for the review and suggestion...
Comment #54
muthukumar sri commentedHi Rob,
Blockers:
1. Once we retrieve the data from the database we will store it in an array and iterate through the array to check if there exists at least one result. Only after this check would we send it to theme the content. If there are no results it wont show any content.
2. Regarding the t() could you please refer the line number or at least content which you are pointing to.
Other issues / remarks:
I have fixed all changes and all helper functions started with an underscore, followed by the module name.
Comment #55
muthukumar sri commentedComment #56
muthukumar sri commentedComment #57
harings_rob commentedHi,
about 1, I looked better at the code, and it is fine, but still I would initialize the $rows array.
about 2, dont use t('ABOUT') instead, strtoupper(t('about')), translated strings are case sensitive.
This to avoid having ABOUT and about in the translation tables.
Comment #58
muthukumar sri commentedHi Rob,
1. Once we retrieve the data from the database we will store it in an array and iterate through the array to check if there exists at least one result. Only after this check would we send it to theme the content. If there are no results it wont show any content.
2. I have fixed the changes
Comment #59
klausiRemoved one automated review.
Comment #60
klausimanual review:
<script>alert('XSS');</script>as view description than I will get a nasty javascript popup on this page. You need to sanitize user provided text before printing, make sure to read https://www.drupal.org/node/28984 again. This is a limited vulnerability because it requires an attacker to have the "administer views" permission, but it should be fixed in any case.Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #61
muthukumar sri commentedComment #62
gisleCan you please explain what your module does that is not already covered by Security review?
Also: Please take a moment to make your project page follow the Project page template and it may be a good idea to also read tips for a great project page.
In particular, you must add the section "Similar projects and how they are different", making sure that it:
And while you're at it, please take a moment to make your README.txt follow the guidelines for in-project documentation and the README.txt Template.
Comment #63
muthukumar sri commentedComment #64
muthukumar sri commentedComment #65
muthukumar sri commentedHi klausi,
Thanks for your review and feedback. I have fixed all the changes.
Comment #66
muthukumar sri commentedComment #67
muthukumar sri commentedComment #68
muthukumar sri commentedComment #69
muthukumar sri commentedComment #70
muthukumar sri commentedComment #71
muthukumar sri commentedComment #72
muthukumar sri commentedComment #73
travis-bradbury commentedManual review:
- * Several places use a variable that may not be defined.
- Other non-blocking feedback.
php_finder.pages.inc
php_finder_node_report()Lines 32-48: I think combining the results of each query here could be done simpler. What about adding the IDs of the nodes into one array instead of using a multi-dimensional array for $nid_set? I don't think the array_merge() or the $result_mine variable would be necessary.
Line 49: Could you call node_load_multiple here instead of doing a custom database query?
Line 54:
It shouldn't be necessary to use count() on the array if using foreach - on an empty array it will skip the foreach.
Line 83: $rows may not be defined.
php_finder_block_report()Line 121: $rows may not be defined.
php_finder_views_report()$result_view->name is passed through check_plain() on line 151 but not 147.
Line 167: $rows may not be defined.
Comment #74
muthukumar sri commentedComment #75
muthukumar sri commentedComment #76
muthukumar sri commentedComment #77
muthukumar sri commentedComment #78
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 #79
muthukumar sri commentedHi tbradbury’s,
Thanks for your review.
Line 54:
if (count($result) > 0) {
foreach ($result as $result_node) {
* For result behaviour i have used this (count($result) > 0)
* $rows variable is defined
Comment #80
muthukumar sri commentedComment #81
muthukumar sri commentedComment #82
muthukumar sri commentedComment #83
muthukumar sri commentedComment #84
muthukumar sri commentedComment #85
muthukumar sri commentedComment #86
muthukumar sri commentedComment #87
muthukumar sri commentedComment #88
muthukumar sri commentedComment #89
muthukumar sri commentedComment #90
muthukumar sri commentedComment #91
muthukumar sri commentedComment #92
muthukumar sri commentedComment #93
klausimanual review:
Otherwise looks good to me.
Thanks for your contribution, muthukumar!
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 #94
muthukumar sri commentedHi Klausi,
Thanks for your support. I will follow your recommendation.
Thanks,
Muthukumar Sri.
Comment #95
klausiAssigning issue credits.
Comment #96
muthukumar sri commentedThanks @klausi