Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/ultimate-post-kit/admin/admin-biggopti.php
+++ b/ultimate-post-kit/admin/admin-biggopti.php
@@ -34,14 +34,6 @@
* @return array|mixed
*/
private function get_api_biggopties_data() {
-
- // 6-hour transient cache for API response
- $transient_key = 'bdt_api_biggopties';
- $cached = get_transient($transient_key);
- if ($cached !== false && is_array($cached)) {
- return $cached;
- }
-
// API endpoint for biggopties - you can change this to your actual endpoint
$api_url = 'https://api.sigmative.io/prod/store/api/biggopti/api-data-records';
@@ -63,8 +55,6 @@
if( isset($biggopties) && isset($biggopties->{'ultimate-post-kit'}) ) {
$data = $biggopties->{'ultimate-post-kit'};
if (is_array($data)) {
- $ttl = apply_filters('bdt_api_biggopties_cache_ttl', 6 * HOUR_IN_SECONDS);
- set_transient($transient_key, $data, $ttl);
return $data;
}
}
@@ -312,23 +302,41 @@
wp_send_json_error([ 'message' => 'forbidden' ]);
}
+ // Don't show biggopties on plugin/theme install and upload pages
+ $current_url = isset($_POST['current_url']) ? sanitize_text_field($_POST['current_url']) : '';
+
+ if (!empty($current_url)) {
+ $excluded_patterns = [
+ 'plugin-install.php',
+ 'theme-install.php',
+ 'action=upload-plugin',
+ 'action=upload-theme'
+ ];
+
+ foreach ($excluded_patterns as $pattern) {
+ if (strpos($current_url, $pattern) !== false) {
+ wp_send_json_success([ 'html' => '' ]);
+ }
+ }
+ }
+
$biggopties = $this->get_api_biggopties_data();
$grouped_biggopties = [];
if (is_array($biggopties)) {
foreach ($biggopties as $index => $biggopti) {
if ($this->should_show_biggopti($biggopti)) {
- $biggopti_class = isset($biggopti->biggopti_class) ? $biggopti->biggopti_class : 'default-' . $index;
- if (!isset($grouped_biggopties[$biggopti_class])) {
- $grouped_biggopties[$biggopti_class] = $biggopti;
+ $display_id = isset($biggopti->display_id) ? $biggopti->display_id : 'default-' . $index;
+ if (!isset($grouped_biggopties[$display_id])) {
+ $grouped_biggopties[$display_id] = $biggopti;
}
}
}
}
// Build biggopties using the same pipeline as synchronous rendering
- foreach ($grouped_biggopties as $biggopti_class => $biggopti) {
- $biggopti_id = isset($biggopti->id) ? $biggopti_class : $biggopti->id;
+ foreach ($grouped_biggopties as $display_id => $biggopti) {
+ $biggopti_id = isset($biggopti->id) ? $display_id : $biggopti->id;
self::add_biggopti([
'id' => 'api-biggopti-' . $biggopti_id,
@@ -374,6 +382,14 @@
update_user_meta(get_current_user_id(), $id, true);
} else {
set_transient($id, true, $time);
+
+ // Also store in options table for persistence
+ $dismissals_option = get_option('bdt_biggopti_dismissals', []);
+ $dismissals_option[$id] = [
+ 'dismissed_at' => time(),
+ 'expires_at' => time() + intval($time),
+ ];
+ update_option('bdt_biggopti_dismissals', $dismissals_option, false);
}
wp_send_json_success();
@@ -444,6 +460,22 @@
$expired = get_user_meta(get_current_user_id(), $biggopti_id, true);
} elseif ('transient' === $biggopti['dismissible-meta']) {
$expired = get_transient($biggopti_id);
+
+ // If transient not found, check options table for persistent dismissal
+ if (false === $expired || empty($expired)) {
+ $dismissals_option = get_option('bdt_biggopti_dismissals', []);
+ if (isset($dismissals_option[$biggopti_id])) {
+ $dismissal = $dismissals_option[$biggopti_id];
+ // Check if dismissal is still valid (not expired)
+ if (isset($dismissal['expires_at']) && time() < $dismissal['expires_at']) {
+ $expired = true;
+ } else {
+ // Clean up expired dismissal from options
+ unset($dismissals_option[$biggopti_id]);
+ update_option('bdt_biggopti_dismissals', $dismissals_option, false);
+ }
+ }
+ }
}
// Biggopties visible after transient expire.
--- a/ultimate-post-kit/includes/setup-wizard/init.php
+++ b/ultimate-post-kit/includes/setup-wizard/init.php
@@ -412,9 +412,14 @@
add_action('wp_ajax_import_elementor_template', function () {
check_ajax_referer( 'setup_wizard_nonce', 'nonce' );
+ if ( ! current_user_can( 'manage_options' ) ) {
+ wp_send_json_error( array( 'message' => esc_html__( 'Unauthorized', 'ultimate-post-kit' ) ) );
+ wp_die();
+ }
+
$json_url = isset( $_POST['import_url'] ) ? esc_url_raw( wp_unslash( $_POST['import_url'] ) ) : '';
- $response = wp_remote_get($json_url, array(
+ $response = wp_safe_remote_get($json_url, array(
'timeout' => 60,
'sslverify' => false
));
@@ -502,6 +507,11 @@
add_action('wp_ajax_import_upk_elementor_bundle_template', function () {
check_ajax_referer('setup_wizard_nonce', 'nonce');
+ if ( ! current_user_can( 'manage_options' ) ) {
+ wp_send_json_error( array( 'message' => esc_html__( 'Unauthorized', 'ultimate-post-kit' ) ) );
+ wp_die();
+ }
+
$file_url = isset($_POST['import_url']) ? esc_url_raw(wp_unslash($_POST['import_url'])) : '';
if (!filter_var($file_url, FILTER_VALIDATE_URL) || 0 !== strpos($file_url, 'http')) {
@@ -592,6 +602,11 @@
add_action('wp_ajax_import_upk_elementor_bundle_runner_template', function () {
check_ajax_referer('setup_wizard_nonce', 'nonce');
+ if ( ! current_user_can( 'manage_options' ) ) {
+ wp_send_json_error( array( 'message' => esc_html__( 'Unauthorized', 'ultimate-post-kit' ) ) );
+ wp_die();
+ }
+
$runner = isset($_POST['runner']) ? sanitize_text_field(wp_unslash($_POST['runner'])) : '';
$sessionId = isset($_POST['sessionId']) ? sanitize_text_field(wp_unslash($_POST['sessionId'])) : '';
--- a/ultimate-post-kit/ultimate-post-kit.php
+++ b/ultimate-post-kit/ultimate-post-kit.php
@@ -4,14 +4,14 @@
* Plugin Name: Ultimate Post Kit
* Plugin URI: https://postkit.pro/
* Description: <a href="https://postkit.pro/">Ultimate Post Kit</a> is a packed of post related elementor widgets. This plugin gives you post related widget features for elementor page builder plugin.
- * Version: 4.0.21
+ * Version: 4.0.22
* Author: BdThemes
* Author URI: https://bdthemes.com/
* Text Domain: ultimate-post-kit
* Domain Path: /languages
* License: GPL3
* Elementor requires at least: 3.28
- * Elementor tested up to: 3.34.0
+ * Elementor tested up to: 3.34.1
*/
if ( ! defined( 'ABSPATH' ) ) {
@@ -19,7 +19,7 @@
}
// Some pre define value for easy use
-define( 'BDTUPK_VER', '4.0.21' );
+define( 'BDTUPK_VER', '4.0.22' );
define( 'BDTUPK__FILE__', __FILE__ );
/**