What it is
Swipe-to-rate is a Home-screen element that presents unrated listings as a card deck. The current card sits in the center with the next card previewed on each side; the user swipes right to like, left to dislike, or taps Rate/Skip. Each swipe records a rating for that listing and recenters the deck on the next one. When the deck is exhausted, the element shows a “caught up” state.
It’s the fast, low-friction counterpart to the full add-review form: one gesture, one rating, no text.
How it saves
A swipe posts to mam-main’s AJAX dispatcher with subaction mam_swipe_listing and these request params:
| Param | Meaning |
|---|---|
listing_id |
The post being rated (post_id also accepted) |
rating |
1–5 star value |
likeStatus |
like, dislike, or skip |
Server-side, mam_reviews_ajax_handler::handle_swipe_listing() runs the same envelope-then-provider flow as a full review:
- Authenticate the user.
- On
skip(or no target), record nothing — just fire the consumer hook and return. - Otherwise resolve the owning provider and call
save_review()with anoverallrating and empty text — so the swipe rating lands in the same native store as everything else and counts toward native averages. - Enforce one swipe rating per user per listing (it checks
get_user_review()first and won’t stack duplicates). - Fire
mam_reviews_swipe_submittedso other plugins can augment with their own storage.
Because it goes through the provider, a like recorded by a swipe is indistinguishable from a star left in the full form or on the website.
Extending it
The swipe handler is deliberately thin: it persists the star rating and then hands off. To attach app-specific meaning to a swipe (e.g. building a personalized recommendation set, mirroring to a third-party service), hook the action:
add_action( 'mam_reviews_swipe_submitted', function ( array $swipe, ?array $result ) {
// $swipe = [ post_id, user (WP_User), rating, like_status ]
// $result = save_review() result, or null on skip / duplicate
}, 10, 2 );
See Hook: mam_reviews_swipe_submitted for the full contract. (For example, MAM ABI Now uses it to store per-user beer ratings in user meta.)
App notes
- The deck of unrated listings is built client-side from the Home screen’s listing data (the app filters to ratable items that have an image and the user hasn’t rated yet), so the element needs no dedicated server feed.
- iOS and Android present the same 3-card recentering carousel.
Related articles
- Plugin: mam-reviews-manager
- How reviews are stored and read (provider model)
- Hook:
mam_reviews_swipe_submitted
Metadata
| Field | Value |
|---|---|
| Article type | Recipe |
| Plugin slug | mam-reviews-manager |
| Applies to plugin version | 26.23.0+ |
| Category | Building Your App |
| Audience | App builder, PHP developer |
| Last verified | 2026-06-04 |
