Changeset 2956334
- Timestamp:
- 08/21/2023 04:30:49 PM (3 years ago)
- Location:
- wiseagentleadform
- Files:
-
- 14 added
- 4 edited
-
tags/3.1.3 (added)
-
tags/3.1.3/README.txt (added)
-
tags/3.1.3/WA_API.php (added)
-
tags/3.1.3/captureForm.js (added)
-
tags/3.1.3/classes (added)
-
tags/3.1.3/classes/captureFormTable.php (added)
-
tags/3.1.3/css (added)
-
tags/3.1.3/css/wiseagent-form.css (added)
-
tags/3.1.3/images (added)
-
tags/3.1.3/images/logo_welcome.png (added)
-
tags/3.1.3/wa_widget.php (added)
-
tags/3.1.3/wiseagent.js (added)
-
tags/3.1.3/wiseagent.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/captureForm.js (added)
-
trunk/css/wiseagent-form.css (modified) (1 diff)
-
trunk/wa_widget.php (modified) (1 diff)
-
trunk/wiseagent.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wiseagentleadform/trunk/README.txt
r2938326 r2956334 9 9 Tested up to: WordPress 6.2.2 10 10 11 Stable tag: 3.1. 211 Stable tag: 3.1.3 12 12 13 13 License: GPL v2 or later … … 62 62 * Security Patches 63 63 * 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 66 67 == Support == 67 68 -
wiseagentleadform/trunk/css/wiseagent-form.css
r2935376 r2956334 44 44 color: #a00!important; 45 45 } 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 29 29 } 30 30 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 } 34 38 35 39 protected function render() { -
wiseagentleadform/trunk/wiseagent.php
r2938326 r2956334 3 3 Plugin URI: http://www.wiseagent.com 4 4 Description: Wise Agent Lead Forms plugin for WordPress 5 Version: 3. 05 Version: 3.1.3 6 6 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 7 7 License: GPLv2 or later … … 38 38 add_action('admin_enqueue_scripts', array($this,'wiseagent_capture_form_css')); 39 39 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 } 43 50 /** 44 51 * Endpoint for form submission. Responds with thank you page and redirects to WACaptureForm::responsePage … … 107 114 // Button to refresh the cached capture forms 108 115 $last_updated = new DateTime(); 116 $tz = get_option('timezone_string'); 117 if($tz === false || strlen($tz) == 0) 118 $tz = 'UTC'; 109 119 $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)); 111 122 if($this->wa_api->last_cache != null) 112 123 $last_updated->setTimestamp($this->wa_api->last_cache); … … 263 274 */ 264 275 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"); 266 277 } 267 278 … … 281 292 if (is_plugin_active( 'elementor/elementor.php' )) { 282 293 $this->has_elementor = true; 283 add_action( 'elementor/widgets/register', array($this,'register_new_widgets') );284 294 } 285 295 } … … 295 305 add_action('wp_ajax_wa_capture_form', array($this,'wiseagent_capture_form')); 296 306 add_action('wp_ajax_nopriv_wa_capture_form', array($this,'wiseagent_capture_form')); 307 add_action( 'elementor/widgets/register', array($this,'register_new_widgets') ); 297 308 } 298 309 … … 358 369 */ 359 370 function wiseagent_form_shortcode($atts, $content = null, $tag = '') { 371 $require_consent_checkbox = false; 360 372 $fullatts = shortcode_atts(['form_id' => 0],$atts,$tag); 361 373 $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 } 362 380 if($form == null) { 363 381 return '<p>There was an error retrieving your forms. Please try again later.</p><br/><small>resp error</small><br/>'; … … 369 387 } 370 388 389 371 390 $form_id = $form->userFormID; 372 $css_class = $form->cssClass;373 391 // Sanitize user input, remove unallowed html tags 374 392 $source = wp_kses_post($form->Source); … … 382 400 if($c == null) { 383 401 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; 384 408 } 385 409 $field_class = "wiseagent-form-field form-group"; … … 399 423 if(strtolower(trim($c->type)) == "select") { 400 424 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"/>'; 402 426 403 427 foreach($c->optionList as $o) { … … 421 445 } else if (strtolower(trim($c->type)) == "textarea") { 422 446 $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>'; 424 448 } 425 449 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" : "") . '/>'; 427 451 $additional_fields_html .= '<label for="wa_' . esc_html($c->name) . '">' . esc_html($c->label) . '</label>'; 428 452 } 429 453 else { 430 454 $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) . '"/>'; 432 456 } 433 457 … … 436 460 $additional_fields_html .= '</div>'; 437 461 } 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 438 471 //set action to the wp_ajax_nopriv_wa_user_form_submit action 439 472 $action = admin_url('admin-ajax.php?action=wa_capture_form'); … … 446 479 $html = '<div class="wiseagent-form-container"> 447 480 <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"> 449 482 <input type="hidden" name="userFormID" value="' . esc_html($form_id) . '" /> 450 483 <input type="hidden" name="Source" value="' . esc_html($source) . '" />
Note: See TracChangeset
for help on using the changeset viewer.