Post Pay Counter

The best way to pay authors on WordPress

  • Features
    • PRO version
  • Cart
    • Addons
  • Documentation
  • Support

Display stats details in public pages with Post Pay Counter PRO shortcode

July 16, 2014 by Stefano 39 Comments

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.

Shortcode usage

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.

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 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].

Author Payment History Shortcode

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.

PayPal email settings frontend

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 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’].
  • Was this Helpful ?
  • Yes   No

Filed Under: Tutorials Tagged With: post pay counter pro, shortcode

Comments

  1. Ivan K says

    January 5, 2015 at 6:15 pm

    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

    Reply
    • TheCrowned says

      January 5, 2015 at 6:56 pm

      If you write down what you’d like to exclude I’ll write the shortcode for you ๐Ÿ™‚

      Have a nice day,
      Stefano

      Reply
  2. Kushal Azza says

    April 19, 2015 at 5:52 am

    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.

    Reply
    • TheCrowned says

      April 19, 2015 at 12:03 pm

      Hi Kushal,
      that’s currently not possible but a nice idea indeed! Will try to implement this as soon as I have time, thanks ๐Ÿ™‚

      Reply
  3. Nitin says

    May 23, 2015 at 2:45 pm

    I want to remove the Bonus Column and Words, can you please help me with the shortcode.

    Reply
    • TheCrowned says

      May 23, 2015 at 7:52 pm

      Hi Nitin,
      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!

      Reply
      • Nitin says

        July 13, 2015 at 12:28 pm

        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.

        Reply
        • TheCrowned says

          July 13, 2015 at 4:29 pm

          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"]

          Reply
          • Nitin says

            July 14, 2015 at 7:25 am

            Thanks,
            [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.

          • TheCrowned says

            July 14, 2015 at 10:47 am

            Sorry, my mistake, use this:

            [ppc exclude="author_words, author_bonus"]

  4. Jeremy says

    September 29, 2016 at 9:02 am

    Can you allow only the user that is logged in to see their own stats?

    Reply
    • Stefano says

      September 29, 2016 at 9:39 am

      Using [ppc author="current"] should work ๐Ÿ™‚

      Reply
  5. Yose Mirza says

    March 1, 2017 at 6:10 pm

    Hi Stefano,

    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

    Thanks

    Reply
    • Stefano says

      March 1, 2017 at 10:00 pm

      Hi Yose,
      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,
      Stefano

      Reply
  6. Yose Mirza says

    March 2, 2017 at 4:36 pm

    Hello Stefano,

    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

    Yose

    Reply
    • Stefano says

      March 2, 2017 at 8:32 pm

      Hi Yose,
      I see what I mean. I’ll make sure to get that done as well for the next release ๐Ÿ™‚

      Have a nice day,
      Stefano

      Reply
  7. Ondrej says

    March 22, 2017 at 11:21 pm

    Hello,

    its possible to sort the table? The best autor on the top by the final revenue? Thank you.

    Reply
    • Stefano says

      March 22, 2017 at 11:29 pm

      Hi Ondrej,
      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,
      Stefano

      Reply
      • Ondrej says

        March 24, 2017 at 5:52 am

        Hey Stefano,

        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.

        Reply
  8. Snehil says

    January 13, 2018 at 4:14 pm

    Adding one point here, use keyword “post_facebook_shares” to exclude facebook shares in detailed stats.

    Reply
    • Stefano says

      January 13, 2018 at 4:52 pm

      Absolutely! Thanks – I have updated the tutorial the Facebook columns that as well ๐Ÿ™‚

      Reply
  9. Mike Hemberger says

    December 3, 2018 at 10:50 pm

    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?

    Reply
    • Stefano says

      December 4, 2018 at 10:35 pm

      Hi Mike,
      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 ๐Ÿ™‚

      Reply
  10. Abdul Sattar says

    October 7, 2019 at 1:31 pm

    what stats this code will show? [ppc author="current"]

    how to show current balance and paid amount?

    Reply
    • Stefano says

      October 7, 2019 at 2:25 pm

      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! ๐Ÿ™‚

      Reply
  11. Adama says

    October 22, 2019 at 1:33 am

    Hi,

    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

    Regards,

    Reply
    • Stefano says

      October 25, 2019 at 3:56 pm

      Hi Adama,
      I am sorry, we do not offer neither of these functionalities as of now ๐Ÿ™‚

      Have a nice day,
      Stefano

      Reply
  12. Adama says

    October 28, 2019 at 12:23 am

    Hi,

    sorry the question was about [ppc_referral_visits_details…

    does it accept exclude params ?

    Thanks

    Reply
    • Stefano says

      October 28, 2019 at 10:30 am

      No, it does not allow to exclude anything. What were you seeking to exclude?

      Reply
      • adama says

        October 30, 2019 at 10:41 pm

        Post ID, and I rather to include post_total_payment, post_due_payment like on ppc

        Reply
        • Stefano says

          November 1, 2019 at 9:22 pm

          Right – No I’m sorry, that feature is not available unfortunately! ๐Ÿ™‚

          Reply
  13. Parrish says

    August 26, 2021 at 10:18 pm

    Is there a way to hide “Total for Basic” with the shortcode. I added all the excludes and didn’t seem to hide it

    Reply
    • Stefano says

      August 27, 2021 at 7:10 am

      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?

      Reply
  14. Parrish says

    August 27, 2021 at 4:56 am

    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

    Reply
    • Stefano says

      August 27, 2021 at 7:32 am

      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 ๐Ÿ™‚

      Reply
  15. mahmoud says

    October 9, 2022 at 11:46 pm

    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

    Reply
    • Stefano says

      October 10, 2022 at 5:10 pm

      No, I don’t think it does.

      Reply
  16. Gideon Lorry says

    February 12, 2023 at 11:08 pm

    Can i display only the overral stats without the detailled posts?

    Reply
    • Stefano says

      February 13, 2023 at 7:24 am

      No, we currently don’t have a shortcode only for overall stats unfortunately.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Your cart

Number of items in cart: 0

  • Your cart is empty.
  • Total: €0.00
  • Checkout

What are you looking for?

Copyright © 2023 ยท Centric Theme on Genesis Framework ยท WordPress ยท Log in

This site uses cookies, as all sites on the planet do -- More info