Linux 软件免费装

WP Plugin Cache

开发者 dartiss
更新时间 2011年3月14日 16:12
捐献地址: 去捐款
PHP版本: 2.0.0 及以上
WordPress版本: 3.1

标签

WordPress Plugin Developer Cache

下载

1.0 1.1 1.2

详情介绍:

WP Plugin Cache was designed to provide developers with an easy to use cache system that they could integrate into their plugins. Now, even the smallest and simplest plugin can use a caching system! If you're not a developer, you may be asked to install this plugin to add caching features to a plugin. Having a seperate caching facility ensures efficient use of code and, ultimately, improved performance. However, performance improvements are always down to how any developer implements this plugin - hints and tips are provided throughout the instructions. Unless you're a developer, wishing to use this plugin to compliment one of your own, there's no need to read any further. If you are, read on! For help with this plugin, or simply to comment or get in touch, please read the appropriate section in "Other Notes" for details. This plugin, and all support, is supplied for free, but donations are always welcome. Introduction When activated, the plugin creates a folder in your wp-contents/uploads directory named plugin_cache. This will store any cached files. The main functions to be aware of are plugin_cache_read and plugin_cache_update. The read and updating functions are seperate to allow for the files to be "stripped down" before being saved, allowing for improved performance. However, if changes are not necessary then the plugin_cache_read function can perform the entire caching procedure by itself. plugin_cache_read The function plugin_cache_read has 4 parameters... file key : This is a unique key to identify the cached file. Often, just the filename would be sufficient, but if you need to differentiate between different versions of the same filename (e.g. a news feed which may contain different numbers of entries) then extra data can be added. filename : This is the filename of the file that you wish to read if a cache doesn't exist. This is optional - if no cache is found and a filename hasn't been specified, then nothing will be returned by the function. This allows you to fetch the file yourself. timeout : This is the number of hours after which you wish the cache to be updated. Specifying this causes the function to also perform the same processing as plugin_cache_update. prefix : This is an optional parameter and allows you to specify a prefix that will be added to the cache filename. This is useful is plugins wish to identify their cached files with a unique prefix - the plugin can then, additionally, provide the option to delete its own cache files. So, specifying a filename but NOT a timeout will cause the file to be fetched - either from cache or not. Specifying a timeout and a filename will mean that the file will be fetched and then updated in the cache. The function will return an array containing the following data... cache_update : Does the cache need updating? This is relevant if you are using the plugin_cache_update function, as you can use it to determine whether you need to call it or not. It contains either Y or blank. data : This is the returned file contents. If it was not fetched from cache and you did not specify a filename, then this will be blank. An example of usage would be... $return=plugin_cache_read("test","http://www.artiss.co.uk/feed",3,"test"); This would fetch the feed from my site, updating the cache and giving it a timeout of 3 hours. The cache file would begin with the prefix "test_". plugin_cache_update The function plugin_cache_update has 4 parameters... file key, file contents, timeout and prefix. Only the last parameter is optional and all except the second are the same as with plugin_cache_read. The second parameter is the file contents rather than the filename itself. An example would be... $return=plugin_cache_update("test",$data,3); This would update the cache with the contents of $data for 3 hours.

安装:

  1. Upload the entire wp-plugin-cache folder to your wp-content/plugins/ directory.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. That's it - there's no admin screen!

升级注意事项:

1.0
  • Initial release
1.1
  • Upgrade to fix a bug which could affect caches being saved
1.2
  • Upgrade if you are using a version of WordPress pre 2.6 or with to fix 2 critical bugs

常见问题:

Which version of PHP does this plugin work with?

It has been tested and been found valid from PHP 4 upwards.

更新日志:

1.0 1.1 1.2