PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 3.6.0
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v3.6.0
3.6.0 3.5.3 3.5.2 3.5.1 3.5.0 3.4.8 3.4.7 3.4.6 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5.1 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.6.1 1.6.7 1.7.0 1.7.0.1 1.7.0.2 1.7.0.3 1.7.1 1.7.2 1.7.2.1 1.7.2.2 1.7.3 1.7.4 1.7.5 1.7.5.1 1.7.5.2 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.8.0 1.8.0.1 1.8.1 1.8.2 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.0.1 1.9.1 1.9.2 1.9.3 1.9.4 1.9.4.1 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.0.1 2.0.1 2.0.2 2.0.3 2.0.3.1 2.0.4 2.0.4.1 2.0.5 2.0.6 2.0.7 2.0.8 2.0.8.1 2.0.9 3.0.0 3.0.0.1 3.0.1 3.0.2 3.0.3 3.0.3.1 3.0.4 3.0.4.1 3.0.4.2 3.0.5 3.0.5.1 3.0.5.2 3.0.6 3.0.6.1 3.0.7.1 3.0.8 3.0.8.1 3.0.9 3.0.9.1 3.0.9.2 3.0.9.3 3.0.9.4 3.0.9.5 3.1.0 3.1.1 3.1.2 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.3.0 3.4.0 3.4.1 3.4.2 3.4.2.1 3.4.3 3.4.4 3.4.5 trunk 1.0 1.0.1 1.0.2 1.0.3
everest-forms / vendor / themegrill / themegrill-sdk / load.php
everest-forms / vendor / themegrill / themegrill-sdk Last commit date
assets 5 months ago src 1 month ago LICENSE 6 months ago composer.json 1 month ago index.php 6 months ago load.php 1 month ago start.php 1 month ago
load.php
118 lines
1 <?php
2 /**
3 * Loader for the ThemeGrillSDK
4 *
5 * Logic for loading always the latest SDK from the installed themes/plugins.
6 *
7 * @package ThemeGrillSDK
8 * @copyright Copyright (c) 2025, ThemeGrill
9 * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
10 * @since 1.0.0
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 return;
15 }
16
17 // Current SDK version and path.
18 $themegrill_sdk_version = '1.0.4';
19 $themegrill_sdk_path = __DIR__;
20
21 global $themegrill_sdk_max_version;
22 global $themegrill_sdk_max_path;
23
24 if (
25 ( is_null( $themegrill_sdk_max_path ) ||
26 version_compare( $themegrill_sdk_version, $themegrill_sdk_max_version ) === 0 ) &&
27 apply_filters( 'themegrill_sdk_should_overwrite_path', false, $themegrill_sdk_path, $themegrill_sdk_max_path )
28 ) {
29 $themegrill_sdk_max_path = $themegrill_sdk_path;
30 }
31
32 if (
33 is_null( $themegrill_sdk_max_version ) ||
34 version_compare( $themegrill_sdk_version, $themegrill_sdk_max_version ) > 0
35 ) {
36 $themegrill_sdk_max_version = $themegrill_sdk_version;
37 $themegrill_sdk_max_path = $themegrill_sdk_path;
38 }
39
40 // Load the latest sdk version from the active ThemeGrill products.
41 if ( ! function_exists( 'themegrill_sdk_load_latest' ) ) :
42 /**
43 * Always load the latest sdk version.
44 */
45 function themegrill_sdk_load_latest() {
46 /**
47 * Don't load the library if we are on < 7.2.24.
48 */
49 if ( version_compare( PHP_VERSION, '7.2.24', '<' ) ) {
50 return;
51 }
52 global $themegrill_sdk_max_path;
53 require_once $themegrill_sdk_max_path . '/start.php';
54 }
55 endif;
56
57 add_action( 'init', 'themegrill_sdk_load_latest' );
58
59
60 if ( ! function_exists( 'tgsdk_utmify' ) ) {
61 /**
62 * Utmify a link.
63 *
64 * @param string $url URL to add utms.
65 * @param string $area Area in page where this is used ( CTA, image, section name).
66 * @param string $location Location, such as customizer, about page.
67 *
68 * @return string
69 */
70 function tgsdk_utmify( $url, $area, $location = null ) {
71 static $current_page = null;
72 if ( $location === null && $current_page === null ) {
73 global $pagenow;
74 $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : $pagenow;
75 $current_page = isset( $screen->id ) ? $screen->id : ( ( $screen === null ) ? 'non-admin' : $screen );
76 $current_page = sanitize_key( str_replace( '.php', '', $current_page ) );
77 }
78 $location = $location === null ? $current_page : $location;
79 $content = sanitize_key(
80 trim(
81 str_replace(
82 apply_filters(
83 'tgsdk_utmify_replace',
84 [
85 'https://',
86 'themegrill.com',
87 '/themes/',
88 '/plugins/',
89 '/upgrade',
90 ]
91 ),
92 '',
93 $url
94 ),
95 '/'
96 )
97 );
98 $filter_key = sanitize_key( $content );
99 $url_args = [
100 'utm_source' => 'wpadmin',
101 'utm_medium' => $location,
102 'utm_campaign' => $area,
103 'utm_content' => $content,
104 ];
105 $query_arguments = apply_filters( 'tgsdk_utmify_' . $filter_key, $url_args, $url );
106 $utmify_url = esc_url_raw(
107 add_query_arg(
108 $query_arguments,
109 $url
110 )
111 );
112
113 return apply_filters( 'tgsdk_utmify_url_' . $filter_key, $utmify_url, $url );
114 }
115
116 add_filter( 'tgsdk_utmify', 'tgsdk_utmify', 10, 3 );
117 }
118