Home › Forums › Front End PM PRO › Question /wp-json/front-end-pm/v1/notification
- This topic has 3 replies, 2 voices, and was last updated 6 years, 4 months ago by Shamim Hasan.
- AuthorPosts
- July 21, 2019 at 6:01 am #27135ssdParticipant
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/notificationAnd 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?
July 21, 2019 at 5:58 pm #27140Shamim HasanKeymasterPlease 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.
July 22, 2019 at 10:08 am #27145ssdParticipantthank 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.
July 22, 2019 at 2:23 pm #27148Shamim HasanKeymasterThere 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
- AuthorPosts
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.