This module enhances the website screenshot module with the cutycapt engine. Now you can produce your own website screenshots without using foreign services.

Project page: http://drupal.org/sandbox/broncomania/1401886
This project is for Drupal 6.

Comments

klausi’s picture

You need to set the status to "needs review" if you want to get a review.

broncomania’s picture

Status: Active » Needs review

Thx for your hint!

asifnoor’s picture

Status: Needs review » Needs work

Manual Review of 6.x-1.x branch

1. Provide more information related to core, package and description of your module in .info file

2. I have downloaded your module and tried to enabled it on drupal 6.22, but it is not getting enabled.

3. Use translate functions t(). you have used at few places and missed at few.

4. use check_url to avoid any xss attacks.

5. cleanup the module and remove unwanted lines of commented code.

Coder Review

Line 25: Control statements should have one space between the control keyword and opening parenthesis
switch($path) {
Line 50: Use an indent of 2 spaces, with no tabs
case FALSE:
Line 51: Use an indent of 2 spaces, with no tabs
return FALSE;
Line 52: Use an indent of 2 spaces, with no tabs
break;
Line 53: Use an indent of 2 spaces, with no tabs
default:
Line 54: Use an indent of 2 spaces, with no tabs
return TRUE;
Line 69: Use an indent of 2 spaces, with no tabs
case FALSE:
Line 70: Use an indent of 2 spaces, with no tabs
return FALSE;
Line 71: Use an indent of 2 spaces, with no tabs
break;
Line 72: Use an indent of 2 spaces, with no tabs
default:
Line 73: Use an indent of 2 spaces, with no tabs
return TRUE;
Line 88: Control statements should have one space between the control keyword and opening parenthesis
if(file_exists($fullpath)) {
Line 93: else statements should begin on a new line
}else{
Line 94: Use an indent of 2 spaces, with no tabs
drupal_set_message('Website Screenshot Save ERROR');
Line 104: Use an indent of 2 spaces, with no tabs
$screenshots_folder = file_directory_path() . '/website_screenshot/cutycapt/';
Line 105: Use an indent of 2 spaces, with no tabs
$cache_expire_time = variable_get('website_screenshot_cutycapt_refresh_period', 10080);
Line 106: Use an indent of 2 spaces, with no tabs
$image_type = variable_get('website_screenshot_cutycapt_imagetype', ".jpg");
Line 107: Use an indent of 2 spaces, with no tabs
if (isset($url) && valid_url($url)) {
Line 108: Use an indent of 2 spaces, with no tabs
$website_url = $url;
Line 109: Use an indent of 2 spaces, with no tabs
}
Line 110: Use an indent of 2 spaces, with no tabs
else {
Line 111: Use an indent of 2 spaces, with no tabs
drupal_set_message(t('Missing URL to grab website screenshot.' . $url), 'error');
Line 111: Potential problem: drupal_set_message() only accepts filtered text, be sure all !placeholders for $variables in t() are fully sanitized using check_plain(), filter_xss() or similar. (Drupal Docs)
drupal_set_message(t('Missing URL to grab website screenshot.' . $url), 'error');
Line 112: Use an indent of 2 spaces, with no tabs
return FALSE;
Line 113: Use an indent of 2 spaces, with no tabs
}
Line 114: Use an indent of 2 spaces, with no tabs
$website_url_md5 = md5($website_url);
Line 115: Use an indent of 2 spaces, with no tabs
$cached_filename = $screenshots_folder . $website_url_md5 . '.' . $image_type;
Line 116: Use an indent of 2 spaces, with no tabs
if (!file_exists($cached_filename) || filemtime ($cached_filename) + $cache_expire_time * 60 < time() ) {
Line 117: string concatenation should be formatted with a space separating the operators (dot .) and non-quote terms
@exec('xvfb-run --server-args="-screen 0, 1024x768x24" ' . variable_get('website_screenshot_cutycapt_home', '') . '/CutyCapt ' . escapeshellarg('--url=' . $website_url) . ' ' . escapeshellarg('--out=' . $cached_filename) . ' --plugins=on --delay='.variable_get('website_screenshot_cutycapt_delay', '3000').' --user-agent='.variable_get('website_screenshot_cutycapt_user_agent', ''));
Line 118: Use an indent of 2 spaces, with no tabs
}
Line 119: Use an indent of 2 spaces, with no tabs

Line 120: Use an indent of 2 spaces, with no tabs
if (!file_exists($cached_filename)) {
Line 121: Use an indent of 2 spaces, with no tabs
drupal_set_message(t('Thumbnail Generation Error. Thumbnail not created.'), 'error');
Line 122: Use an indent of 2 spaces, with no tabs
return FALSE;
Line 123: Use an indent of 2 spaces, with no tabs
}
Line 124: Use an indent of 2 spaces, with no tabs
else {
Line 125: Use an indent of 2 spaces, with no tabs
return $cached_filename;
Line 126: Use an indent of 2 spaces, with no tabs
}

sites/all/modules/contrib/wss_cutycapt/wss_cutycapt.admin.inc
wss_cutycapt.admin.inc
Line -1: @file block missing (Drupal Docs)
Line 69: use a space between the closing parenthesis and the open bracket
function website_screenshot_cutycapt_submit($form, &$form_state){
Line 70: Control statements should have one space between the control keyword and opening parenthesis
if($form_state['clicked_button']['#post']['op'] == t('Make screenshot') ){
Line 70: use a space between the closing parenthesis and the open bracket
if($form_state['clicked_button']['#post']['op'] == t('Make screenshot') ){
Line 72: Control statements should have one space between the control keyword and opening parenthesis
if(valid_url($url)){
Line 72: use a space between the closing parenthesis and the open bracket
if(valid_url($url)){
Line 74: missing space after comma
$image = theme('imagecache', 'screenshot',$cutycapt_path, $url,$url);
Line 75: string concatenation should be formatted with a space separating the operators (dot .) and non-quote terms
drupal_set_message(t('Your snapshot:' . $image. ' path:'.$cutycapt_path), 'status');
Line 75: Potential problem: drupal_set_message() only accepts filtered text, be sure all !placeholders for $variables in t() are fully sanitized using check_plain(), filter_xss() or similar. (Drupal Docs)
drupal_set_message(t('Your snapshot:' . $image. ' path:'.$cutycapt_path), 'status');
Line 77: else statements should begin on a new line
}else{
Line 78: Potential problem: drupal_set_message() only accepts filtered text, be sure all !placeholders for $variables in t() are fully sanitized using check_plain(), filter_xss() or similar. (Drupal Docs)
drupal_set_message(t('Missing URL to grab website screenshot.' . $url), 'error');

sites/all/modules/contrib/wss_cutycapt/wss_cutycapt.install
wss_cutycapt.install
Line -1: @file block missing (Drupal Docs)

klausi’s picture

@asifnoor: please do not include the output of automated reviews directly in your comment. Better attach it as txt file.

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.