I noticed that when the user meta tags are enabled that it automatically tries loading all metatags for every user_load(), which happens on every page. Given that most pages don't need these metatags, it might be better to only load them when arg(0) == 'user' and $user->uid > 0, i.e. when the visitor is not anonymous. Thoughts? The code would change to the following:

function nodewords_user($op, &$edit, &$account, $category = NULL) {
  global $user;

  switch ($op) {
    case 'load':
      if (arg(0) == 'user' && $user->uid > 0 && variable_get('nodewords_enable_user_metatags', TRUE)) {
        $account->nodewords = nodewords_load_tags(NODEWORDS_TYPE_USER, $account->uid);
      }
      break;

Comments

damienmckenna’s picture

Status: Active » Needs review
damienmckenna’s picture

StatusFileSize
new538 bytes

Here's a patch that does just this.

damienmckenna’s picture

StatusFileSize
new541 bytes

Wrong variable name. Doh.

Note this has a MINOR API change in that it will no longer allow loading of metatags for user 0, but there was no way of viewing /user/0 pages anyway, so I don't anticipate any problems.

damienmckenna’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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