This module creates a Kewego PHP Stream Wrapper for Resource and implements the various formatter and file listing hooks in the Media module.
This project is inspired by the Media: Youtube project. It use kewego API to get thumbnails and embed code from Kewego API (http://www.kewego.com).
Here is the link to my sandbox project : http://drupal.org/sandbox/camdarley/1315808
This module is in use on a production site, see http://events.eurocopter.com

CommentFileSizeAuthor
#7 drupalcs-result.txt17.93 KBklausi
#5 drupalcs-result.txt43.17 KBklausi

Comments

chakrapani’s picture

Status: Needs review » Needs work

It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:

  • Run coder to check your style, some issues were found (please check the Drupal coding standards):
    Severity minor, Drupal Commenting Standards, Internationalization, Drupal Security Checks, Drupal SQL Standards, Drupal Coding Standards
    
    sites/all/modules/pareview_temp/test_candidate/media_kewego.module:
     +107: [minor] There should be no trailing spaces
     +110: [normal] Menu item titles and descriptions should NOT be enclosed within t().
     +118: [minor] There should be no trailing spaces
     +131: [minor] There should be no trailing spaces
     +137: [minor] Missing period
     +137: [minor] 'Implements' should be at the start of the sentence and begin with a capitialized letter
     +149: [minor] Missing period
     +149: [minor] 'Implements' should be at the start of the sentence and begin with a capitialized letter
     +156: [normal] Use uppercase for PHP constants, e.g. NULL, TRUE, FALSE
     +168: [minor] There should be no trailing spaces
     +178: [minor] There should be no trailing spaces
     +180: [normal] missing space after comma
     +181: [minor] There should be no trailing spaces
     +183: [minor] There should be no trailing spaces
     +184: [normal] Control statements should have one space between the control keyword and opening parenthesis
     +186: [normal] Use an indent of 2 spaces, with no tabs
     +186: [minor] Use an indent of 2 spaces, with no tabs
     +186: [normal] String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms
     +187: [normal] Use an indent of 2 spaces, with no tabs
     +187: [minor] Use an indent of 2 spaces, with no tabs
     +189: [normal] Use an indent of 2 spaces, with no tabs
     +189: [minor] Use an indent of 2 spaces, with no tabs
     +189: [normal] String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms
     +190: [normal] Use an indent of 2 spaces, with no tabs
     +190: [minor] Use an indent of 2 spaces, with no tabs
     +191: [normal] Use an indent of 2 spaces, with no tabs
     +191: [minor] Use an indent of 2 spaces, with no tabs
     +193: [minor] There should be no trailing spaces
     +195: [minor] There should be no trailing spaces
    
    Status Messages:
     Coder found 1 projects, 1 files, 11 normal warnings, 18 minor warnings, 0 warnings were flagged to be ignored
    
  • README.txt is missing, see the guidelines for in-project documentation.
  • @file doc block is missing in the module file, see http://drupal.org/node/1354#files .
  • The "?>" PHP delimiter at the end of files is discouraged, see http://drupal.org/node/318#phptags
    ./includes/KewegoConnection.class.php
    ./includes/KCurl.class.php
    
  • Comments: there should be a space after "//", see http://drupal.org/node/1354#inline
    includes/KewegoConnection.class.php:29:	  //Checking previous appToken validity
    includes/KewegoConnection.class.php:85:	//watchdog('Kewego', '--> appToken is: '.$appToken, array(), WATCHDOG_INFO);
    includes/KewegoConnection.class.php:95:      //watchdog('Kewego', '--> appToken is still valid', array(), WATCHDOG_INFO);
    includes/KewegoConnection.class.php:105:	//watchdog('Kewego', 'authToken is: '.$authToken, array(), WATCHDOG_INFO);
    includes/KewegoConnection.class.php:114:      //watchdog('Kewego', '--> authToken is still valid', array(), WATCHDOG_INFO);
    includes/KewegoConnection.class.php:148:  //upload a video
    includes/KCurl.class.php:12:      //watchdog('Curl', 'Calling API method: '.$api_url.' '.htmlentities(implode('&',$data_array)), array(), WATCHDOG_INFO);
    
  • ./includes/themes/media_kewego.theme.inc: comment lines should break at 80 characters, see http://drupal.org/node/1354#general
            // Add an overlay that says 'Kewego' to media library browser thumbnails.
    
  • ./includes/KewegoConnection.class.php: comment lines should break at 80 characters, see http://drupal.org/node/1354#general
          //watchdog('Kewego', '--> appToken is still valid', array(), WATCHDOG_INFO);
          //watchdog('Kewego', '--> authToken is still valid', array(), WATCHDOG_INFO);
    
  • ./includes/media_kewego.formatters.inc: comment lines should break at 80 characters, see http://drupal.org/node/1354#general
      // check if media_derivatives_kewego is installed and load derivative uri if exist
      // check if media_derivatives_kewego is installed and load kewego thumbnail if exist
    
  • ./includes/KCurl.class.php: comment lines should break at 80 characters, see http://drupal.org/node/1354#general
          //watchdog('Curl', 'Calling API method: '.$api_url.' '.htmlentities(implode('&',$data_array)), array(), WATCHDOG_INFO);
    
  • media_kewego.module in media_kewego.info: It's only necessary to declare files[] if they declare a class or interface.
  • includes/media_kewego.styles.inc in media_kewego.info: It's only necessary to declare files[] if they declare a class or interface.
  • includes/media_kewego.admin.inc in media_kewego.info: It's only necessary to declare files[] if they declare a class or interface.
  • ./includes/media_kewego.page.inc: all functions should be prefixed with your module/theme name to avoid name clashes. See http://drupal.org/node/318#naming
    function media_page_kewego_thumbnail($file) {
    
  • ./includes/KCurl.class.php: all functions should be prefixed with your module/theme name to avoid name clashes. See http://drupal.org/node/318#naming
    function APICall() {
    
  • ./media_kewego.module: The description on the line after the @param/@return documentation is either missing or not formatted correctly. See http://drupal.org/node/1354#functions
    153- */
    
  • ./includes/media_kewego.variables.inc: The description on the line after the @param/@return documentation is either missing or not formatted correctly. See http://drupal.org/node/1354#functions
    22- *  The variable name to retrieve. Note that it will be namespaced by
    26- *  An optional default variable to return if the variable hasn't been set
    30- *  Returns the stored variable or its default.
    52- *  The variable name to set. Note that it will be namespaced by
    56- *  The value for which to set the variable.
    58- *  Returns the stored variable after setting.
    73- *  The variable name to delete. Note that it will be namespaced by
    90- *  Optional variable name to retrieve the default. Note that it has not yet
    93- *  The default value of this variable, if it's been set, or NULL, unless
    126- *  The variable name to retrieve the namespaced name.
    128- *  The fully namespace variable name, prepended with
    
  • There should be no space after the opening "(" of a control structure, see http://drupal.org/node/318#controlstruct
    includes/KewegoConnection.class.php:113:	if ( "true" == $validity) {
    
  • There should be no space after the opening "(" of an array, see http://drupal.org/node/318#array
    includes/KewegoConnection.class.php:121:	$response = trim(APICall()->Call('http://api.kewego.com/video/getDetails/', array( 'sig' => $sig, 'appToken' => $this->appToken)));
    includes/KewegoConnection.class.php:128:	$response = trim(APICall()->Call('http://api.kewego.com/user/getVideos/', array( 'username' => $this->username, 'appToken' => $this->appToken, 'token' => $this->authToken, 'start' => $start, 'limit' => $limit)));
    includes/KewegoConnection.class.php:135:	$response = trim(APICall()->Call('http://api.kewego.com/video/getThumbnailsURL/', array( 'sig' => $sig, 'appToken' => $this->appToken,'number' => $number, 'size' => $size)));
    includes/KewegoConnection.class.php:142:	$response = trim(APICall()->Call('http://api.kewego.com/video/getPlayerCode/', array( 'sig' => $sig, 'appToken' => $this->appToken, 'autostart' => $autostart, 'width' => $width, 'height' => $height, 'language_code' => $language_code, 'version' => $version)));
    
  • Remove all old CVS $Id tags, they are not needed anymore.
    includes/media_kewego.variables.inc:2:// $Id: media_kewego.variables.inc,v 1.1.4.4 2011/01/11 18:40:39 aaron Exp $
    
  • All text files should end in a single newline (\n). See http://drupal.org/node/318#indenting
    ./media_kewego.install ./media_kewego.module ./includes/media_kewego.admin.inc ./includes/MediaInternetKewegoHandler.inc ./includes/media_kewego.styles.inc ./includes/themes/media_kewego.theme.inc ./includes/themes/media-kewego-video.tpl.php ./includes/media_kewego.page.inc ./includes/KewegoConnection.class.php ./includes/MediaKewegoStreamWrapper.inc ./includes/media_kewego.variables.inc ./includes/media_kewego.formatters.inc ./includes/MediaKewegoStyles.inc ./includes/KCurl.class.php
    

This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.

camdarley’s picture

Status: Needs work » Needs review

Sorry for that, I already checked the code but files hadn't been pushed due to a git error.
That's should be fine now

Robertas’s picture

Status: Needs review » Needs work

Branch name should be not 7.0-alpha1, but 7.x-1.x.
Please see http://drupal.org/node/1015226

camdarley’s picture

Status: Needs work » Needs review

Thanks for the review, I renamed the Branch.
Sorry again.

klausi’s picture

Status: Needs review » Needs work
StatusFileSize
new43.17 KB

There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732
Review of the 7.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.

camdarley’s picture

Status: Needs work » Needs review

That should be fine.
Most of drupalcs' errors are still there. That's because the code I use for somme non-specific parts is the same than Media: Youtube or Media: Vimeo or many others...

klausi’s picture

Status: Needs review » Needs work
StatusFileSize
new17.93 KB

There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732
Review 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. Go and review some other project applications, so we can get back to yours sooner.

manual review:

  • just because other modules do it wrong you don't have to do it wrong as well, so you will have to fix the coding standard issues.
  • MediaKewegoStreamWrapper.inc in the repository root: why do you need this file?
  • media_kewego_install(): empty function, so remove it.
  • ""Deleted all variables in the Media: Kewego namespace."": all user facing text should run through t() (or the result of get_t() in this case) for translation.
  • media_kewego_media_format_form_prepare_alter(): do not use drupal_add_js(), use $form['#attached']['js'] instead. See http://api.drupal.org/api/drupal/developer--topics--forms_api_reference....
camdarley’s picture

Status: Needs work » Closed (duplicate)
avpaderno’s picture

Title: Media: Kewego » [D7] Media: Kewego
Issue summary: View changes
avpaderno’s picture