Description:
This module provides a block which displays a review summary and optionally review excerpts for a specific businness obtained by the Yelp API. There is only one similar module which uses the Yelp API to display search results but it doesn't provide review summaries and excerpts for one specific businness.
This module was developed for one of my clients and developed internally before an agreement to open source it (therefore there is no commit/revision history in the git repository).

Screenshots:
Block display: http://neiti.at/drupal-moduletest/yelp_module_display.png
Conficuration: http://neiti.at/drupal-moduletest/yelp_module_configuration.png

Project URL:
http://drupal.org/sandbox/Neiti01/1400056

Git repository:
git clone --branch 7.x-1.x git.drupal.org:sandbox/Neiti01/1400056.git

Drupal target version:
Drupal 7

CommentFileSizeAuthor
#6 issues.txt27.25 KBdarrell_ulm

Comments

jasonrichardsmith@gmail.com’s picture

Status: Needs review » Needs work
Anonymous’s picture

I fixed the issues and changed the branch to 7.x-1.x.

I was only using the coder module previously to check my code and wasn't aware of the pareview script and Drupal Code Sniffer.

Markus

Anonymous’s picture

Status: Needs work » Needs review
darrell_ulm’s picture

Status: Needs work » Needs review

This has been sitting here a while so decided to do a review.

Full comments in attached node at:
http://drupal.org/node/1400086#comment-5590504

darrell_ulm’s picture

Status: Needs review » Needs work

I decided to run 2 error checkers on this for formatting because the simple one was skipping many errors and would have need re-run. Highly suggest developer to use local version of one of the error checking modules.

Again, full comments are at.
http://drupal.org/node/1400086#comment-5590376

darrell_ulm’s picture

Status: Needs review » Needs work
StatusFileSize
new27.25 KB

Code errors are in attached file issues.txt

Project page could use some documentation
http://drupal.org/sandbox/Neiti01/1400056

Documentation Standards Not Met
See http://drupal.org/node/1354

Validation function for security on yelp_reviews_form($form, &$form_state) form
A validation function(s) would be useful here for security and some cleaning of the input data.
Please see http://drupal.org/writing-secure-code to make sure text inputs coming from user are clean.

Check data coming from Yelp for Security
$reviews = yelp_reviews_get_reviews();
Data retrieved from yelp_reviews_get_reviews() should be checked in case data from Yelp is not clean before displaying in the template.

With the doc standards and formatting errors fixed, looks like an interesting module.

Good luck!

Anonymous’s picture

Status: Needs work » Needs review

Thanks for the review darrellulm!

Coding guideline issues should have been fixed already in the branch but the master was still existing and filled with old stuff.

I removed the master and added the other stuff (check_plain for form input and stuff coming from Yelp as well as better error handling for Yelp API call in general) you requested.

chrisroane’s picture

MANUAL REVIEW
--------------
1. The logo images are not showing up on the configuration screen. They have an extra beginning "/" in front of the path. I don't think you need to include base_path() in this case. I also see the same thing on line 228 of the .module file.

2. Generally it is a good idea to create a custom permission entry to access the config for your module, and not use the general "access administration pages" permission.

I didn't see any other issues when looking for the code. Since these are not deal breakers, I'll keep the project set to "needs review".

AUTO REVIEW
------------
- Ran the code via coder and things look good.

- Ran the code via the PAReview online tool and it looks good.

Anonymous’s picture

I removed the extra slash in the image paths. Interestingly FF and Chrome had no problems with them but IE didn't display them correctly.

I also added a custom permission for the config page instead of using "access administration pages"

jeffschuler’s picture

Nice work!

I would recommend presenting your improvements as patches to the existing Yelp module.

As you mentioned, that module "doesn't provide review summaries and excerpts for one specific business" while yours doesn't provides for multiple. Sounds to me like those combined functionalities would make for a more robust and useful single Yelp module. :)

mdespeuilles’s picture

Status: Needs review » Needs work

Hi,

Manual Review :

  • You should create a yelp_reviews.install file. In your module you define variable from your configuration form. In your install file you must implement hook_uninstall() and remove your variable yelp_reviews_* . See Writing .install files
  • yelp_reviews_get_reviews() : You should use drupal_json_decode() instead of json_decode() . (See this page)

Automatic Review :

Review of the 7.x-1.x branch:

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. Get a review bonus and we will come back to your application sooner.

Severity minor, Drupal Commenting Standards, Internationalization, Drupal Security Checks, Drupal SQL Standards, Drupal Coding Standards

sites/all/modules/pareview_temp/./test_candidate/oauth.inc:
 +384: [minor] in most cases, replace the string function with the drupal_ equivalent string functions
 +497: [minor] in most cases, replace the string function with the drupal_ equivalent string functions
 +553: [minor] in most cases, replace the string function with the drupal_ equivalent string functions
 +959: [minor] in most cases, replace the string function with the drupal_ equivalent string functions
 +976: [minor] in most cases, replace the string function with the drupal_ equivalent string functions
 +983: [minor] in most cases, replace the string function with the drupal_ equivalent string functions

Status Messages:
 Coder found 2 projects, 2 files, 6 minor warnings, 0 warnings were flagged to be ignored

FILE: ...pal-7-pareview/sites/all/modules/pareview_temp/test_candidate/oauth.inc
--------------------------------------------------------------------------------
FOUND 3 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
 400 | ERROR | An operator statement must be followed by a single space
 997 | ERROR | There should be no white space after an opening "("
 997 | ERROR | There should be no white space before a closing ")"
--------------------------------------------------------------------------------


FILE: ...view/sites/all/modules/pareview_temp/test_candidate/yelp_reviews.module
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
 84 | ERROR | If the line declaring an array spans longer than 80 characters,
    |       | each element should be broken into its own line
--------------------------------------------------------------------------------

Source: http://ventral.org/pareview - PAReview.sh online service

patrickd’s picture

@mdespeuilles
please don't post such automated reviews (at leat these grey boxes) into issues, it's quite demotivating for applicants to hit this "wall of errors"
rather attach a txt-file containing the report, or a direct link to it. :)

Anonymous’s picture

Status: Needs work » Closed (won't fix)

Don't have the time to keep on fixing formatting stuff.

patrickd’s picture

I'm sorry about that :(

hope you come back soon

patrickd’s picture

Issue summary: View changes

Changed git repo to correct branch