Skip to content

Activity Log — Audit Every Pin & Unpin

Turn on Lifecycle → Activity Log → Enable logging and every pin, unpin, and auto-expiry is recorded with a timestamp and the user who triggered it. The Activity Log tab shows the 25 most recent events; the full log is available as a CSV export.

Activity Log tab with Export CSV and Clear All buttons

Every event captures:

  • Timestamp — server time of the action.
  • Actionpin, unpin, or expired (for auto-expiry).
  • User — display name of the actor (or System for cron-driven expiries).
  • User ID, User Login — for CSV export.
  • Activity ID — the pinned post.
  • Componentactivity (sitewide / personal) or groups.
  • Group ID — set for group pins.

Storage is automatic: if the plugin’s database tables exist (the standard install), events go into {prefix}bpsp_activity_logs; older option-based installs use the bpsp_activity_logs option. The Export CSV streams from whichever store is active so it works on every install.

  1. Open Lifecycle.
  2. Tick Enable logging — Record pin / unpin / expiry events for audit.
  3. Click Save Settings.

Without this toggle the Activity Log tab stays empty (it shows an empty-state with a one-click Enable Activity Logging button that links straight back to Lifecycle).

Click Export CSV at the top of the Activity Log tab. The browser downloads bpsp-activity-log-YYYY-MM-DD-HHMMSS.csv containing every recorded event with these columns:

Timestamp, Action, User ID, User Login, Activity ID, Component, Group ID

The export requires manage_options and is nonce-protected (bpsp_export_logs). Restored in v2.3.8 after a regression in 2.3.7.

Click Clear All Logs to wipe the entire log table. A confirm prompt appears first; on confirm the table is truncated and the page returns with the success notice “All activity logs have been cleared.”

This also requires manage_options and the bpsp_clear_logs nonce. Use sparingly — there is no undo.

The log is ready for direct SQL or wp db query:

Terminal window
# Pin volume per day, last 30 days
wp db query "SELECT DATE(timestamp) d, action, COUNT(*) n
FROM wp_bpsp_activity_logs
WHERE timestamp >= NOW() - INTERVAL 30 DAY
GROUP BY d, action ORDER BY d DESC"