From 5578a9993eea3e293ff46bcca296e299a61b9f35 Mon Sep 17 00:00:00 2001 From: Leo Fajardo Date: Wed, 24 Jun 2026 22:32:35 +0800 Subject: [PATCH 1/2] Improve checkout manager params. (#869) --- includes/managers/class-fs-checkout-manager.php | 2 +- start.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/managers/class-fs-checkout-manager.php b/includes/managers/class-fs-checkout-manager.php index 359bc25e..5cde3e37 100644 --- a/includes/managers/class-fs-checkout-manager.php +++ b/includes/managers/class-fs-checkout-manager.php @@ -187,7 +187,7 @@ public function get_query_params( Freemius $fs, $plugin_id, $plan_id, $licenses // Allowlist only allowed query params. $filtered_params = array_intersect_key($filtered_params, $this->_allowed_custom_params); - return array_merge( $context_params, $filtered_params, $_GET, array( + return array_merge( $_GET, $context_params, $filtered_params, array( // Current plugin version. 'plugin_version' => $fs->get_plugin_version(), 'sdk_version' => WP_FS__SDK_VERSION, diff --git a/start.php b/start.php index f5664c45..d5d355df 100644 --- a/start.php +++ b/start.php @@ -15,7 +15,7 @@ * * @var string */ - $this_sdk_version = '2.13.2'; + $this_sdk_version = '2.13.2.1'; #region SDK Selection Logic -------------------------------------------------------------------- From e7c0084dcf6e742d17401e2c8f6f9ee545461c8d Mon Sep 17 00:00:00 2001 From: Daniele Alessandra Date: Thu, 25 Jun 2026 00:09:07 +0200 Subject: [PATCH 2/2] no message --- start.php | 51 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/start.php b/start.php index d5d355df..efe60fc3 100644 --- a/start.php +++ b/start.php @@ -93,20 +93,43 @@ function_exists( 'wp_is_json_request' ) && $themes_directory = fs_normalize_path( get_theme_root( get_stylesheet() ) ); $themes_directory_name = basename( $themes_directory ); - // This change ensures that the condition works even if the SDK is located in a subdirectory (e.g., vendor) - $theme_candidate_sdk_basename = str_replace( $themes_directory . '/' . get_stylesheet() . '/', '', $fs_root_path ); - - // Check if the current file is part of the active theme. - $is_current_sdk_from_active_theme = $file_path == $themes_directory . '/' . get_stylesheet() . '/' . $theme_candidate_sdk_basename . '/' . basename( $file_path ); - $is_current_sdk_from_parent_theme = false; - - // Check if the current file is part of the parent theme. - if ( ! $is_current_sdk_from_active_theme ) { - $theme_candidate_sdk_basename = str_replace( $themes_directory . '/' . get_template() . '/', - '', - $fs_root_path ); - $is_current_sdk_from_parent_theme = $file_path == $themes_directory . '/' . get_template() . '/' . $theme_candidate_sdk_basename . '/' . basename( $file_path ); - } + $active_theme_directory = fs_normalize_path( $themes_directory . '/' . get_stylesheet() ); + $active_theme_realpath = fs_normalize_path( realpath( $active_theme_directory ) ); + if ( ! $active_theme_realpath ) { + $active_theme_realpath = $active_theme_directory; + } + + $parent_theme_directory = fs_normalize_path( $themes_directory . '/' . get_template() ); + $parent_theme_realpath = fs_normalize_path( realpath( $parent_theme_directory ) ); + if ( ! $parent_theme_realpath ) { + $parent_theme_realpath = $parent_theme_directory; + } + + $file_path_real = fs_normalize_path( realpath( $file_path ) ); + if ( ! $file_path_real ) { + $file_path_real = $file_path; + } + + $fs_root_path_real = fs_normalize_path( realpath( $fs_root_path ) ); + if ( ! $fs_root_path_real ) { + $fs_root_path_real = $fs_root_path; + } + + $theme_candidate_sdk_basename = ''; + $is_current_sdk_from_active_theme = false; + $is_current_sdk_from_parent_theme = false; + + // Check if the current file is part of the active theme. + if ( 0 === strpos( $fs_root_path_real, $active_theme_realpath . '/' ) ) { + $theme_candidate_sdk_basename = substr( $fs_root_path_real, strlen( $active_theme_realpath ) + 1 ); + $is_current_sdk_from_active_theme = ( $file_path_real === $active_theme_realpath . '/' . $theme_candidate_sdk_basename . '/' . basename( $file_path ) ); + } + + // Check if the current file is part of the parent theme. + if ( ! $is_current_sdk_from_active_theme && 0 === strpos( $fs_root_path_real, $parent_theme_realpath . '/' ) ) { + $theme_candidate_sdk_basename = substr( $fs_root_path_real, strlen( $parent_theme_realpath ) + 1 ); + $is_current_sdk_from_parent_theme = ( $file_path_real === $parent_theme_realpath . '/' . $theme_candidate_sdk_basename . '/' . basename( $file_path ) ); + } $theme_name = null; if ( $is_current_sdk_from_active_theme ) {