PHPackages                             philipnewcomer/persistent-transients - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. philipnewcomer/persistent-transients

ActiveLibrary[Caching](/categories/caching)

philipnewcomer/persistent-transients
====================================

Persistent transients for WordPress

1.0.1(9y ago)24.5k↓50%3[1 issues](https://github.com/philipnewcomer/persistent-transients/issues)GPLv2PHP

Since Jan 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/philipnewcomer/persistent-transients)[ Packagist](https://packagist.org/packages/philipnewcomer/persistent-transients)[ RSS](/packages/philipnewcomer-persistent-transients/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Persistent Transients for WordPress
===================================

[](#persistent-transients-for-wordpress)

This library exists to fill a very specific use case: when you need transients that are guaranteed to exist until their expiration timestamp.

In most cases, you should be using normal [transients](https://codex.wordpress.org/Transients_API) instead. Don't use this library unless you have a good reason to.

Background
----------

[](#background)

WordPress transients are not guaranteed to persist until their expiration timestamp. There are a number of things, including core updates, or a full in-memory object cache, that can cause a transient to be deleted before it is due to expire.

However, sometimes you may need to store data that is transient, cannot be regenerated as you would typically do with a normal transient, and must be available up to the time when it is due to expire. An example of this use case is an email confirmation link, with a unique key generated by `uniqid()`. This data cannot be regenerated, and must be guaranteed to persist in the database until its expiration timestamp.

Using a custom post type or custom database table may be overkill for this type of thing, and that's where this library comes into play.

What This Does
--------------

[](#what-this-does)

Persistent Transients stores transient data in the WordPress options table. Expired transients are garbage collected once per day. Because it does not use the regular WordPress transients system, and is not stored in the in-memory object cache, these transients are not affected by any of the things that may cause a normal transient to expire prematurely.

Usage
-----

[](#usage)

Persistent Transients provides three drop-replacements for the regular WordPress transient functions: `set`, `get`, and `delete`.

```
PersistentTransients\set( $transient, $value, $expiration );

```

- **$transient** (string) A unique identifier for the cached data.
- **$value** (array|object) The data to save.
- **$expiration** (integer) The number of seconds to keep the data.

*Saves a persistent transient. Will overwrite an existing transient with the same name if it exists.*

```
PersistentTransients\get( $transient );

```

- **$transient** (string) A unique identifier for the cached data.

*Returns the transient value, or `false` if it has expired or does not exist.*

```
PersistentTransients\delete( $transient );

```

- **$transient** (string) A unique identifier for the cached data.

*Deletes a transient. Use if you want to remove a transient before its expiration.*

Installation
------------

[](#installation)

This is a Composer package, not a traditional WordPress plugin. Install [via Composer](https://packagist.org/packages/philipnewcomer/persistent-transients).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3391d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/12f960edc40ea879fb20f1e250fcf74f951f231796423782a8aefd65fba4e5eb?d=identicon)[philipnewcomer](/maintainers/philipnewcomer)

---

Top Contributors

[![philipnewcomer](https://avatars.githubusercontent.com/u/1446874?v=4)](https://github.com/philipnewcomer "philipnewcomer (6 commits)")

---

Tags

cachingtransientswordpresswordpress-developmentwordpress-php-librarywordpress-transients

### Embed Badge

![Health badge](/badges/philipnewcomer-persistent-transients/health.svg)

```
[![Health](https://phpackages.com/badges/philipnewcomer-persistent-transients/health.svg)](https://phpackages.com/packages/philipnewcomer-persistent-transients)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
