Plugin Directory

Changeset 3610560


Ignore:
Timestamp:
07/16/2026 05:16:25 PM (3 months ago)
Author:
divineboyaditya
Message:

new field added and phone field updated with country code

Location:
divine-smart-forms/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • divine-smart-forms/trunk/admin/assets/js/form-builder.js

    r3514051 r3610560  
    4949    function labelForType(type) {
    5050        var labels = {
    51             text:'Text', textarea:'Textarea', email:'Email', phone:'Phone',
     51            name:'Name', text:'Text', textarea:'Textarea', email:'Email', phone:'Phone',
    5252            number:'Number', url:'URL', password:'Password',
    5353            dropdown:'Dropdown', radio:'Radio Buttons', checkbox:'Checkbox', multiselect:'Multi Select',
  • divine-smart-forms/trunk/admin/views/entries-list.php

    r3514051 r3610560  
    5656
    5757                $divismfo_name = '-';
     58                $divismfo_name_found = false;
    5859                foreach ($divismfo_fields as $divismfo_field) {
    59                     if (in_array($divismfo_field['type'], ['text'], true) || stripos($divismfo_field['label'], 'name') !== false) {
     60                    if ($divismfo_field['type'] === 'name') {
    6061                        $divismfo_field_key = !empty($divismfo_field['custom_name']) ? $divismfo_field['custom_name'] : $divismfo_field['id'];
    6162                        if (!empty($divismfo_entry_data[$divismfo_field_key])) {
    6263                            $divismfo_name = $divismfo_entry_data[$divismfo_field_key];
     64                            $divismfo_name_found = true;
    6365                            break;
     66                        }
     67                    }
     68                }
     69
     70                if (!$divismfo_name_found) {
     71                    foreach ($divismfo_fields as $divismfo_field) {
     72                        if (in_array($divismfo_field['type'], ['text'], true) || stripos($divismfo_field['label'], 'name') !== false) {
     73                            $divismfo_field_key = !empty($divismfo_field['custom_name']) ? $divismfo_field['custom_name'] : $divismfo_field['id'];
     74                            if (!empty($divismfo_entry_data[$divismfo_field_key])) {
     75                                $divismfo_name = $divismfo_entry_data[$divismfo_field_key];
     76                                break;
     77                            }
    6478                        }
    6579                    }
  • divine-smart-forms/trunk/admin/views/form-builder.php

    r3514051 r3610560  
    5454            <div class="divine-field-group">
    5555                <div class="divine-field-group-title">Basic</div>
     56                <button class="divine-add-field" data-type="name">Name</button>
    5657                <button class="divine-add-field" data-type="text">Text</button>
    5758                <button class="divine-add-field" data-type="textarea">Textarea</button>
  • divine-smart-forms/trunk/divine-smart-forms.php

    r3531303 r3610560  
    44 * Plugin URI:  https://wordpress.org/plugins/divine-smart-forms/
    55 * Description: Create responsive contact forms, lead forms, and custom forms using a simple drag & drop builder.
    6  * Version:     1.2.2
     6 * Version:     1.2.3
    77 * Author:      Aditya Singh
    8  * Author URI:  https://divinesmartforms.wuaze.com/
     8 * Author URI:  https://www.linkedin.com/in/devadityadivine
    99 * License:     GPL v2 or later
    1010 * Text Domain: divine-smart-forms
    … …  
    1414if (!defined('ABSPATH')) exit;
    1515
    16 define('DIVISMFO_VERSION', '1.2.2');
     16define('DIVISMFO_VERSION', '1.2.3');
    1717define('DIVISMFO_PATH',    plugin_dir_path(__FILE__));
    1818define('DIVISMFO_URL',     plugin_dir_url(__FILE__));
  • divine-smart-forms/trunk/includes/core/class-divine-shortcode.php

    r3531303 r3610560  
    1010        wp_enqueue_style('divismfo-form-css', DIVISMFO_URL . 'public/assets/css/form-styles.css', [], DIVISMFO_VERSION);
    1111        wp_enqueue_script('divismfo-form-js', DIVISMFO_URL . 'public/assets/js/form-script.js', ['jquery'], DIVISMFO_VERSION, true);
     12        $form = Divismfo_Form_Manager::divismfo_get_form($form_id);
     13        if (!$form || $form->status !== 'active') return '<p>' . esc_html__('Form not found or inactive.', 'divine-smart-forms') . '</p>';
     14
     15        $has_phone = false;
     16        if (!empty($form->fields) && is_array($form->fields)) {
     17            foreach ($form->fields as $field) {
     18                if (($field['type'] ?? '') === 'phone') {
     19                    $has_phone = true;
     20                    break;
     21                }
     22            }
     23        }
     24
     25        if ($has_phone) {
     26            wp_enqueue_style('divismfo-intl-tel-input-css', DIVISMFO_URL . 'public/assets/vendor/intl-tel-input/css/intlTelInput.min.css', [], DIVISMFO_VERSION);
     27            wp_enqueue_script('divismfo-intl-tel-input-js', DIVISMFO_URL . 'public/assets/vendor/intl-tel-input/js/intlTelInput.min.js', [], DIVISMFO_VERSION, true);
     28        }
     29
    1230        wp_localize_script('divismfo-form-js', 'divismfoForm', [
    1331            'ajax_url' => admin_url('admin-ajax.php'),
    1432            'nonce'    => wp_create_nonce('divismfo_form_nonce'),
     33            'intl_tel_utils_url' => DIVISMFO_URL . 'public/assets/vendor/intl-tel-input/js/utils.js',
    1534            'i18n'     => [
    1635                'please_wait'       => __('Please wait...', 'divine-smart-forms'),
    … …  
    2241        ]);
    2342
    24         $form = Divismfo_Form_Manager::divismfo_get_form($form_id);
    25         if (!$form || $form->status !== 'active') return '<p>' . esc_html__('Form not found or inactive.', 'divine-smart-forms') . '</p>';
    26 
    2743        ob_start();
    2844        include DIVISMFO_PATH . 'templates/form/wrapper.php';
  • divine-smart-forms/trunk/public/assets/css/form-styles.css

    r3531303 r3610560  
    7878.divine-form-message.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
    7979.divine-error { color: #dc2626; font-size: 13px; margin-top: 4px; display: block; }
     80
     81/* intl-tel-input overrides */
     82.divine-form .iti { width: 100%; }
     83.divine-form .iti__country-list { z-index: 999; }
  • divine-smart-forms/trunk/public/assets/js/form-script.js

    r3531303 r3610560  
    11jQuery(document).ready(function($) {
    22    var i18n = divismfoForm.i18n || {};
     3
     4    if (typeof window.intlTelInput !== 'undefined') {
     5        document.querySelectorAll('.divine-form input[type="tel"]').forEach(function(input) {
     6            var iti = window.intlTelInput(input, {
     7                initialCountry: "auto",
     8                separateDialCode: true,
     9                geoIpLookup: function(callback) {
     10                    callback("in");
     11                },
     12                utilsScript: divismfoForm.intl_tel_utils_url || ""
     13            });
     14            input.divismfoIti = iti;
     15        });
     16    }
    317
    418    $(document).on('input change', '.divine-range-input', function() {
    … …  
    4963            var name = el.attr('name');
    5064            if (!name || el.attr('type') === 'file') return;
     65
     66            if (el.attr('type') === 'tel' && this.divismfoIti) {
     67                formData[name] = this.divismfoIti.getNumber();
     68                return;
     69            }
    5170
    5271            if (name.slice(-2) === '[]') {
  • divine-smart-forms/trunk/readme.txt

    r3531303 r3610560  
    11=== Divine Smart Forms - Drag & Drop Contact Form Builder ===
    22Contributors: divineboyaditya
    3 Tags: login forms, contact form, automation forms, contact form , form
     3Tags: contact form, form builder, drag and drop forms, custom forms, WordPress forms
    44Requires at least: 6.0
    5 Tested up to: 6.9
     5Tested up to: 7.0
    66Requires PHP: 7.4
    7 Stable tag: 1.2.2
     7Stable tag: 1.2.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    100100= Optional Plugin Tracking =
    101101
    102 This plugin can optionally send limited analytics data to the developer through Supabase only after a site administrator explicitly allows tracking from the plugin settings or tracking prompt.
     102This plugin can optionally send limited analytics data to the Team only after a site administrator explicitly allow from the plugin settings or tracking prompt.
    103103
    104104Data sent when tracking is allowed:
    … …  
    109109* PHP version
    110110* Plugin version
    111 * Site domain name
    112 
    113 When data is sent:
    114 
    115 * Only after an administrator clicks `Allow Tracking`
    116 * When tracking is first enabled
    117 * During plugin activation and deactivation after consent
    118 * Periodically while the plugin remains active, for lightweight install status updates
    119 
    120 Service provider:
    121 
    122 * Supabase: [Terms of Service](https://supabase.com/terms), [Privacy Policy](https://supabase.com/privacy)
     111* Site Url
    123112
    124113== Installation ==
    … …  
    160149Yes. You can enable debug logging from the plugin settings when troubleshooting.
    161150
    162 = Does this plugin track usage? =
    163 
    164 Only if an administrator explicitly allows tracking. If tracking is skipped, the plugin will not send analytics requests to external services.
    165 
    166151== Changelog ==
    167152
     153= 1.2.3 =
     154
     155* Added Name field type for dedicated name collection in forms.
     156* Added international phone input with country flag selector and automatic country code prefixing.
     157* Updated entries list to prioritize the Name field type for the Name column.
     158* Tested up to WordPress 7.0
     159
    168160= 1.2.2 =
    169 
    170 * Added an opt-in Supabase tracking system with admin consent controls.
    171 * Added optional tracking for activation status, plugin version, WordPress version, PHP version, and domain name after consent.
    172161* Added privacy policy helper text and external service disclosure for optional tracking.
    173162* Fixed uninstall cleanup so plugin data is only removed when the delete-on-uninstall setting is enabled.
    … …  
    199188== Upgrade Notice ==
    200189
     190= 1.2.3 =
     191
     192* Adds Name field type and international phone input with country flags.
     193
    201194= 1.2.2 =
    202195
    203 * Adds optional consent-based tracking, fixes uninstall data retention behavior, and resolves file upload handling issues.
     196* Fixes uninstall data retention behavior, and resolves file upload handling issues.
    204197
    205198= 1.2.1 =
  • divine-smart-forms/trunk/templates/form/wrapper.php

    r3531303 r3610560  
    3939    <?php switch ($divismfo_type):
    4040        case 'text':
     41        case 'name':
    4142        case 'email':
    4243        case 'phone':
    … …  
    4748        case 'time': ?>
    4849        <input
    49             type="<?php echo esc_attr($divismfo_type === 'phone' ? 'tel' : $divismfo_type); ?>"
     50            type="<?php echo esc_attr($divismfo_type === 'phone' ? 'tel' : ($divismfo_type === 'name' ? 'text' : $divismfo_type)); ?>"
    5051            id="<?php echo esc_attr($divismfo_field_id); ?>"
    5152            name="<?php echo esc_attr($divismfo_name); ?>"
Note: See TracChangeset for help on using the changeset viewer.