Social Media Aggregator is a fast and efficient module for displaying the most popular socials feeds on your site. It provides an API for normalising the rendered output of social media from 3 core sources; Facebook, twitter an instagram. It provides a 'Social Media' field that can accept twitter, instagram and Facebook.
This module caches all queries to the social media source.
The module provides a field for you to attach standard social media to any content type.
Each sub module contains its own helper functions allowing you to select the appropriate resource in your fields.
This module differs from most social media related modules as it aims to normalise the theming output so you can blend social media sources together. The first version of this is in use on lush.co.uk
Sandbox Location: https://drupal.org/sandbox/scotthooker/2245205
Git: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/scotthooker/2245205.git social_media_aggregator
Other Reviews
-----
In order to help my application I have completed the following three reviews of other projects:
https://drupal.org/comment/8700489#comment-8700489
https://drupal.org/comment/8700373#comment-8700373
https://drupal.org/comment/8700383#comment-8700383
https://drupal.org/comment/8700391#comment-8700391
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | coder-results.txt | 5.39 KB | klausi |
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxscotthooker2245205git
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.
Comment #2
scotthooker commentedFixed issues returned from pareview.sh - except the issue in .api.inc as this is a false error.
Comment #3
scotthooker commentedComment #4
scotthooker commentedComment #5
scotthooker commentedComment #6
scotthooker commentedComment #7
scotthooker commentedComment #8
kevla commentedJust had a look at the module now, have to say it took me longer than it probably should have to realise what it does!
The automated test does fail on that one issue. Looking at the entity module (inside entity.api.php) that has the extension .api.php not api.inc. Inside that file it does declare the hooks using its modules prefixed name so perhaps the automated review isn't a false positive? Minor issue anyway and its good to see an api helper file.
In your facebook submodule, looking through the use of theme('image'), do the facebook images get alt text from anywhere? Just to help the screen readers out perhaps, even if its not content manageable.
All in all though pretty good. :)
Comment #9
scotthooker commentedI've renamed the file .api.php - some of the hooks in there are still unprefixed where appropriate to I will leave mine as is.
I'm updating the module description to be a bit more clearer describing what the module does!
Comment #10
dwkitchen commentedNow you have renamed the .api.php file it needs to move out of the includes folder and your admin.inc file should be moved in to there.
Comment #11
scotthooker commentedHi David,
Thank you very much for the review.
I have implemented those changes.
Comment #12
veso_83 commentedThe module looks great, the only thing is that the path in hook_menu should be changed to includes/social_media_aggregator.admin.inc
Comment #13
scotthooker commentedHi all,
Thanks for the reviews.
Veso_83 I've updated the path in hook menu
Comment #14
dwkitchen commentedAfter some testing with twitter ans facebook this module works as designed.
Comment #15
scotthooker commentedUpdating to critical due to the following 'Critical: Applications with a status of needs review that have been awaiting response from a reviewer for 4+ weeks.'
Comment #16
mpdonadioAutomated Review
Good :)
Manual Review
Module duplication is a problem on drupal.org. How does this differ from the other modules that provide similar features? You should elaborate on this in the description above and on the project page.
social-media-aggregator-item-theme.tpl.php, you are printing directly from $variables[]? If these are defined in the hook_theme, aren't they directly available? Personally, I would renamed this to social-media-aggregator-item.tpl.php
The docblock for social_media_aggregator_permission() is wrong.
Some of your helper functions need proper docblocks.
You have a few places where you are calling theme() and placing it into markup (eg, social_media_aggregator_facebook_build()). Proper render arrays with a #theme definition would be better.
social_media_aggregator_facebook_get_page_id() shoudl really use drupal_http_request() instead of curl.
In social_media_aggregator_instagram_user_search(), you don't need two empty() checks, just the !empty($cache->data), or the explicit expiration check. cache_get() will expire items for you.
In social_media_aggregator_instagram_user_search, I think you have a logic error if the item is cached. PHPStorm is saying that $account_id on line 101 is unused. You also have some undefined return paths.
In social_media_aggregator_instagram_load_master_account(), you don't need to wildcard the query if you are just returning one field.
This module looks very well written, am I may be a little dense here, but where is the actual atom content being sanitized? By my trace, social_media_aggregator_field_formatter_view() invokes the callback in the submodule, eg, social_media_aggregator_facebook_build(). This will get the posts, eg social_media_aggregator_facebook_get_posts(), which will normalize them via social_media_aggregator_facebook_normalizer(), but that's it. I am not seeing any of the text filtering API functions being called anywhere. Perhaps you need to add a formatter setting for an input format and then use that with check_markup() in social_media_aggregator_field_formatter_view()? Please don't remove the security tag, we keep that for statistics and to show examples of security problems. If I am shown to be wrong, I will remove it.
Comment #17
scotthooker commentedHey mpdonadio,
Thanks! Will work through your comments!
Comment #18
scotthooker commentedComment #19
scotthooker commentedModule duplication is a problem on drupal.org. How does this differ from the other modules that provide similar features? You should elaborate on this in the description above and on the project page.
I have updated the description above and on the project page
social-media-aggregator-item-theme.tpl.php, you are printing directly from $variables[]? If these are defined in the hook_theme, aren't they directly available? Personally, I would renamed this to social-media-aggregator-item.tpl.php
Renamed and variables updated
The docblock for social_media_aggregator_permission() is wrong.
Updated the docblock
Some of your helper functions need proper docblocks.
They should all be there and correct?
You have a few places where you are calling theme() and placing it into markup (eg, social_media_aggregator_facebook_build()). Proper render arrays with a #theme definition would be better.
These get thrown back into the render for field?
social_media_aggregator_facebook_get_page_id() shoudl really use drupal_http_request() instead of curl.
Facebooks tool for this is very picky and it would't work properly with drupal_http_request()
In social_media_aggregator_instagram_user_search(), you don't need two empty() checks, just the !empty($cache->data), or the explicit expiration check. cache_get() will expire items for you.
Updated
In social_media_aggregator_instagram_user_search, I think you have a logic error if the item is cached. PHPStorm is saying that $account_id on line 101 is unused. You also have some undefined return paths.
Updated
In social_media_aggregator_instagram_load_master_account(), you don't need to wildcard the query if you are just returning one field.
Updated
This module looks very well written, am I may be a little dense here, but where is the actual atom content being sanitized? By my trace, social_media_aggregator_field_formatter_view() invokes the callback in the submodule, eg, social_media_aggregator_facebook_build(). This will get the posts, eg social_media_aggregator_facebook_get_posts(), which will normalize them via social_media_aggregator_facebook_normalizer(), but that's it. I am not seeing any of the text filtering API functions being called anywhere. Perhaps you need to add a formatter setting for an input format and then use that with check_markup() in social_media_aggregator_field_formatter_view()? Please don't remove the security tag, we keep that for statistics and to show examples of security problems. If I am shown to be wrong, I will remove it.
Add some sanitisation where appropriate - some of the dependency modules do that already so have skipped it on those occasions
Hopefully that covers the issues! Thanks very much for the review much appreciated!
Comment #20
mpdonadioScott, if you think this is ready for another review, then change the status back to Needs Review. I likely can't take another look until Tuesday, but someone else may be able to in the meantime.
Docblocks. It looks like all of the helpers had one, but there were no @param or @return lines.
Render array. Yeah, you don't need to explicitly return markup. This lets other modules alter things before they get rendered. Poke around for some examples; it makes sense once you see some.
curl(). Leave a comment about that for future reference.
The output filtering / sanitization was the only blocker. I would comment as appropriate where another module is handling the sanitization.
Comment #21
scotthooker commentedNo problems! And seriously thanks for the awesome review.
I'll make the comments/amendments above then set it back.
Thanks again,
Scott
Comment #22
scotthooker commentedSetting back to needs review after updating comments above
Comment #23
mpdonadioScott, could of quick things about the changes you made.
I think your use of check_markup() everywhere isn't quite right. See https://drupal.org/node/28984 I think that only the post itself would need to be rich text and need check_markup(), the rest can likely be check_plain().
You are also doing the sanitization too deep; someone may want to get the raw normalized data. The Drupal way is to sanitize on output. Since some of your dependencies sanitize for you, the build functions in each submodule are probably the best place. This needs to be addressed.
Some side notes (non-blockers).
social_media_aggregator_field_formatter_view() doesn't explicitly need to render via theme(), it can return a render array w/ the #theme index in it. In general, #markup is only for simple things.
Long term, you may want to implement hook_views_data() to make the normalized data available to Views.
Comment #24
scotthooker commentedHi Again (and thanks again)
Reading that article makes sense now sanitising the build output makes sense and working through the dependencies the individual elements are sanitised where required as standard so all should be fine.
Long term I've started implementing views and a block (as used on lush.co.uk). Equally I plan to rework the formatter view like you show above.
Just trying to get this sorted before DrupalCon Austin!
Comment #25
scotthooker commentedComment #26
mpdonadioYour usage is still wrong. You can't call check_markup on the normalized $item. You need to sanitize each element in the $item.
You have
It should look something like:
Also also please excuse me for not catching your check_markup() usage. That should only be used if you allow the user to select an input format (like the body field on nodes). Otherwise, use filter_xss(). See https://drupal.org/writing-secure-code
Calling theme() directly and stuffing it into #markup still isn't the best, but that is not a blocking issue.
Comment #27
scotthooker commentedFilter XSS makes best sense in this instance as check_plain would remove the links to the social media sources.
I've started to implement https://drupal.org/node/930760 but will finish this work when I add the addition of the views and block integration.
Comment #28
scotthooker commentedComment #29
mpdonadioAlmost there. Sorry this keeps going back and forth, but security issues can't be skipped.
social_media_aggregator_twitter_build:54, remove the check_markup() around the $tweet. You filtered each element that goes to the screen, so it is safe.
social_media_aggregator_instagram_build:88, remove the check_markup() around the $post. You filtered each element that goes to the screen, so it is safe.
social_media_aggregator_facebook_build:72, remove the check_markup() around the $item. You filtered each element that goes to the screen, so it is safe.
If you do those three things, this is RTBC.
Comment #30
scotthooker commentedNo problem for me it going back and forth. Thank you for taking the time to review it!
Comment #31
scotthooker commentedComment #32
klausiReview 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. You have to get a review bonus to get a review from me.
manual review:
So the cURL peer verification is the last security blocker right now, otherwise this would be RTBC to me as well. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #33
scotthooker commentedUpdates made to add info to the api doc
Updates to remove the ssl security issue
Comment #34
scotthooker commentedUpdating priority as per submission guidelines
Comment #35
kaareAutomatic review
Still some length of line, capitalization and punctuation errors of some inline comments.
Manual review
social_media_aggregator.info: Thedescription =is almost exactly the same as the module's name. Browsing through the code it looks like this is more a field type than an API module. How about naming it "Social Media Aggregator" and as description say "Field type and API for collecting news feed from various social sites". Or separate it in two: One API and one field module.#descriptionof the individual input elements. I have no idea what to put here in the entity edit form.README.txt: Not one word about this being a field type.Summary
I like the idea, but the fact that it is a field type needs more focus. Project page, README, module descriptions, maybe even module decoupling.
Comment #36
scotthooker commentedHaving received multiple requests for a full release of this module I have updated the issues in #35.
I have added in a more complete read me.txt with installation instructions as well as updating module description.
I can't see any security problems now and these have been dealt with accordingly.
Code test passes.
People seem to want this module so happy to make more changes if required.
Comment #37
kaareWell, almost. In your
social_media_aggregator.api.php:29 I don't know what to do with the $source variable. As you're usingdrupal_alter()to provide this hook the thingy that should be altered need to be passed by reference.$sourceis conceptually also plural here:PAReview.sh also complains about some type hinting. Have a looksie: http://pareview.sh/pareview/httpgitdrupalorgsandboxscotthooker2245205git
Comment #38
scotthooker commented"PAReview.sh also complains about some type hinting. Have a looks:"
Ah ok missed off the hint inside the function. Sorted.
Thanks for the review :)
Comment #39
kaareshould be
Comment #40
kaareOn a general note, please don't change the meaning of an already posted comment after it is posted. Rather, post a new. Now my answer in #39 looks completely out of the blue as I replied to your #38 with the sound "Don't know why PAReview.sh complained".
Comment #41
scotthooker commentedNo problems. You replied too quickly ;)
Thanks for the reply though :)
Comment #42
scotthooker commentedklausi/kaare - are you happy with this now or does it still require some code changes?
Comment #43
kaare@scotthooker: You haven't addressed points 2. and 3. in @klausi's manual review in #32.
As for my review, I think the overall what does this module actually do problem space is the most pressing one.
Looking at your code in
social_media_aggregator.modulemost of it is related to your field type. Say it like it is or split it up.Comment #44
ajitsAdjusting the GIT clone URL so that the project gets downloaded in the directory with the project name.
Comment #45
scotthooker commentedHey AjitS
Thanks for that,
I will finish up this review in the next few days.
Comment #46
klausiSorry for the delay, make sure to complete your review bonus again and this will get finished faster.
manual review:
But that are not critical application blockers, otherwise looks RTBC to me. The review bonus tag is already removed, you can add it again if you have done another 3 reviews of other projects.
Assigning to jthorson as he might have time to take a final look at this.
Comment #47
scotthooker commentedHi Klausi,
No problem re the delay. It was the holiday period.
I'll sort those manual problems as they are mainly UX things.
Thanks,
Scott
Comment #48
scotthooker commented@Klausi - I've made changes for 1,2,3. Will update 4 shortly.
Comment #49
klausino objections for more than a week, so ...
Thanks for your contribution, scotthooker!
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.