WP Manifestindependent plugin directory
manifest / performance / ktwp-wp-plugin-caching-toolkit

KupieTools Caching Toolkit

A plugin providing functions for WordPress developers to implement PHP function caching for performance.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/kupietools/ktwp-wp-plugin-caching-toolkit/archive/refs/heads/main.zip
Updates itself. It ships its own updater (Update URI header), so new versions appear under Dashboard → Updates.

A powerful WordPress plugin that provides a framework for developers to implement function caching for dramatic performance improvements. This toolkit intelligently caches function results and automatically clears those caches when content changes.

Features

  • Function result caching with automatic invalidation
  • Configurable cache invalidation triggers
  • Integration with WordPress core hooks for cache management
  • Admin interface under the KupieTools menu
  • Optimized for performance with minimal overhead
  • Uses WordPress transients and object cache for maximum compatibility
  • Developer-friendly API for implementing caching in custom code

Core Functions

For Developers

  • getFunctionTransient($functionName, $arguments=[], $manualClearOnly=false) - Retrieve cached function results
  • setFunctionTransient($functionName, $value, $arguments=[]) - Cache function results
  • hashArguments($arguments) - Utility function to create consistent hashes of function arguments

Cache Invalidation

The plugin intelligently clears caches when content changes, with configurable triggers for:

  • Post saving/updating
  • Category/taxonomy creation, editing, and deletion
  • Post trashing
  • Theme and plugin file editing

Configuration Options

In the WordPress admin panel under KupieTools:

  • Enable/disable cache clearing for different WordPress actions
  • Configure cache behaviors for different types of content updates
  • Special handling for theme/plugin file editing

Benefits

  • Dramatically improves performance for expensive function calls
  • Reduces database queries and server processing time
  • Intelligent cache invalidation means content stays fresh
  • No manual cache management required - it all happens automatically
  • Preserves dynamic content functionality while improving speed

For WordPress Developers

// Example usage in your theme or plugin:
function my_expensive_function($param1, $param2) {
    // Check if we have a cached result
    $cached = getFunctionTransient('my_expensive_function', [$param1, $param2]);
    if ($cached !== null) {
        return $cached;
    }

    // If not cached, do the expensive operation
    $result = // ... expensive operations ...

    // Cache the result for future use
    setFunctionTransient('my_expensive_function', $result, [$param1, $param2]);

    return $result;
}

Installation

  1. Upload the plugin files to the /wp-content/plugins/ktwp-caching-toolkit directory
  2. Activate the plugin through the WordPress admin interface
  3. Configure settings under the KupieTools menu in WordPress admin

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.