Simple module that provides a block with the latest updates from Facebook for the provided account. It is based on the
likebox social plugin: http://developers.facebook.com/docs/reference/plugins/like-box/
The widget settings are configurable for users with 'admin facebook widget settings' permission.

Comments

berkas1’s picture

Status: Needs review » Postponed

you have to post link to your sandbox project:)

drozas’s picture

jpontani’s picture

Status: Postponed » Needs review
attiks’s picture

Status: Needs review » Needs work

I did a quick Coder review to check the Coding Standards, see below.

Also rename the tpl folder to templates and remove the empty fb_likebox.

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

sites/all/modules/fb_likebox/fb_likebox.module:
+2: [normal] Commits to the Git repository do not require the CVS $Id$ keyword in each file.
+9: [minor] There should be no trailing spaces
+10: [minor] Missing period
+11: [minor] There should be no trailing spaces
+14: [normal] use a space between the closing parenthesis and the open bracket
+22: [normal] use a space between the closing parenthesis and the open bracket
+32: [minor] There should be no trailing spaces
+38: [minor] There should be no trailing spaces
+39: [minor] Missing parenthesis after function name
+40: [minor] There should be no trailing spaces
+41: [minor] There should be no trailing spaces
+42: [minor] There should be no trailing spaces
+45: [normal] use a space between the closing parenthesis and the open bracket
+46: [normal] Control statements should have one space between the control keyword and opening parenthesis
+46: [normal] use a space between the closing parenthesis and the open bracket
+48: [minor] There should be no trailing spaces
+50: [minor] There should be no trailing spaces
+50: [normal] The $string argument to t() should not begin or end with a space.
+53: [minor] There should be no trailing spaces
+55: [minor] There should be no trailing spaces
+58: [normal] curly braces { should end a line, not start one
+70: [minor] There should be no trailing spaces
+73: [critical] Potential problem: hook_block() only accepts filtered text as the block title, be sure to use check_plain(), filter_xss() or similar to ensure your $variable is fully sanitized.
+73: [normal] The $string argument to t() should not begin or end with a space.
+74: [minor] There should be no trailing spaces
+78: [minor] There should be no trailing spaces
+80: [minor] There should be no trailing spaces
+84: [minor] There should be no trailing spaces
+87: [minor] There should be no trailing spaces
+91: [minor] There should be no trailing spaces
+92: [minor] Missing period
+93: [minor] There should be no trailing spaces
+96: [normal] curly braces { should end a line, not start one
+102: [normal] Arrays should be formatted with a space separating each element and assignment operator
+102: [minor] There should be no trailing spaces
+102: [normal] Use uppercase for PHP constants, e.g. NULL, TRUE, FALSE
+103: [normal] Arrays should be formatted with a space separating each element and assignment operator
+103: [normal] missing space after comma
+103: [normal] Use uppercase for PHP constants, e.g. NULL, TRUE, FALSE
+105: [normal] missing space after comma
+106: [minor] There should be no trailing spaces

sites/all/modules/fb_likebox/tpl/fb_likebox.tpl.php:
+-1: [minor] @file block missing
+1: [minor] There should be no trailing spaces
+3: [minor] There should be no trailing spaces
+4: [minor] There should be no trailing spaces
+5: [minor] There should be no trailing spaces
+6: [minor] There should be no trailing spaces

sites/all/modules/fb_likebox/fb_likebox.admin.inc:
+1: [minor] There should be no trailing spaces
+2: [normal] Commits to the Git repository do not require the CVS $Id$ keyword in each file.
+7: [minor] There should be no trailing spaces
+12: [minor] There should be no trailing spaces
+16: [normal] use a space between the closing parenthesis and the open bracket
+17: [minor] There should be no trailing spaces
+18: [minor] There should be no trailing spaces
+30: [minor] There should be no trailing spaces
+36: [minor] There should be no trailing spaces
+38: [minor] There should be no trailing spaces
+43: [normal] Use an indent of 2 spaces, with no tabs
+44: [normal] Use an indent of 2 spaces, with no tabs
+44: [normal] Arrays should be formatted with a space separating each element and assignment operator
+44: [minor] There should be no trailing spaces
+45: [normal] Use an indent of 2 spaces, with no tabs
+46: [minor] There should be no trailing spaces
+52: [normal] Use an indent of 2 spaces, with no tabs
+53: [normal] Use an indent of 2 spaces, with no tabs
+53: [normal] Arrays should be formatted with a space separating each element and assignment operator
+53: [minor] There should be no trailing spaces
+54: [normal] Use an indent of 2 spaces, with no tabs
+55: [minor] There should be no trailing spaces
+61: [normal] Use an indent of 2 spaces, with no tabs
+62: [normal] Use an indent of 2 spaces, with no tabs
+62: [normal] Arrays should be formatted with a space separating each element and assignment operator
+62: [minor] There should be no trailing spaces
+63: [normal] Use an indent of 2 spaces, with no tabs
+64: [minor] There should be no trailing spaces
+70: [normal] Use an indent of 2 spaces, with no tabs
+71: [normal] Use an indent of 2 spaces, with no tabs
+71: [normal] Arrays should be formatted with a space separating each element and assignment operator
+71: [minor] There should be no trailing spaces
+72: [normal] Use an indent of 2 spaces, with no tabs
+73: [minor] There should be no trailing spaces
+74: [minor] There should be no trailing spaces
+79: [normal] Use an indent of 2 spaces, with no tabs
+80: [normal] Use an indent of 2 spaces, with no tabs
+80: [normal] Arrays should be formatted with a space separating each element and assignment operator
+80: [minor] There should be no trailing spaces
+81: [normal] Use an indent of 2 spaces, with no tabs
+82: [minor] There should be no trailing spaces
+83: [minor] There should be no trailing spaces
+84: [minor] There should be no trailing spaces
+90: [minor] There should be no trailing spaces
+96: [minor] There should be no trailing spaces
+97: [minor] There should be no trailing spaces
+98: [minor] There should be no trailing spaces
+99: [minor] There should be no trailing spaces
+100: [minor] There should be no trailing spaces
+101: [minor] There should be no trailing spaces
+107: [minor] There should be no trailing spaces
+109: [minor] There should be no trailing spaces
+111: [minor] There should be no trailing spaces
+113: [normal] use a space between the closing parenthesis and the open bracket
+117: [normal] use a space between the closing parenthesis and the open bracket
+117: [normal] Use uppercase for PHP constants, e.g. NULL, TRUE, FALSE
+120: [minor] There should be no trailing spaces
+123: [normal] use a space between the closing parenthesis and the open bracket
+126: [minor] There should be no trailing spaces
+128: [normal] use a space between the closing parenthesis and the open bracket

Status Messages:
Coder found 1 projects, 3 files, 1 critical warnings, 43 normal warnings, 63 minor warnings, 0 warnings were flagged to be ignored

attiks’s picture

double post

drozas’s picture

Status: Needs work » Needs review

Thanks a lot, attiks.
I have already committed the changes to fulfill the Drupal coding standards.

attiks’s picture

Status: Needs review » Reviewed & tested by the community

Nice work, some minor thing:
In the info file you may remove the version line, it will automatically added by drupal when the download links are generated.

For the rest it looks good to me, I'll ask a second opinion to make sure

drozas’s picture

Thanks attiks,

I have just committed the changes.

drozas’s picture

@attiks: should I change the status to 'needs review'?. Is there anything else I should do?. Thanks!

attiks’s picture

nothing you can do, sit back and relax

drozas’s picture

Thanks! :)

dave reid’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +PAreview: security

Seeing code like this in a template should be a red flag to check that those variables are being properly sanitized:

   8 <iframe
   9 src="http://www.facebook.com/plugins/likebox.php?href=<?php echo $fb_url ?>&width=<?php echo $fb_width ?>&colorscheme=<?php echo $fb_colorscheme ?>&show_faces=<?php echo $fb_show_faces ?>&bordercolor&stream=<?php echo $fb_stream ?>&header=<?php echo $fb_header ?>&height=<?php echo $fb_height ?>"
  10 scrolling="<?php echo $fb_scrolling ?>"
  11 frameborder="0"
  12 style="border:none; overflow:hidden; width:<?php echo $facebook_width ?>px; height:<?php echo $fb_height ?>px;"
  13 allowTransparency="true">
  14 </iframe>

Looking backwards, neither fb_likebox_theme() nor fb_likebox_block() sanitize variables like $fb_url, $fb_width, etc. I do notice that these text-input variables are controlled with validation in fb_likebox.admin.inc - but what happens when validation goes wrong? This is now open to security issues. Please see http://drupal.org/node/28984 and the section near the bottom on 'In practice'.

drozas’s picture

Thanks Dave,

I will look into it, and I will sanitize the variables as explain in that section.

Regards,

David

drozas’s picture

- Changes requested on http://drupal.org/node/1257326#comment-4902286 has been committed.
- README file has been extended to include some configuration examples.

attiks’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me, probable some one else will double check

drozas’s picture

Great, thanks!

tim.plunkett’s picture

Assigned: Unassigned » tim.plunkett
Status: Reviewed & tested by the community » Needs work

I only had time to look through the code now, I will do a functionality review hopefully tomorrow.

Please apply the patch (see http://drupal.org/node/52287 for commit message conventions), and set back to "needs review". Leave it assigned to me, so I don't lose track.

tim.plunkett’s picture

StatusFileSize
new12.8 KB

Attachment failed.

drozas’s picture

Status: Needs work » Needs review

Thanks tim.plunkett,

I have just applied and committed the patch, I set the following message: "Issue #1257326 by tim.plunkett: Applied patch fb_likebox-1257326-18.patch by tim.plunkett.", I hope I followed the standards to give credit properly (it is the first time).

I'll set back the state to "needs review" as stated on http://drupal.org/node/1257326#comment-4918728

Thanks a lot!,

David

attiks’s picture

Status: Needs review » Needs work
StatusFileSize
new1.51 KB

Another patch with some code correction and better use of the t() function.

Left as an exercise: You could move all your settings inside hook_block, it will make it easier for end-users to configure.

drozas’s picture

Status: Needs work » Needs review

Thanks attiks,

I have already applied the patch and committed the changes.

>>Left as an exercise: You could move all your settings inside hook_block, it will make it easier for end-users to configure.

I am planning to extend it in the future to allow users to create blocks dynamically, so I will apply these changes then. Thanks for the advice.

Regards,

David

drozas’s picture

Hi,

I have applied the changes suggested by attiks in the previous comment: http://drupal.org/node/1257326#comment-4922224
The settings are now inside the hook_block(). I have also added the LICENSE.txt and the CHANGELOG.tx file as explained in the coding standards.

The new commit is at: http://drupalcode.org/sandbox/drozas/1257306.git/commit/5dee518

Regards,

David

tim.plunkett’s picture

Status: Needs review » Needs work

Where in the coding standards does it say to have a LICENSE.txt? Unfortunately, that is incorrect, and you need to remove it.
Once you do that, I believe you are pretty much ready to go.

Sorry for another delay, but you are almost done!

drozas’s picture

Thanks tim.plunkett,

I will do a commit removing the license, I have seen it in other modules and I thought it was mandatory :).
I am really looking forward to, this is the first time I upload a module to drupal.org, and I am learning a lot :).

Cheers,

David

drozas’s picture

Status: Needs work » Needs review

Hi tim.plunkett,

The changes requested on http://drupal.org/node/1257326#comment-4993116 have been already applied on commit: http://drupalcode.org/sandbox/drozas/1257306.git/commit/2c52863

Thanks a lot!,

David

tim.plunkett’s picture

Status: Needs review » Fixed

The LICENSE.txt file is automatically added by the drupal.org packaging script when it makes the tgz/zip downloads, as well as adding the version information to the .info file.

I've granted you full project creation rights. Use this ability carefully!

Thank you for your patience.

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