Plugin Directory

Changeset 3442197


Ignore:
Timestamp:
01/19/2026 04:43:40 AM (3 months ago)
Author:
bhvreddy
Message:

v4.36 enhanced analytics parameters

Location:
click-to-chat-for-whatsapp
Files:
269 added
9 edited

Legend:

Unmodified
Added
Removed
  • click-to-chat-for-whatsapp/trunk/click-to-chat.php

    r3429029 r3442197  
    88 * Plugin URI:  https://wordpress.org/plugins/click-to-chat-for-whatsapp/
    99 * Description: Lets make your Web page visitors contact you through WhatsApp with a single click/tap
    10  * Version:     4.35
     10 * Version:     4.36
    1111 * Author:      HoliThemes
    1212 * Author URI:  https://holithemes.com/plugins/click-to-chat/
     
    2222// ctc - Version - update version at readme 'Stable tag'.
    2323if ( ! defined( 'HT_CTC_VERSION' ) ) {
    24     define( 'HT_CTC_VERSION', '4.35' );
     24    define( 'HT_CTC_VERSION', '4.36' );
    2525}
    2626
  • click-to-chat-for-whatsapp/trunk/new/admin/class-ht-ctc-admin-other-settings.php

    r3420906 r3442197  
    141141        </div>
    142142        <div class="collapsible-body">
    143        
    144             <?php
    145 
    146             /**
    147              * Parms_saved - hidden input filed.
    148              * adds to db. while user save changes. useful to identify user saved the params. (especially if user deletes all params - fallback values adds only if parms_saved not exits. (backward compatible))
    149              *
    150              * @since 3.31
    151              *
    152              * before 3.31 google_analytics, ga4 checkbox exists. and now it become one g_an checkbox and value of g_an is ga4 by default(new installs). and for upgrades it will be ga/ga4. updated at class ht-ctc-update-db.php
    153              */
    154             ?>
    155         <input name="<?php echo esc_attr( $dbrow ); ?>[parms_saved]" value="after_3_31" type="hidden" class="hide">
    156         <input name="<?php echo esc_attr( $dbrow ); ?>[parms_saved_2]" value="after_4_34" type="hidden" class="hide">
    157        
    158        
    159        
    160             <?php
    161 
     143            <?php
    162144            // Google Analytics
    163145            $g_an_value = ( isset( $options['g_an'] ) ) ? esc_attr( $options['g_an'] ) : 'ga4';
     
    186168        </p>
    187169            <?php
    188 
    189             /**
    190              * Updated analytics.
    191              *  new: settings for event name, type, params.
    192              *
    193              * @since 3.31
    194              */
    195 
    196             // g_an_params not exits. (and user not yet saved/clear the params.) backward compatible.
    197             if ( ! isset( $options['g_an_params'] ) && ! isset( $options['parms_saved'] ) ) {
    198 
    199                 if ( 'ga' === $g_an_value ) {
    200                     // if only ga is set.
    201                     $options['g_an_params'] = array(
    202                         'g_an_param_1',
    203                         'g_an_param_2',
    204                     );
    205 
    206                     $options['g_an_param_1'] = array(
    207                         'key'   => 'event_category',
    208                         'value' => 'Click to Chat for WhatsApp',
    209                     );
    210 
    211                     $options['g_an_param_2'] = array(
    212                         'key'   => 'event_label',
    213                         'value' => '{title}, {url}',
    214                     );
    215 
    216                 } else {
    217                     // ga4 or ..
    218                     $options['g_an_params'] = array(
    219                         'g_an_param_1',
    220                         'g_an_param_2',
    221                         'g_an_param_3',
    222                     );
    223 
    224                     $options['g_an_param_1'] = array(
    225                         'key'   => 'number',
    226                         'value' => '{number}',
    227                     );
    228 
    229                     $options['g_an_param_2'] = array(
    230                         'key'   => 'title',
    231                         'value' => '{title}',
    232                     );
    233 
    234                     $options['g_an_param_3'] = array(
    235                         'key'   => 'url',
    236                         'value' => '{url}',
    237                     );
    238                 }
    239             }
    240 
    241170            $g_an_event_name = ( isset( $options['g_an_event_name'] ) ) ? esc_attr( $options['g_an_event_name'] ) : 'click to chat';
    242171            // list of all g_an params..
     
    407336        </p>
    408337            <?php
    409             // parms_saved_2 not exits. (and user not yet saved/clear the params.) backward compatible.
    410             if ( ! isset( $options['gtm_params'] ) && ! isset( $options['parms_saved_2'] ) ) {
    411                 $options['gtm_params'] = array(
    412                     'gtm_param_1',
    413                     'gtm_param_2',
    414                     'gtm_param_3',
    415                     'gtm_param_4',
    416                     'gtm_param_5',
    417                 );
    418 
    419                 $options['gtm_param_1'] = array(
    420                     'key'   => 'type',
    421                     'value' => 'chat',
    422                 );
    423 
    424                 $options['gtm_param_2'] = array(
    425                     'key'   => 'number',
    426                     'value' => '{number}',
    427                 );
    428 
    429                 $options['gtm_param_3'] = array(
    430                     'key'   => 'title',
    431                     'value' => '{title}',
    432                 );
    433 
    434                 $options['gtm_param_4'] = array(
    435                     'key'   => 'url',
    436                     'value' => '{url}',
    437                 );
    438 
    439                 $options['gtm_param_5'] = array(
    440                     'key'   => 'ref',
    441                     'value' => 'dataLayer push',
    442                 );
    443 
    444             }
    445 
    446338            $gtm_event_name  = ( isset( $options['gtm_event_name'] ) ) ? esc_attr( $options['gtm_event_name'] ) : 'Click to Chat';
    447339            $gtm_params      = ( isset( $options['gtm_params'] ) && is_array( $options['gtm_params'] ) ) ? array_map( 'esc_attr', $options['gtm_params'] ) : '';
     
    544436        </ul>
    545437
    546 
    547             <?php
    548 
    549             /**
    550              * Meta Pixel
    551              * updated: 3.31 (able to change event name, type, edit/add params)
    552              */
    553 
     438            <?php
    554439            $fb_pixel_checkbox = ( isset( $options['fb_pixel'] ) ) ? esc_attr( $options['fb_pixel'] ) : '';
    555 
    556             ?>
     440            ?>
     441
    557442        <ul class="collapsible col_pixel coll_active" data-coll_active="col_pixel" id="col_pixel">
    558443        <li class="">
     
    571456        </p>
    572457            <?php
    573 
    574             // if params not exits. (and user not yet saved/clear the params.)
    575             if ( ! isset( $options['pixel_params'] ) && ! isset( $options['parms_saved'] ) ) {
    576 
    577                 $options['pixel_params'] = array(
    578                     'pixel_param_1',
    579                     'pixel_param_2',
    580                     'pixel_param_3',
    581                     'pixel_param_4',
    582                 );
    583 
    584                 $options['pixel_param_1'] = array(
    585                     'key'   => 'Category',
    586                     'value' => 'Click to Chat for WhatsApp',
    587                 );
    588 
    589                 $options['pixel_param_2'] = array(
    590                     'key'   => 'ID',
    591                     'value' => '{number}',
    592                 );
    593 
    594                 $options['pixel_param_3'] = array(
    595                     'key'   => 'Title',
    596                     'value' => '{title}',
    597                 );
    598 
    599                 $options['pixel_param_4'] = array(
    600                     'key'   => 'URL',
    601                     'value' => '{url}',
    602                 );
    603 
    604             }
    605 
    606458            $pixel_event_type          = ( isset( $options['pixel_event_type'] ) ) ? esc_attr( $options['pixel_event_type'] ) : 'trackCustom';
    607459            $pixel_custom_event_name   = ( isset( $options['pixel_custom_event_name'] ) ) ? esc_attr( $options['pixel_custom_event_name'] ) : 'Click to Chat by HoliThemes';
  • click-to-chat-for-whatsapp/trunk/new/admin/db/class-ht-ctc-db.php

    r3420906 r3442197  
    9393                $values['g_an_event_name'] = 'click to chat';
    9494
     95                // google analytics params
     96                $values['g_an_params'] = array(
     97                    'g_an_param_1',
     98                    'g_an_param_2',
     99                    'g_an_param_3',
     100                );
     101
     102                $values['g_an_param_1'] = array(
     103                    'key'   => 'number',
     104                    'value' => '{number}',
     105                );
     106
     107                $values['g_an_param_2'] = array(
     108                    'key'   => 'title',
     109                    'value' => '{title}',
     110                );
     111
     112                $values['g_an_param_3'] = array(
     113                    'key'   => 'url',
     114                    'value' => '{url}',
     115                );
     116
    95117                $values['gtm']            = '1';
    96118                $values['gtm_event_name'] = 'Click to Chat';
     119
     120                // gtm params
     121                $values['gtm_params'] = array(
     122                    'gtm_param_1',
     123                    'gtm_param_2',
     124                    'gtm_param_3',
     125                    'gtm_param_4',
     126                    'gtm_param_5',
     127                );
     128
     129                $values['gtm_param_1'] = array(
     130                    'key'   => 'type',
     131                    'value' => 'chat',
     132                );
     133
     134                $values['gtm_param_2'] = array(
     135                    'key'   => 'number',
     136                    'value' => '{number}',
     137                );
     138
     139                $values['gtm_param_3'] = array(
     140                    'key'   => 'title',
     141                    'value' => '{title}',
     142                );
     143
     144                $values['gtm_param_4'] = array(
     145                    'key'   => 'url',
     146                    'value' => '{url}',
     147                );
     148
     149                $values['gtm_param_5'] = array(
     150                    'key'   => 'ref',
     151                    'value' => 'dataLayer push',
     152                );
    97153
    98154                $values['fb_pixel']                  = '1';
     
    100156                $values['pixel_custom_event_name']   = 'Click to Chat by HoliThemes';
    101157                $values['pixel_standard_event_name'] = 'Lead';
     158
     159                // pixel params
     160                $values['pixel_params'] = array(
     161                    'pixel_param_1',
     162                    'pixel_param_2',
     163                    'pixel_param_3',
     164                    'pixel_param_4',
     165                );
     166
     167                $values['pixel_param_1'] = array(
     168                    'key'   => 'Category',
     169                    'value' => 'Click to Chat for WhatsApp',
     170                );
     171
     172                $values['pixel_param_2'] = array(
     173                    'key'   => 'ID',
     174                    'value' => '{number}',
     175                );
     176
     177                $values['pixel_param_3'] = array(
     178                    'key'   => 'Title',
     179                    'value' => '{title}',
     180                );
     181
     182                $values['pixel_param_4'] = array(
     183                    'key'   => 'URL',
     184                    'value' => '{url}',
     185                );
     186
    102187            }
    103188
     
    240325                'v4_3'               => $time,
    241326                'v4_34'              => $time,
     327                'v4_36'              => $time,
    242328            );
    243329
  • click-to-chat-for-whatsapp/trunk/new/admin/db/class-ht-ctc-update-db.php

    r3429029 r3442197  
    8282                    $this->v4_34_update();
    8383                }
     84
     85                /**
     86                 * V4.36: if not yet updated to v4.36 or above
     87                 */
     88                if ( ! isset( $ht_ctc_plugin_details['v4_36'] ) ) {
     89                    $this->v4_36_update();
     90                }
    8491            }
    8592        }
     
    9097         */
    9198
     99
     100
     101        /**
     102         * Updating to v4.36 or above
     103         *
     104         * 4.36 changes.
     105         * Google Analytics params, gtm params, pixel params are added to db. when upgrades.
     106         *
     107         * google analytis setting for parameters added in approx. v3.31.
     108         */
     109        public function v4_36_update() {
     110
     111            $os = get_option( 'ht_ctc_othersettings', array() );
     112
     113            // Ensure $os is an array to prevent errors.
     114            if ( ! is_array( $os ) ) {
     115                $os = array();
     116            }
     117
     118            $new_data = array(); // hold new structure data
     119
     120            /**
     121             * Migration Logic:
     122             * We check if the parameters exist in the DB.
     123             * We also check 'parms_saved' (for GA/Pixel) and 'parms_saved_2' (for GTM).
     124             *
     125             * 'parms_saved'/'parms_saved_2' are hidden fields saved when the user submits the settings form.
     126             * If these flags exist, it means the user has explicitly saved the settings at some point.
     127             * In that case, we TRUST the database (even if params are empty, the user might have deleted them intentionally).
     128             *
     129             * If these flags DO NOT exist, it means the user is likely running on default settings (runtime defaults).
     130             * In this case, we populate the DB with those defaults to maintain behavior now that runtime generation is removed.
     131             */
     132
     133            // 1. Google Analytics Params
     134            // Check if params are missing AND user hasn't actively saved settings before (backward compatibility).
     135            // isset check is safe because $os is guaranteed strictly to be an array above.
     136            if ( ! isset( $os['g_an_params'] ) && ! isset( $os['parms_saved'] ) ) {
     137
     138                $g_an_value = ( isset( $os['g_an'] ) ) ? esc_attr( $os['g_an'] ) : 'ga4';
     139
     140                if ( 'ga' === $g_an_value ) {
     141                    // Legacy Google Analytics (Universal Analytics) defaults
     142                    $new_data['g_an_params'] = array(
     143                        'g_an_param_1',
     144                        'g_an_param_2',
     145                    );
     146
     147                    $new_data['g_an_param_1'] = array(
     148                        'key'   => 'event_category',
     149                        'value' => 'Click to Chat for WhatsApp',
     150                    );
     151
     152                    $new_data['g_an_param_2'] = array(
     153                        'key'   => 'event_label',
     154                        'value' => '{title}, {url}',
     155                    );
     156
     157                } else {
     158                    // GA4 defaults
     159                    $new_data['g_an_params'] = array(
     160                        'g_an_param_1',
     161                        'g_an_param_2',
     162                        'g_an_param_3',
     163                    );
     164
     165                    $new_data['g_an_param_1'] = array(
     166                        'key'   => 'number',
     167                        'value' => '{number}',
     168                    );
     169
     170                    $new_data['g_an_param_2'] = array(
     171                        'key'   => 'title',
     172                        'value' => '{title}',
     173                    );
     174
     175                    $new_data['g_an_param_3'] = array(
     176                        'key'   => 'url',
     177                        'value' => '{url}',
     178                    );
     179                }
     180            }
     181
     182            // 2. GTM (Google Tag Manager) Params
     183            // Check if params are missing AND 'parms_saved_2' flag does not exist.
     184            if ( ! isset( $os['gtm_params'] ) && ! isset( $os['parms_saved_2'] ) ) {
     185
     186                $new_data['gtm_params'] = array(
     187                    'gtm_param_1',
     188                    'gtm_param_2',
     189                    'gtm_param_3',
     190                    'gtm_param_4',
     191                    'gtm_param_5',
     192                );
     193
     194                $new_data['gtm_param_1'] = array(
     195                    'key'   => 'type',
     196                    'value' => 'chat',
     197                );
     198
     199                $new_data['gtm_param_2'] = array(
     200                    'key'   => 'number',
     201                    'value' => '{number}',
     202                );
     203
     204                $new_data['gtm_param_3'] = array(
     205                    'key'   => 'title',
     206                    'value' => '{title}',
     207                );
     208
     209                $new_data['gtm_param_4'] = array(
     210                    'key'   => 'url',
     211                    'value' => '{url}',
     212                );
     213
     214                $new_data['gtm_param_5'] = array(
     215                    'key'   => 'ref',
     216                    'value' => 'dataLayer push',
     217                );
     218
     219            }
     220
     221            // 3. Meta Pixel Params
     222            // Check if params are missing AND user hasn't actively saved settings before.
     223            if ( ! isset( $os['pixel_params'] ) && ! isset( $os['parms_saved'] ) ) {
     224
     225                $new_data['pixel_params'] = array(
     226                    'pixel_param_1',
     227                    'pixel_param_2',
     228                    'pixel_param_3',
     229                    'pixel_param_4',
     230                );
     231
     232                $new_data['pixel_param_1'] = array(
     233                    'key'   => 'Category',
     234                    'value' => 'Click to Chat for WhatsApp',
     235                );
     236
     237                $new_data['pixel_param_2'] = array(
     238                    'key'   => 'ID',
     239                    'value' => '{number}',
     240                );
     241
     242                $new_data['pixel_param_3'] = array(
     243                    'key'   => 'Title',
     244                    'value' => '{title}',
     245                );
     246
     247                $new_data['pixel_param_4'] = array(
     248                    'key'   => 'URL',
     249                    'value' => '{url}',
     250                );
     251
     252            }
     253
     254            if ( ! is_array( $new_data ) ) {
     255                $new_data = array();
     256            }
     257
     258            // Merge defaults ($new_data) with existing options ($os).
     259            // Existing keys in $os will overwrite $new_data, preserving user settings if they exist.
     260            $update_othersettings = array_merge( $new_data, $os );
     261
     262            update_option( 'ht_ctc_othersettings', $update_othersettings );
     263        }
    92264
    93265
     
    247419            $group        = get_option( 'ht_ctc_group', array() );
    248420            $update_group = array_merge( $n, $group );
    249             update_option( 'ht_ctc_group', $update_chat );
     421            update_option( 'ht_ctc_group', $update_group );
    250422
    251423            $share        = get_option( 'ht_ctc_share', array() );
    252424            $update_share = array_merge( $n, $share );
    253             update_option( 'ht_ctc_share', $update_chat );
     425            update_option( 'ht_ctc_share', $update_share );
    254426        }
    255427
  • click-to-chat-for-whatsapp/trunk/new/inc/assets/js/dev/app.dev.js

    r3429029 r3442197  
    15131513
    15141514            // Create basic event info
    1515             var ga_parms = new Map();
    1516             const getGaParamsObject = () => Object.fromEntries( ga_parms );
     1515            var ga_params = new Map();
     1516            const getGaParamsObject = () => Object.fromEntries( ga_params );
    15171517            var ga_category = 'Click to Chat for WhatsApp';
    15181518            var ga_action = 'chat: ' + id;
     
    15661566                        console.log( parameterKey );
    15671567                        console.log( parameterValue );
    1568                         ga_parms.set( parameterKey, parameterValue );
     1568                        ga_params.set( parameterKey, parameterValue );
    15691569                    } );
    15701570                }
    1571                 console.log( 'ga_parms' );
     1571                console.log( 'ga_params' );
    15721572                console.log( getGaParamsObject() );
    15731573
     
    16131613                            // Only allow certain tag ID formats
    16141614                            if ( tag_id.startsWith( 'G-' ) || tag_id.startsWith( 'GT-' ) ) {
    1615                                 ga_parms.set( 'send_to', tag_id );
     1615                                ga_params.set( 'send_to', tag_id );
    16161616
    16171617                                console.log( 'gtag event - send_to: ' + tag_id );
    16181618                                console.log( 'g_event_name: ' + g_event_name );
    1619                                 console.log( 'ga_parms: ' );
     1619                                console.log( 'ga_params: ' );
    16201620                                console.log( getGaParamsObject() );
    16211621
     
    17301730                            'g_event_name: ' +
    17311731                            g_event_name );
    1732                         console.log( 'ga_parms: ' );
     1732                        console.log( 'ga_params: ' );
    17331733                        console.log( getGaParamsObject() );
    17341734                        gtag( 'event', g_event_name, getGaParamsObject() );
  • click-to-chat-for-whatsapp/trunk/new/inc/chat/class-ht-ctc-chat.php

    r3429029 r3442197  
    584584                    }
    585585                }
    586             } elseif ( ! isset( $othersettings['parms_saved'] ) ) {
    587 
    588                 // If user not yet saved the params. (backward compatibility)
    589                 if ( 'ga' === $g_an_value ) {
    590                     $values['g_an_params'] = array(
    591                         'g_an_param_1',
    592                         'g_an_param_2',
    593                     );
    594 
    595                     $values['g_an_param_1'] = array(
    596                         'key'   => 'event_category',
    597                         'value' => 'Click to Chat for WhatsApp',
    598                     );
    599 
    600                     $values['g_an_param_2'] = array(
    601                         'key'   => 'event_label',
    602                         'value' => '{title}, {url}',
    603                     );
    604                 } else {
    605                     $values['g_an_params']  = array(
    606                         'g_an_param_1',
    607                         'g_an_param_2',
    608                         'g_an_param_3',
    609                     );
    610                     $values['g_an_param_1'] = array(
    611                         'key'   => 'number',
    612                         'value' => '{number}',
    613                     );
    614                     $values['g_an_param_2'] = array(
    615                         'key'   => 'title',
    616                         'value' => '{title}',
    617                     );
    618                     $values['g_an_param_3'] = array(
    619                         'key'   => 'url',
    620                         'value' => '{url}',
    621                     );
    622                 }
    623586            }
    624587
     
    639602                    }
    640603                }
    641             } elseif ( ! isset( $othersettings['parms_saved'] ) ) {
    642                     $values['pixel_params'] = array(
    643                         'pixel_param_1',
    644                         'pixel_param_2',
    645                         'pixel_param_3',
    646                         'pixel_param_4',
    647                     );
    648 
    649                     $values['pixel_param_1'] = array(
    650                         'key'   => 'Category',
    651                         'value' => 'Click to Chat for WhatsApp',
    652                     );
    653 
    654                     $values['pixel_param_2'] = array(
    655                         'key'   => 'ID',
    656                         'value' => '{number}',
    657                     );
    658 
    659                     $values['pixel_param_3'] = array(
    660                         'key'   => 'Title',
    661                         'value' => '{title}',
    662                     );
    663 
    664                     $values['pixel_param_4'] = array(
    665                         'key'   => 'URL',
    666                         'value' => '{url}',
    667                     );
    668604            }
    669605
     
    684620                    }
    685621                }
    686             } elseif ( ! isset( $othersettings['gtm_params'] ) && ! isset( $othersettings['parms_saved_2'] ) ) {
    687                 $values['gtm_params']  = array(
    688                     'gtm_param_1',
    689                     'gtm_param_2',
    690                     'gtm_param_3',
    691                     'gtm_param_4',
    692                     'gtm_param_5',
    693                 );
    694                 $values['gtm_param_1'] = array(
    695                     'key'   => 'type',
    696                     'value' => 'chat',
    697                 );
    698                 $values['gtm_param_2'] = array(
    699                     'key'   => 'number',
    700                     'value' => '{number}',
    701                 );
    702                 $values['gtm_param_3'] = array(
    703                     'key'   => 'title',
    704                     'value' => '{title}',
    705                 );
    706                 $values['gtm_param_4'] = array(
    707                     'key'   => 'url',
    708                     'value' => '{url}',
    709                 );
    710                 $values['gtm_param_5'] = array(
    711                     'key'   => 'ref',
    712                     'value' => 'dataLayer push',
    713                 );
    714622            }
    715623
  • click-to-chat-for-whatsapp/trunk/new/inc/commons/class-ht-ctc-security.php

    r3369409 r3442197  
    3030                $referer  = isset( $_SERVER['HTTP_REFERER'] ) ? esc_url_raw( wp_unslash( $_SERVER['HTTP_REFERER'] ) ) : '';
    3131
    32                 // Referer check
    33                 if ( strpos( $referer, $site_url ) === false ) {
     32                // Referer checks should only run when a header is present.
     33                // A growing number of browsers/extensions block the Referer header for privacy.
     34                if ( $referer && strpos( $referer, $site_url ) === false ) {
    3435                    return new WP_REST_Response( array( 'error' => 'Invalid referer' ), 403 );
    3536                }
    3637
    37                 // Nonce check (optional, only if frontend sends it)
     38                // Nonce check:
     39                // 1. Allow optional/missing nonce for public caching compatibility (Settings are public data).
     40                // 2. If a nonce IS provided (e.g. from app.js), verify it strictly to prevent spoofing.
    3841                $nonce = $request->get_header( 'x_wp_nonce' );
     42                if ( empty( $nonce ) ) {
     43                    $nonce = $request->get_param( '_wpnonce' );
     44                }
    3945
    40                 // ht_ctc_nonce
    41                 if ( ! wp_verify_nonce( $nonce, 'wp_rest' ) ) {
     46                if ( $nonce && ! wp_verify_nonce( $nonce, 'wp_rest' ) ) {
    4247                    return new WP_REST_Response( array( 'error' => 'Invalid nonce' ), 403 );
    4348                }
     
    4550                // Optional: Bounce or User-Agent logic (custom abuse logic)
    4651                $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : '';
    47                 if ( empty( $user_agent ) ) {
     52                if ( '' === $user_agent ) {
    4853                    return new WP_REST_Response( array( 'error' => 'Invalid user agent' ), 403 );
    4954                }
  • click-to-chat-for-whatsapp/trunk/new/inc/commons/class-ht-ctc-settings-data.php

    r3369409 r3442197  
    311311                    }
    312312                }
    313             } elseif ( ! isset( $othersettings['parms_saved'] ) ) {
    314                 // if user not yet saved the params. (backward compatibility)
    315                 if ( 'ga' === $g_an_value ) {
    316                     $values['g_an_params'] = array(
    317                         'g_an_param_1',
    318                         'g_an_param_2',
    319                     );
    320 
    321                     $values['g_an_param_1'] = array(
    322                         'key'   => 'event_category',
    323                         'value' => 'Click to Chat for WhatsApp',
    324                     );
    325 
    326                     $values['g_an_param_2'] = array(
    327                         'key'   => 'event_label',
    328                         'value' => '{title}, {url}',
    329                     );
    330                 } else {
    331                     $values['g_an_params']  = array(
    332                         'g_an_param_1',
    333                         'g_an_param_2',
    334                         'g_an_param_3',
    335                     );
    336                     $values['g_an_param_1'] = array(
    337                         'key'   => 'number',
    338                         'value' => '{number}',
    339                     );
    340                     $values['g_an_param_2'] = array(
    341                         'key'   => 'title',
    342                         'value' => '{title}',
    343                     );
    344                     $values['g_an_param_3'] = array(
    345                         'key'   => 'url',
    346                         'value' => '{url}',
    347                     );
    348                 }
    349313            }
    350314
     
    365329                    }
    366330                }
    367             } elseif ( ! isset( $othersettings['parms_saved'] ) ) {
    368                     $values['pixel_params'] = array(
    369                         'pixel_param_1',
    370                         'pixel_param_2',
    371                         'pixel_param_3',
    372                         'pixel_param_4',
    373                     );
    374 
    375                     $values['pixel_param_1'] = array(
    376                         'key'   => 'Category',
    377                         'value' => 'Click to Chat for WhatsApp',
    378                     );
    379 
    380                     $values['pixel_param_2'] = array(
    381                         'key'   => 'ID',
    382                         'value' => '{number}',
    383                     );
    384 
    385                     $values['pixel_param_3'] = array(
    386                         'key'   => 'Title',
    387                         'value' => '{title}',
    388                     );
    389 
    390                     $values['pixel_param_4'] = array(
    391                         'key'   => 'URL',
    392                         'value' => '{url}',
    393                     );
    394331            }
    395332
  • click-to-chat-for-whatsapp/trunk/readme.txt

    r3429029 r3442197  
    44Requires PHP: 5.6
    55Contributors: HoliThemes
    6 Stable tag: 4.35
     6Stable tag: 4.36
    77Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, WooCommerce WhatsApp
    88License: GPLv2 or later
     
    542542== Changelog ==
    543543
     544= 4.36 =
     545* Enhancement: Google Analytics feature.
     546
    544547= 4.35 =
    545548* Enhancement: Custom CSS feature.
     
    562565* Fix: Shortcode style-1 added icon
    563566
    564 = 4.30 =
    565 * Enhancement: Google Analytics feature.
    566 
    567 = 4.29 =
    568 * Settings to load JavaScript files as Normal, Async, or Defer for improved performance.
    569 
    570 = 4.28 =
    571 * Fix: The Custom Element feature now works correctly even when the 'ctc_chat' class is added dynamically.
    572 
    573 = 4.27 =
    574 * app.js file now loads asynchronously and deferred to improve page load performance.
    575 
    576 = 4.26 =
    577 * Custom URL feature is now available in this main plugin. We can add WhatsApp Chanel URL in the plugin settings to open WhatsApp Channel.
    578 * Enhancement: Page level settings design.
    579 
    580 = 4.25 =
    581 * Fix: Greeting dialog modal not displaying correctly due to z-index issues when certain background elements were present.
    582 
    583 = 4.24 =
    584 * Fixed: Page-level settings now work correctly on the WooCommerce Shop page.
    585 * Improved: Better visual styling for the base widget.
    586 
    587 = 4.23 =
    588 🚨 Important Update
    589 * ✨ New Feature: Greetings Dialog can now appear as a modal for better visibility and UX.
    590 * 🛠️ Fix: Resolved an issue where the Greetings Dialog was not displaying correctly when the base widget was positioned at the top.
    591 * 🛠️ Fix: On iPhone Chrome, the Share feature now opens WhatsApp correctly without opening a new tab.
    592 * 🔧 Improvement: When a WhatsApp number is not set, the admin notice is now displayed using a more reliable and secure method — instead of using JS .html().
    593 
    594 = 4.22 =
    595 * The Custom Image widget now automatically uses the image file name as the alt attribute
    596 * Settings to disable page-level settings.
    597 
    598 = 4.21 =
    599 * Fix: Resolved issue where phone numbers with +1888 prefix were not being saved in settings.
    600 
    601 = 4.20 =
    602 * New: Added {{price}} variable for WooCommerce product pages to display price with currency symbol, thousand separator, and decimal separator.
    603 * Fix: Resolved conflict with some themes caused by animation class name.
    604 
    605 = 4.19 =
    606 * Fix: PHP Error. Thanks, Malae, for reporting it!
    607 
    608 = 4.18 =
    609 * Fix: Resolved an issue where the Style-5 profile image was displaying above the greetings dialog on mobile devices.
    610 * Fix: Corrected the border alignment in Style-5.
    611 * Enhancement: Admin Demo for better usability
    612 
    613 = 4.17 =
    614 * Fix: Display Widget as an Add to Cart like button is not working on the WooCommerce single product page, Archive list.
    615 
    616 = 4.16 =
    617 * Added 'Alt' attribute value for greetings header image
    618 * Fix: Style-7, Style-7 Extend hover effects not working.
    619 
    620 = 4.15 =
    621 * Fix: Page-level settings not working properly.
    622 * Fix: Alignment issues at admin setting pages
    623 
    624 = 4.14 =
    625 * Enhancement: Show or hide the admin demo.
    626 
    627 = 4.13 =
    628 * Fix: Alignment issues at admin setting pages
    629 
    630 = 4.12.1 =
    631 * Fix: Hover effects for Style-7 Extend
    632 * Fix: Dual lines issue for Style-8 with large call to action text
    633 
    634 = 4.12 =
    635 * Fix: Custom CSS Code block not allowing quotes at front end
    636 
    637 = 4.11 =
    638 * New: Custom CSS Code block.
    639 
    640 = 4.10 =
    641 * Fix: Page level display settings for WooCommerce single product page
    642 
    643 = 4.9 =
    644 * Fix: Display based on device not working as expected on iPad Pro
    645 
    646567[Changelog](https://holithemes.com/plugins/click-to-chat/changelog/)
Note: See TracChangeset for help on using the changeset viewer.