Overview

This module will implement on Drupal the Social Sharing Buttons by GetSocial.io is an all in one toolkit to help you grow your traffic, social shares, followers & conversions. With +15 different apps, we help you grow your website with sharing, following, tracking & engagement apps. Super easy to install, mostly no code required.

This will inject a javascript library to make API calls to the GetSocial API, which will return social bar codes to display in your pages.

Project Page
https://www.drupal.org/sandbox/azeiteiro/2544600

Clone in git

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/azeiteiro/2544600.git getsocial_share_buttons
cd getsocial_share_buttons 

Reviews of other projects
https://www.drupal.org/node/2442327#comment-10238149
https://www.drupal.org/node/2491645#comment-10237511
https://www.drupal.org/node/2541320#comment-10236953
--
https://www.drupal.org/node/2554797#comment-10256437
https://www.drupal.org/node/2508285#comment-10256625
https://www.drupal.org/node/2501525#comment-10256677

CommentFileSizeAuthor
#15 error.png123.96 KBrashid_786
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

azeiteiro created an issue. See original summary.

PA robot’s picture

Issue summary: View changes
Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxazeiteiro2544600git

Fixed the git clone URL in the issue summary for non-maintainer users.

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.

azeiteiro’s picture

Issue summary: View changes
azeiteiro’s picture

Status: Needs work » Needs review

Reviewed auto testing tool errors

ARUN AK’s picture

Status: Needs review » Needs work

Automated Review

Fix all PAReview issues http://pareview.sh/pareview/httpgitdrupalorgsandboxazeiteiro2544600git.

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

(*) Remove Unwanted files and folders from the repository.
(*) Remove .svn folder from lib, and img folders.
(*) If you use variables, you have to erase them on uninstall. You may follow this:
https://www.drupal.org/node/2274697
(+) Please follow drupal coding standards and don't include the js in the below manner:

    $GS = share_buttons_analytics_by_getsocial_get_gs();

    // On admin pages load the necessary files to create the configuration page 
    if (user_access('administer modules') && path_is_admin(current_path())) {
      echo $GS->share_buttons_analytics_by_getsocial_set_js_variables();
    } 
    else { 
      echo $GS->share_buttons_analytics_by_getsocial_get_lib();
    }
    

use drupal_add_js() function to add js.
(+) In hook_menu() you are defining same url(admin/config/services/get_social) two times for change the callback function and you are clearing cache when user submit the registration form.

    // clear cache
    drupal_flush_all_caches();
    

Instead of defining same url two times, you can do alterations inside callback functions. Based on condition you can alter admin config form instead of re-initialize the admin url. So that you can avoid unnecessary use of drupal_flush_all_caches() function.
(*) Make use of Drupal Behaviours in your javascript code. You can refer JavaScript coding standards

azeiteiro’s picture

Fixed all PAReview issues;

Fixed error found in the manual review;

azeiteiro’s picture

Status: Needs work » Needs review

Fixed all PAReview issues;

Fixed error found in the manual review;

PA robot’s picture

Issue summary: View changes

Fixed the git clone URL in the issue summary for non-maintainer users.

I'm a robot and this is an automated message from Project Applications Scraper.

rashid_786’s picture

Kindly abbreviate your module name properly. It should be easy to read and understand.

Refer name convention here https://www.drupal.org/node/299070

azeiteiro’s picture

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

Changed module name to a smaller one;

Add reviews of other projects;

rashid_786’s picture

Change your git clone url with update module name.

e.g. git clone --branch 7.x-1.x http://git.drupal.org/sandbox/azeiteiro/2544600.git UPDATED MODULE NAME
cd UPDATED MODULE NAME.

azeiteiro’s picture

Issue summary: View changes

Change git clone URL

azeiteiro’s picture

Assigned: azeiteiro » Unassigned
azeiteiro’s picture

Title: Social Sharing, Follow Bar & Share Buttons by GetSocial.io » [D7] Social Sharing, Follow Bar & Share Buttons by GetSocial.io
rashid_786’s picture

Status: Needs review » Needs work
FileSize
123.96 KB

Automated Review:
* Lots of issues found in automated review : http://pareview.sh/pareview/httpgitdrupalorgsandboxazeiteiro2544600git

Manual Review
* Implements hook_help()
It is recommended to get the basic understanding of the module to new users.

/**
 * Use hook_page_build() to add CSS to the page.
 */
function getsocial_share_buttons_page_build() {

  if (arg(0) == 'admin') {
    drupal_add_css('//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400italic,600,700|Raleway:800', 'external');
    drupal_add_css('//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css', 'external');
  }
}

* In above code, you are directly embedding external css on the admin page which is taking too much time to load and creating dependency on other server. Is there possibility if you can have those in your module in css directory.

* After installing the module, went to configuration and tried to activate account but found fatal error as in attachment.

azeiteiro’s picture

Status: Needs work » Needs review
Issue tags: -PAreview: review bonus

Thank you.

Fixed all errors from manual review.

Automatic review errors:
- Variables are system variables, can't start with module name;
- Since form values are changed via JS on form submit, the way to get tis value is trough $form_state['values'];

Changed to needs review.

azeiteiro’s picture

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

Add 3 more manual reviews to speedup review

azeiteiro’s picture

Priority: Normal » Critical

Change applications priority to critical since it has been awaiting response from a reviewer for 4+ weeks

klausi’s picture

Priority: Critical » Normal
Status: Needs review » Needs work

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

  • ./README.txt: the byte order mark at the beginning of UTF-8 files is discouraged, you should remove it.
  • ESLint has found some issues with your code (please check the JavaScript coding standards).
/home/klausi/pareview_temp/js/plugin.js: line 30, col 9, Error - Expected indentation of 6 space characters but found 8. (indent)
/home/klausi/pareview_temp/js/plugin.js: line 31, col 9, Error - Expected indentation of 6 space characters but found 8. (indent)
/home/klausi/pareview_temp/js/plugin.js: line 32, col 9, Error - Expected indentation of 6 space characters but found 8. (indent)
/home/klausi/pareview_temp/js/plugin.js: line 33, col 9, Error - Expected indentation of 6 space characters but found 8. (indent)
/home/klausi/pareview_temp/js/plugin.js: line 34, col 9, Error - Expected indentation of 6 space characters but found 8. (indent)
/home/klausi/pareview_temp/js/plugin.js: line 35, col 9, Error - Expected indentation of 6 space characters but found 8. (indent)
/home/klausi/pareview_temp/js/plugin.js: line 36, col 9, Error - Expected indentation of 6 space characters but found 8. (indent)
/home/klausi/pareview_temp/js/plugin.js: line 37, col 9, Error - Expected indentation of 6 space characters but found 8. (indent)
/home/klausi/pareview_temp/js/plugin.js: line 75, col 7, Error - Expected indentation of 4 space characters but found 6. (indent)
  • DrupalPractice has found some issues with your code, but could be false positives.
    FILE: /home/klausi/pareview_temp/getsocial_share_buttons.module
    ---------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    ---------------------------------------------------------------------------
     277 | WARNING | Do not use the raw $form_state['input'], use
         |         | $form_state['values'] instead where possible
     279 | WARNING | Do not use the raw $form_state['input'], use
         |         | $form_state['values'] instead where possible
    ---------------------------------------------------------------------------
    
  • 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. "'#markup' => '<p>To get started click on the button below to automatically activate your GetSocial account.</p>',": all user facing text must run through t() for translation. Also elsewhere, please check all your #markup and #title strings that contain user facing text.
    2. getsocial_share_buttons_init(): hook_init() is executed on every single page request, even on drush invocations. Use hook_page_build() instead to add JS.
    3. gs.inc: instead of having inline javascript here you should move that to a dedicated JS file and pass down settings with Drupal.settings from PHP to JS. See https://www.drupal.org/node/756722
    4. The indentation in your scss file is wrong, always use 2 spaces.
    5. font-awesome: appears to be 3rd party code. 3rd party code is not generally allowed on Drupal.org and should be deleted. This policy is described in the getting involved handbook. It also appears in the terms and conditions you agreed to when you signed up for Git access, which you may want to re-read, to be sure you're not violating other terms. Tell users where to download font awesome if they need it.

    font-awesome is a blocker right now.

    azeiteiro’s picture

    Status: Needs work » Needs review

    Fixed all issues from the manual review.

    Fixed errors from the automated tests, expect the following from the DrupalPractice:

    1. All variables defined by your module must be prefixed with your module's name to avoid name collisions with others.
      The variables used are "site_name" and "site_mail", both are Drupal system variables, not module specific.

    2. Do not use drupal_add_js() in hook_page_build(), use #attached on the $page render array instead
      This is used to inject javascript in every page on the frontend, so the GetSocial library can be loaded when it is installed. The backoffice JS is added via #attached

    3. Do not use the raw $form_state['input'], use $form_state['values'] instead where possible
      The form values are changed via javascript after a Ajax request, so in order to get this new values from the DOM, the $form_state['input'] is needed
    klausi’s picture

    Assigned: Unassigned » dman
    Status: Needs review » Reviewed & tested by the community

    manual review:

    Otherwsie looks RTBC to me. Assigning to dman as he might have time to take a final look at this.

    azeiteiro’s picture

    Thank you very much for your review, klausi.

    About change the javascript load, currently I load it like this:

    drupal_add_js(drupal_get_path('module', 'getsocial_share_buttons') . '/js/getsocial_frontend.js');

    To load it via page builder array, should I changed it for this code?

    $page['content']['#attached']['js'] = array(
    drupal_get_path('module', 'getsocial_share_buttons') . '/js/getsocial_frontend.js',
    );

    klausi’s picture

    Assigned: dman » Unassigned
    Status: Reviewed & tested by the community » Fixed

    no objections for more than a week, so ...

    Thanks for your contribution, azeiteiro!

    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.

    Status: Fixed » Closed (fixed)

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