@@ -389,64 +389,66 @@ public static function _getChartTypesLocalized( $enabledOnly = false, $get2Darra
389389 );
390390 }
391391
392+ $ enabled = self ::proFeaturesLocked ();
393+
392394 $ types = array_merge (
393395 $ additional ,
394396 array (
395397 'tabular ' => array (
396398 'name ' => esc_html__ ( 'Table ' , 'visualizer ' ),
397399 'enabled ' => true ,
398- 'supports ' => array ( 'Google Charts ' , 'DataTable ' ),
400+ 'supports ' => $ enabled ? array ( 'Google Charts ' , ' DataTable ' ) : array ( 'DataTable ' ),
399401 ),
400402 'pie ' => array (
401403 'name ' => esc_html__ ( 'Pie/Donut ' , 'visualizer ' ),
402404 'enabled ' => true ,
403- 'supports ' => array ( 'Google Charts ' , 'ChartJS ' ),
405+ 'supports ' => $ enabled ? array ( 'Google Charts ' , 'ChartJS ' ) : array ( ' Google Charts ' ),
404406 ),
405407 'line ' => array (
406408 'name ' => esc_html__ ( 'Line ' , 'visualizer ' ),
407409 'enabled ' => true ,
408- 'supports ' => array ( 'Google Charts ' , 'ChartJS ' ),
410+ 'supports ' => $ enabled ? array ( 'Google Charts ' , 'ChartJS ' ) : array ( 'Google Charts ' ),
411+ ),
412+ 'bar ' => array (
413+ 'name ' => esc_html__ ( 'Bar ' , 'visualizer ' ),
414+ 'enabled ' => true ,
415+ 'supports ' => $ enabled ? array ( 'Google Charts ' , 'ChartJS ' ) : array ( 'Google Charts ' ),
409416 ),
410417 'area ' => array (
411418 'name ' => esc_html__ ( 'Area ' , 'visualizer ' ),
412- 'enabled ' => true ,
419+ 'enabled ' => $ enabled ,
413420 // in ChartJS, the fill option is used to make Line chart an area: https://www.chartjs.org/docs/latest/charts/area.html
414421 'supports ' => array ( 'Google Charts ' ),
415422 ),
416423 'geo ' => array (
417424 'name ' => esc_html__ ( 'Geo ' , 'visualizer ' ),
418- 'enabled ' => true ,
425+ 'enabled ' => $ enabled ,
419426 'supports ' => array ( 'Google Charts ' ),
420427 ),
421- 'bar ' => array (
422- 'name ' => esc_html__ ( 'Bar ' , 'visualizer ' ),
423- 'enabled ' => true ,
424- 'supports ' => array ( 'Google Charts ' , 'ChartJS ' ),
425- ),
426428 'column ' => array (
427429 'name ' => esc_html__ ( 'Column ' , 'visualizer ' ),
428- 'enabled ' => true ,
430+ 'enabled ' => $ enabled ,
429431 'supports ' => array ( 'Google Charts ' , 'ChartJS ' ),
430432 ),
431433 'bubble ' => array (
432434 'name ' => esc_html__ ( 'Bubble ' , 'visualizer ' ),
433- 'enabled ' => true ,
435+ 'enabled ' => $ enabled ,
434436 // chartjs' bubble is ugly looking (and it won't work off the default bubble.csv) so it is being excluded for the time being.
435437 'supports ' => array ( 'Google Charts ' ),
436438 ),
437439 'scatter ' => array (
438440 'name ' => esc_html__ ( 'Scatter ' , 'visualizer ' ),
439- 'enabled ' => true ,
441+ 'enabled ' => $ enabled ,
440442 'supports ' => array ( 'Google Charts ' ),
441443 ),
442444 'gauge ' => array (
443445 'name ' => esc_html__ ( 'Gauge ' , 'visualizer ' ),
444- 'enabled ' => true ,
446+ 'enabled ' => $ enabled ,
445447 'supports ' => array ( 'Google Charts ' ),
446448 ),
447449 'candlestick ' => array (
448450 'name ' => esc_html__ ( 'Candlestick ' , 'visualizer ' ),
449- 'enabled ' => true ,
451+ 'enabled ' => $ enabled ,
450452 'supports ' => array ( 'Google Charts ' ),
451453 ),
452454 // pro types
@@ -1046,4 +1048,15 @@ public function getPluginMetaLinks( $plugin_meta, $plugin_file ) {
10461048 return $ plugin_meta ;
10471049 }
10481050
1051+ /**
1052+ * If check is existing user.
1053+ *
1054+ * @return bool Default false
1055+ */
1056+ public static function proFeaturesLocked () {
1057+ if ( Visualizer_Module::is_pro () ) {
1058+ return true ;
1059+ }
1060+ return 'yes ' === get_option ( 'visualizer-new-user ' , 'yes ' ) ? false : true ;
1061+ }
10491062}
0 commit comments