Transients have practical limitation on key length (45 symbols or something like that), so using dynamic keys tends to come with risk of ending up with keys too long and having it break down.
One of common practices is to form unique string (for example combination of plugin name and type of data being saved, etc) and hash it with md5()
to use as transient key of fixed predictable length.
For clarity could use plugins name to prefix md5 hash instead, so it’s clear where transient comes from, when seeing it in database.
Related Posts:
- How to get home page ID?
- Creating a WordPress admin page without a menu for a plugin
- pre_set_site_transient_update_plugins wont call on hosted webspace
- Force Plugin Updates: “Update Failed: Plugin update failed.” after update one plugin
- How to get post ID with hooks publish_post, new_to_publish, etc
- Form that generates an ID for the customer
- Set post tags using tag ID
- Set WordPress Transient Expiration via Variable Value
- Get Image Having the ID [closed]
- Search by Attachment ID
- Managing and deleting transients with dynamically generated transient names
- Give custom page template a custom post ID
- Bookmarking custom template pages which all have the same page ID
- Custom Post Type with Sequence ID
- Get Current Post ID in WP Loop For GiveWP
- Is there a function to search for a wildcard value when calling a shortcode?
- Get page content by ID (from a 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?
- How to create a dynamically created page on wordpress plugin?
- Progmatically adding menu links to the default (Top) or Footer menu
- Add text to variable
- Where is my google maps on my page? [closed]
- standard custom page template hierarchy for plugins
- get specific value of a array | PHP
- How do I add $_SESSION[”] to my wordpress page?
- How to get specific string/value from an array? php [closed]
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- How do i show different group of images below a button when the button is clicked on the same page in wordpress? [closed]
- plugin wraps the entire content
- React error #231with Custom Blocks after upgrade to WP 5.5
- Add User Role: Pre-saved in User-Meta [SOLVED]
- There has been a critical error on your website – won’t fix no matter what
- Adding custom meta boxes to specified custom post type
- WordPress Console Application (ability to excecute a custom function via crontab only)
- Get orders of a specific customer woocommerce
- What am is missing? (API CORS)
- How to do database for download stats?
- Shortcode Attributes to Return different $_POST
- How to find out which plugin create captcha after login?
- Comment IP Plugin – Fixing onfocus=’this.select()’
- How do I make reusable content blocks for header and footer when using WordPress headless with another front-end?
- WordPress 5.4 – How to prevent to enter only certain values in custom field
- What form should the $query media query array have for an Elementor page builder function? [closed]
- Private Page View Counter
- WooCommerce: Force coupon for existing/registered customers [closed]
- Plugin Activation Error – The plugin generated 22 characters of unexpected output during activation
- Plugin Admin Menu Boiler Plate
- How can I add IP address to my post?
- REST API can’t get the response manually
- Super slow plugin page (lots of error 500)
- How to make a dynamic css class whose name changes every visit to confuse scraper
- serverSideRender does not render “preview” html inside Gutenberg block
- How use wp media upload liberary in react components?
- Add_rewrite_endpoint doesn’t work with post name permalink structure
- How to notify wordpress instalation about my plugin update?
- Is it possible not to load theme on a specific page in wordpress?
- How to change shortcode’s default theme?
- Integer in Array returns null
- Plugin onclick button activate other plugin
- composer not working on my plugin when i upload it to my website
- wc_get_template new template does not showing up
- How to select a paragraph other than the 1st to be the post’s excerpt?
- Moving Jetpack buttons to appear below the first H2 title on all project/post pages [closed]
- Send email to multiple addresses on Contact Form 7, but exclude personal details on all but one
- How can I support plugins in a custom theme?
- Display site language setting in source code
- Show icons or badges under title on product archives/category pages
- How to get theme’s info from wordpress.org/themes using api.wordpress.org?
- Override/ignore CSS from active theme as not to interfere with my custom CSS
- WordPress Custom Pages that work with Plugins?
- posts from multiple post types in one slider
- How to automatically redirect to custom admin menu after plugin activation?
- How to use the CSS of the WordPress core in the development of my administration page?
- Redeclare function after plugin activation
- add_submenu_page returns null
- What is the WordPress approach to custom data?
- Conditional Shipping Options if Certain Products are in Cart WooCommerce
- Readable titles in mobile
- How to do the simplest possible frontend ajax call from a plugin?
- The XXX plugin has been deactivated due to an error: The plugin does not have a valid header
- How can I add “last updated” in plugin descripton?
- get_edit_post_link() not working on wp-cron
- get_option / wp_localize_script Not Working in OOP Plug In
- New bulk action to resend welcome emails
- Get site url and updates data, then use them
- How to have a gallery in which each image’s caption is a whole “post”?
- I receive taxonomy id
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- WordPress won’t allow for updates to plugins or WordPress Core
- WordPress Stock Update Programatically
- Loading a plugin’s js file from functions.php
- Woocommerce Backend Search by Title and SKU
- I Setup Rate My Post Plugin On Site But Now Got Issues In Google Webmasters
- How to integrate together a website currently hosted WordPress.com and a custom web application currently hosted on Azure?
- How-to: This block can only be used once
- output html on post or page from custom plugin [closed]
- Custom Post Type – custom form in dashboard
- Problem with add_action
- To perform the requested action, WordPress needs to access your web > server