TM Product Wishlist
Lightweight WooCommerce product wishlist with shareable lists.
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/jcs-company-work/tm-wishlist/archive/refs/heads/main.zipTM Wishlist Plugin
A modern, multi-list wishlist plugin for WordPress/WooCommerce, supporting both single-list and multi-list user experiences. Built for performance, flexibility, and a seamless user journey.
Features
- Multiple wishlists per user (multi-list support)
- Single-list fallback for simple use cases
- Add/remove products to wishlists from product pages
- Edit wishlist names (with validation)
- Share wishlists via unique links
- Persistent storage using cookies and localStorage
- REST API endpoints for all core actions
- Responsive, accessible UI with smooth animations
User Journey
-
First Visit
- User visits a product page or wishlist page.
- A unique
user_tokenis generated and stored in a cookie.
-
Creating a Wishlist
- On first add, a new wishlist is created via the REST API.
- A unique
share_tokenis generated and stored in both a cookie and localStorage. - The wishlist is now ready for items.
-
Adding Products
- User clicks "Add to wishlist" on a product page.
- The product configuration is saved to the active wishlist in localStorage and synced to the server.
- The UI updates instantly.
-
Managing Wishlists
- User can create, rename, or delete wishlists from the wishlist page.
- Switching between lists is instant (localStorage), with server sync for persistence.
-
Sharing
- Each wishlist has a unique share link (using
share_token). - Anyone with the link can view the shared wishlist.
- Each wishlist has a unique share link (using
-
Persistence
- Wishlists persist across sessions using cookies and localStorage.
- All changes are synced to the server for reliability.
Technical Overview
- Backend: PHP, WordPress REST API, MySQL
- Frontend: Vanilla JS (modular), localStorage, cookies
- Data Structure:
{ "user-xxxx": { "share_token1": [ {...}, {...} ], "share_token2": [ {...} ] } } - API Endpoints:
POST /wp-json/tm-wishlist/v1/lists/new— Create new wishlistPOST /wp-json/tm-wishlist/v1/lists— Save/update wishlistGET /wp-json/tm-wishlist/v1/lists?user_token=...— Get all wishlists for userGET /wp-json/tm-wishlist/v1/lists/{share_token}— Get wishlist by share tokenPUT /wp-json/tm-wishlist/v1/lists/{share_token}— Rename wishlistDELETE /wp-json/tm-wishlist/v1/lists/{share_token}— Delete wishlist
Recent Updates (2026-03-05)
- Multi-list page: Users can create new wishlists, delete existing ones, and switch between multiple lists directly from the wishlist page.
- Automatic data recovery: If localStorage configs are missing, the plugin fetches and restores all user lists from the server for seamless recovery.
- Improved localStorage initialization: New wishlists are always initialized as empty arrays keyed by share token, even when recovering from server.
- Robust active list promotion: When deleting the active list, the next available list is automatically promoted as active in both UI and localStorage/cookie.
- New list creation now uses localStorage flags for cross-page logic after redirect, preventing duplicate DOM insertion.
- Empty message always shown as a
tag when lists are empty.
- Inline comments and developer notes updated for maintainability and clarity.
- Minor bug fixes and code formatting improvements in JS wishlist logic.
Developer Notes
- All tokens are generated server-side for security.
- Use localStorage for instant UI updates; use cookies for server sync.
- The plugin is designed to be extensible and maintainable.
License
MIT