{"id":16055917,"url":"https://github.com/varunsridharan/wp-transient-api","last_synced_at":"2025-08-09T09:32:29.205Z","repository":{"id":62543823,"uuid":"123292999","full_name":"varunsridharan/wp-transient-api","owner":"varunsridharan","description":"Provides Option to store Transient / options with version management.","archived":false,"fork":false,"pushed_at":"2021-04-29T19:35:47.000Z","size":145,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T10:21:31.429Z","etag":null,"topics":["transient-handler","transients","vsp-libs","wordpress","wordpress-cache","wordpress-data","wordpress-development","wordpress-library","wordpress-php-library","wordpress-plugin","wordpress-plugin-development","wordpress-plugin-library","wordpress-plugins","wordpress-theme","wordpress-transients","wp-library","wp-plugin","wp-theme"],"latest_commit_sha":null,"homepage":"https://varunsridharan.github.io/wp-transient-api/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/varunsridharan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-28T14:02:32.000Z","updated_at":"2023-01-17T09:14:05.000Z","dependencies_parsed_at":"2022-11-02T21:30:32.146Z","dependency_job_id":null,"html_url":"https://github.com/varunsridharan/wp-transient-api","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/varunsridharan/wp-transient-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-transient-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-transient-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-transient-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-transient-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/varunsridharan","download_url":"https://codeload.github.com/varunsridharan/wp-transient-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-transient-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262801825,"owners_count":23366632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["transient-handler","transients","vsp-libs","wordpress","wordpress-cache","wordpress-data","wordpress-development","wordpress-library","wordpress-php-library","wordpress-plugin","wordpress-plugin-development","wordpress-plugin-library","wordpress-plugins","wordpress-theme","wordpress-transients","wp-library","wp-plugin","wp-theme"],"created_at":"2024-10-09T02:23:08.013Z","updated_at":"2025-06-30T15:37:16.611Z","avatar_url":"https://github.com/varunsridharan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordPress Transient API\nThis library provides developers to manage all their Transients with version management. \n\n[![Latest Stable Version](https://poser.pugx.org/varunsridharan/wp-transient-api/version)](https://packagist.org/packages/varunsridharan/wp-transient-api)\n[![Total Downloads](https://poser.pugx.org/varunsridharan/wp-transient-api/downloads)](https://packagist.org/packages/varunsridharan/wp-transient-api)\n[![Latest Unstable Version](https://poser.pugx.org/varunsridharan/wp-transient-api/v/unstable)](//packagist.org/packages/varunsridharan/wp-transient-api)\n[![License](https://poser.pugx.org/varunsridharan/wp-transient-api/license)](https://packagist.org/packages/varunsridharan/wp-transient-api)\n[![composer.lock available](https://poser.pugx.org/varunsridharan/wp-transient-api/composerlock)](https://packagist.org/packages/varunsridharan/wp-transient-api)\n\n\n## Installation\nThe preferred way to install this extension is through [Composer](http://getcomposer.org/download/).\n\nTo install **WP_Transient_API library**, simply:\n\n    $ composer require Varunsridharan/WP_Transient_API\n\nThe previous command will only install the necessary files, if you prefer to **download the entire source code** you can use:\n\n    $ composer require Varunsridharan/WP_Transient_API --prefer-source\n\nYou can also **clone the complete repository** with Git:\n\n    $ git clone https://github.com/varunsridharan/wp-transient-api.git\n\nOr **install it manually**:\n\n[Download WP_Transient_API.php](https://raw.githubusercontent.com/varunsridharan/wp-transient-api/master/class-transient-wp-api.php):\n\n    $ wget https://raw.githubusercontent.com/varunsridharan/wp-transient-api/master/class-transient-wp-api.php\n\n\n## Options\n| Option | Notes |\n| ------ | ----- |\n| ***WP Options API*** ||\n| `option_prefix` | Custom text to auto prefix for each option added via this class |\n| `option_surfix` | Custom text to auto append for each option added via this class | \n| `option_version` | On Which version the given option to be saved\n| `option_auto_delete` | if set to true then it auto deletes if the version dose not match|\n| ***WP Transient API*** ||\n| `transient_prefix` | Custom text to auto prefix for each option added via this class |\n| `transient_surfix` | Custom text to auto append for each option added via this class | \n| `transient_version` | On Which version the given option to be saved\n| `transient_auto_delete` | if set to true then it auto deletes if the version dose not match|\n\n\n## Usage \n\n```php\n$api = new Varunsridharan\\WordPress\\Transient_API::instance('instance_key',array(\n    // Transients\n    'transient_version'     =\u003e 1.0,\n    'transient_auto_delete' =\u003e false,\n    'transient_surfix'      =\u003e '',\n    'transient_prefix'      =\u003e '',\n    // WP DB Options\n    'option_auto_delete'    =\u003e false,\n    'option_version'        =\u003e 1.0,\n    'option_surfix'         =\u003e '',\n    'option_prefix'         =\u003e '',\n    // Global Config.\n    'is_option'             =\u003e false,\n));\nYourPlugin_Transient_Api::instance();\n\n```\n\n## Global Based On Class Settings \n**Note** : `update only works for if class set to wp options api` \n```php\nYourPlugin_Transient_Api::instance('instance_key')-\u003eset('your-key','your-value');\nYourPlugin_Transient_Api::instance('instance_key')-\u003eget('your-key'); # Returns the values only if option version matched with $option_version\nYourPlugin_Transient_Api::instance('instance_key')-\u003eupdate('your-key','your-value'); # Updates the options value\nYourPlugin_Transient_Api::instance('instance_key')-\u003edelete('your-key'); # Deletes the options and its releated options \n```\n\n\n\n## WP Options API With Version Management\n```php\nYourPlugin_Transient_Api::instance('instance_key')-\u003eadd_option('your-key','your-value');\nYourPlugin_Transient_Api::instance('instance_key')-\u003eget_option('your-key'); # Returns the values only if option version matched with $option_version\nYourPlugin_Transient_Api::instance('instance_key')-\u003eupdate_option('your-key','your-value'); # Updates the options value\nYourPlugin_Transient_Api::instance('instance_key')-\u003edelete_option('your-key'); # Deletes the options and its releated options \n```\n\n\n## WP Transient API With Version Management\n```php\nYourPlugin_Transient_Api::instance('instance_key')-\u003eadd_transient('your-key','your-value',2000);\nYourPlugin_Transient_Api::instance('instance_key')-\u003eget_transient('your-key'); # Returns the values only if option version matched with $transient_version\nYourPlugin_Transient_Api::instance('instance_key')-\u003edelete_transient('your-key'); # Deletes the options and its releated options \n```\n\n---\n\n\u003c!-- START common-footer.mustache  --\u003e\n## 📝 Changelog\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n[Checkout CHANGELOG.md](https://github.com/varunsridharan/wp-transient-api/blob/main/CHANGELOG.md)\n\n\n## 🤝 Contributing\nIf you would like to help, please take a look at the list of [issues](https://github.com/varunsridharan/wp-transient-api/issues/).\n\n\n## 📜  License \u0026 Conduct\n- [**GNU General Public License v3.0**](https://github.com/varunsridharan/wp-transient-api/blob/main/LICENSE) © [Varun Sridharan](website)\n- [Code of Conduct](https://github.com/varunsridharan/.github/blob/main/CODE_OF_CONDUCT.md)\n\n\n## 📣 Feedback\n- ⭐ This repository if this project helped you! :wink:\n- Create An [🔧 Issue](https://github.com/varunsridharan/wp-transient-api/issues/) if you need help / found a bug\n\n\n## 💰 Sponsor\n[I][twitter] fell in love with open-source in 2013 and there has been no looking back since! You can read more about me [here][website].\nIf you, or your company, use any of my projects or like what I’m doing, kindly consider backing me. I'm in this for the long run.\n\n- ☕ How about we get to know each other over coffee? Buy me a cup for just [**$9.99**][buymeacoffee]\n- ☕️☕️ How about buying me just 2 cups of coffee each month? You can do that for as little as [**$9.99**][buymeacoffee]\n- 🔰         We love bettering open-source projects. Support 1-hour of open-source maintenance for [**$24.99 one-time?**][paypal]\n- 🚀         Love open-source tools? Me too! How about supporting one hour of open-source development for just [**$49.99 one-time ?**][paypal]\n\n\u003c!-- Personl Links --\u003e\n[paypal]: https://sva.onl/paypal\n[buymeacoffee]: https://sva.onl/buymeacoffee\n[twitter]: https://sva.onl/twitter/\n[website]: https://sva.onl/website/\n\n\n## Connect \u0026 Say 👋\n- **Follow** me on [👨‍💻 Github][github] and stay updated on free and open-source software\n- **Follow** me on [🐦 Twitter][twitter] to get updates on my latest open source projects\n- **Message** me on [📠 Telegram][telegram]\n- **Follow** my pet on [Instagram][sofythelabrador] for some _dog-tastic_ updates!\n\n\u003c!-- Personl Links --\u003e\n[sofythelabrador]: https://www.instagram.com/sofythelabrador/\n[github]: https://sva.onl/github/\n[twitter]: https://sva.onl/twitter/\n[telegram]: https://sva.onl/telegram/\n\n\n---\n\n\u003cp align=\"center\"\u003e\n\u003ci\u003eBuilt With ♥ By \u003ca href=\"https://sva.onl/twitter\"  target=\"_blank\" rel=\"noopener noreferrer\"\u003eVarun Sridharan\u003c/a\u003e \u003ca href=\"https://en.wikipedia.org/wiki/India\"\u003e\n   \u003cimg src=\"https://cdn.svarun.dev/flag-india.jpg\" width=\"20px\"/\u003e\u003c/a\u003e \u003c/i\u003e \u003cbr/\u003e\u003cbr/\u003e\n   \u003cimg src=\"https://cdn.svarun.dev/codeispoetry.png\"/\u003e\n\u003c/p\u003e\n\n---\n\n\n\u003c!-- END common-footer.mustache  --\u003e\n\n\n[composer]: http://getcomposer.org/download/\n[downloadzip]:https://github.com/varunsridharan/wp-transient-api/archive/master.zip\n\n[latest-stable-version-img]: https://poser.pugx.org/varunsridharan/wp-transient-api/version\n[latest-Unstable-version-img]: https://poser.pugx.org/varunsridharan/wp-transient-api/v/unstable\n[total-downloads-img]: https://poser.pugx.org/varunsridharan/wp-transient-api/downloads\n[Latest-Unstable-version-img]: https://poser.pugx.org/varunsridharan/wp-transient-api/v/unstable\n[wpcs-img]: https://img.shields.io/badge/WordPress-Standar-1abc9c.svg\n[license-img]: https://poser.pugx.org/varunsridharan/wp-transient-api/license\n[composerlock-img]: https://poser.pugx.org/varunsridharan/wp-transient-api/composerlock\n\n[latest-stable-version-link]: https://packagist.org/packages/varunsridharan/wp-transient-api\n[latest-Unstable-version-link]: https://packagist.org/packages/varunsridharan/wp-transient-api\n[total-downloads-link]: https://packagist.org/packages/varunsridharan/wp-transient-api\n[Latest-Unstable-Version-link]: https://packagist.org/packages/varunsridharan/wp-transient-api\n[wpcs-link]: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/\n[license-link]: https://packagist.org/packages/varunsridharan/wp-transient-api\n[composerlock-link]: https://packagist.org/packages/varunsridharan/wp-transient-api","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvarunsridharan%2Fwp-transient-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvarunsridharan%2Fwp-transient-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvarunsridharan%2Fwp-transient-api/lists"}