PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 2.0.3
Visualizer – Tables & Charts Manager with Built-in AI Generator v2.0.3
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
← All changes | classes/Visualizer/Module/Sources.php +10 -24 4.0.72.0.3 View file →
@@ -52,9 +52,9 @@
52 52 public function __construct( Visualizer_Plugin $plugin ) {
53 53 parent::__construct( $plugin );
54 54 $this->_addFilter( Visualizer_Plugin::FILTER_GET_CHART_SERIES, 'filterChartSeries', 1, 2 );
55 55 $this->_addFilter( Visualizer_Plugin::FILTER_GET_CHART_DATA, 'filterChartData', 1, 2 );
56 - $this->_addFilter( 'visualizer_pro_upsell', 'addProUpsell', 10, 3 );
56 + $this->_addFilter( 'visualizer_pro_upsell', 'addProUpsell', 10, 2 );
57 57 }
58 58
59 59 /**
60 60 * Filters chart sereis.
@@ -128,41 +128,26 @@
128 128 * @param string $feature What feature is this filter running for.
129 129 *
130 130 * @return string The new html code.
131 131 */
132 - public function addProUpsell( $old, $feature = null, string $docs_url = '' ) {
133 - $pro_features = Visualizer_Module::get_features_for_license( 1 );
134 - $biz_features = Visualizer_Module::get_features_for_license( 2 );
132 + public function addProUpsell( $old, $feature = null ) {
135 133 $return = '';
136 134 $feature = strval( $feature );
137 - if ( empty( $feature ) ||
138 - ( in_array( $feature, $biz_features, true ) && ! apply_filters( 'visualizer_is_business', false ) ) ||
139 - ( in_array( $feature, $pro_features, true ) && ! Visualizer_Module::is_pro() )
140 - ) {
141 - // translators: $s - the name of the plan (PRO).
142 - $msg = sprintf( __( 'Upgrade to %s to activate this feature!', 'visualizer' ), 'PRO' );
143 - // translators: $s - the name of the plan (Plus).
144 - $plus_msg = sprintf( __( 'Upgrade to %s plan to activate this feature!', 'visualizer' ), 'Plus' );
145 - if ( in_array( $feature, $biz_features, true ) && Visualizer_Module::is_pro() ) {
146 - $msg = $plus_msg;
135 + if ( empty( $feature ) || ( $feature == 'schedule-chart' && ! apply_filters( 'visualizer_is_business', false ) ) ) {
136 + $plan = 'PRO';
137 + if ( $feature === 'schedule-chart' ) {
138 + $plan = 'BUSINESS';
147 139 }
148 - if ( in_array( $feature, array( 'db-query', 'chart-permissions' ), true ) ) {
149 - $msg = $plus_msg;
150 - }
151 -
152 140 $return = '<div class="only-pro-content">';
153 141 $return .= ' <div class="only-pro-container">';
154 142 $return .= ' <div class="only-pro-inner">';
155 - $return .= ' <p>' . $msg . '</p>';
156 - if ( ! empty( $docs_url ) ) {
157 - $return .= ' <a target="_blank" href="' . esc_url( $docs_url ) . '" class="button button-secondary">' . esc_html__( 'Documentation', 'visualizer' ) . '</a>';
158 - }
159 - $return .= ' <a target="_blank" href="' . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, esc_attr( $feature ) ) . '" title="' . __( 'Upgrade Now', 'visualizer' ) . '" class="button button-primary">' . __( 'Upgrade Now', 'visualizer' ) . '</a>';
143 + $return .= ' <p>' . sprintf( __( 'Enable this feature in %s version!', 'visualizer' ), $plan ) . '</p>';
144 + $return .= ' <a target="_blank" href="' . Visualizer_Plugin::PRO_TEASER_URL . '" title="' . __( 'Buy now', 'visualizer' ) . '">' . __( 'Buy now', 'visualizer' ) . '</a>';
160 145 $return .= ' </div>';
161 146 $return .= ' </div>';
162 147 $return .= '</div>';
163 148 }
164 - if ( empty( $feature ) && Visualizer_Module::is_pro() ) {
149 + if ( empty( $feature ) && defined( 'VISUALIZER_PRO_VERSION' ) ) {
165 150 remove_filter( 'visualizer_pro_upsell', 'addProUpsell', 10, 1 );
166 151 $return = '';
167 152 }
168 153
@@ -167,5 +152,6 @@
167 152 }
168 153
169 154 return $return;
170 155 }
156 +
171 157 }