One of the most appreciated features of Post Pay Counter PRO is the stats shortcode, which provides the ability to display the statistics and payment details on any public page. 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 the 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 the backend to see their earnings and to interact with the plugin.
The stats shortcode
The stats shortcode is [ppc]
. If you use it as it is (i.e. with no parameters), the default stats page will be shown: the general view with the default time range set in Options > Misc settings > Default stats time range
. This is what you would see if you just went to Post Pay Counter > Stats
in the WP backend.
To get author stats, you can use the parameter author
, feeding it with the relevant user ID. 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 from the default one. For this, the relevant parameters are tstart
and tend
and accept a UNIX timestamp. An example would be [ppc author=1 tstart=1388534400 tend=1388538800]
. 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 output, as public themes are often less wide than the wp-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 table.
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
.
Valid column names for author 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
.
More options
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 payment criteria, 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"
– To show stats from the previous month.
time_range="last_week"
– To show stats from the previous week.
time_range="current_month"
– To show 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 resource.
Other shortcodes
- 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 parameterauthor_id
. Furthermore, there is a shortcode to display the referral link box, which is[ppc_referral_link]
. It accepts some self-explanatory parameters, the prototype being[ppc_referral_link author_id = 1, background_color = '#b30000', text_color = 'white']
.