Aug 28 2007

Permalink Redirect 0.8.1 and Gravatar Cache 2.0

Sorry I have not been updating this blog. There are simply way too many commitments in life for me to maintain “yet-another-blog”, so I think I might eventually fold FuCoder.com after two years of on and off writing. I will continue to publish code snippets at our personal blog, Scott Yang’s Playground, but even that has slowed down quite a bit over the last few months.

So what we have got here?

Gravatar Cache 0.2

On July 20 I have uploaded an updated version of Gravatar Cache. Something has been added, and something has been removed:

  • Add MySQL backend support for handling negative responses

    Personally I found that SQLite-based backend is just not scalable. It is perfectly fine for small websites, but when you have a site with thousands of page views a day, each page view generates multiple Gravatar requests, and majority of requests yield negative result — you’ll probably see lots of SQLite locking errors in your log files.

    Porting negative cache to a new backend is easy. Now Gravatar Cache can use MySQL as backend so hopefully cache misses can be better handled.

  • Remove fopen_url based HTTP request method

    That means we will never use fopen to grab Gravatar from gravatar.com, as fopen automatically follows 301/302 redirects. Gravatar cache can still download gravatars using either cURL or raw socket.

It has been running quite stably on one of my Drupal site doing 30,000+ gravatars per day.

Also on July 20 I have released an updated version of Permalink Redirect WordPress plugin. There has been quite a few changes since 0.7.0:

  • Add FeedBurner branding support

    Thanks to Mesoconcepts for sponsoring this enhancement. Since Google purchased FeedBurner, FeedBurner has released this Pro feature for free. Now you can edit your hostname as well as the pathname to redirect the visitors to.

  • Add static page redirect

    Thanks to Sergey Menshikov for supplying the patch. You can now edit a list of [from] [to] and let WordPress to handle the redirection. Again, it is probably a feature best left for the web server to do. It is nice to have it in the plugin as well, for those who do not wish to touch their web server configuration files.

  • Fix front page as static page issue in WordPress 2.2

    Somehow is_home() is ambiguous in different versions of WordPress. Anyway, it is fixed now.

  • Fix 301 redirect issue with Lighttpd/Nginx + PHP FastCGI

    Permalink Redirect 0.8+ uses WordPress’ wp_redirect function, which refuses to send back 301 when PHP is running as FastCGI. Now we are making an exception in the code so it by-pass wp_redirect if we are running FastCGI behind Lighttpd and Nginx.

There has been words that WordPress is going to integrate the functionality of Permalink Redirect into its core, and looks like it is going to be available in WP 2.3 (currently SVN trunk).

The function redirect_canonical does pretty much the same thing as Permalink Redirect plugin so I guess the question is — what is happening to Permalink Redirect beyond WordPress 2.3?

Not much I guess. The primary goal for Permalink Redirect is redirecting visitors to the canonical URL for search engine’s sake, and I think WP 2.3 has achieved that right inside the core. While there are lots of other functionality in Permalink Redirect that are not ported to WP 2.3 (Feedburner feeds, configurable rules, old to new permalink structure, etc), but honestly even I do not use these features much myself.

It is still possible to create a lite version of Permalink Redirect to hook these extra functionality into WordPress 2.3, and I might start working on that when WP 2.3 turns beta. Meanwhile, excuse my absence here as I have my “other life” to sort out. Don’t bother with the bbPress support forum (it is down anyway). If you need any quick solutions, email me directly. You can find my email address in the contact page.

12 Comments

  1. Pingback: Permalink Redirect Plugin auf heunihome - the long road

  2. Jeff on 1 Sep 2007 at 11:08 am #

    I just downloaded your permalink redirect 0.8.1 and I wanted to clarify how to set up the Old Permalink structure. It was on default which of course was the ‘?p=(number)’. How should I input that default expression, or will leaving it blank take care of everything since WordPress leaves it blank on the Permalinks options page.

    Thanks.

  3. Scott Yang on 1 Sep 2007 at 2:55 pm #

    Jeff,

    The URL form “?p=(postid)” is actually not a permalink structure. The Old Permalink -> New Permalink is only needed if you have set up a permalink structure before and decided to change afterwards.

    If previously if use the form “?p=(postid)” which is the WordPress default, you don’t need to fill anything in in the old structure. Just (1) set up your new permalink structure in the Permalink tab (2) enable Permalink Redirect plugin, and it will take care everything itself.

  4. Sunny on 9 Sep 2007 at 1:01 am #

    Ouch! I’m using svn:externals to keep my plugins up-to-date (thank you so much for that article from last year http://fucoder.com/2006/04/svnexternal-wordpress-plugins/ ) but today svn.fucoder.com just asked me for an authentification :/

    Could we get the svn back pretty-please ?

  5. Daniel Westermann-Clark on 12 Sep 2007 at 1:10 am #

    Scott,

    Is anonymous Subversion access for the permalink-redirect plugin available anywhere? The URL I was using previously to track development now requires a password.

  6. Scott Yang on 12 Sep 2007 at 9:37 am #

    Sorry Sunny and Daniel — I upgraded to Apache 2.2.4 the other day and it seems to break the SVN. All fixed now (finger crossed).

  7. Daniel Westermann-Clark on 13 Sep 2007 at 11:03 am #

    Scott – anonymous Subversion access works from here. Thanks for updating it!

  8. Sunny on 13 Sep 2007 at 3:32 pm #

    Same here, thank you ! :)

  9. Kirk M on 27 Oct 2007 at 12:11 am #

    Scott, I’ve been running WP 2.3 since beta 3 (now running 2.3.1 RC1) and I still use Permalink Redirect to redirect the old permalink structure to the new one (I changed it ages ago but I still got 404′s linked to the old structure without it). I use it along with the “Redirection” plugin which I use for 404 monitoring and single redirects. Unfortunately I don’t have a head for coding especially any regex stuff (.htaccess file) to setup any sort of permanent permalink redirects nor do I know if that would be a wise thing to do.

    Either way, I’m glad your plugin is still around.

  10. Ben on 27 Nov 2007 at 8:31 pm #

    Hi Scott, a quick question.

    I changed permalink structure in the summer from the simple /%post_id%/ to the fancy /%year%/%monthnum%/%day%/%postname%/

    I installed your plugin to take care of the redirects and it worked great.

    Now I have upgraded to 2.31 and discover that your plugin still does the same old > new permalink job perfectly.

    But, if I turn it off, the old and the new structures now both work fine. E.g. http://www.notesfromspain.com/821/ goes to the right post without redirecting to the new permalink structure, and without throwing up an error as it would have done before without your plugin.

    It seems to me that I should still use your plugin to keep all the permalinks looking consistent though, does that make sense?

  11. scotty on 27 Nov 2007 at 9:35 pm #

    @Ben,

    To keep the answer short, “Yes” :)

    Now the long story. When Permalink Redirect plugin is installed, and when you added the old permalink structure, it will add extra rewrite rules to WordPress knows how to handle the URL when a request with the old URL comes in. Deactivating the plugin actually does not remove those rules — they will only be removed when you do a “Save” in the Options – Permalink page.

    Therefore the old permalinks will still be handled, but will not be redirected.

    The current 0.8.1 should work with WordPress 2.3+. WordPress 2.3 has some of Permalink Redirect’s functionality but not all so feel free to keep it around if you need those extra functionalities.

  12. Ben on 28 Nov 2007 at 10:39 pm #

    Thanks Scott!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>