Skip to content

Commit 2c5af91

Browse files
committed
fix: allow database option access for old personal
improve upsell message References: Codeinwp/visualizer-pro#468
1 parent ac88843 commit 2c5af91

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

classes/Visualizer/Module.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,11 +738,20 @@ public static function can_show_feature( $feature ) {
738738
* Gets the features for the provided license type.
739739
*/
740740
public static final function get_features_for_license( $plan ) {
741+
$is_new_personal = apply_filters( 'visualizer_is_new_personal', false );
741742
switch ( $plan ) {
742743
case 1:
743-
return array( 'import-wp', 'import-wc-report', 'import-file', 'import-url' );
744+
$features = array( 'import-wp', 'import-wc-report', 'import-file', 'import-url' );
745+
if ( ! $is_new_personal ) {
746+
$features[] = 'db-query';
747+
}
748+
return $features;
744749
case 2:
745-
return array( 'db-query', 'schedule-chart', 'chart-permissions', 'import-chart', 'data-filter-configuration', 'frontend-actions' );
750+
$features = array( 'schedule-chart', 'chart-permissions', 'import-chart', 'data-filter-configuration', 'frontend-actions' );
751+
if ( $is_new_personal ) {
752+
$features[] = 'db-query';
753+
}
754+
return $features;
746755
}
747756
}
748757

classes/Visualizer/Module/Sources.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ public function addProUpsell( $old, $feature = null ) {
139139
( in_array( $feature, $pro_features, true ) && ! Visualizer_Module::is_pro() )
140140
) {
141141
$msg = sprintf( __( 'Upgrade to %s to activate this feature!', 'visualizer' ), 'PRO' );
142-
if ( in_array( $feature, $biz_features, true ) ) {
143-
$msg = sprintf( __( 'Upgrade to %s plan to activate this feature!', 'visualizer' ), 'Developer' );
142+
if ( in_array( $feature, $biz_features, true ) && Visualizer_Module::is_pro() ) {
143+
$msg = sprintf( __( 'Upgrade to %s plan to activate this feature!', 'visualizer' ), 'Plus' );
144144
}
145145
$return = '<div class="only-pro-content">';
146146
$return .= ' <div class="only-pro-container">';

0 commit comments

Comments
 (0)