aristath
Supreme Deity
WPMU DEV Staff
Lifetime member
Support Hamster Likes (5)
With MarketPress 2.5 came store statistics and everybody's a bit happier. :)
The last project I build was using Drupal Commerce and I miss the stats it provides... They aren't difficult to achieve, they're just just beautiful!
The Affiliate plugin has some great-looking statistics compared to MarketPress which is a bit odd, considering that the MarketPress plugin is a lot more famous!
Google charts ( https://developers.google.com/chart/ ) has a really easy implementation and it would be a simple matter to add a new dashboard widget with full, beautiful sales reports.
I've created a feature request here, if anyone thinks this is useful I urge you to vote for it!
http://wpmudev.uservoice.com/forums/148158-wpmu-dev-new-development-requests/suggestions/2988917-better-marketpress-statistics-similar-to-the-affi

Responses (57)
Support Hamster (joined March 2012) Likes (0)
And in case anyone thinks I'm being paranoid, these are the stats I had on my previous project. If MarketPress had something half as good as this, it would be a lot better! Just watch the vide (better in fullscreen) http://www.youtube.com/watch?v=L1-9-fgXRJg
Inactive (joined February 2012) Likes (0)
Hey @aristath
Affiliates plugin have better statistics probably because it was made to use with the dev and for Affiliates statistics is like can't-live-without. Am not saying it isn't needed for MarketPress.
Makes total sense to have awesome statistics not just for MarketPress, but for all the other plugins as well.
Did my part :)
Support Hamster (joined March 2012) Likes (0)
Well, since I was saying that it's not difficult to do, I decided to do it myself. :P
First approach is here: https://github.com/nerdzgr/MarketPress-Statistics
You can download it directly from here: https://github.com/nerdzgr/MarketPress-Statistics/zipball/master
This was done just to prove to myself that it can be done. Just install it and a new page will be added to your admin menu. See it and realize the potential we've got here. ;)
And now that I've seen how easy it is (it took about 30-40 minutes), I decided to continue developing this.
So I am asking the community: What would you like to see in your store's stats and how would you like it presented?
Member (joined July 2011) Likes (0)
Cool!
I just installed this on a new demo site so all I have is a blank sales chart which has monthly sales figure (or what would be there) going one year back. Is there the ability to set the date range? My apologies for not testing this in a production site yet.
In terms of features, are the features available which are shown in the example chart of your original post? (Total revenue, total orders, orders in cart)?
Thanks for taking the initiative. That's awesome to see.
Cheers,
Mark
Support Hamster (joined March 2012) Likes (0)
@mark77210 The features shown are not from this plugin, they are what I would like to build eventually.
For less than an hour's work that's all there is to it, but I'm working on it right now.
The hard part is not doing it, but figuring out what we would like to have.
So what would you like to have in your reports Mark?
Member (joined July 2011) Likes (0)
I understood that. Sorry, maybe I wasn't clear enough: I was asking if they were in there - I thought perhaps I couldn't see them because I don't have values for them.
Definitely those items are ones I would like to see plus the pie chart with product sales distribution.
- On a multi-site setup, obviously being able to see sales by subsite would be useful.
- People shipping physical products would probably want to see geographical distribution of sales.
- If refund amount is stored, that would be useful for basic accounting.
- Sales by product category (or even tags) would be very helpful for some store set-ups
But, I mean hey, even if you can get the first stuff done that would be killer. :-)
Rep points coming your way.
Support Hamster (joined March 2012) Likes (0)
@mark77210 thank you, I appreciate it!
So far I've only implemented some basic stats.
I's not much, but it's still better that what MarketPress gives you by default.
(since you last downloaded it 1 hour ago, it went through 9 updates. :P)
I've attached a screenshot of what it looks like now.
The numbers are of course fake 'cause it's a site still under construction and it's just some test orders I 've made.
It would be interesting however to see what this looks like on a real shop, with real stats.. :)
Member (joined July 2011) Likes (0)
Awesome. You're tearing through it :-)
I don't have a real shop in place either (still working on it) so I hope someone else will set up to the plate in give it a go. Even a robust dev site could yield interesting results, and perhaps the WPMU Dev staff have a good simulator running.
Any potential risks for running this on live sites? I wouldn't think so but just checking...
Support Hamster (joined March 2012) Likes (0)
No, no risk at all.
All it does is retrieve the info from the database and display it, nothing more.
I'll add a pie chart and I'm going to bed... :P this is going to be pretty.
Support Hamster (joined March 2012) Likes (0)
Pie chart added, see screenshot.
Support Hamster (joined March 2012) Likes (1)Liked by: 
I added checks (check if MarketPress exists and if user is admin)
I added some more stats
so... here's the new screenshot.
The menu is in Greek but the stats are in English so you 'll get the point. :)
I actually don't know what kind of stats to put in there!
I haven't figured out hot to query for products on the stats yet, and I haven't even thought of changing the date range. It's doable, It's just that my PHP knowledge is kinda limited. So if anyone has any ideas on what stats to display and/or improve it just say so.
You can always download the latest build from here: https://github.com/nerdzgr/MarketPress-Statistics/zipball/master and if you're a PHP guru then help out. This is a nice addition to MarketPress and it needs some loving. :)
Support Hamster (joined March 2012) Likes (0)
Just an update... I combined some stats and I am attaching a screenshot of my results so far. Go ahead download it, test it and send me your feedback. As stated above:
Support Hamster (joined March 2012) Likes (0)
LOTS of progress today...
I managed to add top products per sales, top products revenue, 2 pies and a table . See attached screenshot... It's becoming pretty cool!!!
Member (joined July 2011) Likes (0)
Phenomenal, man. You're still speeding ahead so I won't even bother updating because it will become obsolete in your next post, LOL.
A space or divider between Monthly section and Totals section would be a nice visual helper.
Kudos,
Mark
Support Hamster (joined March 2012) Likes (0)
You're absolutely right!! spacer-divider added.
I'm not going to update it for a couple of days 'cause I have to do some work too... :P so feel free to update.
I have to admit thought that I was expecting more people to be interested in this!! Am I the only one who wants to provide a nice UI & UX to my clients???
Member (joined July 2011) Likes (0)
I'm VERY surprised no one else has commented in this thread. Not even one of the WPMU staff, which is unusual since they always have input or at least some words of encouragement.
I think you should create a new post in the Marketpress plug-in section with a brief summary of what you've done, using the latest screenshot and update. I think that will attract attention. Maybe people are just waiting to see what you've come up with.
Keep up the good work,
Mark
Support Hamster (joined March 2012) Likes (0)
I think you're right... I created an issue here http://premium.wpmudev.org/forums/topic/provide-better-marketpress-statistics so I'll probably continue the discussion there from now on (hopefully with more commenters, it's good having more opinions to help out).
Member (joined June 2012) Likes (0)
Hi Arististics,
Amazed and impressed!
Don't understand anything of the 814 lines you wrote but I'm very practical and the result is functionality. Great!
Is it also possible to show the amount of products you are selling, Now you are counting the orders. And what the average amount of products is per order?
And the top of the top would be when you can import the data from the old wp-ecommerce plugin in the statistics so that my year is again complete.
Looking forward to the next version.
Ella
(posted in the wrong post... still blond)
Member (joined June 2012) Likes (0)
My wishlist, results of:
- coupon code
- returning customers
- top customers
- publish date
- combinations of products per order
- country
- category
- sales by week (I'm counting 13 periods of 4 weeks instead of 12 months)
And a export function with date selection to satisfy my bookkeeper
Ella
Lead Developer (joined May 2009) Likes (0)
Coupon code stats are recorded on the coupon page. Most of those others would be better tracked via the GA ecommerce tracking that's built into the plugin.
Support Hamster (joined March 2012) Likes (0)
@Ella I was replying on the other post here: http://premium.wpmudev.org/forums/topic/provide-better-marketpress-statistics?replies=11#post-247560
I added product counts for orders, average product count per order and I think I managed to add top customers but needs some checking 'cause I don't have enough data on my test store.
Support Hamster (joined March 2012) Likes (0)
If someone can confirm that the top users table works the way it should, then I can add orders by country and/or city.
Member (joined June 2012) Likes (0)
Sorry I replied at the post here.
http://premium.wpmudev.org/forums/topic/provide-better-marketpress-statistics?replies=11#post-247560
In the future I will be a good girl and look or post is closed :)
Support Hamster (joined March 2012) Likes (3)Liked by: 


This plugin is now on wordpress.org so from now on you'll be able to get it there. :)
http://wordpress.org/extend/plugins/marketpress-statistics/
Member (joined June 2012) Likes (0)
Wow, you are becoming famous!
Do I have to call you "Sir" ?
And they didn't give you those 582 points for your live membership...tsss!
I will give you 33,33 % of my points :)
Now, still something in the customer section that I can see the amount of money and the frequency of visits (can you show all the customers?)
Ella
Inactive (joined February 2012) Likes (0)
Hey @aristath
Look look look: http://premium.wpmudev.org/forums/topic/better-marketpress-store-statistics-plugin-by-aristath
Make sure you a leave a reply there, fans might want to share some points ;)
Support Hamster (joined March 2012) Likes (0)
@Ella thank you for your points!!!
This really means a lot to me! :)
Support Hamster (joined March 2012) Likes (0)
@Arun Basil Lal Thank you for the post, I commented there too. ;)
Inactive (joined February 2012) Likes (0)
You are most welcome. I shared it with the team and they loved it as well :)
Member (joined June 2012) Likes (0)
Hi Aristath,
Me again :)
Today when I looked at my statistics I saw suddenly two bars for the month July.
and what are the two lines (products count ,12 months) showing me? I have this month 150 sales and 378 products. The left one shows something like 38.000, that would be great :)
Can you also explain me the dot diagram.. to blond for that..
Look at the screen shots.
Ella
Support Hamster (joined March 2012) Likes (0)
@Ella Looking into it.. :)
Support Hamster (joined March 2012) Likes (0)
@Ella
I just found that there is some kind of a bug in php and there's an issue displaying the dates correctly when calculating months on the last day of a month that has 31 days (that is today... :P ). Anyway, this is an issue that will only appear 1 day every 2 months so I don't consider it a major issue. HOWEVER I'll keep looking for a way to get around this...
On the product sales chart there was an error, it has been fixed. The update should appear in wordpress.org in a few minutes.
As for the dots charts:
They are there just to provide you with an overall impression of which of your products sell the most depending on their price, and from which product price-ranges your revenue is bigger.
For example in your case you sell a lot of products that cost $6.5 and most of your income is from those products.
I'm attaching a screenshot from my test store so that this can be a bit more clear:
In my test case, you'll notice that the dots are more concentrated and higher in value in the lower price ranges. So I know that I sell more products costing less than $400,
But my revenue is bigger from products costing more than 1200!!
I can also see that I haven't sold any of my products costing between 400 and 1200, so I know there's something wrong with those and I have to improve them!
I hope that explains it a bit... It's just to get a general "feel" of what's going on in your store and what the customers preferences are.
Member (joined June 2012) Likes (0)
Hi @Aristath,
Thanks again, downloaded the new version. My sales went drastically down :)
By the way I adore the colors of my cakes...
Ella
Support Hamster (joined March 2012) Likes (0)
@Ella Thank you for reporting the error... I would have missed it without you!
As for the colors yes they are pretty!!! :)
Member (joined February 2012) Likes (0)
Hello @aristath Downloaded and installed your plugin but must have missed something as I'm not seeing any pie charts. Let me know what I did wrong.
Thanks!
Member (joined June 2012) Likes (0)
Hi @Aristath,
After the automatic update from Marketpress statistics, I got this error:
I also could not deactivate the plugin, removed it with ftp and the error was gone.
Ella
Support Hamster (joined March 2012) Likes (0)
@Ella The "update" was a nothing that would justify this error!
I instralled the ultimate facebook plugin too and tried it with that enabled and I still couldn't get the errors you described, everything was working fine!
Could this have been a simple case of mis-downloading the plugin? I don't know... So I would like to ask you if you could re-install it and tell me if you get the error again?
@Dean Kaus well, The pie charts are comparing products. So in case you only have 1 product they won't show any slices. Could this be your case?
Also please note that sometimes google charts can be a bit slow displaying the actual charts... So just give it a minute. I'm currently trying to find a good replacement for google charts (nothing good so far).
Member (joined June 2012) Likes (0)
Hi Aristah,
I have the same error again.
I deleted the old one, then in wordpress I did a search and installed it again.
again the error.
Then deleted again and did it by ftp. Still the error.
This site is the Italian version of Wordpress
Do yo have the old version for me?
Then i can try or that is working...
Ella
Support Hamster (joined March 2012) Likes (0)
Try the attached file... I added an italian .po and .mo files to see if this is possibly the problem.
Support Hamster (joined March 2012) Likes (0)
I forgot I can't attach zip file....
https://docs.google.com/open?id=0B02M3q19p_o8TVNjcXExcGpEZXc and go to
file->download
Support Hamster (joined March 2012) Likes (0)
Here you can see the changes to this file:
http://plugins.trac.wordpress.org/changeset/582150/marketpress-statistics/trunk/marketpress-stats.php
As you can see it's actually NOTHING important.
The only thing that I can think that could possibly be the source of your problem is an added space at the end of the file.
So try this: Open up the marketpress-statistics.php file. If you see a blank line at the end of the file, delete it. Please let me know if that solves it...
Support Hamster (joined March 2012) Likes (0)
@Ella Update to the latest version, bug-free. :)
Member (joined June 2012) Likes (0)
HI @Aristath,
Updated and........ it works!!
Ella.
Support Hamster (joined March 2012) Likes (0)
:) Great!
Member (joined June 2012) Likes (0)
Hi Aristath,
Back again whether you like it or not :)
I told you long ago that the amount of sales and products not corresponding with my statistics.
I saw the same in my product list - option sales. So i suppose it is something in Marketpress what is going wrong.
Ella
Support Hamster (joined March 2012) Likes (0)
@Ella hey there!
Can you send me a screenshot and tell me what your actual sales are?
Member (joined June 2012) Likes (0)
@Aristath
The top 20 real sales from 1 August till now and the top 10 from statistics.
Ella
Support Hamster (joined March 2012) Likes (0)
Those 2 statistics are all-time statistics, not for the past month!
So it's the products that have sold the most since the existence of your store!
Member (joined June 2012) Likes (0)
Ok dear, nice try :)
How is it possible that a product who is sold 9 times can be on the first place in statistics and another who is sold 38 times, is not in the list?
Two examples as screenshot, both all time.
Ella
Support Hamster (joined March 2012) Likes (0)
Oh my... I messed up. :)
Since I don't have your database would you be kind enough to help me resolve this?
Open up marketpress-stats/marketpress-stats.php
line 438 is this:
$custom_query = new WP_Query('post_type=product&post_status=publish&posts_per_page='.intval($num).'&meta_key=mp_sales_count&meta_compare=>&meta_value=0&orderby=meta_value&order=DESC');Change it to this:
$custom_query = new WP_Query('post_type=product&post_status=publish&posts_per_page='.intval($num).'&meta_key=mp_sales_count&meta_compare=>&meta_value=0&orderby=mp_sales_count&order=DESC');Let me know if that works so that I can update everything else as well...
Member (joined June 2012) Likes (0)
Because your are my favorite php guru...I forgive you :)
I don't think that the mistake is in your plugin because when I create a Widget with the top ten sales I get the same results as the statistics.
I shall try your suggestion
Ella
Member (joined June 2012) Likes (0)
Your suggestion gives the same result.
Ella
Member (joined February 2012) Likes (0)
@Ella and @aristath I'm wondering if it takes the dates of the sales into consideration. for example I have a custom accounting software for my portrait business. When I ask for a report of what the hottest selling item is it technically should be wallets. High school seniors purchase a lot of wallets. So even though I sell more wallet photos than all of my other sizes combined. They aren't listed as the best seller because they are really only popular for 2 months out of the year.
So I wonder if that or possibly the price has something to do with it.
Example 1) if the 9 items you sold were in the last month and the product that sold 38 was spread out over several months....
Or the other thought is price point. Is the product that only sold 9 more expensive than the product that sold 38?
Just thinking outside of the code to see how it does the tally.
Support Hamster (joined March 2012) Likes (0)
...Now I'm troubled....
Trying to pinpoint the problem.
line 435:
function mp_st_popular_products_revenue_table( $echo = true, $num = 10 ) {Change $num = 10 to $num = 100
this will put the top 100 products on the table instead of the top 10 (I've been wondering if I should do that by default...).
Then by clicking on the table headers you can sort them by name, revenue or sales.
so their order on the table is not that important, just tell me if the sales numbers you see there are correct!
Member (joined June 2012) Likes (0)
Hi @Aristah,
Changed from 10 to 100.
First view is the order as we start.
Two clicks on "product sales" gives the right amount of sales.
But the pies are still "old"
Ella
Member (joined June 2012) Likes (0)
p.s. I changed the $num to 117. ( the total amount of products)
Now i have a quick overview of the performance of all my products.
Ella
Member (joined June 2012) Likes (0)
Hi @Aristath,
I know, you are very busy with .... everything.
So I came on place number: huge :)
When you have time can you look at this post http://premium.wpmudev.org/forums/topic/widget-product-list-number-of-sales?replies=13#post-288266
I hoped that it would also fix the problem in the statistics.
But no, still the same. Can it be something similar?
Ella
Become a member