Tracking user activity in WordPress is essential for security, debugging, and content management. Simple History makes this easy by logging key events, and with the power of the WordPress REST API, you can integrate these logs into almost any workflow.
In this guide, we’ll explore how to fetch Simple History logs and display them in (almost) real-time using SwiftBar, a macOS tool that adds dynamic data to your menu bar. This setup allows you to monitor WordPress changes without needing to log in – perfect for developers and admins who want quick insights at a glance.

Why Use SwiftBar with Simple History?
By combining SwiftBar with Simple History’s REST API, you can:
- ✅ Monitor site activity almost in real-time (updates every minute)
- ✅ Get instant insights into login attempts, plugin updates, and content changes
- ✅ Enhance security by keeping an eye on suspicious activity
- ✅ Save time by accessing logs without opening WordPress
This approach showcases the flexibility of the Simple History API, demonstrating how audit logs can be integrated into different environments beyond the WordPress dashboard.
Prerequisites
Before getting started, ensure you have the following:
- A WordPress site with Simple History installed
- Administrator access to create an application password
- A macOS device with SwiftBar installed
- jq, a lightweight command-line tool for parsing JSON
Installing jq
If you don’t have jq
installed, you can check with:
jq --version
If it’s missing, install it via Homebrew:
brew install jq
Step 1: Generate an Application Password in WordPress
To access Simple History logs via the REST API, you need an application password for authentication.
📌 Important: This step must be done on the WordPress website where you want to fetch the history from.
- Log in to WordPress and navigate to Users > Your Profile.
- Scroll down to Application Passwords.
- Enter a descriptive name (e.g., “SwiftBar Integration”) and click Generate Password.
- Copy the generated password—this will be used in your script.
Step 2: Create the SwiftBar Plugin
SwiftBar plugins are simple scripts that output text to the macOS menu bar. We’ll create a Bash script that fetches the latest Simple History events and displays them in the SwiftBar dropdown menu.
Create a new script file
Save the following code as simple-history.1m.sh
in your SwiftBar plugins folder:
#!/usr/bin/env bash
# <xbar.title>WordPress website history events</xbar.title>
# <xbar.desc>Displays recent events from a WordPress website.</xbar.desc>
# <swiftbar.hideSwiftBar>true</swiftbar.hideSwiftBar>
# <xbar.dependencies>jq,curl</xbar.dependencies>
WP_USER="your-username"
WP_APPLICATION_PASSWORD="your-application-password"
WP_WEBSITE="https://yourwebsite.com"
WP_API_ENDPOINT="/wp-json/simple-history/v1/events"
# Paths to curl and jq
CURL_BIN="/usr/bin/curl"
JQ_BIN="/opt/homebrew/bin/jq"
# Number of events to fetch
PER_PAGE=5
# Truncate long messages
TRUNCATE_LENGTH=70
echo "🔔 Website events"
echo "---"
# Fetch updates from API.
EVENTS=$($CURL_BIN -s -u "$WP_USER:$WP_APPLICATION_PASSWORD" "$WP_WEBSITE$WP_API_ENDPOINT?per_page=$PER_PAGE" | $JQ_BIN -r '.[] | "\(.date_local) - \(.message[0:'"$TRUNCATE_LENGTH"'])..."')
# Output events
echo "$EVENTS" | while read -r line; do
echo "$line | color=darkgreen"
done
# Additional menu options
echo "---"
echo "Refresh | refresh=true"
echo "Open Simple History in WordPress | href=$WP_WEBSITE/wp-admin/admin.php?page=simple_history_admin_menu_page"
Step 3: Make the Script Executable
Before SwiftBar can run the script, it must have the correct permissions. Run the following command in Terminal:
chmod +x ~/Library/Application\ Support/SwiftBar/Plugins/simple-history.1m.sh
Step 4: Load the Plugin in SwiftBar
- Open SwiftBar and go to Preferences > Plugins Folder.
- Move
simple-history.1m.sh
into the Plugins folder. - Click Refresh in SwiftBar.
You should now see Simple History events appear in your macOS menu bar!
Next Steps
Now that you have a working integration, consider customizing it:
- Adjust the polling frequency – By default, SwiftBar updates every minute. If you need more frequent updates, change the script filename to
simple-history.10s.sh
(updates every 10 seconds). - Filter specific event types – Modify the
jq
query to display only login attempts, post updates, or plugin changes.
This workflow demonstrates how flexible and powerful the Simple History REST API is, allowing you to integrate WordPress audit logs into any external tool.
🚀 Try it out and let us know how it improves your workflow!