Question /wp-json/front-end-pm/v1/notification


Home Forums Front End PM PRO Question /wp-json/front-end-pm/v1/notification

This topic is: Not Resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #27135
    ssd
    Participant

    I used [front-end-pm] in /account, for example: https://www.abc.com/account

    When the user stays at https://www.abc.com/account

    Found that users are constantly accessing:
    https://www.abc.com/wp-json/front-end-pm/v1/notification

    And the interval is 1 minute.

    I understand that it should be a new information notification. I want to know what can be changed, such as 5 minutes, 10 minutes visit?

    #27140
    Shamim Hasan
    Keymaster

    Please add following code in your theme’s (child theme’s if you are using) functions.php

    add_filter( 'fep_filter_ajax_notification_interval', function( $interval ){
        $interval = 5 * MINUTE_IN_SECONDS * 1000;
        return $interval;
    });
    

    You can change 5 to any number. It will call every after that many minutes.

    #27145
    ssd
    Participant

    thank you for your reply,

    I installed your method, modified the theme’s functions.php file, restarted “Front End PM PRO, W3 Total Cache clear cache;

    However, I still have to visit “https://www.abc.com/wp-json/front-end-pm/v1” and browse more than 50 pages in one second (I can use the Wordfence plugin to find traces of browsing).

    I have no choice but to disable it and switch back to the 10.x version, which is normal now.

    But there is a new problem. Some members stay at https://www.abc.com/account before changing the 10.x version. Just like before, visit once every minute: https://www.abc.com/wp- Json/front-end-pm/v1/notification, but I have changed back to version 10.x….

    What should I do, thank you.

    #27148
    Shamim Hasan
    Keymaster

    There are so many performance improved in 11.x version. Before this version if a user open multiple tab this produce multiple requests but in this version no matter how many tabs are open in same browser it will just make 1 request per interval.
    Also previous versions it used admin ajax but now use wp-json which is also a performance improved. It use less resources.

    After adding that code wait couple of hours. Next time user refresh their browser will load that code and reduce call.

    I suggest you use 11.x version. It is better in performance. After changing that code just wait couple of hours to load in users browser. You can change to 10 minutes more if required. This notification call is present in 10.x version also. But it use admin ajax thats why you may not find it. But for ajax call wp-json in better for performance

Viewing 4 posts - 1 through 4 (of 4 total)

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.