Loco-nonce error question | WordPress.org

[ad_1]

Plugin Author
Tim W

(@timwhitlock)

My plugin uses wp_create_nonce and wp_verify_nonce.

I can’t answer your question with certainty, as all of this is taken care of by WordPress, but looking at the code in wp_verify_nonce it seems that it should last 24 hours maximum.

I’ve not experienced the problem you’re describing, but I can tell you that the Loco Translate editor uses Ajax, and the nonce is preloaded into the browser. So, without a page refresh, you won’t get a new nonce. So I suppose if you left the editor page open all day, then this could happen. I can only suggest you reload the page if you come back to it after a long idle period.

I can look at regenerating the nonce after each save, but I’ve not been given cause to until now.

Rather than disable it, it looks like you can control nonce_life with a filter.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer