Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/jeg-elementor-kit/class/assets/class-asset.php
+++ b/jeg-elementor-kit/class/assets/class-asset.php
@@ -155,6 +155,29 @@
'pro_banner' => pro_banner_popup_template(),
)
);
+
+ $editor_asset = JEG_ELEMENTOR_KIT_DIR . '/lib/dependencies/editor.asset.php';
+ $include = include $editor_asset;
+ wp_enqueue_script(
+ 'jkit-editor-bundle',
+ JEG_ELEMENTOR_KIT_URL . '/assets/js/editor/editor.js',
+ isset( $include['dependencies'] ) ? $include['dependencies'] : array(),
+ JEG_ELEMENTOR_KIT_VERSION,
+ true
+ );
+
+ // Minimal mirror for shared helpers used in editor bundle
+ $freemius_cfg = JegElementor_KitIntegrationsFreemius::instance()->get_pricing_config();
+ $editor_option = array(
+ 'freemius' => array( 'pricing' => $freemius_cfg ),
+ 'pricingPlan' => jkit_get_pricing_plan(),
+ 'imgDir' => JEG_ELEMENTOR_KIT_URL . '/assets/img/',
+ );
+ $mirror_js = $this->build_window_assignment_js( 'jkit.options.freemius', $editor_option['freemius'], false )
+ . $this->build_window_assignment_js( 'jkit.pricingPlan', $editor_option['pricingPlan'], false )
+ . $this->build_window_assignment_js( 'jkit.imgDir', $editor_option['imgDir'], false );
+ wp_add_inline_script( 'jkit-editor-bundle', $mirror_js );
+
}
/**
@@ -175,6 +198,21 @@
/** WP Admin Bar Style in Frontend */
if ( is_admin_bar_showing() ) {
wp_enqueue_style( 'jkit-admin', JEG_ELEMENTOR_KIT_URL . '/assets/css/admin/admin.css', array(), JEG_ELEMENTOR_KIT_VERSION );
+ wp_enqueue_script( 'jkit-admin', JEG_ELEMENTOR_KIT_URL . '/assets/js/admin/admin.js', array( 'lodash', 'react', 'react-dom', 'regenerator-runtime', 'wp-api-fetch', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-notices' ), JEG_ELEMENTOR_KIT_VERSION, true );
+
+ // Provide minimal dashboard options to frontend/admin-bar pages so shared modules
+ // (like the pricing modal) can access Freemius pricing config and related values.
+ $freemius_cfg = JegElementor_KitIntegrationsFreemius::instance()->get_pricing_config();
+ $frontend_option = array(
+ 'freemius' => array( 'pricing' => $freemius_cfg ),
+ 'pricingPlan' => jkit_get_pricing_plan(),
+ 'imgDir' => JEG_ELEMENTOR_KIT_URL . '/assets/img/',
+ );
+ // Mirror only the minimal fields into a safer namespace to avoid collisions
+ $mirror_js = $this->build_window_assignment_js( 'jkit.options.freemius', $frontend_option['freemius'], false )
+ . $this->build_window_assignment_js( 'jkit.pricingPlan', $frontend_option['pricingPlan'], false )
+ . $this->build_window_assignment_js( 'jkit.imgDir', $frontend_option['imgDir'], false );
+ wp_add_inline_script( 'jkit-admin', $mirror_js );
}
}
@@ -185,6 +223,19 @@
*/
public function load_admin_assets() {
wp_enqueue_style( 'jkit-admin', JEG_ELEMENTOR_KIT_URL . '/assets/css/admin/admin.css', array(), JEG_ELEMENTOR_KIT_VERSION );
+ wp_enqueue_script( 'jkit-admin', JEG_ELEMENTOR_KIT_URL . '/assets/js/admin/admin.js', array( 'lodash', 'react', 'react-dom', 'regenerator-runtime', 'wp-api-fetch', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-notices' ), JEG_ELEMENTOR_KIT_VERSION, true );
+
+ // Ensure JkitDashboardOption is available on admin pages where `jkit-admin` is loaded.
+ $admin_option = array(
+ 'freemius' => array( 'pricing' => JegElementor_KitIntegrationsFreemius::instance()->get_pricing_config() ),
+ 'pricingPlan' => jkit_get_pricing_plan(),
+ 'imgDir' => JEG_ELEMENTOR_KIT_URL . '/assets/img/',
+ );
+ // Mirror only the minimal fields into a safer namespace to avoid collisions
+ $mirror_js = $this->build_window_assignment_js( 'jkit.options.freemius', $admin_option['freemius'], false )
+ . $this->build_window_assignment_js( 'jkit.pricingPlan', $admin_option['pricingPlan'], false )
+ . $this->build_window_assignment_js( 'jkit.imgDir', $admin_option['imgDir'], false );
+ wp_add_inline_script( 'jkit-admin', $mirror_js );
}
/**
@@ -256,6 +307,37 @@
}
/**
+ * Build JavaScript snippet that ensures a nested `window` path exists and assigns a value.
+ *
+ * @param string $path Dot-separated path, e.g. 'jkit.options.freemius'.
+ * @param mixed $value Value to assign. If $raw is false the value is JSON-encoded.
+ * @param bool $raw Whether $value is a raw JS expression (true) or PHP value to json_encode (false).
+ *
+ * @return string JS code string (immediately-invoked function expression).
+ */
+ protected function build_window_assignment_js( $path, $value, $raw = false ) {
+ $parts = explode( '.', $path );
+ $acc = 'window';
+ $lines = array();
+ foreach ( $parts as $part ) {
+ $acc .= "['" . esc_js( $part ) . "']";
+ $lines[] = "if ( typeof {$acc} === 'undefined' ) { {$acc} = {}; }";
+ }
+
+ if ( $raw ) {
+ $val = $value;
+ } else {
+ $val = wp_json_encode( $value );
+ }
+
+ $assign = "{$acc} = {$val};";
+
+ $js = '(function(){' . implode( '', $lines ) . $assign . '})();';
+
+ return $js;
+ }
+
+ /**
* Add Jeg Element Kit Custom CSS
*
* @param object $post_css ElementorCoreDynamicTagsDynamic_CSS.
--- a/jeg-elementor-kit/class/elements/views/class-fun-fact-view.php
+++ b/jeg-elementor-kit/class/elements/views/class-fun-fact-view.php
@@ -32,7 +32,7 @@
$icon = 'none' !== $icon_type ? '<div class="icon elementor-animation-' . $icon_hover_animation . '">' . $this->render_icon() . '</div>' : '';
$output =
- '<div class=fun-fact-inner>' . $icon . '
+ '<div class=fun-fact-inner>' . $icon . '
<div class="content">
<div class="number-wrapper">' . $this->render_number() . '</div>
<' . $title_tag . ' class="title">' . $title . '</' . $title_tag . '>
@@ -68,8 +68,8 @@
private function render_number() {
$animation_duration = isset( $this->attribute['sg_setting_number_aniamtion_duration']['size'] ) ? esc_attr( $this->attribute['sg_setting_number_aniamtion_duration']['size'] ) : 3500;
$super = 'yes' === $this->attribute['sg_setting_enable_super'] ? '<sup class="super">' . esc_attr( $this->attribute['sg_content_super'] ) . '</sup>' : '';
- $prefix = '<span class="prefix">' . $this->attribute['sg_content_number_prefix'] . '</span>';
- $suffix = '<span class="suffix">' . $this->attribute['sg_content_number_suffix'] . '</span>';
+ $prefix = '<span class="prefix">' . esc_html( $this->attribute['sg_content_number_prefix'] ) . '</span>';
+ $suffix = '<span class="suffix">' . esc_html( $this->attribute['sg_content_number_suffix'] ) . '</span>';
return $prefix . '
<span class="number" data-value="' . esc_attr( $this->attribute['sg_content_number'] ) . '" data-animation-duration="' . $animation_duration . '">0</span>
--- a/jeg-elementor-kit/helper.php
+++ b/jeg-elementor-kit/helper.php
@@ -1672,9 +1672,9 @@
function jkit_get_pricing_plan() {
$data = get_transient( 'jkit_pricing_plan_cache' );
- // if ( $data ) {
- // return $data;
- // }
+ if ( $data ) {
+ return $data;
+ }
$response = wp_remote_request(
JEG_ELEMENT_SERVER_URL . 'wp-json/jkit-export/v1/pricingplan',
--- a/jeg-elementor-kit/jeg-elementor-kit.php
+++ b/jeg-elementor-kit/jeg-elementor-kit.php
@@ -4,14 +4,14 @@
* Plugin URI: https://jegkit.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
* Description: Jeg Kit for Elementor (formerly Jeg Elementor Kit) extends Elementor with powerful, customizable widgets and templates — helping you build modern, responsive WordPress websites faster.
* Requires Plugins: elementor
- * Version: 3.1.0
+ * Version: 3.1.1
* Author: Jegtheme
* Author URI: https://jegkit.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
* License: GPLv3
* Text Domain: jeg-elementor-kit
*
- * Elementor tested up to: 4.0.3
- * Elementor Pro tested up to: 4.0.2
+ * Elementor tested up to: 4.0.4
+ * Elementor Pro tested up to: 4.0.4
*
* @author Jegtheme
* @since 1.0.0
@@ -20,7 +20,7 @@
defined( 'JEG_ELEMENTOR_KIT' ) || define( 'JEG_ELEMENTOR_KIT', 'jeg-elementor-kit' );
defined( 'JEG_ELEMENTOR_KIT_NAME' ) || define( 'JEG_ELEMENTOR_KIT_NAME', 'Jeg Kit' );
-defined( 'JEG_ELEMENTOR_KIT_VERSION' ) || define( 'JEG_ELEMENTOR_KIT_VERSION', '3.1.0' );
+defined( 'JEG_ELEMENTOR_KIT_VERSION' ) || define( 'JEG_ELEMENTOR_KIT_VERSION', '3.1.1' );
defined( 'JEG_ELEMENTOR_KIT_URL' ) || define( 'JEG_ELEMENTOR_KIT_URL', plugins_url( JEG_ELEMENTOR_KIT ) );
defined( 'JEG_ELEMENTOR_KIT_FILE' ) || define( 'JEG_ELEMENTOR_KIT_FILE', __FILE__ );
defined( 'JEG_ELEMENTOR_KIT_BASE' ) || define( 'JEG_ELEMENTOR_KIT_BASE', plugin_basename( __FILE__ ) );
--- a/jeg-elementor-kit/lib/dependencies/admin.asset.php
+++ b/jeg-elementor-kit/lib/dependencies/admin.asset.php
@@ -0,0 +1 @@
+<?php return array('dependencies' => array('react-dom', 'regenerator-runtime', 'wp-element', 'wp-i18n'), 'version' => 'd497bd9977c9a93c2a80');
--- a/jeg-elementor-kit/lib/dependencies/dashboard.asset.php
+++ b/jeg-elementor-kit/lib/dependencies/dashboard.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'regenerator-runtime', 'wp-api-fetch', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '7bd8c32f8f2e450f9873');
+<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'regenerator-runtime', 'wp-api-fetch', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'e6dca4b38009304323a4');
--- a/jeg-elementor-kit/lib/dependencies/editor.asset.php
+++ b/jeg-elementor-kit/lib/dependencies/editor.asset.php
@@ -0,0 +1 @@
+<?php return array('dependencies' => array('react-dom', 'regenerator-runtime', 'wp-element', 'wp-i18n'), 'version' => '7b01efc7f21b31f1dc64');
--- a/jeg-elementor-kit/lib/dependencies/wizard.asset.php
+++ b/jeg-elementor-kit/lib/dependencies/wizard.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'regenerator-runtime', 'wp-api-fetch', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '7ee40d422b62e288ff6c');
+<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'regenerator-runtime', 'wp-api-fetch', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'e4e5ddfa0bcd57f2919f');