This modules provides the Walk Score for node locations.
Allows users to:
- Integrate Walk Score into your site
- Add Walk Scores to nodes
- Display the Walk Score Block on each node
The Walk Score API is supported in the United States, Canada, Australia, and New Zealand. Integrates nodes with Location data with the Walkscore API
See project at https://www.drupal.org/sandbox/sagesolutions/2302543
Installation
To install this module, clone it into the module's directory of a Drupal 7 installation, and enable the module:
You can clone the project at by using the following:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/sagesolutions/2302543.git walkscore
Comments
Comment #1
sagesolutions commentedComment #2
sagesolutions commentedComment #3
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxsagesolutions2302543git
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
sagesolutions commentedFixed all errors from pareview.sh
Comment #5
Oleks Iv commentedHi sagesolutions,
Automated Review
There are still have some warnings from http://pareview.sh/pareview/httpgitdrupalorgsandboxsagesolutions2302543git
Manual Review
$node = node_load(arg(1));What if this block will be on page where arg(1) is not node id? I assume, we should add conditions for this situation.
$block['content']['#attached']['css'][] = [a path to css]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 #6
Oleks Iv commentedComment #7
sagesolutions commentedHi alexsergivan,
Thanks for the quick review. I added in some logic so the block only displays on node pages.
I also moved the css to the proper spot.
Thanks for the review.
Mike
Comment #8
iztok commentedAutomated Review
Pareview.sh passed
Manual Review
Notice: Undefined index: province_name in walkscore_calculate_score() (line 312 of /x/sites/all/modules/walkscore/walkscore.module).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 #9
sagesolutions commentedHi Iztok,
I updated the walkscore_calculate_score() function to include error checking on location values.
And my account is an individual user account.
Comment #10
rhuffstedtler commentedHi sagesolutions,
Automated Review
Nothing other than a single warning identified.
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.
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 #11
rhuffstedtler commentedComment #12
sagesolutions commentedHi rhuffstedtler,
Walkscore needs more information than just a street address to generate the walkscore. I added validation to the node type form so the user must require (or force default) street, city, province and country. This should fix the issues you were having.
For issue #2, The location module automatically re-geocodes the lat / long values when the location field data changes.
Thanks for the review,
Mike
Comment #13
tikaszvince commentedAutomated Review
There are still have some warnings from http://pareview.sh/pareview/httpgitdrupalorgsandboxsagesolutions2302543git
Manual Review
walkscore_form_node_form_alter()you can reduce code complexity if you merge the two if conditions and reverse it.walkscore_node_insert(),walkscore_node_update()andwalkscore_node_delete()too.This review uses the Project Application Review Template.
Comment #14
sagesolutions commentedHi tikaszvince,
Thanks for the review, I have reduced the complexity in the code.
Mike
Comment #15
gregglesI tried getting a walkscore API key, but my application is waitlisted. I'll try to come back and review again after I get that.
I have a few suggestions. These aren't strictly blocking approval, so I won't change the status.
Permission title
The permission title isn't really clear. You can expand it "Configure Walk Score" and also use a description to make it more clear what it does.
Printing the $score
A strong suggestion - this value is coming from the DB where it was stored after retrieving it from the API. There's a risk that the score will contain unexpected content (e.g. malicious strings like a cross site scripting attack). It would be better
Watchdog calls not translatable - could be a security risk
These lines are technically OK for security now, but they are not good for translation and could lead to an XSS vulnerability if the $statuscode or error messages from walkscore_get_error could ever contain malicious content.
Test scores a risk for XSS in the future
Similarly, these lines should be filtered (e.g. using check_plain or filter_xss) OR, if the function is guaranteed to return "safe" content then you should state that in comments so a future person modifying the code doesn't make a mistake. I like to add to the docblock something like "@return A string ready to be printed without need to filter/sanitize."
Comment #16
afinnarn commentedHey @sagesolutions,
I also couldn't get the API key either. It said it would take two business days to sort that out. If possible, it might be a good idea to provide a sample key for reviews as reviewers probably want to be able to do their code review in one sitting.
A few suggestions...
On line 98 in walkscore.module, I think you can just use menu_get_object() as the defaults are for node and loading arg(1). From my understanding, the node object is already loaded so you wouldn't be loading it twice.
In walkscore_form_node_type_form_alter(), it might be a good idea to set the defaults to what you are validating against. It took me a little while to figure out that I had to set the value to required instead of just adding a default value. Since the required locations to enter defaults to zero, this doesn't really affect node creation if they don't want to calculate a walk score and provides a better UX in my opinion.
On lines 119 and 125 in walkscore.module the word "description" is misspelled.
In walkscore_save(), I think you can use db_merge() to reduce your queries to just one. Reference
In _walkscore_print_test(), you might want to send the output to a theme function instead of just stringing the output together. I think this is what @greggles was mentioning above with a security risk. This also makes it more readable and uses Drupal standards.
Since I don't have an API key to test, I'm not changing the status here, but if I do receive one, I can go back and functionally test this module.
Comment #17
avpadernoI am changing status basing on the previous comments.
Comment #18
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 #19
sagesolutions commentedComment #20
sagesolutions commentedSince Drupal 8 is out, I will focus my development to a new 8.x Walkscore module
Comment #21
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.