Paolo Gabrielli’s Blog

Just another near empty WordPress.com’s weblog. But this is from Paolo ‘pkirk’ Gabrielli.

Archive for the 'Wordpress' Category

Wordpress

WordPress plugin for old Permalink

Posted by paolo on 15 May, 2007

Sometime we change the Permalink structure in our WordPress installation but if we live thanks to search engines that bring most of our readers on our site, we’re gonna lost lot of them that will not find what where they looking for.

So I’ve coded a little WordPress Plugin that, thanks to a db query, will check if the post searched is a post that has an old Permalink Structure.

I don’t know why but in WordPress when you change the Permalink structure (Admin->Options->Permalinks) only the option in the wp_options table is changed, without changing the “guid” field in the wp_posts table, so, thanks to that field and this plugin, we can reach an old post.

Limitation:

  • released under GPL, so I can’t take any responsability for any damage et al.;
  • it’s based upon Fabrizio Tarizzo’s Old Plinks Redirects Plugin;
  • it works in my heavily modified WordPress 2.0.5 (not the latest even in its 2.0 branch) so it may take some modifies to work properly on another installation;
  • notable if WordPress is not on the root of the domain it will not work without some little modifies;
  • it will not redirect posts’ comments’ feed but we can work on it;
  • please don’t use it on a production site, or do it at your own risk;
  • even if I’ve changed the priority of add_action() to 0 (zero) I’ve got an “Headers alreay sent error” with another plugin that was echoing a var_dump() between HTML comments (<!– –>);
  • I don’t know how much is the Guid field in the wp_posts table is safe and reliable;
  • I don’t know if there is already a plugin that does the same thing: I’ve searched but nothing popped. If it exists is a lot better than this.
  • If in the meanwhile you’ve changed the categories’ of the post, this plugin will fail miserably.

TODO:

  • Now it doesn’t redirect if we already have an ID but we can save a query if we can also exit the plugin’s code when we are in home (is_home()), in category (is_category()) and so on.

Just drop me a line to have a limited (in time) support or leave a comment here.

Download it here, put it in your wp-content/plugins directory, rename it from .PHPS to .PHP and activate it from the Admin and cross the finger.

Posted in Wordpress, plugin | No Comments »

votnutingin

Posted by paolo on 11 April, 2007

As in the other post about natalykorah today I’ve found “votnutingin” (bononert@hotpop.com) that will be banned by the Blacklist Registration Plugin I’ve installed. See ya votnutingin.

Posted in Spam, Wordpress | No Comments »

WordPress 2.1

Posted by paolo on 23 January, 2007

Heya! I’m really excited about it: WordPress 2.1 is out! I think I’m going to use it on a test server and begin to apply the (_*MANY*_) modifies I’ve done to the other WP I use for that hightraffic site. The best feature I pray for is the MySQL optimization… Let’s be honest and say that WP is slow!

Now let’s go to vote for 2.2

P.S.: also Akismet got an update to 2.0, let’s downlaod it”

Posted in Akismet, Wordpress | No Comments »

HTML Purifier WordPress plugin

Posted by paolo on 27 December, 2006

I should write a WP’s plug-in for the fantastic HTML Purifier. That would be simple and the web will be a better place to live in, with children running in big green lawns, etc. etc. The plug-in should also have the ability to check the db for not-well formatted posts. But in a smart way to avoid PHP’s timeout… But now we are going too deep…

What WP.com does with HTML from TinyMCE? Let’s investigate.

Posted in Programming, Wordpress, plugin, thinking | 1 Comment »