Plugin Directory

Changeset 2841803


Ignore:
Timestamp:
12/31/2022 02:00:26 PM (3 years ago)
Author:
liquidpoll
Message:

Fix issues

Location:
wp-poll
Files:
285 added
16 edited

Legend:

Unmodified
Added
Removed
  • wp-poll/trunk/assets/front/css/style-nps.css

    r2835348 r2841803  
    44
    55.nps-single {
    6     display: flex;
    7     justify-content: center;
     6    /*display: flex;*/
     7    /*justify-content: center;*/
    88    margin: 50px 0;
    99}
     
    1111.nps-single .nps-form {
    1212    width: 700px;
     13    margin: auto;
    1314}
    1415
  • wp-poll/trunk/assets/front/css/style.css

    r2839280 r2841803  
    16591659}
    16601660
     1661@media (max-width: 425px) {
     1662    .poll-single:not(.inside-embed) {
     1663        margin: 70px 15px !important;
     1664    }
     1665}
     1666
     1667@media (max-width: 375px) {
     1668
     1669    .poll-single:not(.inside-embed) {
     1670        margin: 70px 15px !important;
     1671    }
     1672
     1673    p.liquidpoll-responses {
     1674        font-size: 14px;
     1675        padding: 15px 0 15px 20px;
     1676    }
     1677
     1678    p.liquidpoll-responses .icon-box {
     1679        width: 50px;
     1680        height: 50px;
     1681    }
     1682}
     1683
     1684@media (max-width: 320px) {
     1685
     1686    .liquidpoll-button {
     1687        font-size: 16px;
     1688    }
     1689
     1690    .poll-single:not(.inside-embed) {
     1691        margin: 70px 15px !important;
     1692    }
     1693
     1694    p.liquidpoll-responses {
     1695        font-size: 12px;
     1696        padding: 12px 0 12px 25px;
     1697    }
     1698
     1699    p.liquidpoll-responses .icon-box {
     1700        width: 45px;
     1701        height: 45px;
     1702    }
     1703}
     1704
    16611705
    16621706/**
     
    16681712    padding: 30px 50px;
    16691713    border-radius: 5px;
    1670     margin: 20px 0;
     1714    margin: 20px auto;
     1715    display: block;
     1716}
     1717
     1718.liquidpoll-form:not(.display) {
    16711719    display: none;
    16721720}
  • wp-poll/trunk/includes/classes/class-hooks.php

    r2839280 r2841803  
    2222            add_action( 'manage_poll_posts_columns', array( $this, 'add_core_poll_columns' ), 16, 1 );
    2323            add_action( 'manage_poll_posts_custom_column', array( $this, 'custom_columns_content' ), 10, 2 );
     24            add_action( 'restrict_manage_posts', array( $this, 'add_dropdown_for_poll_type' ), 10, 2 );
     25            add_filter( 'parse_query', array( $this, 'filter_poll_type' ), 10, 2 );
    2426            add_filter( 'post_row_actions', array( $this, 'remove_row_actions' ), 10, 1 );
    2527
     
    482484
    483485
     486        /**
     487         * Filter poll type
     488         *
     489         * @param $query
     490         *
     491         * @return void
     492         */
     493        function filter_poll_type( $query ) {
     494
     495            global $pagenow;
     496
     497            $post_type   = isset( $_GET['post_type'] ) ? sanitize_text_field( $_GET['post_type'] ) : '';
     498            $filter_type = isset( $_REQUEST['poll_type'] ) ? sanitize_text_field( $_REQUEST['poll_type'] ) : '';
     499
     500            if ( is_admin() && 'poll' == $post_type && 'edit.php' == $pagenow && $filter_type ) {
     501                $query->query_vars['meta_key']   = '_type';
     502                $query->query_vars['meta_value'] = $filter_type;
     503            }
     504        }
     505
     506
     507        /**
     508         * Add dropdown filter for poll type
     509         *
     510         * @return void
     511         */
     512        function add_dropdown_for_poll_type() {
     513
     514            $filter_type = isset( $_REQUEST['poll_type'] ) ? sanitize_text_field( $_REQUEST['poll_type'] ) : '';
     515
     516            ?>
     517            <div class="alignleft ">
     518                <form action="<?php echo admin_url( 'edit.php?post_type=poll' ); ?>" method="get">
     519                    <label>
     520                        <select name="poll_type">
     521                            <option value=""><?php esc_html_e( 'All Types', 'wp-poll' ); ?></option>
     522                            <option <?php selected( $filter_type, 'poll' ); ?> value="poll"><?php esc_html_e( 'Poll', 'wp-poll' ); ?></option>
     523                            <option <?php selected( $filter_type, 'nps' ); ?> value="nps"><?php esc_html_e( 'NPS', 'wp-poll' ); ?></option>
     524                            <option <?php selected( $filter_type, 'reaction' ); ?> value="reaction"><?php esc_html_e( 'Reaction', 'wp-poll' ); ?></option>
     525                        </select>
     526                    </label>
     527                </form>
     528            </div>
     529            <?php
     530        }
     531
     532
    484533        function add_core_poll_columns( $columns ) {
    485534
  • wp-poll/trunk/includes/classes/class-meta-boxes.php

    r2839280 r2841803  
    164164                            'availability' => liquidpoll()->is_pro() ? '' : 'pro',
    165165                        ),
    166                         'subscription' => array(
    167                             'label'        => esc_html__( 'Subscription', 'wp-poll' ),
    168                             'availability' => 'upcoming',
    169                         ),
    170                         'feedback'     => array(
    171                             'label'        => esc_html__( 'Feedback', 'wp-poll' ),
     166                        'reviews' => array(
     167                            'label'        => esc_html__( 'Reviews', 'wp-poll' ),
    172168                            'availability' => 'upcoming',
    173169                        ),
  • wp-poll/trunk/includes/elementor/class-elementor.php

    r2835348 r2841803  
    3434        function register_widgets() {
    3535
     36            require_once LIQUIDPOLL_PLUGIN_DIR . 'includes/elementor/class-widget-base.php';
     37            include_once LIQUIDPOLL_PLUGIN_DIR . 'includes/elementor/widget-nps/widget.php';
    3638            include_once LIQUIDPOLL_PLUGIN_DIR . 'includes/elementor/widget-poll/widget.php';
     39            include_once LIQUIDPOLL_PLUGIN_DIR . 'includes/elementor/widget-reaction/widget.php';
    3740
     41            Plugin::instance()->widgets_manager->register( new LIQUIDPOLL_Widget_nps );
    3842            Plugin::instance()->widgets_manager->register( new LIQUIDPOLL_Widget_poll );
     43            Plugin::instance()->widgets_manager->register( new LIQUIDPOLL_Widget_reaction );
    3944        }
    4045
     
    4752        public function register_scripts() {
    4853            wp_enqueue_script( 'rangeslider-el', LIQUIDPOLL_PLUGIN_URL . 'assets/front/js/rangeslider.min.js', array( 'jquery' ) );
     54            wp_register_script( 'widget-nps', LIQUIDPOLL_PLUGIN_URL . 'includes/elementor/widget-nps/js/scripts.js', array( 'jquery' ), $this->version );
    4955            wp_register_script( 'widget-poll', LIQUIDPOLL_PLUGIN_URL . 'includes/elementor/widget-poll/js/scripts.js', array( 'jquery' ), $this->version );
    5056        }
  • wp-poll/trunk/includes/elementor/widget-poll/js/scripts.js

    r2835348 r2841803  
    99        elementorFrontend.hooks.addAction('frontend/element_ready/liquidpoll-widget-poll.default', function (scope, $) {
    1010
    11             let $r = $(scope).find('input[type="range"]'), $ruler = $('<div class="rangeslider__ruler" />');
     11            let optionSingle = $('.liquidpoll-option-single');
    1212
    13             $r.rangeslider({
    14                 polyfill: false,
    15                 onInit: function () {
    16                     $ruler[0].innerHTML = getRulerRange(this.min, this.max, this.step);
    17                     this.$range.prepend($ruler);
    18                 },
    19                 onSlide: function (position, value) {
    20 
    21                     let npsSingle = $r.parent().parent(),
    22                         npsCommentBox = npsSingle.find('.liquidpoll-comment-box'),
    23                         npsSubmitButton = npsSingle.find('.nps-button-wrap > .liquidpoll-submit-poll');
    24 
    25                     if (value > 0) {
    26                         npsCommentBox.fadeIn('300');
    27                         npsSubmitButton.fadeIn('300');
    28                     }
    29                 }
     13            optionSingle.on('click', function () {
     14                optionSingle.removeClass('active');
     15                $(this).addClass('active');
    3016            });
    3117
    32             function getRulerRange(min, max, step) {
    33                 let range = '', i = 0;
    34                 while (i <= max) {
    35                     range += i + ' ';
    36                     i = i + step;
    37                 }
    38                 return range;
    39             }
    40 
    41             $.fn.roundSlider.prototype._invertRange = true;
    42             let roundHandle = $(scope).find('#nps_score');
    43 
    44             // this is core functionality to generate the numbers
    45             $.fn.roundSlider.prototype.defaults.create = function () {
    46                 let o = this.options, tickInterval = 1;
    47 
    48                 for (let i = o.min; i <= o.max; i += tickInterval) {
    49                     let angle = this._valueToAngle(i),
    50                         numberTag = this._addSeperator(angle, "rs-custom"),
    51                         number = numberTag.children();
    52 
    53                     number.clone().css({
    54                         "width": o.width + this._border(),
    55                         "margin-top": this._border(true) / -2
    56                     });
    57                     number.removeClass().addClass("rs-number").html(i).rsRotate(-angle);
    58                 }
    59             }
    60             roundHandle.roundSlider({
    61                 sliderType: "min-range",
    62                 editableTooltip: false,
    63                 showTooltip: false,
    64                 radius: 300,
    65                 width: 30,
    66                 value: 0,
    67                 handleShape: "square",
    68                 handleSize: 20,
    69                 circleShape: "half-top",
    70                 startAngle: 0,
    71                 min: 0,
    72                 max: 10,
    73                 step: 1,
    74                 change: "onValueChange",
    75             });
    76             roundHandle.on('change', function (e) {
    77                 let colors = ['#6265ea', '#6866e8', '#6766e9', '#6d68e8', '#7369e6', '#7a6be4', '#7f6be2', '#866de1', '#876ddf', '#8a6ddf', '#8b6edf'];
    78                 document.documentElement.style.setProperty('--bgcolor', colors[e.value]);
    79 
    80                 if (e.value > 0 && e.value < 10) {
    81 
    82                     let npsSingle = roundHandle.parent(),
    83                         npsCommentBox = npsSingle.find('.liquidpoll-comment-box'),
    84                         npsSubmitButton = npsSingle.find('.nps-button-wrap > .liquidpoll-submit-poll');
    85 
    86                     roundHandle.attr('val', 'yes-' + e.value);
    87                     npsCommentBox.fadeIn('300');
    88                     npsSubmitButton.fadeIn('300');
    89                 } else {
    90                     roundHandle.attr('val', '0');
    91                 }
     18            $('.theme-6, .theme-7').on('click', function () {
     19                $(this).find('.liquidpoll-option-single input[name="submit_poll_option"]').not(':checked').prop("checked", true);
    9220            });
    9321        });
  • wp-poll/trunk/includes/elementor/widget-poll/views/template-1.php

    r2835348 r2841803  
    44 */
    55
    6 global $poll, $liquidpoll_widget_settings;
     6global $poll;
    77
    8 $poll_type = isset( $liquidpoll_widget_settings['_type'] ) ? $liquidpoll_widget_settings['_type'] : '';
    9 $key       = 'poll_id_' . $poll_type;
    10 $poll_id   = liquidpoll()->get_widget_arg_val( $key );
     8$poll_id   = liquidpoll()->get_widget_arg_val( 'poll_id_poll' );
    119$poll      = liquidpoll_get_poll( $poll_id );
    1210
     
    1513}
    1614
    17 //wp_enqueue_script( 'rangeslider', LIQUIDPOLL_PLUGIN_URL . 'assets/front/js/rangeslider.min.js', array( 'jquery', 'elementor-frontend' ) );
    18 //wp_enqueue_style( 'rangeslider', LIQUIDPOLL_PLUGIN_URL . 'assets/front/css/rangeslider.css' );
    19 
    2015printf( '<div class="liquidpoll-elementor-poll">%s</div>', do_shortcode( '[poll id="' . $poll->get_id() . '"]' ) );
    21 
    22 ?>
    23 <script>
    24 
    25 </script>
  • wp-poll/trunk/includes/elementor/widget-poll/widget.php

    r2839280 r2841803  
    1313
    1414
    15 class LIQUIDPOLL_Widget_poll extends Widget_base {
     15class LIQUIDPOLL_Widget_poll extends LIQUIDPOLL_Widget_base {
    1616
    1717    public function get_name() {
     
    2020
    2121    public function get_title() {
    22         return esc_html__( 'Liquidpoll - Widget Poll', 'wp-poll' );
     22        return esc_html__( 'Liquidpoll - Poll', 'wp-poll' );
    2323    }
    2424
    2525    public function get_icon() {
    26         return 'fa fa-heart';
     26        return 'eicon-checkbox';
    2727    }
    2828
     
    8484            'label'     => esc_html__( 'Form', 'wp-poll' ),
    8585            'tab'       => Controls_Manager::TAB_CONTENT,
    86             'condition' => [ '_type' => [ 'poll' ] ],
    8786        ) );
    8887        $this->controls_for_content_form();
     
    9998        $this->controls_for_style();
    10099        $this->end_controls_section();
    101     }
    102 
    103 
    104     protected function controls_for_content_form() {
    105 
    106         $this->add_control( 'poll_form_enable', [
    107             'label' => esc_html__( 'Enable Form', 'wp-poll' ),
    108             'type'  => Controls_Manager::SWITCHER,
    109         ] );
    110 
    111         $this->add_control( 'poll_form_fields', [
    112             'label'     => esc_html__( 'Form Fields', 'wp-poll' ),
    113             'type'      => Controls_Manager::HEADING,
     100
     101        /**
     102         * Main Tab - Form Style
     103         */
     104        $this->start_controls_section( 'section_form_style', [
     105            'label'     => esc_html__( 'Form Style', 'wp-poll' ),
     106            'tab'       => Controls_Manager::TAB_STYLE,
    114107            'condition' => [ 'poll_form_enable' => 'yes', ],
    115             'separator' => 'before',
    116         ] );
    117 
    118         $this->add_control( 'poll_form_label_first_name', [
    119             'label'     => esc_html__( 'First Name Label', 'wp-poll' ),
    120             'type'      => Controls_Manager::TEXT,
    121             'condition' => [ 'poll_form_enable' => 'yes', ],
    122         ] );
    123 
    124         $this->add_control( 'poll_form_label_email', [
    125             'label'     => esc_html__( 'Email Address Label', 'wp-poll' ),
    126             'type'      => Controls_Manager::TEXT,
    127             'condition' => [ 'poll_form_enable' => 'yes', ],
    128         ] );
    129 
    130         $this->add_control( 'enable_last_name', [
    131             'label'     => esc_html__( 'Enable Last Name', 'wp-poll' ),
    132             'type'      => Controls_Manager::SWITCHER,
    133             'condition' => [ 'poll_form_enable' => 'yes', ],
    134         ] );
    135 
    136         $this->add_control( 'poll_form_label_last_name', [
    137             'label'     => esc_html__( 'Last Name Label', 'wp-poll' ),
    138             'type'      => Controls_Manager::TEXT,
    139             'condition' => [ 'poll_form_enable' => 'yes', 'enable_last_name' => 'yes' ],
    140         ] );
    141 
    142         $this->add_control( 'poll_form_label_button', [
    143             'label'     => esc_html__( 'Submit Button Label', 'wp-poll' ),
    144             'type'      => Controls_Manager::TEXT,
    145             'condition' => [ 'poll_form_enable' => 'yes', ],
    146         ] );
    147 
    148         $this->add_control( 'poll_form_content', [
    149             'label'     => esc_html__( 'Form Content', 'wp-poll' ),
    150             'type'      => Controls_Manager::TEXTAREA,
    151             'condition' => [ 'poll_form_enable' => 'yes', ],
    152         ] );
    153 
    154         $this->add_control( 'poll_form_notice', [
    155             'label'     => esc_html__( 'Form Notice', 'wp-poll' ),
    156             'type'      => Controls_Manager::TEXTAREA,
    157             'condition' => [ 'poll_form_enable' => 'yes', ],
    158         ] );
    159 
    160         $this->add_control( 'form_styling', [
    161             'label'     => esc_html__( 'Form Styling', 'wp-poll' ),
    162             'type'      => Controls_Manager::HEADING,
    163             'condition' => [ 'poll_form_enable' => 'yes', ],
    164             'separator' => 'before',
    165         ] );
    166 
    167         $this->add_control( 'poll_form_style_colors', [
    168             'label'     => esc_html__( 'Colors', 'wp-poll' ),
    169             'type'      => Controls_Manager::SWITCHER,
    170             'condition' => [ 'poll_form_enable' => 'yes', ],
    171         ] );
    172 
    173         $this->add_control( 'form_bg', [
    174             'label'     => esc_html__( 'Form Bg', 'wp-poll' ),
    175             'type'      => Controls_Manager::COLOR,
    176             'condition' => [ 'poll_form_enable' => 'yes', 'poll_form_style_colors' => 'yes' ],
    177         ] );
    178 
    179         $this->add_control( 'content', [
    180             'label'     => esc_html__( 'Content', 'wp-poll' ),
    181             'type'      => Controls_Manager::COLOR,
    182             'condition' => [ 'poll_form_enable' => 'yes', 'poll_form_style_colors' => 'yes' ],
    183         ] );
    184 
    185         $this->add_control( 'button_normal', [
    186             'label'     => esc_html__( 'Button', 'wp-poll' ),
    187             'type'      => Controls_Manager::COLOR,
    188             'condition' => [ 'poll_form_enable' => 'yes', 'poll_form_style_colors' => 'yes' ],
    189         ] );
    190 
    191         $this->add_control( 'button_bg', [
    192             'label'     => esc_html__( 'Button Bg', 'wp-poll' ),
    193             'type'      => Controls_Manager::COLOR,
    194             'condition' => [ 'poll_form_enable' => 'yes', 'poll_form_style_colors' => 'yes' ],
    195         ] );
    196 
    197         $this->add_control( 'button_bg_hover', [
    198             'label'     => esc_html__( 'Button Bg (Hover))', 'wp-poll' ),
    199             'type'      => Controls_Manager::COLOR,
    200             'condition' => [ 'poll_form_enable' => 'yes', 'poll_form_style_colors' => 'yes' ],
    201         ] );
     108        ] );
     109        $this->controls_for_style_form();
     110        $this->end_controls_section();
    202111    }
    203112
     
    206115
    207116        $options_poll     = array( '0' => esc_html__( 'Select a Poll', 'wp-poll' ) );
    208         $options_nps      = array( '0' => esc_html__( 'Select a NPS', 'wp-poll' ) );
    209         $options_reaction = array( '0' => esc_html__( 'Select a Reaction', 'wp-poll' ) );
    210         $poll_types       = array(
    211             'poll'     => esc_html__( 'Poll', 'wp-poll' ),
    212             'reaction' => esc_html__( 'Reaction', 'wp-poll' ),
    213             'nps'      => esc_html__( 'NPS', 'wp-poll' ),
    214         );
    215117
    216118        foreach ( get_posts( array( 'post_type' => 'poll', 'meta_key' => '_type', 'meta_value' => 'poll', 'showposts' => - 1 ) ) as $post ) {
     
    218120        }
    219121
    220         foreach ( get_posts( array( 'post_type' => 'poll', 'meta_key' => '_type', 'meta_value' => 'nps', 'showposts' => - 1 ) ) as $post ) {
    221             $options_nps[ $post->ID ] = $post->post_title;
    222         }
    223 
    224         foreach ( get_posts( array( 'post_type' => 'poll', 'meta_key' => '_type', 'meta_value' => 'reaction', 'showposts' => - 1 ) ) as $post ) {
    225             $options_reaction[ $post->ID ] = $post->post_title;
    226         }
    227 
    228         if ( ! liquidpoll()->is_pro() ) {
    229             unset( $poll_types['reaction'] );
    230         }
    231 
    232         $this->add_control( '_type', [
    233             'label'   => esc_html__( 'Poll Type', 'wp-poll' ),
    234             'type'    => Controls_Manager::SELECT,
    235             'default' => 'poll',
    236             'options' => $poll_types,
    237         ] );
    238122
    239123        $this->add_control( 'poll_id_poll', [
     
    242126            'options'   => $options_poll,
    243127            'default'   => '0',
    244             'condition' => [ '_type' => [ 'poll' ] ],
    245         ] );
    246 
    247         $this->add_control( 'poll_id_nps', [
    248             'label'     => esc_html__( 'Select NPS', 'wp-poll' ),
    249             'type'      => Controls_Manager::SELECT,
    250             'options'   => $options_nps,
    251             'default'   => '0',
    252             'condition' => [ '_type' => [ 'nps' ] ],
    253         ] );
    254 
    255         $this->add_control( 'poll_id_reaction', [
    256             'label'     => esc_html__( 'Select Reaction', 'wp-poll' ),
    257             'type'      => Controls_Manager::SELECT,
    258             'options'   => $options_reaction,
    259             'default'   => '0',
    260             'condition' => [ '_type' => [ 'reaction' ] ],
    261         ] );
     128        ] );
     129
    262130
    263131        $this->add_control( 'poll_content', [
    264132            'label'     => esc_html__( 'Poll Content', 'wp-poll' ),
    265133            'type'      => Controls_Manager::TEXTAREA,
    266             'condition' => [ '_type' => [ 'poll', 'nps' ] ],
    267134        ] );
    268135
     
    274141                'enableTime' => false,
    275142            ],
    276             'condition'      => [ '_type' => 'poll', ],
    277143        ] );
    278144
     
    285151            ],
    286152            'default'   => 'below_options',
    287             'condition' => [ '_type' => 'poll', ],
    288153        ] );
    289154
     
    297162            'label'     => esc_html__( 'Hide for logged out users.', 'wp-poll' ),
    298163            'type'      => Controls_Manager::SWITCHER,
    299             'condition' => [ '_type' => [ 'poll', 'reaction', 'nps' ] ],
    300164        ] );
    301165
     
    303167            'label'     => esc_html__( 'Allow users to vote after deadline.', 'wp-poll' ),
    304168            'type'      => Controls_Manager::SWITCHER,
    305             'condition' => [ '_type' => [ 'poll' ] ],
    306169        ] );
    307170
     
    309172            'label'     => esc_html__( 'Hide countdown timer for this poll.', 'wp-poll' ),
    310173            'type'      => Controls_Manager::SWITCHER,
    311             'condition' => [ '_type' => [ 'poll' ] ],
    312174        ] );
    313175
     
    315177            'label'     => esc_html__( 'View results to voted users only.', 'wp-poll' ),
    316178            'type'      => Controls_Manager::SWITCHER,
    317             'condition' => [ '_type' => [ 'poll' ] ],
    318         ] );
    319 
    320         $this->add_control( 'settings_reaction_hide_title', [
    321             'label'     => esc_html__( 'Hide title for this reaction.', 'wp-poll' ),
    322             'type'      => Controls_Manager::SWITCHER,
    323             'condition' => [ '_type' => [ 'reaction' ] ],
    324         ] );
    325 
    326         $this->add_control( 'settings_reaction_hide_content', [
    327             'label'     => esc_html__( 'Hide content for this reaction.', 'wp-poll' ),
    328             'type'      => Controls_Manager::SWITCHER,
    329             'condition' => [ '_type' => [ 'reaction' ] ],
    330         ] );
    331     }
    332 
    333 
    334     protected function calculate_themes( $themes ) {
    335 
    336         $calculated_themes = array();
    337 
    338         foreach ( $themes as $theme_id => $theme ) {
    339 
    340             $availability = Utils::get_args_option( 'availability', $theme );
    341             $theme_label  = Utils::get_args_option( 'label', $theme );
    342 
    343             if ( 'pro' == $availability && ! liquidpoll()->is_pro() ) {
    344                 $calculated_themes[998] = esc_html__( '7+ are in pro', 'wp-poll' );
    345                 continue;
    346             }
    347 
    348             $calculated_themes[ $theme_id ] = $theme_label;
    349         }
    350 
    351         return $calculated_themes;
     179        ] );
    352180    }
    353181
     
    358186            'label'     => esc_html__( 'Poll Theme', 'wp-poll' ),
    359187            'type'      => Controls_Manager::SELECT,
    360             'options'   => $this->calculate_themes( liquidpoll()->get_poll_themes() ),
     188            'options'   => liquidpoll_calculate_themes( liquidpoll()->get_poll_themes() ),
    361189            'default'   => 1,
    362             'condition' => [ '_type' => [ 'poll' ] ],
    363         ] );
    364 
    365         $this->add_control( '_theme_nps', [
    366             'label'     => esc_html__( 'NPS Theme', 'wp-poll' ),
    367             'type'      => Controls_Manager::SELECT,
    368             'options'   => $this->calculate_themes( liquidpoll()->get_nps_themes() ),
    369             'default'   => 1,
    370             'condition' => [ '_type' => [ 'nps' ] ],
    371         ] );
    372 
    373         $this->add_control( '_theme_reaction', [
    374             'label'     => esc_html__( 'Reaction Theme', 'wp-poll' ),
    375             'type'      => Controls_Manager::SELECT,
    376             'options'   => $this->calculate_themes( liquidpoll()->get_reaction_themes() ),
    377             'default'   => 1,
    378             'condition' => [ '_type' => [ 'reaction' ] ],
    379190        ] );
    380191
     
    383194            'type'      => Controls_Manager::HEADING,
    384195            'separator' => 'before',
    385             'condition' => [ '_theme' => [ '7', '9' ], '_type' => 'poll' ],
     196            'condition' => [ '_theme' => [ '7', '9' ] ],
    386197        ] );
    387198
     
    391202            'types'     => [ 'gradient' ],
    392203            'selector'  => '{{WRAPPER}} .liquidpoll-option-thumb::before',
    393             'condition' => [ '_theme' => [ '7', '9' ], '_type' => 'poll' ],
     204            'condition' => [ '_theme' => [ '7', '9' ] ],
    394205        ] );
    395206
     
    398209            'type'      => Controls_Manager::HEADING,
    399210            'separator' => 'before',
    400             'condition' => [ '_theme' => [ '6', '7', '8', '9' ], '_type' => 'poll' ],
     211            'condition' => [ '_theme' => [ '6', '7', '8', '9' ] ],
    401212        ] );
    402213
     
    406217            'types'     => [ 'classic', 'gradient' ],
    407218            'selector'  => '{{WRAPPER}} .liquidpoll-option-single::before',
    408             'condition' => [ '_theme' => [ '6', '7', '8', '9' ], '_type' => 'poll' ],
     219            'condition' => [ '_theme' => [ '6', '7', '8', '9' ] ],
    409220        ] );
    410221
     
    417228            ],
    418229            'default'   => 'votes',
    419             'condition' => [ '_theme' => [ '1', '2', '3', '5', '8', '9', '10' ], '_type' => 'poll' ],
     230            'condition' => [ '_theme' => [ '1', '2', '3', '5', '8', '9', '10' ] ],
    420231        ] );
    421232
     
    428239            ],
    429240            'default'   => 'regular',
    430             'condition' => [ '_theme' => [ '10', '11', '12' ], '_type' => 'poll' ],
    431         ] );
    432 
    433         $this->add_control( '_nps_lowest_marking_text', [
    434             'label'     => esc_html__( 'Lowest Marking Text', 'wp-poll' ),
    435             'type'      => Controls_Manager::TEXT,
    436             'condition' => [ '_type' => 'nps' ],
    437         ] );
    438 
    439         $this->add_control( '_nps_highest_marking_text', [
    440             'label'     => esc_html__( 'Highest Marking Text', 'wp-poll' ),
    441             'type'      => Controls_Manager::TEXT,
    442             'condition' => [ '_type' => 'nps' ],
    443         ] );
    444 
    445         $this->add_control( '_nps_commentbox', [
    446             'label'     => esc_html__( 'Comment Box', 'wp-poll' ),
    447             'type'      => Controls_Manager::SELECT,
    448             'options'   => [
    449                 'disabled' => esc_html__( 'Disable', 'wp-poll' ),
    450                 'enabled'  => esc_html__( 'Enable, Not Mandatory', 'wp-poll' ),
    451                 'obvious'  => esc_html__( 'Enable, Mandatory', 'wp-poll' ),
    452             ],
    453             'default'   => 'enabled',
    454             'condition' => [ '_type' => 'nps' ],
    455         ] );
    456 
    457 
    458         $this->add_control( '_nps_label_styles', [
    459             'label'     => esc_html__( 'Label Styles', 'wp-poll' ),
    460             'type'      => Controls_Manager::HEADING,
    461             'separator' => 'before',
    462             'condition' => [ '_theme_nps' => [ '1', '2' ], '_type' => [ 'nps' ] ],
    463         ] );
    464 
    465 
    466         $this->start_controls_tabs( '_nps_label_styles_tabs', [ 'condition' => [ '_theme_nps' => [ '1', '2' ], '_type' => [ 'nps' ] ] ] );
    467 
    468         // Tab - normal
    469         $this->start_controls_tab( '_nps_label_styles_tabs_normal', [ 'label' => esc_html__( 'Normal', 'wp-poll' ), ] );
    470 
    471         $this->add_control( '_nps_label_styles_tabs_normal_color', [
    472             'label'     => esc_html__( 'Color', 'wp-poll' ),
    473             'type'      => Controls_Manager::COLOR,
    474             'selectors' => [ '{{WRAPPER}} ul.liquidpoll-nps-options li label' => 'color: {{VALUE}}', ],
    475             'condition' => [ '_theme_nps' => [ '1', '2' ], '_type' => [ 'nps' ] ],
    476         ] );
    477 
    478         $this->add_group_control( Group_Control_Background::get_type(), [
    479             'name'      => '_nps_label_styles_tabs_normal_bg',
    480             'types'     => [ 'gradient' ],
    481             'selector'  => '{{WRAPPER}} ul.liquidpoll-nps-options > li',
    482             'condition' => [ '_theme_nps' => [ '1', '2' ], '_type' => [ 'nps' ] ],
    483         ] );
    484 
    485         $this->add_group_control( Group_Control_Border::get_type(), [
    486             'name'      => '_nps_label_styles_tabs_normal_border',
    487             'selector'  => '{{WRAPPER}} ul.liquidpoll-nps-options > li:hover',
    488             'condition' => [ '_theme_nps' => [ '1', '2' ], '_type' => [ 'nps' ] ],
    489         ] );
    490 
    491         $this->end_controls_tab(); // tabs_normal
    492 
    493 
    494         // Tab - hover
    495         $this->start_controls_tab( '_nps_label_styles_tabs_hover', [ 'label' => esc_html__( 'Hover', 'wp-poll' ), ] );
    496 
    497         $this->add_control( '_nps_label_styles_tabs_hover_color', [
    498             'label'     => esc_html__( 'Color', 'wp-poll' ),
    499             'type'      => Controls_Manager::COLOR,
    500             'selectors' => [ '{{WRAPPER}} .liquidpoll-nps-options li:hover label' => 'color: {{VALUE}}' ],
    501             'condition' => [ '_theme_nps' => [ '1', '2' ], '_type' => [ 'nps' ] ],
    502         ] );
    503 
    504         $this->add_group_control( Group_Control_Background::get_type(), [
    505             'name'      => '_nps_label_styles_tabs_hover_bg',
    506             'types'     => [ 'gradient' ],
    507             'selector'  => '{{WRAPPER}} ul.liquidpoll-nps-options > li:hover',
    508             'condition' => [ '_theme_nps' => [ '1', '2' ], '_type' => [ 'nps' ] ],
    509         ] );
    510 
    511         $this->add_group_control( Group_Control_Border::get_type(), [
    512             'name'      => '_nps_label_styles_tabs_hover_border',
    513             'selector'  => '{{WRAPPER}} ul.liquidpoll-nps-options > li:hover',
    514             'condition' => [ '_theme_nps' => [ '1', '2' ], '_type' => [ 'nps' ] ],
    515         ] );
    516 
    517         $this->end_controls_tab(); // tabs_hover
    518 
    519 
    520         // Tab - active
    521         $this->start_controls_tab( '_nps_label_styles_tabs_active', [ 'label' => esc_html__( 'Active', 'wp-poll' ), ] );
    522 
    523         $this->add_control( '_nps_label_styles_tabs_active_color', [
    524             'label'     => esc_html__( 'Color', 'wp-poll' ),
    525             'type'      => Controls_Manager::COLOR,
    526             'selectors' => [ '{{WRAPPER}} .liquidpoll-nps-options li.active label' => 'color: {{VALUE}}' ],
    527             'condition' => [ '_theme_nps' => [ '1', '2' ], '_type' => [ 'nps' ] ],
    528         ] );
    529 
    530         $this->add_group_control( Group_Control_Background::get_type(), [
    531             'name'      => '_nps_label_styles_tabs_active_bg',
    532             'types'     => [ 'gradient' ],
    533             'selector'  => '{{WRAPPER}} ul.liquidpoll-nps-options > li.active',
    534             'condition' => [ '_theme_nps' => [ '1', '2' ], '_type' => [ 'nps' ] ],
    535         ] );
    536 
    537         $this->add_group_control( Group_Control_Border::get_type(), [
    538             'name'      => '_nps_label_styles_tabs_active_border',
    539             'selector'  => '{{WRAPPER}} ul.liquidpoll-nps-options > li:hover',
    540             'condition' => [ '_theme_nps' => [ '1', '2' ], '_type' => [ 'nps' ] ],
    541         ] );
    542 
    543         $this->end_controls_tab(); // tabs_active
    544 
    545 
    546         $this->end_controls_tabs();
    547 
    548 
    549         $this->add_control( '_nps_slider_color', [
    550             'label'     => esc_html__( 'Slider Color', 'wp-poll' ),
    551             'type'      => Controls_Manager::HEADING,
    552             'separator' => 'before',
    553             'condition' => [ '_theme_nps' => [ '3' ], '_type' => [ 'nps' ] ],
    554         ] );
    555 
    556         $this->add_control( 'bar', [
    557             'label'     => esc_html__( 'Bar Color', 'wp-poll' ),
    558             'type'      => Controls_Manager::COLOR,
    559             'selectors' => [ '{{WRAPPER}} .rangeslider__fill' => 'background: {{VALUE}}', ],
    560             'condition' => [ '_theme_nps' => [ '3' ], '_type' => [ 'nps' ] ],
    561         ] );
    562 
    563         $this->add_control( 'circle_indicator', [
    564             'label'     => esc_html__( 'Circle Indicator Color', 'wp-poll' ),
    565             'type'      => Controls_Manager::COLOR,
    566             'selectors' => [ '{{WRAPPER}} .rangeslider__handle' => 'background: {{VALUE}}', ],
    567             'condition' => [ '_theme_nps' => [ '3' ], '_type' => [ 'nps' ] ],
    568         ] );
    569 
    570         $this->add_control( '_nps_progress_bar_colors', [
    571             'label'     => esc_html__( 'Progress Bar Color', 'wp-poll' ),
    572             'type'      => Controls_Manager::HEADING,
    573             'separator' => 'before',
    574             'condition' => [ '_theme_nps' => [ '4' ], '_type' => [ 'nps' ] ],
    575         ] );
    576 
    577         $this->add_control( 'background', [
    578             'label'     => esc_html__( 'Bar Color', 'wp-poll' ),
    579             'type'      => Controls_Manager::COLOR,
    580             'selectors' => [
    581                 '{{WRAPPER}} #nps_score .rs-path-color'    => 'border-color: {{VALUE}}',
    582                 '{{WRAPPER}} #nps_score .rs-handle:before' => 'outline-color: {{VALUE}}',
    583             ],
    584             'condition' => [ '_theme_nps' => [ '4' ], '_type' => [ 'nps' ] ],
    585         ] );
    586 
    587         $this->add_control( 'indicator', [
    588             'label'     => esc_html__( 'Circle Indicator Color', 'wp-poll' ),
    589             'type'      => Controls_Manager::COLOR,
    590             'selectors' => [
    591                 '{{WRAPPER}} #nps_score .rs-handle'        => 'border-right-color: {{VALUE}}',
    592                 '{{WRAPPER}} #nps_score .rs-handle:before' => 'border-color: {{VALUE}}',
    593             ],
    594             'condition' => [ '_theme_nps' => [ '4' ], '_type' => [ 'nps' ] ],
    595         ] );
    596 
    597 
    598         $this->add_control( 'progress_bar_background_heading', [
    599             'label'     => esc_html__( 'Progress Bar Background', 'wp-poll' ),
    600             'type'      => Controls_Manager::HEADING,
    601             'separator' => 'before',
    602             'condition' => [ '_theme_nps' => [ '4' ], '_type' => [ 'nps' ] ],
    603         ] );
    604 
    605         $this->add_group_control( Group_Control_Background::get_type(), [
    606             'name'      => 'progress_bar_fill_color',
    607             'types'     => [ 'gradient' ],
    608             'selector'  => '{{WRAPPER}} #nps_score .rs-range-color',
    609             'condition' => [ '_theme_nps' => [ '4' ], '_type' => [ 'nps' ] ],
    610         ] );
    611 
    612         $this->add_control( 'progress_ball_background_heading', [
    613             'label'     => esc_html__( 'Progress Ball Background', 'wp-poll' ),
    614             'type'      => Controls_Manager::HEADING,
    615             'separator' => 'before',
    616             'condition' => [ '_theme_nps' => [ '4' ], '_type' => [ 'nps' ] ],
    617         ] );
    618 
    619         $this->add_group_control( Group_Control_Background::get_type(), [
    620             'name'      => 'progress_ball_fill_color',
    621             'types'     => [ 'gradient' ],
    622             'selector'  => '{{WRAPPER}} #nps_score .rs-handle:after',
    623             'condition' => [ '_theme_nps' => [ '4' ], '_type' => [ 'nps' ] ],
    624         ] );
    625 
    626 
    627 //      $this->add_control( 'bar_fill_1', [
    628 //          'label'     => esc_html__( 'Bar Active Color 1', 'wp-poll' ),
    629 //          'type'      => Controls_Manager::COLOR,
    630 //          'condition' => [ '_theme_nps' => [ '4' ], '_type' => [ 'nps' ] ],
    631 //      ] );
    632 //
    633 //      $this->add_control( 'bar_fill_2', [
    634 //          'label'     => esc_html__( 'Bar Active Color 2', 'wp-poll' ),
    635 //          'type'      => Controls_Manager::COLOR,
    636 //          'condition' => [ '_theme_nps' => [ '4' ], '_type' => [ 'nps' ] ],
    637 //      ] );
    638 //
    639 //      $this->add_control( 'bar_fill_3', [
    640 //          'label'     => esc_html__( 'Bar Active Color 3', 'wp-poll' ),
    641 //          'type'      => Controls_Manager::COLOR,
    642 //          'condition' => [ '_theme_nps' => [ '4' ], '_type' => [ 'nps' ] ],
    643 //      ] );
    644 
    645 
    646         $this->add_control( 'labels_colors_normal', [
    647             'label'     => esc_html__( 'Label color', 'wp-poll' ),
    648             'type'      => Controls_Manager::COLOR,
    649             'selectors' => [ '{{WRAPPER}} .liquidpoll-nps-options li > label > span:first-child' => 'color: {{VALUE}}', ],
    650             'condition' => [ '_theme_nps' => [ '5' ], '_type' => [ 'nps' ] ],
    651         ] );
    652 
    653         $this->add_control( 'active', [
    654             'label'     => esc_html__( 'Hover/Active Color', 'wp-poll' ),
    655             'type'      => Controls_Manager::COLOR,
    656             'selectors' => [
    657                 '{{WRAPPER}} .liquidpoll-nps-options li span.liquidpoll-nps-tooltip' => 'color: {{VALUE}}',
    658                 '{{WRAPPER}} .liquidpoll-nps-options li::before'                     => 'background: {{VALUE}}',
    659             ],
    660             'condition' => [ '_theme_nps' => [ '5' ], '_type' => [ 'nps' ] ],
    661         ] );
    662 
    663         $this->add_control( 'selected_bg', [
    664             'label'     => esc_html__( 'Hover/Active Background', 'wp-poll' ),
    665             'type'      => Controls_Manager::COLOR,
    666             'selectors' => [
    667                 '{{WRAPPER}} .liquidpoll-nps-options li:hover > label > span:first-child'    => 'color: {{VALUE}}',
    668                 '{{WRAPPER}} .liquidpoll-nps-options li.active > label > span:first-child'   => 'color: {{VALUE}}',
    669                 '{{WRAPPER}} .liquidpoll-nps-options li:hover'                               => 'background: {{VALUE}}',
    670                 '{{WRAPPER}} .liquidpoll-nps-options li.active'                              => 'background: {{VALUE}}',
    671                 '{{WRAPPER}} .liquidpoll-nps-options li span.liquidpoll-nps-tooltip::before' => 'background: {{VALUE}}',
    672             ],
    673             'condition' => [ '_theme_nps' => [ '5' ], '_type' => [ 'nps' ] ],
    674         ] );
    675 
    676         $this->add_control( 'border', [
    677             'label'     => esc_html__( 'Wrapper Border', 'wp-poll' ),
    678             'type'      => Controls_Manager::COLOR,
    679             'selectors' => [
    680                 '{{WRAPPER}} .liquidpoll-nps-options li'               => 'border-color: {{VALUE}}',
    681                 '{{WRAPPER}} ul.liquidpoll-nps-options li:first-child' => 'border-left-color: {{VALUE}}',
    682                 '{{WRAPPER}} .liquidpoll-nps-options li:last-child'    => 'border-right-color: {{VALUE}}',
    683             ],
    684             'condition' => [ '_theme_nps' => [ '5' ], '_type' => [ 'nps' ] ],
    685         ] );
    686 
    687         $this->add_control( 'wrapper_bg', [
    688             'label'     => esc_html__( 'Wrapper Background', 'wp-poll' ),
    689             'type'      => Controls_Manager::COLOR,
    690             'selectors' => [ '{{WRAPPER}} .liquidpoll-nps-options li' => 'background: {{VALUE}}', ],
    691             'condition' => [ '_theme_nps' => [ '5' ], '_type' => [ 'nps' ] ],
    692         ] );
    693 
    694 
    695         $this->add_control( '_nps_marking_text_colors', [
    696             'label'     => esc_html__( 'Marking Texts', 'wp-poll' ),
    697             'type'      => Controls_Manager::HEADING,
    698             'separator' => 'before',
    699             'condition' => [ '_type' => [ 'nps' ] ],
    700         ] );
    701 
    702         $this->add_group_control( Group_Control_Typography::get_type(), [
    703             'name'      => '_nps_highest_marking_typography',
    704             'selector'  => '{{WRAPPER}} .liquidpoll-nps-score-labels span',
    705             'condition' => [ '_type' => [ 'nps' ] ],
    706         ] );
    707 
    708         $this->add_control( 'lowest', [
    709             'label'     => esc_html__( 'Lowest text color', 'wp-poll' ),
    710             'type'      => Controls_Manager::COLOR,
    711             'selectors' => [ '{{WRAPPER}} .liquidpoll-nps-score-labels span.lowest' => 'color: {{VALUE}}', ],
    712             'condition' => [ '_type' => [ 'nps' ] ],
    713         ] );
    714 
    715         $this->add_control( 'highest', [
    716             'label'     => esc_html__( 'Highest text color', 'wp-poll' ),
    717             'type'      => Controls_Manager::COLOR,
    718             'selectors' => [ '{{WRAPPER}} .liquidpoll-nps-score-labels span.highest' => 'color: {{VALUE}}', ],
    719             'condition' => [ '_type' => [ 'nps' ] ],
    720         ] );
    721 
    722         $this->add_control( '_nps_comment_box_colors', [
    723             'label'     => esc_html__( 'Comment / Feedback Box', 'wp-poll' ),
    724             'type'      => Controls_Manager::HEADING,
    725             'separator' => 'before',
    726             'condition' => [ '_type' => [ 'nps' ] ],
    727         ] );
    728 
    729         $this->add_control( 'text_color', [
    730             'label'     => esc_html__( 'Text color', 'wp-poll' ),
    731             'type'      => Controls_Manager::COLOR,
    732             'selectors' => [ '{{WRAPPER}} .liquidpoll-comment-box textarea' => 'color: {{VALUE}}', ],
    733             'condition' => [ '_type' => [ 'nps' ] ],
    734         ] );
    735 
    736         $this->add_control( 'bg_color', [
    737             'label'     => esc_html__( 'Background color', 'wp-poll' ),
    738             'type'      => Controls_Manager::COLOR,
    739             'selectors' => [ '{{WRAPPER}} .liquidpoll-comment-box textarea' => 'background: {{VALUE}}', ],
    740             'condition' => [ '_type' => [ 'nps' ] ],
    741         ] );
    742 
    743         $this->add_control( 'border_color', [
    744             'label'     => esc_html__( 'Border color', 'wp-poll' ),
    745             'type'      => Controls_Manager::COLOR,
    746             'selectors' => [ '{{WRAPPER}} .liquidpoll-comment-box textarea' => 'border-color: {{VALUE}}', ],
    747             'condition' => [ '_type' => [ 'nps' ] ],
     241            'condition' => [ '_theme' => [ '10', '11', '12' ] ],
    748242        ] );
    749243
     
    756250            'type'      => Controls_Manager::HEADING,
    757251            'separator' => 'before',
    758             'condition' => [ '_type' => [ 'poll', 'nps' ] ],
    759252        ] );
    760253
     
    762255            'name'      => 'poll_title_typography',
    763256            'selector'  => '{{WRAPPER}} .liquidpoll-poll-title',
    764             'condition' => [ '_type' => [ 'poll', 'nps' ] ],
    765257        ] );
    766258
     
    769261            'type'      => Controls_Manager::COLOR,
    770262            'selectors' => [ '{{WRAPPER}} .liquidpoll-poll-title' => 'color: {{VALUE}}', ],
    771             'condition' => [ '_type' => [ 'poll', 'nps' ] ],
    772263        ] );
    773264
     
    780271            'type'      => Controls_Manager::HEADING,
    781272            'separator' => 'before',
    782             'condition' => [ '_type' => [ 'poll', 'nps' ] ],
    783273        ] );
    784274
     
    786276            'name'      => 'poll_content_typography',
    787277            'selector'  => '{{WRAPPER}} .liquidpoll-content',
    788             'condition' => [ '_type' => [ 'poll', 'nps' ] ],
    789278        ] );
    790279
     
    793282            'type'      => Controls_Manager::COLOR,
    794283            'selectors' => [ '{{WRAPPER}} .liquidpoll-content' => 'color: {{VALUE}}', ],
    795             'condition' => [ '_type' => [ 'poll', 'nps' ] ],
    796284        ] );
    797285
     
    804292            'type'      => Controls_Manager::HEADING,
    805293            'separator' => 'before',
    806             'condition' => [ '_type' => [ 'poll' ] ],
    807294        ] );
    808295
     
    810297            'name'      => 'poll_options_typography',
    811298            'selector'  => '{{WRAPPER}} .liquidpoll-option-single label',
    812             'condition' => [ '_type' => [ 'poll' ] ],
    813299        ] );
    814300
     
    817303            'type'      => Controls_Manager::COLOR,
    818304            'selectors' => [ '{{WRAPPER}} .liquidpoll-option-single label' => 'color: {{VALUE}}', ],
    819             'condition' => [ '_type' => [ 'poll' ] ],
    820305        ] );
    821306
     
    828313            'type'      => Controls_Manager::HEADING,
    829314            'separator' => 'before',
    830             'condition' => [ '_type' => [ 'poll' ] ],
    831315        ] );
    832316
     
    834318            'name'      => 'poll_countdown_typography',
    835319            'selector'  => '{{WRAPPER}} .liquidpoll-countdown-timer > span',
    836             'condition' => [ '_type' => [ 'poll' ] ],
    837320        ] );
    838321
     
    841324            'type'      => Controls_Manager::COLOR,
    842325            'selectors' => [ '{{WRAPPER}} .liquidpoll-countdown-timer > span' => 'color: {{VALUE}}', ],
    843             'condition' => [ '_type' => [ 'poll' ] ],
    844326        ] );
    845327
     
    852334            'type'      => Controls_Manager::HEADING,
    853335            'separator' => 'before',
    854             'condition' => [ '_type' => [ 'poll', 'nps' ] ],
    855336        ] );
    856337
     
    858339            'name'      => 'poll_btn_submit_typography',
    859340            'selector'  => '{{WRAPPER}} .liquidpoll-submit-poll',
    860             'condition' => [ '_type' => [ 'poll', 'nps' ] ],
    861341        ] );
    862342
     
    865345            'types'     => [ 'classic', 'gradient' ],
    866346            'selector'  => '{{WRAPPER}} .liquidpoll-submit-poll',
    867             'condition' => [ '_type' => [ 'poll', 'nps' ] ],
    868347        ] );
    869348
     
    872351            'type'      => Controls_Manager::COLOR,
    873352            'selectors' => [ '{{WRAPPER}} .liquidpoll-submit-poll' => 'color: {{VALUE}}', ],
    874             'condition' => [ '_type' => [ 'poll', 'nps' ] ],
    875353        ] );
    876354
     
    884362                    '{{WRAPPER}} .liquidpoll-submit-poll' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
    885363                ],
    886                 'condition'  => [ '_type' => [ 'poll', 'nps' ] ],
    887364            ]
    888365        );
     
    897374                    '{{WRAPPER}} .liquidpoll-submit-poll' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
    898375                ],
    899                 'condition'  => [ '_type' => [ 'poll', 'nps' ] ],
    900376            ]
    901377        );
     
    910386                    '{{WRAPPER}} .liquidpoll-submit-poll' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
    911387                ],
    912                 'condition'  => [ '_type' => [ 'poll', 'nps' ] ],
    913388            ]
    914389        );
     
    922397            'type'      => Controls_Manager::HEADING,
    923398            'separator' => 'before',
    924             'condition' => [ '_type' => [ 'poll' ] ],
    925399        ] );
    926400
     
    928402            'name'      => 'poll_btn_results_typography',
    929403            'selector'  => '{{WRAPPER}} .liquidpoll-get-poll-results',
    930             'condition' => [ '_type' => [ 'poll' ] ],
    931404        ] );
    932405
     
    935408            'types'     => [ 'classic', 'gradient' ],
    936409            'selector'  => '{{WRAPPER}} .liquidpoll-get-poll-results',
    937             'condition' => [ '_type' => [ 'poll' ] ],
    938410        ] );
    939411
     
    942414            'type'      => Controls_Manager::COLOR,
    943415            'selectors' => [ '{{WRAPPER}} .liquidpoll-get-poll-results' => 'color: {{VALUE}}', ],
    944             'condition' => [ '_type' => [ 'poll' ] ],
    945416        ] );
    946417
     
    954425                    '{{WRAPPER}} .liquidpoll-get-poll-results' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
    955426                ],
    956                 'condition'  => [ '_type' => [ 'poll' ] ],
    957427            ]
    958428        );
     
    967437                    '{{WRAPPER}} .liquidpoll-get-poll-results' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
    968438                ],
    969                 'condition'  => [ '_type' => [ 'poll' ] ],
    970439            ]
    971440        );
     
    980449                    '{{WRAPPER}} .liquidpoll-get-poll-results' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
    981450                ],
    982                 'condition'  => [ '_type' => [ 'poll' ] ],
    983451            ]
    984452        );
  • wp-poll/trunk/includes/functions.php

    r2835348 r2841803  
    252252     * Generate and return classes
    253253     *
    254      * @param string $classes
     254     * @param $classes
    255255     *
    256256     * @return string
    257257     */
    258     function liquidpoll_generate_classes( $classes = '' ) {
     258    function liquidpoll_generate_classes( $classes ) {
    259259
    260260        if ( ! is_array( $classes ) ) {
     
    286286        $classes[] = sprintf( 'results-type-%s', $poll->get_meta( '_results_type', 'votes' ) );
    287287
    288         if ( '1' == $poll->get_meta( 'poll_form_enable', '0' ) ) {
     288        if ( '1' == $poll->get_meta( 'poll_form_enable', '0' ) || 'yes' == $poll->get_meta( 'poll_form_enable', '0' ) ) {
    289289            $classes[] = 'has-form';
    290290        }
     
    737737
    738738
    739 if( ! function_exists('liquidpoll_get_feedback_form')) {
     739if ( ! function_exists( 'liquidpoll_get_feedback_form' ) ) {
    740740    /**
    741741     * Return html content for feedback form
     
    752752    }
    753753}
     754
     755
     756if ( ! function_exists( 'liquidpoll_calculate_themes' ) ) {
     757    /**
     758     * Calculate themes for each type
     759     *
     760     * @param $themes
     761     *
     762     * @return array
     763     */
     764    function liquidpoll_calculate_themes( $themes ) {
     765
     766        $calculated_themes = array();
     767
     768        foreach ( $themes as $theme_id => $theme ) {
     769
     770            $availability = Utils::get_args_option( 'availability', $theme );
     771            $theme_label  = Utils::get_args_option( 'label', $theme );
     772
     773            if ( 'pro' == $availability && ! liquidpoll()->is_pro() ) {
     774                $calculated_themes[998] = esc_html__( '7+ are in pro', 'wp-poll' );
     775                continue;
     776            }
     777
     778            $calculated_themes[ $theme_id ] = $theme_label;
     779        }
     780
     781        return $calculated_themes;
     782    }
     783}
  • wp-poll/trunk/includes/wpdk/classes/class-license.php

    r2839280 r2841803  
    2929        }
    3030
    31         $plugin_data = get_plugin_data( $plugin_file );
    32 
    33         $this->client          = $client;
    34         $this->plugin_file     = $plugin_file;
    35         $this->plugin_basename = plugin_basename( $plugin_file );
    36         $this->plugin_version  = Utils::get_args_option( 'Version', $plugin_data );
    37         $this->option_key      = sprintf( 'pb_%s_license_data', md5( $this->client->text_domain . esc_attr( '-pro' ) ) );
    38         $this->cache_key       = sprintf( 'pb_%s_version_info', md5( $this->client->text_domain . esc_attr( '-pro' ) ) );
    39         $this->data            = get_option( $this->option_key, array() );
    40 
    41         add_action( 'init', array( $this, 'schedule_event' ) );
    42         add_action( 'rest_api_init', array( $this, 'add_license_activation_endpoint' ) );
    43         add_filter( 'cron_schedules', array( $this, 'add_cron_interval' ) );
    44         add_action( 'pb_license_check', array( $this, 'check_license_validity' ) );
    45 
     31        if ( ! empty( $plugin_file ) ) {
     32
     33            $plugin_data           = get_plugin_data( $plugin_file );
     34            $this->client          = $client;
     35            $this->plugin_file     = $plugin_file;
     36            $this->plugin_basename = plugin_basename( $plugin_file );
     37            $this->plugin_version  = Utils::get_args_option( 'Version', $plugin_data );
     38            $this->option_key      = sprintf( 'pb_%s_license_data', md5( $this->client->text_domain . esc_attr( '-pro' ) ) );
     39            $this->cache_key       = sprintf( 'pb_%s_version_info', md5( $this->client->text_domain . esc_attr( '-pro' ) ) );
     40            $this->data            = get_option( $this->option_key, array() );
     41
     42            add_action( 'init', array( $this, 'schedule_event' ) );
     43            add_action( 'rest_api_init', array( $this, 'add_license_activation_endpoint' ) );
     44            add_filter( 'cron_schedules', array( $this, 'add_cron_interval' ) );
     45            add_action( 'pb_license_check', array( $this, 'check_license_validity' ) );
     46        }
    4647    }
    4748
  • wp-poll/trunk/includes/wpdk/classes/class-utils.php

    r2835348 r2841803  
    144144                'name'               => sprintf( $this->client->__trans( '%s' ), $plural ),
    145145                'singular_name'      => $singular,
    146                 'menu_name'          => $this->client->__trans( $singular ),
    147                 'all_items'          => sprintf( $this->client->__trans( 'All %s' ), $plural ),
     146                'menu_name'          => $this->client->__trans( $plural ),
     147                'all_items'          => sprintf( $this->client->__trans( '%s' ), $plural ),
    148148                'add_new'            => sprintf( $this->client->__trans( 'Add %s' ), $singular ),
    149149                'add_new_item'       => sprintf( $this->client->__trans( 'Add %s' ), $singular ),
  • wp-poll/trunk/includes/wpdk/settings/assets/css/style.css

    r2835348 r2841803  
    225225    position: relative;
    226226    display: block;
    227     padding: 20px 16px 20px;
     227    padding: 10px;
    228228    text-decoration: none;
    229229    transition: 0.3s;
     
    876876    width: calc(100% - 30px);
    877877    height: calc(100% - 30px);
    878     border: 1px solid #ffd8d8;
    879878    left: 15px;
    880879    top: 15px;
    881880    border-radius: 3px;
    882881    overflow: hidden;
     882    background: #ffb3b321;
    883883}
    884884
     
    890890    position: absolute;
    891891    top: 15px;
    892     right: 18px;
    893     width: 90px;
     892    right: 15px;
     893    width: 50px;
    894894    height: 22px;
    895895    z-index: 9;
     
    898898    background: #ed6f6f;
    899899    text-align: center;
    900     color: #f2f2f2;
     900    color: #f1f1f1;
    901901    border: 1px solid #ed6f6f;
    902     border-radius: 0 3px 0 3px;
    903902    cursor: pointer;
    904903    text-transform: uppercase;
     
    906905    outline: none;
    907906    box-shadow: none;
     907    letter-spacing: 1px;
     908    border-top-right-radius: 3px;
    908909}
    909910
  • wp-poll/trunk/includes/wpdk/settings/classes/setup.class.php

    r2835348 r2841803  
    818818
    819819                if ( 'pro' == $availability ) {
    820                     $notice_url = isset( self::$args['pro_url'] ) ? self::$args['pro_url'] : '';
     820                    $notice_url = self::$args['pro_url'] ?? '';
    821821                }
    822822
  • wp-poll/trunk/readme.txt

    r2839280 r2841803  
    55    Requires at least: 4.6
    66    Tested up to: 6.1.1
    7     Stable tag: 3.3.51
     7    Stable tag: 3.3.52
    88    License: GPLv2 or later
    99    License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    323323* 26/12/2022 - TWEAK - Version updated.
    324324
     325= 3.3.52 =
     326* 30/12/2022 - NEW - Added Poll widget, NPS widget, and Reaction widget for Elementor page builder.
     327
  • wp-poll/trunk/templates/single-poll/form.php

    r2839280 r2841803  
    44 */
    55
     6use Elementor\Plugin;
    67use WPDK\Utils;
    78
     
    2930}
    3031
     32$form_classes = array( 'liquidpoll-form' );
     33
     34if ( 'yes' == $poll->get_meta( 'poll_form_preview' ) && Plugin::$instance->editor->is_edit_mode() ) {
     35    $form_classes[] = 'display';
     36}
    3137
    3238?>
    33     <form class="liquidpoll-form" action="" enctype="multipart/form-data" method="get">
     39    <form class="<?php echo esc_attr( liquidpoll_generate_classes( $form_classes ) ); ?>" action="" enctype="multipart/form-data" method="get">
    3440
    3541        <?php if ( ! empty( $poll_form_content ) ) : ?>
  • wp-poll/trunk/wp-poll.php

    r2839280 r2841803  
    44 * Plugin URI: https://liquidpoll.com
    55 * Description: It allows user to poll in your website with many awesome features.
    6  * Version: 3.3.51
     6 * Version: 3.3.52
    77 * Author: LiquidPoll
    88 * Text Domain: wp-poll
     
    2727defined( 'LIQUIDPOLL_TICKET_URL' ) || define( 'LIQUIDPOLL_TICKET_URL', 'https://www.liquidpoll.com/my-account/' );
    2828defined( 'LIQUIDPOLL_COMMUNITY_URL' ) || define( 'LIQUIDPOLL_COMMUNITY_URL', 'https://www.facebook.com/groups/liquidpoll/' );
    29 defined( 'LIQUIDPOLL_VERSION' ) || define( 'LIQUIDPOLL_VERSION', '3.3.51' );
     29defined( 'LIQUIDPOLL_VERSION' ) || define( 'LIQUIDPOLL_VERSION', '3.3.52' );
    3030
    3131if ( ! class_exists( 'LIQUIDPOLL_Main' ) ) {
Note: See TracChangeset for help on using the changeset viewer.