Transients are being used effectively
The plugin seems to be using transients effectively. Here’s why:
- Caching Tags: Your plugin uses a transient to cache the tags fetched from the database. This can significantly reduce the load on your database if you have a large number of tags, as the tags are fetched from the transient cache instead of making a database query each time.
- Expiration of Transients: The transients in your plugin are set to expire after 12 hours. This is a reasonable duration that balances the need for fresh data with the performance benefits of caching.
- Invalidation of Transients: Your plugin invalidates (deletes) the transients when a new term is created or when the number of tags to display is updated. This ensures that the cached data is not stale and reflects the most recent state of your tags.
- Option to Disable Transients: You’ve added an option to disable the use of transients for caching tags. This gives users the flexibility to choose whether to use transients based on their specific needs and hosting environment.
Such cache is available in Advanced Version only. Check out all features.
As long as the transients are being deleted when they are no longer needed (which your plugin does), they should not cause unnecessary database bloat.