Skip to content

Add caching layer for direct database queries #21

@chubes4

Description

@chubes4

Summary

Direct database queries should use WordPress caching mechanisms to improve performance.

Findings

  • ~50+ warnings for uncached database calls
  • Direct $wpdb->get_results() and similar calls without caching

Caching Options

  1. Object Cache - wp_cache_get() / wp_cache_set()

    • Best for frequently accessed data
    • Persists across requests with object cache plugins
  2. Transients - get_transient() / set_transient()

    • Best for data that can be stale temporarily
    • Built-in expiration support

Why This Matters

  • Reduces database load
  • Improves page load times
  • Required for scalability on high-traffic sites
  • Plugin Check requirement for performance

Acceptance Criteria

  • Identify queries that benefit from caching
  • Implement appropriate caching strategy for each
  • Add cache invalidation on data changes
  • Plugin Check passes caching validation

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance improvementsplugin-checkWordPress Plugin Check compliance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions