• Resolved SEOreviewtools

    (@seoreviewtools)


    Hi,

    I’m keep running into issues with my “ajax-nonce” and the WP lightspeed plugin that seems to be caching the nonce.

    This is what I’ve done so far to deal with this issue:

    1. I’ve added the “ajax-nonce” to the Cache => ESI => ESI Nonces
    2. In addition I’ve added do_action( ‘litespeed_nonce’, ‘ajax-nonce’); before creating this nonce in my functions.php file.

    (I think, according to the documentation option 2 shouldn’t be necessary).

    Is there something that I’m missing here?

    Because after hitting the “Empty Entire Cache” button, things seem to work for a while but within a couple of hours the problem returns.

    Any help is appreciated!

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Support qtwrk

    (@qtwrk)

    you need to make sure the correct nonce name, it might not just be simple as ajax-nonce , please share the part of plugin’s source code that generates nonce

    Thread Starter SEOreviewtools

    (@seoreviewtools)

    Hi, it’s not a plugin, but it’s custom code.

    // this is how the nonce is created 
     
    function ajax_login_init(){
    
      do_action( 'litespeed_nonce', 'ajax-nonce');
      $ajax_nonce = wp_create_nonce('ajax-nonce');
      ....
     }
     
     add_action('init', 'ajax_login_init');
    
     // and this is how the nonce is verified (same file)
    
    function fetchUrl() {
    
    	
    	$nonce = $_REQUEST['nonce'];
    	if ( ! wp_verify_nonce( $nonce, 'ajax-nonce' ) ) {
    		die( 'Nonce value cannot be verified.' ); 
    	}	
    	
        die();
    }
    add_action('wp_ajax_fetchUrl', 'fetchUrl');
    add_action('wp_ajax_nopriv_fetchUrl', 'fetchUrl');
     

    And the function is called by this JavaScript.

    function fetchUrl(dataInput){
    		
    jQuery.ajaxSetup({
        data : {
    	action : 'fetchUrl', 
    	nonce: ajax_login_object.login_nonce, 
    	...
    	},
    });
    Thread Starter SEOreviewtools

    (@seoreviewtools)

    Additionally it seems to happen much more frequently in Opera compared to other browsers.

    Plugin Support qtwrk

    (@qtwrk)

    please provide the report number , you can get it in toolbox -> report -> click “send to LiteSpeed”

    Thread Starter SEOreviewtools

    (@seoreviewtools)

    This is the report number TEBDTVWF

    I’ve excluded all important tools for now from caching.

    This tool however uses the same configuration: https://www.seoreviewtools.com/free-headline-generator/ and suffers from the same caching issue.

    Thread Starter SEOreviewtools

    (@seoreviewtools)

    Excluding these pages from cashing isn’t working either. The nonce issue keeps popping up…

    Any updates? Thank you!

    Plugin Support qtwrk

    (@qtwrk)

    now that makes no sense , if page is not cached , then how come nonce will be problematic , please try disable object cache as well , see how it goes.

    Thread Starter SEOreviewtools

    (@seoreviewtools)

    Disabled object cache a couple of hours ago and will report back to you.

    Plugin Support qtwrk

    (@qtwrk)

    how thing goes ?

    Thread Starter SEOreviewtools

    (@seoreviewtools)

    Yes, all looks good for now.

    Any suggestions on how to configure object cache.. or just leave it disabled?

    Thread Starter SEOreviewtools

    (@seoreviewtools)

    So far, so good. I’ve also remove the pages / tools that where effected from the exclude list and everything seems to work as expected.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘LiteSpeed nonce issue’ is closed to new replies.