Looking for something? Check the archive.

Favicache

Favicache

Description

Favicache is a Wordpress plugin that retrieves and stores favicons in a local cache. This makes for faster page load times and lessens the strain on the server where the favicon was originally retrieved from.

Installation

  1. Download favicache.zip.
  2. Upload favicache.php, the favicache/ directory and it's contents to /wp-content/plugins/.
  3. Ensure the favicache/ folder is writable.1
  4. Activate the Favicache plugin from the Plugins section in Wordpress.

Code

When the plugin is activated and you begin to add/edit links, the favicons are getting stored in the favicache/ directory. However the plugin does not modify the wp_list_bookmarks()2 function so you need to replace it with favicache_wp_list_bookmarks() which shares the same function attributes. The following code snippet is an example of Favicache in a Wordpress template. Notice the function_exists() function call on line 3. This code is to allow for seamless switching from Favicache being active and not.

PHP
<?php
 
if (function_exists('favicache_wp_list_bookmarks')) { favicache_wp_list_bookmarks(); }
else { wp_list_bookmarks(); }
 
?>

In addition to outputting bookmarks with the custom Favicache function, you can style the label that gets displayed next to each favicon.

CSS
span.favicon_label { position: relative; top: -3px; left: 3px; }

Features

Technical Specs

Download Favicache.zip
  1. Changing File Permissions « WordPress Codex
  2. In previous versions of Wordpress (prior to 2.5), wp_list_bookmarks() used to be get_links_list() or get_links(). Both functions are now deprecated.