Wp-Favicons Database Requirements

The Wp-Favicons plugin, which iconizes your blog-links, makes use of request caching. We need this for 2 reasons:

image

1. so that when you delete your favicon cache and want to regenerate your favicons, it will not go out and do thousands of requests again (assuming you have thousands of links on your weblog)

2. to validate your links and produce those cool little round icons indicating green, yellow, red, black or white links. Very handy to bring your 404 links etc… back to 0 in a short time and to provide your visitors some information about the links they click.

For me: I really wanted to have this. I even want to have the tool clean my links automatically in some way, which will appear in the  next version.

BUT……………. this of course has impact on the storage on your server or shared hosting account.

1. To show icons to your users, we have to store them on disk since embedded bas64 encoded icons are not supported by all browsers. This means, that for e.g. 10.000 outgoing links it will store 1.000 icons, which are small but each take a few Kb (assuming you link multiple times to the same websites) (since it will store an icon only if it is unique in terms of uri where it came from). But… whatever a CDN coupling might be in a next release.

2. To have an index of the icons on your disk we use a metadata cache, which is a database cache so this is then 10.000 records for 10.000 outgoing links.

3. To cache all your outgoing requests we store each request in the database and ergo duplicate the icon or the webpages we scanned in the request. THIS is a biggie.

On my system my original database export was about 120 Mb (for my personal multisite environment). When I installed the plugin the export became 825 MB. So this single plugin makes your database about 7 times as large. GRIN.

But yes, this plugin has high demands. If you have the disk space (so let’s say 7 time your current database), then it is no problem. If you are on a database disk space limited server then you might have a problem and better not use it.

For me, I really really want to have this one. It’s a heavy one, but one that is worth it.

But… for the next release I will try to lower the database size of the request cache, this will probably will mean some lost functionality but let’s see how far we get.

WP-Favicons will clean bad links and will show your visitors where they redirect to

image

The next version of WP-Favicons (still in the Trunk) will show you more information about your links:

- it will show visitors where they redirect to if they e.g. have a short url in front of them, handy because at least me likes to know where he clicks to and for you: if you have always “misspelled” a url then now you know that you should use the correct name.

image- it will show 404, 500, etc… and possible in the next release try to auto-clean them. If you are like me Google Webmaster will report you hundreds of broken links. And personally I am too lazy to clean them. Probably in the release after this one it will contain some kind of functionality to auto clean up your links. If you don’t want to auto-clean then at least it’s handy to see at once which links are no longer good and you can doublecheck them.

In the screenshot the current state: no styling or icons yet, but the information is there. I I decided little unobtrusive little status indicator icons looks the nicest.

Every HTTP code will get its own color in a categorized range (all 3xx will be yellowish) and status code 418 will be a teapot Glimlach

Of course you can select which functionality you want to use Glimlach

Handling Redirects for WP Favicons with redirects set to 0 with WordPress wp_remote_get

For version 0.51 of WP Favicons I want to  come nearer to handling 100% of the Favicons out there. Measuring this is simple because for every Favicon it does not handle correctly one by Google or Geticon.org (as backup) will be used. So I can see from the statistics (in the information screen) how good the current code is. Ideally we would like to catch 100% of everything possible (and that is still some way to go: 80% is simple but the more you crawl nearer to the 100% the tougher it gets).

What I describe below is for the most part in the code in this file: http://plugins.trac.wordpress.org/browser/wp-favicons/trunk/includes/class-http.php (although locally I have a newer version)

Continue reading

WP-Favicons: favicons for links on your blog.

imageI have not blogged about it… but I made a plugin called WP-Favicons which you can download here: http://wordpress.org/extend/plugins/wp-favicons/.

 

DEMO:

I am using it on my own blog: http://edward.de.leau.net so you can check it out there as demo.

It used to be an internal little plugin which I used. I then had a question on StackExchange and I dumped some code on the WordPress svn site. And I improved it a little since.

It is now on version 0.5.0 , which is public but has 1 big bug: the HTTP response codes are not written in the database since I accidently copied twice the same line, so two times the response message is written instead of the the response message and the response code. GRIN. (which is fixed in 0.5.1)

Nevertheless that is the code I am also using on my own blog since well.. it does not disturb anything but will be a clean action during the upgrade to 0.5.1.

In principle it shows Favicons on your blog next to links on your blog. And it does it well. Especially version 0.5.1 which now even gets the icons from redirected links.

Version 0.5.1 will have some refactoring done since of course while coding it you get some new thoughts so that will take some time.

Maybe some highlights:

  • it is polite concerning activation, deactivation and uninstall of the plugin
  • it is almost ready for internationalization Glimlach
  • it not only shows those Google S2 favicons that you see posted everywhere but grabs itself icons from pages and roots and then falls back on google or geticon.org. I hope those percentages will fall back to 0 if the things does what it should do and you should get a much greater coverage of favicons than “just with Google” which only does a smaller part of favicons out there, there is also a little statistics applet in there in the admin pages which show you exact those percentages
  • it has a diskcache and a real nice one: you can see the icon via the domain directory structure e.g. /cache/http/com/google/www/favicon.ico
  • it has a nice plugin framework that works alongside the Settings API of WordPress meaning: developers should be able to add stuff anywhere in the plugin
  • it supports image filters and includes a filter to convert everything (includes .ico) to PNG format. So you can write your own image filter and process favicons to whatever you want
  • it supports placement by filters and specific styling for it. So e.g. you can replace in the post content or text widget and have the icons differently styled as long as there is a WordPress filter for it.
  • it supports default icons when really the site has no favicon, you can choose from the WordPress Identicons, MonsterID, etc… or add your own plugin. It supports both cached defaults and non cached defaults.
  • it supports exceptions such as do not process .zip files
  • Because it builds a database, you get a database of all your outgoing links or uhm… better said all outgoing links that are parsed by the plugin.

But… while writing this I got some new thoughts. Maybe some of them will appear in version 0.5.1 Glimlach

How to setup your WordPress PHP Development environment

If you develop themes or plugins for WordPress you might still be doing this from an editor and FTP your changes to the server. This short guide shows you how to setup a more professional environment and will function as a link I can send around for people still developing PHP in an editor.

It’s not that hard, just follow the following steps and you will have a new cool shiny development environment setup:

Continue reading

Add a site specific theme in WP3 Multisite

To have some place to store screenshots to be able to answer this question I made this post. The question was:

What I’d like to do is get to the stage where I have 1 install that can accommodate the 10 sites, but each site can’t see the details/users/themes etc. of the other sites.

How to have themes that are only available to specific weblogs

Continue reading

Moving a weblog to a WP3 Multisite Weblog System (on MediaTemple)

At one point or another you will start thinking to move several older weblogs or even some domains you have to one weblog system. This has the advantage that you only need to administrate 1 WP installation (and the disadvantage that if one system fails they all fail).

I moved 20 smaller sites to one central weblog system. Those were pretty simple:

Continue reading

Featured Images and Swift Theme

Since some time WordPress now offers “featured images“. In short it lets you define a thumbnail that should be shown alongside or in place of the post-type e.g. when having a “magazine layout”.

A featured image is tied to a post-type like a post, page or a custom post-type. In reality it is the post-thumbnail (of a specific size) which we knew before but it is real handy that this is now build-in functionality of WordPress.

In the latest version of the Swift Theme I noticed that the code had been changed to make use of these featured images versus the old way: defining a custom field and auto associating the first image in a post to the custom field (so that everything went auto magically). Continue reading