From fe7e27e71b3cd9791c73722a68a5402f20df5ff5 Mon Sep 17 00:00:00 2001 From: Hardeep Asrani Date: Mon, 16 Mar 2026 11:59:29 +0530 Subject: [PATCH 1/6] fix: pro upsell appearing in plugin meta even when pro is there --- classes/Visualizer/Module/Admin.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/classes/Visualizer/Module/Admin.php b/classes/Visualizer/Module/Admin.php index 02a3f16d..aafd012d 100644 --- a/classes/Visualizer/Module/Admin.php +++ b/classes/Visualizer/Module/Admin.php @@ -1163,6 +1163,20 @@ public function getPluginActionLinks( $links, $file ) { * @return array Updated array of plugin meta links. */ public function getPluginMetaLinks( $plugin_meta, $plugin_file ) { + if ( Visualizer_Module::is_pro() ) { + return $plugin_meta; + } + + // Also suppress the upsell when Pro is installed but not currently active. + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + foreach ( array_keys( get_plugins() ) as $installed_plugin ) { + if ( false !== strpos( $installed_plugin, 'visualizer-pro' ) ) { + return $plugin_meta; + } + } + if ( $plugin_file === plugin_basename( VISUALIZER_BASEFILE ) ) { // knowledge base link $plugin_meta[] = sprintf( From 03ab7b04c11a956bbe84cd048f9a47bcf94f5c1f Mon Sep 17 00:00:00 2001 From: Hardeep Asrani Date: Mon, 16 Mar 2026 12:45:15 +0530 Subject: [PATCH 2/6] fix: some charts showing up as available for free --- classes/Visualizer/Module/Admin.php | 30 +++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/classes/Visualizer/Module/Admin.php b/classes/Visualizer/Module/Admin.php index aafd012d..eeb9b456 100644 --- a/classes/Visualizer/Module/Admin.php +++ b/classes/Visualizer/Module/Admin.php @@ -1194,15 +1194,37 @@ public function getPluginMetaLinks( $plugin_meta, $plugin_file ) { } /** - * If check is existing user. + * Returns true when premium chart types should be enabled for the current user. * - * @return bool Default false + * Pro 1.9.0+ hooks the 'visualizer_is_pro' filter and returns true only when + * the license is valid. Pre-1.9.0 Pro defined a Visualizer_Pro class instead; + * we detect that as a fallback so those legacy installs still work. + * + * Passing false as the filter default ensures the constant VISUALIZER_PRO + * (which is set to true whenever the Pro class exists, regardless of license + * state) cannot bypass the license check. + * + * @return bool */ public static function proFeaturesLocked() { - if ( Visualizer_Module::is_pro() ) { + $is_pro_filter = apply_filters( 'visualizer_is_pro', false ); + + // Pro 1.9.0+: filter is hooked and returns true only with a valid license. + if ( $is_pro_filter ) { return true; } - return 'yes' === get_option( 'visualizer-new-user', 'yes' ) ? false : true; + + // Pro is installed (active) but the license check above did not pass. + // Do NOT fall through to the legacy "old user" path — that path exists + // only for sites that never had Pro installed. If Pro is present but + // the license is inactive we should lock, regardless of chart history. + if ( class_exists( 'Visualizer_Pro', false ) ) { + return false; + } + + // No Pro installed at all: grant legacy access to existing users so + // their charts are not suddenly broken when they upgrade the free plugin. + return 'yes' === get_option( 'visualizer-new-user' ) ? false : true; } /** From 2f460943734a498ca913b2260dbbb28a309d539d Mon Sep 17 00:00:00 2001 From: Hardeep Asrani Date: Mon, 16 Mar 2026 12:58:53 +0530 Subject: [PATCH 3/6] fix: rate it not always visible --- classes/Visualizer/Module/Admin.php | 2 +- classes/Visualizer/Render/Page/Data.php | 4 +--- css/frame.css | 13 ++++++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/classes/Visualizer/Module/Admin.php b/classes/Visualizer/Module/Admin.php index eeb9b456..7149892a 100644 --- a/classes/Visualizer/Module/Admin.php +++ b/classes/Visualizer/Module/Admin.php @@ -113,7 +113,7 @@ public function render_review_notice( $footer_text ) { __( 'Enjoying %1$s? %2$s %3$s rating. Thank you for being so supportive!', 'visualizer' ), 'Visualizer', esc_html__( 'You can help us by leaving a', 'visualizer' ), - '★★★★★' + '★★★★★' ); break; } diff --git a/classes/Visualizer/Render/Page/Data.php b/classes/Visualizer/Render/Page/Data.php index 6730db0b..9ad6b236 100644 --- a/classes/Visualizer/Render/Page/Data.php +++ b/classes/Visualizer/Render/Page/Data.php @@ -108,9 +108,7 @@ protected function _renderSidebarContent() {