Albacross Drupal module provides simple functionality that appends javascript code to the page including admin entered tracking ID(which obtains on albacross.com website) and then allows to track viewers of website and see all the analytics and metrics on the Albacross control panel.

Link to project: https://www.drupal.org/project/albacross

Comand line arguments for git clone:

git clone --branch 7.x-1.x https://git.drupal.org/project/albacross.git
cd albacross

Comments

albacross created an issue. See original summary.

albacross’s picture

Issue summary: View changes
harishh’s picture

Hi ALBACROSS,

1. Please check with automated review tool and correct it.
https://pareview.sh/pareview/https-git.drupal.org-project-albacross.git

2. Please remove unwanted comments from the .module file.

harishh’s picture

Status: Needs review » Needs work
albacross’s picture

Alright, so i've fixed all of the problems there only left git(with master branch which is unused) and unittests, which i will add after creating a release.

Here's the link:
https://pareview.sh/pareview/https-git.drupal.org-project-albacross.git-...

albacross’s picture

Status: Needs work » Needs review
logesh waran’s picture

Hi albacross,

When i reviewed your module, i found "albacross" external script file path (serve.albacross.com/track.js) mentioned in your module's "hook_preprocess_page". Albacross script file is hardcoded in the hook.

There might be chance of changing the script file name or URL in future by albacross third party. It is better to have another configuration field just like "albacross_drupal_trackid" to update the "Albacross Script path". Can avoid hardcoded URLs. :)

Thanks,
Logeshwaran

logesh waran’s picture

albacross’s picture

Hi Logesh,

Thank you for your advice, but there's no chance of changing of this URL in the future, and we only need to provide easy-to-install module for users, to be able to integrate albacross services with their Drupal website :)

Have a great day
Albacross

avpaderno’s picture

Priority: Normal » Major

To the reviewers: Please set the priority to Normal after reviewing the project.

rajeevgole’s picture

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

Few suggestions:

  1. You are using a variable “albacross_drupal_trackid” which will reside in the database. It would be great if you delete this variable when the module is uninstalled.
  2. From the hook_help and comments in the .module file, I got that the script will be added in the footer. It would be great if you share this information in README.txt file and on the project page as well.
  3. In the hook_form_validate, I don’t see the appropriate messages as per your logic. For example:
    if (!is_numeric($trackId)) {
        form_set_error('albacross_drupal_trackid', t('You must enter correct Track ID for your Albacross account'));
      }
    

    Here, probably “Please enter numeric tracking id from your Albacross account.” would be more clear to the user.

    Similarly,

    elseif ($trackId <= 0) {
        form_set_error('albacross_drupal_trackid', t('You should not use minus in front of your Track ID'));
      }
    

    This message would show in the case of zero(0) tracking id. So you can change it to like “Non-negative tracking id is not allowed."

avpaderno’s picture

Also, a form validation handler is not an implementation of hook_form_validate(), which is not a hook Drupal core uses.

/**
 * Implements hook_form_validate().
 */
function albacross_drupal_form_validate($form, &$form_state) {
  $trackId = $form_state['values']['albacross_drupal_trackid'];
  if (!is_numeric($trackId)) {
    form_set_error('albacross_drupal_trackid', t('You must enter correct Track ID for your Albacross account'));
  }
  elseif ($trackId <= 0) {
    form_set_error('albacross_drupal_trackid', t('You should not use minus in front of your Track ID'));
  }
}

If $trackID cannot contain a floating point number or an exponential number, the following code should be preferable.

/**
 * Form validation handler for albacross_drupal_form().
 */
function albacross_drupal_form_validate($form, &$form_state) {
  $trackId = $form_state['values']['albacross_drupal_trackid'];
  if (((string) (int) $trackId !=== (string) $trackId) || $trackId <= 0) {
    form_set_error('albacross_drupal_trackid', t('The track ID must be a positive integer'));
  }
}
avpaderno’s picture

Anyway, those aren't application stoppers, except the first one: A module needs to remove the persistent variables it uses.
It is better to delete the variables one by one with variable_del(), rather than using a database query that deletes all the persistent variables whose name starts with the module name.

avpaderno’s picture

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

If you are still working on this application, you should fix all known problems and set the status to Needs review. (See also the project application workflow.)
Please don't change status of this application if you aren't sure you have time to dedicate to this application, or it will be closed again as won't fix.

I am closing this application due to lack of activity.