Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/primary-addon-for-elementor/elementor/lib/lib.php
+++ b/primary-addon-for-elementor/elementor/lib/lib.php
@@ -10,19 +10,69 @@
}
if ( ! function_exists( 'prim_insert_elementor' ) ) {
- function prim_insert_elementor($atts){
- if (!class_exists('ElementorPlugin')){
- return '';
- }
- if (!isset($atts['id']) || empty($atts['id'])){
- return '';
- }
-
- $post_id = $atts['id'];
- $response = Plugin::instance()->frontend->get_builder_content_for_display($post_id);
- return $response;
- }
- add_shortcode('prim_elementor_template','Elementorprim_insert_elementor');
+ function prim_insert_elementor($atts) {
+ // Check if Elementor exists
+ if (!class_exists('ElementorPlugin')) {
+ return '';
+ }
+
+ // Validate shortcode attributes
+ if (!isset($atts['id']) || empty($atts['id'])) {
+ return '';
+ }
+
+ $post_id = absint($atts['id']); // Sanitize the ID
+
+ // Get the post
+ $post = get_post($post_id);
+ if (!$post) {
+ return '';
+ }
+
+ // Security checks
+ if (!is_user_logged_in()) {
+ // For non-logged in users, only show published posts
+ if ($post->post_status !== 'publish') {
+ return '';
+ }
+ } else {
+ // For logged-in users, check proper permissions
+ if (!current_user_can('read_post', $post_id)) {
+ return '';
+ }
+
+ // Additional status checks
+ $allowed_statuses = array('publish');
+
+ // Allow draft/private viewing only for editors and admins
+ if (current_user_can('edit_posts')) {
+ $allowed_statuses[] = 'draft';
+ $allowed_statuses[] = 'private';
+ }
+
+ if (!in_array($post->post_status, $allowed_statuses)) {
+ return '';
+ }
+ }
+
+ // Verify post type supports Elementor
+ if (!current_theme_supports('elementor') &&
+ !in_array($post->post_type, get_post_types_by_support('elementor'))) {
+ return '';
+ }
+
+ // Get Elementor content with proper error handling
+ try {
+ $response = Plugin::instance()->frontend->get_builder_content_for_display($post_id);
+ return $response;
+ } catch (Exception $e) {
+ if (current_user_can('manage_options')) {
+ return sprintf('Elementor error: %s', esc_html($e->getMessage()));
+ }
+ return '';
+ }
+ }
+ add_shortcode('prim_elementor_template', 'prim_insert_elementor');
}
if ( !class_exists('NAPAE_Controls_Helper_Output') ){
--- a/primary-addon-for-elementor/elementor/widgets/basic/nabasic-about-me.php
+++ b/primary-addon-for-elementor/elementor/widgets/basic/nabasic-about-me.php
@@ -846,7 +846,7 @@
$title_link = $aboutme_title_link ? '<a href="'.esc_url($aboutme_title_link).'" '.$aboutme_title_link_attr.'>'.esc_html($aboutme_title).'</a>' : esc_html($aboutme_title);
$title = $aboutme_title ? '<h3 class="aboutme-title">'.$title_link.'</h3>' : '';
$subtitle = $aboutme_subtitle ? '<h5>'.esc_html($aboutme_subtitle).'</h5>' : '';
- $content = $aboutme_content ? $aboutme_content : '';
+ $content = $aboutme_content ? esc_textarea( $aboutme_content ) : '';
$aboutme_btn = $aboutme_btn_link ? '<div class="napae-btn-wrap"><a href="'.esc_url($aboutme_btn_link).'" class="napae-btn" '.$aboutme_btn_link_attr.'>'.esc_html($aboutme_btn_text).'</a></div>' : '';
$output = '<div class="napae-aboutme-item zoom-image">
--- a/primary-addon-for-elementor/elementor/widgets/basic/nabasic-about-us.php
+++ b/primary-addon-for-elementor/elementor/widgets/basic/nabasic-about-us.php
@@ -783,7 +783,7 @@
$aboutus_btn_link_nofollow = !empty( $settings['aboutus_btn_link']['nofollow'] ) ? 'rel="nofollow"' : '';
$aboutus_btn_link_attr = !empty( $aboutus_btn_link ) ? $aboutus_btn_link_external.' '.$aboutus_btn_link_nofollow : '';
$btn_icon = !empty( $settings['btn_icon'] ) ? $settings['btn_icon'] : '';
- $btn_icon = $btn_icon ? ' <i class="'.esc_attr($btn_icon).'"></i>' : '';
+ $btn_icon = $btn_icon ? ' <i class="'.esc_attr($btn_icon).'"></i>' : '';
$listItems_groups = !empty( $settings['listItems_groups'] ) ? $settings['listItems_groups'] : '';
$toggle_align = !empty( $settings['toggle_align'] ) ? $settings['toggle_align'] : '';
$aboutus_sign_image = !empty( $settings['aboutus_sign_image']['id'] ) ? $settings['aboutus_sign_image']['id'] : '';
--- a/primary-addon-for-elementor/elementor/widgets/basic/nabasic-blog.php
+++ b/primary-addon-for-elementor/elementor/widgets/basic/nabasic-blog.php
@@ -1342,26 +1342,26 @@
$pageDots = !empty( $settings['pageDots'] ) ? $settings['pageDots'] : '';
// Carousel Data's
- $draggable = $draggable ? ' data-draggable="true"' : ' data-draggable="false"';
- $freeScroll = $freeScroll ? ' data-freescroll="true"' : '';
- $freeScrollFriction = $freeScrollFriction ? ' data-freescrollfriction="'.$freeScrollFriction.'"' : '';
- $wrapAround = $wrapAround ? ' data-wraparound="true"' : ' data-wraparound="false"';
- $groupCells = $groupCells ? ' data-groupcells="'.$groupCells.'"' : '';
- $autoPlay = $autoPlay ? ' data-autoplay="'.$autoPlay.'"' : '';
- $pauseAutoPlayOnHover = $pauseAutoPlayOnHover ? ' data-pauseautoplayonhover="true"' : '';
- $adaptiveHeight = $adaptiveHeight ? ' data-adaptiveheight="true"' : '';
- $dragThreshold = $dragThreshold ? ' data-dragthreshold="'.$dragThreshold.'"' : '';
- $selectedAttraction = $selectedAttraction ? ' data-selectedattraction="'.$selectedAttraction.'"' : '';
- $friction = $friction ? ' data-friction="'.$friction : '';
- $initialIndex = $initialIndex ? ' data-initialindex="'.$initialIndex.'"' : '';
- $accessibility = $accessibility ? ' data-accessibility="true"' : ' data-accessibility="false"';
- $setGallerySize = $setGallerySize ? ' data-setgallerysize="true"' : ' data-setgallerysize="false"';
- $resize = $resize ? ' data-resize="true"' : ' data-resize="false"';
- $cellAlign = $cellAlign ? ' data-cellalign="'.$cellAlign.'"' : '';
- $contain = $contain ? ' data-contain="true"' : '';
- $rightToLeft = $rightToLeft ? ' data-righttoleft="true"' : '';
- $prevNextButtons = $prevNextButtons ? ' data-prevnextbuttons="true"' : ' data-prevnextbuttons="false"';
- $pageDots = $pageDots ? ' data-pagedots="true"' : ' data-pagedots="false"';
+ $draggable = $draggable ? ' data-draggable="' . esc_attr('true') . '"' : ' data-draggable="' . esc_attr('false') . '"';
+ $freeScroll = $freeScroll ? ' data-freescroll="' . esc_attr('true') . '"' : '';
+ $freeScrollFriction = $freeScrollFriction ? ' data-freescrollfriction="' . esc_attr($freeScrollFriction) . '"' : '';
+ $wrapAround = $wrapAround ? ' data-wraparound="' . esc_attr('true') . '"' : ' data-wraparound="' . esc_attr('false') . '"';
+ $groupCells = $groupCells ? ' data-groupcells="' . esc_attr($groupCells) . '"' : '';
+ $autoPlay = $autoPlay ? ' data-autoplay="' . esc_attr($autoPlay) . '"' : '';
+ $pauseAutoPlayOnHover = $pauseAutoPlayOnHover ? ' data-pauseautoplayonhover="' . esc_attr('true') . '"' : '';
+ $adaptiveHeight = $adaptiveHeight ? ' data-adaptiveheight="' . esc_attr('true') . '"' : '';
+ $dragThreshold = $dragThreshold ? ' data-dragthreshold="' . esc_attr($dragThreshold) . '"' : '';
+ $selectedAttraction = $selectedAttraction ? ' data-selectedattraction="' . esc_attr($selectedAttraction) . '"' : '';
+ $friction = $friction ? ' data-friction="' . esc_attr($friction) . '"' : '';
+ $initialIndex = $initialIndex ? ' data-initialindex="' . esc_attr($initialIndex) . '"' : '';
+ $accessibility = $accessibility ? ' data-accessibility="' . esc_attr('true') . '"' : ' data-accessibility="' . esc_attr('false') . '"';
+ $setGallerySize = $setGallerySize ? ' data-setgallerysize="' . esc_attr('true') . '"' : ' data-setgallerysize="' . esc_attr('false') . '"';
+ $resize = $resize ? ' data-resize="' . esc_attr('true') . '"' : ' data-resize="' . esc_attr('false') . '"';
+ $cellAlign = $cellAlign ? ' data-cellalign="' . esc_attr($cellAlign) . '"' : '';
+ $contain = $contain ? ' data-contain="' . esc_attr('true') . '"' : '';
+ $rightToLeft = $rightToLeft ? ' data-righttoleft="' . esc_attr('true') . '"' : '';
+ $prevNextButtons = $prevNextButtons ? ' data-prevnextbuttons="' . esc_attr('true') . '"' : ' data-prevnextbuttons="' . esc_attr('false') . '"';
+ $pageDots = $pageDots ? ' data-pagedots="' . esc_attr('true') . '"' : ' data-pagedots="' . esc_attr('false') . '"';
$blog_col = $blog_col ? $blog_col : '3';
@@ -1400,14 +1400,14 @@
$paged = $my_page;
}
- if ($blog_show_id) {
+ if ($blog_show_id) {
$blog_show_id = json_encode( $blog_show_id );
$blog_show_id = str_replace(array( '[', ']' ), '', $blog_show_id);
$blog_show_id = str_replace(array( '"', '"' ), '', $blog_show_id);
- $blog_show_id = explode(',',$blog_show_id);
- } else {
- $blog_show_id = '';
- }
+ $blog_show_id = explode(',',$blog_show_id);
+ } else {
+ $blog_show_id = '';
+ }
$args = array(
// other query params here,
@@ -1417,14 +1417,14 @@
'category_name' => implode(',', $blog_show_category),
'orderby' => $blog_orderby,
'order' => $blog_order,
- 'post__in' => $blog_show_id,
+ 'post__in' => $blog_show_id,
);
$prim_post = new WP_Query( $args );
if ($prim_post->have_posts()) : ?>
<div class="napae-blog-wrap<?php echo esc_attr($style_class); ?>">
<?php if ($blog_style === 'three') { ?>
- <div class="flick-carousel" <?php echo $cellAlign . $draggable . $freeScroll . $freeScrollFriction . $wrapAround . $groupCells . $autoPlay . $pauseAutoPlayOnHover . $adaptiveHeight . $dragThreshold . $selectedAttraction . $friction . $initialIndex . $accessibility . $setGallerySize . $resize . $contain . $rightToLeft . $prevNextButtons . $pageDots; ?>>
+ <div class="flick-carousel"<?php echo wp_kses_post($cellAlign . $draggable . $freeScroll . $freeScrollFriction . $wrapAround . $groupCells . $autoPlay . $pauseAutoPlayOnHover . $adaptiveHeight . $dragThreshold . $selectedAttraction . $friction . $initialIndex . $accessibility . $setGallerySize . $resize . $contain . $rightToLeft . $prevNextButtons . $pageDots); ?>>
<?php } else { ?>
<div class="nich-row">
<?php } ?>
--- a/primary-addon-for-elementor/elementor/widgets/basic/nabasic-chart.php
+++ b/primary-addon-for-elementor/elementor/widgets/basic/nabasic-chart.php
@@ -464,167 +464,92 @@
* Written in PHP and used to generate the final HTML.
*/
protected function render() {
- // Chart query
- $settings = $this->get_settings_for_display();
- $chart_type = !empty( $settings['chart_type'] ) ? $settings['chart_type'] : '';
- $opt_legend = ( isset( $settings['opt_legend'] ) && ( 'yes' == $settings['opt_legend'] ) ) ? true : false;
- $opt_legend_pos = !empty( $settings['opt_legend_pos'] ) ? $settings['opt_legend_pos'] : '';
- $horizontal_bar = ( isset( $settings['horizontal_bar'] ) && ( 'yes' == $settings['horizontal_bar'] ) ) ? true : false;
- $x_values = !empty( $settings['x_values'] ) ? $settings['x_values'] : '';
- $max_value = !empty( $settings['max_value'] ) ? $settings['max_value'] : '';
- $min_value = !empty( $settings['min_value'] ) ? $settings['min_value'] : '';
- $hidex_gridlines = ( isset( $settings['hidex_gridlines'] ) && ( 'yes' == $settings['hidex_gridlines'] ) ) ? true : false;
- $hidey_gridlines = ( isset( $settings['hidey_gridlines'] ) && ( 'yes' == $settings['hidey_gridlines'] ) ) ? true : false;
- $step_value = !empty( $settings['step_value'] ) ? $settings['step_value'] : '';
-
- // Atts
- if ($chart_type === 'bar') {
- if ($horizontal_bar) {
- $chart_type = 'horizontalBar';
- } else {
- $chart_type = 'bar';
- }
- } else {
- $horizontal_bar = $chart_type;
- }
-
- // Unique ID
- $chart_uniqid = uniqid( 'chart_' );
-
- // X Values
- $x_values = explode( ';', trim( $x_values, ';' ) );
-
- // Param Group Values
- $line_values = !empty( $settings['line_values'] ) ? $settings['line_values'] : [];
- $circle_values = !empty( $settings['circle_values'] ) ? $settings['circle_values'] : [];
-
- // Get Values
- $data = array(
- 'labels' => $x_values,
- 'datasets' => array()
- );
- // Chart Datasets
- if ( $chart_type !== 'pie' ) {
- foreach ( $line_values as $key => $value ) {
-
- $color = $value['bg_color'];
- $point_color = $value['point_color'];
- $border_color = $value['border_color'];
- $point_border_color = $value['point_border_color'];
- // $opt_mixed = $value['opt_mixed'];
-
- $data['datasets'][] = array(
- 'label' => isset( $value['chart_title'] ) ? $value['chart_title'] : '',
- 'data' => explode( ';', isset( $value['y_values'] ) ? trim( $value['y_values'], ';' ) : '' ),
- 'borderColor' => $border_color,
- 'pointBorderColor' => $point_border_color,
- 'pointBackgroundColor' => $point_color,
- 'backgroundColor' => $color,
- 'borderWidth' => isset( $value['border_width'] ) ? $value['border_width'] : '1',
- 'pointBorderWidth' => isset( $value['point_width'] ) ? $value['point_width'] : '2',
- 'pointRadius' => isset( $value['point_radius'] ) ? $value['point_radius'] : '4',
- 'pointHoverRadius' => isset( $value['point_hover_radius'] ) ? $value['point_hover_radius'] : '4',
- // 'lineTension' => '0',
- // 'type' => $opt_mixed,
- );
- }
- }
-
- echo '<div class="eclt-chart "><canvas id="'. esc_attr($chart_uniqid) .'" ></canvas></div>'; ?>
-
- <script type="text/javascript">
-
- jQuery(document).ready(function($) {
- <?php if ($opt_legend == 'true') { $show_legend = 'true'; } else { $show_legend = 'false'; } ?>
-
- // Global configs
- Chart.defaults.global.responsive = true;
- Chart.defaults.global.maintainAspectRatio = false;
- Chart.defaults.global.legend.display = <?php echo $show_legend; ?>;
- Chart.defaults.global.legend.position = <?php echo json_encode($opt_legend_pos); ?>;
- Chart.defaults.global.tooltips.backgroundColor = 'rgba(35,35,35,0.9)';
- Chart.defaults.global.tooltips.bodyFontSize = 13;
- Chart.defaults.global.tooltips.bodyFontStyle = 'bold';
- Chart.defaults.global.tooltips.yPadding = 13;
- Chart.defaults.global.tooltips.xPadding = 10;
- Chart.defaults.doughnut.cutoutPercentage = 60;
-
- // Line Chart
- var <?php echo esc_js( $chart_uniqid ); ?> = document.getElementById("<?php echo esc_js( $chart_uniqid ); ?>").getContext("2d");
-
- var <?php echo esc_js( $chart_uniqid ); ?>_myChart = new Chart(<?php echo esc_js( $chart_uniqid ); ?>, {
- type: '<?php echo esc_js( $chart_type ); ?>',
- <?php if ( $chart_type === 'pie' ) { ?>
- data: {
- labels: [
- <?php foreach ( $circle_values as $value ) { ?>
- "<?php echo esc_js($value['chart_title']); ?>",
- <?php } ?>
- ],
- datasets: [
- {
- data: [
- <?php foreach ( $circle_values as $value ) { ?>
- <?php echo esc_js($value['values']); ?>,
- <?php } ?>
- ],
- backgroundColor: [
- <?php foreach ( $circle_values as $value ) { ?>
- "<?php echo esc_js($value['bg_color']); ?>",
- <?php } ?>
- ],
- borderWidth: [4, 4, 4]
- }
- ]
- },
- <?php } else { ?>
- data: <?php echo json_encode( $data ); ?>,
- <?php } if ( $chart_type === 'bar' || $chart_type === 'horizontalBar' ) { ?>
- options: {
- responsive: true,
- scales: {
- yAxes: [{
- <?php if ($chart_type !== 'horizontalBar' || $chart_type === 'bar') { ?>
- ticks: {
- max: <?php echo esc_js($max_value); ?>,
- min: <?php echo esc_js($min_value); ?>,
- stepSize: <?php echo esc_js($step_value); ?>,
- stacked: true,
- },
- <?php } if ($hidey_gridlines) { ?>
- gridLines: {
- color: "rgba(0, 0, 0, 0)",
- <?php if ($chart_type === 'bar') { ?>
- zeroLineColor: 'rgba(0, 0, 0, 0)',
- <?php } ?>
- }
- <?php } ?>
- }],
- xAxes: [{
- <?php if ($chart_type === 'horizontalBar') { ?>
- ticks: {
- max: <?php echo esc_js($max_value); ?>,
- min: <?php echo esc_js($min_value); ?>,
- stepSize: <?php echo esc_js($step_value); ?>,
- stacked: true,
- },
- <?php } if ($hidex_gridlines) { ?>
- gridLines: {
- color: "rgba(0, 0, 0, 0)",
- zeroLineColor: 'rgba(0, 0, 0, 0)',
- }
- <?php } ?>
- }],
- }
- }
- <?php } ?>
- });
+ $settings = $this->get_settings_for_display();
- });
- </script>
+ $chart_type = !empty( $settings['chart_type'] ) ? $settings['chart_type'] : '';
+ $opt_legend = ( isset( $settings['opt_legend'] ) && ( 'yes' == $settings['opt_legend'] ) ) ? 'true' : 'false';
+ $opt_legend_pos = !empty( $settings['opt_legend_pos'] ) ? $settings['opt_legend_pos'] : '';
+ $horizontal_bar = ( isset( $settings['horizontal_bar'] ) && ( 'yes' == $settings['horizontal_bar'] ) ) ? 'true' : 'false';
+ $x_values = !empty( $settings['x_values'] ) ? $settings['x_values'] : '';
+ $max_value = !empty( $settings['max_value'] ) ? $settings['max_value'] : '';
+ $min_value = !empty( $settings['min_value'] ) ? $settings['min_value'] : '';
+ $hidex_gridlines = ( isset( $settings['hidex_gridlines'] ) && ( 'yes' == $settings['hidex_gridlines'] ) ) ? 'true' : 'false';
+ $hidey_gridlines = ( isset( $settings['hidey_gridlines'] ) && ( 'yes' == $settings['hidey_gridlines'] ) ) ? 'true' : 'false';
+ $step_value = !empty( $settings['step_value'] ) ? $settings['step_value'] : '';
+
+ // Unique ID
+ $chart_uniqid = uniqid( 'chart_' );
+
+ // X Values
+ $x_values = explode( ';', trim( $x_values, ';' ) );
+
+ // Param Group Values
+ $line_values = !empty( $settings['line_values'] ) ? $settings['line_values'] : [];
+ $circle_values = !empty( $settings['circle_values'] ) ? $settings['circle_values'] : [];
+
+ // Prepare data for JSON encoding
+ $chart_data = [
+ 'type' => $chart_type,
+ 'labels' => $x_values,
+ 'datasets' => [],
+ 'options' => [
+ 'legend' => [
+ 'display' => $opt_legend,
+ 'position' => $opt_legend_pos
+ ],
+ 'horizontalBar' => $horizontal_bar,
+ 'scales' => [
+ 'yAxes' => [[
+ 'ticks' => [
+ 'max' => $max_value,
+ 'min' => $min_value,
+ 'stepSize' => $step_value
+ ],
+ 'gridLines' => [
+ 'display' => !$hidey_gridlines
+ ]
+ ]],
+ 'xAxes' => [[
+ 'gridLines' => [
+ 'display' => !$hidex_gridlines
+ ]
+ ]]
+ ]
+ ]
+ ];
+
+ if ($chart_type !== 'pie') {
+ foreach ($line_values as $value) {
+ $chart_data['datasets'][] = [
+ 'label' => isset($value['chart_title']) ? $value['chart_title'] : '',
+ 'data' => explode(';', isset($value['y_values']) ? trim($value['y_values'], ';') : ''),
+ 'borderColor' => $value['border_color'],
+ 'pointBorderColor' => $value['point_border_color'],
+ 'pointBackgroundColor' => $value['point_color'],
+ 'backgroundColor' => $value['bg_color'],
+ 'borderWidth' => isset($value['border_width']) ? $value['border_width'] : '1',
+ 'pointBorderWidth' => isset($value['point_width']) ? $value['point_width'] : '2',
+ 'pointRadius' => isset($value['point_radius']) ? $value['point_radius'] : '4',
+ 'pointHoverRadius' => isset($value['point_hover_radius']) ? $value['point_hover_radius'] : '4',
+ ];
+ }
+ } else {
+ $chart_data['datasets'][] = [
+ 'data' => array_column($circle_values, 'values'),
+ 'backgroundColor' => array_column($circle_values, 'bg_color'),
+ 'borderWidth' => [4, 4, 4]
+ ];
+ $chart_data['labels'] = array_column($circle_values, 'chart_title');
+ }
- <?php }
+ // Encode the data for the data attribute
+ $chart_data_json = json_encode($chart_data);
+
+ // Output the canvas with data attribute
+ echo '<div class="eclt-chart"><canvas id="' . esc_attr($chart_uniqid) . '" data-chart='' . esc_attr($chart_data_json) . ''></canvas></div>';
+
+ }
}
Plugin::instance()->widgets_manager->register_widget_type( new Primary_Addon_Chart() );
--- a/primary-addon-for-elementor/elementor/widgets/basic/nabasic-gallery.php
+++ b/primary-addon-for-elementor/elementor/widgets/basic/nabasic-gallery.php
@@ -985,7 +985,7 @@
$category = $filter_cat ? ' data-category="'. str_replace(', ', " ", strtolower($filter_cat)) .'"' : '';
$category_class = $filter_cat ? ' '.str_replace(', ', " ", strtolower($filter_cat)) : '';
- $output .= '<div class="masonry-item'.$category_class.' '.$gallery_col.'"'.$category.'>
+ $output .= '<div class="masonry-item'.esc_attr( $category_class ).' '.esc_attr( $gallery_col ).'"'.esc_attr( $category ).'>
<div class="napae-gallery-item'.$hover_class.$style_class.'">';
if ($gallery_style === 'two') {$output .= '<div class="gallery-info-wrap">';}
$output .= $image.'
--- a/primary-addon-for-elementor/elementor/widgets/basic/nabasic-image-compare.php
+++ b/primary-addon-for-elementor/elementor/widgets/basic/nabasic-image-compare.php
@@ -287,38 +287,18 @@
$after_title = $settings['after_title'] ? $settings['after_title'] : '';
$compare_id = uniqid();
- $id = rand(999, 9999);
-
- $output = '<div class="napae-compare-wrap"><div class="napae-compare compare-'.esc_attr($compare_id).'-'.esc_attr($id).'"></div></div>';
-
- echo $output; ?>
-
- <script type="text/javascript">
-
- jQuery(document).ready(function($) {
-
- slider = new juxtapose.JXSlider('.compare-<?php echo esc_attr($compare_id); ?>-<?php echo esc_attr($id); ?>',
- [
- {
- src: '<?php echo esc_url($before_url); ?>',
- label: '<?php echo esc_attr($before_title); ?>',
- },
- {
- src: '<?php echo esc_url($after_url); ?>',
- label: '<?php echo esc_attr($after_title); ?>',
- }
- ],
- {
- animate: true,
- showLabels: <?php echo esc_attr($title); ?>,
- showCredits: false,
- startingPosition: "<?php echo esc_attr($starting_position); ?>%",
- makeResponsive: true,
- mode: "<?php echo esc_attr($compare_style); ?>",
- });
-
- });
- </script>
+ $id = rand(999, 9999); ?>
+ <div class="napae-compare-wrap">
+ <div class="napae-compare <?php echo esc_attr($unique_class); ?>"
+ data-before-url="<?php echo esc_url($before_url); ?>"
+ data-before-title="<?php echo esc_attr($before_title); ?>"
+ data-after-url="<?php echo esc_url($after_url); ?>"
+ data-after-title="<?php echo esc_attr($after_title); ?>"
+ data-show-labels="<?php echo esc_attr($title); ?>"
+ data-starting-position="<?php echo esc_attr($starting_position); ?>"
+ data-compare-style="<?php echo esc_attr($compare_style); ?>">
+ </div>
+ </div>
<?php
}
--- a/primary-addon-for-elementor/elementor/widgets/basic/nabasic-section-title.php
+++ b/primary-addon-for-elementor/elementor/widgets/basic/nabasic-section-title.php
@@ -334,8 +334,8 @@
$title_image = !empty( $settings['title_image']['id'] ) ? $settings['title_image']['id'] : '';
$title_image_url = wp_get_attachment_url( $title_image );
- $section_title = $section_title ? '<h3>'.$section_title.'</h3>' : '';
- $section_sub_title = $section_sub_title ? '<h4>'.$section_sub_title.'</h4>' : '';
+ $section_title = $section_title ? '<h3>'.esc_html( $section_title ).'</h3>' : '';
+ $section_sub_title = $section_sub_title ? '<h4>'.esc_html( $section_sub_title ).'</h4>' : '';
$title_image = $title_image_url ? '<div class="napae-image"><img src="'.esc_url($title_image_url).'" alt="Icon"></div>' : '';
// Turn output buffer on
--- a/primary-addon-for-elementor/elementor/widgets/basic/nabasic-separator.php
+++ b/primary-addon-for-elementor/elementor/widgets/basic/nabasic-separator.php
@@ -1010,7 +1010,7 @@
$border_rsub_class = 'sep-right';
}
- $output = '<div class="napae-separator'.$align_class.$salign_class.$pos_class.$border_class.'">';
+ $output = '<div class="napae-separator'.esc_attr( $align_class.$salign_class.$pos_class.$border_class ).'">';
if ($separator_style === 'two') {
} else {
$output .= '<span class="'.$border_lsub_class.'"></span><div class="napae-sep">'.$separator.'</div><span class="'.$border_rsub_class.'"></span>';
--- a/primary-addon-for-elementor/elementor/widgets/basic/nabasic-team.php
+++ b/primary-addon-for-elementor/elementor/widgets/basic/nabasic-team.php
@@ -760,19 +760,19 @@
<div class="napae-social rounded">
<ul>
<?php
- // Group Param Output
- if ( is_array( $listItems_groups ) && !empty( $listItems_groups ) ){
- foreach ( $listItems_groups as $each_list ) {
- $icon_link = !empty( $each_list['icon_link'] ) ? $each_list['icon_link'] : '';
- $link_url = !empty( $icon_link['url'] ) ? esc_url($icon_link['url']) : '';
- $link_external = !empty( $icon_link['is_external'] ) ? 'target="_blank"' : '';
- $link_nofollow = !empty( $icon_link['nofollow'] ) ? 'rel="nofollow"' : '';
- $link_attr = !empty( $icon_link['url'] ) ? $link_external.' '.$link_nofollow : '';
- $social_icon = !empty( $each_list['social_icon'] ) ? $each_list['social_icon'] : '';
- $icon = $social_icon ? '<i class="'.esc_attr($social_icon).'" aria-hidden="true"></i>' : '';
- ?>
- <li><a href="<?php echo esc_url($link_url); ?>" <?php echo $link_attr; ?>><?php echo $icon; ?></a></li>
- <?php } } ?>
+ // Group Param Output
+ if ( is_array( $listItems_groups ) && !empty( $listItems_groups ) ){
+ foreach ( $listItems_groups as $each_list ) {
+ $icon_link = !empty( $each_list['icon_link'] ) ? $each_list['icon_link'] : '';
+ $link_url = !empty( $icon_link['url'] ) ? esc_url($icon_link['url']) : '';
+ $link_external = !empty( $icon_link['is_external'] ) ? 'target="_blank"' : '';
+ $link_nofollow = !empty( $icon_link['nofollow'] ) ? 'rel="nofollow"' : '';
+ $link_attr = !empty( $icon_link['url'] ) ? $link_external.' '.$link_nofollow : '';
+ $social_icon = !empty( $each_list['social_icon'] ) ? $each_list['social_icon'] : '';
+ $icon = $social_icon ? '<i class="'.esc_attr($social_icon).'" aria-hidden="true"></i>' : '';
+ ?>
+ <li><a href="<?php echo esc_url($link_url); ?>" <?php echo $link_attr; ?>><?php echo $icon; ?></a></li>
+ <?php } } ?>
</ul>
</div>
</div>
@@ -844,7 +844,7 @@
$link_attr = !empty( $contact_link['url'] ) ? $link_external.' '.$link_nofollow : '';
$contact_icon = !empty( $each_list['contact_icon'] ) ? $each_list['contact_icon'] : '';
$icon = $contact_icon ? '<i class="'.esc_attr($contact_icon).'" aria-hidden="true"></i>' : '';
- $text = $link_url ? '<a href="'. esc_url($link_url).'" '. $link_attr.'>'.$contact_text.'</a>' : $contact_text;
+ $text = $link_url ? '<a href="'. esc_url($link_url).'" '. $link_attr.'>'.esc_html( $contact_text ).'</a>' : esc_html( $contact_text );
?>
<li><?php echo $icon.' '.$text; ?></li>
<?php } } ?>
--- a/primary-addon-for-elementor/elementor/widgets/basic/nabasic-testimonials.php
+++ b/primary-addon-for-elementor/elementor/widgets/basic/nabasic-testimonials.php
@@ -1212,65 +1212,6 @@
echo $output;
- if ( Plugin::$instance->editor->is_edit_mode() ) : ?>
- <script type="text/javascript">
- jQuery(document).ready(function($) {
- $('.owl-carousel').each( function() {
- var $carousel = $(this);
- var $items = ($carousel.data('items') !== undefined) ? $carousel.data('items') : 1;
- var $items_tablet = ($carousel.data('items-tablet') !== undefined) ? $carousel.data('items-tablet') : 1;
- var $items_mobile_landscape = ($carousel.data('items-mobile-landscape') !== undefined) ? $carousel.data('items-mobile-landscape') : 1;
- var $items_mobile_portrait = ($carousel.data('items-mobile-portrait') !== undefined) ? $carousel.data('items-mobile-portrait') : 1;
- $carousel.owlCarousel ({
- loop : ($carousel.data('loop') !== undefined) ? $carousel.data('loop') : true,
- items : $carousel.data('items'),
- margin : ($carousel.data('margin') !== undefined) ? $carousel.data('margin') : 0,
- dots : ($carousel.data('dots') !== undefined) ? $carousel.data('dots') : true,
- nav : ($carousel.data('nav') !== undefined) ? $carousel.data('nav') : false,
- navText : ["<div class='slider-no-current'><span class='current-no'></span><span class='total-no'></span></div><span class='current-monials'></span>", "<div class='slider-no-next'></div><span class='next-monials'></span>"],
- autoplay : ($carousel.data('autoplay') !== undefined) ? $carousel.data('autoplay') : false,
- autoplayTimeout : ($carousel.data('autoplay-timeout') !== undefined) ? $carousel.data('autoplay-timeout') : 5000,
- animateIn : ($carousel.data('animatein') !== undefined) ? $carousel.data('animatein') : false,
- animateOut : ($carousel.data('animateout') !== undefined) ? $carousel.data('animateout') : false,
- mouseDrag : ($carousel.data('mouse-drag') !== undefined) ? $carousel.data('mouse-drag') : true,
- autoWidth : ($carousel.data('auto-width') !== undefined) ? $carousel.data('auto-width') : false,
- autoHeight : ($carousel.data('auto-height') !== undefined) ? $carousel.data('auto-height') : false,
- center : ($carousel.data('center') !== undefined) ? $carousel.data('center') : false,
- responsiveClass: true,
- dotsEachNumber: true,
- smartSpeed: 600,
- autoplayHoverPause: true,
- responsive : {
- 0 : {
- items : $items_mobile_portrait,
- },
- 480 : {
- items : $items_mobile_landscape,
- },
- 768 : {
- items : $items_tablet,
- },
- 992 : {
- items : $items,
- }
- }
- });
- var totLength = $('.owl-dot', $carousel).length;
- $('.total-no', $carousel).html(totLength);
- $('.current-no', $carousel).html(totLength);
- $carousel.owlCarousel();
- $('.current-no', $carousel).html(1);
- $carousel.on('changed.owl.carousel', function(event) {
- var total_items = event.page.count;
- var currentNum = event.page.index + 1;
- $('.total-no', $carousel ).html(total_items);
- $('.current-no', $carousel).html(currentNum);
- });
- });
- });
- </script>
- <?php endif;
-
}
}
--- a/primary-addon-for-elementor/elementor/widgets/basic/nabasic-video.php
+++ b/primary-addon-for-elementor/elementor/widgets/basic/nabasic-video.php
@@ -900,9 +900,9 @@
$video = $video_link ? '<a href="'.esc_url($video_link).'" class="napae-video-btn napae-popup-video"><i class="fa fa-play" aria-hidden="true"></i>'.$animation.'</a>' : '';
}
$title_image_url = wp_get_attachment_url( $title_image );
- $section_title = $section_title ? '<h3>'.$section_title.'</h3>' : '';
- $section_sub_title = $section_sub_title ? '<h4>'.$section_sub_title.'</h4>' : '';
- $content = $content ? $content : '';
+ $section_title = $section_title ? '<h3>'.esc_html( $section_title ).'</h3>' : '';
+ $section_sub_title = $section_sub_title ? '<h4>'.esc_html( $section_sub_title ).'</h4>' : '';
+ $content = $content ? wp_kses_post( $content ) : '';
$title_image = $title_image_url ? '<div class="napae-image"><img src="'.esc_url($title_image_url).'" alt="Icon"></div>' : '';
$sign_image_url = wp_get_attachment_url( $sign_image );
$sign_image = $sign_image_url ? '<div class="sign-image"><img src="'.esc_url($sign_image_url).'" alt="Icon"></div>' : '';
--- a/primary-addon-for-elementor/elementor/widgets/basic/nabasic-woo-product-grid.php
+++ b/primary-addon-for-elementor/elementor/widgets/basic/nabasic-woo-product-grid.php
@@ -812,7 +812,7 @@
<div class="napae-woo-product-image" style="background-image: url(<?php echo esc_url($image_url); ?>);">
<?php
if($settings['is_label']) {
- echo ( ! $product->managing_stock() && ! $product->is_in_stock() ? '<span class="napae-onsale outofstock '.$sale_badge_preset.' '.$sale_badge_align.'">'. $stockout_text .'</span>' : ($product->is_on_sale() ? '<span class="napae-onsale '.$sale_badge_preset.' '.$sale_badge_align.'">' . $sale_text . '</span>' : '') );
+ echo ( ! $product->managing_stock() && ! $product->is_in_stock() ? '<span class="napae-onsale outofstock '.esc_attr( $sale_badge_preset ).' '.esc_attr( $sale_badge_align ).'">'. esc_html( $stockout_text ) .'</span>' : ($product->is_on_sale() ? '<span class="napae-onsale '.esc_attr( $sale_badge_preset ).' '.esc_attr( $sale_badge_align ).'">' . esc_html( $sale_text ) . '</span>' : '') );
}
?>
</div>
@@ -861,7 +861,7 @@
<div class="napae-woo-product-image" style="background-image: url(<?php echo esc_url($image_url); ?>);">
<?php
if($settings['is_label']) {
- echo ( ! $product->managing_stock() && ! $product->is_in_stock() ? '<span class="napae-onsale outofstock '.$sale_badge_preset.' '.$sale_badge_align.'">'. $stockout_text .'</span>' : ($product->is_on_sale() ? '<span class="napae-onsale '.$sale_badge_preset.' '.$sale_badge_align.'">' . $sale_text . '</span>' : '') );
+ echo ( ! $product->managing_stock() && ! $product->is_in_stock() ? '<span class="napae-onsale outofstock '.esc_attr( $sale_badge_preset ).' '.esc_attr( $sale_badge_align ).'">'. esc_html( $stockout_text ) .'</span>' : ($product->is_on_sale() ? '<span class="napae-onsale '.esc_attr( $sale_badge_preset ).' '.esc_attr( $sale_badge_align ).'">' . esc_html($sale_text) . '</span>' : '') );
}
?>
</div>
@@ -901,7 +901,7 @@
<div class="napae-woo-product-image" style="background-image: url(<?php echo esc_url($image_url); ?>);">
<?php
if($settings['is_label']) {
- echo ( ! $product->managing_stock() && ! $product->is_in_stock() ? '<span class="napae-onsale outofstock '.$sale_badge_preset.' '.$sale_badge_align.'">'. $stockout_text .'</span>' : ($product->is_on_sale() ? '<span class="napae-onsale '.$sale_badge_preset.' '.$sale_badge_align.'">' . $sale_text . '</span>' : '') );
+ echo ( ! $product->managing_stock() && ! $product->is_in_stock() ? '<span class="napae-onsale outofstock '.esc_attr( $sale_badge_preset ).' '.esc_attr( $sale_badge_align ).'">'. esc_html( $stockout_text ) .'</span>' : ($product->is_on_sale() ? '<span class="napae-onsale '.esc_attr( $sale_badge_preset ).' '.esc_attr( $sale_badge_align ).'">' . esc_html( $sale_text ) . '</span>' : '') );
}
?>
<?php if ( $settings['is_rating'] && $product->get_rating_count() ) { ?>
@@ -940,7 +940,7 @@
<div class="napae-woo-product-image" style="background-image: url(<?php echo esc_url($image_url); ?>);">
<?php
if($settings['is_label']) {
- echo ( ! $product->managing_stock() && ! $product->is_in_stock() ? '<span class="napae-onsale outofstock '.$sale_badge_preset.' '.$sale_badge_align.'">'. $stockout_text .'</span>' : ($product->is_on_sale() ? '<span class="napae-onsale '.$sale_badge_preset.' '.$sale_badge_align.'">' . $sale_text . '</span>' : '') );
+ echo ( ! $product->managing_stock() && ! $product->is_in_stock() ? '<span class="napae-onsale outofstock '.esc_attr( $sale_badge_preset ).' '.esc_attr( $sale_badge_align ).'">'. esc_html($stockout_text) .'</span>' : ($product->is_on_sale() ? '<span class="napae-onsale '.esc_attr( $sale_badge_preset ).' '.esc_attr( $sale_badge_align ).'">' . esc_html($sale_text) . '</span>' : '') );
}
?>
</div>
--- a/primary-addon-for-elementor/freemius/includes/class-freemius.php
+++ b/primary-addon-for-elementor/freemius/includes/class-freemius.php
@@ -110,6 +110,12 @@
private $_enable_anonymous = true;
/**
+ * @since 2.9.1
+ * @var string|null Hints the SDK whether the plugin supports parallel activation mode, preventing the auto-deactivation of the free version when the premium version is activated, and vice versa.
+ */
+ private $_premium_plugin_basename_from_parallel_activation;
+
+ /**
* @since 1.1.7.5
* @var bool Hints the SDK if plugin should run in anonymous mode (only adds feedback form).
*/
@@ -1651,6 +1657,31 @@
);
}
}
+
+ if (
+ $this->is_user_in_admin() &&
+ $this->is_parallel_activation() &&
+ $this->_premium_plugin_basename !== $this->_premium_plugin_basename_from_parallel_activation
+ ) {
+ $this->_premium_plugin_basename = $this->_premium_plugin_basename_from_parallel_activation;
+
+ register_activation_hook(
+ dirname( $this->_plugin_dir_path ) . '/' . $this->_premium_plugin_basename,
+ array( &$this, '_activate_plugin_event_hook' )
+ );
+ }
+ }
+
+ /**
+ * Determines if a plugin is running in parallel activation mode.
+ *
+ * @author Leo Fajardo (@leorw)
+ * @since 2.9.1
+ *
+ * @return bool
+ */
+ private function is_parallel_activation() {
+ return ! empty( $this->_premium_plugin_basename_from_parallel_activation );
}
/**
@@ -5155,11 +5186,35 @@
$this->_plugin :
new FS_Plugin();
+ $is_premium = $this->get_bool_option( $plugin_info, 'is_premium', true );
$premium_suffix = $this->get_option( $plugin_info, 'premium_suffix', '(Premium)' );
+ $module_type = $this->get_option( $plugin_info, 'type', $this->_module_type );
+
+ $parallel_activation = $this->get_option( $plugin_info, 'parallel_activation' );
+
+ if (
+ ! $is_premium &&
+ is_array( $parallel_activation ) &&
+ ( WP_FS__MODULE_TYPE_PLUGIN === $module_type ) &&
+ $this->get_bool_option( $parallel_activation, 'enabled' )
+ ) {
+ $premium_basename = $this->get_option( $parallel_activation, 'premium_version_basename' );
+
+ if ( empty( $premium_basename ) ) {
+ throw new Exception('You need to specify the premium version basename to enable parallel version activation.');
+ }
+
+ $this->_premium_plugin_basename_from_parallel_activation = $premium_basename;
+
+ if ( is_plugin_active( $premium_basename ) ) {
+ $is_premium = true;
+ }
+ }
+
$plugin->update( array(
'id' => $id,
- 'type' => $this->get_option( $plugin_info, 'type', $this->_module_type ),
+ 'type' => $module_type,
'public_key' => $public_key,
'slug' => $this->_slug,
'premium_slug' => $this->get_option( $plugin_info, 'premium_slug', "{$this->_slug}-premium" ),
@@ -5167,7 +5222,7 @@
'version' => $this->get_plugin_version(),
'title' => $this->get_plugin_name( $premium_suffix ),
'file' => $this->_plugin_basename,
- 'is_premium' => $this->get_bool_option( $plugin_info, 'is_premium', true ),
+ 'is_premium' => $is_premium,
'premium_suffix' => $premium_suffix,
'is_live' => $this->get_bool_option( $plugin_info, 'is_live', true ),
'affiliate_moderation' => $this->get_option( $plugin_info, 'has_affiliation' ),
@@ -5236,7 +5291,14 @@
$this->_anonymous_mode = false;
} else {
$this->_enable_anonymous = $this->get_bool_option( $plugin_info, 'enable_anonymous', true );
- $this->_anonymous_mode = $this->get_bool_option( $plugin_info, 'anonymous_mode', false );
+ $this->_anonymous_mode = (
+ $this->get_bool_option( $plugin_info, 'anonymous_mode', false ) ||
+ (
+ $this->apply_filters( 'playground_anonymous_mode', true ) &&
+ ! empty( $_SERVER['HTTP_HOST'] ) &&
+ FS_Site::is_playground_wp_environment_by_host( $_SERVER['HTTP_HOST'] )
+ )
+ );
}
$this->_permissions = $this->get_option( $plugin_info, 'permissions', array() );
$this->_is_bundle_license_auto_activation_enabled = $this->get_option( $plugin_info, 'bundle_license_auto_activation', false );
@@ -5444,7 +5506,7 @@
if ( $this->is_registered() ) {
// Schedule code type changes event.
- $this->schedule_install_sync();
+ $this->maybe_schedule_install_sync_cron();
}
/**
@@ -6508,6 +6570,33 @@
}
/**
+ * Instead of running blocking install sync event, execute non blocking scheduled cron job.
+ *
+ * @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding specified blog ID from being the cron job executor.
+ *
+ * @author Leo Fajardo (@leorw)
+ * @since 2.9.1
+ */
+ private function maybe_schedule_install_sync_cron( $except_blog_id = 0 ) {
+ if ( ! $this->is_user_in_admin() ) {
+ return;
+ }
+
+ if ( $this->is_clone() ) {
+ return;
+ }
+
+ if (
+ // The event has been properly scheduled, so no need to reschedule it.
+ is_numeric( $this->next_install_sync() )
+ ) {
+ return;
+ }
+
+ $this->schedule_cron( 'install_sync', 'install_sync', 'single', WP_FS__SCRIPT_START_TIME, false, $except_blog_id );
+ }
+
+ /**
* @author Vova Feldman (@svovaf)
* @since 1.1.7.3
*
@@ -6605,22 +6694,6 @@
}
/**
- * Instead of running blocking install sync event, execute non blocking scheduled wp-cron.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.1.7.3
- *
- * @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding excluded specified blog ID from being the cron executor.
- */
- private function schedule_install_sync( $except_blog_id = 0 ) {
- if ( $this->is_clone() ) {
- return;
- }
-
- $this->schedule_cron( 'install_sync', 'install_sync', 'single', WP_FS__SCRIPT_START_TIME, false, $except_blog_id );
- }
-
- /**
* Unix timestamp for previous install sync cron execution or false if never executed.
*
* @todo There's some very strange bug that $this->_storage->install_sync_timestamp value is not being updated. But for sure the sync event is working.
@@ -7411,7 +7484,7 @@
*/
if (
is_plugin_active( $other_version_basename ) &&
- $this->apply_filters( 'deactivate_on_activation', true )
+ $this->apply_filters( 'deactivate_on_activation', ! $this->is_parallel_activation() )
) {
deactivate_plugins( $other_version_basename );
}
@@ -7425,7 +7498,7 @@
// Schedule re-activation event and sync.
// $this->sync_install( array(), true );
- $this->schedule_install_sync();
+ $this->maybe_schedule_install_sync_cron();
// If activating the premium module version, add an admin notice to congratulate for an upgrade completion.
if ( $is_premium_version_activation ) {
@@ -8616,7 +8689,7 @@
return;
}
- $this->schedule_install_sync();
+ $this->maybe_schedule_install_sync_cron();
// $this->sync_install( array(), true );
}
@@ -15974,7 +16047,7 @@
if ( $this->is_install_sync_scheduled() &&
$context_blog_id == $this->get_install_sync_cron_blog_id()
) {
- $this->schedule_install_sync( $context_blog_id );
+ $this->maybe_schedule_install_sync_cron( $context_blog_id );
}
}
@@ -23927,13 +24000,15 @@
// Start trial button.
$button = ' ' . sprintf(
- '<a style="margin-left: 10px; vertical-align: super;" href="%s"><button class="button button-primary">%s ➜</button></a>',
+ '<div><a class="button button-primary" href="%s">%s ➜</a></div>',
$trial_url,
$this->get_text_x_inline( 'Start free trial', 'call to action', 'start-free-trial' )
);
+ $message_text = $this->apply_filters( 'trial_promotion_message', "{$message} {$cc_string}" );
+
$this->_admin_notices->add_sticky(
- $this->apply_filters( 'trial_promotion_message', "{$message} {$cc_string} {$button}" ),
+ "<div class="fs-trial-message-container"><div>{$message_text}</div> {$button}</div>",
'trial_promotion',
'',
'promotion'
@@ -25403,7 +25478,7 @@
$img_dir = WP_FS__DIR_IMG;
// Locate the main assets folder.
- if ( 1 < count( $fs_active_plugins->plugins ) ) {
+ if ( ! empty( $fs_active_plugins->plugins ) ) {
$plugin_or_theme_img_dir = ( $this->is_plugin() ? WP_PLUGIN_DIR : get_theme_root( get_stylesheet() ) );
foreach ( $fs_active_plugins->plugins as $sdk_path => &$data ) {
--- a/primary-addon-for-elementor/freemius/includes/class-fs-plugin-updater.php
+++ b/primary-addon-for-elementor/freemius/includes/class-fs-plugin-updater.php
@@ -542,24 +542,8 @@
global $wp_current_filter;
- $current_plugin_version = $this->_fs->get_plugin_version();
-
- if ( ! empty( $wp_current_filter ) && 'upgrader_process_complete' === $wp_current_filter[0] ) {
- if (
- is_null( $this->_update_details ) ||
- ( is_object( $this->_update_details ) && $this->_update_details->new_version !== $current_plugin_version )
- ) {
- /**
- * After an update, clear the stored update details and reparse the plugin's main file in order to get
- * the updated version's information and prevent the previous update information from showing up on the
- * updates page.
- *
- * @author Leo Fajardo (@leorw)
- * @since 2.3.1
- */
- $this->_update_details = null;
- $current_plugin_version = $this->_fs->get_plugin_version( true );
- }
+ if ( ! empty( $wp_current_filter ) && in_array( 'upgrader_process_complete', $wp_current_filter ) ) {
+ return $transient_data;
}
if ( ! isset( $this->_update_details ) ) {
@@ -568,7 +552,7 @@
false,
fs_request_get_bool( 'force-check' ),
FS_Plugin_Updater::UPDATES_CHECK_CACHE_EXPIRATION,
- $current_plugin_version
+ $this->_fs->get_plugin_version()
);
$this->_update_details = false;
--- a/primary-addon-for-elementor/freemius/includes/entities/class-fs-plugin-plan.php
+++ b/primary-addon-for-elementor/freemius/includes/entities/class-fs-plugin-plan.php
@@ -13,7 +13,6 @@
/**
* Class FS_Plugin_Plan
*
- * @property FS_Pricing[] $pricing
*/
class FS_Plugin_Plan extends FS_Entity {
--- a/primary-addon-for-elementor/freemius/includes/entities/class-fs-site.php
+++ b/primary-addon-for-elementor/freemius/includes/entities/class-fs-site.php
@@ -10,16 +10,16 @@
exit;
}
- /**
- * @property int $blog_id
- */
- #[AllowDynamicProperties]
class FS_Site extends FS_Scope_Entity {
/**
* @var number
*/
public $site_id;
/**
+ * @var int
+ */
+ public $blog_id;
+ /**
* @var number
*/
public $plugin_id;
@@ -190,7 +190,7 @@
fs_ends_with( $subdomain, '.cloudwaysapps.com' ) ||
// Kinsta
(
- ( fs_starts_with( $subdomain, 'staging-' ) || fs_starts_with( $subdomain, 'env-' ) ) &&
+ ( fs_starts_with( $subdomain, 'stg-' ) || fs_starts_with( $subdomain, 'staging-' ) || fs_starts_with( $subdomain, 'env-' ) ) &&
( fs_ends_with( $subdomain, '.kinsta.com' ) || fs_ends_with( $subdomain, '.kinsta.cloud' ) )
) ||
// DesktopServer
@@ -208,6 +208,40 @@
);
}
+ /**
+ * @author Leo Fajardo (@leorw)
+ * @since 2.9.1
+ *
+ * @param string $host
+ *
+ * @return bool
+ */
+ static function is_playground_wp_environment_by_host( $host ) {
+ // Services aimed at providing a WordPress sandbox environment.
+ $sandbox_wp_environment_domains = array(
+ // InstaWP
+ 'instawp.xyz',
+
+ // TasteWP
+ 'tastewp.com',
+
+ // WordPress Playground
+ 'playground.wordpress.net',
+ );
+
+ foreach ( $sandbox_wp_environment_domains as $domain) {
+ if (
+ ( $host === $domain ) ||
+ fs_ends_with( $host, '.' . $domain ) ||
+ fs_ends_with( $host, '-' . $domain )
+ ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
function is_localhost() {
return ( WP_FS__IS_LOCALHOST_FOR_SERVER || self::is_localhost_by_address( $this->url ) );
}
--- a/primary-addon-for-elementor/freemius/includes/entities/class-fs-user.php
+++ b/primary-addon-for-elementor/freemius/includes/entities/class-fs-user.php
@@ -48,6 +48,19 @@
parent::__construct( $user );
}
+ /**
+ * This method removes the deprecated 'is_beta' property from the serialized data.
+ * Should clean up the serialized data to avoid PHP 8.2 warning on next execution.
+ *
+ * @return void
+ */
+ function __wakeup() {
+ if ( property_exists( $this, 'is_beta' ) ) {
+ // If we enter here, and we are running PHP 8.2, we already had the warning. But we sanitize data for next execution.
+ unset( $this->is_beta );
+ }
+ }
+
function get_name() {
return trim( ucfirst( trim( is_string( $this->first ) ? $this->first : '' ) ) . ' ' . ucfirst( trim( is_string( $this->last ) ? $this->last : '' ) ) );
}
--- a/primary-addon-for-elementor/freemius/includes/managers/class-fs-admin-menu-manager.php
+++ b/primary-addon-for-elementor/freemius/includes/managers/class-fs-admin-menu-manager.php
@@ -699,16 +699,36 @@
$menu = $this->find_main_submenu();
}
+ $menu_slug = $menu['menu'][2];
$parent_slug = isset( $menu['parent_slug'] ) ?
- $menu['parent_slug'] :
- 'admin.php';
+ $menu['parent_slug'] :
+ 'admin.php';
- return admin_url(
- $parent_slug .
- ( false === strpos( $parent_slug, '?' ) ? '?' : '&' ) .
- 'page=' .
- $menu['menu'][2]
- );
+ if ( fs_apply_filter( $this->_module_unique_affix, 'enable_cpt_advanced_menu_logic', false ) ) {
+ $parent_slug = 'admin.php';
+
+ /**
+ * This line and the `if` block below it are based on the `menu_page_url()` function of WordPress.
+ *
+ * @author Leo Fajardo (@leorw)
+ * @since 2.10.2
+ */
+ global $_parent_pages;
+
+ if ( ! empty( $_parent_pages[ $menu_slug ] ) ) {
+ $_parent_slug = $_parent_pages[ $menu_slug ];
+ $parent_slug = isset( $_parent_pages[ $_parent_slug ] ) ?
+ $parent_slug :
+ $menu['parent_slug'];
+ }
+ }
+
+ return admin_url(
+ $parent_slug .
+ ( false === strpos( $parent_slug, '?' ) ? '?' : '&' ) .
+ 'page=' .
+ $menu_slug
+ );
}
/**
--- a/primary-addon-for-elementor/freemius/includes/managers/class-fs-admin-notice-manager.php
+++ b/primary-addon-for-elementor/freemius/includes/managers/class-fs-admin-notice-manager.php
@@ -194,8 +194,14 @@
* @since 1.0.7
*/
static function _add_sticky_dismiss_javascript() {
+ $sticky_admin_notice_js_template_name = 'sticky-admin-notice-js.php';
+
+ if ( ! file_exists( fs_get_template_path( $sticky_admin_notice_js_template_name ) ) ) {
+ return;
+ }
+
$params = array();
- fs_require_once_template( 'sticky-admin-notice-js.php', $params );
+ fs_require_once_template( $sticky_admin_notice_js_template_name, $params );
}
private static $_added_sticky_javascript = false;
--- a/primary-addon-for-elementor/freemius/start.php
+++ b/primary-addon-for-elementor/freemius/start.php
@@ -15,7 +15,7 @@
*
* @var string
*/
- $this_sdk_version = '2.9.0';
+ $this_sdk_version = '2.11.0';
#region SDK Selection Logic --------------------------------------------------------------------
@@ -36,7 +36,16 @@
require_once dirname( __FILE__ ) . '/includes/fs-essential-functions.php';
}
- /**
+ /**
+ * We updated the logic to support SDK loading from a subfolder of a theme as well as from a parent theme
+ * If the SDK is found in the active theme, it sets the relative path accordingly.
+ * If not, it checks the parent theme and sets the relative path if found there.
+ * This allows the SDK to be loaded from composer dependencies or from a custom `vendor/freemius` folder.
+ *
+ * @author Daniele Alessandra (@DanieleAlessandra)
+ * @since 2.9.0.5
+ *
+ *
* This complex logic fixes symlink issues (e.g. with Vargant). The logic assumes
* that if it's a file from an SDK running in a theme, the location of the SDK
* is in the main theme's folder.
@@ -83,16 +92,50 @@
*/
$themes_directory = get_theme_root( get_stylesheet() );
$themes_directory_name = basename( $themes_directory );
- $theme_candidate_basename = basename( dirname( $fs_root_path ) ) . '/' . basename( $fs_root_path );
- if ( $file_path == fs_normalize_path( realpath( trailingslashit( $themes_directory ) . $theme_candidate_basename . '/' . basename( $file_path ) ) )
- ) {
- $this_sdk_relative_path = '../' . $themes_directory_name . '/' . $theme_candidate_basename;
- $is_theme = true;
- } else {
- $this_sdk_relative_path = plugin_basename( $fs_root_path );
- $is_theme = false;
- }
+ // This change ensures that the condition works even if the SDK is located in a subdirectory (e.g., vendor)
+ $theme_candidate_sdk_basename = str_replace( $themes_directory . '/' . get_stylesheet() . '/', '', $fs_root_path );
+
+ // Check if the current file is part of the active theme.
+ $is_current_sdk_from_active_theme = $file_path == $themes_directory . '/' . get_stylesheet() . '/' . $theme_candidate_sdk_basename . '/' . basename( $file_path );
+ $is_current_sdk_from_parent_theme = false;
+
+ // Check if the current file is part of the parent theme.
+ if ( ! $is_current_sdk_from_active_theme ) {
+ $theme_candidate_sdk_basename = str_replace( $themes_directory . '/' . get_template() . '/',
+ '',
+ $fs_root_path );
+ $is_current_sdk_from_parent_theme = $file_path == $themes_directory . '/' . get_template() . '/' . $theme_candidate_sdk_basename . '/' . basename( $file_path );
+ }
+
+ $theme_name = null;
+ if ( $is_current_sdk_from_active_theme ) {
+ $theme_name = get_stylesheet();
+ $this_sdk_relative_path = '../' . $themes_directory_name . '/' . $theme_name . '/' . $theme_candidate_sdk_basename;
+ $is_theme = true;
+ } else if ( $is_current_sdk_from_parent_theme ) {
+ $theme_name = get_template();
+ $this_sdk_relative_path = '../' . $themes_directory_name . '/' . $theme_name . '/' . $theme_candidate_sdk_basename;
+ $is_theme = true;
+ } else {
+ $this_sdk_relative_path = plugin_basename( $fs_root_pa