feat(Core): add optimize and complete code
This commit is contained in:
@@ -112,6 +112,12 @@ class BannerService {
|
||||
wp_cache_set('version', $version, 'sodino_banners');
|
||||
}
|
||||
|
||||
return 'sodino_active_banners_' . md5($version . '|' . $position . '|' . serialize($context));
|
||||
$runtimeContext = [
|
||||
'user' => is_user_logged_in() ? 'returning' : 'new',
|
||||
'device' => wp_is_mobile() ? 'mobile' : 'desktop',
|
||||
'minute' => gmdate('YmdHi', current_time('timestamp', true)),
|
||||
];
|
||||
|
||||
return 'sodino_active_banners_' . md5($version . '|' . $position . '|' . wp_json_encode($context) . '|' . wp_json_encode($runtimeContext));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user