Plugin Directory

Changeset 2956334


Ignore:
Timestamp:
08/21/2023 04:30:49 PM (3 years ago)
Author:
wiseagentwp
Message:

Updated to 3.1.3

Location:
wiseagentleadform
Files:
14 added
4 edited

Legend:

Unmodified
Added
Removed
  • wiseagentleadform/trunk/README.txt

    r2938326 r2956334  
    99Tested up to: WordPress 6.2.2
    1010
    11 Stable tag: 3.1.2
     11Stable tag: 3.1.3
    1212
    1313License: GPL v2 or later
     
    6262* Security Patches
    6363* Support for WP 6.2.2
    64 
    65 
     64= 3.1.3 =
     65* Fix for Unknown or bad timezone
     66* Added SMS consent checkbox to the form if there is a phone field
    6667== Support ==
    6768
  • wiseagentleadform/trunk/css/wiseagent-form.css

    r2935376 r2956334  
    4444    color: #a00!important;
    4545}
     46
     47.wiseagent-form .form-group {
     48    margin-bottom: 1rem;
     49}
     50
     51
     52.wiseagent-form .form-control {
     53    display: block;
     54    width: 100%;
     55    height: calc(1.5em + 0.75rem + 2px);
     56    padding: 0.375rem 0.75rem;
     57    font-size: 1rem;
     58    font-weight: 400;
     59    line-height: 1.5;
     60    color: #495057;
     61    background-color: #fff;
     62    background-clip: padding-box;
     63    border: 1px solid #ced4da;
     64    border-radius: 0.25rem;
     65    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
     66}
     67
     68.wiseagent-form .form-control:focus {
     69    color: #495057;
     70    background-color: #fff;
     71    border-color: #80bdff;
     72    outline: 0;
     73    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
     74}
     75
     76.wiseagent-form .wiseagent-form-submit input {
     77    width: 100%;
     78    height: 3em;
     79    border-style: none;
     80    border-radius: 5px;
     81    padding: 10px 20px 10px 20px;
     82}
  • wiseagentleadform/trunk/wa_widget.php

    r2935376 r2956334  
    2929    }
    3030
    31     public function get_script_depends() {}
    32 
    33     public function get_style_depends() {}
     31    public function get_script_depends() {
     32        return [];
     33    }
     34
     35    public function get_style_depends() {
     36        return [];
     37    }
    3438
    3539    protected function render() {
  • wiseagentleadform/trunk/wiseagent.php

    r2938326 r2956334  
    33    Plugin URI: http://www.wiseagent.com
    44    Description: Wise Agent Lead Forms plugin for WordPress
    5     Version: 3.0
     5    Version: 3.1.3
    66    Tags: CRM, forms, capture forms, contact management, Lead Capture Forms, Wise Agent, Lead Management Tool, Leads, Lead Capture, Landing page, WA forms, Wise Agent forms, Wise Agent Lead Forms
    77    License: GPLv2 or later
     
    3838        add_action('admin_enqueue_scripts', array($this,'wiseagent_capture_form_css'));
    3939
    40 
    41     }
    42 
     40        add_action('wp_enqueue_scripts', array($this,'wiseagent_capture_form_js'));
     41
     42    }
     43
     44    /**
     45     * Enqueue the captureForm.js script
     46     */
     47    public function wiseagent_capture_form_js() {
     48        wp_enqueue_script('wiseagent_capture_form_js', plugins_url('captureForm.js', __FILE__), array(), "1.0.0");
     49    }
    4350    /**
    4451     * Endpoint for form submission. Responds with thank you page and redirects to WACaptureForm::responsePage
     
    107114            // Button to refresh the cached capture forms
    108115            $last_updated = new DateTime();
     116            $tz = get_option('timezone_string');
     117            if($tz === false || strlen($tz) == 0)
     118                $tz = 'UTC';
    109119            $url = admin_url('admin-post.php?action=wa_refresh_capture_forms');
    110             $last_updated->setTimezone(new \DateTimeZone(get_option('timezone_string')));
     120            error_log("wiseagent_capture_form_menu_page: timezone_string: $tz\n", 3, WA_LOG_FILE);
     121            $last_updated->setTimezone(new \DateTimeZone($tz));
    111122            if($this->wa_api->last_cache != null)
    112123                $last_updated->setTimestamp($this->wa_api->last_cache);
     
    263274     */
    264275    public function wiseagent_capture_form_css() {
    265         wp_enqueue_style('wiseagent-form-css', plugin_dir_url(__FILE__) . 'css/wiseagent-form.css',array(),"1.0.9");
     276        wp_enqueue_style('wiseagent-form-css', plugin_dir_url(__FILE__) . 'css/wiseagent-form.css',array(),"1.1.0");
    266277    }
    267278
     
    281292        if (is_plugin_active( 'elementor/elementor.php' )) {
    282293            $this->has_elementor = true;
    283             add_action( 'elementor/widgets/register', array($this,'register_new_widgets') );
    284294        }
    285295    }
     
    295305        add_action('wp_ajax_wa_capture_form', array($this,'wiseagent_capture_form'));
    296306        add_action('wp_ajax_nopriv_wa_capture_form', array($this,'wiseagent_capture_form'));
     307        add_action( 'elementor/widgets/register', array($this,'register_new_widgets') );
    297308    }
    298309
     
    358369     */
    359370    function wiseagent_form_shortcode($atts, $content = null, $tag = '') {
     371        $require_consent_checkbox = false;
    360372        $fullatts = shortcode_atts(['form_id' => 0],$atts,$tag);
    361373        $form = $this->wa_api->get_wa_capture_form($fullatts['form_id']);
     374        $sms_consent_content = wp_kses_post($form->topHtml);
     375        $mobile_required = false;
     376        if(strlen(trim($sms_consent_content)) == 0) {
     377            // Default SMS consent content
     378            $sms_consent_content = 'By checking off this box and submitting your information you are agreeing to the Terms and Privacy policy of this site, and are opting in to receive communications through SMS text messaging. Msg&data rates may apply. Text Help for info, and STOP to unsubscribe. Msg frequency varies.';
     379        }
    362380        if($form == null) {
    363381            return '<p>There was an error retrieving your forms. Please try again later.</p><br/><small>resp error</small><br/>';
     
    369387        }
    370388
     389
    371390        $form_id = $form->userFormID;
    372         $css_class = $form->cssClass;
    373391        // Sanitize user input, remove unallowed html tags
    374392        $source = wp_kses_post($form->Source);
     
    382400            if($c == null) {
    383401                continue;
     402            }
     403            $required = property_exists($c, 'required') ? $c->required == "1" : false;
     404            if($c->name == "Cell" || $c->name == "CCell") {
     405                $require_consent_checkbox = true;
     406                if($required)
     407                    $mobile_required = true;
    384408            }
    385409            $field_class = "wiseagent-form-field form-group";
     
    399423                    if(strtolower(trim($c->type)) == "select") {
    400424
    401                         $additional_fields_html .= '<select ' . ($c->multi ? " multiple " : "") . ' id="wa_' . esc_html($c->name) . '" name="' . esc_html($c->name) . '" placeholder="' . esc_html($c->label) . '"' . ($c->required ? " required " : "") . ' class="form-control"/>';   
     425                        $additional_fields_html .= '<select ' . ($c->multi ? " multiple " : "") . ' id="wa_' . esc_html($c->name) . '" name="' . esc_html($c->name) . '" placeholder="' . esc_html($c->label) . '"' . ($required ? " required " : "") . ' class="form-control"/>';   
    402426
    403427                        foreach($c->optionList as $o) {
     
    421445                } else if (strtolower(trim($c->type)) == "textarea") {
    422446                    $additional_fields_html .= '<label for="wa_' . esc_html($c->name) . '">' . esc_html($c->label) . '</label>';
    423                     $additional_fields_html .= '<textarea id="wa_' . esc_html($c->name) . '" name="' . esc_html($c->name) . '" placeholder="' . esc_html($c->label) . ($c->required ? " required " : "") . '" maxlength="' . esc_html($c->max) . '" class="form-control"></textarea>';
     447                    $additional_fields_html .= '<textarea id="wa_' . esc_html($c->name) . '" name="' . esc_html($c->name) . '" placeholder="' . esc_html($c->label) . ($required ? " required " : "") . '" maxlength="' . esc_html($c->max) . '" class="form-control"></textarea>';
    424448                }
    425449                else if(strtolower(trim($c->type)) == "checkbox") {
    426                     $additional_fields_html .= '<input type="checkbox" id="wa_' . esc_html($c->name) . '" name="' . esc_html($c->name) . '" placeholder="' . esc_html($c->label) . '" ' . ($c->required ? "required" : "") . '/>';
     450                    $additional_fields_html .= '<input type="checkbox" id="wa_' . esc_html($c->name) . '" name="' . esc_html($c->name) . '" placeholder="' . esc_html($c->label) . '" ' . ($required ? "required" : "") . '/>';
    427451                    $additional_fields_html .= '<label for="wa_' . esc_html($c->name) . '">' . esc_html($c->label) . '</label>';
    428452                }
    429453                else {
    430454                    $additional_fields_html .= '<label for="wa_' . esc_html($c->name) . '">' . esc_html($c->label) . '</label>';
    431                     $additional_fields_html .= '<input class="form-control" type="' . esc_html($c->type) . '" id="wa_' . esc_html($c->name) . '" name="' . esc_html($c->name) . '" placeholder="' . esc_html($c->label) . '" ' . ($c->required ? "required" : "") . ' maxlength="' . esc_html($c->max) . '"/>';
     455                    $additional_fields_html .= '<input class="form-control" type="' . esc_html($c->type) . '" id="wa_' . esc_html($c->name) . '" name="' . esc_html($c->name) . '" placeholder="' . esc_html($c->label) . '" ' . ($required ? "required" : "") . ' maxlength="' . esc_html($c->max) . '"/>';
    432456                }
    433457
     
    436460            $additional_fields_html .= '</div>';
    437461        }
     462
     463        // Add consent checkbox if required
     464        if($require_consent_checkbox) {
     465            $additional_fields_html .= '<div class="wiseagent-form-field form-group checkbox-field" style="display:flex;align-items:baseline;margin-top:30px;opacity:0.5;font-size:0.8em;">';
     466            $additional_fields_html .= '<input type="checkbox" id="wa_consent" name="wa_consent" placeholder="Consent" ' . ($mobile_required ? 'required' : '') . '/>';
     467            $additional_fields_html .= '<label for="wa_consent">' . $sms_consent_content . '</label>';
     468            $additional_fields_html .= '</div>';
     469        }
     470
    438471        //set action to the wp_ajax_nopriv_wa_user_form_submit action
    439472        $action = admin_url('admin-ajax.php?action=wa_capture_form');
     
    446479        $html = '<div class="wiseagent-form-container">
    447480                    <div class="wiseagent-form-body">
    448                         <form id="wiseagent-form-' . esc_html($form_id) . '" class="wiseagent-form ' . esc_html($css_class) . '" action="'.esc_html($action).'" method="post">
     481                        <form id="wiseagent-form-' . esc_html($form_id) . '" class="wiseagent-form" action="'.esc_html($action).'" method="post">
    449482                            <input type="hidden" name="userFormID" value="' . esc_html($form_id) . '" />
    450483                            <input type="hidden" name="Source" value="' . esc_html($source) . '" />
Note: See TracChangeset for help on using the changeset viewer.