11<?php
22/*
3- Plugin Name: No transients
3+ Plugin Name: No transients in database
44Version: 1.0.0
5+ Description: Prevent transients from being stored in the database when external object cache is being used
56Plugin URI: https://beapi.fr
67Author: Be API
78Author URI: https://beapi.fr
@@ -39,8 +40,6 @@ class NoTransients {
3940 * Initialize the class and set up hooks
4041 */
4142 public function __construct () {
42-
43-
4443 // Prevent transients from being retrieved
4544 add_filter ( 'pre_option ' , [ $ this , 'prevent_transient_retrieval ' ], 10 , 2 );
4645
@@ -59,6 +58,7 @@ public function __construct() {
5958 // Show admin notice if no external object cache is being used
6059 add_action ( 'admin_notices ' , [ $ this , 'show_admin_notice ' ] );
6160
61+ // Clean up transients from the database
6262 add_action ( 'beapi_clean_transients ' , [ $ this , 'cleanup_transients ' ] );
6363 }
6464
@@ -67,6 +67,7 @@ public function __construct() {
6767 *
6868 * @param mixed $pre The pre-option value
6969 * @param string $option The option name
70+ *
7071 * @return mixed The modified pre-option value
7172 */
7273 public function prevent_transient_retrieval ( $ pre , $ option ) {
@@ -142,5 +143,4 @@ public function show_admin_notice() {
142143 }
143144}
144145
145- // Initialize the class
146146new NoTransients ();
0 commit comments