• Resolved tabatha.j22

    (@tabathaj22)


    Hello,

    First off, thanks for the great plugin.

    I am having issues with WP-PostRatings By Lester ‘GaMerZ’ Chan. The ratings are not changing after being rated. We tried on different computers and browsers. I only made a few changes to your plugin settings after installing. I wanted to just start enabling and disabling options but worried it might be a strain on our server due to constantly clearing and building the cache after each test.

    Page Caching:
    Enable preload caching (turned on)
    Cache URL queries (turned off)
    Clear full cache when post/page is updated (turned on)
    Clear cache on comment post (turned on)

    Browser caching:
    Not Activated.

    Asset Optimization:
    Not Activated.

    Advanced tools:
    Prefetch DNS Requests (recommended defaults).
    No other changes in this section.

    Is there a setting that I should enable/disable to allow the ratings to be saved?

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • @tabathaj22,

    I’m not sure how WP-PostRatings load the rating stats, but if they are not done via Ajax, then the stats will be cached. If there is no such option in WP-PostRatings, then the only way, unfortunately, is to not cache such pages.

    Best regards,
    Anton

    Thread Starter tabatha.j22

    (@tabathaj22)

    Thanks for the quick reply.

    WP-PostRatings does load using Ajax.

    Then the rating should be updated. Can you provide some steps I can replicate this on a local install?

    Best regards,
    Anton

    Thread Starter tabatha.j22

    (@tabathaj22)

    In my meta data template I enter:
    <?php if(function_exists(‘the_ratings’)) { the_ratings(); } ?>

    This allows the ratings to appear in the meta data section of single pages and the archive pages.

    The rating will update on the single post but not archive page.

    Thanks again.

    Would it be help if I send you a link to one of my pages to see?

    @tabathaj22,

    I’m afraid that the UI data that is generated by the_ratings() is not ajax based. That’s why it is getting cached, even though in the database the rating is updated via an ajax call.

    You can add this to your functions.php file to trigger a cache purge for the specific page, where the rating was updated:

    add_action( 'rate_post', function( $user_id, $post_id ) {
    	do_action( 'wphb_clear_page_cache', $post_id );
    }, 10, 2 );

    Best regards,
    Anton

    Thread Starter tabatha.j22

    (@tabathaj22)

    That worked. Thank you so much. I appreciate you taking the time find a fix. You’re great at what you do.

    Have a great day!

    @tabathaj22,

    Welcome. Glad I could help. I will mark this as resolved.

    Best regards,
    Anton

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WP-PostRatings issue’ is closed to new replies.