Title: stats_get_csv
Last modified: July 27, 2022

---

# stats_get_csv

 *  Resolved [Dmytro](https://wordpress.org/support/users/azzepis/)
 * (@azzepis)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/stats_get_csv/)
 * Hi.
    I’m using stats_get_csv() function to show post views counter in single.
   php, it worked good for a long time. But I can’t see no data last days, statistics
   in WordPress Dashboard is working correctly – I can see views for every single
   post.
 * Here is my code:
 *     ```
       if (function_exists('stats_get_csv')) {
         $args = array('days'=>-1, 'limit'=>-1, 'post_id'=>get_the_ID());
         $views = stats_get_csv('postviews', $args)[0]['views'];
       } else {
           $views='';
       }
       ```
   
 * I asked my hosting provider ([https://wphost.me](https://wphost.me)) about this
   issue – they told me they can’t see anything related with hosting
 * Can you please help me?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fstats_get_csv%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [Mohamed Mehdi Benchalal](https://wordpress.org/support/users/muffinpeace/)
 * (@muffinpeace)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/stats_get_csv/#post-15863891)
 * Hi [@azzepis](https://wordpress.org/support/users/azzepis/)
 * I’ve seen you’ve mentioned using the `stats_get_csv()` function to show post 
   views and that it stopped working; however, I noticed that your Jetpack connection
   is currently broken on your website.
 * Looking further, I’ve found that your [XML-RPC endpoint](https://zelenasadyba.com.ua/xmlrpc.php)
   isn’t reachable or accessible at all. To resolve this, I suggest reaching out
   to your hosting provider and having them ensure that your XML-RPC endpoint is
   accessible and responds to cURL requests, so Jetpack can properly communicate
   with your website.
 * Let us know how this goes.
 *  Thread Starter [Dmytro](https://wordpress.org/support/users/azzepis/)
 * (@azzepis)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/stats_get_csv/#post-15863999)
 * Thank you for your answer.
    XML-RPC endpoint is opened only for jetpack IPs (
   [https://jetpack.com/support/how-to-add-jetpack-ips-allowlist/](https://jetpack.com/support/how-to-add-jetpack-ips-allowlist/))
   Did you check from one of those ips or from any other?
    -  This reply was modified 3 years, 10 months ago by [Dmytro](https://wordpress.org/support/users/azzepis/).
 *  Plugin Support [lastsplash (a11n)](https://wordpress.org/support/users/lastsplash/)
 * (@lastsplash)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/stats_get_csv/#post-15864222)
 * Hi [@azzepis](https://wordpress.org/support/users/azzepis/) –
 * When we test the connection, it originates from one of those IPs. We’re seeing
   the following:
 *     ```
       HTTP/1.1 405 Not Allowed
       Server: nginx
       Date: Wed, 27 Jul 2022 14:32:48 GMT
       Content-Type: text/html; charset=utf-8
       Content-Length: 150
       Connection: close
   
       <html>
       <head><title>405 Not Allowed</title></head>
       <body>
       <center><h1>405 Not Allowed</h1></center>
       <hr><center>nginx</center>
       </body>
       </html>
       ```
   
 * This indicates that something is blocking our requests. You likely will need 
   to make adjustments to how you are allowing Jetpack’s IPs.
 * Once the connection is restored, it should fix the issue with the stats display.
 *  Thread Starter [Dmytro](https://wordpress.org/support/users/azzepis/)
 * (@azzepis)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/stats_get_csv/#post-15864302)
 * Thanks again! I will check twice
 *  [MadHatter (a11n)](https://wordpress.org/support/users/madhattersez/)
 * (@madhattersez)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/stats_get_csv/#post-15865224)
 * That sounds like a plan, Dmytro.
 * No need to reply until you’ve given that a chance, but once you do, please let
   us know the results and we can help from there. Thanks!
 *  Thread Starter [Dmytro](https://wordpress.org/support/users/azzepis/)
 * (@azzepis)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/stats_get_csv/#post-15870394)
 * My hosting removed limits for my sites but they said it’s not related with this
   issue, because you should get 403 error and not 405 if limits are active
 * I found some strange problems, maybe this helps:
    1. I cant see account name 
   connected to Jetpack ([https://i.imgur.com/HOzrOm2.jpg](https://i.imgur.com/HOzrOm2.jpg))
   2. I’m trying to access statistics on WordPress.com using my wordpress.com email/
   pass – but It says – there is no connected site, but I see statistics in wp dashboard
 *  [Mohamed Mehdi Benchalal](https://wordpress.org/support/users/muffinpeace/)
 * (@muffinpeace)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/stats_get_csv/#post-15871523)
 * Hi [@azzepis](https://wordpress.org/support/users/azzepis/)
 * The Jetpack connection is still broken, which are consequences and side effects
   of that.
 * 403 and 403 are very similar in kind, since they represent responses when the
   server itself is forbidden or rejecting the request. I’ve seen that those errors
   have settled now, but you still haven’t connected your WordPress.com account 
   to Jetpack. To do that, head over [to this page](https://zelenasadyba.com.ua/wp-admin/admin.php?page=jetpack#/dashboard).
 * You can then click on “Set up Jetpack” and then approve the connection to your
   WordPress.com account.
 * Let us know how this goes.
 *  Thread Starter [Dmytro](https://wordpress.org/support/users/azzepis/)
 * (@azzepis)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/stats_get_csv/#post-15871849)
 * > The Jetpack connection is still broken
 * I understand that and I’m trying to find why
 * > 403 and 405 are very similar in kind, since they represent responses when the
   > server itself is forbidden or rejecting the request.
 * Yes, but it’s important for me, because hosting denying connection to xmlrpc.
   php using 403 code, and if you are getting 405 – I have to search in some other
   places
 * > I’ve seen that those errors have settled now, but you still haven’t connected
   > your WordPress.com account to Jetpack. To do that, head over to this page.
   > You can then click on “Set up Jetpack” and then approve the connection to your
   > WordPress.com
 * I can’t see that button “Set up Jetpack”, I will check from pc later. Thank you
 * Last question, how to find account username or email connected to my site now(
   I see statistics in wp dashboard , so some account connected, but I logged into
   two accounts on WordPress.com and I can’t see my site there) ?
 *  Thread Starter [Dmytro](https://wordpress.org/support/users/azzepis/)
 * (@azzepis)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/stats_get_csv/#post-15871921)
 * Ok, my issue is resolved now, but I still has no guess why it presented.
    Maybe
   there was an update of Jetpack plugin and something changed in the way it works
   and I had to reconnect website.
 * All configuration on the webhost side was correct and all function on wp dashboard
   and view counts are working properly after I authorized again Jetpack with WordPress.
   com account (even with active webhost limits related with xmlrpc connections).
   
   Also I see stats on wordpress.com site again after Jetpack re-authorization
 * Thank you anyway!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘stats_get_csv’ is closed to new replies.

 * ![](https://ps.w.org/jetpack/assets/icon.svg?rev=2819237)
 * [Jetpack - WP Security, Backup, Speed, & Growth](https://wordpress.org/plugins/jetpack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jetpack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jetpack/)
 * [Active Topics](https://wordpress.org/support/plugin/jetpack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jetpack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jetpack/reviews/)

 * 9 replies
 * 4 participants
 * Last reply from: [Dmytro](https://wordpress.org/support/users/azzepis/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/stats_get_csv/#post-15871921)
 * Status: resolved