woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
228 stars 201 forks source link

Caching issue on WPEngine #1335

Open leglesslizard opened 3 years ago

leglesslizard commented 3 years ago

Describe the bug We noticed an issue with the WooCommerce Waitlist plugin when used in conjunction with this plugin on WPEngine hosting with regards to nonce verification. Isolated the issue and created a minimal plugin to demonstrate it (included). When processing the nonce request the verification will fail with the Stripe plugin enabled. This has been narrowed down to the following line of code (with this commented out the issue goes away): https://github.com/woocommerce/woocommerce-gateway-stripe/blob/4cc53bc355fdab1c387625e5e3841e0563ad0c92/includes/payment-methods/class-wc-stripe-payment-request.php#L141

The plugin to demonstrate the issue: `<?php /**

To Reproduce Steps to reproduce the behavior:

  1. Install and activate the nonce plugin and stripe plugin on a WPEngine install (page caching must be enabled so cannot be hidden behind a password for example)
  2. Make sure in the Stripe settings "Payment Request Buttons" is checked
  3. Visit the frontend and open network tab
  4. Visit any single product page and click the "Test" link
  5. The result of the verify nonce function is printed for the AJAX request (int(1) is a success, bool(false) is a fail)
  6. If the error doesn't present, clear cache and retry in incognito/private browser window

Expected behavior AJAX request should process the nonce verification without problems (as it does when plugin is deactivated).

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

sarraherring commented 3 years ago

Hey there! I just thought I'd pop in here as well. I have been experiencing issues with this as well. You can see the issues happening on my staging website (https://tclstagingsite.wpengine.com/product/hello-color-book-signed/); It currently never loads the email for the user. It seems the engineers have determined it to be an infinity caching issue.

Please let me know if anymore information from me is helpful.

Thanks.