Download the PHP package rockschtar/wordpress-object-storage without Composer
On this page you can find all versions of the php package rockschtar/wordpress-object-storage. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rockschtar/wordpress-object-storage
More information about rockschtar/wordpress-object-storage
Files in rockschtar/wordpress-object-storage
Package wordpress-object-storage
Short Description Transients in green
License MIT
Informations about the package wordpress-object-storage
rockschtar/wordpress-object-storage
Description
WordPress plugin that provides functions similar to transients but without their general behavior: transients may disappear at any time (for example when a persistent object cache evicts them), so code must never rely on them. Objects stored with this plugin persist until they expire or are deleted — nothing else removes them.
- Data is stored in the
wp_optionstable (never autoloaded), so it survives object cache evictions. - Optional expiration time per object; expired objects are cleaned up hourly by a WP-Cron job
(
rsos_delete_expired) and lazily on read. - Values are serialized automatically when needed — store scalars, arrays or objects as they are.
Requirements
- PHP >= 8.4
- WordPress >= 6.8
Install
Composer
For composer based WordPress projects (roots/bedrock or
johnpbloch/wordpress); the package is installed as a
must-use plugin (wordpress-muplugin):
Manual
Download wordpress-object-storage-<version>.zip from the
latest release and install
it like any other plugin (the zip ships with its own autoloader).
Usage
Set object
An expiration of 0 (default) means the object never expires. A negative expiration deletes the
object.
Get object
Returns false if the object does not exist or is expired. Like get_option(), a stored value of
false is indistinguishable from a missing object.
Delete object
ObjectStorage class
The rsos_* functions are thin wrappers around the ObjectStorage class, which offers a few more
methods:
License
rockschtar/wordpress-object-storage is open source and released under MIT license. See LICENSE.md file for more info.