Skip to content

Commit 4ab5c6f

Browse files
RivianTrackrclaude
andcommitted
Make reviews guest-only, hide favorites for guests (1.48.0)
WordPress registration is disabled site-wide, so the "Sign up · or · Log in" banner above the review submit button had nowhere productive to send guests. Removed the banner from both the standalone review page and the inline review modal, deleted the associated CSS, and dropped the now-unused register_url from the localized review-data arrays. The member review submission path is unchanged — existing members can still log in via /wp-login.php directly. The favorites heart on tire cards previously redirected guests to the login page (also a dead end now); it is no longer rendered for non-logged-in visitors. The favorites filter chip in the filter bar was already gated server-side and needed no change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a1e0db2 commit 4ab5c6f

13 files changed

Lines changed: 58 additions & 239 deletions

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@ All notable changes to the Rivian Tire Guide plugin will be documented in this f
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
## [1.48.0] - 2026-05-23
8+
9+
### Removed
10+
- **Member sign-up entry point from the review flow.** WordPress
11+
registration is now disabled site-wide, so the "Sign up · or · Log in"
12+
banner that appeared above the submit button for guest reviewers had
13+
nowhere productive to send people. Removed the banner from both the
14+
standalone review page and the inline review modal on the catalog,
15+
deleted the associated CSS, and dropped the now-unused `register_url`
16+
from the localized review-data arrays in `class-rtg-frontend.php` and
17+
`class-rtg-tire-review.php`. Existing members are unaffected: the
18+
member review submission path (`submit_tire_rating`) is unchanged and
19+
`/wp-login.php` is still reachable for those who already have an
20+
account.
21+
22+
### Changed
23+
- **Favorites heart button is hidden for non-logged-in visitors.** The
24+
heart overlay on each tire card previously redirected guests to
25+
`wp-login.php`, which now dead-ends since registration is off. The
26+
button is no longer rendered for guests in `cards.js`; existing
27+
members continue to see it as before. The "Filter to my favorites"
28+
toggle in the filter bar was already gated by `is_user_logged_in()`
29+
server-side and needed no change.
30+
731
## [1.47.1] - 2026-05-22
832

933
### Changed

PLUGIN-REVIEW.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Rivian Tire Guide — Enhancement Roadmap
22

3-
**Plugin:** Rivian Tire Guide v1.47.1
4-
**Updated:** 2026-05-22
3+
**Plugin:** Rivian Tire Guide v1.48.0
4+
**Updated:** 2026-05-23
55
**Scope:** 35 planned enhancements across catalog, user features, admin tooling, and technical/SEO improvements
66

77
> All 41 original review items (security, performance, code quality, UX, testing) were completed as of v1.20.0. This document tracks the **next phase** of development.

frontend/css/rivian-tires.css

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,55 +1806,6 @@
18061806
margin-top: 10px;
18071807
line-height: 1.4;
18081808
}
1809-
.rtg-review-login-banner {
1810-
display: flex;
1811-
align-items: center;
1812-
gap: 10px;
1813-
font-size: 13px;
1814-
color: var(--rtg-text-muted, #8493a5);
1815-
background: color-mix(in srgb, var(--rtg-accent, #fba919) 6%, var(--rtg-bg-secondary, #0d1b2a));
1816-
border: 1px solid color-mix(in srgb, var(--rtg-accent, #fba919) 20%, transparent);
1817-
border-radius: 8px;
1818-
padding: 12px 14px;
1819-
margin: 6px 24px 16px;
1820-
line-height: 1.4;
1821-
}
1822-
.rtg-review-login-banner-icon {
1823-
display: inline-flex;
1824-
align-items: center;
1825-
justify-content: center;
1826-
color: var(--rtg-accent, #fba919);
1827-
flex-shrink: 0;
1828-
}
1829-
.rtg-review-login-banner-content {
1830-
display: flex;
1831-
align-items: center;
1832-
gap: 8px;
1833-
flex-wrap: wrap;
1834-
}
1835-
.rtg-review-login-banner-text {
1836-
margin: 0;
1837-
font-size: 13px;
1838-
}
1839-
.rtg-review-login-banner-actions {
1840-
display: flex;
1841-
align-items: center;
1842-
gap: 6px;
1843-
}
1844-
.rtg-review-login-btn {
1845-
color: var(--rtg-accent, #fba919);
1846-
text-decoration: none;
1847-
font-weight: 600;
1848-
}
1849-
.rtg-review-login-btn:hover {
1850-
text-decoration: underline;
1851-
color: var(--rtg-accent-hover, #4daa80);
1852-
}
1853-
.rtg-review-login-or {
1854-
color: var(--rtg-text-muted, #8493a5);
1855-
font-size: 13px;
1856-
}
1857-
18581809
/* Modal footer */
18591810
.rtg-review-modal-footer {
18601811
display: flex;
@@ -2269,61 +2220,6 @@ a.rtg-review-card-title-link:hover {
22692220
.rtg-reviews-drawer {
22702221
max-width: 100%;
22712222
}
2272-
.rtg-review-login-banner {
2273-
flex-direction: column;
2274-
text-align: center;
2275-
padding: 20px 16px;
2276-
margin: 4px 16px 14px;
2277-
gap: 10px;
2278-
border-radius: 12px;
2279-
}
2280-
.rtg-review-login-banner-icon {
2281-
width: 40px;
2282-
height: 40px;
2283-
border-radius: 50%;
2284-
background: color-mix(in srgb, var(--rtg-accent, #fba919) 12%, transparent);
2285-
}
2286-
.rtg-review-login-banner-icon svg {
2287-
width: 20px;
2288-
height: 20px;
2289-
}
2290-
.rtg-review-login-banner-content {
2291-
flex-direction: column;
2292-
gap: 14px;
2293-
}
2294-
.rtg-review-login-banner-text {
2295-
font-size: 13px;
2296-
line-height: 1.5;
2297-
}
2298-
.rtg-review-login-banner-actions {
2299-
gap: 10px;
2300-
}
2301-
.rtg-review-login-btn {
2302-
display: inline-flex;
2303-
align-items: center;
2304-
justify-content: center;
2305-
padding: 10px 24px;
2306-
border-radius: 20px;
2307-
font-size: 14px;
2308-
font-weight: 600;
2309-
transition: opacity 0.15s ease;
2310-
}
2311-
.rtg-review-login-btn:hover {
2312-
text-decoration: none;
2313-
opacity: 0.85;
2314-
}
2315-
.rtg-review-login-btn-primary {
2316-
background: var(--rtg-accent, #fba919);
2317-
color: #0d1b2a;
2318-
}
2319-
.rtg-review-login-btn-secondary {
2320-
background: transparent;
2321-
border: 1px solid color-mix(in srgb, var(--rtg-accent, #fba919) 50%, transparent);
2322-
color: var(--rtg-accent, #fba919);
2323-
}
2324-
.rtg-review-login-or {
2325-
font-size: 12px;
2326-
}
23272223
}
23282224

23292225
/* === Toast Notifications === */

frontend/css/rivian-tires.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/js/modules/cards.js

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -262,20 +262,23 @@ export function createSingleCard(row) {
262262
compareOverlay.appendChild(compareCheckbox);
263263
compareOverlay.appendChild(compareIcon);
264264

265-
// Favorite button overlay
266-
const favBtn = document.createElement('button');
267-
favBtn.className = 'tire-card-fav-btn';
268-
favBtn.dataset.tireId = tireId;
269-
const isFav = state.userFavorites.has(tireId);
270-
favBtn.classList.toggle('is-favorite', isFav);
271-
favBtn.setAttribute('aria-label', isFav ? 'Remove from favorites' : 'Add to favorites');
272-
favBtn.innerHTML = isFav
273-
? rtgIcon('heart', 16)
274-
: rtgIcon('heart-outline', 16);
275-
favBtn.addEventListener('click', (e) => {
276-
e.stopPropagation();
277-
toggleFavorite(tireId);
278-
});
265+
// Favorite button overlay (logged-in users only)
266+
let favBtn = null;
267+
if (state.isLoggedIn) {
268+
favBtn = document.createElement('button');
269+
favBtn.className = 'tire-card-fav-btn';
270+
favBtn.dataset.tireId = tireId;
271+
const isFav = state.userFavorites.has(tireId);
272+
favBtn.classList.toggle('is-favorite', isFav);
273+
favBtn.setAttribute('aria-label', isFav ? 'Remove from favorites' : 'Add to favorites');
274+
favBtn.innerHTML = isFav
275+
? rtgIcon('heart', 16)
276+
: rtgIcon('heart-outline', 16);
277+
favBtn.addEventListener('click', (e) => {
278+
e.stopPropagation();
279+
toggleFavorite(tireId);
280+
});
281+
}
279282

280283
// Share button overlay
281284
const shareBtn = document.createElement('button');
@@ -323,12 +326,12 @@ export function createSingleCard(row) {
323326

324327
imageContainer.appendChild(img);
325328
imageContainer.appendChild(compareOverlay);
326-
imageContainer.appendChild(favBtn);
329+
if (favBtn) imageContainer.appendChild(favBtn);
327330
imageContainer.appendChild(shareBtn);
328331
card.appendChild(imageContainer);
329332
} else {
330333
card.appendChild(compareOverlay);
331-
card.appendChild(favBtn);
334+
if (favBtn) card.appendChild(favBtn);
332335
card.appendChild(shareBtn);
333336
}
334337

frontend/js/modules/ratings.js

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -576,51 +576,6 @@ export function openReviewModal(tireId, preselectedRating = 0) {
576576
textSection.appendChild(notice);
577577
}
578578

579-
// Guest login/register prompt.
580-
let loginBanner;
581-
if (isGuest && typeof tireRatingAjax !== 'undefined') {
582-
loginBanner = document.createElement('div');
583-
loginBanner.className = 'rtg-review-login-banner';
584-
585-
const bannerIcon = document.createElement('div');
586-
bannerIcon.className = 'rtg-review-login-banner-icon';
587-
bannerIcon.innerHTML = rtgIcon('user', 18);
588-
589-
const bannerContent = document.createElement('div');
590-
bannerContent.className = 'rtg-review-login-banner-content';
591-
592-
const bannerText = document.createElement('p');
593-
bannerText.className = 'rtg-review-login-banner-text';
594-
bannerText.textContent = 'Create an account to edit reviews and favorite tires.';
595-
596-
const bannerActions = document.createElement('div');
597-
bannerActions.className = 'rtg-review-login-banner-actions';
598-
599-
const registerLink = document.createElement('a');
600-
registerLink.href = tireRatingAjax.register_url || '/wp-login.php?action=register';
601-
registerLink.className = 'rtg-review-login-btn rtg-review-login-btn-primary';
602-
registerLink.textContent = 'Sign up';
603-
604-
const orSpan = document.createElement('span');
605-
orSpan.className = 'rtg-review-login-or';
606-
orSpan.textContent = 'or';
607-
608-
const loginLink = document.createElement('a');
609-
loginLink.href = tireRatingAjax.login_url || '/wp-login.php';
610-
loginLink.className = 'rtg-review-login-btn rtg-review-login-btn-secondary';
611-
loginLink.textContent = 'Log in';
612-
613-
bannerActions.appendChild(registerLink);
614-
bannerActions.appendChild(orSpan);
615-
bannerActions.appendChild(loginLink);
616-
617-
bannerContent.appendChild(bannerText);
618-
bannerContent.appendChild(bannerActions);
619-
620-
loginBanner.appendChild(bannerIcon);
621-
loginBanner.appendChild(bannerContent);
622-
}
623-
624579
const footer = document.createElement('div');
625580
footer.className = 'rtg-review-modal-footer';
626581

@@ -673,9 +628,6 @@ export function openReviewModal(tireId, preselectedRating = 0) {
673628
}
674629
modal.appendChild(titleSection);
675630
modal.appendChild(textSection);
676-
if (loginBanner) {
677-
modal.appendChild(loginBanner);
678-
}
679631
modal.appendChild(footer);
680632
overlay.appendChild(modal);
681633
document.body.appendChild(overlay);

frontend/js/rivian-tires.min.js

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/js/tire-review.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@
383383
document.getElementById('rvGuestNameField').style.display = '';
384384
document.getElementById('rvGuestEmailField').style.display = '';
385385
document.getElementById('rvGuestNotice').style.display = '';
386-
document.getElementById('rvLoginBanner').style.display = '';
387386

388387
// Update labels — fields are required for guests.
389388
document.getElementById('rvTitleLabel').textContent = 'Review Title';

frontend/templates/tire-review.php

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -491,45 +491,6 @@
491491
margin-top: 4px;
492492
}
493493

494-
/* Login banner */
495-
.rv-login-banner {
496-
display: flex;
497-
align-items: center;
498-
gap: 10px;
499-
font-size: 13px;
500-
color: var(--rtg-text-muted);
501-
background: color-mix(in srgb, var(--rtg-accent) 6%, rgba(13,27,42,0.8));
502-
border: 1px solid color-mix(in srgb, var(--rtg-accent) 20%, transparent);
503-
border-radius: 8px;
504-
padding: 12px 14px;
505-
margin: 6px 24px 16px;
506-
line-height: 1.4;
507-
}
508-
.rv-login-banner-icon {
509-
color: var(--rtg-accent);
510-
flex-shrink: 0;
511-
font-size: 18px;
512-
}
513-
.rv-login-banner-content {
514-
display: flex;
515-
align-items: center;
516-
gap: 8px;
517-
flex-wrap: wrap;
518-
}
519-
.rv-login-banner-content p { margin: 0; font-size: 13px; }
520-
.rv-login-banner-actions {
521-
display: flex;
522-
align-items: center;
523-
gap: 6px;
524-
}
525-
.rv-login-link {
526-
color: var(--rtg-accent);
527-
text-decoration: none;
528-
font-weight: 600;
529-
}
530-
.rv-login-link:hover { text-decoration: underline; }
531-
.rv-login-or { color: var(--rtg-text-muted); font-size: 13px; }
532-
533494
/* Honeypot */
534495
.rv-hp { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; width: 0; }
535496

@@ -678,7 +639,6 @@
678639
.rv-stars-section { padding: 16px; }
679640
.rv-form-header { padding: 16px; }
680641
.rv-form-footer { padding: 14px 16px; }
681-
.rv-login-banner { margin: 6px 16px 14px; flex-direction: column; align-items: flex-start; }
682642
.rv-toast-container { top: 10px; right: 10px; left: 10px; }
683643
}
684644
</style>
@@ -771,19 +731,6 @@
771731
<div class="rv-guest-notice">Your review will be visible after admin approval.</div>
772732
</div>
773733

774-
<!-- Login banner for guests -->
775-
<div class="rv-login-banner" id="rvLoginBanner" style="display:none">
776-
<div class="rv-login-banner-icon"><i class="fa-solid fa-user" aria-hidden="true"></i></div>
777-
<div class="rv-login-banner-content">
778-
<p>Create an account to edit reviews and favorite tires.</p>
779-
<div class="rv-login-banner-actions">
780-
<a href="<?php echo esc_url( wp_registration_url() ); ?>" class="rv-login-link">Sign up</a>
781-
<span class="rv-login-or">or</span>
782-
<a href="<?php echo esc_url( wp_login_url( home_url( '/' ) ) ); ?>" class="rv-login-link">Log in</a>
783-
</div>
784-
</div>
785-
</div>
786-
787734
<!-- Submit -->
788735
<div class="rv-form-footer">
789736
<div class="rv-error" id="rvError"></div>

includes/class-rtg-frontend.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ private function enqueue_assets( $shortcode_atts = array() ) {
195195
'nonce' => wp_create_nonce( 'tire_rating_nonce' ),
196196
'is_logged_in' => is_user_logged_in(),
197197
'login_url' => wp_login_url( get_permalink() ),
198-
'register_url' => wp_registration_url(),
199198
'timezone' => wp_timezone_string(),
200199
) );
201200
}

0 commit comments

Comments
 (0)