Home>Support>Nonce Error when submitting form using So Contact Form widget

Nonce Error when submitting form using So Contact Form widget

Hello. I have a form on my contact page, using the Site Origin Contact Form widget, which was working fine till earlier. I noticed recently that sometimes the success message was not firing when submitting the contact form. I had to reload page and submit again, and it would then go through.

So I added a small text note to my contact page (contact form embedded on page as gutenberg SO widgets block; i just added another text block), and updated the page and cleared old page cache. But now, whenever i submit my contact form, i am getting a nonce error.

{“code”:”rest_cookie_invalid_nonce”,”message”:”Cookie nonce is invalid”,”data”:{“status”:403}}

I have WP Super Cache and Autoptimize on the site. The contact form also uses Google re captcha v2. Not using any CDN.

Things i have tried:
– Disable and re-enable both SO Page Builder and SO Widgets plugins
– Delete all cache
– Disable WP Super Cache and Autoptimize
– Republish my contact page
– I noticed that Askimet spam filter was enabled. Since i dont use it, i disabled that.

I did not check for any other plugin conflicts, since this has been live and working till recently. And no other change has been done on the site; other than regular plug in updates.

Could you please suggest what else i can do to debug or fix this ?
Thanks

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 3 years, 4 months ago Andrew Misplon
    Hi, I Work Here

    Hi Alex

    Thanks for reaching out.

    Is the issue occurring when logged out of WordPress?

  2. 3 years, 4 months ago alexj

    Hi Andrew. Thanks for getting back. Yes, it happens when logged out too. Tried multiple browsers, incognito mode, and logged in/out. It continues to give me the same issue. I also created a brand new page and contact form from scratch, but the issue persists.

  3. 3 years, 4 months ago Andrew Misplon
    Hi, I Work Here

    Thanks for the update. Please, try running a plugin conflict test. It should only take a couple of minutes. Clear your caching/optimization plugins and then temporarily deactivate all plugins except for the Widgets Bundle. In that state, does the issue perist?

  4. 3 years, 4 months ago alexj

    I cannot do that on my live environment. So I tried it on my localhost which has an identical setup. Disabled all plugins except SOWB. But the issue persists.

  5. 3 years, 4 months ago Andrew Misplon
    Hi, I Work Here

    You can try extending the test to include your theme, temporarily switch to a default theme like Twenty Nineteen, and re-run the test with all plugins deactivated except for the Widgets Bundle.

  6. 3 years, 4 months ago alexj

    I am on the Vantage theme. But i switched to the Twenty Twenty-One theme, again with all other plugins disabled, but the same thing happens.

  7. 3 years, 4 months ago Andrew Misplon
    Hi, I Work Here

    Thanks for trying. Please, send us an export of the page. Edit the page, click LayoutsImport/ExportDownload Layout. Upload the JSON file to WeTransfer or Dropbox or any similar site and send us the link. We’ll take a look and see if we can spot anything in the layout or form.

  8. 3 years, 4 months ago alexj

    Hi Andrew. We use Gutenberg block editor, so SOWB is a block for me. I ‘Copied All Content’ using the Code Editor on my page. Hope this gives you what you need. Just to note that I masked the email address. Here is the link: https://we.tl/t-1T9ZZYY2Ch

  9. 3 years, 4 months ago Andrew Misplon
    Hi, I Work Here

    Thanks for the file. We can replicate the issue and are investigating. We’ll update you as soon as we have a solution.

  10. 3 years, 4 months ago Alex S
    Hi, I Work Here

    Hi Alex,

    I’ve identified a soloution to this issue and prepared you a build of SiteOrigin Widgets Bundle with changes that allow for the layout you provided to work for me. You can download it by clicking here.

    Before proceeding, do a backup.

    Open your website and navigate to PluginsInstalled Plugins and deactivate SiteOrigin Widgets Bundle, then delete SiteOrigin Widgets Bundle. Scroll to the top of the page and click Add New, Upload Plugin and upload so-widgets-bundle.1.19.0.1.zip. When prompted, activate the SiteOrigin Widgets Bundle.

    Open the page with your contact form in the editor and edit the SiteOrigin Contact Form. Make any setting change (you can revert this change after you’ve made it) and then save. Does the contact form submit as expected now?

    Kind regards,
    Alex

  11. 3 years, 4 months ago alexj

    Hi Alex. Thanks so much for the quick update. Yes i was able to submit the form now.

    But I must say, there is a warning notice on the WordPress Page Editor. Other than that, there were no issue on page/form update, and for actually sending the form.

    See error screenshot at: https://we.tl/t-1bw7udNBhr
    The error is: “Notice: Only variables should be passed by reference in C:\xampp\htdocs\church\wp-content\plugins\so-widgets-bundle\compat\block-editor\widget-block.php on line 48”

  12. 3 years, 4 months ago Alex S
    Hi, I Work Here

    Hi Alex,

    Great to hear that helped! :)
    I’ve applied a fix for that notice. You can download an updated version of the patch with that fix by clicking here. You can install it by following the instructions provided in my last reply – you’ll need to make another edit to the SiteOrigin Widgets Block again also.

    Kind regards,
    Alex

  13. 3 years, 4 months ago alexj

    Thanks Alex. Form still works great. Only that i get a new error now on the editor :)
    Warning: end() expects parameter 1 to be array, null given in C:\xampp\htdocs\church\wp-content\plugins\so-widgets-bundle\compat\block-editor\widget-block.php on line 48

    Sorry for the annoyance – on live, i definitely have my debug flag to false. So wouldnt even know a thing. On my dev site, i got to ensure there were no red flags.

    Still, very thankful to you and Andrew for all your assistance.
    Just another question: i assume you will release this formally sometime soon as updated plugin version 1.19.1 ?

  14. 3 years, 4 months ago Alex S
    Hi, I Work Here

    Hi Alex,

    Sorry, there was a typo in the provided build. Here’s an updated build with that corrected.

    Yes, these changes will be in an upcoming update.

    Kind regards,
    Alex

  15. 3 years, 4 months ago alexj

    Hi Alex. Thanks again. Everything looks good now from my end. Much appreciated.

  16. 3 years, 4 months ago Alex S
    Hi, I Work Here

    Hi Alex,

    Great to hear that helped! :)
    Please feel free to open a new thread if anything else comes up.

    Page: New Thread

    Have a good one mate.

    Kind regards,
    Alex

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More