@@ -12,16 +12,20 @@ import { TwoColorProgressBar } from 'src/components/progress-bar';
1212import { Tooltip } from 'src/components/tooltip' ;
1313import { TreeView , TreeNode , updateNodeById } from 'src/components/tree-view' ;
1414import { SYNC_PUSH_SIZE_LIMIT_GB } from 'src/constants' ;
15+ import { useGetWpVersion } from 'src/hooks/use-get-wp-version' ;
1516import { cx } from 'src/lib/cx' ;
1617import { getIpcApi } from 'src/lib/get-ipc-api' ;
1718import { getLocalizedLink } from 'src/lib/get-localized-link' ;
19+ import { getLatestStableWpVersion } from 'src/lib/version-utils' ;
20+ import { hasVersionMismatch } from 'src/modules/preview-site/lib/version-comparison' ;
1821import { SiteNameBox } from 'src/modules/sync/components/site-name-box' ;
1922import { useSelectedItemsPushSize } from 'src/modules/sync/hooks/use-selected-items-push-size' ;
2023import { useSyncDialogTexts } from 'src/modules/sync/hooks/use-sync-dialog-texts' ;
2124import { useTopLevelSyncTree } from 'src/modules/sync/hooks/use-top-level-sync-tree' ;
2225import { getSiteEnvironment } from 'src/modules/sync/lib/environment-utils' ;
2326import { useI18nLocale } from 'src/stores' ;
2427import { useLatestRewindId , useRemoteFileTree , useLocalFileTree } from 'src/stores/sync' ;
28+ import { useGetWordPressVersions } from 'src/stores/wordpress-versions-api' ;
2529import { TreeViewLoadingSkeleton } from './tree-view-loading-skeleton' ;
2630import type { SyncSite } from 'src/hooks/use-fetch-wpcom-sites/types' ;
2731
@@ -154,6 +158,19 @@ export function SyncDialog( {
154158 const { fetchChildren, rewindId, isLoadingRewindId, isErrorRewindId, isLoadingLocalFileTree } =
155159 useDynamicTreeState ( type , localSite . id , remoteSite . id , setTreeState ) ;
156160
161+ const [ wpVersion ] = useGetWpVersion ( localSite ) ;
162+ const { data : wpVersions = [ ] } = useGetWordPressVersions ( {
163+ minimumVersion : '' ,
164+ } ) ;
165+ const latestWpVersion = getLatestStableWpVersion ( wpVersions ) ;
166+ const shouldShowVersionMismatch =
167+ type === 'push' &&
168+ hasVersionMismatch ( {
169+ wpVersion,
170+ latestWpVersion,
171+ phpVersion : localSite . phpVersion ,
172+ } ) ;
173+
157174 const localSiteName = < SiteNameBox siteName = { localSite . name } envType = "studio" /> ;
158175 const remoteSiteName = < SiteNameBox siteName = { remoteSite . name } envType = { siteEnv } /> ;
159176
@@ -227,10 +244,18 @@ export function SyncDialog( {
227244 if ( type === 'pull' ) {
228245 return 'pb-[70px]' ; // Original padding for pull
229246 }
230- if ( isPushSelectionOverLimit ) {
231- return 'pb-[200px]' ; // Progress bar + warning notice
247+ // Calculate dynamic padding based on number of notices shown
248+ const noticeCount = [ isPushSelectionOverLimit , shouldShowVersionMismatch ] . filter (
249+ Boolean
250+ ) . length ;
251+
252+ if ( noticeCount === 0 ) {
253+ return 'pb-[140px]' ; // Just progress bar
232254 }
233- return 'pb-[110px]' ; // Just progress bar
255+ if ( noticeCount === 1 ) {
256+ return 'pb-[220px]' ; // Progress bar + one notice
257+ }
258+ return 'pb-[300px]' ; // Progress bar + two notices
234259 } ;
235260
236261 return (
@@ -336,7 +361,7 @@ export function SyncDialog( {
336361 </ div >
337362 </ Tooltip >
338363
339- < div className = "px-8 py-4 absolute left-0 right-0 bottom-0 bg-white z-10 border-t border-a8c-gray-5" >
364+ < div className = "px-8 py-4 absolute left-0 right-0 bottom-0 bg-white/[0.8] backdrop-blur-sm z-10 border-t border-a8c-gray-5" >
340365 { type === 'push' && (
341366 < div className = "mb-4" >
342367 < TwoColorProgressBar
@@ -361,6 +386,15 @@ export function SyncDialog( {
361386 </ p >
362387 </ Notice >
363388 ) }
389+ { shouldShowVersionMismatch && (
390+ < Notice status = "warning" isDismissible = { false } className = "mb-4" >
391+ < p data-testid = "push-version-mismatch-notice" >
392+ { __ (
393+ 'Your Studio site is using a different WordPress or PHP version than your WordPress.com site. The remote site will keep on using the newest supported versions.'
394+ ) }
395+ </ p >
396+ </ Notice >
397+ ) }
364398 < div className = "flex justify-between items-center" >
365399 < div >
366400 { createInterpolateElement ( syncTexts . envSync , {
0 commit comments