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 |
explicit |
1 when the user actually chose the star value (touched the star strip) |
Server-side, mam_reviews_ajax_handler::handle_swipe_listing():
- Authenticate the user.
- A bare gesture (
like/dislike/skipwithoutexplicit=1) is a soft signal: nothing is persisted natively — the consumer hook fires and consumer plugins score it themselves (a like is typically treated as a soft 5, a dislike as a soft 1) in their own storage, where a later real review replaces it. The apps send the star strip’s default value with every gesture, so a bare swipe’sratingis never trusted. - Only an
explicit=1like with a star value resolves the owning provider and callssave_review()with anoverallrating and empty text — landing in the same native store as a full review and counting toward native averages. - Native persists enforce one swipe rating per user per listing (it checks
get_user_review()first and won’t stack duplicates). mam_reviews_swipe_submittedfires for every gesture so other plugins can augment with their own storage.
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, a site plugin can use it to store each user’s 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.
Swipe direction (iOS 26.40.14+)
On iOS 26.40.14 and later, a swipe where the finger moves right records a like, and a swipe where the finger moves left records a dislike. The Rate button’s card leaves to the right, the same way as a like. iOS builds before 26.40.14 had the two swipe directions reversed. Android support for this change is pending.
Swipe hint labels (iOS 26.40.14+)
Two optional string keys on the swipe_to_review home-screen item add a hint row under the card:
| Key | Type | Example | Shown as |
|---|---|---|---|
swipe_left_label |
string | "Not for me" |
← Not for me |
swipe_right_label |
string | "Love it" |
Love it → |
{
"type": "swipe_to_review",
"swipe_left_label": "Not for me",
"swipe_right_label": "Love it"
}
- Set one or both. With neither, no hint row is shown and the deck looks as before.
- The hint row is hidden when the deck is empty.
- Android support pending.
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 |
