Title: wp-stats.php error: invalid argument
Last modified: August 18, 2016

---

# wp-stats.php error: invalid argument

 *  [poons15](https://wordpress.org/support/users/poons15/)
 * (@poons15)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/wp-statsphp-error-invalid-argument/)
 * I am using the wp-stats.php hack found on the wiki but am getting this error
   `
   Â» 10 Recent Posts Warning: Invalid argument supplied for foreach() in /home/
   poons15/public_html/wp/wp-stats.php on line 72 Â» 10 Recent Comments Warning:
   Invalid argument supplied for foreach() in /home/poons15/public_html/wp/wp-stats.
   php on line 86 Â» 10 Most Commented Posts Warning: Invalid argument supplied 
   for foreach() in /home/poons15/public_html/wp/wp-stats.php on line 101  Can somebody
   deciper this for me? Why isn’t this working? I am using wordpress 1.3 alpha. 
   Thanks!

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

 *  [Conor](https://wordpress.org/support/users/conor/)
 * (@conor)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/wp-statsphp-error-invalid-argument/#post-78062)
 * I cant find hte hack , if you directed me to it , I would be happy to help.
 *  Thread Starter [poons15](https://wordpress.org/support/users/poons15/)
 * (@poons15)
 * [21 years, 9 months ago](https://wordpress.org/support/topic/wp-statsphp-error-invalid-argument/#post-78848)
 * Hello Conor –
    Her’es the link on the wiki where I got the code. [http://wiki.wordpress.org/Plugin?PHPSESSID=0d0741377a786e469b3bb35af95dac77](http://wiki.wordpress.org/Plugin?PHPSESSID=0d0741377a786e469b3bb35af95dac77)
   its called wp-stats.php – Updated wp-stats.php for WordPress 1.2 If you are able
   to help — Thank you in advance. Poonam
 *  [Lee Penney](https://wordpress.org/support/users/longplay/)
 * (@longplay)
 * [21 years, 6 months ago](https://wordpress.org/support/topic/wp-statsphp-error-invalid-argument/#post-78885)
 * This is caused by reference to $now which doesn’t exist in 1.3
    To stop it, just
   go to the relevant lines as listed in the error, then remove the text that says
   AND post_date_gmt <= $now make sure you get the AND before the text, and leave
   any after it alone. hth

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

The topic ‘wp-stats.php error: invalid argument’ is closed to new replies.

 * 3 replies
 * 3 participants
 * Last reply from: [Lee Penney](https://wordpress.org/support/users/longplay/)
 * Last activity: [21 years, 6 months ago](https://wordpress.org/support/topic/wp-statsphp-error-invalid-argument/#post-78885)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
