The Transients Module provides a complete WordPress transients management system within the admin area. It allows administrators to view, search, create, edit, and delete transients stored in both the database and external object caches (Redis).
Key Capabilities
View all transients from the wp_options table with expiration and value preview
Detect and display transients stored in Redis object cache
Create, edit, and delete transients via the admin UI
Filter transients by type: persistent, with expiration, expired, WordPress core
Search transients by name
Bulk delete operations
CSV export with progress indicator
REST API endpoint for asynchronous transient detail retrieval
Modal viewer with copy-to-clipboard and native share support
Multisite support with site-wide transient handling
Technology Stack
PHP 7.4+ (strict types)
WordPress WP_List_Table API
WordPress Transient API (get_transient(), set_transient(), etc.)
WordPress REST API for modal data fetching
Direct database queries for listing and expiration resolution
The list table uses AJAX-based deletion — single transient deletes happen without a full page reload, with a fade-out animation and toast notification.
Note: Persistent transients (those with no expiration) have their date/time fields rendered as hidden inputs with empty values. The expiration section is not shown to the user.
Enables/disables the entire Transients module. When disabled, the Transients viewer sub-menu is hidden and all management UI is removed.
4. Core Classes
4.1 ADVAN\Helpers\Transients_Helper
Core helper class for all transient operations — CRUD, object cache detection, value type detection, and database queries.
Constants
PHP
<?php
// WordPress core transients that are auto-detected and flagged in the UIpublicconstWP_CORE_TRANSIENTS = array(
'update_themes',
'update_plugins',
'update_core',
'theme_roots',
'poptags_',
'doing_cron',
'wp_theme_files_patterns-',
'wp_plugin_dependencies_plugin_data',
'wp_styles_for_blocks',
'wp_core_block_css_files',
'health-check-site-status-result',
);
Object Cache Detection Methods
Method
Return
Description
is_object_cache_active()
bool
Checks if WordPress is using an external persistent object cache via wp_using_ext_object_cache()
get_object_cache_backend()
string
Returns the detected backend: 'redis', 'memcached', 'memcache', 'apcu', 'unknown', or 'none'
get_object_cache_description()
string
Human-readable label for the active backend (e.g., “Redis”, “Memcached”)
Transient Query Methods
Method
Return
Description
get_transient_items(array $args)
array|int
Main query method — retrieves transients from the database with optional search, pagination, type filtering. Merges Redis transients when applicable. Pass 'count' => true for count only.
Retrieves a single transient by its option_id. When called via REST (with $request), returns a formatted REST response with HTML table.
get_redis_transients(array $args)
array
Scans Redis for transients matching WordPress key patterns. Supports search and type filtering.
Transient Name & Value Methods
Method
Return
Description
get_transient_name(string $transient)
string
Extracts the clean transient key from the full option_name. Strips _transient_ (offset 11) or _site_transient_ (offset 16) prefix.
clear_transient_name(string $transient)
string
Alias for get_transient_name() — used in display contexts.
get_transient_expiration_time(string $transient)
int
Returns the Unix timestamp of the transient’s expiration by looking up the corresponding _transient_timeout_ option. Returns 0 for persistent transients.
get_transient_value(string $transient)
string
Formats a transient value for list display — truncates to 100 characters, wraps in <code>, and appends a type detection badge.
is_site_wide(string $transient_name)
bool
Returns true if the option name contains _site_transient.
Creates a new transient. Delegates to update_transient() internally.
delete_transient(int $id)
bool|WP_Error
Deletes a transient by its option_id. Resolves the transient name from the database, determines if site-wide, and uses the appropriate delete_transient() or delete_site_transient() API.
Value Type Detection
The private method get_transient_value_type() classifies transient values into these types:
Type
Detection Logic
array
Value unserializes to a PHP array
object
Value unserializes to a PHP object
serialized
Value is a serialized string (is_serialized())
html
Value contains HTML tags (strip_tags() differs from original)
json
Value is a valid JSON string
numeric
Value is numeric (not timestamp-length, not 0/1)
timestamp?
Value is numeric and exactly 10 digits long
boolean?
Value is "0", "1", "yes", "no", "true", or "false"
scalar
Any other scalar value
empty
Value is empty
4.2 ADVAN\Lists\Transients_List
Extends Abstract_List (which extends WP_List_Table). Handles the transients admin list table rendering, column management, filtering, and bulk operations.
Registers admin_post action handlers for update and new transient, page load hook, and styles
menu_add()
Registers the admin submenu page under Error Logs at position 5
process_actions_load()
Handles bulk actions during early page load (before output)
prepare_items()
Queries transients, applies search/pagination/filters, sets up table
fetch_table_data(array $args)
Delegates to Transients_Helper::get_transient_items()
manage_columns($columns)
Defines table columns: cb, transient_name, schedule, value
format_column_value($item, $column_name)
Renders individual column content including row actions and badges
get_views()
Returns filter view links: All, Expired, Persistent, With Expiration, Core
get_bulk_actions()
Returns available bulk actions (Delete)
handle_table_actions()
Processes bulk delete action with nonce verification
single_row($item)
Overrides row rendering to add status CSS classes (persistent, late, on-time)
Filter View Logic
PHP
<?php
// The get_views() method builds filter links using get_filtered_transients()// which classifies all transients into these categories:$filtered = array(
'persistent' => /* transients where schedule === 0 */,
'core' => /* transients matching WP_CORE_TRANSIENTS names */,
'expired' => /* transients where schedule > 0 and time has passed */,
'with_expiration' => /* transients where schedule > 0 */,
);
4.3 ADVAN\Lists\Views\Transients_View
Handles page rendering for all transient screens (list, edit, add) and processes form submissions.
Public Static Methods
Method
Description
analytics_transients_page()
Main page renderer — checks capabilities, routes to list/edit/add form based on action parameter
update_transient()
Form handler for editing — validates nonce, delegates to Transients_Helper::update_transient(), redirects
new_transient()
Form handler for creating — validates nonce, delegates to Transients_Helper::create_transient(), redirects
page_load()
Cleanup hook — removes _wp_http_referer and bulk_action query args
add_help_content_transients()
Returns contextual help text for the transients screen
Page Routing Logic
PHP
<?php
// analytics_transients_page() routes based on the 'action' parameter:$action = sanitize_key( $_REQUEST['action'] ?? '' );
if ( 'edit_transient' === $action ) {
// Render edit form with pre-filled values from database
} elseif ( 'new_transient' === $action ) {
// Render blank new transient form
} else {
// Render the list table (default view)
}
Modal Viewer (JavaScript)
The list page includes an inline modal built with WordPress media modal styles. Transient data is loaded via the REST API:
JavaScript
// Triggered by clicking the "View" row action
jQuery(document).on('click', '.aadvana-tablerow-view', function(e) {
e.preventDefault();
var id = jQuery(this).data('details-id');
wp.apiFetch({
path: '/0-day/v1/get_transient_record/' + encodeURIComponent(id) + '/',
method: 'GET',
cache: 'no-cache'
}).then(function(response) {
// response.mail_body contains the formatted HTML table// response.transient_name contains the transient key
jQuery('.media-modal .http-request-args').html(response.mail_body);
jQuery('.media-modal .transient-name').html(response.transient_name);
});
jQuery('.media-modal').addClass('open');
jQuery('.media-modal-backdrop').addClass('open');
});
5. Data Model & Storage
Transients are stored in the standard WordPress wp_options table. The module queries this table directly for listing and joins the timeout option for expiration data.
Database Query Structure
SQL
SELECT go.option_id, go.option_name, go.option_value, go.autoload,
d.option_value AS schedule
FROM wp_options ASgoLEFTJOIN wp_options d
ON d.option_name = CONCAT('_transient_timeout_',
SUBSTRING(go.option_name, LENGTH('_transient_') + 1))
WHERE (go.option_name LIKE'_transient_%'OR go.option_name LIKE'_site_transient_%')
AND go.option_name NOTLIKE'%_transient_timeout_%'ORDERBY option_id DESCLIMIT {offset}, {per_page}
Normalized Transient Data Array
Both database and Redis transients are normalized to this format before display:
PHP
<?php
$transient = array(
'transient_name' => 'my_custom_data', // Clean name (no prefix)'value' => '<code>...</code>', // Truncated HTML for display'schedule' => 1711900800, // Unix timestamp or 0 (persistent)'id' => 42, // option_id (positive = DB, negative = Redis)'source' => 'database', // 'database' or 'redis'
);
Redis transients use negative IDs (decremented counter) to distinguish them from database record IDs. This allows the list to display both sources without ID conflicts.
6. Object Cache Integration
The module automatically detects whether WordPress is using an external object cache and adapts its behavior accordingly.
If active, get_object_cache_backend() inspects PHP extensions and global objects:
Redis: Checks for \Redis or \Predis\Client classes, then verifies via $wp_object_cache properties/methods or WP_REDIS_HOST / WP_REDIS_SERVERS constants
Memcached: Checks for \Memcached class + $wp_object_cache->mc property
Memcache: Checks for \Memcache class
APCu: Checks for apcu_cache_info function + $wp_object_cache->apcu_get method
Redis Key Scanning
When Redis is detected, get_redis_transients() scans for keys matching these patterns:
New \Redis() connection using WP_REDIS_HOST, WP_REDIS_PORT, WP_REDIS_PASSWORD, WP_REDIS_DATABASE constants
De-duplication
When merging Redis and database transients, duplicates are removed by checking transient names. Database records take priority — Redis-only transients are appended to the end of the list.
Handles inline (AJAX-based) transient deletion from the list table. Uses nonce verification and returns JSON response.
9. Settings Reference
Settings are on the Transients Options tab within the main settings page.
PHP
<?php
// Check if transients module is enabled$enabled = Settings::get_option( 'transients_module_enabled' );
Settings Builder Usage
PHP
<?php
// How the settings are defined in transient-list.php
Settings::build_option(
array(
'title' => esc_html__( 'Transients Options', '0-day-analytics' ),
'id' => 'options-settings-tab',
'type' => 'tab-title',
)
);
Settings::build_option(
array(
'name' => esc_html__( 'Enable transients module', '0-day-analytics' ),
'id' => 'transients_module_enabled',
'type' => 'checkbox',
'hint' => esc_html__( 'If you disable this, the entire plugin transients module will be disabled...', '0-day-analytics' ),
'default' => Settings::get_option( 'transients_module_enabled' ),
)
);
10. List Table Columns & Filtering
Columns
Key
Header
Sortable
Description
cb
☐
No
Bulk selection checkbox
transient_name
Name
No
Transient name with WP core icon, Redis badge, and row actions
schedule
Expiration ({timezone})
No
Expiration timestamp or “Persistent” badge
value
Value
No
Value preview (100 chars) with type badge
Sorting is disabled for transients columns due to the storage format constraints (transients are stored across wp_options rows with joined timeout rows). The list is ordered by option_id DESC by default.
Search
The search box filters by transient name (the option_name column in wp_options). Query parameter: sgp
Filter Views
All transients (no filters) – All transients including Redis
Expired transients – Transients past their expiration
Persistent transients – Transients with no expiration (schedule = 0)
Transients with expiration – Transients with an expiration set