So the answer was to use base64_encode and base64_decode.
So basically doing something like this to set the transient:
$json_contact_info = json_encode( $contact_info );
$transient_data = encrypt_text( $json_contact_info );
$transient_array = base64_encode( $transient_data );
$transient_set = set_transient( $transient_name, $transient_array, 60 * 60 * 24 * 7 );
And then to get the transient:
$decrypted_transient_data = decrypt_text( base64_decode( $transient_data ) );
$cr_json = json_decode( $decrypted_transient_data );
Related Posts:
- When should I be using the Transients API?
- Cache remote (HTTP) request with Transients API
- Is there any danger in deleting all transients?
- Why are transients cleared prematurely?
- Get a list of existing transients
- Storing posts social counters by using transient api
- How to save new transients if query changes?
- Integrating WP-TLC-Transients with WordPress – Where to Begin?
- Is priming a Transient Cache possible?
- What causes a transient to changes status to “Does Not Expire”?
- Reset Transient on New Day
- How to use transients and variables
- Transient storage location? database/xcache/w3Total Cache?
- How to delete transients written by fetch_feed()?
- Set Transient expiration
- WordPress transient doesn’t use the transient
- How do I reset a transient when updating a widget’s value?
- How to clear Transients on all sites in Multi Sites environment
- Is this the proper usage of creating / using a transient?
- Should I use the Transients API to temporarily hold edited attachements?
- transient or not transient
- Can Transients be used to store sensitive data?
- wp_options flooded with transient API entires
- Why Transients may not work correctly?
- How many transients is too many transients
- Synchronize Data every minute with set_transient
- Difference between get_site_transient() and get_transient()
- delete_transient on click inside a widget form
- Set_Transient to end at midnight
- Whats wrong with this transient? Not caching as expected
- Set transient with get posts error
- Clear Transients
- Unique Transients user id for Non-Logged In users
- Transient is never set. Why?
- Button to clear transients
- Set transient name
- Hacked site using transient API?
- Ajax call to transients
- Doesn’t set_transient() add multiple rows with the same key?
- Chrome not Firefox are not dumping to SSLKEYLOGFILE variable
- File extension .DB – What kind of database is it exactly?
- How to encrypt String in Java
- Encrypt with private key and decrypt with public key
- Encrypt Password in Configuration Files?
- How does object caching work?
- How WordPress encrypt password? [duplicate]
- Are the default salts secure?
- Using transients in conjunction with memcached
- Do WordPress’ cron’s clean up expired transients?
- How to validate WordPress generated password in DB using PHP?
- Why does WordPress create two transients with the same name when I specify timeout value?
- Fragment caching increasing database queries
- WordPress transients for a shortcode
- Encrypt emails?
- How to delete a transient on post/page publish?
- Transients vs CRON +Custom Fields: Caching Data Per Post
- Transient not working for custom loops
- get_transient(), PHP switch(), and comparison operators
- Storing an XML Response (Transient)?
- Store and Encrypt Contact Form 7 Submissions in Database? [closed]
- How can I store an image in the database with Transients API?
- Transient caching for wp query
- Can I edit the wp_post > post_content right before its inserted/updated?
- how to get the value of time left for a transient
- How does WordPress handle sessions?
- Clearing cached plugin data if it is using an external object cache
- Can set_transient() be used in multi-site?
- CNAME site attempts to load files over HTTP instead of HTTPS
- Minimize database queries to user tables?
- How to use transient in this code for related post?
- Delete a WordPress transient from a shortcode on Page/Post update
- Transients are not expiring as expected in simple custom plugin
- Store a default value for a transient on plugin activation
- Is using custom table to suit business needs instead of transients a big hit to page load speed?
- Transient not behaving as expected
- Using an Encryption class in a WordPress Plugin
- Pass MD5 value to prepopulate field
- How to decode wordpress transient cache stored in database?
- How to make use of Transient API as cookie
- After having installed APC Object Cache Backend transients stopped working
- Compare custom taxonomies of updated post (or new post) [Updated with progress]
- Is the login encrypted before it is sent? If so how to do I encrypt it the same way?
- passing markup thought a shortcode attribute
- Compare transient data with a meta box value
- WordPress transient not working with WP Engine
- How to write update query in WordPress to expire transients
- Workflow for new importer plugin – your advices?
- Storing temporary data for a custom post type
- Managing and deleting transients with dynamically generated transient names
- Change WooCommerce product and variation prices programatically without affecting performance
- set_transient fails if the value has more than 60.000 characters
- Is it possible to restore an expired transient?
- Transient not working for external data
- Retrieve $_POST data to send to javascript without using localize script
- Add Hook for clearing transient when post is added
- Delete Transient when clicking ‘Save Changes’ on options page
- How to optimize performance without transient?
- How to Deobfuscate a sourcecop protected WordPress plugin?
- How can i store cache of wordpress a database request without plugins?
- How can I wordpress cache a database request with no existing plugin?