Plugin Directory

Changeset 3534694

Timestamp:
05/17/2026 05:26:27 PM (2 months ago)
Author:
nishatbd31
Message:

Update to version 5.4.0 from GitHub

Location:
autocomplete-google-address
Files:
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • autocomplete-google-address/tags/5.4.0/admin/css/admin.css

    r3495638 r3534694  
    346346    position: relative;
    347347    display: inline-block;
     348    flex-shrink: 0;
    348349    width: 44px;
     350    min-width: 44px;
    349351    height: 24px;
     352    vertical-align: middle;
     353    overflow: visible;
     354    box-sizing: content-box;
    350355}
    351356
    352357.aga-switch input {
     358    position: absolute;
    353359    opacity: 0;
    354360    width: 0;
    355361    height: 0;
    356 }
    357 
    358 .aga-slider {
     362    margin: 0;
     363    padding: 0;
     364    pointer-events: none;
     365}
     366
     367.aga-switch .aga-slider {
    359368    position: absolute;
    360369    cursor: pointer;
     
    363372    right: 0;
    364373    bottom: 0;
     374    width: 44px;
     375    height: 24px;
    365376    background-color: var(--aga-text-muted);
    366377    transition: background-color 0.3s ease;
    367378    border-radius: var(--aga-radius-full);
    368 }
    369 
    370 .aga-slider:before {
     379    box-sizing: border-box;
     380}
     381
     382.aga-switch .aga-slider:before {
    371383    position: absolute;
    372384    content: "";
     
    374386    width: 18px;
    375387    left: 3px;
    376     bottom: 3px;
    377     background-color: var(--aga-bg-card);
     388    top: 3px;
     389    bottom: auto;
     390    background-color: #fff;
    378391    transition: transform 0.3s ease;
    379392    border-radius: 50%;
    380393    box-shadow: var(--aga-shadow-sm);
    381 }
    382 
    383 input:checked + .aga-slider {
     394    box-sizing: border-box;
     395}
     396
     397.aga-switch input:checked + .aga-slider {
    384398    background-color: var(--aga-primary);
    385399}
    386400
    387 input:checked + .aga-slider:before {
     401.aga-switch input:checked + .aga-slider:before {
    388402    transform: translateX(20px);
    389403}
    390404
    391 input:focus + .aga-slider {
     405.aga-switch input:focus-visible + .aga-slider {
    392406    box-shadow: 0 0 0 3px var(--aga-primary-light);
     407}
     408
     409.aga-switch input:disabled + .aga-slider {
     410    cursor: not-allowed;
     411    opacity: 0.55;
    393412}
    394413
     
    27012720    }
    27022721}
     2722
     2723/* ==========================================================================
     2724   Mapping Mode — Pro lock preview
     2725   ========================================================================== */
     2726
     2727.aga-pro-inline-callout {
     2728    display: flex;
     2729    align-items: center;
     2730    justify-content: space-between;
     2731    gap: var(--aga-space-md);
     2732    padding: var(--aga-space-md);
     2733    margin-bottom: var(--aga-space-md);
     2734    background: linear-gradient(135deg, rgba(var(--aga-primary-rgb), 0.08), rgba(var(--aga-primary-rgb), 0.02));
     2735    border: 1px solid rgba(var(--aga-primary-rgb), 0.25);
     2736    border-radius: var(--aga-radius-md);
     2737}
     2738
     2739.aga-pro-inline-callout__text {
     2740    display: flex;
     2741    flex-direction: column;
     2742    gap: 2px;
     2743    min-width: 0;
     2744}
     2745
     2746.aga-pro-inline-callout__text strong {
     2747    color: var(--aga-text);
     2748    font-size: var(--aga-font-size-sm);
     2749}
     2750
     2751.aga-pro-inline-callout__text span {
     2752    color: var(--aga-text-muted);
     2753    font-size: var(--aga-font-size-xs);
     2754}
     2755
     2756.aga-pro-inline-callout .button-primary {
     2757    flex-shrink: 0;
     2758}
     2759
     2760/* Locked panel: disabled inputs styled as preview */
     2761.aga-mode-panel--locked input[type="text"],
     2762.aga-mode-panel--locked select,
     2763.aga-mode-panel--locked .aga-vst-pick-btn {
     2764    opacity: 0.6;
     2765    cursor: not-allowed;
     2766    background-color: var(--aga-bg-subtle, #f6f7f7);
     2767}
     2768
     2769.aga-mode-panel--locked .aga-vst-pick-btn:hover {
     2770    background: var(--aga-bg-subtle, #f6f7f7);
     2771    color: inherit;
     2772    border-color: var(--aga-border);
     2773    transform: none;
     2774    box-shadow: none;
     2775}
     2776
     2777.aga-mode-panel--locked label {
     2778    color: var(--aga-text-muted);
     2779}
     2780
     2781/* Inline-row variant (used inside Mapping Mode panel — no full-width border) */
     2782.aga-toggle-row--inline {
     2783    border-bottom: none;
     2784    padding: var(--aga-space-sm) 0;
     2785    gap: var(--aga-space-md);
     2786}
     2787
     2788@media screen and (max-width: 600px) {
     2789    .aga-pro-inline-callout {
     2790        flex-direction: column;
     2791        align-items: flex-start;
     2792    }
     2793}
  • autocomplete-google-address/tags/5.4.0/admin/js/admin.js

    r3493591 r3534694  
    1212        }
    1313
    14         // ---- Mode Toggling Logic ----
    15         var modeRadios = $('input[name="Nish_aga_mode"]');
    16         var modePanels = $('.aga-mode-panel');
    17 
     14        // ---- Mode Toggling Logic (single mode now — kept as no-op for legacy callers) ----
    1815        function toggleModePanels() {
    19             var selectedMode = modeRadios.filter(':checked').val();
    20             modePanels.removeClass('active');
    21             $('#aga-panel-' + selectedMode).addClass('active');
    22         }
    23 
     16            $('.aga-mode-panel').addClass('active');
     17        }
    2418        toggleModePanels();
    25         modeRadios.on('change', toggleModePanels);
    2619
    2720        // ---- Settings Page Tabs ----
     
    5447            }
    5548
    56             // Switch to smart mapping mode and toggle panel
    57             $('#mode_smart_mapping').prop('checked', true);
    58             toggleModePanels();
     49            // Smart mapping is now the only mode — nothing to switch.
    5950
    6051            // Fill smart mapping fields
  • autocomplete-google-address/tags/5.4.0/admin/views/html-admin-page-form-edit.php

    r3495096 r3534694  
    1515
    1616// Get saved values
    17 $mode              = get_post_meta( $post->ID, 'Nish_aga_mode', true ) ?: 'single_line';
     17$mode              = 'smart_mapping';
    1818$activate_globally = metadata_exists( 'post', $post->ID, 'Nish_aga_activate_globally' ) ? get_post_meta( $post->ID, 'Nish_aga_activate_globally', true ) : '1';
    1919$main_selector     = get_post_meta( $post->ID, 'Nish_aga_main_selector', true );
     
    2727$map_picker        = get_post_meta( $post->ID, 'Nish_aga_map_picker', true );
    2828
    29 // Single Line
    30 $lat_selector      = get_post_meta( $post->ID, 'Nish_aga_lat_selector', true );
    31 $lng_selector      = get_post_meta( $post->ID, 'Nish_aga_lng_selector', true );
    32 $place_id_selector = get_post_meta( $post->ID, 'Nish_aga_place_id_selector', true );
    33 
    3429// Smart Mapping
    3530$street_selector         = get_post_meta( $post->ID, 'Nish_aga_street_selector', true );
     31$street_full_address     = get_post_meta( $post->ID, 'Nish_aga_street_full_address', true );
    3632$city_selector           = get_post_meta( $post->ID, 'Nish_aga_city_selector', true );
    3733$state_selector          = get_post_meta( $post->ID, 'Nish_aga_state_selector', true );
     
    218214                                </div>
    219215                                <div class="aga-card-body">
    220                                         <div class="aga-field-group">
    221                                                 <div class="aga-mode-selector">
    222                                                         <input type="radio" id="mode_single_line" name="Nish_aga_mode" value="single_line" <?php checked( $mode, 'single_line' ); ?>>
    223                                                         <label for="mode_single_line"><?php esc_html_e( 'Single Line', 'autocomplete-google-address' ); ?></label>
    224                                                         <input type="radio" id="mode_smart_mapping" name="Nish_aga_mode" value="smart_mapping" <?php checked( $mode, 'smart_mapping' ); ?>>
    225                                                         <label for="mode_smart_mapping"><?php esc_html_e( 'Smart Mapping', 'autocomplete-google-address' ); ?><?php if ( ! $is_paying ) echo ' <small>(Pro)</small>'; ?></label>
    226                                                 </div>
    227                                         </div>
    228                                         <!-- Single Line Panel -->
    229                                         <div id="aga-panel-single_line" class="aga-mode-panel <?php echo 'single_line' === $mode ? 'active' : ''; ?>">
    230                                                 <p><?php esc_html_e( 'The full address goes into the trigger field. Optionally capture extra data.', 'autocomplete-google-address' ); ?></p>
    231                                                 <div class="aga-field-group">
    232                                                         <label for="aga_lat_selector"><?php esc_html_e( 'Latitude Selector', 'autocomplete-google-address' ); ?></label>
    233                                                         <div class="aga-vst-input-row">
    234                                                                 <input type="text" id="aga_lat_selector" name="Nish_aga_lat_selector" value="<?php echo esc_attr( $lat_selector ); ?>" class="widefat" placeholder="<?php esc_attr_e( 'Optional - e.g., #lat_field', 'autocomplete-google-address' ); ?>" />
    235                                                                 <button type="button" class="aga-vst-pick-btn" title="<?php esc_attr_e( 'Click to visually select a field from your page', 'autocomplete-google-address' ); ?>"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="22" y1="12" x2="18" y2="12"/><line x1="6" y1="12" x2="2" y2="12"/><line x1="12" y1="6" x2="12" y2="2"/><line x1="12" y1="22" x2="12" y2="18"/></svg><span class="aga-vst-pick-label"><?php esc_html_e( 'Pick', 'autocomplete-google-address' ); ?></span></button>
    236                                                         </div>
    237                                                 </div>
    238                                                 <div class="aga-field-group">
    239                                                         <label for="aga_lng_selector"><?php esc_html_e( 'Longitude Selector', 'autocomplete-google-address' ); ?></label>
    240                                                         <div class="aga-vst-input-row">
    241                                                                 <input type="text" id="aga_lng_selector" name="Nish_aga_lng_selector" value="<?php echo esc_attr( $lng_selector ); ?>" class="widefat" placeholder="<?php esc_attr_e( 'Optional - e.g., #lng_field', 'autocomplete-google-address' ); ?>" />
    242                                                                 <button type="button" class="aga-vst-pick-btn" title="<?php esc_attr_e( 'Click to visually select a field from your page', 'autocomplete-google-address' ); ?>"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="22" y1="12" x2="18" y2="12"/><line x1="6" y1="12" x2="2" y2="12"/><line x1="12" y1="6" x2="12" y2="2"/><line x1="12" y1="22" x2="12" y2="18"/></svg><span class="aga-vst-pick-label"><?php esc_html_e( 'Pick', 'autocomplete-google-address' ); ?></span></button>
    243                                                         </div>
    244                                                 </div>
    245                                                 <div class="aga-field-group">
    246                                                         <label for="aga_place_id_selector"><?php esc_html_e( 'Place ID Selector', 'autocomplete-google-address' ); ?></label>
    247                                                         <div class="aga-vst-input-row">
    248                                                                 <input type="text" id="aga_place_id_selector" name="Nish_aga_place_id_selector" value="<?php echo esc_attr( $place_id_selector ); ?>" class="widefat" placeholder="<?php esc_attr_e( 'Optional - e.g., #place_id_field', 'autocomplete-google-address' ); ?>" />
    249                                                                 <button type="button" class="aga-vst-pick-btn" title="<?php esc_attr_e( 'Click to visually select a field from your page', 'autocomplete-google-address' ); ?>"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="22" y1="12" x2="18" y2="12"/><line x1="6" y1="12" x2="2" y2="12"/><line x1="12" y1="6" x2="12" y2="2"/><line x1="12" y1="22" x2="12" y2="18"/></svg><span class="aga-vst-pick-label"><?php esc_html_e( 'Pick', 'autocomplete-google-address' ); ?></span></button>
    250                                                         </div>
    251                                                 </div>
    252                                         </div>
     216                                        <input type="hidden" name="Nish_aga_mode" value="smart_mapping">
     217                                        <?php $disabled_attr = $is_paying ? '' : 'disabled'; ?>
    253218                                        <!-- Smart Mapping Panel -->
    254                                         <div id="aga-panel-smart_mapping" class="aga-mode-panel <?php echo 'smart_mapping' === $mode ? 'active' : ''; ?>">
     219                                        <div id="aga-panel-smart_mapping" class="aga-mode-panel active<?php echo $is_paying ? '' : ' aga-mode-panel--locked'; ?>">
    255220                                                <?php if ( ! $is_paying ) : ?>
    256                                                 <div class="aga-pro-banner">
    257                                                         <h3><?php esc_html_e( 'Unlock Smart Mapping', 'autocomplete-google-address' ); ?></h3>
    258                                                         <p><?php esc_html_e( 'Split addresses into Street, City, State, Zip, and Country fields automatically.', 'autocomplete-google-address' ); ?></p>
    259                                                         <a href="<?php echo esc_url( $checkout_url ); ?>" target="_blank" class="button"><?php esc_html_e( 'Upgrade to Pro', 'autocomplete-google-address' ); ?></a>
     221                                                <div class="aga-pro-inline-callout">
     222                                                        <div class="aga-pro-inline-callout__text">
     223                                                                <strong><?php esc_html_e( 'Mapping Mode is a Pro feature.', 'autocomplete-google-address' ); ?></strong>
     224                                                                <span><?php esc_html_e( 'Preview the fields below — upgrade to enable them.', 'autocomplete-google-address' ); ?></span>
     225                                                        </div>
     226                                                        <a href="<?php echo esc_url( $checkout_url ); ?>" target="_blank" class="button button-primary"><?php esc_html_e( 'Upgrade to Pro', 'autocomplete-google-address' ); ?></a>
    260227                                                </div>
    261228                                                <?php else : ?>
    262229                                                <p><?php esc_html_e( 'Map each address component to your form fields.', 'autocomplete-google-address' ); ?></p>
     230                                                <?php endif; ?>
     231
     232                                                <div class="aga-toggle-row aga-toggle-row--inline aga-mb-sm">
     233                                                        <div class="aga-toggle-row-info">
     234                                                                <strong><?php esc_html_e( 'Full Address in Street Field', 'autocomplete-google-address' ); ?></strong>
     235                                                                <span class="aga-toggle-desc"><?php esc_html_e( 'When enabled, the entire formatted address is written into the Street selector instead of only the street component.', 'autocomplete-google-address' ); ?></span>
     236                                                        </div>
     237                                                        <label class="aga-switch">
     238                                                                <input type="checkbox" id="aga_street_full_address" name="Nish_aga_street_full_address" value="1" <?php checked( $street_full_address, '1' ); ?> <?php echo $disabled_attr; ?>>
     239                                                                <span class="aga-slider"></span>
     240                                                        </label>
     241                                                </div>
     242
    263243                                                <div class="aga-mapping-grid">
    264244                                                        <?php
     
    277257                                                                <label for="<?php echo esc_attr( $field['id'] ); ?>"><?php echo esc_html( $field['label'] ); ?></label>
    278258                                                                <div class="aga-vst-input-row">
    279                                                                         <input type="text" id="<?php echo esc_attr( $field['id'] ); ?>" name="<?php echo esc_attr( $field['name'] ); ?>" value="<?php echo esc_attr( $field['value'] ); ?>" class="widefat" placeholder="#id, .class, [name='field']" />
    280                                                                         <button type="button" class="aga-vst-pick-btn" title="<?php esc_attr_e( 'Click to visually select a field from your page', 'autocomplete-google-address' ); ?>"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="22" y1="12" x2="18" y2="12"/><line x1="6" y1="12" x2="2" y2="12"/><line x1="12" y1="6" x2="12" y2="2"/><line x1="12" y1="22" x2="12" y2="18"/></svg><span class="aga-vst-pick-label"><?php esc_html_e( 'Pick', 'autocomplete-google-address' ); ?></span></button>
     259                                                                        <input type="text" id="<?php echo esc_attr( $field['id'] ); ?>" name="<?php echo esc_attr( $field['name'] ); ?>" value="<?php echo esc_attr( $field['value'] ); ?>" class="widefat" placeholder="#id, .class, [name='field']" <?php echo $disabled_attr; ?> />
     260                                                                        <button type="button" class="aga-vst-pick-btn" title="<?php esc_attr_e( 'Click to visually select a field from your page', 'autocomplete-google-address' ); ?>" <?php echo $disabled_attr; ?>><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="22" y1="12" x2="18" y2="12"/><line x1="6" y1="12" x2="2" y2="12"/><line x1="12" y1="6" x2="12" y2="2"/><line x1="12" y1="22" x2="12" y2="18"/></svg><span class="aga-vst-pick-label"><?php esc_html_e( 'Pick', 'autocomplete-google-address' ); ?></span></button>
    281261                                                                </div>
    282262                                                        </div>
     
    288268                                                        <div class="aga-field-group">
    289269                                                                <label for="aga_state_format"><?php esc_html_e( 'State Format', 'autocomplete-google-address' ); ?></label>
    290                                                                 <select id="aga_state_format" name="Nish_aga_state_format">
     270                                                                <select id="aga_state_format" name="Nish_aga_state_format" <?php echo $disabled_attr; ?>>
    291271                                                                        <option value="long" <?php selected( $state_format, 'long' ); ?>><?php esc_html_e( 'Long Name (e.g., California)', 'autocomplete-google-address' ); ?></option>
    292272                                                                        <option value="short" <?php selected( $state_format, 'short' ); ?>><?php esc_html_e( 'Short Name (e.g., CA)', 'autocomplete-google-address' ); ?></option>
     
    295275                                                        <div class="aga-field-group">
    296276                                                                <label for="aga_country_format"><?php esc_html_e( 'Country Format', 'autocomplete-google-address' ); ?></label>
    297                                                                 <select id="aga_country_format" name="Nish_aga_country_format">
     277                                                                <select id="aga_country_format" name="Nish_aga_country_format" <?php echo $disabled_attr; ?>>
    298278                                                                        <option value="long" <?php selected( $country_format, 'long' ); ?>><?php esc_html_e( 'Long Name (e.g., United States)', 'autocomplete-google-address' ); ?></option>
    299279                                                                        <option value="short" <?php selected( $country_format, 'short' ); ?>><?php esc_html_e( 'Short Name (e.g., US)', 'autocomplete-google-address' ); ?></option>
     
    301281                                                        </div>
    302282                                                </div>
    303                                                 <?php endif; ?>
    304283                                        </div>
    305284                                </div>
  • autocomplete-google-address/tags/5.4.0/autocomplete-google-address.php

    r3529084 r3534694  
    55 * Plugin URI:        https://wordpress.org/plugins/autocomplete-google-address/
    66 * Description:       Add Google Places address autocomplete to any existing form in WordPress using a selector-based mapping builder.
    7  * Version:           5.3.5
     7 * Version:           5.4.0
    88 * Author:            Md Nishath Khandakar
    99 * Author URI:        https://profiles.wordpress.org/nishatbd31/
     
    5858 * Currently plugin version.
    5959 */
    60 define( 'AGA_VERSION', '5.3.5' );
     60define( 'AGA_VERSION', '5.4.0' );
    6161/**
    6262 * Plugin directory path.
  • autocomplete-google-address/tags/5.4.0/includes/class-aga-autocomplete.php

    r3493591 r3534694  
    2626
    2727        $mode = get_post_meta( $form_id, 'Nish_aga_mode', true );
     28        if ( 'smart_mapping' !== $mode ) {
     29            $mode = 'smart_mapping';
     30        }
    2831        $main_selector = get_post_meta( $form_id, 'Nish_aga_main_selector', true );
    2932
     
    3841        $is_paying = function_exists( 'google_autocomplete' ) && google_autocomplete()->is_paying();
    3942
    40         if ( 'single_line' === $mode ) {
    41             $config['selectors']['lat'] = get_post_meta( $form_id, 'Nish_aga_lat_selector', true );
    42             $config['selectors']['lng'] = get_post_meta( $form_id, 'Nish_aga_lng_selector', true );
    43             $config['selectors']['place_id'] = get_post_meta( $form_id, 'Nish_aga_place_id_selector', true );
    44         } elseif ( 'smart_mapping' === $mode && $is_paying ) {
     43        if ( $is_paying ) {
    4544            $config['selectors']['street'] = get_post_meta( $form_id, 'Nish_aga_street_selector', true );
    4645            $config['selectors']['city'] = get_post_meta( $form_id, 'Nish_aga_city_selector', true );
     
    5150            $config['selectors']['lng'] = get_post_meta( $form_id, 'Nish_aga_map_lng_selector', true );
    5251            $config['selectors']['place_id'] = get_post_meta( $form_id, 'Nish_aga_smart_place_id_selector', true );
    53            
     52
    5453            $config['formats'] = array(
    5554                'state'   => get_post_meta( $form_id, 'Nish_aga_state_format', true ) ?: 'long',
    5655                'country' => get_post_meta( $form_id, 'Nish_aga_country_format', true ) ?: 'long',
    5756            );
     57
     58            $config['street_full_address'] = ( '1' === get_post_meta( $form_id, 'Nish_aga_street_full_address', true ) );
    5859        }
    5960
  • autocomplete-google-address/tags/5.4.0/includes/class-aga-elementor.php

    r3488484 r3534694  
    160160                    var itemClasses = _.escape(item.css_classes) || '';
    161161                    var required = item.required ? 'required' : '';
    162                     var mode = item.aga_mode || 'single_line';
     162                    var mode = item.aga_mode || 'smart_mapping';
    163163
    164164                    var html = '<input size=\"1\" type=\"text\" class=\"elementor-field elementor-field-textual elementor-size-' + inputSize + ' ' + itemClasses + '\" name=\"form_field_' + i + '\" id=\"form_field_' + i + '\" ' + required + ' placeholder=\"' + placeholder + '\" autocomplete=\"off\">';
  • autocomplete-google-address/tags/5.4.0/includes/class-aga-forms.php

    r3493591 r3534694  
    199199        );
    200200
     201        update_post_meta(
     202            $post_id,
     203            'Nish_aga_street_full_address',
     204            isset( $_POST['Nish_aga_street_full_address'] ) ? '1' : ''
     205        );
     206
    201207        if ( isset( $_POST['Nish_aga_load_on_pages'] ) && is_array( $_POST['Nish_aga_load_on_pages'] ) ) {
    202208            update_post_meta(
     
    289295
    290296        if ( 'aga_mode' === $column ) {
    291             $mode = get_post_meta( $post_id, 'Nish_aga_mode', true );
    292             echo esc_html(
    293                 $mode === 'single_line'
    294                     ? 'Single Line'
    295                     : ( $mode === 'smart_mapping' ? 'Smart Mapping' : 'None' )
    296             );
     297            $is_paying = function_exists( 'google_autocomplete' ) && google_autocomplete()->is_paying();
     298            echo esc_html( $is_paying ? 'Smart Mapping' : 'Smart Mapping (Pro)' );
    297299        }
    298300
  • autocomplete-google-address/tags/5.4.0/includes/class-aga-shortcode.php

    r3493591 r3534694  
    5252                'placeholder' => 'Start typing an address...',
    5353                'label'       => '',
    54                 'mode'        => 'single_line',
     54                'mode'        => 'smart_mapping',
    5555                'country'     => '',
    5656                'show_map'    => 'false',
     
    9898
    9999        // Build the HTML.
    100         $mode       = ! empty( $config['mode'] ) ? $config['mode'] : 'single_line';
     100        $mode       = ! empty( $config['mode'] ) ? $config['mode'] : 'smart_mapping';
    101101        $show_map   = ! empty( $config['map_picker'] );
    102102        $wrapper_class = 'aga-shortcode-wrapper';
     
    127127     */
    128128    private function render_standalone( $instance_id, $atts ) {
    129         $mode     = in_array( $atts['mode'], array( 'single_line', 'smart_mapping' ), true ) ? $atts['mode'] : 'single_line';
     129        $is_paying = function_exists( 'google_autocomplete' ) && google_autocomplete()->is_paying();
     130        // Smart Mapping is Pro-only — fall back to plain single-line for free users.
     131        $mode      = $is_paying ? 'smart_mapping' : 'single_line';
    130132        $show_map = 'true' === strtolower( $atts['show_map'] );
    131133
  • autocomplete-google-address/tags/5.4.0/includes/widgets/class-aga-elementor-form-field.php

    r3493591 r3534694  
    5353                                'name'      => 'aga_mode',
    5454                                'label'     => esc_html__( 'Mode', 'autocomplete-google-address' ),
    55                                 'type'      => \Elementor\Controls_Manager::SELECT,
    56                                 'default'   => 'single_line',
    57                                 'options'   => array(
    58                                         'single_line'   => esc_html__( 'Single Line', 'autocomplete-google-address' ),
    59                                         'smart_mapping' => $is_paying
    60                                                 ? esc_html__( 'Smart Mapping', 'autocomplete-google-address' )
    61                                                 : esc_html__( 'Smart Mapping (Pro)', 'autocomplete-google-address' ),
    62                                 ),
     55                                'type'      => \Elementor\Controls_Manager::HIDDEN,
     56                                'default'   => 'smart_mapping',
    6357                                'condition' => $condition,
    6458                        ) ),
     
    161155                $is_paying = function_exists( 'google_autocomplete' ) && google_autocomplete()->is_paying();
    162156
    163                 $mode = ! empty( $item['aga_mode'] ) ? $item['aga_mode'] : 'single_line';
    164                 if ( 'smart_mapping' === $mode && ! $is_paying ) {
    165                         $mode = 'single_line';
    166                 }
     157                // Smart Mapping is Pro-only — fall back to plain single-line for free users.
     158                $mode = $is_paying ? 'smart_mapping' : 'single_line';
    167159
    168160                $input_size = ! empty( $item['input_size'] ) ? $item['input_size'] : 'sm';
  • autocomplete-google-address/tags/5.4.0/includes/widgets/class-aga-elementor-widget.php

    r3493591 r3534694  
    9292        );
    9393
    94         $mode_options = array(
    95             'single_line' => esc_html__( 'Single Line', 'autocomplete-google-address' ),
    96         );
    97         if ( $is_paying ) {
    98             $mode_options['smart_mapping'] = esc_html__( 'Smart Mapping', 'autocomplete-google-address' );
    99         } else {
    100             $mode_options['smart_mapping'] = esc_html__( 'Smart Mapping (Pro)', 'autocomplete-google-address' );
    101         }
    102 
    10394        $this->add_control(
    10495            'mode',
    10596            array(
    10697                'label'   => esc_html__( 'Mode', 'autocomplete-google-address' ),
    107                 'type'    => \Elementor\Controls_Manager::SELECT,
    108                 'default' => 'single_line',
    109                 'options' => $mode_options,
     98                'type'    => \Elementor\Controls_Manager::HIDDEN,
     99                'default' => 'smart_mapping',
    110100            )
    111101        );
     
    375365        $instance_id = 'aga-el-' . $widget_id;
    376366
    377         // Determine effective mode — fall back to single_line for free users.
    378         $mode = $settings['mode'];
    379         if ( 'smart_mapping' === $mode && ! $is_paying ) {
    380             $mode = 'single_line';
    381         }
     367        // Smart Mapping is Pro-only — fall back to plain single-line for free users.
     368        $mode = $is_paying ? 'smart_mapping' : 'single_line';
    382369
    383370        $show_map              = $is_paying && 'yes' === ( $settings['show_map'] ?? '' );
  • autocomplete-google-address/tags/5.4.0/public/js/frontend.js

    r3529084 r3534694  
    10211021                    if (config.mode === 'smart_mapping' && result.address_components) {
    10221022                        var components = aga.parseReverseComponents(result.address_components);
    1023                         aga.applyParsedComponents(components, config, mainInput);
     1023                        aga.applyParsedComponents(components, config, mainInput, result.formatted_address || '');
    10241024                    }
    10251025
     
    10771077        },
    10781078
    1079         applyParsedComponents: function (components, config, mainInput) {
     1079        applyParsedComponents: function (components, config, mainInput, formattedAddress) {
    10801080            var countryCode = components.country_short || '';
    10811081            var countryName = components.country_long || '';
     
    11041104
    11051105            if (config.selectors.street) {
    1106                 aga.setFieldValue(config.selectors.street, (components.street_number + ' ' + components.route).trim(), undefined, mainInput);
     1106                var streetValue = (config.street_full_address && formattedAddress)
     1107                    ? formattedAddress
     1108                    : (components.street_number + ' ' + components.route).trim();
     1109                aga.setFieldValue(config.selectors.street, streetValue, undefined, mainInput);
    11071110            }
    11081111            if (config.selectors.city) {
     
    12881291
    12891292                if (config.selectors.street) {
    1290                     aga.setFieldValue(config.selectors.street, (components.street_number + ' ' + components.route).trim(), undefined, mainInput);
     1293                    var streetValue = (config.street_full_address && place.formattedAddress)
     1294                        ? place.formattedAddress
     1295                        : (components.street_number + ' ' + components.route).trim();
     1296                    aga.setFieldValue(config.selectors.street, streetValue, undefined, mainInput);
    12911297                }
    12921298
  • autocomplete-google-address/tags/5.4.0/readme.txt

    r3529084 r3534694  
    44Requires at least: 5.4
    55Tested up to: 6.9
    6 Stable tag: 5.3.5
     6Stable tag: 5.4.0
    77Requires PHP: 7.2
    88License: GPL-2.0-or-later
     
    291291== Changelog ==
    292292
     293= 5.4.0 =
     294* CHANGED: Mapping Mode is now a single unified Pro feature — the legacy "Single Line" option has been removed. Free users see a locked preview of all mapping fields with an upgrade prompt; Pro users get the full configurator.
     295* NEW: "Full Address in Street Field" toggle (Pro) — when enabled, the entire formatted address is written into the Street selector instead of only the street component. Useful when your form has a single visible address field but you still want all the structured data.
     296* IMPROVED: Mapping Mode card redesigned — disabled-input preview for free users so the available fields and toggle are visible at a glance.
     297* FIX: Toggle switches no longer overflow their track on the form-edit page; thumb stays inside the track in all admin themes.
     298
    293299= 5.3.5 =
    294300* NEW: Country blocklist support — when WooCommerce is configured to sell only to specific countries, selecting an unsupported country address now shows a clear "We do not ship to [Country]" error badge and blocks checkout submission.
  • autocomplete-google-address/trunk/admin/css/admin.css

    r3495638 r3534694  
    346346    position: relative;
    347347    display: inline-block;
     348    flex-shrink: 0;
    348349    width: 44px;
     350    min-width: 44px;
    349351    height: 24px;
     352    vertical-align: middle;
     353    overflow: visible;
     354    box-sizing: content-box;
    350355}
    351356
    352357.aga-switch input {
     358    position: absolute;
    353359    opacity: 0;
    354360    width: 0;
    355361    height: 0;
    356 }
    357 
    358 .aga-slider {
     362    margin: 0;
     363    padding: 0;
     364    pointer-events: none;
     365}
     366
     367.aga-switch .aga-slider {
    359368    position: absolute;
    360369    cursor: pointer;
     
    363372    right: 0;
    364373    bottom: 0;
     374    width: 44px;
     375    height: 24px;
    365376    background-color: var(--aga-text-muted);
    366377    transition: background-color 0.3s ease;
    367378    border-radius: var(--aga-radius-full);
    368 }
    369 
    370 .aga-slider:before {
     379    box-sizing: border-box;
     380}
     381
     382.aga-switch .aga-slider:before {
    371383    position: absolute;
    372384    content: "";
     
    374386    width: 18px;
    375387    left: 3px;
    376     bottom: 3px;
    377     background-color: var(--aga-bg-card);
     388    top: 3px;
     389    bottom: auto;
     390    background-color: #fff;
    378391    transition: transform 0.3s ease;
    379392    border-radius: 50%;
    380393    box-shadow: var(--aga-shadow-sm);
    381 }
    382 
    383 input:checked + .aga-slider {
     394    box-sizing: border-box;
     395}
     396
     397.aga-switch input:checked + .aga-slider {
    384398    background-color: var(--aga-primary);
    385399}
    386400
    387 input:checked + .aga-slider:before {
     401.aga-switch input:checked + .aga-slider:before {
    388402    transform: translateX(20px);
    389403}
    390404
    391 input:focus + .aga-slider {
     405.aga-switch input:focus-visible + .aga-slider {
    392406    box-shadow: 0 0 0 3px var(--aga-primary-light);
     407}
     408
     409.aga-switch input:disabled + .aga-slider {
     410    cursor: not-allowed;
     411    opacity: 0.55;
    393412}
    394413
     
    27012720    }
    27022721}
     2722
     2723/* ==========================================================================
     2724   Mapping Mode — Pro lock preview
     2725   ========================================================================== */
     2726
     2727.aga-pro-inline-callout {
     2728    display: flex;
     2729    align-items: center;
     2730    justify-content: space-between;
     2731    gap: var(--aga-space-md);
     2732    padding: var(--aga-space-md);
     2733    margin-bottom: var(--aga-space-md);
     2734    background: linear-gradient(135deg, rgba(var(--aga-primary-rgb), 0.08), rgba(var(--aga-primary-rgb), 0.02));
     2735    border: 1px solid rgba(var(--aga-primary-rgb), 0.25);
     2736    border-radius: var(--aga-radius-md);
     2737}
     2738
     2739.aga-pro-inline-callout__text {
     2740    display: flex;
     2741    flex-direction: column;
     2742    gap: 2px;
     2743    min-width: 0;
     2744}
     2745
     2746.aga-pro-inline-callout__text strong {
     2747    color: var(--aga-text);
     2748    font-size: var(--aga-font-size-sm);
     2749}
     2750
     2751.aga-pro-inline-callout__text span {
     2752    color: var(--aga-text-muted);
     2753    font-size: var(--aga-font-size-xs);
     2754}
     2755
     2756.aga-pro-inline-callout .button-primary {
     2757    flex-shrink: 0;
     2758}
     2759
     2760/* Locked panel: disabled inputs styled as preview */
     2761.aga-mode-panel--locked input[type="text"],
     2762.aga-mode-panel--locked select,
     2763.aga-mode-panel--locked .aga-vst-pick-btn {
     2764    opacity: 0.6;
     2765    cursor: not-allowed;
     2766    background-color: var(--aga-bg-subtle, #f6f7f7);
     2767}
     2768
     2769.aga-mode-panel--locked .aga-vst-pick-btn:hover {
     2770    background: var(--aga-bg-subtle, #f6f7f7);
     2771    color: inherit;
     2772    border-color: var(--aga-border);
     2773    transform: none;
     2774    box-shadow: none;
     2775}
     2776
     2777.aga-mode-panel--locked label {
     2778    color: var(--aga-text-muted);
     2779}
     2780
     2781/* Inline-row variant (used inside Mapping Mode panel — no full-width border) */
     2782.aga-toggle-row--inline {
     2783    border-bottom: none;
     2784    padding: var(--aga-space-sm) 0;
     2785    gap: var(--aga-space-md);
     2786}
     2787
     2788@media screen and (max-width: 600px) {
     2789    .aga-pro-inline-callout {
     2790        flex-direction: column;
     2791        align-items: flex-start;
     2792    }
     2793}
  • autocomplete-google-address/trunk/admin/js/admin.js

    r3493591 r3534694  
    1212        }
    1313
    14         // ---- Mode Toggling Logic ----
    15         var modeRadios = $('input[name="Nish_aga_mode"]');
    16         var modePanels = $('.aga-mode-panel');
    17 
     14        // ---- Mode Toggling Logic (single mode now — kept as no-op for legacy callers) ----
    1815        function toggleModePanels() {
    19             var selectedMode = modeRadios.filter(':checked').val();
    20             modePanels.removeClass('active');
    21             $('#aga-panel-' + selectedMode).addClass('active');
    22         }
    23 
     16            $('.aga-mode-panel').addClass('active');
     17        }
    2418        toggleModePanels();
    25         modeRadios.on('change', toggleModePanels);
    2619
    2720        // ---- Settings Page Tabs ----
     
    5447            }
    5548
    56             // Switch to smart mapping mode and toggle panel
    57             $('#mode_smart_mapping').prop('checked', true);
    58             toggleModePanels();
     49            // Smart mapping is now the only mode — nothing to switch.
    5950
    6051            // Fill smart mapping fields
  • autocomplete-google-address/trunk/admin/views/html-admin-page-form-edit.php

    r3495096 r3534694  
    1515
    1616// Get saved values
    17 $mode              = get_post_meta( $post->ID, 'Nish_aga_mode', true ) ?: 'single_line';
     17$mode              = 'smart_mapping';
    1818$activate_globally = metadata_exists( 'post', $post->ID, 'Nish_aga_activate_globally' ) ? get_post_meta( $post->ID, 'Nish_aga_activate_globally', true ) : '1';
    1919$main_selector     = get_post_meta( $post->ID, 'Nish_aga_main_selector', true );
     
    2727$map_picker        = get_post_meta( $post->ID, 'Nish_aga_map_picker', true );
    2828
    29 // Single Line
    30 $lat_selector      = get_post_meta( $post->ID, 'Nish_aga_lat_selector', true );
    31 $lng_selector      = get_post_meta( $post->ID, 'Nish_aga_lng_selector', true );
    32 $place_id_selector = get_post_meta( $post->ID, 'Nish_aga_place_id_selector', true );
    33 
    3429// Smart Mapping
    3530$street_selector         = get_post_meta( $post->ID, 'Nish_aga_street_selector', true );
     31$street_full_address     = get_post_meta( $post->ID, 'Nish_aga_street_full_address', true );
    3632$city_selector           = get_post_meta( $post->ID, 'Nish_aga_city_selector', true );
    3733$state_selector          = get_post_meta( $post->ID, 'Nish_aga_state_selector', true );
     
    218214                                </div>
    219215                                <div class="aga-card-body">
    220                                         <div class="aga-field-group">
    221                                                 <div class="aga-mode-selector">
    222                                                         <input type="radio" id="mode_single_line" name="Nish_aga_mode" value="single_line" <?php checked( $mode, 'single_line' ); ?>>
    223                                                         <label for="mode_single_line"><?php esc_html_e( 'Single Line', 'autocomplete-google-address' ); ?></label>
    224                                                         <input type="radio" id="mode_smart_mapping" name="Nish_aga_mode" value="smart_mapping" <?php checked( $mode, 'smart_mapping' ); ?>>
    225                                                         <label for="mode_smart_mapping"><?php esc_html_e( 'Smart Mapping', 'autocomplete-google-address' ); ?><?php if ( ! $is_paying ) echo ' <small>(Pro)</small>'; ?></label>
    226                                                 </div>
    227                                         </div>
    228                                         <!-- Single Line Panel -->
    229                                         <div id="aga-panel-single_line" class="aga-mode-panel <?php echo 'single_line' === $mode ? 'active' : ''; ?>">
    230                                                 <p><?php esc_html_e( 'The full address goes into the trigger field. Optionally capture extra data.', 'autocomplete-google-address' ); ?></p>
    231                                                 <div class="aga-field-group">
    232                                                         <label for="aga_lat_selector"><?php esc_html_e( 'Latitude Selector', 'autocomplete-google-address' ); ?></label>
    233                                                         <div class="aga-vst-input-row">
    234                                                                 <input type="text" id="aga_lat_selector" name="Nish_aga_lat_selector" value="<?php echo esc_attr( $lat_selector ); ?>" class="widefat" placeholder="<?php esc_attr_e( 'Optional - e.g., #lat_field', 'autocomplete-google-address' ); ?>" />
    235                                                                 <button type="button" class="aga-vst-pick-btn" title="<?php esc_attr_e( 'Click to visually select a field from your page', 'autocomplete-google-address' ); ?>"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="22" y1="12" x2="18" y2="12"/><line x1="6" y1="12" x2="2" y2="12"/><line x1="12" y1="6" x2="12" y2="2"/><line x1="12" y1="22" x2="12" y2="18"/></svg><span class="aga-vst-pick-label"><?php esc_html_e( 'Pick', 'autocomplete-google-address' ); ?></span></button>
    236                                                         </div>
    237                                                 </div>
    238                                                 <div class="aga-field-group">
    239                                                         <label for="aga_lng_selector"><?php esc_html_e( 'Longitude Selector', 'autocomplete-google-address' ); ?></label>
    240                                                         <div class="aga-vst-input-row">
    241                                                                 <input type="text" id="aga_lng_selector" name="Nish_aga_lng_selector" value="<?php echo esc_attr( $lng_selector ); ?>" class="widefat" placeholder="<?php esc_attr_e( 'Optional - e.g., #lng_field', 'autocomplete-google-address' ); ?>" />
    242                                                                 <button type="button" class="aga-vst-pick-btn" title="<?php esc_attr_e( 'Click to visually select a field from your page', 'autocomplete-google-address' ); ?>"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="22" y1="12" x2="18" y2="12"/><line x1="6" y1="12" x2="2" y2="12"/><line x1="12" y1="6" x2="12" y2="2"/><line x1="12" y1="22" x2="12" y2="18"/></svg><span class="aga-vst-pick-label"><?php esc_html_e( 'Pick', 'autocomplete-google-address' ); ?></span></button>
    243                                                         </div>
    244                                                 </div>
    245                                                 <div class="aga-field-group">
    246                                                         <label for="aga_place_id_selector"><?php esc_html_e( 'Place ID Selector', 'autocomplete-google-address' ); ?></label>
    247                                                         <div class="aga-vst-input-row">
    248                                                                 <input type="text" id="aga_place_id_selector" name="Nish_aga_place_id_selector" value="<?php echo esc_attr( $place_id_selector ); ?>" class="widefat" placeholder="<?php esc_attr_e( 'Optional - e.g., #place_id_field', 'autocomplete-google-address' ); ?>" />
    249                                                                 <button type="button" class="aga-vst-pick-btn" title="<?php esc_attr_e( 'Click to visually select a field from your page', 'autocomplete-google-address' ); ?>"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="22" y1="12" x2="18" y2="12"/><line x1="6" y1="12" x2="2" y2="12"/><line x1="12" y1="6" x2="12" y2="2"/><line x1="12" y1="22" x2="12" y2="18"/></svg><span class="aga-vst-pick-label"><?php esc_html_e( 'Pick', 'autocomplete-google-address' ); ?></span></button>
    250                                                         </div>
    251                                                 </div>
    252                                         </div>
     216                                        <input type="hidden" name="Nish_aga_mode" value="smart_mapping">
     217                                        <?php $disabled_attr = $is_paying ? '' : 'disabled'; ?>
    253218                                        <!-- Smart Mapping Panel -->
    254                                         <div id="aga-panel-smart_mapping" class="aga-mode-panel <?php echo 'smart_mapping' === $mode ? 'active' : ''; ?>">
     219                                        <div id="aga-panel-smart_mapping" class="aga-mode-panel active<?php echo $is_paying ? '' : ' aga-mode-panel--locked'; ?>">
    255220                                                <?php if ( ! $is_paying ) : ?>
    256                                                 <div class="aga-pro-banner">
    257                                                         <h3><?php esc_html_e( 'Unlock Smart Mapping', 'autocomplete-google-address' ); ?></h3>
    258                                                         <p><?php esc_html_e( 'Split addresses into Street, City, State, Zip, and Country fields automatically.', 'autocomplete-google-address' ); ?></p>
    259                                                         <a href="<?php echo esc_url( $checkout_url ); ?>" target="_blank" class="button"><?php esc_html_e( 'Upgrade to Pro', 'autocomplete-google-address' ); ?></a>
     221                                                <div class="aga-pro-inline-callout">
     222                                                        <div class="aga-pro-inline-callout__text">
     223                                                                <strong><?php esc_html_e( 'Mapping Mode is a Pro feature.', 'autocomplete-google-address' ); ?></strong>
     224                                                                <span><?php esc_html_e( 'Preview the fields below — upgrade to enable them.', 'autocomplete-google-address' ); ?></span>
     225                                                        </div>
     226                                                        <a href="<?php echo esc_url( $checkout_url ); ?>" target="_blank" class="button button-primary"><?php esc_html_e( 'Upgrade to Pro', 'autocomplete-google-address' ); ?></a>
    260227                                                </div>
    261228                                                <?php else : ?>
    262229                                                <p><?php esc_html_e( 'Map each address component to your form fields.', 'autocomplete-google-address' ); ?></p>
     230                                                <?php endif; ?>
     231
     232                                                <div class="aga-toggle-row aga-toggle-row--inline aga-mb-sm">
     233                                                        <div class="aga-toggle-row-info">
     234                                                                <strong><?php esc_html_e( 'Full Address in Street Field', 'autocomplete-google-address' ); ?></strong>
     235                                                                <span class="aga-toggle-desc"><?php esc_html_e( 'When enabled, the entire formatted address is written into the Street selector instead of only the street component.', 'autocomplete-google-address' ); ?></span>
     236                                                        </div>
     237                                                        <label class="aga-switch">
     238                                                                <input type="checkbox" id="aga_street_full_address" name="Nish_aga_street_full_address" value="1" <?php checked( $street_full_address, '1' ); ?> <?php echo $disabled_attr; ?>>
     239                                                                <span class="aga-slider"></span>
     240                                                        </label>
     241                                                </div>
     242
    263243                                                <div class="aga-mapping-grid">
    264244                                                        <?php
     
    277257                                                                <label for="<?php echo esc_attr( $field['id'] ); ?>"><?php echo esc_html( $field['label'] ); ?></label>
    278258                                                                <div class="aga-vst-input-row">
    279                                                                         <input type="text" id="<?php echo esc_attr( $field['id'] ); ?>" name="<?php echo esc_attr( $field['name'] ); ?>" value="<?php echo esc_attr( $field['value'] ); ?>" class="widefat" placeholder="#id, .class, [name='field']" />
    280                                                                         <button type="button" class="aga-vst-pick-btn" title="<?php esc_attr_e( 'Click to visually select a field from your page', 'autocomplete-google-address' ); ?>"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="22" y1="12" x2="18" y2="12"/><line x1="6" y1="12" x2="2" y2="12"/><line x1="12" y1="6" x2="12" y2="2"/><line x1="12" y1="22" x2="12" y2="18"/></svg><span class="aga-vst-pick-label"><?php esc_html_e( 'Pick', 'autocomplete-google-address' ); ?></span></button>
     259                                                                        <input type="text" id="<?php echo esc_attr( $field['id'] ); ?>" name="<?php echo esc_attr( $field['name'] ); ?>" value="<?php echo esc_attr( $field['value'] ); ?>" class="widefat" placeholder="#id, .class, [name='field']" <?php echo $disabled_attr; ?> />
     260                                                                        <button type="button" class="aga-vst-pick-btn" title="<?php esc_attr_e( 'Click to visually select a field from your page', 'autocomplete-google-address' ); ?>" <?php echo $disabled_attr; ?>><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="22" y1="12" x2="18" y2="12"/><line x1="6" y1="12" x2="2" y2="12"/><line x1="12" y1="6" x2="12" y2="2"/><line x1="12" y1="22" x2="12" y2="18"/></svg><span class="aga-vst-pick-label"><?php esc_html_e( 'Pick', 'autocomplete-google-address' ); ?></span></button>
    281261                                                                </div>
    282262                                                        </div>
     
    288268                                                        <div class="aga-field-group">
    289269                                                                <label for="aga_state_format"><?php esc_html_e( 'State Format', 'autocomplete-google-address' ); ?></label>
    290                                                                 <select id="aga_state_format" name="Nish_aga_state_format">
     270                                                                <select id="aga_state_format" name="Nish_aga_state_format" <?php echo $disabled_attr; ?>>
    291271                                                                        <option value="long" <?php selected( $state_format, 'long' ); ?>><?php esc_html_e( 'Long Name (e.g., California)', 'autocomplete-google-address' ); ?></option>
    292272                                                                        <option value="short" <?php selected( $state_format, 'short' ); ?>><?php esc_html_e( 'Short Name (e.g., CA)', 'autocomplete-google-address' ); ?></option>
     
    295275                                                        <div class="aga-field-group">
    296276                                                                <label for="aga_country_format"><?php esc_html_e( 'Country Format', 'autocomplete-google-address' ); ?></label>
    297                                                                 <select id="aga_country_format" name="Nish_aga_country_format">
     277                                                                <select id="aga_country_format" name="Nish_aga_country_format" <?php echo $disabled_attr; ?>>
    298278                                                                        <option value="long" <?php selected( $country_format, 'long' ); ?>><?php esc_html_e( 'Long Name (e.g., United States)', 'autocomplete-google-address' ); ?></option>
    299279                                                                        <option value="short" <?php selected( $country_format, 'short' ); ?>><?php esc_html_e( 'Short Name (e.g., US)', 'autocomplete-google-address' ); ?></option>
     
    301281                                                        </div>
    302282                                                </div>
    303                                                 <?php endif; ?>
    304283                                        </div>
    305284                                </div>
  • autocomplete-google-address/trunk/autocomplete-google-address.php

    r3529084 r3534694  
    55 * Plugin URI:        https://wordpress.org/plugins/autocomplete-google-address/
    66 * Description:       Add Google Places address autocomplete to any existing form in WordPress using a selector-based mapping builder.
    7  * Version:           5.3.5
     7 * Version:           5.4.0
    88 * Author:            Md Nishath Khandakar
    99 * Author URI:        https://profiles.wordpress.org/nishatbd31/
     
    5858 * Currently plugin version.
    5959 */
    60 define( 'AGA_VERSION', '5.3.5' );
     60define( 'AGA_VERSION', '5.4.0' );
    6161/**
    6262 * Plugin directory path.
  • autocomplete-google-address/trunk/includes/class-aga-autocomplete.php

    r3493591 r3534694  
    2626
    2727        $mode = get_post_meta( $form_id, 'Nish_aga_mode', true );
     28        if ( 'smart_mapping' !== $mode ) {
     29            $mode = 'smart_mapping';
     30        }
    2831        $main_selector = get_post_meta( $form_id, 'Nish_aga_main_selector', true );
    2932
     
    3841        $is_paying = function_exists( 'google_autocomplete' ) && google_autocomplete()->is_paying();
    3942
    40         if ( 'single_line' === $mode ) {
    41             $config['selectors']['lat'] = get_post_meta( $form_id, 'Nish_aga_lat_selector', true );
    42             $config['selectors']['lng'] = get_post_meta( $form_id, 'Nish_aga_lng_selector', true );
    43             $config['selectors']['place_id'] = get_post_meta( $form_id, 'Nish_aga_place_id_selector', true );
    44         } elseif ( 'smart_mapping' === $mode && $is_paying ) {
     43        if ( $is_paying ) {
    4544            $config['selectors']['street'] = get_post_meta( $form_id, 'Nish_aga_street_selector', true );
    4645            $config['selectors']['city'] = get_post_meta( $form_id, 'Nish_aga_city_selector', true );
     
    5150            $config['selectors']['lng'] = get_post_meta( $form_id, 'Nish_aga_map_lng_selector', true );
    5251            $config['selectors']['place_id'] = get_post_meta( $form_id, 'Nish_aga_smart_place_id_selector', true );
    53            
     52
    5453            $config['formats'] = array(
    5554                'state'   => get_post_meta( $form_id, 'Nish_aga_state_format', true ) ?: 'long',
    5655                'country' => get_post_meta( $form_id, 'Nish_aga_country_format', true ) ?: 'long',
    5756            );
     57
     58            $config['street_full_address'] = ( '1' === get_post_meta( $form_id, 'Nish_aga_street_full_address', true ) );
    5859        }
    5960
  • autocomplete-google-address/trunk/includes/class-aga-elementor.php

    r3488484 r3534694  
    160160                    var itemClasses = _.escape(item.css_classes) || '';
    161161                    var required = item.required ? 'required' : '';
    162                     var mode = item.aga_mode || 'single_line';
     162                    var mode = item.aga_mode || 'smart_mapping';
    163163
    164164                    var html = '<input size=\"1\" type=\"text\" class=\"elementor-field elementor-field-textual elementor-size-' + inputSize + ' ' + itemClasses + '\" name=\"form_field_' + i + '\" id=\"form_field_' + i + '\" ' + required + ' placeholder=\"' + placeholder + '\" autocomplete=\"off\">';
  • autocomplete-google-address/trunk/includes/class-aga-forms.php

    r3493591 r3534694  
    199199        );
    200200
     201        update_post_meta(
     202            $post_id,
     203            'Nish_aga_street_full_address',
     204            isset( $_POST['Nish_aga_street_full_address'] ) ? '1' : ''
     205        );
     206
    201207        if ( isset( $_POST['Nish_aga_load_on_pages'] ) && is_array( $_POST['Nish_aga_load_on_pages'] ) ) {
    202208            update_post_meta(
     
    289295
    290296        if ( 'aga_mode' === $column ) {
    291             $mode = get_post_meta( $post_id, 'Nish_aga_mode', true );
    292             echo esc_html(
    293                 $mode === 'single_line'
    294                     ? 'Single Line'
    295                     : ( $mode === 'smart_mapping' ? 'Smart Mapping' : 'None' )
    296             );
     297            $is_paying = function_exists( 'google_autocomplete' ) && google_autocomplete()->is_paying();
     298            echo esc_html( $is_paying ? 'Smart Mapping' : 'Smart Mapping (Pro)' );
    297299        }
    298300
  • autocomplete-google-address/trunk/includes/class-aga-shortcode.php

    r3493591 r3534694  
    5252                'placeholder' => 'Start typing an address...',
    5353                'label'       => '',
    54                 'mode'        => 'single_line',
     54                'mode'        => 'smart_mapping',
    5555                'country'     => '',
    5656                'show_map'    => 'false',
     
    9898
    9999        // Build the HTML.
    100         $mode       = ! empty( $config['mode'] ) ? $config['mode'] : 'single_line';
     100        $mode       = ! empty( $config['mode'] ) ? $config['mode'] : 'smart_mapping';
    101101        $show_map   = ! empty( $config['map_picker'] );
    102102        $wrapper_class = 'aga-shortcode-wrapper';
     
    127127     */
    128128    private function render_standalone( $instance_id, $atts ) {
    129         $mode     = in_array( $atts['mode'], array( 'single_line', 'smart_mapping' ), true ) ? $atts['mode'] : 'single_line';
     129        $is_paying = function_exists( 'google_autocomplete' ) && google_autocomplete()->is_paying();
     130        // Smart Mapping is Pro-only — fall back to plain single-line for free users.
     131        $mode      = $is_paying ? 'smart_mapping' : 'single_line';
    130132        $show_map = 'true' === strtolower( $atts['show_map'] );
    131133
  • autocomplete-google-address/trunk/includes/widgets/class-aga-elementor-form-field.php

    r3493591 r3534694  
    5353                                'name'      => 'aga_mode',
    5454                                'label'     => esc_html__( 'Mode', 'autocomplete-google-address' ),
    55                                 'type'      => \Elementor\Controls_Manager::SELECT,
    56                                 'default'   => 'single_line',
    57                                 'options'   => array(
    58                                         'single_line'   => esc_html__( 'Single Line', 'autocomplete-google-address' ),
    59                                         'smart_mapping' => $is_paying
    60                                                 ? esc_html__( 'Smart Mapping', 'autocomplete-google-address' )
    61                                                 : esc_html__( 'Smart Mapping (Pro)', 'autocomplete-google-address' ),
    62                                 ),
     55                                'type'      => \Elementor\Controls_Manager::HIDDEN,
     56                                'default'   => 'smart_mapping',
    6357                                'condition' => $condition,
    6458                        ) ),
     
    161155                $is_paying = function_exists( 'google_autocomplete' ) && google_autocomplete()->is_paying();
    162156
    163                 $mode = ! empty( $item['aga_mode'] ) ? $item['aga_mode'] : 'single_line';
    164                 if ( 'smart_mapping' === $mode && ! $is_paying ) {
    165                         $mode = 'single_line';
    166                 }
     157                // Smart Mapping is Pro-only — fall back to plain single-line for free users.
     158                $mode = $is_paying ? 'smart_mapping' : 'single_line';
    167159
    168160                $input_size = ! empty( $item['input_size'] ) ? $item['input_size'] : 'sm';
  • autocomplete-google-address/trunk/includes/widgets/class-aga-elementor-widget.php

    r3493591 r3534694  
    9292        );
    9393
    94         $mode_options = array(
    95             'single_line' => esc_html__( 'Single Line', 'autocomplete-google-address' ),
    96         );
    97         if ( $is_paying ) {
    98             $mode_options['smart_mapping'] = esc_html__( 'Smart Mapping', 'autocomplete-google-address' );
    99         } else {
    100             $mode_options['smart_mapping'] = esc_html__( 'Smart Mapping (Pro)', 'autocomplete-google-address' );
    101         }
    102 
    10394        $this->add_control(
    10495            'mode',
    10596            array(
    10697                'label'   => esc_html__( 'Mode', 'autocomplete-google-address' ),
    107                 'type'    => \Elementor\Controls_Manager::SELECT,
    108                 'default' => 'single_line',
    109                 'options' => $mode_options,
     98                'type'    => \Elementor\Controls_Manager::HIDDEN,
     99                'default' => 'smart_mapping',
    110100            )
    111101        );
     
    375365        $instance_id = 'aga-el-' . $widget_id;
    376366
    377         // Determine effective mode — fall back to single_line for free users.
    378         $mode = $settings['mode'];
    379         if ( 'smart_mapping' === $mode && ! $is_paying ) {
    380             $mode = 'single_line';
    381         }
     367        // Smart Mapping is Pro-only — fall back to plain single-line for free users.
     368        $mode = $is_paying ? 'smart_mapping' : 'single_line';
    382369
    383370        $show_map              = $is_paying && 'yes' === ( $settings['show_map'] ?? '' );
  • autocomplete-google-address/trunk/public/js/frontend.js

    r3529084 r3534694  
    10211021                    if (config.mode === 'smart_mapping' && result.address_components) {
    10221022                        var components = aga.parseReverseComponents(result.address_components);
    1023                         aga.applyParsedComponents(components, config, mainInput);
     1023                        aga.applyParsedComponents(components, config, mainInput, result.formatted_address || '');
    10241024                    }
    10251025
     
    10771077        },
    10781078
    1079         applyParsedComponents: function (components, config, mainInput) {
     1079        applyParsedComponents: function (components, config, mainInput, formattedAddress) {
    10801080            var countryCode = components.country_short || '';
    10811081            var countryName = components.country_long || '';
     
    11041104
    11051105            if (config.selectors.street) {
    1106                 aga.setFieldValue(config.selectors.street, (components.street_number + ' ' + components.route).trim(), undefined, mainInput);
     1106                var streetValue = (config.street_full_address && formattedAddress)
     1107                    ? formattedAddress
     1108                    : (components.street_number + ' ' + components.route).trim();
     1109                aga.setFieldValue(config.selectors.street, streetValue, undefined, mainInput);
    11071110            }
    11081111            if (config.selectors.city) {
     
    12881291
    12891292                if (config.selectors.street) {
    1290                     aga.setFieldValue(config.selectors.street, (components.street_number + ' ' + components.route).trim(), undefined, mainInput);
     1293                    var streetValue = (config.street_full_address && place.formattedAddress)
     1294                        ? place.formattedAddress
     1295                        : (components.street_number + ' ' + components.route).trim();
     1296                    aga.setFieldValue(config.selectors.street, streetValue, undefined, mainInput);
    12911297                }
    12921298
  • autocomplete-google-address/trunk/readme.txt

    r3529084 r3534694  
    44Requires at least: 5.4
    55Tested up to: 6.9
    6 Stable tag: 5.3.5
     6Stable tag: 5.4.0
    77Requires PHP: 7.2
    88License: GPL-2.0-or-later
     
    291291== Changelog ==
    292292
     293= 5.4.0 =
     294* CHANGED: Mapping Mode is now a single unified Pro feature — the legacy "Single Line" option has been removed. Free users see a locked preview of all mapping fields with an upgrade prompt; Pro users get the full configurator.
     295* NEW: "Full Address in Street Field" toggle (Pro) — when enabled, the entire formatted address is written into the Street selector instead of only the street component. Useful when your form has a single visible address field but you still want all the structured data.
     296* IMPROVED: Mapping Mode card redesigned — disabled-input preview for free users so the available fields and toggle are visible at a glance.
     297* FIX: Toggle switches no longer overflow their track on the form-edit page; thumb stays inside the track in all admin themes.
     298
    293299= 5.3.5 =
    294300* NEW: Country blocklist support — when WooCommerce is configured to sell only to specific countries, selecting an unsupported country address now shows a clear "We do not ship to [Country]" error badge and blocks checkout submission.
Note: See TracChangeset for help on using the changeset viewer.