Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/visualizer/classes/Visualizer/Module/Frontend.php
+++ b/visualizer/classes/Visualizer/Module/Frontend.php
@@ -153,14 +153,25 @@
),
),
'permission_callback' => function ( WP_REST_Request $request ) {
- $chart_id = filter_var( sanitize_text_field( $request->get_param( 'chart' ), FILTER_VALIDATE_INT ) );
- if ( ! empty( $chart_id ) && in_array( $request->get_param( 'type' ), array( 'save', 'cancel' ), true ) ) {
- // let save and cancel go without any check as past version of pro
- // did not send the X-WP-Nonce
- // we can change this at a later date.
- return true;
+ $chart_id = absint( $request->get_param( 'chart' ) );
+ if ( ! $chart_id ) {
+ return false;
}
- return ! empty( $chart_id ) && apply_filters( 'visualizer_pro_show_chart', true, $chart_id );
+
+ $chart = get_post( $chart_id );
+ if ( ! $chart || Visualizer_Plugin::CPT_VISUALIZER !== $chart->post_type ) {
+ return false;
+ }
+
+ if ( in_array( $request->get_param( 'type' ), array( 'save', 'cancel' ), true ) ) {
+ return current_user_can( 'edit_post', $chart_id );
+ }
+
+ if ( 'publish' !== $chart->post_status ) {
+ return current_user_can( 'edit_post', $chart_id );
+ }
+
+ return apply_filters( 'visualizer_pro_show_chart', true, $chart_id );
},
'callback' => array( $this, 'perform_action' ),
)
--- a/visualizer/classes/Visualizer/Plugin.php
+++ b/visualizer/classes/Visualizer/Plugin.php
@@ -28,7 +28,7 @@
class Visualizer_Plugin {
const NAME = 'visualizer';
- const VERSION = '4.0.3';
+ const VERSION = '4.0.4';
// custom post types
const CPT_VISUALIZER = 'visualizer';
--- a/visualizer/index.php
+++ b/visualizer/index.php
@@ -3,7 +3,7 @@
Plugin Name: Visualizer: Tables and Charts for WordPress
Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs/
Description: Effortlessly create and embed responsive charts and tables with Visualizer, a powerful WordPress plugin that enhances data presentation from multiple sources.
- Version: 4.0.3
+ Version: 4.0.4
Author: Themeisle
Author URI: http://themeisle.com
License: GPL v2.0 or later
--- a/visualizer/vendor/codeinwp/themeisle-sdk/assets/js/build/about/about.asset.php
+++ b/visualizer/vendor/codeinwp/themeisle-sdk/assets/js/build/about/about.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('react', 'wp-components', 'wp-element'), 'version' => '8d9c74cada5a40e4082b');
+<?php return array('dependencies' => array('react', 'wp-components', 'wp-element'), 'version' => '33f2e4c85280a9cf0f4e');
--- a/visualizer/vendor/codeinwp/themeisle-sdk/load.php
+++ b/visualizer/vendor/codeinwp/themeisle-sdk/load.php
@@ -14,7 +14,7 @@
return;
}
// Current SDK version and path.
-$themeisle_sdk_version = '3.3.52';
+$themeisle_sdk_version = '3.3.54';
$themeisle_sdk_path = dirname( __FILE__ );
global $themeisle_sdk_max_version;
--- a/visualizer/vendor/codeinwp/themeisle-sdk/src/Loader.php
+++ b/visualizer/vendor/codeinwp/themeisle-sdk/src/Loader.php
@@ -268,6 +268,42 @@
'newsHeading' => 'Stay connected for news & updates!',
'emailPlaceholder' => 'Your email address',
'signMeUp' => 'Sign me up',
+ 'services' => [
+ 'ariaLabel' => 'Themeisle services',
+ 'trustpilotLabel' => 'Rated excellent on Trustpilot',
+ 'trustpilotRated' => 'Rated',
+ 'trustpilotOn' => 'on',
+ 'trustpilotBrand' => 'Trustpilot',
+ 'heading' => 'Expert WordPress services from the Themeisle team',
+ 'description' => 'Done for you by the same people who build your plugins and themes.',
+ 'cta' => 'Explore all services',
+ 'items' => [
+ 'websiteDesign' => [
+ 'title' => 'Website Design',
+ 'subtitle' => 'Built for your business',
+ ],
+ 'support' => [
+ 'title' => 'Support',
+ 'subtitle' => 'On-demand expert help',
+ ],
+ 'speed' => [
+ 'title' => 'Speed Optimization',
+ 'subtitle' => 'Core Web Vitals boost',
+ ],
+ 'seo' => [
+ 'title' => 'SEO Foundation',
+ 'subtitle' => 'Rank & get found',
+ ],
+ 'maintenance' => [
+ 'title' => 'Maintenance',
+ 'subtitle' => 'Updates, backups, security',
+ ],
+ 'hackedSite' => [
+ 'title' => 'Hacked Site Repair',
+ 'subtitle' => 'Malware removed fast',
+ ],
+ ],
+ ],
'installNow' => 'Install Now',
'activate' => 'Activate',
'learnMore' => 'Learn More',
--- a/visualizer/vendor/codeinwp/themeisle-sdk/src/Modules/About_us.php
+++ b/visualizer/vendor/codeinwp/themeisle-sdk/src/Modules/About_us.php
@@ -225,6 +225,7 @@
'newsHeading' => Loader::$labels['about_us']['newsHeading'],
'emailPlaceholder' => Loader::$labels['about_us']['emailPlaceholder'],
'signMeUp' => Loader::$labels['about_us']['signMeUp'],
+ 'services' => Loader::$labels['about_us']['services'],
'installNow' => Loader::$labels['about_us']['installNow'],
'activate' => Loader::$labels['about_us']['activate'],
'learnMore' => Loader::$labels['about_us']['learnMore'],
--- a/visualizer/vendor/codeinwp/themeisle-sdk/src/Modules/Dashboard_widget.php
+++ b/visualizer/vendor/codeinwp/themeisle-sdk/src/Modules/Dashboard_widget.php
@@ -123,6 +123,10 @@
}
?>
<style type="text/css">
+ #dashboard-widgets #themeisle .hndle {
+ padding-left: 39px;
+ }
+
#themeisle ul li.ti-dw-recommend-item {
padding-left: 7px;
border-top: 1px solid #eee;
@@ -135,7 +139,6 @@
background-repeat: no-repeat;
background-position: 2% 50%;
background-size: 25px;
- padding-left: 39px;
}
#themeisle .inside {
--- a/visualizer/vendor/codeinwp/themeisle-sdk/src/Modules/Promotions.php
+++ b/visualizer/vendor/codeinwp/themeisle-sdk/src/Modules/Promotions.php
@@ -209,7 +209,7 @@
add_filter( 'themeisle_sdk_ran_promos', '__return_true' );
if ( get_option( $this->option_neve, false ) !== true ) {
- add_action( 'wp_ajax_themeisle_sdk_dismiss_notice', 'ThemeisleSDKModulesNotification::regular_dismiss' );
+ add_action( 'wp_ajax_themeisle_sdk_dismiss_notice', 'ThemeisleSDKModulesNotification::dismiss' );
}
}
--- a/visualizer/vendor/codeinwp/themeisle-sdk/src/Modules/Uninstall_feedback.php
+++ b/visualizer/vendor/codeinwp/themeisle-sdk/src/Modules/Uninstall_feedback.php
@@ -139,7 +139,8 @@
?>
<div class="ti-theme-uninstall-feedback-drawer ti-feedback">
<div class="popup--header">
- <h5><?php echo wp_kses( $heading, array( 'span' => true ) ); ?> </h5>
+ <h5><?php echo wp_kses( $heading, array( 'span' => true ) ); ?></h5>
+ <?php $this->do_popup_header_after_heading_action( 'theme' ); ?>
<button class="toggle"><span>×</span></button>
</div><!--/.popup--header-->
<div class="popup--body">
@@ -485,6 +486,19 @@
}
/**
+ * Fires after the popup header heading, allowing products to output extra markup.
+ *
+ * @param string $context Popup context. Either `theme` or `plugin`.
+ */
+ private function do_popup_header_after_heading_action( $context ) {
+ do_action(
+ $this->product->get_key() . '_uninstall_feedback_popup_header_after_heading',
+ $this->product,
+ $context
+ );
+ }
+
+ /**
* Render the options list.
*
* @param array $options the options for the feedback form.
@@ -535,6 +549,7 @@
id="<?php echo esc_attr( $this->product->get_slug() . '_uninstall_feedback_popup' ); ?>">
<div class="popup--header">
<h5><?php echo wp_kses( Loader::$labels['uninstall']['heading_plugin'], array( 'span' => true ) ); ?> </h5>
+ <?php $this->do_popup_header_after_heading_action( 'plugin' ); ?>
</div><!--/.popup--header-->
<div class="popup--body">
<?php $this->render_options_list( $options ); ?>
@@ -581,13 +596,14 @@
(function ($) {
$(document).ready(function () {
var targetElement = 'tr[data-plugin^="<?php echo esc_attr( $this->product->get_slug() ); ?>/"] span.deactivate a';
- var redirectUrl = $(targetElement).attr('href');
+ var $deactivateLink = $(targetElement);
+ var redirectUrl = $deactivateLink.attr('href');
if ($('.ti-feedback-overlay').length === 0) {
$('body').prepend('<div class="ti-feedback-overlay"></div>');
}
- $('<?php echo esc_attr( $popup_id ); ?> ').appendTo($(targetElement).parent());
+ $('<?php echo esc_attr( $popup_id ); ?> ').appendTo($deactivateLink.parent());
- $(targetElement).on('click', function (e) {
+ $deactivateLink.on('click', function (e) {
e.preventDefault();
$('<?php echo esc_attr( $popup_id ); ?> ').addClass('active');
$('body').addClass('ti-feedback-open');
@@ -622,7 +638,7 @@
$('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-no').on('click', function (e) {
e.preventDefault();
e.stopPropagation();
- $(targetElement).unbind('click');
+ $deactivateLink.unbind('click');
$('body').removeClass('ti-feedback-open');
$('<?php echo esc_attr( $popup_id ); ?>').remove();
if (redirectUrl !== '') {
@@ -633,7 +649,7 @@
$('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').on('click', function (e) {
e.preventDefault();
e.stopPropagation();
- $(targetElement).unbind('click');
+ $deactivateLink.unbind('click');
var selectedOption = $(
'<?php echo esc_attr( $popup_id ); ?> input[name="ti-deactivate-option"]:checked');
var data = {
--- a/visualizer/vendor/composer/installed.php
+++ b/visualizer/vendor/composer/installed.php
@@ -1,9 +1,9 @@
<?php return array(
'root' => array(
'name' => 'codeinwp/visualizer',
- 'pretty_version' => 'v4.0.3',
- 'version' => '4.0.3.0',
- 'reference' => '68b4b8ca7bae72889cca17e7ba815506ef3dd0b8',
+ 'pretty_version' => 'v4.0.4',
+ 'version' => '4.0.4.0',
+ 'reference' => '4c379dcd85aad19f0dd628ac47368c031c164d2d',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -11,18 +11,18 @@
),
'versions' => array(
'codeinwp/themeisle-sdk' => array(
- 'pretty_version' => '3.3.52',
- 'version' => '3.3.52.0',
- 'reference' => 'd1ae68cbd4f84934b4d982e9eeff317b9f4c814a',
+ 'pretty_version' => '3.3.54',
+ 'version' => '3.3.54.0',
+ 'reference' => '095c2d0f1388af0b0196c492a7f79e2fd092dab1',
'type' => 'library',
'install_path' => __DIR__ . '/../codeinwp/themeisle-sdk',
'aliases' => array(),
'dev_requirement' => false,
),
'codeinwp/visualizer' => array(
- 'pretty_version' => 'v4.0.3',
- 'version' => '4.0.3.0',
- 'reference' => '68b4b8ca7bae72889cca17e7ba815506ef3dd0b8',
+ 'pretty_version' => 'v4.0.4',
+ 'version' => '4.0.4.0',
+ 'reference' => '4c379dcd85aad19f0dd628ac47368c031c164d2d',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),