Pinto Image Formatter enables users to create pinterest-like image galleries and responsive grid layouts by using jQuery plugin Pinto.js with colorbox gallery option.
It uses JQuery Update and Libraries modules and the optional Colorbox module for fully responsive galleries.

Image titles are shown as image caption.

There are three default thumbnail Image styles, e.g. Pinto (220x). The user is able to create custom styles as well. The images can be linked to: none, content, original image and Colorbox modal. There's an option to align the images (center, right and left), plus an option to sets horizontal and vertical margins between images.

Demonstration link:

http://demo7.yonko-tsvetkov.com/pinto-image-formatter

A link to the project page:

https://www.drupal.org/sandbox/webriddle/2525442

A git clone command:


git clone --branch 7.x-1.x http://git.drupal.org/sandbox/WebRiddle/2525442.git pinto_image_formatter
cd pinto_image_formatter

Pareview review:

http://pareview.sh/pareview/httpgitdrupalorgsandboxwebriddle2525442git

Manual reviews of other projects:

[D7] user_data_wrapper: https://www.drupal.org/node/2549565#comment-10211887
[D7] Views Pipes: https://www.drupal.org/node/2443583#comment-10208631
[D7] CSS Autoload: https://www.drupal.org/node/2587323#comment-10564410

Comments

yonko.tsvetkov created an issue. See original summary.

yonko.tsvetkov’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.

yonko.tsvetkov’s picture

Issue summary: View changes
ivanzhu’s picture

I tested the module on my drupal site, but not works well.

1. pinto js not works when I resize the browser window. No js errors show in console. So strange for it.
2. It's not include js library in hook_init(), Instead, you can put it in hook_field_formatter_view().
3. It's not necessary to put your frontend files(js, css, tpl) in theme folder. Instead, you could create js, css and templates folder for each file. or put these under module root directory directly.
4. Reorder items in you *.info file. you could refer to https://www.drupal.org/node/542202
5.Please, Provide a link to your pareview review on the issue summary.

That's all, Thanks.

yonko.tsvetkov’s picture

Issue summary: View changes
yonko.tsvetkov’s picture

Hello ivanzhu,

Thank you for your review.

Regarding the first point - what theme have you used? It needs to be responsive in order to work well (e. g. Garland is OK but Bartik will not work)

For 2 issue - I moved libraries_load to hook_field_formatter_view().

3. I reorganised files

4. I changed the info file

5. I added Pareview review link in the issue summary text.

ivanzhu’s picture

@yonko.tsvetkov

Yes, It's works well on Garland theme. not Bartik.

yonko.tsvetkov’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus
yonko.tsvetkov’s picture

Issue summary: View changes
alexfarr’s picture

Hi,

I have had a look through your module and good news is it worked first time for me. I have found a few point that you might consider.
1: Should you be using drupal.behaviors to attach your js? as per https://www.drupal.org/node/756722
2: When you enable the pinto image formatter the title of the field is hidden behind the pinto gallery.

yonko.tsvetkov’s picture

Hello,

Thank you for your review and suggestions.
1. I don't use drupal.behaviors because of specific external script (pinto.js) issue. It works only when a window load function is used, but drupal.behaviors doesn't work with window load function.
2. I've fixed label issue.

thatpatguy’s picture

This module appears to work as intended. The Pareview output did mention that you have not set a default branch to your git repo, you may want to do that.

Automated Review

There are no errors or warnings:
http://pareview.sh/pareview/httpgitdrupalorgsandboxhenryw2496335git

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.

No duplication
Yes: Does not cause module duplication and/or fragmentation.

Master Branch
Yes: Does follow the guidelines for master branch.

Licensing
Yes: Follows the licensing requirements.

3rd party assets/code
Yes: Follows the 3rd party assets/code requirements.

README.txt/README.md
Yes: Follows 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
Yes: Meets the security requirements.

yonko.tsvetkov’s picture

Hi thatpatguy,

Thanks a lot for your review. I set a default branch.

devdokimov’s picture

Hello, @yonko.tsvetkov

I reviewed your module and didn't find any problems in your code:

Automated Review

There are no issues identified by pareview.sh:
http://pareview.sh/pareview/httpgitdrupalorgsandboxwebriddle2525442git

Manual Review

Individual user account
Follows the guidelines for individual user accounts.
No duplication
Does not cause module duplication and/or fragmentation.
Master Branch
Follows the guidelines for master branch.
Licensing
Follows the licensing requirements.
3rd party assets/code
Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Follows the guidelines for in-project documentation
Code long/complex enough for review
Follows the guidelines for project length and complexity.
Secure code
Meets the security requirements.

I noticed you fixed the problem noticed by @thatpatguy so I think this module is ready for the production use.

devdokimov’s picture

Status: Needs review » Reviewed & tested by the community
klausi’s picture

Issue summary: View changes
Issue tags: -PAreview: review bonus

Removing review bonus tag, you have not all manual reviews, you just posted the output of an automated review tool. Make sure to read through the source code of the other projects, as requested on the review bonus page.

yonko.tsvetkov’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus

Hi klausi, I've made a new review following the requirements and added the review bonus tag again.

klausi’s picture

Assigned: Unassigned » manjit.singh
Status: Reviewed & tested by the community » Needs work
Issue tags: -PAreview: review bonus +PAreview: security

manual review:

  1. "t('Image style') . ':</strong> ' . $image_styles_default": do not concatenate translatable strings with variables like that, us placeholders with t() instead. See https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/t/7
  2. There are multiple security issues in the code of this project. As part of our git admin training I'm assigning this to Manjit so that he can take a look if he has time. If he does not find anything I'm going to post the exploit details in one week. And please don't remove the security tag, we keep that for statistics and to show examples of security problems.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

klausi’s picture

Assigned: manjit.singh » Unassigned

Sorry for the delay, now revealing the security vulnerabilities:

  1. pinto_image_formatter_field_formatter_settings_summary(): this is vulnerable to XSS exploits. Variables such as $default_link are user provided text and need to be sanitized before printing. In your case using the appropriate placeholders with t() would solve the problem. Make sure to read https://www.drupal.org/writing-secure-code again.
  2. pinto_image_formatter_field_formatter_view(): This is also vulnerable to XSS attacks. If I enter <script>alert('XSS');</script> as title or alt text for an image then you will get nasty javascript popups. Again, make sure to sanitize user provided text before printing to HTML. This is more severe, since anyone that can create content on the site can perform the XSS attack on admins.
manjit.singh’s picture

Thanks a lot Klausi, Actually i had not found these.
@yonko.tsvetkov Can you please look into these then i will retest once you fixed.

yonko.tsvetkov’s picture

Hello Manjit Singh,

Thank you for your time. I've fixed the problems in the module file including those regarding security vulnerabilities.

PA robot’s picture

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

Closing 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.

yonko.tsvetkov’s picture

Status: Closed (won't fix) » Needs review
mrmysterious2502’s picture

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
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
Yes: Follows 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
Yes: Meets the security requirements
Coding style & Drupal API usage
  1. Looks good! Author seems to have a clear understanding of what's happening. Module installs. Bada bing!

This review uses the Project Application Review Template.

klausi’s picture

Status: Needs review » Needs work

manual review:

  1. pinto_image_formatter_field_formatter_settings_summary(): Variables such as $default_link are now double escaped, which is bad. The "@" placeholder with t() already sanitized variables for you, so the additional check_plain() should be removed.
  2. pinto_image_formatter_field_formatter_settings_form(): the check_plain() calls are wrong here because the Form API will already sanitize #default_value and #options for you. Make sure to read https://www.drupal.org/node/28984 again.
  3. pinto_image_formatter_field_formatter_view(): this is still vulnerable to XSS. If I enter 0});alert('XSS');});})(jQuery);// as Margin X in the field formatter settings then there will be a nasty javascript popup. Do not concatenate the settings variables to Javascript directly, use Drupal.settings to pass down variables from PHP to Javascript. See https://www.drupal.org/node/756722
PA robot’s picture

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

Closing 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.