Restrict access to thank you page
-
Greetings friends.
After the wponce (Nonce) expires, users can still access the page like:
https://example.com/thank-you-transaction-result/?order_id=78&_wpnonce=cad3bf9999Not that it is bad or breaks anything, it is just unsightly and looks unprofessional / sloppy. The user sees messages like “Error! Nonce value is missing in the URL or Nonce verification failed.” and “do not access this page directly”.
The ideal situation would be modification to the plugin to prevent this behavior, but I understand you guys are very busy.
I have searched plugin code trying to find some type of filter / hook / function so I could handle in themes function, but unsuccessful. In a Woo environment, I would use something like:
add_action('template_redirect', 'custom_nonce_check'); function custom_nonce_check() { $notices = wc_get_notices(); foreach ($notices['error'] as $notice) { if ($notice === "Error! Nonce value is missing in the URL or Nonce verification failed.") { wp_redirect("https://discountplr.com/link-expired/"); exit(); } } }
Could you please ask the dev if there is something like wc_get_notices() in WP Express Checkout?
- The topic ‘Restrict access to thank you page’ is closed to new replies.