The Transients API provides a standardized way to store data temporarily (with an expiration time) in the database.

learn more… | top users | synonyms

0
votes
0answers
17 views

WooCommerce Shipping

I have a WordPress site using WooCommerce with bespoke shipping functionality on. All it does is find the users shipping address and works out the distance between the customer and the depot, based on ...
0
votes
1answer
20 views

Transients are not expiring as expected in simple custom plugin

I have developed a simple shortcode plugin that essentially gets txt files from the url provided in the shortcode and parses a specific piece of data from them (date the file was last modified). I am ...
3
votes
1answer
48 views

Reset Transient on New Day

I have a plugin that interfaces with an API and am storing retrieved schedule data in a transient. Storing the transient for 24 hours: set_transient($schedule_cache, $schedule_data, 60 * 60 * 24); ...
1
vote
2answers
61 views

Delete transients in website

We have so many error happen on website (WordPress and Woocommerce) error log and it will show the following error message WordPress database error Deadlock found when trying to get lock; try ...
0
votes
0answers
42 views

WordPress database error Deadlock found

My website become slow due to this issue. WordPress database error Deadlock found when trying to get lock; try restarting transaction for query DELETE FROM wp_options WHERE option_name LIKE ...
0
votes
0answers
29 views

Test if fragment caching is working

I had this fragment caching function added in the `function.php. it goes like this: function fragment_cache($key, $ttl, $function) { if ( is_user_logged_in() ) { ...
0
votes
0answers
17 views

Add Hook for clearing transient when post is added

I have this fragment caching implemented in a page. I've got the codes from https://css-tricks.com/wordpress-fragment-caching-revisited/. Which goes like this: function fragment_cache($key, ...
-3
votes
1answer
46 views

Why can't I save encrypted data in a transient?

I'm trying to save encrypted data (using AES-256-CBC in PHP) in a transient but for some reason it keeps failing. The transient key is under the required length of 45 characters and the data is not a ...
13
votes
3answers
249 views

Should I use Transient API to store HTML String, or Object?

Let's assume that there is a plugin that displays 20 related posts (for each post) with a very complex query. And then using data from this query, it builds complex HTML layout. Also, should be noted ...
0
votes
2answers
54 views

Transients with dynamic WP_Query

I have a <form> with about 20 inputs (mostly select and number) which each is an argument in WP_Query if filled. I learned today that I could use transients to store results which seems like a ...
0
votes
1answer
87 views

Is there a better way to access transients using javascript

I've been searching around the web trying to find a better way to use wordpress transients with javascript. Currently I am using admin-ajax to run a php function that retrieves the transient and ...
1
vote
1answer
42 views

What causes a transient to changes status to “Does Not Expire”?

I noticed that some transients on my site every now and then go from having an expiration date to "Does Not Expire". I have noticed this happening with some plugins (eg Gravity Forms) but also ...
0
votes
1answer
85 views

Should I store external API data in my WP database or keep it as a transient?

I am in a situation where I need to use data from an API (XML) served by a third party in my WordPress site. The data will be updated on that third party application. Specifically this is data about ...
0
votes
1answer
57 views

Hacked site using transient API?

I have got a website to "cleanup" which has almost 10k replicated files in the public_html folder and almost all PHP files contains code ...
0
votes
0answers
46 views

WP_cron not updating post meta, instead clearing it

I'm trying to store social media follower count (ex. FB fans, Twitter followers) in post meta daily with wp_cron. If I manually save the post it will save the social media count numbers correctly in ...
0
votes
1answer
20 views

Cannot get transient to work on shortcode, Moz API

I'm new to transients and have been having a tough time switching over. I was able to fix my shortcodes for Facebook and Twitter API, but I can't get Moz API to work as a transient. Below is the ...
1
vote
0answers
21 views

Which hook is fired when tag is added or changed? [duplicate]

I have a transient that collects WordPress tags with specific description. I'm looking for a hook name that fires when user edits a WordPress tag or creates a new tag in admin so I can delete my ...
0
votes
1answer
47 views

Delete Transient when clicking 'Save Changes' on options page

I have an options page setup for a ticker tape on a theme I am working on. It has a number of options such as Title, number of posts to display and what categories to display posts from. I have also ...
0
votes
0answers
153 views

Notice: Undefined property: stdClass and WordPress transients

I took this for a basis https://github.com/abeMedia/shareCount and created a class for retrieving social share counts to use in a theme. I also implemented WordPress's built-in transients for cashing. ...
3
votes
1answer
114 views

How to save new transients if query changes?

I am using WP REST API to pull blog posts into another site. Everything works great, but now I need to save the results into transients to prevent querying the blog every time. I am new to transients ...
0
votes
0answers
64 views

How to decode wordpress transient cache stored in database?

Wordpress stores caches using Transient and saved in wp_options table. I can't read those stored values - a sample snapshot is as below. If you know how to decode/read/parse them, please share.
1
vote
0answers
15 views

Can we turn off Wordpress `transient` cache? [duplicate]

When studying Wordpress, I notice that a lot of database changes are on wp_options table - a closer monitor will show that a lot of transient related changes are made. I wonder if we can turn off ...
0
votes
0answers
45 views

Translation in Core , Plugin and Theme Update

I'm curious about translations in update transient for Core , Plugin and Theme updates. I got this from _site_transient_update_core in wp_option table in this why translations array is always empty? ...
1
vote
1answer
54 views

Hook an action when a transient is deleted ? Can't get it to work!

I'm working on a plugin, and it caches a remote page when requested. The file is created with tempnam(). I save the path of that cached file in a transient, using the transient API. Once the ...
1
vote
2answers
345 views

Looping through posts per category gives same posts for each category

For a specific section on my website I loop through some categories and get the three latest posts in that categorie and list them. Like so: <?php $categories = get_categories(array('exclude' ...
0
votes
1answer
108 views

Web scraping using transients

I'm using xPath to scrape tour dates from another website (with permission of course). Since it updates on every page load, I thought about using transients to store the data. Unfortunately I have no ...
0
votes
1answer
95 views

Workflow for new importer plugin - your advices?

I'm building a new plugin to import Pinterest Pins from a user into Wordpress. It will NOT work using the Pinterest API (which is too limited for what I want to do) and requires the user login and ...
0
votes
1answer
50 views

Set Transient on CPT

When I add set_transient code to my cpt query, I get a Fatal error: Call to a member function have_posts() on string ... on line 30 Line 30 is basically: if($graduate_student_query->have_posts()) ...
4
votes
1answer
389 views

Fragment caching increasing database queries

While implementing fragment caching on a wordpress site by using the technique described here: http://css-tricks.com/wordpress-fragment-caching-revisited/ I found that it seems to actually increase ...
2
votes
1answer
83 views

How to use transients and variables

I am trying to implement transient fragments, I've been doing what is suggested here: http://css-tricks.com/wordpress-fragment-caching-revisited/ While it is working for headers, footers, landing ...
1
vote
0answers
116 views

Transient storage location? database/xcache/w3Total Cache?

I've been working to speed up my site by utilizing transients to store rendered HTML and it works great. I've set up checks that clear specific transients upon post/page/data updates and it all works ...
1
vote
1answer
163 views

How to delete transients written by fetch_feed()?

I'm using fetch_feed() to cache external rss sources displayed in a widget. in case the widget (or, more likely, the whole plugin) is deleted/deactivated, i want to manually delete all related ...
0
votes
2answers
74 views

What is the best way (regarding performance) to set transients for logged in users?

I have an option for my logged in users where they can hide the posts they dont want to see. Everything works as expected until I implement transients. When I set the transients to cache the posts ...
0
votes
0answers
57 views

What is the best way to upload a temporary & sensitive file and then delete it when done

What is the best way to upload a temporary & sensitive file and then delete it when done. I'm writing a plugin (eventually for multisite) that allows users with a certain role to upload a .csv ...
0
votes
1answer
81 views

How to make use of Transient API as cookie

I want to use Transient API as cookie, but I want to know if it is the best practice,and how to make transient be unique or per user. Thanks
1
vote
1answer
118 views

Messing up with transient API - getting flushed on refresh

Following the _s theme I wanted to make my own version of Post Categories List with Transient, and here's what I made: function my_blog_categories() { global $post; if ( ( ...
2
votes
2answers
496 views

Transient not working for custom loops

I'm working at a WordPress theme. Since I need to display featured posts, related posts, some widgets with recent posts and so on, I need to use multiple custom loops. Because of this, the number of ...
0
votes
1answer
233 views

Storing temporary data for a custom post type

I've created a Rental custom post type to a rental site I'm developing for a client. I'd like to add an ajax availability calendar in the backend so the client can mark/unmark unavailable dates ...
5
votes
1answer
187 views

Storing posts social counters by using transient api

I would like to know if it's a good practice to use transient api to cache social counters for every post. Loading post pages get quite slow while processing and getting all social APIs.
0
votes
0answers
94 views

Show the online status of the current post's author

Is there a way that I can show the online status (Either online or offline) of the author of the post that a site visitor is viewing? I imagine it's something to do with the Transients API ...
-1
votes
1answer
440 views

How to cache wp_query with pagination using transients?

I have seen examples where there is a fix number of posts to be queried; however, I cant find an example when using pagination. I am trying to figure out how to use transients to cache a WP_Query ...
1
vote
1answer
414 views

How to delete a transient on post/page publish?

I have a transient set for a custom query. It expires in 30 days. But I also need it to expire once a new post/page is published. So that the new published post/page is available in that custom query. ...
0
votes
1answer
929 views

pre_set_site_transient_update_plugins wont call on hosted webspace

I am trying to use pre_set_site_transient_update_plugins to update my plugin from a GitHub repository. For that I am using this example. On my Dev-System (MAMP for Mac Version 2.2) everything is ...
0
votes
0answers
45 views

Should I use transients for these API call results?

I am consuming an API that gives me a list of people and their profiles. My initial idea was working perfectly fine when it's just the list of people because I was just saving the ids and names using ...
0
votes
1answer
41 views

How to optimize performance without transient?

I've built a widget to output some fancy content from an API. I realize today I added a transient system so everytime the widget is updated transient is deleted and everything is alright. What I ...
1
vote
0answers
48 views

wp_options flooded with transient API entires

I make heavy use of the WordPress Transient API. Suddenly a few days ago my wp_options table began being flooded with transient entries (2GB worth on average). Normally WordPress only writes them to ...
0
votes
1answer
77 views

Whats wrong with this transient? Not caching as expected

I am trying to cache the returned data from a query using WP_Query. It doesn't seem to be storing any where near the time I have specified. Sometimes its refreshing on every page load. What might I ...
1
vote
1answer
99 views

Minimize database queries to user tables?

I'm trying to come up with a strategic way to collect large amounts of usermeta data (and output to the screen) while keeping database queries low. Some pages, like the home page, single pages, and ...
0
votes
2answers
352 views

Set Transient expiration

I have a page that displays a random post every day. In order to change post every 24 hours I use set_transient('totd_trans_post_id', $totd[0]->ID, (60*60*24)); What I'm wondering is this: ...
1
vote
2answers
94 views

Transient API and caching Plugins

Hello wordpress NINJAS.... I am crazy about transient api and I have implemented it in my theme.My question is If I use transient api is it required caching plugin? (I hate plugins!!!) If I use ...