Divi Theme’s Email Optin Module Not Working with LiteSpeed Cache
-
The Elegant Themes Divi Email Optin module (https://www.elegantthemes.com/documentation/divi/newsletter/) is not working with LiteSpeed Cache due to the nonce not being registered with the LiteSpeed API. The Optin module submits via AJAX and this stops working after the nonce expires every 12 hours or so until I manually flush the LiteSpeed cache.
I checked out your documentation and found that I need to manually write a function to register the nonce with LiteSpeed: https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:api#nonce_issues
I checked the Divi code (et_pb_submit_subscribe_form() function in their includes/builder/core.php file) and confirmed that the nonce that I need to register is called “et_frontend_nonce”:
https://paste.pics/8581c86b60529cfbb77a884bb7e3da84In my child theme’s functions.php, I wrote a function to register this nonce:
https://paste.pics/1325acb472e09f156f923e1c19f4a0e9
After enabling LiteSpeed debug logging for my Admin IP, I confirmed that it was being successfully registered!LiteSpeed is set to “Cache Logged-in Users” separately and of course the nonce that I see when logged into the site is different from the one that the public sees when accessing the site. From the debug log, I see that the “et_frontend_nonce” nonce is viewable at this link: https://www.jedduggar.com/?lsesi=nonce&esi=eyJhY3Rpb24iOiJldF9mcm9udGVuZF9ub25jZSIsIl9sc19zaWxlbmNlIjp0cnVlfQ%3D%3D&_hash=24c726023691f65f3a8944eca858e5e4
Last night when I went to bed the “et_frontend_nonce” for me logged into the site was “c7c197cf4e”: https://paste.pics/fb907d2cd485976e244fd056ffce2bf1
This morning when I checked the above URL it was supposed to be “dbf5f48b06”. However, the source of the page for “et_frontend_nonce” is now displaying a string of cryptic characters when I’m logged into the site: “?KIJ3M3?H20???A”
https://paste.pics/bacff9445ae74338729823c735248052What is up with that???
If it’s any help, I found that the wp_create_nonce() call that outputs this nonce onto the page is inside of the “et_builder_load_modules_styles” function in the “includes/builder/framework.php” file and uses “wp_localize_script”:
https://paste.pics/e7331cf0b0358156a79fa6a339511281I have sent a status report to you as requested in your forum support request rules:
Report number: JIAUCCJO
Report date: 11/09/2019 16:57:34So is it possible to use the Divi theme’s Email Optin Module with LiteSpeed Cache?
The page I need help with: [log in to see the link]
- The topic ‘Divi Theme’s Email Optin Module Not Working with LiteSpeed Cache’ is closed to new replies.