[Plugin: GoCodes] Gocode suggestions
-
I made a few modifications to fit my needs – some of these suggestions might fit into the roadmap of the plugin (for the developer to decide)
.htaccess –
I used:
RewriteRule ^go/([A-Za-z0-9]+)/?$ /index.php?gocode=$1 [L]
No R flag because I don’t want it to redirect to index.php?gocode=whatever then to the page – I just want it to redirect once.
gocodes.php –
I updated line ~ 80 from:
header("Location: $gocode_target");
to:
header ('HTTP/1.1 301 Moved Permanently'); header('Location: '.$gocode_target);
302 is a search engine friendly – aka moved permanently redirect. Short url’s are great for people but make sure they are good to SEO as well.
I added this as line 219 (before the if)
$basewpurl = get_option('siteurl');
And modified the now line 223 from
echo "<tr class='alternate'> <td>".$gocode->key1."<br /></td> <td>".wsc_gocodes_truncate($gocode->target)."</td> <td style=\"text-align: center\">".$gocode->hitcount."</td> <td><a href='".GOCODES_URL."&editgc=".$gocode->id."'>Edit</a></td> <td><a href='".GOCODES_URL."&deletegc=".$gocode->id."' class='delete'>Delete</a></td> </tr>";
to
echo '<tr class="alternate"> <td>'.$gocode->key1.'<br />'.$basewpurl.'/go/'.$gocode->key1.'</td> <td>'.wsc_gocodes_truncate($gocode->target).'</td> <td style="text-align: center">'.$gocode->hitcount.'</td> <td><a href="'.GOCODES_URL.'&editgc='.$gocode->id.'">Edit</a></td> <td><a href="'.GOCODES_URL.'&deletegc='.$gocode->id.'" class="delete">Delete</a></td> </tr>';
To clean up the HTML output and display the full small url for easy triple click copy paste goodness.
To the author: I’d be happy to commit these changes to SVN if you are interested in adding this to a new release.
- The topic ‘[Plugin: GoCodes] Gocode suggestions’ is closed to new replies.