PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.11.10
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.11.10
4.0.8 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 All 149 releases
← All changes | vendor/codeinwp/themeisle-sdk/load.php +81 -15 3.10.33.11.10 View file →
@@ -13,9 +13,9 @@
13 13 if ( ! defined( 'ABSPATH' ) ) {
14 14 return;
15 15 }
16 16 // Current SDK version and path.
17 -$themeisle_sdk_version = '3.3.0';
17 +$themeisle_sdk_version = '3.3.44';
18 18 $themeisle_sdk_path = dirname( __FILE__ );
19 19
20 20 global $themeisle_sdk_max_version;
21 21 global $themeisle_sdk_max_path;
@@ -89,10 +89,11 @@
89 89 $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : $pagenow;
90 90 $current_page = isset( $screen->id ) ? $screen->id : ( ( $screen === null ) ? 'non-admin' : $screen );
91 91 $current_page = sanitize_key( str_replace( '.php', '', $current_page ) );
92 92 }
93 - $location = $location === null ? $current_page : $location;
94 - $content = sanitize_key(
93 + $location = $location === null ? $current_page : $location;
94 + $is_upgrade_url = strpos( $url, '/upgrade' ) !== false;
95 + $content = sanitize_key(
95 96 trim(
96 97 str_replace(
97 98 [
98 99 'https://',
@@ -101,24 +102,49 @@
101 102 '/plugins/',
102 103 '/upgrade',
103 104 ],
104 105 '',
105 - $url
106 + $url
106 107 ),
107 - '/'
108 - )
108 + '/'
109 + )
109 110 );
110 - return esc_url_raw(
111 + $filter_key = sanitize_key( $content );
112 + $url_args = [
113 + 'utm_source' => 'wpadmin',
114 + 'utm_medium' => $location,
115 + 'utm_campaign' => $area,
116 + 'utm_content' => $content,
117 + ];
118 + $query_arguments = apply_filters( 'tsdk_utmify_' . $filter_key, $url_args, $url );
119 + $utmify_url = esc_url_raw(
111 120 add_query_arg(
112 - [
113 - 'utm_source' => 'wpadmin',
114 - 'utm_medium' => $location,
115 - 'utm_campaign' => $area,
116 - 'utm_content' => $content,
117 - ],
118 - $url
119 - )
121 + $query_arguments,
122 + $url
123 + )
120 124 );
125 +
126 + /**
127 + * Check if there is an affiliate URL for this upgrade link, if so use it.
128 + */
129 + if ( $is_upgrade_url ) {
130 + $option_content_key = str_replace( '-', '_', $filter_key );
131 + $theme_upgrade_option_name = 'themeisle_af_' . $option_content_key . '_themes_upgrade';
132 + $plugin_upgrade_option_name = 'themeisle_af_' . $option_content_key . '_plugins_upgrade';
133 +
134 + $theme_option_url = get_option( $theme_upgrade_option_name, false );
135 + if ( ! empty( $theme_option_url ) ) {
136 + $utmify_url = esc_url_raw( $theme_option_url );
137 + }
138 + $plugin_option_url = get_option( $plugin_upgrade_option_name, false );
139 + if ( ! empty( $plugin_option_url ) ) {
140 + $utmify_url = esc_url_raw( $plugin_option_url );
141 + }
142 + }
143 +
144 +
145 +
146 + return apply_filters( 'tsdk_utmify_url_' . $filter_key, $utmify_url, $url );
121 147 }
122 148
123 149 add_filter( 'tsdk_utmify', 'tsdk_utmify', 10, 3 );
124 150 }
@@ -170,8 +196,48 @@
170 196 * @return string Key.
171 197 */
172 198 function tsdk_lkey( $file ) {
173 199 return \ThemeisleSDK\Modules\Licenser::key( $file );
200 + }
201 +}
202 +
203 +if ( ! function_exists( 'tsdk_translate_link' ) ) {
204 +
205 + /**
206 + * Function to translate a link based on the current language.
207 + *
208 + * @param string $url URL to translate.
209 + * @param string{'path'|'query'|'domain'} $type Type of localization. Supports path, query and domain.
210 + * @param array $available_languages Available language to choose from.
211 + *
212 + * @return string
213 + */
214 + function tsdk_translate_link(
215 + $url, $type = 'path', $available_languages = [
216 + 'de_DE' => 'de',
217 + 'de_DE_formal' => 'de',
218 + ]
219 + ) {
220 + $language = get_user_locale();
221 + if ( ! isset( $available_languages[ $language ] ) ) {
222 + return $url;
223 + }
224 + $code = $available_languages[ $language ];
225 + // We asume that false is based on query and add the code via query arg.
226 + if ( $type === 'query' ) {
227 + return add_query_arg( 'lang', $code, $url );
228 + }
229 +
230 + $parsed_url = wp_parse_url( $url );
231 + // we replace the domain here based on the localized one.
232 + if ( $type === 'domain' ) {
233 + return $parsed_url['scheme'] . '://' . $code . ( isset( $parsed_url['path'] ) ? $parsed_url['path'] : '' ) . ( isset( $parsed_url['query'] ) ? '?' . $parsed_url['query'] : '' ) . ( isset( $parsed_url['fragment'] ) ? '#' . $parsed_url['fragment'] : '' );
234 + }
235 + // default is the path based approach.
236 + $new_path = isset( $parsed_url['path'] ) ? "/$code" . $parsed_url['path'] : "/$code";
237 +
238 + return $parsed_url['scheme'] . '://' . $parsed_url['host'] . $new_path . ( isset( $parsed_url['query'] ) ? '?' . $parsed_url['query'] : '' ) . ( isset( $parsed_url['fragment'] ) ? '#' . $parsed_url['fragment'] : '' );
239 +
174 240 }
175 241 }
176 242 if ( ! function_exists( 'tsdk_support_link' ) ) {
177 243