Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Ricard Torres

    (@quicoto)

    Weird. Can I see it on your live site?

    What version of WordPress are you running?

    Do you have the latest version of the plugin?

    Thread Starter simpleXX

    (@simplexx)

    I send you an email. Did you check my site?
    I have the neweset WP and the newest version of the plugin.

    Plugin Author Ricard Torres

    (@quicoto)

    I did not get it. Try again here:

    torres.rick(at)gmail(dot)com

    Cheers.

    Thread Starter simpleXX

    (@simplexx)

    i dont know why but this code dotn work.

    wp_localize_script( 'thumbs_rating_scripts', 'thumbs_rating_ajax', array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'thumbs-rating-nonce' ) ) );

    but is not a problem, i have on every page an ajax request (to fix supercache bugs). I receive now the nonce from this call.

    $responseObj['nonce'] = wp_create_nonce( 'thumbs-rating-nonce' ) ;
    echo json_encode($responseObj);

    Thanks for the rly fast answer!

    Plugin Author Ricard Torres

    (@quicoto)

    I’m afraid I don’t know the answer. It’s gotta be related with the supercache.

    The line you refer to is meant to validate where the source of the ajax call is, to prevent malicious calls from other domains.

    What happens if you turn off the supercache plugin? Does it work then?

    Thread Starter simpleXX

    (@simplexx)

    I disabled all plugins … same error.

    Maybe my WP is too modified ^^

    Plugin Author Ricard Torres

    (@quicoto)

    Strange. Maybe a hosting related issue?

    Are you running the last WordPress version? The core should never (ever) be modified. Always use plugins or theme to alter the behaviour.

    I have the same problem here and I fixed it by removing the dependency in wp_enqueue_script.

    The original code is wp_enqueue_script('thumbs_rating_scripts', thumbs_rating_url . '/js/general.js', array('jquery'), '4.0.1'); which require jQuery to be loaded. However my theme has the jQuery deregistered and replaced with a CDN one (Google API). So as there’s no registered script called jquery here, the dependency failed to meet, then WP will not load this script.

    I had it changed to wp_enqueue_script('thumbs_rating_scripts', thumbs_rating_url . '/js/general.js', array(), '4.0.1'); and it’s working now.

    Plugin Author Ricard Torres

    (@quicoto)

    Thanks fkj for posting this.

    I’m not sure how to improve the code so it can detect how jQuery is implemented.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘ReferenceError: thumbs_rating_ajax is not defined’ is closed to new replies.