|

Kagodora Points Activity Shortcode

Kagodora Points Activity Shortcode

Overview

The 

Please log in to see your points activity.

 shortcode gives members a clear, concise history of their points earnings and spendings that come directly from using the messaging and broadcast features of the Kagodora Engagement Suite. It displays the two most recent point transactions related to reading messages, sending broadcasts, and receiving “helpful” votes on their messages.

This shortcode is designed to sit alongside your existing myCRED wallet (which shows the total balance) and provides context for how that balance has changed through recent messaging activity.

How It Works

The shortcode queries the myCRED log table (wp_mycred_log) for the currently logged‑in user and filters only those transactions where the reference (the action type) begins with kagodora_. These references are automatically recorded by the Kagodora Engagement Suite’s myCRED hooks:

  • kagodora_read_message – awarded when a user marks a message as read.
  • kagodora_broadcast_cost – deducted when a user sends a broadcast (if a points cost is set).
  • kagodora_helpful – awarded to a message sender when another user clicks “Helpful” on their message.

Each transaction includes the date, the number of points (with a + or  sign), a human‑readable description, and – where possible – a direct link back to the original message or the admin broadcast approval screen.

What It Displays

For each of the last two transactions, the output includes:

  • Points change (e.g., +1 points or -50 points)
  • Date and time (in your WordPress site’s time format)
  • Activity description – for example:
    • “Read a message”
    • “Sent a broadcast”
    • “Your message was marked helpful”
  • Optional link – “View message” or “View approval” that takes the user directly to the relevant inbox item or admin approval page.

If no messaging‑related points activity has occurred yet, the shortcode shows a simple message: “No messaging points activity yet.”

If myCRED is not active, it shows: “Points system is not active.”

Where to Use It

The shortcode is intended to be placed on the user’s account page – the same page where the myCRED wallet is already displayed. This gives members a complete view of their points balance (from the wallet) and the specific actions that have affected it (from the activity list).

Example placement:

htmlCopyDownloadRun

   <!-- shows total points -->

Please log in to see your points activity.

<!-- shows recent messaging activity -->

You can also place it on any other page where you want to show a user their recent points activity, such as a custom dashboard or a “My Activity” page.

Customisation

The shortcode is hard‑coded to show two entries (the default). To show more or fewer, edit the plugin file and change the LIMIT 2 in the SQL query to any positive number. For example, to show the last 5 entries:

phpCopyDownload

LIMIT 5

All other output (date format, link text) can be customised by editing the kagodora_eng_points_activity_shortcode() function inside the plugin.

Benefits for Users

  • Transparency – Members see exactly why they gained or lost points from messaging actions.
  • Engagement – Seeing recent activity encourages users to read messages, send helpful feedback, and participate in broadcasts.
  • Convenience – Links directly to the message or approval screen save users from searching.
  • Integration – Works seamlessly with the existing myCRED wallet, no extra configuration needed.

Technical Notes

  • The shortcode is only available on the front‑end and only for logged‑in users.
  • It requires the myCRED plugin to be active and the Kagodora Engagement Suite’s myCRED hooks to be enabled.
  • Links assume the inbox page slug is /inbox/. If your inbox page has a different slug (e.g., /nbox/), update the home_url('/inbox/') sections in the plugin file accordingly.
  • The shortcode does not run during AJAX requests or in the admin area, so it never interferes with post saving or other admin‑side functionality.

Example Output (HTML)

<div class="kagodora-points-activity">
  <h4>Recent Messaging Activity</h4>
  <ul>
    <li>
      <strong>+1 points</strong><br>
      <small>May 15, 2026 10:23 am</small><br>
      Read a message – <a href="/inbox/?msg_id=42">View message</a>
    </li>
    <li>
      <strong>-50 points</strong><br>
      <small>May 14, 2026 3:15 pm</small><br>
      Sent a broadcast – <a href="/wp-admin/admin.php?page=kagodora-engage-broadcasts">View approval</a>
    </li>
  </ul>
</div>

Summary

The 

Please log in to see your points activity.

 shortcode is a lightweight, informative addition that bridges the gap between the myCRED wallet and the specific actions users take within the Kagodora messaging system. It builds trust, encourages participation, and provides a seamless user experience on the account page.

Similar Posts

Leave a Reply

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