@@ -1233,19 +1233,23 @@ public static function checkChartStatus( $type ) {
1233
1233
1234
1234
/**
1235
1235
* Get the survey metadata.
1236
- *
1237
- * @param array $data The data for survey in Formbricks format.
1236
+ *
1237
+ * @param array $data The data for survey in Formbricks format.
1238
1238
* @param string $page_slug The slug of the loaded page.
1239
1239
*
1240
1240
* @return array The survey metadata.
1241
1241
*/
1242
1242
public function get_survey_metadata ( $ data , $ page_slug ) {
1243
1243
$ install_date = get_option ( 'visualizer_install ' , time () );
1244
-
1245
1244
$ install_days_number = intval ( ( time () - $ install_date ) / DAY_IN_SECONDS );
1246
1245
1246
+ $ license_status = apply_filters ( 'product_visualizer_license_status ' , 'invalid ' );
1247
+ $ license_plan = apply_filters ( 'product_visualizer_license_plan ' , false );
1248
+ $ license_key = apply_filters ( 'product_visualizer_license_key ' , false );
1249
+
1247
1250
$ plugin_data = get_plugin_data ( VISUALIZER_BASEFILE , false , false );
1248
1251
$ plugin_version = '' ;
1252
+
1249
1253
if ( ! empty ( $ plugin_data ['Version ' ] ) ) {
1250
1254
$ plugin_version = $ plugin_data ['Version ' ];
1251
1255
}
@@ -1255,14 +1259,17 @@ public function get_survey_metadata( $data, $page_slug ) {
1255
1259
'attributes ' => array (
1256
1260
'free_version ' => $ plugin_version ,
1257
1261
'pro_version ' => defined ( 'VISUALIZER_PRO_VERSION ' ) ? VISUALIZER_PRO_VERSION : '' ,
1258
- 'license_status ' => apply_filters ( ' product_visualizer_license_status ' , ' invalid ' ) ,
1262
+ 'license_status ' => $ license_status ,
1259
1263
'install_days_number ' => $ install_days_number ,
1260
1264
),
1261
1265
);
1262
1266
1263
- $ license_data = get_option ( 'visualizer_pro_license_data ' , false );
1264
- if ( isset ( $ license_data ->key ) ) {
1265
- $ data ['attributes ' ]['license_key ' ] = apply_filters ( 'themeisle_sdk_secret_masking ' , $ license_data ->key );
1267
+ if ( ! empty ( $ license_plan ) ) {
1268
+ $ data ['attributes ' ]['plan ' ] = $ license_plan ;
1269
+ }
1270
+
1271
+ if ( ! empty ( $ license_key ) ) {
1272
+ $ data ['attributes ' ]['license_key ' ] = apply_filters ( 'themeisle_sdk_secret_masking ' , $ license_key );
1266
1273
}
1267
1274
1268
1275
return $ data ;
0 commit comments