Hi, currently, the cached metadata of a post is auto-purged when a post transitions from one state to the other and one of the two states is ‘publish’. Truth is I hadn’t given it much thought about the need to review metadata while the post is still a draft. Apparently this has to be taken into account. Thanks for pointing it out!
The code that would purge the cached metadata on every save is already there, but is commented out. If possible, please try uncommenting this line of the /wp-content/plugins/add-meta-tags/add-meta-tags.php file and please check if this works as expected.
George
Alternatively, maybe it should be left as is, but prevent the metadata from being cached if the post is a draft (or better if none of the two states is ‘publish’). It’ll need some experimentation. I’ll try to look into this very soon.
I think I’ll go ahead with setting it to not cache the metadata if the post isn’t published and leave the current logic with auto purging as is. That seems to make more sense.
uncommenting this line of the /wp-content/plugins/add-meta-tags/add-meta-tags.php file and please check if this works as expected.
Indeed worked perfect. Whatever you decide to implement for future releases – this modification is working very well. Thank you for reading.
Hi, I’ve released 2.10.5 in which metadata is not cached for post objects (posts, pages. attachments, custom post types, products, etc), unless they have been published. I think this makes the most sense of the two possible resolutions, especially since the triggering of the auto-purging is also based on the post status.
I’ve also corrected another minor issue with the clean up of the whole metadata cache from the WP database when the plugin settings where saved. I discovered that WordPress also creates an extra object regarding the real transient object’s timeout. This was undocumented and previous AMT releases didn’t clean those up properly. Now this has been fixed. To the best of my knowledge now caching works without any issues.
Thank you for your useful feedback!
Best Regards,
George