WP Cache Remember
Helper for the WordPress object cache and transients.
by Steve Grunwell · github.com/stevegrunwell/wp-cache-remember · website
★ 148stars
10forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/stevegrunwell/wp-cache-remember/archive/refs/heads/develop.zipFrom the readme
WP Cache Remember
WP Cache Remember is a simple WordPress include to introduce convenient new caching functions.
Well-built WordPress plugins know when to take advantage of the object cache and/or transients, but they often end up with code that looks like this:
That pattern works well, but there's a lot of repeated code. This package draws inspiration from Laravel's Cache::remember() method; using wpcacheremember(), the same code from above becomes:
Installation
The best way to install this package is via Composer:
The package ships with the composer/installers package, enabling you to control where you'd like the package to be installed. For example, if you're using WP Cache Remember in a WordPress plugin, you might store the file in an includes/ directory. To accomplish this, add the following to your plugin's composer.json file:
Then, from within your plugin, simply include or require the file:
Using as a plugin
If you'd prefer, the package also includes the necessary file headers to be used as a WordPress plugin.
After downloading or cloning the package, move wp-cache-remember.php into either your wp-content/mu-plugins/ (preferred) or wp-content/plugins/ directory. I
Read the full README on GitHub →
Releases
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.