1. This plugin enables users to share your content via MMS using the Mogreet Messaging Platform. This is different from most of sharing plugins which often enable users to share content on social websites.
You can see the plugin in action on the screenshots attached.

2. Link to the project: http://drupal.org/sandbox/jperichon/1371270

3. git clone --branch master jperichon@git.drupal.org:sandbox/jperichon/1371270.git moshare

4. This plugin is for Drupal 7.

CommentFileSizeAuthor
moshare_settings.png36.58 KBjperichon
moshare_in_action.png83.43 KBjperichon

Comments

patrickd’s picture

Status: Needs review » Needs work

You got some coding standart issues (See http://ventral.org/pareview/httpgitdrupalorgsandboxjperichon1371270git, you can use this site your self to re-test)
If you got any questions on this, please ask!

At least the following issues should be solved before switching back to 'need review':

  • Switching to a version specific branch (see link above)
  • all functions should be prefixed with your module/theme name to avoid name clashes.
  • README.txt is missing, see the guidelines for in-project documentation.
  • Remove LICENSE.txt, it will be added by drupal.org packaging automatically.

You implemented a function called sanitize. You should rather use api cleaning function for this (See http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/check_...)

You can also think about using dbtng queries instead of sql-query strings (the example module gives you a nice instruction about this http://drupal.org/project/examples)

You've only feeee....eewww comments in your code, please do some more commenting so other developers don't have to re-think your code. (There is a lot of space to add many many comments, yes I love comments)

/**
 * Implements hook_admin()
 */
function moshare_admin() {
    return drupal_get_form('moshare_form'); 
}

/**
 * Implements hook_menu()
 */
function moshare_menu() {
    $items['admin/config/moshare'] = array(
        'title'            => 'MoShare Settings',
        'description'      => 'Customize your MoShare widget',
        'page callback'    => 'drupal_get_form',
        'page arguments'   => array('moshare_admin'),
        'access arguments' => array('access administration pages')
    );
    return $items;
}

This calls drupal_get_form() twice what is really not necessary, please read the documentation about this and have a look on the example module.

Furthermore I'm not shure if your module has enough code to determine your skills seriously, maybe you could add some more functionality?

jperichon’s picture

Status: Needs work » Needs review

Thank you for you quick review!

Here are the modifications I made:
- fixed the coding standard issues
- switched to a version specific branch (7.X-1.x)
- added a README.txt
- removed the LICENSE.txt
- used an API cleaning function instead of my own sanitize()
- used dbtng queries instead of sql-query strings
- fixed the duplicate call to drupal_get_form()
- added more functions and inline comments

Thank you for your time!

jperichon’s picture

Priority: Normal » Major
afox’s picture

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

Hi @jperichon,

first of all, thanks for your submission. I didn't go through the module looking for coding standards misses, so I suggest that you look over it yourself with the coder-module. However I looked at your module and here's what I found:

  1. I don't think @author comments are used much. I haven't seen them really anywhere, so I they should be removed for consistencies sake. (Core group did this long time ago: http://drupal.org/node/90823)
  2. I'd prefer giving the admin a chance to use a local version of the JS file as you can never know if an external site is down. Also, when using drupal_add_js with an external javascript -file, use in the format:
    drupal_add_js('http://example.com/example.js', 'external');
    

    See http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_ad... for more info.

  3. Instead of
      // Gets the url of the node.
      global $base_url;
      if (module_exists('pathauto')) {
        $path_module = '/' . drupal_lookup_path('alias', "node/" . $node->nid);
      }
      else {
        $path_module = "/node/" . $node->nid;
      }
      $url = $base_url . $path_module;
    
    

    use:

    $url = url(current_path(),array('absolute'=>TRUE));
    

    For more information, goto http://api.drupal.org/api/drupal/includes--common.inc/function/url/7

  4. I'm not 100% sure about this, but I noticed that you are using $node->body['und'][0]… When doing an img tag search. The "und" is for "undecided language". Make sure this works also with multiple languages enabled.
  5. Always use the l() -function to create links.
  6. Use theme_image(…) or theme('image', …) to create image tags.
  7. Instead of creating a custom submit button for settings form and fetching options from the database, just remove the submit-button and use variable_get($name, $default = NULL) for getting the settings from Drupal's variable system and return system_settings_form($form) to insert a submit button and save the settings into the variable table.
    Example:
      $form['form']['my_form_element'] = array(
        '#title' => t('Title'),
        '#type' => 'textarea',
        '#default_value' => variable_get('my_form_element'),
      );
    
      return system_settings_form($form); 
    
  8. You can delete the moshare_get_options() -function for the variable system. See previous.

Those things said, you don't really need the install -file either as you can do all this with just variable_set() and variable_get(). I also strongly suggest that you'd make the image files and javascript files available locally. Also, how is this external JS-library licensed? Can you just pick it up? By the least, you will need to inform the user that you are using the library externally from another site. See http://drupal.org/node/422996

Generally speaking, I do agree with @patrickd that this is a very small module that provides very little functionality as it is. If I understood from quickly looking at mogreet.com, they have more API's and libraries than just this one. Maybe create a larger set that includes integrations from other mogreet libraries?

The other option is that it would be better off merged to some other, longer-standing sharing module?

Thank you for your effort! Hopefully we'll get a great module from you!

jperichon’s picture

Title: MoShare » moShare
klausi’s picture

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

Closing due to lack of activity. Feel free to reopen if you are still working on this application.