One of the most appreciated features of Post Pay Counter PRO is the shortcode, which provides the ability to display the statistics and payment details in public pages. The stats table will use your theme’s style and will be thus seamlessly integrated with the look of your site.
If you are using BuddyPress on your site, be aware that it is also possible to integrate Post Pay Counter with BuddyPress Members page with our BuddyPress addon.
This allows your users to see stats without having to access the admin section. This is useful when users are not supposed to ever access wp-admin, neither for writing posts nor for any other matter. In this way, they will not need to access wp-admin to see their earnings and to interact with the plugin.
The shortcode is [ppc]. If you use it as it is, with no parameters, the default stats page will be shown: general stats with a time range which is the default one set in Options > Misc settings > Default stats time range. This is what you would see if you just went to the wp-admin Stats page.
To get detailed stats (specific for an author), you can use the parameter author, feeding it with the user ID of which stats should be shown. For example, [ppc author=1] will show detailed stats for user ID 1. You can also use [ppc author="current"] to make the user selection dynamic: in this case, the stats for the user who opens the page will be shown.
You may want to set a time range different than the default one. For this, the parameters are tstart and tend, and accept a UNIX timestamp. An example would be [ppc author=1 tstart=1388534400 tend=1388538800]. These two, of course, can be used together with the author parameter or not, it is completely up to your needs. The parameter display_timerange can be used to hide the time range, and accepts a boolean-integered value, meaning either 1 or 0 (eg: [ppc author=1 display_timerange=0])
(Advanced: Also notice that (since PRO version 1.8.6) the arguments tstart and tend have super-flexible handling. In fact, if given an integer, it will be interpreted as a UNIX timestamp, but you can also pass it a valid PHP DateTime Format as a string, and it will be passed through strtotime and dynamically converted into timestamps. For example, [ppc tstart="first day of last month +48 hours"] will result in posts published starting from the third day of last month.)
Finally, you may want to exclude some cols from displaying, as public themes are often less wide than the admin template. For this, it is enough to list them in the parameter exclude; you can separate them with a comma. [ppc author=1 exclude="post_id, post_publication_date"] will show stats for user ID 1 excluding post id and publication date from the display table. You can mix them however you prefer.
Valid column names for general stats are: author_id, author_name, author_words, author_visits, author_images, author_comments, author_adsense_revenues, author_written_posts, author_bonus, author_facebook_shares, author_facebook_comments, author_total_payment, author_due_payment;
while for detailed stats are: post_id, post_title, post_type, post_status, post_publication_date, post_words, post_visits, post_adsense_revenues, post_images, post_comments, post_bonus, post_facebook_shares, post_facebook_comments, post_total_payment, post_due_payment.
There are a couple more parameters that can be set in the shortcode to achieve more personalized views:
- display_overall=1 – To display overall stats at the bottom of the stats table (this will display total counts and payments per counting type, number of written posts and total due payment).
- display_timerange=0 – To hide the current time range information.
- display_timerange_choices=0 – To hide the choices of different timeranges.
- time_range=”last_month” – Provides a dynamic shortcut to last month stats. Will display stats from the previous month.
time_range=”last_week” – Provides a dynamic shortcut to last week stats. Will display stats from the previous week.
time_range=”current_month” – Provides a dynamic shortcut to current month stats. Will display stats from the current month.
As a side note, bear in mind that marking posts as paid and full payment history features are not available in shortcoded stats, as they are advanced and dynamic features which rely on the admin section.
Payment history shortcode
To display the current author payment history, there is another shortcode, which is [ppc_author_payment_history].
PayPal email address settings shortcode
There is also a shortcode to allow users to enter the PayPal email address they would like to be paid to, which is [ppc_user_paypal_email_settings]. Other ways in which authors can enter their PayPal address are detailed in this tutorial.
- For the Referral Visits addon, there is a shortcode to display referral visits, either for the current user or for a given one. It is [ppc_referral_visits_details], and it accepts the parameter author_id. Furthermore, there is a shortcode to display the referral link box, it is [ppc_referral_link]. It accepts some parameters, the prototype being [ppc_referral_link author_id = 1, background_color = ‘#b30000’, text_color = ‘white’].
Ivan K says
I tried to exclude something from the stats. Everything disappeared except “BONUS” section. All my attempts fell apart. I used all possible shortcodes (see below):
exclude=”author_id, author_name, author_payment_bonus, author_total_payment, author_due_payment, post_id, post_title, post_type, post_status, post_publication_date, post_words_count, post_visits_count, post_images_count, post_comments_count, post_payment_bonus, post_total_payment, post_due_payment, display_timerange, ppc”]
Everything disappeared except the bonus part! Please advice
If you write down what you’d like to exclude I’ll write the shortcode for you 🙂
Have a nice day,
Kushal Azza says
Hi Stefano, I am great fan of your plugin. Thanks for developing such a wonderful Post Pay Count. 🙂
I have a query regarding these shortcode. Do shortcode have ability to display Payment per post on single blog post ?
I want to add payment received for current post by the Author in there meta description box after post.
that’s currently not possible but a nice idea indeed! Will try to implement this as soon as I have time, thanks 🙂
I want to remove the Bonus Column and Words, can you please help me with the shortcode.
you may try this shortcode:
[ppc author=1 exclude="post_words_count, post_payment_bonus"]
Let me know if you need anything else 🙂
Have a nice day!
This will exclude the columns for Author Id=1, what if I want to exclude the Word Count and Bonus Column for all the authors. Is there a way out.
Yes sure, but it depends if you need the genera stats or the author detailed ones.
Try both these ones:
[ppc author="current" exclude="post_words_count, post_payment_bonus"]
[ppc exclude="author_words_count, author_payment_bonus"]
[ppc exclude="author_words_count, author_payment_bonus"] works for excluding words but doesn’t work for bonus.
It will be great if bonus can be excluded as well.
Sorry, my mistake, use this:
[ppc exclude="author_words, author_bonus"]
Can you allow only the user that is logged in to see their own stats?
Using [ppc author="current"] should work 🙂
Yose Mirza says
1. Stats title into “All Time Stats” when set to all time instead of date range? Because it shows from 1970 at the beginning.
2. Is there possible to change the title of Payment history into something like “Payment history for AUTHOR NAME” instead of Payment history for author ID=1
1. Sorry, but can’t understand what you mean. Is it related to the shortcode feature or not? Could you explain it again please? Thanks!
2. Yes – I believe I will just change the default text so that the author name is clear. You will see that in the next release, thanks for the suggestion! 🙂
Have a nice day,
Yose Mirza says
1. I set on Post Pay Counter->options->Miscellenia-> Default stats time range as “All Time” and put this shortcode: [ppc author="current" exclude="post_id, post_type, post_status, post_publication_date, post_total_payment, post_bonus" display_overall=0] on a page called “My Incentive” where a user can see their own stat.
Stats table has this title: 01/01/1970 – 02/03/2017 (Time range). I think it’s better to have “All Time” as title instead of the time range.
Hope you understand what I mean.
2. That would be awesome. Thanks
I see what I mean. I’ll make sure to get that done as well for the next release 🙂
Have a nice day,
its possible to sort the table? The best autor on the top by the final revenue? Thank you.
right now the sorting feature is only available in the wp-admin stats table. I may consider adding the ability to sort the shortcode stats as well through shortcode parameters, but it’s not possible right now, sorry! 🙂
Have a nice day,
i was buy the PRO for this feature mostly :/ .
Need to get easy access to my authors to actuall table, who is the best, but when you have lot of authors its not easy to see the order – who is the first, second, …
Please very much, put this functionality in next update.
Thank you very very much in advice.
Adding one point here, use keyword “post_facebook_shares” to exclude facebook shares in detailed stats.
Absolutely! Thanks – I have updated the tutorial the Facebook columns that as well 🙂
Mike Hemberger says
Hi there, we’re using Post Pay Counter Pro and we need the `[ppc]` shortcode to display ALL posts by the user, but allow us to filter the views by timeframe/range. So we want to see how many views ALL an author’s posts got last month, or this month, or the whole year. Not only posts that they’ve written during that time frame. Is this possible?
unfortunately, that is not possible. The visits data the plugin stores is always and only aggregate/total data, so there’s no way to provide visits for a given time range. The time range only affects the posts that are displayed, basing on their publishing date 🙂
Abdul Sattar says
what stats this code will show? [ppc author="current"]
how to show current balance and paid amount?
It will show the stats of the author the visits the page. Why not try it out and see it for yourself? It does no harm! 🙂
can I show the author_name instead of the author_id in the referral link (eg: https://website.com/post007/?ppc_ref=stefano )
and, it will be great if we can use “mod_rewrite” and having something like https://website.com/post007/stefano
I am sorry, we do not offer neither of these functionalities as of now 🙂
Have a nice day,
sorry the question was about [ppc_referral_visits_details…
does it accept exclude params ?
No, it does not allow to exclude anything. What were you seeking to exclude?
Post ID, and I rather to include post_total_payment, post_due_payment like on ppc
Right – No I’m sorry, that feature is not available unfortunately! 🙂
Is there a way to hide “Total for Basic” with the shortcode. I added all the excludes and didn’t seem to hide it
You can hide overall stats entirely with the flag display_overall=0, but I assume you would like to hide only the line about basic payment while retaining other overall stats; is that so?
Is there a way to edit the short code so that it shows a total with specific user roles? I’d love to be able to embed last months total numbers for all authors to be able to see
There is unfortunately no straightforward way to achieve that. With some tweaking, it should be possible to give multiple user IDs to the author parameter, but you’d still have to generate the list of IDs for each user role yourself (either statically or dynamically). Let me know in case you were interested into this option 🙂
Hi Stefano , is this plugin responsible for making my website accepted in adsense Flexible Revenue Sharing ?
can you check this
https://developers.google.com/adsense/host/review_tech link for technical requirements
No, I don’t think it does.
Gideon Lorry says
Can i display only the overral stats without the detailled posts?
No, we currently don’t have a shortcode only for overall stats unfortunately.