ajax - How to check nonce lifetime value of plugins?

admin2025-06-02  3

Dear StackExchange users,

I currently use the premium version of WP Fastest Cache Premium. My website loads very fast, but I always get a 403 error for wp-admin/ajax.

I believe there is a plugin with a tremendously low nonce lifetime value.

Does anybody know how and where I can check the none lifetime value of my plugins.

Any help is appreciated.

Thanks!

Dear StackExchange users,

I currently use the premium version of WP Fastest Cache Premium. My website loads very fast, but I always get a 403 error for wp-admin/ajax.

I believe there is a plugin with a tremendously low nonce lifetime value.

Does anybody know how and where I can check the none lifetime value of my plugins.

Any help is appreciated.

Thanks!

Share Improve this question asked Feb 21, 2019 at 21:55 NiklasNiklas 531 silver badge7 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Check codex info about Nonces life time here.

Here is a quick code that will echo life time of nonces in footer of your site's front-end as html comment. Put it in your functions.php file.

$n  = "";
add_filter('nonce_life', 'wptuts_change_nonce_hourly');
function wptuts_change_nonce_hourly( $nonce_life ) {
    global $n ;
    $n = $nonce_life;
    return $nonce_life;
}

// Display in footer comments
add_filter("wp_footer","d");
function d(){
    global $n;
    echo "<!- Nonce Life =". $n ."-->";
}

NOTE: This code does not give the ideal way to check life time of nonce, but a quick fix to get the desired info. You should delete this code from functions.php once you get the info.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748878218a314473.html

最新回复(0)