Advertisement
geminilabs

[site-reviews] disable the nonce check

Feb 10th, 2021
1,114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. /**
  2.  * This removes the nonce check for logged-in users when submitting a review.
  3.  *
  4.  * A nonce is a special generated security token that expires after 12 hours.
  5.  * Nonces prevent malicious form submissions and is an additional security measure
  6.  * used in WordPress forms for logged in users. Nonces can be problematic when your
  7.  * pages are cached. It's general practice in WordPress to not cache pages for
  8.  * logged in users for this reason. However, if caching is required on your site
  9.  * for logged in users, then this snippet will disable the use Site Reviews nonce
  10.  * check for submitted reviews.
  11.  *
  12.  * @see http://developer.wordpress.org/plugins/security/nonces/
  13.  */
  14. add_filter('site-reviews/router/unguarded-actions', function ($actions) {
  15.     $actions[] = 'submit-review';
  16.     return $actions;
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement