awesomemotive / wp-mail-logging

:envelope: Logs each email sent by WordPress.
48 stars 25 forks source link

Query executed on site load and cache expiration time adjustment #165

Closed donmhico closed 1 year ago

donmhico commented 1 year ago

Description

This PR replaces the usage of wp_cache_get and wp_cache_set to use get_transient / set_transient to make sure we are caching certain DB queries and not doing DB calls on each page load.

Motivation

Fixes #150.

Testing procedure

  1. Install Query Monitor plugin in your WordPress.
  2. Check the query calls.
  3. You should no longer see the query SHOW TABLES LIKE %s being called on each page load.