Plugin Directory

Changeset 2824528


Ignore:
Timestamp:
11/26/2022 11:49:12 AM (3 years ago)
Author:
liquidpoll
Message:

3.3.47

  • 26/11/2022 - NEW - Form added for nps and reaction.
Location:
wp-poll
Files:
257 added
11 edited

Legend:

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

    r2777716 r2824528  
    99}
    1010
    11 .nps-single .nps-container {
     11.nps-single .nps-form {
    1212    width: 700px;
    1313}
    1414
    15 form.nps-container.submission-done {
     15.nps-form.submission-done {
    1616    pointer-events: none;
    1717}
     
    9898}
    9999
    100 .nps-single .nps-container .liquidpoll-submit-poll.disabled {
     100.nps-single .nps-form .liquidpoll-submit-poll.disabled {
    101101    pointer-events: none;
    102102    background: #bbb;
  • wp-poll/trunk/assets/front/css/style.css

    r2818249 r2824528  
    16611661 * Form Style
    16621662 */
     1663
    16631664.liquidpoll-form {
     1665    width: 570px;
    16641666    background: #e1e0fa;
    16651667    padding: 30px 50px;
  • wp-poll/trunk/assets/front/js/scripts.js

    r2818062 r2824528  
    134134            singlePoll = optinForm.parent();
    135135
    136         if (!singlePoll.hasClass('poll-type-poll')) {
    137             return false;
    138         }
    139 
    140         $.ajax({
    141             type: 'POST',
    142             context: this,
    143             url: pluginObject.ajaxurl,
    144             data: {
    145                 'action': 'liquidpoll_submit_optin_form',
    146                 'form_data': optinFormData,
    147             },
    148             success: function (response) {
    149                 if (response.success) {
    150                     $('.liquidpoll-get-poll-results').trigger('click');
    151 
    152                     singlePoll.find('.liquidpoll-form').fadeOut(100);
    153                     setTimeout(function () {
    154                         singlePoll.find('.poll-content').fadeIn(100);
    155                     }, 150);
    156                 }
    157             }
    158         });
     136        if (singlePoll.hasClass('poll-type-poll') || singlePoll.hasClass('poll-type-nps') || singlePoll.hasClass('poll-type-reaction')) {
     137            $.ajax({
     138                type: 'POST',
     139                context: this,
     140                url: pluginObject.ajaxurl,
     141                data: {
     142                    'action': 'liquidpoll_submit_optin_form',
     143                    'form_data': optinFormData,
     144                },
     145                success: function (response) {
     146                    if (response.success) {
     147                        $('.liquidpoll-get-poll-results').trigger('click');
     148
     149                        singlePoll.find('.liquidpoll-form').fadeOut(100);
     150                        setTimeout(function () {
     151                            singlePoll.find('.poll-content').fadeIn(100);
     152                            singlePoll.find('.nps-form').fadeIn(100);
     153                            singlePoll.find('.reaction-container').fadeIn(100);
     154                        }, 150);
     155                    }
     156                }
     157            });
     158        }
    159159
    160160        return false;
     
    406406
    407407
    408     // $(document).on('click', '.nps-single .liquidpoll-submit-poll', function () {
    409     //     $('.nps-single form.nps-container').submit();
    410     // });
    411 
    412408    $(document).on('keyup', '.nps-single .liquidpoll-comment-box textarea', function () {
    413409        let npsCommentBox = $(this),
     
    425421    });
    426422
    427     $(document).on('submit', '.nps-single form.nps-container', function () {
     423
     424    $(document).on('submit', '.nps-single form.nps-form', function () {
    428425
    429426        let npsForm = $(this),
    430427            poll_id = npsForm.data('poll-id'),
     428            single_poll = $('#nps-' + poll_id),
    431429            npsFormData = npsForm.serialize(),
    432430            submissionButton = npsForm.find('.liquidpoll-submit-poll');
     
    453451                    submissionButton.fadeOut();
    454452                    npsForm.addClass('submission-done');
     453
     454
     455                    if (single_poll.hasClass('has-form')) {
     456                        single_poll.find('.nps-form').fadeOut(100);
     457                        setTimeout(function () {
     458                            single_poll.find('.liquidpoll-form').fadeIn(100);
     459                        }, 150);
     460                    }
    455461                }
    456462            }
  • wp-poll/trunk/includes/classes/class-item-data.php

    r2818062 r2824528  
    9999                foreach ( $poll_options as $option_key => $option ) {
    100100                    $_poll_options[ $option_key ] = array(
    101                         'label'           => Utils::get_args_option( 'label', $option ),
    102                         'thumb'           => Utils::get_args_option( 'url', Utils::get_args_option( 'thumb', $option, array() ) ),
    103                         'fcrm_tags'       => Utils::get_args_option( 'fcrm_tags', $option ),
    104                         'groundhogg_tags' => Utils::get_args_option( 'groundhogg_tags', $option ),
    105                         'funnelkit_tags'  => Utils::get_args_option( 'funnelkit_tags', $option ),
     101                        'label'               => Utils::get_args_option( 'label', $option ),
     102                        'thumb'               => Utils::get_args_option( 'url', Utils::get_args_option( 'thumb', $option, array() ) ),
     103                        'fcrm_tags'           => Utils::get_args_option( 'fcrm_tags', $option ),
     104                        'fcrm_nps_tags'       => Utils::get_args_option( 'fcrm_nps_tags', $option ),
     105                        'groundhogg_tags'     => Utils::get_args_option( 'groundhogg_tags', $option ),
     106                        'groundhogg_nps_tags' => Utils::get_args_option( 'groundhogg_nps_tags', $option ),
     107                        'funnelkit_tags'      => Utils::get_args_option( 'funnelkit_tags', $option ),
     108                        'funnelkit_nps_tags'  => Utils::get_args_option( 'funnelkit_nps_tags', $option ),
    106109                    );
    107110                }
  • wp-poll/trunk/includes/classes/class-meta-boxes.php

    r2818062 r2824528  
    340340                    'style'      => 'danger',
    341341                    'content'    => esc_html__( 'Form is available only for poll type.', 'wp-poll' ),
    342                     'dependency' => array( '_type', '!=', 'poll', 'all' ),
     342                    'dependency' => array( '_type', 'not-any', 'poll,nps,reaction', 'all' ),
    343343                ),
    344344                array(
     
    348348                    'type'       => 'switcher',
    349349                    'default'    => false,
    350                     'dependency' => array( '_type', '==', 'poll', 'all' ),
     350                    'dependency' => array( '_type', 'any', 'poll,nps,reaction', 'all' ),
    351351                ),
    352352                array(
     
    370370                    ),
    371371                    'default'    => array( 'first_name', 'email_address' ),
    372                     'dependency' => array( '_type|poll_form_enable', '==|==', 'poll|true', 'all' ),
     372                    'dependency' => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
    373373                ),
    374374                array(
     
    377377                    'subtitle'   => esc_html__( 'Label for first name in the form', 'wp-poll' ),
    378378                    'type'       => 'text',
    379                     'dependency' => array( '_type|poll_form_enable', '==|==', 'poll|true', 'all' ),
     379                    'dependency' => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
    380380                ),
    381381                array(
     
    384384                    'subtitle'   => esc_html__( 'Label for last name in the form', 'wp-poll' ),
    385385                    'type'       => 'text',
    386                     'dependency' => array( '_type|poll_form_fields|poll_form_enable', '==|any|==', 'poll|last_name|true', 'all' ),
     386                    'dependency' => array( '_type|poll_form_fields|poll_form_enable', 'any|any|==', 'poll,nps,reaction|last_name|true', 'all' ),
    387387                ),
    388388                array(
     
    391391                    'subtitle'   => esc_html__( 'Label for email address in the form', 'wp-poll' ),
    392392                    'type'       => 'text',
    393                     'dependency' => array( '_type|poll_form_enable', '==|==', 'poll|true', 'all' ),
     393                    'dependency' => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
    394394                ),
    395395                array(
     
    398398                    'subtitle'   => esc_html__( 'Label for submit button in the form.', 'wp-poll' ),
    399399                    'type'       => 'text',
    400                     'dependency' => array( '_type|poll_form_enable', '==|==', 'poll|true', 'all' ),
     400                    'dependency' => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
    401401                ),
    402402                array(
     
    407407                    'media_buttons' => false,
    408408                    'height'        => '100px',
    409                     'dependency'    => array( '_type|poll_form_enable', '==|==', 'poll|true', 'all' ),
     409                    'dependency'    => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
    410410                ),
    411411                array(
     
    416416                    'media_buttons' => false,
    417417                    'height'        => '100px',
    418                     'dependency'    => array( '_type|poll_form_enable', '==|==', 'poll|true', 'all' ),
     418                    'dependency'    => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
    419419                ),
    420420                array(
    421421                    'type'       => 'subheading',
    422422                    'content'    => esc_html__( 'Form Stylying', 'wp-poll' ),
    423                     'dependency' => array( '_type|poll_form_enable', '==|==', 'poll|true', 'all' ),
     423                    'dependency' => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
    424424                ),
    425425                array(
     
    435435                        'button_bg_hover' => esc_html__( 'Button Bg (Hover))', 'wp-poll' ),
    436436                    ),
    437                     'dependency' => array( '_type|poll_form_enable', '==|==', 'poll|true', 'all' ),
     437                    'dependency' => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
    438438                ),
    439439                array(
     
    447447                    'text_align'     => false,
    448448                    'letter_spacing' => false,
    449                     'dependency'     => array( '_type|poll_form_enable', '==|==', 'poll|true', 'all' ),
     449                    'dependency'     => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
    450450                ),
    451451                array(
     
    459459                    'text_align'     => false,
    460460                    'letter_spacing' => false,
    461                     'dependency'     => array( '_type|poll_form_enable', '==|==', 'poll|true', 'all' ),
     461                    'dependency'     => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
    462462                ),
    463463                array(
     
    471471                    'text_align'     => false,
    472472                    'letter_spacing' => false,
    473                     'dependency'     => array( '_type|poll_form_enable', '==|==', 'poll|true', 'all' ),
     473                    'dependency'     => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
    474474                ),
    475475            ),
  • wp-poll/trunk/includes/functions.php

    r2797768 r2824528  
    606606        global $wpdb, $poll;
    607607
    608         $defaults    = array(
     608        $defaults = array(
    609609            'poll_id'         => $poll instanceof LIQUIDPOLL_Poll ? $poll->get_id() : '',
    610610            'poll_type'       => 'poll',
     
    614614            'datetime'        => current_time( 'mysql' ),
    615615        );
    616         $args        = wp_parse_args( $args, $defaults );
     616        $args     = wp_parse_args( $args, $defaults );
    617617//      $entry_count = $wpdb->get_var( "SELECT COUNT(*) FROM " . LIQUIDPOLL_RESULTS_TABLE . " WHERE poll_type = '{$args['poll_type']}' AND poller_id_ip = '{$args['poller_id_ip']}'" );
    618618//      if ( $entry_count > 0 ) {
     
    739739
    740740
    741 
     741if( ! function_exists('liquidpoll_get_feedback_form')) {
     742    /**
     743     * Return html content for feedback form
     744     *
     745     * @return false|string
     746     */
     747    function liquidpoll_get_feedback_form() {
     748
     749        ob_start();
     750        liquidpoll_single_poll_form();
     751
     752        return ob_get_clean();
     753
     754    }
     755}
  • wp-poll/trunk/readme.txt

    r2818062 r2824528  
    44    Tags: poll, polls, survey, NPS, vote
    55    Requires at least: 4.6
    6     Tested up to: 6.1
    7     Stable tag: 3.3.46
     6    Tested up to: 6.1.1
     7    Stable tag: 3.3.47
    88    License: GPLv2 or later
    99    License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    308308* 14/11/2022 - NEW - Countdown timer style added in poll theme 10, 11 and 12.
    309309
     310= 3.3.47 =
     311* 26/11/2022 - NEW - Form added for nps and reaction.
     312
  • wp-poll/trunk/templates/content-single-poll.php

    r2794157 r2824528  
    4444                ob_start();
    4545                liquidpoll_get_template_part( 'single-nps/theme', $poll->get_theme(), ( $poll->get_theme() > 1 && liquidpoll()->is_pro() ) );
    46                 printf( '<form action="" class="nps-container" data-poll-id="%s" method="get">%s</form>', $poll->get_id(), ob_get_clean() );
     46                printf( '%s <form action="" class="nps-form" data-poll-id="%s" method="get">%s</form>', liquidpoll_get_feedback_form(), $poll->get_id(), ob_get_clean() );
    4747
    4848            } elseif ( 'reaction' == $poll->get_type() ) {
     
    5151                liquidpoll_get_template_part( 'single-reaction/theme', $poll->get_theme(), ( $poll->get_theme() > 0 && liquidpoll()->is_pro() ) );
    5252                printf( '<input type="hidden" name="poll_id" value="%s">', $poll->get_id() );
    53                 printf( '<form action="" class="reaction-container" data-poll-id="%s" method="get">%s</form>', $poll->get_id(), ob_get_clean() );
     53                printf( '%s <form action="" class="reaction-container" data-poll-id="%s" method="get">%s</form>', liquidpoll_get_feedback_form(), $poll->get_id(), ob_get_clean() );
    5454
    5555            } else {
  • wp-poll/trunk/templates/single-nps/theme-1.php

    r2788325 r2824528  
    102102}
    103103
    104 
    105104if ( $poll->ready_to_vote() ) {
    106105
  • wp-poll/trunk/templates/single-poll/form.php

    r2797768 r2824528  
    2222$poll_form_notice           = $poll->get_meta( 'poll_form_notice' );
    2323$poll_form_style_colors     = $poll->get_meta( 'poll_form_style_colors' );
     24$submit_button_text         = esc_attr__( 'View Results', 'wp-poll' );
    2425
     26if ( 'nps' == $poll->get_type() || 'reaction' == $poll->get_type() ) {
     27    $submit_button_text = esc_attr__( 'Confirm Optin', 'wp-poll' );
     28}
    2529
    2630?>
     
    6367        <div class="liquidpoll-form-field">
    6468            <input type="hidden" name="poll_id" value="<?php echo esc_attr( $poll->get_id() ); ?>">
    65             <input id="liquidpoll_submit" class="liquidpoll-button" type="submit" value="<?php echo esc_attr__( 'View Results', 'wp-poll' ); ?>">
     69            <input id="liquidpoll_submit" class="liquidpoll-button" type="submit" value="<?php echo $submit_button_text; ?>">
    6670        </div>
    6771
  • wp-poll/trunk/wp-poll.php

    r2818062 r2824528  
    44 * Plugin URI: https://liquidpoll.com
    55 * Description: It allows user to poll in your website with many awesome features.
    6  * Version: 3.3.46
     6 * Version: 3.3.47
    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.46' );
     29defined( 'LIQUIDPOLL_VERSION' ) || define( 'LIQUIDPOLL_VERSION', '3.3.47' );
    3030
    3131if ( ! class_exists( 'LIQUIDPOLL_Main' ) ) {
Note: See TracChangeset for help on using the changeset viewer.