@@ -49,20 +49,25 @@ public function get_survey_metadata( $data, $page_slug ) {
49
49
return $ data ;
50
50
}
51
51
52
- $ license_status = apply_filters ( 'product_ppom_license_status ' , 'invalid ' );
53
- $ license_plan = intval ( apply_filters ( 'product_ppom_license_plan ' , -1 ) );
54
- $ license_key = apply_filters ( 'product_ppom_license_key ' , '' );
52
+ $ license_status = apply_filters ( 'product_ppom_license_status ' , 'invalid ' );
53
+ $ license_plan = intval ( apply_filters ( 'product_ppom_license_plan ' , -1 ) );
54
+ $ license_key = apply_filters ( 'product_ppom_license_key ' , '' );
55
+ $ group_fields_count = get_transient ( PPOM_GROUPS_COUNT_CACHE_KEY );
55
56
56
- $ license_data = get_option ( 'ppom_pro_license_data ' , array () );
57
+ if ( false === $ group_fields_count ) {
58
+ $ group_fields_count = min ( 100 , NM_PersonalizedProduct::get_product_meta_count () );
59
+ set_transient ( PPOM_GROUPS_COUNT_CACHE_KEY , $ group_fields_count , 100 <= $ group_fields_count ? WEEK_IN_SECONDS : 12 * HOUR_IN_SECONDS );
60
+ }
57
61
58
- $ install_days_number = round ( ( time () - get_option ( 'woocommerce_product_addon_install ' , time () ) ) / DAY_IN_SECONDS );
62
+ $ install_days_number = intval ( ( time () - get_option ( 'woocommerce_product_addon_install ' , time () ) ) / DAY_IN_SECONDS );
59
63
60
64
$ data = array (
61
65
'environmentId ' => 'clza3s4zm000h10km1699nlli ' ,
62
66
'attributes ' => array (
63
67
'install_days_number ' => $ install_days_number ,
64
68
'free_version ' => PPOM_VERSION ,
65
69
'license_status ' => $ license_status ,
70
+ 'field_groups_count ' => intval ( $ group_fields_count )
66
71
)
67
72
);
68
73
@@ -71,7 +76,7 @@ public function get_survey_metadata( $data, $page_slug ) {
71
76
}
72
77
73
78
if ( ! empty ( $ license_key ) ) {
74
- $ data ['attributes ' ]['license_key ' ] = apply_filters ( 'themeisle_sdk_secret_masking ' , $ license_data -> key );
79
+ $ data ['attributes ' ]['license_key ' ] = apply_filters ( 'themeisle_sdk_secret_masking ' , $ license_key );
75
80
}
76
81
77
82
if ( defined ( 'PPOM_PRO_VERSION ' ) ) {
0 commit comments