Description

The Field Wistia module provides a simple field that allows a user to add a Wistia video to a content type, user, or any entity with your Wisita video's URL. Wistia is a video hosting provider with a nice API and lots of cool features. There is another Wistia module, but it is built for use with Embedded Media field and only for D6. This module is stand alone and allows for video embeds with only Field API.

Display types include:

  • Wistia videos of various sizes, or input your own custom size.
  • Wistia thumbnails with image styles.

Wistia Embed Options:

  • Default Embed Type (iFrame, SEO, API)
  • VideoFoam for responsive video
  • AutoPlay
  • SSL Embed
  • Wistia Social bar plugin (only Facebook, Twitter and Reddit currently.

Project Page: https://drupal.org/sandbox/joetoday/2191943
Git Repo:

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/joetoday/2191943.git field_wistia
cd field_wistia

Reviews of Other Projects

https://drupal.org/node/2278513#comment-8841885
https://drupal.org/node/2261225#comment-8842009
https://drupal.org/node/2191147#comment-8856885

CommentFileSizeAuthor
#18 pareview_results.txt1.16 KBmpdonadio

Comments

jdvc’s picture

Issue summary: View changes
jdvc’s picture

Issue summary: View changes
jdvc’s picture

Issue summary: View changes
PA robot’s picture

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.

thomas.fleming’s picture

Outside of what's mentioned in http://pareview.sh/, the code itself looks pretty solid. One thing I noticed on line 36 in field_wistia.admin.inc is that the value of @url has parentheses wrapped around it. Did you intend to wrap this value in url()?

You may go to http://pareview.sh/ and submit a review of your site using http://git.drupal.org/sandbox/joetoday/2191943.git.

Here are the main takeaways:

1) You will need to switch your module's default branch over to a non-master branch and remove master. Make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732 .

2) You will also need to set a param type in your documentation on line 73 of field_wistia.theme.inc. Param types are technically optional for D7 modules, but they are still required to pass this review. The param type in this case would likely be string.

thomas.fleming’s picture

Status: Needs review » Needs work
jdvc’s picture

Thanks tidrif!

Yes, forgot to add url() and the actual URL in field_wistia.admin.inc. Thanks for catching it, now added.

1) Deleted the master branch, set default branch to 7.x-1.x.

2) Added param type in field_wistia_.theme.inc, line 73, and now no errors from pareview.

jdvc’s picture

Status: Needs work » Needs review
tonylegrone’s picture

Status: Needs review » Needs work

Hi joetoday,

First off, this module looks great!

I noticed that the permissions of all the module files except field_wistia.admin.inc are set at 755 (the default mode for folders). They should be set to 644 so that they don't have execute permissions.

You should also remove the trailing whitespace in the files as per https://drupal.org/coding-standards#indenting. Your editor should be able to do that automatically for you so you won't ever have to worry about it again. :)

I'm looking forward to seeing your module out in the wild!

jdvc’s picture

Hey Tony,

Ok, set the correct permissions for the files and pushed.

However, could you specify which line number you see trailing whitespace on? The code is passing pareview with out any errors and that checks for whitespace, so I'm not sure what you are referring to?

http://pareview.sh/pareview/httpgitdrupalorgsandboxjoetoday2191943git

Thanks for reviewing!
joe

jdvc’s picture

Status: Needs work » Needs review
tonylegrone’s picture

That's weird. I wonder if it ignores comments and multi-line strings.

Here's the list of places I found trailing spaces:
- field_wistia.admin.inc: 17
- field_wistia.info: 2, 5
- field_wistia.module: 90, 91
- field_wistia.theme.inc: 7

jdvc’s picture

Yeah you are right, weird. A couple rouge spaces for sure. Well this forced me to get my sublime whitespace plugin working at least!

Just pushed the fix.

Thanks!

tonylegrone’s picture

Status: Needs review » Reviewed & tested by the community

Awesome! I love sublime. If you're having problems with that whitespace plugin, you might try adding "trim_trailing_white_space_on_save": true to your preferences.

Everything looks good to me. Hopefully someone will promote it to a full project soon. Thanks for sharing your module!

jdvc’s picture

Issue summary: View changes
jdvc’s picture

Issue summary: View changes
jdvc’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus
mpdonadio’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +PAreview: security
StatusFileSize
new1.16 KB

Automated Review

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

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.
  • DrupalPractice has found some issues with your code, but could be false positives, and may be duplicate results from Coder Sniffer. See attachment.

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.

Minor things, but fix when you can.

Manual Review

The duplication/collaboration issue is tricky with the video modules. There are two general purpose video modules that
I know about, Media and Video Embed Field. There are also some modules that provide fields for a particular
video provider. Media and Video Embed Field both provide hooks for adding different providers, which this module
does not implement. Long term, I would suggest adding support for these through submodules.

field_wistia_field_schema(). No primary key for your table? These are usally a good idea.

(+) Avoid building HTML in t(). In field_wistia_settings_form(), build the link with l(), and then pass this in
to t() as a placeholder.

(*) In field_wistia_field_widget_form(), pass in the ID as a parameter to t() (line 336). This is XSS vulnerable. If I schema
alter to make the field longer, I can set the URL to http://www.wistia.com/medias/<script>alert('XSS')</script>
and get the alert on the edit page. In addition, I would see if you can validate the ID, but validation is not a
substitute for output sanitization.

field_wistia_get_video_id() should probably return FALSE if the URL wasn't valid.

(+) field_wistia_get_remote_image() should use the File API for the thumbnail. See system_retrieve_file().

(+) It doesn't look like there is any cleanup of the thumnails when a video field is removed. This should be addressed.

(+) In theme_field_wistia_video(), don't build the URL manually, use url().

In _field_wistia_request_embed(), use drupal_json_decode().

The custom dimensions in the setting form can probably use some validation, and casting to int when you use them.

The starred (*) issues are blockers. Please don't remove the security tag, we keep that for statistics and to show examples of security problems.

The plussed (+) items are high priority, but not blockers.

jdvc’s picture

Status: Needs work » Needs review

Thanks for the review mpdonadio. Yes, I will integrate one of the general video modules in the future. When I originally though about using wistia, embedded media field wasn't yet available for Drupal 7. Also , I use wistia for a number of sites and this module does everything I need it to do with the lowest overhead. I think there are other people who use Wistia that will feel the same way.

Things I fixed:

pareview errors
FIXED

(+) Avoid building HTML in t(). In field_wistia_settings_form()
FIXED line 35 field_wistia.admin.inc

(*) In field_wistia_field_widget_form(), pass in the ID as a parameter to t() (line 336)
FIXED line 336 field_wistia.module

field_wistia_get_video_id() should probably return FALSE
FIXED line 35 field_wistia.inc

(+) field_wistia_get_remote_image() should use system_retrieve_file
FIXED line 82 field_wistia.inc

(+) In theme_field_wistia_video(), don't build the URL manually
FIXED line 54 field_wistia.theme.inc

_field_wistia_request_embed(), use drupal_json_decode()
FIXED line 84 field_wistia.theme.inc

On the immediate TODO list:

Thumbnail cleanup

Custom dimension validation

jdvc’s picture

Issue summary: View changes
jdvc’s picture

Issue summary: View changes
mpdonadio’s picture

Ignore my comment in #18 about "Avoid building HTML in t(). In field_wistia_settings_form(), build the link with l(), and then pass this in to t() as a placeholder." I forgot this was the preferred practice so the link title gets translated.

jdvc’s picture

Yes, adjusted accordingly to that one.

klausi’s picture

Assigned: Unassigned » heddn
Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

Looks RTBC to me after a manual review! Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

Assigning to heddn as he might have time to take a final look at this.

heddn’s picture

Issue summary: View changes
heddn’s picture

Status: Reviewed & tested by the community » Fixed

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No multiple applications
Yes
No duplication
Yes
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements
3rd party code
Yes: Follows the guidelines for 3rd party code.
README.txt
Yes: Follows the guidelines for in-project documentation and the README.txt Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes. If "no", list security issues identified.
Coding style & Drupal API usage
Place code review here using this format:
  • .module seems to assume a size of 640x360 but .inc file seems to allow various sizes.
    See field_wistia_field_formatter_settings_summary & field_wistia_size_options

The manual review comments in the code walkthrough are recommendations.

Thanks for your contribution, Joe!

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.

jdvc’s picture

Awesome, this is freaking cool! Thanks to everyone who helped review this!

tonylegrone’s picture

Congratulations Joe!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.