Hi,
Please follow the instructions on the solution on this post:
https://wordpress.org/support/topic/how-can-this-plugin-log-searches-on-json-rest-api/
Adding “search” in the settings will make it work.
Please let me know if you solved it.
Thanks
Thread Starter
小鱼哥
(@hellobeebee)
I added ‘search’ to make the code work,
but I found that if the result is empty, it will be recorded multiple times. If there is data in the result, it will only be recorded once
e.g.
https://example.com/wp-json/wp/v2/posts?search=cat
‘cat’ have 1 post in JSON,Search statistics occur once, and subsequent requests of the same type will no longer be recorded
https://example.com/wp-json/wp/v2/posts?search=bibibi
‘bibibi’ have no post in JSON,Search statistics will always be recorded
I hope to receive your help
thanks
Thread Starter
小鱼哥
(@hellobeebee)
Oh my god, it turned out that it was because I used caching technology on Restapi, and I have already solved this problem. Thank you for your reply
-
This reply was modified 1 year, 2 months ago by 小鱼哥.
Thank you for the update!
Glad you got it to work!
If you like my plugin, please add a review. That’s what keeps me going on maintaining and enhancing this plugin.
Thank you!
Cornel