Support » Plugin: Rate My Post - Star Rating Plugin by FeedbackWP » admin-ajax called on each page load

  • Resolved longnha

    (@longnha)


    Hi,

    While checking I notice that admin-ajax.php is called on every pageload, even on archive page where no rating is showed.

    Is that normal behavior? This could bring unnecessary high server load if the site get decent traffic!

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Blaz K.

    (@blazk)

    Hi @longnha,

    that shouldn’t be the case. Ajax is used only if the rating widget is present on the page. Otherwise the script is not enqueued. Nevertheless, I’m releasing version 2.10 today or tomorrow which uses ajax only if it’s enabled in the settings (for compatibility with a few caching plugins).

    Regards,
    Blaz

    Thread Starter longnha

    (@longnha)

    Hi,

    It’s concerned because Ajax is loaded where it should not! I used shortcode and call it on single post only, but Ajax is load on every page so I guess something is not right!

    Thanks.

    Plugin Support Blaz K.

    (@blazk)

    Hi @longnha,

    version 2.10.0 was released which no longer uses ajax on page load. Previous versions used ajax on page load if the widget was present on the page for compatibility with caching plugins. Now this is handled differently. If ajax was fired on every page load (also where there was no widget) it might be because your were combining JS?

    Regards,
    Blaz

    Thread Starter longnha

    (@longnha)

    Thank you for the update. The new version no longer uses ajax.

    Another question, can I dequeue all scripts/css and only enqueue it when there is shortcode available? It’s prevent the scripts unnecessary load site-wide.

    Thank you.

    Plugin Support Blaz K.

    (@blazk)

    @longnha,

    I double checked this and the plugin loads JS and CSS only where it’s required. So if you are using shortcode the plugin’s CSS and JS should be present only where the shortcode is present. Exception is if you are also using the top rated posts widget or displaying stars on archive pages. Then obviously the CSS is required on these pages as well.

    If that is not the case on your website, the problem must be somewhere else. Please share the link to the website and I’ll have a look.

    Regards,
    Blaz

    • This reply was modified 4 years, 4 months ago by Blaz K..
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘admin-ajax called on each page load’ is closed to new replies.