Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Profile Visitors for Ultimate Member

WordPress Ultimate Member PHP License Version

A WordPress add-on for Ultimate Member that records who views a member's profile and shows the recent visitors on a Visitors profile tab — or anywhere on the site with the [profile_visitors] shortcode.

This is an open-source fork of the commercial Visitors for Ultimate Member plugin by SuitePlugins (GPL-2.0-or-later). The licensing/update gate has been removed and the plugin has been substantially rewritten — see CHANGELOG.md.


✨ Features

  • 👁️ Logs one visit per visitor per day on every Ultimate Member profile view
  • 📑 Adds a Visitors tab to the profile, visible only to the profile owner
  • 🧩 [profile_visitors] shortcode for showing a visitor list anywhere
  • 🖼️ Avatars pulled through get_avatar(), so Ultimate Member photos, Gravatar, offloaded media (S3/CDN) and avatar plugins all work
  • 🚫 Exclude chosen Ultimate Member roles from visitor lists (admins, moderators, …)
  • 🗓️ Configurable range — today only, or the last N days
  • 🕒 "3 hours ago" timestamps in the site's timezone — English by default, translatable via the plugin's own text domain
  • 🎨 Theme-overridable template and a plain, enqueued stylesheet
  • 🧹 Automatic daily pruning of old rows, plus full cleanup on uninstall
  • 🔐 GDPR-ready: hooks into WordPress' personal-data export and erase tools
  • 🌍 Fully translatable (um-visitors text domain)
  • 🕸️ Multisite aware — one network-wide visit log

📦 Installation

  1. Install and activate Ultimate Member first.
  2. Copy the um-visitors folder into /wp-content/plugins/.
  3. Activate Profile Visitors for Ultimate Member from Plugins.
  4. Configure it under Ultimate Member → Visitors.

🛠️ Usage

Profile tab

Nothing to do — once active, each member sees a Visitors tab on their own profile. Other members never see it, and the tab's content is blocked even if the URL is requested directly.

Shortcode

[profile_visitors]

Three tags are registered, all identical:

[profile_visitors]        the documented tag
[um_profile_visitors]     prefixed, guaranteed collision-free
[um_visitors]             legacy, kept from the original plugin

A tag is only claimed if nothing else has registered it — the check runs on init at priority 20, after other plugins have registered theirs. If another plugin already owns profile_visitors or um_visitors, this plugin leaves it alone rather than silently breaking it, and um_profile_visitors still works.

Attribute Default Description
public false Set to true to show the list to anyone, not just the profile owner
user_id 0 Show visitors for a specific user instead of the profile being viewed
amount setting Override the number of visitors shown
avatar_size setting Override the avatar size, in pixels
[profile_visitors public="true" amount="5" avatar_size="64"]

⚙️ Settings

Ultimate Member → Visitors

Setting Description
Number of visitors on page How many visitors to list
Exclude these roles Ultimate Member roles to hide from visitor lists
Size of avatar Avatar width/height in pixels
Text displayed before visitors list Heading above the list. {days} is replaced with the range
No visitors found Message shown when the list is empty. {days} also works here
Visited Range Days to look back. Blank or 0 means today only

🎨 Customising the template

Copy the template into your theme and edit it there — it survives plugin updates:

wp-content/plugins/um-visitors/templates/visitors-list.php
  →  wp-content/themes/your-theme/um-visitors/visitors-list.php

Available variables: $visitors, $text, $no_found, $avatar_size, $profile_user_id.


🔌 Hooks

Hook Type Purpose
um_visitors_record_visit filter Return false to skip logging a visit
um_visitors_retention_days filter Days to keep visit rows (default 365, 0 disables pruning)
um_visitors_max_rows_scanned filter Cap on rows examined to fill one list (default 500)
um_visitors_avatar_html filter Replace the avatar markup for a visitor
um_visitors_default_no_found_text filter Default "no visitors" message; return '' for a silent empty list
um_visitors_locate_template filter Change which template file is loaded
um_visitors_translation_path filter Change where translations are loaded from

Define UM_VISITORS_KEEP_DATA as true in wp-config.php to keep the visit log when the plugin is deleted.


📋 Requirements

WordPress ≥ 5.6
PHP ≥ 7.4
Ultimate Member ≥ 2.0

⚠️ Notes

  • Visits are only recorded for logged-in users viewing someone else's profile.
  • One visit per visitor per profile per day; the list shows each visitor's most recent visit.
  • Recording a visit writes to the database on a page view, so a full-page cache in front of profile pages will suppress some visits.
  • Excluded roles are filtered in PHP, since the role a member counts as comes from Ultimate Member's own priority logic. The list is read a page at a time until it is full, so exclusions never shorten it. A profile whose recent visitors are nearly all excluded stops after 500 rows (um_visitors_max_rows_scanned).

🚀 Future Improvements

  • Pagination / "load more" for long visitor lists
  • Per-user opt-out of being tracked, and of appearing in lists
  • Visit counts and a simple "who viewed me" summary widget
  • Optional notification when someone views your profile
  • Object-cache the visitor query on busy profiles

🤝 Contributing

Contributions are welcome! Please open an issue first to discuss what you'd like to change, then submit a pull request.


📄 License

Licensed under the GPL-2.0 License, as was the original plugin this fork is based on.

About

WordPress add-on for Ultimate Member that records who views a member's profile and lists recent visitors on a Visitors profile tab or via the [profile_visitors] shortcode. Open-source fork with security, timezone and database fixes.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages