Skip to content

Commit 27b6f4c

Browse files
committed
Fix: "Nonce value cannot be verified" when dequeue-ing scripts and styles onPOS checkout modal
1 parent 78167d0 commit 27b6f4c

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

includes/Templates/Payment.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private function check_troubleshooting_form_submission() {
116116
// Check if our form has been submitted
117117
if ( isset( $_POST['troubleshooting_form_nonce'] ) ) {
118118
// Verify the nonce
119-
if ( ! wp_verify_nonce( $_POST['troubleshooting_form_nonce'], 'troubleshooting_form_action' ) ) {
119+
if ( ! wp_verify_nonce( $_POST['troubleshooting_form_nonce'], 'troubleshooting_form_nonce' ) ) {
120120
// Nonce doesn't verify, we should stop execution here
121121
die( 'Nonce value cannot be verified.' );
122122
}
@@ -191,6 +191,7 @@ public function get_template(): void {
191191

192192
// create nonce for cashier to apply coupons
193193
$coupon_nonce = wp_create_nonce( 'pos_coupon_action' );
194+
$troubleshooting_form_nonce = wp_create_nonce( 'troubleshooting_form_nonce' );
194195

195196
/**
196197
* The wp_set_current_user() function changes the global user object but it does not authenticate the user

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wcpos/woocommerce-pos",
3-
"version": "1.3.2",
3+
"version": "1.3.3",
44
"description": "A simple front-end for taking WooCommerce orders at the Point of Sale.",
55
"main": "index.js",
66
"workspaces": {

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: kilbot
33
Tags: cart, e-commerce, ecommerce, inventory, point-of-sale, pos, sales, sell, shop, shopify, store, vend, woocommerce, wordpress-ecommerce
44
Requires at least: 5.6 & WooCommerce 5.3
55
Tested up to: 6.3
6-
Stable tag: 1.3.2
6+
Stable tag: 1.3.3
77
License: GPL-3.0
88
License URI: http://www.gnu.org/licenses/gpl-3.0.html
99

@@ -63,6 +63,9 @@ There is more information on our website at [https://wcpos.com](https://wcpos.co
6363

6464
== Changelog ==
6565

66+
= 1.3.3 - 2023/07/28 =
67+
* Fix: "Nonce value cannot be verified" when dequeue-ing scripts and styles onPOS checkout modal
68+
6669
= 1.3.2 - 2023/07/27 =
6770
* Urgent Fix for variations not downloading for some users
6871

templates/payment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
<?php endforeach; ?>
305305
</div>
306306
</div>
307-
<?php wp_nonce_field( 'troubleshooting_form_action', 'troubleshooting_form_nonce' ); ?>
307+
<input type="hidden" name="troubleshooting_form_nonce" value="<?php echo $troubleshooting_form_nonce; ?>" />
308308
<button type="submit"><?php _e('Submit', 'woocommerce-pos'); ?></button>
309309
<a href="#" class="toggle-troubleshooting"><?php _e('Close', 'woocommerce-pos'); ?></a>
310310
</form>

woocommerce-pos.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WooCommerce POS
44
* Plugin URI: https://wordpress.org/plugins/woocommerce-pos/
55
* Description: A simple front-end for taking WooCommerce orders at the Point of Sale. Requires <a href="http://wordpress.org/plugins/woocommerce/">WooCommerce</a>.
6-
* Version: 1.3.2
6+
* Version: 1.3.3
77
* Author: kilbot
88
* Author URI: http://wcpos.com
99
* Text Domain: woocommerce-pos
@@ -24,7 +24,7 @@
2424
use function define;
2525

2626
// Define plugin constants.
27-
const VERSION = '1.3.2';
27+
const VERSION = '1.3.3';
2828
const PLUGIN_NAME = 'woocommerce-pos';
2929
const SHORT_NAME = 'wcpos';
3030
define( __NAMESPACE__ . '\PLUGIN_FILE', plugin_basename( __FILE__ ) ); // 'woocommerce-pos/woocommerce-pos.php'

0 commit comments

Comments
 (0)