Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Lester Chan

    (@gamerz)

    It loads the result in AJAX. Only the initial load is done in PHP. Feel free to study the code https://github.com/lesterchan/wp-postratings/blob/master/wp-postratings.php#L584

    I know you are the developer for fastest cache. The plugin is not designed with caching in mind because it is old and I have no time to rewrite it. So I am offering it as is.

    I would recommend to tell your users to use PollDaddy’s Rating instead as it is fully JS.

    Thread Starter Emre Vona

    (@emrevona)

    thank you so much.

    but we can make your plugin to be compatible with WP Fastest Cache. You can call a function of WP Fastest cache and the function can delete the cache.

    if ( isset( $GLOBALS[‘wp_fastest_cache’] ) && method_exists( $GLOBALS[‘wp_fastest_cache’], ‘singleDeleteCache’ ) ) {
    $GLOBALS[‘wp_fastest_cache’]->singleDeleteCache(false, $post_id);
    }

    Plugin Author Lester Chan

    (@gamerz)

    Sure, feel free to submit a pull request https://github.com/lesterchan/wp-postratings if needed.

    But I would prefer the action “rate_post” is fired when a post is rated successfully.

    So you can tell your users to do like this

    add_action( 'rate_post', 'clear_fastest_cache', 10, 4 );
    function clear_fastest_cache($post_id, $post_ratings_users, $post_ratings_score, $post_ratings_average) {
        if ( isset( $GLOBALS['wp_fastest_cache'] ) && method_exists( $GLOBALS['wp_fastest_cache'], 'singleDeleteCache' ) ) {
            $GLOBALS['wp_fastest_cache']->singleDeleteCache(false, $post_id);
        }
    }
    Plugin Author Lester Chan

    (@gamerz)

    Thread Starter Emre Vona

    (@emrevona)

    than I need to update my plugin ?? thank you so much.

    add_action( ‘rate_post’, ‘clear_fastest_cache’, 10, 4 );

    Are you sure that this hook work properly?

    Thread Starter Emre Vona

    (@emrevona)

    Sticky topic is so nice ?? I wanna call add this hook into my plugin. do you think that it works properly? I am just worry about the hook works before “rate_post”.

    Thread Starter Emre Vona

    (@emrevona)

    I added into my plugin and it works properly ?? thank you so much.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Getting Result via Ajax’ is closed to new replies.