CVS edit link for bolchowka

I am working on integrating Drupal.org with LiveChat (www.livechatinc.com). Users will be able to create a LiveChat license from within the module settings page and start using the software in few minutes.

Comments

bolchowka’s picture

Title: bolchowka [bolchowka] » Drupal & LiveChat (www.livechatinc.com) integration
Assigned: Unassigned » bolchowka
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new19.53 KB

LiveChat module for Drupal is ready! Please see the attachment.

I would love to get the CVS account to upload this module to the main Drupal repository. Thank you in advance.

avpaderno’s picture

Title: Drupal & LiveChat (www.livechatinc.com) integration » bolchowka [bolchowka]
Assigned: bolchowka » Unassigned
Status: Needs review » Needs work
Issue tags: +Module review

Hello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review the code, pointing out what it needs to be changed.

As per requirements, the motivation message should be expanded to contain more features of the proposed project. For themes, it should include also a screenshot of the theme, and (when possible) a link to a working demo site using the proposed theme; for modules, it should include also a comparison with the existing solutions.

bolchowka’s picture

StatusFileSize
new19.69 KB

kiamlaluno, thank you for your comment.

I have updated the module to meet the requirements of Drupal coding standards. Please find the latest LiveChat Drupal module version attached.

bolchowka’s picture

Status: Needs work » Needs review
bolchowka’s picture

The motivation message:

LiveChat is a very advanced yet easy-to-use solution for providing instant live chat support for the website visitors. In includes many unique features not available in the solutions already existing in Drupal. Here are some of them:

  • Desktop sharing - LiveChat operator can help the visitor by setting up a remote desktop session. If the visitor agrees, the operator has full access to his deskto what lets him provide a very professional and instant help and support. More information can be found in tutorial: Desktop sharing.
  • Multiple languages support - currently LiveChat window is translated into 13 languages: Chinese, Český, Deutsch, Ελληνικά, English, Espańol, Français, Italiano, Polski, Português, Русский, Svenska, Slovenský. More translations are currently in progress.
  • Many professional integrations with other software, including Google Analytics, Zendesk, Salesforce, Shopify, Wordpress and Joomla!. More details can be found here: LiveChat Add-ons & Extras.
  • Supervising chats - LiveChat operator can supervise chats held by other operators. This gives him a possibility to whisper a message to a less experienced operator with some suggestions regarding current chat session or the website visitor. Moreover, the chat supervisor can join the conversation at any time to directly talk to the customer. More information can be found in Supervise chats tutorial.

I hope this covers many unique features that LiveChat solution provides. I hope this is a sufficient proof of why LiveChat would be a valuable module available to Drupal users.

Great customers' opinions just prove our software is used with a great success by many well-known companies and organisations including Volkswagen, Mazda, Codero, ControlScan, Kaspersky and Unicef. The software available in Drupal will have exactly the same functionalities for Drupal users. For the customers list and testimonials see our Customers list.

avpaderno’s picture

Status: Needs review » Needs work
  1. See http://drupal.org/coding-standards to understand how a module should be written; in particular see how code should be formatted, how constants should be written, and how implementations of hooks should be commented.
  2. License files are not allowed in Drupal.org repository. The license for any file committed in Drupal.org repository is the same used by Drupal.
  3. What is the license for Livechat.php?
  4. Files available from third-party sites should not be committed in Drupal.org repository.
  5. hook_requirements() should be placed in the installation file.
  6. The files chat_button.php, and monitoring_code.php don't contain PHP code; the extension of the files is not correct.
bolchowka’s picture

Status: Needs work » Needs review
StatusFileSize
new14.46 KB

Hello again,
please find the fixed module attached. Below I commented the issues you mentioned.

1. See http://drupal.org/coding-standards to understand how a module should be written; in particular see how code should be formatted, how constants should be written, and how implementations of hooks should be commented.

I hope that now everything is all right.

2. License files are not allowed in Drupal.org repository. The license for any file committed in Drupal.org repository is the same used by Drupal.

License file has been removed from LiveChat module.

3. What is the license for Livechat.php?

The license inherits the whole Drupal license (GPL). Do I need to tell this explicitly somewhere?

4. Files available from third-party sites should not be committed in Drupal.org repository.

LiveChat module does not include any third-party files. For example, it uses jQuery library included within default Drupal installation.

5. hook_requirements() should be placed in the installation file.

Done.

6. The files chat_button.php, and monitoring_code.php don't contain PHP code; the extension of the files is not correct.

Renamed .php into .txt.

I hope that the module should be fine now. I'm looking forward to hearing from you soon.

Thank you very much for the review.

Best regards

bolchowka’s picture

Hello,
could you please review the module after my latest fixes? It has been a week since they've been introduced.

Thank you!

bolchowka’s picture

Is there any chance that this module will be reviewed? It is waiting for approval for a month now...

avpaderno’s picture

Status: Needs review » Needs work
  • The points reported in this review are not in order or importance / relevance.
  • Most of the times I report the code that present an issue. In such cases, the same error can be present in other parts of the code; the fact I don't report the same issue more than once doesn't mean the same issue is not present in different places.
  • Not all the reported points are application blockers; some of the points I report are simple suggestions to who applies for a CVS account. For a list of what is considered a blocker for the application approval, see CVS applications review, what to expect. Keep in mind the list is still under construction, and can be changed to adapt it to what has been found out during code review, or to make the list clearer to who applies for a CVS account.
  1. package = LiveChat
    project = "livechat"
    version = "1.0.2"
    
    

    Those lines need to be removed. The package line is used when the module is part of a group of modules, or when the value used as package name is already used from other modules.

  2.     $livechat = Livechat::get_instance();
    
    

    When the installation file is loaded, the module file could be not loaded; in that case, the class would not be found.

  3. Drupal variables defined from the module should not be initialized in hook_install().
  4. require_once drupal_get_path('module', 'livechat') . '/Livechat.php';
    
    

    It usually not a good idea to unconditionally include code contained in PHP files. If the files contain form handlers, theme functions, or menu callbacks, Drupal core code allows to third-party modules to define which files must be loaded in the implementations of hook_menu(), and hook_theme(); in these cases, Drupal loads the file only when necessary.
    If the file needs to always be loaded, then it should be merged with the module file.
    There is a Drupal function to load files containing PHP code.

  5.       '#type' => 'markup',
          '#value' => t('<div class="messages installed_ok">Your LiveChat monitoring code is installed properly.</div>')
    
    

    When possible, HTML tags should not be included in strings to translate; in this case it is possible, as the tags are at the beginning and the end of the string.

  6.   $form['choose_form'] = array
      (
        '#type' => 'markup',
        '#value' =>
          '<fieldset>'.
          '<h3>Do you already have a LiveChat account?</h3>'.
          '<ul id="choose_form">'.
          '<li><input type="radio" name="choose_form" id="choose_form_0"' . ($livechat->is_installed() ? '' : ' checked="checked"') . '> <label for="choose_form_0">No, give me new LiveChat account for free</label></li>'.
          '<li><input type="radio" name="choose_form" id="choose_form_1"' . ($livechat->is_installed() ? ' checked="checked"' : '') . '> <label for="choose_form_1">Yes, I already have a LiveChat account</label></li>'.
          '</ul>'.
          '</fieldset>'
      );
    
    

    Why isn't the code using a Drupal form field, in this case?

  7.  $form['new_account']['livechat_account_website'] = array
      (
        '#type' => 'textfield',
        '#title' => t('Website'),
        '#size' => 30,
        '#maxlength' => 70,
        '#required' => FALSE,
        '#default_value' => $base_url
      );
      
    

    The default value for #required is FALSE; there is no reason to add it, if it is using the default value.

  8. See http://drupal.org/coding-standards to understand how a module should be written. In particular, see how the code should be formatted.
  9.   if ($phase == 'install') {
        // Test PHP version
        $requirements['php'] = array(
          'title' => $t('PHP'),
          'value' => ($phase == 'runtime') ? l(phpversion(), 'admin/logs/status/php') : phpversion(),
        );
        if (version_compare(PHP_VERSION, LIVECHAT_PHP_VERSION) < 0) {
          $requirements['php']['description'] = $t('Your PHP installation is too old. LiveChat requires at least PHP %version.', array('%version' => LIVECHAT_PHP_VERSION));
          $requirements['php']['severity'] = REQUIREMENT_ERROR;
        }
      }
    
    

    All that code can be replaced from a line in the .info file.

  10. The class Livechat doesn't follow the Drupal coding standards.
avpaderno’s picture

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

I am closing this issue due to lack of replies.

avpaderno’s picture

Component: Miscellaneous » new project application
Issue summary: View changes

Please read the following links as this is very important information about CVS applications.