Plugin Directory

Changeset 2979600


Ignore:
Timestamp:
10/16/2023 02:21:57 PM (2 years ago)
Author:
wiseagentwp
Message:

3.2 Update

Location:
wiseagentleadform
Files:
13 added
7 edited

Legend:

Unmodified
Added
Removed
  • wiseagentleadform/trunk/README.txt

    r2956334 r2979600  
    99Tested up to: WordPress 6.2.2
    1010
    11 Stable tag: 3.1.3
     11Stable tag: 3.2
    1212
    1313License: GPL v2 or later
     
    5151A: Yes, you can set up lead rules within Wise Agent to automate lead management based on your specified criteria.
    5252
     53Q: How can I add Google reCAPTCHA to my forms?
     54
     55A: You can now add a site key and secret key to your Wise Agent Lead Forms settings page to enable Google reCAPTCHA on your forms.
     56
     57Q: How can I add hCaptcha to my forms?
     58
     59A: You can now add a site key and secret key to your Wise Agent Lead Forms settings page to enable hCaptcha on your forms.
     60
     61Q: What is Captcha?
     62
     63A: Captcha is a type of challenge-response test used in computing to determine whether or not the user is human. Captcha is used to prevent bots from automatically submitting forms.
     64
    5365== Changelog ==
    5466
     
    6577* Fix for Unknown or bad timezone
    6678* Added SMS consent checkbox to the form if there is a phone field
     79= 3.2 =
     80* Added support for Google reCAPTCHA on forms
     81* Added support for hCaptcha on forms
    6782== Support ==
    6883
  • wiseagentleadform/trunk/WA_API.php

    r2935376 r2979600  
    11<?php
    22defined('ABSPATH') or die();
    3 
    43class WA_API {
    54    /**
     
    7877
    7978    /**
     79     * @var string
     80     * The hCaptcha secret key
     81     */
     82    private $hCaptcha_secret = '';
     83
     84    /**
     85     * @var string
     86     * The hCaptcha site key
     87     */
     88    private $hCaptcha_site_key = '';
     89
     90    /**
     91     * @var bool
     92     * Whether or not hCaptcha is enabled
     93     */
     94    private $hCaptcha_enabled = false;
     95
     96    /**
     97     * @var string
     98     * The hCaptcha secret key
     99     */
     100    private $reCaptcha_secret = '';
     101
     102    /**
     103     * @var string
     104     * The hCaptcha site key
     105     */
     106    private $reCaptcha_site_key = '';
     107
     108    /**
     109     * @var bool
     110     * Whether or not hCaptcha is enabled
     111     */
     112    private $reCaptcha_enabled = false;
     113
     114    /**
    80115     * Construct the Wise Agent API object
    81116     * @param array $wa_options   The wiseagent_options array from the database
    82117     */
    83     public function __construct($wa_options)
     118    public function __construct($wa_options, $h_captcha_options, $re_captcha_options)
    84119    {
    85         $this->set_wa_opts($wa_options);
     120        $this->set_wa_opts($wa_options, $h_captcha_options, $re_captcha_options);
    86121        $this->logged_in = false;
    87122    }
     
    122157        }
    123158        return $result;
     159    }
     160
     161    public function get_hCaptcha_settings () {
     162        return ['site_key' => $this->hCaptcha_site_key, 'secret' => $this->hCaptcha_secret, 'enabled' => $this->hCaptcha_enabled];
     163    }
     164
     165    public function get_re_captcha_settings() {
     166        return ['site_key' => $this->reCaptcha_site_key, 'secret' => $this->reCaptcha_secret, 'enabled' => $this->reCaptcha_enabled];
    124167    }
    125168
     
    344387    }
    345388
     389    public function validate_h_captcha ($hCaptcha_response) {
     390        $data = [
     391            'secret' => $this->hCaptcha_secret,
     392            'response' => $hCaptcha_response
     393        ];
     394
     395        $args = [
     396            'body' => $data,
     397            'headers' => [
     398                'Content-Type' => 'application/x-www-form-urlencoded'
     399            ]
     400        ];
     401
     402        $response = wp_remote_post('https://hcaptcha.com/siteverify',$args);
     403
     404        if ($response['response']['code'] != 200) {
     405            error_log('validate_h_captcha: ' . $response['response']['message'] . "\n", 3, WA_LOG_FILE);
     406            return false;
     407        }
     408        if (is_wp_error($response)) {
     409            error_log('validate_h_captcha: ' . $response->get_error_message(), 3, WA_LOG_FILE);
     410            $this->last_error = ['error' => $response->get_error_message(), 'error_description' => 'Something went wrong. Please try again.'];
     411            return false;
     412        }
     413        $serialized_response = json_decode($response['body']);
     414        if($serialized_response->success) {
     415            return true;
     416        } else {
     417            return false;
     418        }
     419    }
     420
     421    public function validate_re_captcha ($re_captcha_response) {
     422        $data = [
     423            'secret' => $this->reCaptcha_secret,
     424            'response' => $re_captcha_response
     425        ];
     426       
     427        $args = [
     428            'body' => $data,
     429            'headers' => [
     430                'Content-Type' => 'application/x-www-form-urlencoded'
     431            ]
     432        ];
     433
     434        $response = wp_remote_post('https://www.google.com/recaptcha/api/siteverify',$args);
     435
     436        if ($response['response']['code'] != 200) {
     437            error_log('validate_re_captcha: ' . $response['response']['message'] . "\n", 3, WA_LOG_FILE);
     438            return false;
     439        }
     440        if (is_wp_error($response)) {
     441            error_log('validate_re_captcha: ' . $response->get_error_message(), 3, WA_LOG_FILE);
     442            $this->last_error = ['error' => $response->get_error_message(), 'error_description' => 'Something went wrong. Please try again.'];
     443            return false;
     444        }
     445        $serialized_response = json_decode($response['body']);
     446        // log response
     447        error_log('validate_re_captcha: ' . print_r($serialized_response, true) . "\n", 3, WA_LOG_FILE);
     448        if($serialized_response->success) {
     449            // check action matches
     450            if($serialized_response->action != 'submit') {
     451                return false;
     452            }
     453            // check hostname matches
     454            if($serialized_response->hostname != $_SERVER['SERVER_NAME']) {
     455                return false;
     456            }
     457            // check score
     458            if($serialized_response->score < 0.4) {
     459                return false;
     460            }
     461            return true;
     462        } else {
     463            return false;
     464        }
     465    }
     466
    346467    // Private methods
    347468
     
    480601        update_option('wiseagent_options', $options);
    481602
     603        $h_captcha_options = get_option('wiseagent_hcaptcha_options');
     604        $re_captcha_options = get_option('wiseagent_recaptcha_options');
     605
    482606        // Update local variables
    483         $this->set_wa_opts($options);
     607        $this->set_wa_opts($options, $h_captcha_options, $re_captcha_options);
    484608
    485609        $this->last_error = null;
     
    491615     * @return void
    492616     */
    493     private function set_wa_opts($wa_options) {
     617    private function set_wa_opts($wa_options, $h_captcha_options, $re_captcha_options) {
    494618        $this->access_token = isset($wa_options['access_token']) ? $wa_options['access_token'] : '';
    495619        $this->refresh_token = isset($wa_options['refresh_token']) ? $wa_options['refresh_token'] : '';
     
    497621        $this->last_cache = isset($wa_options['last_cache']) ? $wa_options['last_cache'] : null;
    498622        $this->code_verifier = isset($wa_options['code_verifier']) ? $wa_options['code_verifier'] : '';
     623        $this->hCaptcha_secret = isset($h_captcha_options['hCaptcha_secret']) ? $h_captcha_options['hCaptcha_secret'] : '';
     624        $this->hCaptcha_site_key = isset($h_captcha_options['hCaptcha_site_key']) ? $h_captcha_options['hCaptcha_site_key'] : '';
     625        $this->hCaptcha_enabled = isset($h_captcha_options['hCaptcha_enabled']) ? $h_captcha_options['hCaptcha_enabled'] : false;
     626        $this->reCaptcha_enabled = isset($re_captcha_options['reCaptcha_enabled']) ? $re_captcha_options['reCaptcha_enabled'] : false;
     627        $this->reCaptcha_secret = isset($re_captcha_options['reCaptcha_secret']) ? $re_captcha_options['reCaptcha_secret'] : '';
     628        $this->reCaptcha_site_key = isset($re_captcha_options['reCaptcha_site_key']) ? $re_captcha_options['reCaptcha_site_key'] : '';
     629
    499630        if(isset($wa_options['cached_forms'])) {
    500631            $this->cached_forms = json_decode($wa_options['cached_forms']);
     
    509640    private function save_opts($updateCacheDate = false) {
    510641        $options = get_option('wiseagent_options');
     642        $h_captcha_options = get_option('wiseagent_hcaptcha_options');
     643        $re_captcha_options = get_option('wiseagent_recaptcha_options');
    511644        $options['access_token'] = $this->access_token;
    512645        $options['refresh_token'] = $this->refresh_token;
     
    514647        $options['code_verifier'] = $this->code_verifier;
    515648        $options['cached_forms'] = json_encode($this->cached_forms);
     649        $h_captcha_options['hCaptcha_secret'] = $this->hCaptcha_secret;
     650        $h_captcha_options['hCaptcha_site_key'] = $this->hCaptcha_site_key;
     651        $h_captcha_options['hCaptcha_enabled'] = $this->hCaptcha_enabled;
     652        $re_captcha_options['reCaptcha_secret'] = $this->reCaptcha_secret;
     653        $re_captcha_options['reCaptcha_site_key'] = $this->reCaptcha_site_key;
     654        $re_captcha_options['reCaptcha_enabled'] = $this->reCaptcha_enabled;
     655
    516656        if($updateCacheDate) {
    517657            $options['last_cache'] = time();
     
    519659        }
    520660        update_option('wiseagent_options', $options);
     661        update_option('wiseagent_hcaptcha_options', $h_captcha_options);
     662        update_option('wiseagent_recaptcha_options', $re_captcha_options);
    521663    }
    522664
  • wiseagentleadform/trunk/captureForm.js

    r2956334 r2979600  
    99    });
    1010});
     11
     12function onSubmitWAForm (token) {
     13    var forms = document.querySelectorAll('.wiseagent-form-container form');
     14    forms.forEach(function (form) {
     15        if(form.checkValidity())
     16            form.submit();
     17        else
     18            form.reportValidity();
     19    });
     20}
  • wiseagentleadform/trunk/css/wiseagent-form.css

    r2956334 r2979600  
    8080    border-radius: 5px;
    8181    padding: 10px 20px 10px 20px;
     82    cursor: pointer;
    8283}
     84
     85.wa-collapsible-title {
     86    display: flex;
     87    justify-content: space-between;
     88    align-items: center;
     89    cursor: pointer;
     90    background-color: #fff;
     91    height: 4em;
     92    padding: 1em;
     93    border: 1px solid #ccc;
     94    width: 600px;
     95}
     96
     97.wa-collapsible-content {
     98    display: none;
     99    overflow: hidden;
     100    transition: max-height 0.2s ease-out;
     101    background-color: #f9fafa;
     102    padding: 1em;
     103    width: 600px;
     104}
  • wiseagentleadform/trunk/wa_widget.php

    r2956334 r2979600  
    509509            return $my_forms;
    510510        } else {
    511             $wa_api = new WA_API(get_option("wiseagent_options"));
     511            $wa_api = new WA_API(get_option("wiseagent_options"), get_option('wiseagent_hcaptcha_options'), get_option('wiseagent_recaptcha_options'));
    512512            $my_forms_resp = $wa_api->get_wa_capture_forms();
    513513            $this->wa_forms_resp = $my_forms_resp;
  • wiseagentleadform/trunk/wiseagent.js

    r2935376 r2979600  
    6161        });
    6262    });
     63
     64    document.body.addEventListener("click", function(event) {
     65        if (event.target.classList.contains("wa-collapsible-title")) {
     66            var formId = event.target.getAttribute("data-form-id");
     67            var content = document.querySelector('.wa-collapsible-content[data-form-id="' + formId + '"]');
     68            if (content.style.display === "block") {
     69                content.style.display = "none";
     70                // add dashicons-arrow-up-alt2 class, remove dashicons-arrow-down-alt2 class
     71                var icon = event.target.querySelector("i");
     72                icon.classList.remove("dashicons-arrow-up-alt2");
     73                icon.classList.add("dashicons-arrow-down-alt2");
     74            } else {
     75                content.style.display = "block";
     76                // add dashicons-arrow-down-alt2 class, remove dashicons-arrow-up-alt2 class
     77                var icon = event.target.querySelector("i");
     78                icon.classList.remove("dashicons-arrow-down-alt2");
     79                icon.classList.add("dashicons-arrow-up-alt2");
     80            }
     81        }
     82    });
    6383});
  • wiseagentleadform/trunk/wiseagent.php

    r2956334 r2979600  
    33    Plugin URI: http://www.wiseagent.com
    44    Description: Wise Agent Lead Forms plugin for WordPress
    5     Version: 3.1.3
     5    Version: 3.2
    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
     
    2020    {
    2121
    22         $this->wa_api = new WA_API(get_option('wiseagent_options'));
     22        $this->wa_api = new WA_API(get_option('wiseagent_options'), get_option('wiseagent_hcaptcha_options'), get_option('wiseagent_recaptcha_options'));
    2323        add_action('admin_menu', array($this,'wiseagent_admin_menu'));
    2424        // Register callback endpoint to handle Wise Agent OAuth2 callback
     
    4646     */
    4747    public function wiseagent_capture_form_js() {
    48         wp_enqueue_script('wiseagent_capture_form_js', plugins_url('captureForm.js', __FILE__), array(), "1.0.0");
     48        wp_enqueue_script('wiseagent_capture_form_js', plugins_url('captureForm.js', __FILE__), array(), "1.0.1");
    4949    }
    5050    /**
     
    7171            $redirect_page = $_POST['_wp_http_referer'];
    7272            error_log("wiseagent_capture_form: responsePage is not a valid URL\n", 3, WA_LOG_FILE);
     73        }
     74
     75        // Validate h-captcha-response
     76        $captcha_settings = $this->wa_api->get_hCaptcha_settings();
     77        if($captcha_settings['enabled'] == true) {
     78            $captcha_response = $_POST['h-captcha-response'];
     79            if($this->wa_api->validate_h_captcha($captcha_response) == false) {
     80                error_log("\nwiseagent_capture_form: h-captcha-response failed for form_id $form_id\n", 3, WA_LOG_FILE);
     81                wp_nonce_ays("wa_capture_form_nonce");
     82            }
     83            // remove captcha response from POST data
     84            unset($_POST['h-captcha-response']);
     85            unset($_POST['g-recaptcha-response']);
     86        }
     87
     88        // Validate re-captcha response
     89        $re_captcha_settings = $this->wa_api->get_re_captcha_settings();
     90        if($re_captcha_settings['enabled'] == true) {
     91
     92            $re_captcha_response = $_POST['g-recaptcha-response'];
     93            if($this->wa_api->validate_re_captcha($re_captcha_response) == false) {
     94                error_log("\nwiseagent_capture_form: re-captcha-response failed for form_id $form_id\n", 3, WA_LOG_FILE);
     95                wp_nonce_ays("wa_capture_form_nonce");
     96            }
     97            // remove captcha response from POST data
     98            unset($_POST['h-captcha-response']);
     99            unset($_POST['g-recaptcha-response']);
    73100        }
    74101
     
    139166            $error_html = $this->wa_api->get_last_error_html();
    140167            if($error_html != '') {
    141                 echo esc_html($error_html);
     168                echo wp_kses_post($error_html);
    142169            }
    143170            echo '<p>Wise Agent is a lead management tool that helps you capture leads, manage contacts, and track your marketing efforts.</p>';
     
    267294            // Display User Info
    268295            $this->wiseagent_user();
    269         }
     296            echo '<hr/>';
     297
     298            // Display section for Google re-captcha setup
     299            $this->re_captcha_settings_form();
     300
     301            // Display section for hCaptcha setup
     302            $this->h_captcha_settings_form();
     303
     304
     305        }
     306    }
     307
     308    /**
     309     * Render the Google reCAPTCHA settings form
     310     */
     311    public function re_captcha_settings_form() {
     312        $re_captcha_settings = $this->wa_api->get_re_captcha_settings();
     313        $expanded_style = $re_captcha_settings['enabled'] ? 'display:block;' : 'display:none;';
     314        // Add dashicon chevron class
     315        $arrow_class = $re_captcha_settings['enabled'] ? 'dashicons-arrow-up-alt2' : 'dashicons-arrow-down-alt2';
     316
     317        echo '<div class="wa-collapsible-title" data-form-id="reCaptcha"><h3><a href="https://www.google.com/u/2/recaptcha/admin/create" target="_blank">Google reCAPTCHA (v3) Setup</a></h3> <i class="dashicons ' . $arrow_class . '" ></i></div>';
     318        echo '<div class="wiseagent-form-container">';
     319        echo '<div class="wiseagent-form-body wa-collapsible-content" data-form-id="reCaptcha" style="' . $expanded_style .'">';
     320        echo '<form method="post" action="options.php" class="wiseagent-form">';
     321        settings_fields('wiseagent_recaptcha_options');
     322        do_settings_sections('wiseagent_recaptcha_options');
     323   
     324        echo '<input type="checkbox" id="wiseagent_recaptcha_options[reCaptcha_enabled]" name="wiseagent_recaptcha_options[reCaptcha_enabled]" value="1" ' . ($re_captcha_settings['enabled'] ? 'checked' : '') . ' />';
     325        echo '<label for="wiseagent_recaptcha_options[reCaptcha_enabled]">Enable Google reCAPTCHA</label>';
     326        echo '<br/><br/>';
     327        echo '<label for="wiseagent_recaptcha_options[reCaptcha_site_key]">Google reCAPTCHA Site Key</label>';
     328        echo '<input style="width:450px;" placeholder="Your Google reCAPTCHA Site-Key" type="text" id="wiseagent_recaptcha_options[reCaptcha_site_key]" name="wiseagent_recaptcha_options[reCaptcha_site_key]" value="' . esc_html($re_captcha_settings['site_key']) . '" class="form-control"/>';
     329        echo '<br/>';
     330        echo '<label for="wiseagent_recaptcha_options[reCaptcha_secret]">Google reCAPTCHA Secret Key</label>';
     331        echo '<input style="width:450px;" placeholder="Your Google reCAPTCHA Secret" type="password" id="wiseagent_recaptcha_options[reCaptcha_secret]" name="wiseagent_recaptcha_options[reCaptcha_secret]" value="' . esc_html($re_captcha_settings['secret']) . '" class="form-control"/>';
     332        echo '<br/>';
     333        echo '<input type="submit" class="button button-primary" value="Save Settings" />';
     334        echo '</form>';
     335        echo '</div>';
     336        echo '</div>';
     337    }
     338
     339    /**
     340     * Render the hCaptcha settings form
     341     */
     342    public function h_captcha_settings_form() {
     343        $captcha_settings = $this->wa_api->get_hCaptcha_settings();
     344        $expanded_style = $captcha_settings['enabled'] ? 'display:block;' : 'display:none;';
     345        // Add dashicon chevron class
     346        $arrow_class = $captcha_settings['enabled'] ? 'dashicons-arrow-up-alt2' : 'dashicons-arrow-down-alt2';
     347        echo '<hr/>';
     348        echo '<div class="wa-collapsible-title" data-form-id="hCaptcha"><h3><a href="https://www.hcaptcha.com/" target="_blank" >hCaptcha Setup</a></h3><i class="dashicons ' . $arrow_class . '" ></i></div>';
     349        echo '<div class="wiseagent-form-container">';
     350        echo '<div class="wiseagent-form-body wa-collapsible-content" data-form-id="hCaptcha" style="' . $expanded_style .'">';
     351        echo '<form method="post" action="options.php" class="wiseagent-form">';
     352        settings_fields('wiseagent_hcaptcha_options');
     353        do_settings_sections('wiseagent_hcaptcha_options');
     354   
     355        echo '<input type="checkbox" name="wiseagent_hcaptcha_options[hCaptcha_enabled]" id="wiseagent_hcaptcha_options[hCaptcha_enabled]" value="1" ' . ($captcha_settings['enabled'] ? 'checked' : '') . ' />';
     356        echo '<label for="wiseagent_hcaptcha_options[hCaptcha_enabled]">Enable hCaptcha</label>';
     357        echo '<br/><br/>';
     358        echo '<label for="wiseagent_hcaptcha_options[hCaptcha_site_key]">hCaptcha Site Key</label>';
     359        echo '<input style="width:450px;" placeholder="Your hCaptcha Site-Key" type="text" name="wiseagent_hcaptcha_options[hCaptcha_site_key]" id="wiseagent_hcaptcha_options[hCaptcha_site_key]" value="' . esc_html($captcha_settings['site_key']) . '" class="form-control"/>';
     360        echo '<br/>';
     361        echo '<label for="wiseagent_hcaptcha_options[hCaptcha_secret]">hCaptcha Secret Key</label>';
     362        echo '<input style="width:450px;" placeholder="Your hCaptcha Secret" type="password" name="wiseagent_hcaptcha_options[hCaptcha_secret]" id="wiseagent_hcaptcha_options[hCaptcha_secret]" value="' . esc_html($captcha_settings['secret']) . '" class="form-control"/>';
     363        echo '<br/>';
     364        echo '<input type="submit" class="button button-primary" value="Save Settings" />';
     365        echo '</form>';
     366        echo '</div>';
     367        echo '</div>';
    270368    }
    271369
     
    274372     */
    275373    public function wiseagent_capture_form_css() {
    276         wp_enqueue_style('wiseagent-form-css', plugin_dir_url(__FILE__) . 'css/wiseagent-form.css',array(),"1.1.0");
     374        wp_enqueue_style('wiseagent-form-css', plugin_dir_url(__FILE__) . 'css/wiseagent-form.css',array(),"1.1.1");
    277375    }
    278376
     
    281379     */
    282380    public function wiseagent_admin_scripts() {
    283         wp_enqueue_script('wiseagent_admin', plugins_url('wiseagent.js', __FILE__), array(), "1.2.8");
     381        wp_enqueue_script('wiseagent_admin', plugins_url('wiseagent.js', __FILE__), array(), "1.2.9");
    284382    }
    285383
     
    289387    public function wiseagent_admin_init() {
    290388        register_setting('wiseagent_options', 'wiseagent_options');
     389        register_setting('wiseagent_hcaptcha_options', 'wiseagent_hcaptcha_options');
     390        register_setting('wiseagent_recaptcha_options', 'wiseagent_recaptcha_options');
    291391
    292392        if (is_plugin_active( 'elementor/elementor.php' )) {
     
    352452        $this->wa_api->revoke_token();
    353453        delete_option('wiseagent_options');
     454        delete_option('wiseagent_hcaptcha_options');
     455        delete_option('wiseagent_recaptcha_options');
    354456    }
    355457
     
    476578        }
    477579
     580       
     581        // Handle Captcha settings
     582        $captcha_settings = $this->wa_api->get_hCaptcha_settings();
     583        $re_captcha_settings = $this->wa_api->get_re_captcha_settings();
     584        $captcha_html = '';
     585        $recaptcha_html = '';
     586        if($captcha_settings['enabled'] == true) {
     587            $captcha_html = '<div class="h-captcha" data-sitekey="'. $captcha_settings['site_key'] . '"></div>';
     588            $captcha_html .= '<script src="https://js.hcaptcha.com/1/api.js" async defer></script>';
     589        }
     590
     591        if($re_captcha_settings['enabled'] == true) {
     592            $recaptcha_html.= '<script src="https://www.google.com/recaptcha/api.js" async defer></script>';
     593            $recaptcha_html .= '<input type="button" value="' . esc_html($buttonText) .  '" class="g-recaptcha" data-sitekey="'. $re_captcha_settings['site_key'] . '" data-callback="onSubmitWAForm" data-action="submit"/>';
     594        }
     595
    478596        wp_enqueue_script("wiseagent_capture_form_js");
    479597        $html = '<div class="wiseagent-form-container">
     
    486604                            $html .= wp_nonce_field("wa_capture_form", 'wa_capture_form_nonce', true, false);
    487605                            $html .= $additional_fields_html;
     606                            $html .= $captcha_html;
    488607                            $html .= '<div class="wiseagent-form-submit">';
    489                             $html .=  '<input type="submit" value="' . esc_html($buttonText) . '" />';
     608                            $html .= $re_captcha_settings['enabled'] == false ? ('<input type="submit" value="' . esc_html($buttonText) . '" />') : $recaptcha_html;
    490609                            $html .= '</div>
    491610                        </form>
Note: See TracChangeset for help on using the changeset viewer.