This module requires the Shortcodes module.
This also works with the Shortcode for Wysiwyg module.

The shortcode social module is an extension to the shortcode module. This module allows the user to easily embed social media content within a WYSIWYG editor using shortcodes, taking away the need to use iframes or the normal social media embed codes making it a more user friendly experience.

Shortcodes currently available:

  • [twitter]Tweet URL[/twitter]
  • [instagram]Instagram URL[/instagram]
  • [flickr]Flickr URL[/flickr]
  • [facebook]Facebook URL[/facebook]

Automated testing by Pareview: http://pareview.sh/pareview/httpgitdrupalorgsandboxliampower2577405git

The sandbox module can be found here: https://www.drupal.org/sandbox/liampower/2577405

Manual Reviews:
https://www.drupal.org/node/2592703#comment-10949095
https://www.drupal.org/node/2279865#comment-10949133
https://www.drupal.org/node/2466967#comment-10949205

CommentFileSizeAuthor
#13 coder-results.txt2.39 KBklausi

Comments

LiamPower created an issue. See original summary.

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.

ItangSanjana’s picture

Automated Review

http://pareview.sh/pareview/httpgitdrupalorgsandboxliampower2577405git

Note that perfect adherence to Drupal Coding Standard is NOT a reason to block an application, except for total disregard of them. However, modules should follow them as closely as possible.

Manual Review

Coding style & Drupal API usage
List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance.
  1. Do not use drupal_add_js() in hook_page_build(), use #attached on the $page render array instead

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.

liampower’s picture

Assigned: Unassigned » liampower
Status: Active » Needs review

@ItangSanjana Thanks for the review.

I've updated that although I believe it is just a recommendation for D7 as it's deprecated in D8, although it's still widely used in contrib modules within D7.

sdstyles’s picture

Status: Needs review » Needs work

Automated Review

No issues found by Pareview

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
No: Causes module duplication and/or fragmentation. I've found Shortcode for Wysiwyg which seems to have the same functionality.
No duplication
[Yes: Does not cause] module duplication and/or fragmentation.
I checked Shortcode for Wysiwyg module and it's just a small API that provide a plugin for Wysiwyg, I'm not sure if this module take any advantages of it.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
No: Does not follow the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
No: List of security issues identified.
  1. In hook_menu() access callback always is TRUE
  2. In hook_preprocess_html() is not safe to add js directly in markup, and also is a good practice to use Drupal.behaviors for you javascript
Coding style & Drupal API usage
List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. (*) Major finding, needs work
  2. (+) Release blocker
  3. Just a recommendation
  4. ...

Just a recommendations:

  1. In _shortcode_social_is_json() I'll recommend to use drupal_json_decode() from Drupal API.
  2. Please document correctly used hooks, take a look at shortcode_social_shortcode_info() seems to be a custom function provided by your module, but is a hook, hook_shortcode_info() provided by Shortcode module.
  3. In module info you added dependency to filter module, I think is useless because shortcode already depends of filter module and your module has shortcode as dependency. I'll recommend to have wysiwyg as dependency too.

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.

liampower’s picture

@sdstyles, thank you for the review.

I have updated my README.txt file to follow the template format.

I have also removed my usages of hook_menu and opted to use jsonp instead of a callback so that removes the security concern around that.

I've moved the Facebook API JS to be added in to the page using #attached JS so it isn't done directly in to the markup.

As for your recommendations:

  1. _shortcode_social_is_json() has been removed as it's being taken care of by jsonp
  2. I've updated the document for that function to show it implements a hook
  3. I've removed the filter dependency as recommended. I haven't added a dependency on WYSIWYG as the shortcode module implements similar functionality and I believe it can be used with the CKeditor module as well - but I haven't tested this.
liampower’s picture

Status: Needs work » Needs review
khaled.zaidan’s picture

Automated Review

Nothing here

Manual Review

Individual user account
Yes: Follows
No duplication
Yes: Does not cause
Master Branch
Yes: Follows
Licensing
Yes: Follows
3rd party assets/code
Yes: Follows
README.txt/README.md
Yes: Follows
Code long/complex enough for review
[Yes: Follows / No: Does not follow] the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements
Coding style & Drupal API usage
Looks good

This review uses the Project Application Review Template.

ItangSanjana’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. RTBC...

liampower’s picture

Thanks for the reviews

liampower’s picture

Assigned: liampower » Unassigned
liampower’s picture

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

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new2.39 KB

Review of the 7.x-1.x branch (commit 0005c31):

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.
  • ESLint has found some issues with your code (please check the JavaScript coding standards).
    /home/klausi/pareview_temp/shortcode_social.js: line 12, col 22, Error - Strings must use singlequote. (quotes)
    /home/klausi/pareview_temp/shortcode_social.js: line 34, col 21, Error - Strings must use singlequote. (quotes)
    /home/klausi/pareview_temp/shortcode_social.js: line 35, col 24, Error - Strings must use singlequote. (quotes)
    
    3 problems
    
  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

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.

manual review:

  1. theme_shortcode_embed(): doc block is wrong, see https://www.drupal.org/coding-standards/docs#themeable . Also elsewhere.
  2. shortcode_social_theme(): all the variables are missing that you pass on to the theme function? link is not even used? There should be url, class and type, right?

But otherwise looks good to me.

Thanks for your contribution, Liam!

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.

liampower’s picture

Thanks klausi, I'll take a look at those suggestions and make the changes now.

Status: Fixed » Closed (fixed)

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