99import { applyFilters } from '@wordpress/hooks'
1010import apiFetch from '@wordpress/api-fetch'
1111import { __ , sprintf } from '@wordpress/i18n'
12+ import { buildPricingUrl } from '~cimo/shared/pricing-url'
1213import cimoLogo from './assets/logo-long.webp'
1314
1415const buildType = applyFilters ( 'cimo.admin.settings.buildType' , 'free' )
@@ -349,7 +350,7 @@ const AdminSettings = () => {
349350 < img className = "cimo-logo" src = { cimoLogo } alt = { __ ( 'Cimo Logo' , 'cimo-image-optimizer' ) } height = "35" />
350351
351352 { /* Statistics Section */ }
352- < div className = "cimo-stats-section" >
353+ < div className = "cimo-stats-section" id = "cimo-stats" >
353354 < div className = "cimo-stats-column cimo-stats-column-big" >
354355 < h3 > { __ ( 'Total Storage Saved' , 'cimo-image-optimizer' ) } </ h3 >
355356 < div className = "cimo-stats-main" >
@@ -390,7 +391,7 @@ const AdminSettings = () => {
390391 if ( match ) {
391392 const num = parseFloat ( match [ 1 ] )
392393 const unit = match [ 2 ] . toUpperCase ( )
393- if ( unit === 'MB' && num > 100 ) {
394+ if ( unit === 'MB' && num > 5 ) {
394395 showRating = true
395396 }
396397 }
@@ -629,6 +630,7 @@ const AdminSettings = () => {
629630 < PremiumPlaceholder
630631 label = { __ ( 'Bulk optimize existing media in your Media Library.' , 'cimo-image-optimizer' ) }
631632 learnMoreUrl = "https://docs.wpcimo.com/article/788-bulk-optimization"
633+ pricingUtmContent = "bulk"
632634 />
633635 ) }
634636 { buildType === 'premium' && < >
@@ -667,6 +669,7 @@ const AdminSettings = () => {
667669 < PremiumPlaceholder
668670 label = { __ ( 'Show a low-quality preview while the image loads, then fade in the final image.' , 'cimo-image-optimizer' ) }
669671 learnMoreUrl = "https://docs.wpcimo.com/article/777-low-quality-image-placeholder"
672+ pricingUtmContent = "lqip"
670673 />
671674 ) }
672675 { buildType === 'premium' && < >
@@ -771,6 +774,7 @@ const AdminSettings = () => {
771774 < PremiumPlaceholder
772775 label = { __ ( 'Upgrade to Premium to compress and optimize video files on upload' , 'cimo-image-optimizer' ) }
773776 learnMoreUrl = "https://docs.wpcimo.com/article/775-video-optimization"
777+ pricingUtmContent = "video"
774778 />
775779 ) }
776780 { buildType === 'premium' && < >
@@ -890,6 +894,7 @@ const AdminSettings = () => {
890894 < PremiumPlaceholder
891895 label = { __ ( 'Upgrade to Premium to compress and optimize audio files on upload' , 'cimo-image-optimizer' ) }
892896 learnMoreUrl = "https://docs.wpcimo.com/article/776-audio-optimization"
897+ pricingUtmContent = "audio"
893898 />
894899 ) }
895900 { buildType === 'premium' && < >
@@ -952,6 +957,7 @@ const AdminSettings = () => {
952957 < PremiumPlaceholder
953958 label = { __ ( 'Upgrade to Premium to compress and optimize SVG files on upload' , 'cimo-image-optimizer' ) }
954959 learnMoreUrl = "https://docs.wpcimo.com/article/780-svg-support"
960+ pricingUtmContent = "svg"
955961 />
956962 ) }
957963 { buildType === 'premium' && < >
@@ -1011,6 +1017,7 @@ const AdminSettings = () => {
10111017 < PremiumPlaceholder
10121018 label = { __ ( 'Upgrade to Premium to enter stealth mode.' , 'cimo-image-optimizer' ) }
10131019 learnMoreUrl = "https://docs.wpcimo.com/article/782-stealth-mode"
1020+ pricingUtmContent = "stealth"
10141021 />
10151022 ) }
10161023 { buildType === 'premium' && < >
@@ -1135,7 +1142,7 @@ const AdminSettings = () => {
11351142
11361143 < div className = "cimo-premium-cta" >
11371144 < Button
1138- href = "https://wpcimo.com/pricing?utm_source=plugin & utm_medium = admin & utm_campaign = upgrade "
1145+ href = { buildPricingUrl ( 'sidebar' ) }
11391146 variant = "primary"
11401147 target = "_blank"
11411148 rel = "noopener noreferrer"
@@ -1156,6 +1163,7 @@ const AdminSettings = () => {
11561163export default AdminSettings
11571164
11581165const PremiumPlaceholder = props => {
1166+ const pricingHref = buildPricingUrl ( props . pricingUtmContent || 'placeholder' )
11591167 return (
11601168 < div className = "cimo-settings-premium-placeholder" >
11611169 { props . label }
@@ -1165,7 +1173,7 @@ const PremiumPlaceholder = props => {
11651173 < Button
11661174 variant = "secondary"
11671175 className = "cimo-premium-cta cimo-premium-cta-upgrade"
1168- href = "https://wpcimo.com/pricing"
1176+ href = { pricingHref }
11691177 target = "_blank"
11701178 rel = "noopener noreferrer"
11711179 >
0 commit comments