WordPress Plugin: Cache Time

Timing is important. We look at watches and clocks often throughout the day, as most of us have a busy schedule. With websites, it is often advantageous to know when the current page has been written or created.

That is why I have written this simple WordPress plugin for websites. At first glance it appears to be a basic plugin that displays the current time, but there is much more behind the scenes.

Cache Time displays the time that the current page was cached, or, if the page is not part of the caching system, it shows the current time. It is smart enough to take into consideration the time zone of the WordPress installation, and it checks the WP-Cache configuration file for any URLs that are not supposed to be cached. My website is currently displaying this information in the footer.

Tested up to the latest version of WordPress, 2.6.

If you have any comments, questions or suggestions, please contact me or write a comment.

Download latest version of Cache Time

Limitations

  • Officially, the only supported caching system is WP-cache, though I have not tested WP-Super-Cache.

Usage

  1. Upload the plugin to your WordPress plugins folder.
  2. Inside the WP admin panel, activate plugin.
  3. Wherever you wish to display the information, use inside your Template pages

Customization

There are 3 elements that can be customized with Cache Time:

  1. Text displayed when page is cached
    Open cache-time.php inside the Cache-time folder with your favorite text editor and find line 27 that says $cached = 'Page cached on: ';. Change the text between the quotes for your own message.
  2. Text displayed if no cache is present
    Similar to above, find line 29 that says $not_cached = 'Time is now: '; and change the text between the quotes.
  3. Date Format
    Again inside the cache-time.php file, line 36 can be changed to display your choice of information. More details about customizing the date can be found at w3schools.

FAQs

What is the point of this plugin?
Cache Time is meant to display the time that your website last cached the current page, for both you and your users’ benefit. There are many instances where users want the most current information, and this is an easy way to show how current that info is.

Is WP-Cache the only caching plugin that works with Cache Time?
Officially, yes. I have not been able to fully test WP-Super-Cache yet, but I believe it would work the same way.

OK, but what I don’t have WP-cache installed?
If no caching system is installed, the plugin simply displays the current time.

Changelog

v1.0 –– May 14, 2008
* Initial release

v1.01 — May 19, 2008
* update the readme file

v1.0.2 — July 28, 2008
* Cleaned up code and readme file

View all plugins

[tags]Wordpress, plugin, websites[/tags]


{ 0 comments… add one }

Leave a Comment

Next Post:

Previous Post:

Twitter Feed