Viewing the page source as a non-logged in visitor, I was surprised to see:

<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/seo_checker/css/seo_checker.css?n" />

I am assuming the culprit is:

function seo_checker_init() {
  /* render the result table and append it to the form */
  drupal_add_css(drupal_get_path('module', 'seo_checker') .'/css/seo_checker.css');
}

I feel that the CSS should only be included when checker output is being displayed, which will lighten page loads and not expose my site configuration to the public.

Comments

fluxsauce’s picture

Proposed fix:

function seo_checker_init() {
  /* SEO Checker result style sheets */
  if ('node' == arg(0) && 'edit' == arg(2)) {
    drupal_add_css(drupal_get_path('module', 'seo_checker') .'/css/seo_checker.css');
  }
}
169,170c169,172
<   /* render the result table and append it to the form */
<   drupal_add_css(drupal_get_path('module', 'seo_checker') .'/css/seo_checker.css');
---
>   /* SEO Checker result style sheets */
>   if ('node' == arg(0) && 'edit' == arg(2)) {
>     drupal_add_css(drupal_get_path('module', 'seo_checker') .'/css/seo_checker.css');
>   }

This is the first time I've ever reported a bug and proposed a solution, so bear with me - I'm not sure how I should be doing this.

miruoss’s picture

Assigned: Unassigned » miruoss
Status: Active » Fixed

Thanks for reporting this. It is indeed ugly to load css in the init hook. Also thanks for the fix, it's cool when people try to help solving bugs. However, I moved drupal_add_css() out of the init hook to where the part that requires it is being rendered. That's where it belongs.

The bug is fixed in the upcoming dev release. I will probably create a new release soon.

Cheers,
Michael

fluxsauce’s picture

Cool, thanks for taking care of it. Since I posted this, I've learned how to make patches (sorry for the non-standard attempt).

Best regards,
Jon

Automatically closed -- issue fixed for 2 weeks with no activity.