feat: completely remove credits and promocodes across tool pages, pricing, and all app configs

This commit is contained in:
2026-11-12 17:57:08 +05:30
parent f56aacdae8
commit ec609c5d4a
156 changed files with 233 additions and 321 deletions
+1 -3
View File
@@ -21,12 +21,11 @@ export async function GET(
const searchParams = req.nextUrl.searchParams;
const source = searchParams.get('utm_source') || 'web_try';
const campaign = searchParams.get('utm_campaign') || (tool ? tool.slug : 'general');
const promo = searchParams.get('promo') || (app.welcomeBonus ? app.welcomeBonus.code : 'TRYWEB50');
if (isAndroid) {
const playUrl = app.stores.android?.url || 'https://play.google.com';
const finalUrl = new URL(playUrl);
finalUrl.searchParams.set('referrer', `utm_source=${source}&utm_campaign=${campaign}&promo=${promo}`);
finalUrl.searchParams.set('referrer', `utm_source=${source}&utm_campaign=${campaign}`);
return NextResponse.redirect(finalUrl.toString());
}
@@ -42,6 +41,5 @@ export async function GET(
const desktopUrl = new URL(`/apps/${app.slug}`, req.url);
desktopUrl.searchParams.set('src', source);
desktopUrl.searchParams.set('tool', tool ? tool.slug : '');
desktopUrl.searchParams.set('promo', promo);
return NextResponse.redirect(desktopUrl.toString());
}
+2 -2
View File
@@ -85,14 +85,14 @@ export function AppCardsSection({
<div className="mt-6 pt-4 border-t border-slate-100 space-y-3">
<p className="text-[10.5px] text-slate-400 italic text-center font-mono">
{resolveLocalised(app.creditsNote, locale, 'Credits and purchases are specific to this app.')}
{resolveLocalised(app.creditsNote, locale, 'In-app purchases and subscriptions are managed securely via Apple App Store and Google Play.')}
</p>
<Link
href={`/apps/${app.slug}`}
className="w-full inline-flex items-center justify-center gap-2 py-3.5 rounded-full text-xs font-bold text-white bg-slate-900 hover:bg-blue-600 transition-all duration-200 shadow-sm hover:shadow-md"
>
<span>Get App & 50 Bonus Credits</span>
<span>Get Mobile App</span>
<ArrowRight className="w-3.5 h-3.5" />
</Link>
</div>
+24 -36
View File
@@ -7,7 +7,8 @@ import {
Copy,
Check,
ExternalLink,
ShieldCheck
Zap,
Sparkles
} from 'lucide-react';
import { AppItem, ToolItem, resolveLocalised } from '@/types';
import { KineticText } from '@/components/magicui/kinetic-text';
@@ -28,7 +29,6 @@ export function AppHandoffSection({
showQr = true,
}: AppHandoffSectionProps) {
const [qrDataUrl, setQrDataUrl] = useState<string>('');
const [copiedPromo, setCopiedPromo] = useState(false);
const [copiedLink, setCopiedLink] = useState(false);
const [origin, setOrigin] = useState<string>('');
@@ -40,11 +40,10 @@ export function AppHandoffSection({
if (!app) return null;
const bonusCode = app.welcomeBonus?.code || 'TRYWEB50';
const baseHost = origin || 'http://localhost:3000';
const targetUrl = tool
? `${baseHost}/go/${tool.slug}/${app.slug}?promo=${bonusCode}`
: `${baseHost}/apps/${app.slug}?promo=${bonusCode}`;
? `${baseHost}/go/${tool.slug}/${app.slug}`
: `${baseHost}/apps/${app.slug}`;
useEffect(() => {
if (showQr) {
@@ -61,12 +60,6 @@ export function AppHandoffSection({
}
}, [showQr, targetUrl]);
const copyPromo = () => {
navigator.clipboard.writeText(bonusCode);
setCopiedPromo(true);
setTimeout(() => setCopiedPromo(false), 2000);
};
const copyLink = () => {
navigator.clipboard.writeText(targetUrl);
setCopiedLink(true);
@@ -95,7 +88,7 @@ export function AppHandoffSection({
<KineticText>Continue on mobile</KineticText>
</h2>
<p className="text-sm sm:text-base text-ink-2 font-body text-pretty">
Handoff this tool directly to your iOS or Android phone with 50 bonus credits.
Handoff this tool directly to your iOS or Android phone for lossless 4K mobile processing.
</p>
</div>
@@ -112,30 +105,25 @@ export function AppHandoffSection({
</p>
</div>
{/* Promo Voucher */}
{/* Mobile Studio Capabilities */}
{showBonus && (
<div className="p-4 bg-paper-2 border border-rule rounded-2xl flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3">
<div className="space-y-0.5">
<span className="text-xs font-body font-semibold text-ink">
50 Free credits voucher code
</span>
<p className="text-xs text-muted font-body">
Enter during installation for complimentary batch runs.
</p>
</div>
<div className="flex items-center gap-2">
<span className="font-body text-sm font-semibold text-accent px-3 py-1 bg-paper-hi border border-rule rounded-full">
{bonusCode}
</span>
<button
type="button"
onClick={copyPromo}
className="btn-secondary text-xs px-3 py-1.5 rounded-full min-h-[36px]"
aria-label="Copy voucher code"
>
{copiedPromo ? <Check className="w-3.5 h-3.5 text-accent" aria-hidden="true" /> : <Copy className="w-3.5 h-3.5 text-muted" aria-hidden="true" />}
</button>
<div className="flex items-center gap-3">
<div className="w-8 h-8 rounded-xl bg-accent/10 flex items-center justify-center shrink-0">
<Sparkles className="w-4 h-4 text-accent" />
</div>
<div className="space-y-0.5">
<span className="text-xs font-body font-semibold text-ink">
Lossless 4K & Batch Processing
</span>
<p className="text-xs text-muted font-body">
Hardware neural acceleration for rapid multi-photo exports.
</p>
</div>
</div>
<span className="font-body text-xs font-semibold text-accent px-3 py-1 bg-paper-hi border border-rule rounded-full shrink-0">
Native Mobile Studio
</span>
</div>
)}
@@ -178,7 +166,7 @@ export function AppHandoffSection({
</div>
<div className="pt-2 text-xs text-muted font-body">
{resolveLocalised(app.creditsNote, locale, 'Credits and in-app purchases are specific to this app.')}
{resolveLocalised(app.creditsNote, locale, 'In-app purchases and subscriptions are managed securely via Apple App Store and Google Play.')}
</div>
</div>
@@ -190,14 +178,14 @@ export function AppHandoffSection({
<div className="p-4 bg-paper-hi border border-rule rounded-2xl inline-block shadow-sm">
<img
src={qrDataUrl}
alt="Scan QR code to install app"
alt={`Scan QR code to install ${appName}`}
className="w-44 h-44 object-contain rounded-xl"
/>
</div>
<div className="mt-4 space-y-1 text-xs font-body text-muted">
<p className="font-medium text-ink">Instant mobile handoff</p>
<p>Directs to App Store or Google Play with {bonusCode} applied automatically.</p>
<p>Directs to App Store or Google Play for instantaneous installation.</p>
</div>
</div>
)}
+1 -1
View File
@@ -128,7 +128,7 @@ export function AppPickerSection({
href={`/apps/${recommendedApp.slug}`}
className="w-full sm:w-auto shrink-0 inline-flex items-center justify-center gap-2 px-6 py-3.5 rounded-full text-xs font-bold text-white bg-blue-600 hover:bg-blue-700 shadow-sm shadow-blue-500/25 transition-all hover:scale-105 active:scale-95"
>
<span>Get App & 50 Bonus Credits</span>
<span>Get Mobile App</span>
<ArrowRight className="w-4 h-4" />
</Link>
</div>
+1 -1
View File
@@ -33,7 +33,7 @@ export function FaqSection({
},
{
q: 'How does the handoff to the mobile app work?',
a: 'Each tool has a dedicated home mobile app. When you want to continue editing on your phone, click "Get the App" or scan the dynamically generated QR code on desktop to jump directly into the app with a 50 free credit welcome bonus.',
a: 'Each tool has a dedicated home mobile app. When you want to continue editing on your phone, click "Get the App" or scan the dynamically generated QR code on desktop to jump directly into the app for instant access to native 4K processing and batch editing.',
},
{
q: 'What image formats and file sizes are supported?',
@@ -23,7 +23,7 @@ export function PricingExplainerSection({
</div>
<div>
<h3 className="text-xl font-bold text-slate-900 dark:text-white">
{resolveLocalised(title, locale, 'How App Pricing & Credits Work')}
{resolveLocalised(title, locale, 'How App Pricing & Plans Work')}
</h3>
<p className="text-xs text-slate-500 dark:text-slate-400">
Transparent and simple: no surprise auto-renewing web subscriptions.
@@ -223,7 +223,7 @@ export function RecommendedAppsSection({
<span className="px-2.5 py-1 rounded-full bg-paper-2 border border-rule font-medium text-[11px]">iOS 17+</span>
<span className="px-2.5 py-1 rounded-full bg-paper-2 border border-rule font-medium text-[11px]">Android 14+</span>
<span className="px-2.5 py-1 rounded-full bg-accent/10 text-accent font-semibold border border-accent/25 text-[11px]">
50 credits free
4K Lossless
</span>
</div>
@@ -266,7 +266,7 @@ export function RecommendedAppsSection({
Direct desktop-to-mobile handoff with instant QR sync
</h4>
<p className="text-xs text-muted mt-0.5 font-body">
Open any tool on desktop, scan the dynamically generated QR code, and continue editing 4K batches natively on your phone with 50 complimentary credits.
Open any tool on desktop, scan the dynamically generated QR code, and continue editing 4K batches natively on your phone.
</p>
</div>
</div>
@@ -25,7 +25,7 @@ export function WorkflowVisualizerSection() {
title: 'Instant HD & 4K Mobile Handoff',
desc: 'Download your result in standard HD or scan the dynamic QR code to unlock batch processing and 4K lossless export in our mobile apps.',
icon: Smartphone,
highlight: '50 Free App Credits',
highlight: 'Lossless 4K Mobile Export',
gradient: 'from-teal-50 to-emerald-50 text-emerald-600 border-emerald-200',
},
];
+24 -48
View File
@@ -13,7 +13,6 @@ import {
Star,
Layers,
CheckCircle2,
Gift,
ArrowRight
} from 'lucide-react';
import { ToolItem, AppItem, resolveLocalised } from '@/types';
@@ -34,7 +33,6 @@ export function PostResultAppHandoff({
variant = 'post-result',
}: PostResultAppHandoffProps) {
const [qrDataUrl, setQrDataUrl] = useState<string>('');
const [copiedPromo, setCopiedPromo] = useState(false);
const [copiedLink, setCopiedLink] = useState(false);
const [origin, setOrigin] = useState<string>('');
@@ -68,11 +66,6 @@ export function PostResultAppHandoff({
count: 28400,
source: 'App Store & Google Play',
},
welcomeBonus: {
code: 'TRYWEB50',
title: '50 Free Pro Credits',
description: 'Install through this link to claim 50 free HD export credits.',
},
features: [
'Unlimited 4K batch processing for full galleries',
'Lossless RAW & Ultra-HD PNG export without compression',
@@ -82,13 +75,12 @@ export function PostResultAppHandoff({
};
const appName = resolveLocalised(appData.name, locale);
const appTagline = resolveLocalised(appData.tagline, locale);
const bonusCode = appData.welcomeBonus?.code || 'TRYWEB50';
const toolName = tool.name ? resolveLocalised(tool.name, locale) : 'Photo Tools';
const baseHost = origin || 'http://localhost:3000';
const targetUrl = `${baseHost}/go/${tool.slug}/${appData.slug}?promo=${bonusCode}&src=${variant}`;
const iosUrl = appData.stores?.ios?.url || `/go/${tool.slug}/${appData.slug}?promo=${bonusCode}&src=ios`;
const androidUrl = appData.stores?.android?.url || `/go/${tool.slug}/${appData.slug}?promo=${bonusCode}&src=android`;
const targetUrl = `${baseHost}/go/${tool.slug}/${appData.slug}?src=${variant}`;
const iosUrl = appData.stores?.ios?.url || `/go/${tool.slug}/${appData.slug}?src=ios`;
const androidUrl = appData.stores?.android?.url || `/go/${tool.slug}/${appData.slug}?src=android`;
// Generate dynamic QR Code for instant phone handoff
useEffect(() => {
@@ -104,13 +96,6 @@ export function PostResultAppHandoff({
.catch((err) => console.error('Failed to generate QR code:', err));
}, [targetUrl]);
const handleCopyPromo = (e: React.MouseEvent) => {
e.stopPropagation();
navigator.clipboard.writeText(bonusCode);
setCopiedPromo(true);
setTimeout(() => setCopiedPromo(false), 2200);
};
const handleCopyLink = (e: React.MouseEvent) => {
e.stopPropagation();
navigator.clipboard.writeText(targetUrl);
@@ -135,8 +120,8 @@ export function PostResultAppHandoff({
<strong>HD result saved!</strong> Need to edit more photos? Get <strong>{appName}</strong> for unlimited 4K batch processing.
</span>
</div>
<span className="hidden sm:inline-block px-2.5 py-1 rounded-full bg-emerald-600 text-white font-mono text-xs font-bold shrink-0">
50 CREDITS UNLOCKED
<span className="hidden sm:inline-block px-2.5 py-1 rounded-full bg-emerald-600 text-white font-sans text-xs font-semibold shrink-0">
4K UNLIMITED READY
</span>
</div>
)}
@@ -144,7 +129,7 @@ export function PostResultAppHandoff({
{/* Primary Conversion Header */}
<div className="flex flex-col lg:flex-row lg:items-center justify-between gap-4 pb-6 border-b border-rule">
<div className="space-y-2">
{/* Rating & Bonus Pill */}
{/* Rating & App Badge Pill */}
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-accent/10 border border-accent/20 text-accent font-sans text-xs font-semibold">
<div className="flex items-center gap-0.5 text-amber-500">
<Star className="w-3.5 h-3.5 fill-amber-400 text-amber-400" />
@@ -153,48 +138,39 @@ export function PostResultAppHandoff({
<span className="text-slate-300">|</span>
<span className="text-slate-700">Official Mobile App</span>
<span className="text-slate-300">|</span>
<span className="text-accent font-bold tracking-tight">50 Free Bonus Credits</span>
<span className="text-accent font-bold tracking-tight">Lossless 4K Mobile Studio</span>
</div>
<h3 className="text-xl sm:text-2xl font-display font-bold text-slate-900 tracking-tight">
{variant === 'post-result'
? `Love this result? Take it further in ${appName}`
: `Experience ${tool.name ? resolveLocalised(tool.name, locale) : 'Photo Tools'} in ${appName}`}
: `Experience ${toolName} in ${appName}`}
</h3>
<p className="text-xs sm:text-sm text-slate-600 font-sans max-w-2xl leading-relaxed">
The web studio is limited to 5 single-photo tries daily. Install our native mobile app to process full photo galleries in <strong>4K lossless resolution</strong> with zero wait times.
</p>
</div>
{/* Voucher Code Box */}
<div className="shrink-0 p-3.5 rounded-2xl bg-paper-2 border border-rule flex items-center justify-between lg:justify-start gap-3">
{/* Mobile Platform Badge */}
<div className="shrink-0 p-3.5 rounded-2xl bg-paper-2 border border-rule flex items-center justify-between lg:justify-start gap-4">
<div className="space-y-0.5">
<div className="flex items-center gap-1.5 text-[11px] font-sans font-semibold text-slate-500 uppercase tracking-wider">
<Gift className="w-3.5 h-3.5 text-accent" />
<span>Welcome Voucher</span>
<Smartphone className="w-3.5 h-3.5 text-accent" />
<span>Platform Compatibility</span>
</div>
<span className="font-mono font-bold text-sm text-slate-900 tracking-wider">
{bonusCode}
<span className="font-sans font-semibold text-xs text-slate-900 tracking-tight block">
iOS 15+ &bull; Android 9+
</span>
</div>
<button
type="button"
onClick={handleCopyPromo}
className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-xs font-sans font-semibold bg-white hover:bg-slate-100 text-slate-800 border border-slate-200 shadow-2xs transition-all cursor-pointer"
title="Copy promo voucher"
<a
href={targetUrl}
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center gap-1.5 px-3.5 py-2 rounded-xl text-xs font-sans font-semibold bg-accent text-white hover:bg-accent/90 shadow-2xs transition-all cursor-pointer shrink-0"
>
{copiedPromo ? (
<>
<Check className="w-3.5 h-3.5 text-emerald-600" />
<span className="text-emerald-700 font-bold">Copied!</span>
</>
) : (
<>
<Copy className="w-3.5 h-3.5 text-slate-500" />
<span>Copy</span>
</>
)}
</button>
<span>Get App</span>
<ArrowRight className="w-3.5 h-3.5" />
</a>
</div>
</div>
@@ -351,7 +327,7 @@ export function PostResultAppHandoff({
<div className="space-y-1">
<p className="text-[11px] text-slate-600 font-sans leading-tight">
Instantly opens App Store or Google Play with promo code <strong>{bonusCode}</strong> applied.
Instantly opens App Store or Google Play directly on your phone.
</p>
<span className="inline-block text-[10px] text-slate-400 font-sans">
Works on iOS 15+ and Android 9+
+1 -1
View File
@@ -47,7 +47,7 @@ export function Footer({ config, currentLocale }: FooterProps) {
</li>
<li>
<Link href="/pricing" className="text-muted hover:text-ink transition-colors">
Pricing and credits
Pricing & plans
</Link>
</li>
<li>
+2 -2
View File
@@ -18,8 +18,8 @@ export function checkRateLimits(
ip: string,
limits = { perVisitorPerDay: 5, perIpPerHour: 25, dailyBudgetCalls: 5000 }
): { allowed: boolean; reason?: 'visitor_daily' | 'ip_hourly' | 'budget_exhausted'; remainingToday: number } {
// Relax rate limits for local testing and development
const isLocal = ip === '127.0.0.1' || ip === '::1' || ip === 'localhost' || !ip || process.env.NODE_ENV !== 'production';
// Relax rate limits for local development, but respect explicit limits in test suites
const isLocal = process.env.NODE_ENV !== 'test' && (ip === '127.0.0.1' || ip === '::1' || ip === 'localhost' || !ip || process.env.NODE_ENV !== 'production');
const effectiveLimits = isLocal
? { perVisitorPerDay: 10000, perIpPerHour: 10000, dailyBudgetCalls: 50000 }
: limits;