Arewa Recently Viewed Content
Arewa Recently Viewed Content is a lightweight and professional WordPress plugin that tracks and displays recently viewed content for both logged-in and guest users. All data is stored on your server; no external tracking or third-party services are used.
When users are logged in, viewing history is saved to their user account. When they are not logged in, the plugin uses cookies to store history locally. After login, cookie-based history is automatically merged into the user account so nothing is lost. The plugin is designed to work correctly in WebView and mobile app contexts, supports multiple content types and layouts, and is optimized for performance and user experience.
Key Highlights:
- Dual Tracking System: Tracks viewing history for both logged-in users (via user meta) and guest users (via cookies)
- Automatic Sync: Merges guest history into user account upon login
- Privacy-Friendly: No external tracking services or third-party dependencies
- Multiple Layouts: Choose from Video, Article, Shop, and Carousel layouts
- WooCommerce Compatible: Dedicated shop layout for product tracking
- Mobile & WebView Ready: Works seamlessly in mobile apps and WebView environments
- Performance Optimized: Efficient database queries and caching mechanisms
- Fully Responsive: All layouts adapt beautifully to any screen size
The plugin is ideal for news sites, blogs, online stores, video platforms, and any WordPress site that wants to improve user engagement by showing personalized recently viewed content.
Features
-
Recently Viewed Tracking
- Automatic tracking of posts, pages, products, and custom post types
- Configurable maximum items (default: 100 for logged-in users, 50 for guests)
- Timestamp-based ordering (most recent first)
- Duplicate prevention with automatic repositioning
-
User Management
- Logged-in users: History stored in user meta
- Guest users: History stored in cookies (30-day expiration)
- Automatic merge on login
- Per-user history management
-
Layout Options
- Video Layout: Media-focused grid with overlay text
- Article Layout: Magazine-style responsive grid
- Shop Layout: WooCommerce product grid or carousel
- Carousel Layout: Horizontal scrolling with navigation
-
Customization
- Shortcode-based rendering with multiple parameters
- Configurable items per page
- Show/hide images and dates
- Pagination support
- Post type filtering
- Category and taxonomy filtering
-
Privacy & Security
- No external tracking services
- GDPR-friendly cookie usage
- Secure nonce verification
- Data sanitization and validation
- Optional data removal on uninstall
-
Performance
- Optimized database queries
- Efficient post retrieval
- No impact on page load times
- Clean code following WordPress standards
-
Compatibility
- Works with any WordPress theme
- WooCommerce integration
- Mobile app and WebView support
- Multisite compatible
- Translation ready
How It Works
For Logged-In Users:
When a logged-in user views a post, page, or product, the plugin automatically saves the post ID, post type, and timestamp to the user’s meta data. The history is stored in the database under the meta key arewa_recently_viewed and persists across sessions and devices.
For Guest Users:
When a guest (non-logged-in) user views content, the plugin stores the viewing history in a browser cookie named arewa_recently_viewed. The cookie expires after 30 days and is accessible across the same browser sessions.
Automatic Sync on Login:
When a guest user logs in, the plugin automatically: 1. Reads the guest history from the cookie 2. Merges it with any existing user history 3. Removes duplicates (keeping the most recent timestamp) 4. Saves the merged history to user meta 5. Clears the guest cookie
This ensures a seamless experience where users never lose their browsing history when they log in.
Revisiting Content:
When a user revisits previously viewed content, the plugin: 1. Updates the timestamp to the current time 2. Moves the item to the first position in the history 3. Maintains the most-recent-first ordering
Shortcodes
Basic Usage:
[watch_history]
Displays recently viewed content using default settings.
Layout Types:
[watch_history layout_type="video"]
Displays content in video/media layout with overlay text.
[watch_history layout_type="article"]
Displays content in magazine-style article layout.
[watch_history layout_type="shop"]
Displays WooCommerce products in shop layout.
[watch_history layout_type="carousel"]
Displays content in horizontal scrolling carousel.
Display Options:
[watch_history limit="10"]
Limits the number of items displayed.
[watch_history show_image="yes" show_date="yes"]
Controls visibility of images and dates.
[watch_history pagination="yes"]
Enables pagination for large histories.
[watch_history show_clear_all_history="no"]
Hides the «Clear All History» button. Default is «yes» (button visible).
Filtering:
[watch_history post_type="post"]
Shows only blog posts.
[watch_history post_type="product"]
Shows only WooCommerce products.
[watch_history category="news,sports"]
Filters by category names or slugs.
[watch_history taxonomy="genre:action,comedy"]
Filters by custom taxonomy terms.
Combined Examples:
[watch_history layout_type="article" limit="6" show_date="yes"]
[watch_history layout_type="shop" post_type="product" limit="8"]
[watch_history layout_type="carousel" limit="12" pagination="no"]
[watch_history layout_type="carousel" post_type="movies" limit="20" pagination="no" show_clear_all_history="no"]<h3>Layout Types</h3>
Video Layout
A grid-based layout optimized for video content and media. Features: * Responsive grid (configurable columns) * Large thumbnail images * Overlay text with title and metadata * Play button icon overlay * Hover effects * Best for: Video sites, media libraries, movie databases
Article Layout
A magazine-style layout perfect for blog posts and articles. Features: * 2-column grid on desktop and tablet * 1-column on mobile devices * Featured images with gradient overlay * Excerpt display * Category badges * «Continue Reading» button * Best for: Blogs, news sites, magazine-style websites
Shop Layout
A WooCommerce-optimized layout for product display. Features: * Product images with sale badges * Price display * «Add to Cart» button * «View Product» link * Stock status indicators * Recently viewed badge * Best for: Online stores, WooCommerce shops
Carousel Layout
A horizontal scrolling layout with navigation controls. Features: * Smooth horizontal scrolling * Previous/Next navigation buttons * Dot indicators * Touch/swipe support * Auto-height adjustment * Responsive breakpoints * Best for: Homepage widgets, sidebar displays, featured content
