Plugin Directory

Changeset 2504343


Ignore:
Timestamp:
03/27/2021 06:36:39 AM (5 years ago)
Author:
moveaddons
Message:

Capability With latest WordPress version
Solved HTML tag validation issue

Location:
move-addons
Files:
235 added
8 edited

Legend:

Unmodified
Added
Removed
  • move-addons/trunk/includes/helper-functions.php

    r2484127 r2504343  
    110110    ];
    111111    return $html_tag_list;
     112}
     113
     114/**
     115 * HTML Tag Validation
     116 * @return strig
     117 */
     118function move_addons_validate_html_tag( $tag ) {
     119    $allowed_html_tags = [
     120        'article',
     121        'aside',
     122        'footer',
     123        'header',
     124        'section',
     125        'nav',
     126        'main',
     127        'div',
     128        'h1',
     129        'h2',
     130        'h3',
     131        'h4',
     132        'h5',
     133        'h6',
     134        'p',
     135        'span',
     136    ];
     137    return in_array( strtolower( $tag ), $allowed_html_tags ) ? $tag : 'div';
     138}
     139
     140/**
     141 * [move_addons_escape_html_data]
     142 * @param  [HTML] $content
     143 * @return [HTML] validate html data
     144 */
     145function move_addons_escape_html_data( $content ){
     146    $allow_html = array(
     147        'a' => array(
     148            'href' => array(),
     149            'title' => array()
     150        ),
     151        'br' => array(),
     152        'em' => array(),
     153        'strong' => array(),
     154    );
     155    return wp_kses( $content, $allow_html );
    112156}
    113157
  • move-addons/trunk/includes/widgets/dual-color-heading/widget.php

    r2369917 r2504343  
    844844                    'label' => esc_html__( 'Color', 'moveaddons' ),
    845845                    'type' => Controls_Manager::COLOR,
    846                     'scheme' => [
    847                         'type' => \Elementor\Scheme_Color::get_type(),
    848                         'value' => \Elementor\Scheme_Color::COLOR_1,
    849                     ],
    850                     'default' => '#1D39D7',
    851846                    'selectors' => [
    852847                        '{{WRAPPER}} .htmove-heading .htmove-heighlight-txt' => 'color: {{VALUE}};',
     
    961956        if( !empty( $subheading ) ){
    962957            $this->add_render_attribute( 'sub_heading_attr', 'class', 'htmove-heading-sub-title' );
    963             $sub_heading = sprintf( '<%1$s %4$s %2$s>%3$s</%1$s>', $settings['sub_heading_tag'], $this->get_render_attribute_string( 'sub_heading_attr' ), $subheading, $sub_heading_pl_txt );
     958            $sub_heading_html_tag = move_addons_validate_html_tag( $settings['sub_heading_tag'] );
     959            $sub_heading = sprintf( '<%1$s %4$s %2$s>%3$s</%1$s>', $sub_heading_html_tag, $this->get_render_attribute_string( 'sub_heading_attr' ), $subheading, $sub_heading_pl_txt );
    964960        }
    965961
    966962        if( !empty( $heading ) ){
    967963            $this->add_render_attribute( 'heading_attr', 'class', 'htmove-heading-title' );
    968 
     964            $heading_html_tag = move_addons_validate_html_tag( $settings['heading_tag'] );
    969965            if ( $settings['heading_highlight_txt_pos'] == 'before' ) {
    970                 $heading_text = sprintf( '<%1$s %4$s %2$s>%5$s %3$s</%1$s>', $settings['heading_tag'], $this->get_render_attribute_string( 'heading_attr' ), $heading, $heading_pl_txt, $highlight_txt );
     966                $heading_text = sprintf( '<%1$s %4$s %2$s>%5$s %3$s</%1$s>', $heading_html_tag, $this->get_render_attribute_string( 'heading_attr' ), $heading, $heading_pl_txt, $highlight_txt );
    971967            }else{
    972                 $heading_text = sprintf( '<%1$s %4$s %2$s>%3$s %5$s</%1$s>', $settings['heading_tag'], $this->get_render_attribute_string( 'heading_attr' ), $heading, $heading_pl_txt, $highlight_txt );
     968                $heading_text = sprintf( '<%1$s %4$s %2$s>%3$s %5$s</%1$s>', $heading_html_tag, $this->get_render_attribute_string( 'heading_attr' ), $heading, $heading_pl_txt, $highlight_txt );
    973969            }
    974970        }
     
    976972        if( !empty( $des_heading ) ){
    977973            $this->add_render_attribute( 'des_heading_attr', 'class', 'htmove-heading-desc' );
    978             $heading_des = sprintf( '<%1$s %2$s>%3$s</%1$s>', $settings['desc_heading_tag'], $this->get_render_attribute_string( 'des_heading_attr' ), $des_heading );
     974            $desc_heading_html_tag = move_addons_validate_html_tag( $settings['desc_heading_tag'] );
     975            $heading_des = sprintf( '<%1$s %2$s>%3$s</%1$s>', $desc_heading_html_tag, $this->get_render_attribute_string( 'des_heading_attr' ), $des_heading );
    979976        }
    980977
  • move-addons/trunk/includes/widgets/flip-box/widget.php

    r2414668 r2504343  
    12471247        if( !empty( $title ) ){
    12481248            $this->add_render_attribute( $side.'_title_attr', 'class', 'htmove-flipbox-title' );
    1249             $title = sprintf( '<%1$s %2$s>%3$s</%1$s>', $settings['title_tag'], $this->get_render_attribute_string( $side.'_title_attr' ), $title );
     1249            $title_html_tag = move_addons_validate_html_tag( $settings['title_tag'] );
     1250            $title = sprintf( '<%1$s %2$s>%3$s</%1$s>', $title_html_tag, $this->get_render_attribute_string( $side.'_title_attr' ), $title );
    12501251        }
    12511252
  • move-addons/trunk/includes/widgets/heading/widget.php

    r2369917 r2504343  
    869869                    'label' => esc_html__( 'Color', 'moveaddons' ),
    870870                    'type' => Controls_Manager::COLOR,
    871                     'scheme' => [
    872                         'type' => \Elementor\Scheme_Color::get_type(),
    873                         'value' => \Elementor\Scheme_Color::COLOR_1,
    874                     ],
    875                     'default' => '#E6E6E6',
    876871                    'selectors' => [
    877872                        '{{WRAPPER}} .htmove-heading.htmove-heading-placeholder .htmove-heading-sub-title::before' => 'color: {{VALUE}};',
     
    884879                [
    885880                    'name' => 'transparent_subheading_typography',
    886                     'scheme' => \Elementor\Scheme_Typography::TYPOGRAPHY_1,
    887881                    'selector' => '{{WRAPPER}} .htmove-heading.htmove-heading-placeholder .htmove-heading-sub-title::before',
    888882                    'separator'=>'before',
     
    958952        if( !empty( $subheading ) ){
    959953            $this->add_render_attribute( 'sub_heading_attr', 'class', 'htmove-heading-sub-title' );
    960             $sub_heading = sprintf( '<%1$s %4$s %2$s>%3$s</%1$s>', $settings['sub_heading_tag'], $this->get_render_attribute_string( 'sub_heading_attr' ), $subheading, $sub_heading_pl_txt );
     954            $sub_heading_html_tag = move_addons_validate_html_tag( $settings['sub_heading_tag'] );
     955            $sub_heading = sprintf( '<%1$s %4$s %2$s>%3$s</%1$s>', $sub_heading_html_tag, $this->get_render_attribute_string( 'sub_heading_attr' ), $subheading, $sub_heading_pl_txt );
    961956        }
    962957
    963958        if( !empty( $heading ) ){
    964959            $this->add_render_attribute( 'heading_attr', 'class', 'htmove-heading-title' );
    965             $heading_text = sprintf( '<%1$s %4$s %2$s>%3$s</%1$s>', $settings['heading_tag'], $this->get_render_attribute_string( 'heading_attr' ), $heading, $heading_pl_txt );
     960            $heading_html_tag = move_addons_validate_html_tag( $settings['heading_tag'] );
     961            $heading_text = sprintf( '<%1$s %4$s %2$s>%3$s</%1$s>', $heading_html_tag, $this->get_render_attribute_string( 'heading_attr' ), $heading, $heading_pl_txt );
    966962        }
    967963
    968964        if( !empty( $des_heading ) ){
    969965            $this->add_render_attribute( 'des_heading_attr', 'class', 'htmove-heading-desc' );
    970             $heading_des = sprintf( '<%1$s %2$s>%3$s</%1$s>', $settings['desc_heading_tag'], $this->get_render_attribute_string( 'des_heading_attr' ), $des_heading );
     966            $desc_heading_html_tag = move_addons_validate_html_tag( $settings['desc_heading_tag'] );
     967            $heading_des = sprintf( '<%1$s %2$s>%3$s</%1$s>', $desc_heading_html_tag, $this->get_render_attribute_string( 'des_heading_attr' ), $des_heading );
    971968        }
    972969
  • move-addons/trunk/includes/widgets/image-box/widget.php

    r2369917 r2504343  
    837837                    <?php
    838838                        if( !empty( $settings['title'] ) ){
    839                             echo sprintf( '<%1$s class="%2$s">%3$s</%1$s>', $settings['title_tag'], 'htmove-image-box-title', $settings['title'] );
     839                            $title_html_tag = move_addons_validate_html_tag( $settings['title_tag'] );
     840                            echo sprintf( '<%1$s class="%2$s">%3$s</%1$s>', $title_html_tag, 'htmove-image-box-title', move_addons_escape_html_data( $settings['title'] ) );
    840841                        }
    841842
    842843                        if( !empty( $settings['description'] ) ){
    843                             echo sprintf('<div class="htmove-image-box-text"><%1$s class="%2$s">%3$s</%1$s></div>','div','htmove-description', $settings['description'] );
     844                            echo sprintf('<div class="htmove-image-box-text"><%1$s class="%2$s">%3$s</%1$s></div>','div','htmove-description', move_addons_escape_html_data( $settings['description'] ) );
    844845                        }
    845846                        if( $settings['box_style'] != 'two' ){
  • move-addons/trunk/includes/widgets/info-box/widget.php

    r2483367 r2504343  
    764764        if( !empty( $title ) ){
    765765            $this->add_render_attribute( 'title_attr', 'class', 'htmove-infobox-title' );
    766             $title = sprintf( '<%1$s %2$s>%3$s</%1$s>', $settings['title_tag'], $this->get_render_attribute_string( 'title_attr' ), $title );
     766            $title_html_tag = move_addons_validate_html_tag( $settings['title_tag'] );
     767            $title = sprintf( '<%1$s %2$s>%3$s</%1$s>', $title_html_tag, $this->get_render_attribute_string( 'title_attr' ), $title );
    767768        }
    768769
  • move-addons/trunk/move-addons.php

    r2483367 r2504343  
    66 * Author:      moveaddons
    77 * Author URI:  https://moveaddons.com
    8  * Version:     1.0.8
     8 * Version:     1.0.9
    99 * License:     GPL2
    1010 * License URI:  https://www.gnu.org/licenses/gpl-2.0.html
     
    1515if( ! defined( 'ABSPATH' ) ) exit(); // Exit if accessed directly
    1616
    17 define( 'MOVE_ADDONS_VERSION', '1.0.8' );
     17define( 'MOVE_ADDONS_VERSION', '1.0.9' );
    1818define( 'MOVE_ADDONS_FILE', __FILE__ );
    1919define( 'MOVE_ADDONS_PL_PATH', plugin_dir_path( MOVE_ADDONS_FILE ) );
  • move-addons/trunk/readme.txt

    r2483367 r2504343  
    33Tags: Elementor, Elementor Addons, Elementor Widgets, elementor page builder, Elementor Blocks
    44Requires at least: 4.7
    5 Tested up to: 5.6.2
     5Tested up to: 5.7
    66Stable tag: trunk
    77License: GPLv2 or later
     
    216216
    217217== Changelog ==
     218
     219= Version: 1.0.9 - Date: 2021-03-27 =
     220* Capability with latest WordPress version.
     221* Solved HTML Tags Validation issue.
     222
    218223= Version: 1.0.8 - Date: 2021-03-01 =
    219224* Increased style option in few addons.
Note: See TracChangeset for help on using the changeset viewer.