Generally, I track site resource usage using Google Analytics. Recently, I needed to check a clients site stats through AWStats instead. I noticed a number of URLs starting with /wp-json ...

My client uses FTP for a few web tasks and will not see those files in the directory structure. The fact that these record start with wp- is likely to be a source of confusion. While I understand that this is tied to the REST API in /wp-includes, I need to give my client a better explanation because I will be sharing those stats with her.

  • And what do you mean by “better explanation”? URL has nothing to do with files on server - there is no directory like /rss/ and there is no directory like /category/uncaregorized/, so what is the problem with correct explanation - these are the requests to REST API? – Krzysiek Dróżdż Dec 29 '18 at 7:24
  • That is a very good thought! I can provide an explanation that compares the /wp-json* addresses to /category/*. The place where I got stumped is the ambiguity in the pattern of wp-json looking so much like wp-content or wp-config.php. If you can put this in an answer, I will check it. – Nora McDougall-Collins Dec 29 '18 at 17:49

I'm not entirely sure what will be better explanation, or why this one (the real one) is not enough.

In your stats you see URLs of requests and not paths to files. URL has nothing to do with files on server.

Yes - if the requests targets physical file, then that file exists, but... There are plenty URLs that are not connected to any file - mod_rewrite takes care of them. For example there is no directory like /rss/ anywhere in your WP installation directory. There is no directory like /category/uncaregorized/, and yet - both of these URLs work and you can find them in stats...

I don't see anything wrong in explaining, that your client sees HTTP requests and not file paths. And these /wp-json/* requests are requests to WP REST API.

PS. You don't see them in Google Analytics, because there is no tracking code in REST API, so there requests are not logged to GA. But AWStats are more like server logs, so all requests get logged.

  • 1
    I will translate your excellent basic points into words my client can understand. – Nora McDougall-Collins Dec 30 '18 at 1:06

Just delete the data from what you're showing the client. If a person doesn't understand what the API is, showing him data on it will simply confuse the human being. Use Whiteout if you have to.

  • I see it differently. I try to treat my clients as partners. If I don't have a clear, plain English answer, I try to find one. – Nora McDougall-Collins Dec 29 '18 at 4:48
  • Well, it seems like jargon to a non-programmer. Do you break the HTTP requests down into GET and POST requests are show them that too? Do you show them the network latency on each request? – John Dee Dec 29 '18 at 4:52
  • If it comes up! I teach them to code if they want as well. But, in either case, I would like to know how it works that that hierarchy of directories shows up in AWStats. Something inside the REST API coding is triggering it. Or is it somehow a direct viewer request? – Nora McDougall-Collins Dec 29 '18 at 5:13
  • This client was hacked because of a tragic breakin. Now, they want to understand everything, and I'm happy to give them that relief. – Nora McDougall-Collins Dec 29 '18 at 5:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.