Plugin Directory

Changeset 3430425


Ignore:
Timestamp:
01/01/2026 09:48:37 AM (3 months ago)
Author:
itpathsolutions
Message:

V 1.0.1
*Release Date 1 January 2026*

  • New: Added support for form tags along with WPForms fields.
  • Fix: Resolved duplicate entries in the Status column.
  • Fix: Fixed compatibility issue with the CF7 to Any API plugin.
Location:
connect-wpform-to-any-api
Files:
39 added
10 edited

Legend:

Unmodified
Added
Removed
  • connect-wpform-to-any-api/trunk/README.txt

    r3420669 r3430425  
    11=== Connect WPForm to Any API ===
    2 Contributors: itpathsolutions, mayur8991, thakordarshil, wpeople, jaiminp
     2Contributors: itpathsolutions, mayur8991, thakordarshil, wpeople, jaiminp, drashti16
    33Tags: wpform to api, wpform. api, contact form, crm, lead
    44Requires at least: 6.0
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    9393== Changelog ==
    9494
     95= 1.0.1 =
     96
     97*Release Date 1 January 2026*
     98
     99* New: Added support for form tags along with WPForms fields.
     100* Fix: Resolved duplicate entries in the Status column.
     101* Fix: Fixed compatibility issue with the CF7 to Any API plugin.
     102
    95103= 1.0.0 =
    96104
  • connect-wpform-to-any-api/trunk/admin/class-wpform-to-any-api-admin.php

    r3420669 r3430425  
    141141        add_submenu_page(
    142142            'wpform_api',
    143             __('Logs', 'connect-wpform-to-any-api'),
    144             __('Logs', 'connect-wpform-to-any-api'),
     143            __('API Logs', 'connect-wpform-to-any-api'),
     144            __('API Logs', 'connect-wpform-to-any-api'),
    145145            'manage_options',
    146146            'wpformapi_logs',
     
    183183        // --- Add the TOP-LEVEL menu item with a float position ---
    184184        add_menu_page(
    185             'WPForm to API',
     185            'All API Integrations',
    186186            'WPForm to API',
    187187            'manage_options',
     
    197197        add_submenu_page(
    198198            $parent_slug,
    199             'Add New API Form',
    200             'Add New WPForm API',
     199            'Add New Integration',
     200            'Add New Integration',
    201201            'manage_options',
    202202            'post-new.php?post_type=wpform_api'
     
    226226
    227227        $labels = array(
    228             'name' => _x('WPForm to Any API', 'plural', 'connect-wpform-to-any-api'),
    229             'singular_name' => _x('WPForm to api', 'singular', 'connect-wpform-to-any-api'),
     228            'name' => _x('WPForm to API', 'plural', 'connect-wpform-to-any-api'),
     229            'singular_name' => _x('WPForm to API', 'singular', 'connect-wpform-to-any-api'),
    230230            'menu_name' => _x('WPForm to API', 'admin menu', 'connect-wpform-to-any-api'),
    231231            'name_admin_bar' => _x('WPForm to API', 'admin bar', 'connect-wpform-to-any-api'),
    232             'add_new' => _x('Add New WPForm API', 'add new', 'connect-wpform-to-any-api'),
    233             'add_new_item' => __('Add New WPForm API', 'connect-wpform-to-any-api'),
    234             'new_item' => __('New WPForm API', 'connect-wpform-to-any-api'),
    235             'edit_item' => __('Edit WPForm to Any API', 'connect-wpform-to-any-api'),
    236             'view_item' => __('View WPForm to Any API', 'connect-wpform-to-any-api'),
    237             'all_items' => __('All WPForm API', 'connect-wpform-to-any-api'),
    238             'not_found' => __('No WPForm API found.', 'connect-wpform-to-any-api'),
     232            'add_new' => _x('Add New Integration', 'add new', 'connect-wpform-to-any-api'),
     233            'add_new_item' => __('Add New Integration', 'connect-wpform-to-any-api'),
     234            'new_item' => __('New Integration', 'connect-wpform-to-any-api'),
     235            'edit_item' => __('Edit Integration', 'connect-wpform-to-any-api'),
     236            'view_item' => __('View Integration', 'connect-wpform-to-any-api'),
     237            'all_items' => __('All API Integrations', 'connect-wpform-to-any-api'),
     238            'not_found' => __('No API Integrations found.', 'connect-wpform-to-any-api'),
    239239            'register_meta_box_cb' => 'aps_metabox',
    240240        );
     
    304304                    $response = update_post_meta( $post_id , $options_key, $options_value );
    305305                }
     306               
    306307                if($response){
    307308                    $status = 'true';
     
    436437            'title' => __('Title', 'connect-wpform-to-any-api'),
    437438            'wpform' => __('Form Name','connect-wpform-to-any-api'),
    438             'wpform_status' => __('Status','connect-wpform-to-any-api'),   
    439439            'date' => __('Date','connect-wpform-to-any-api'),
    440440        );
     
    480480    public static function wpformapi_send_data_to_api($fields, $entry, $form_data, $entry_id){
    481481        global $wpdb;
     482
     483        $form_title = $form_data['settings']['form_title'];
    482484        $wpfromapi_uploads_dir = trailingslashit( wp_upload_dir()['basedir'] ) . 'wpform-api-uploads';
    483485        $form_id = (int)stripslashes($form_data['id']);
     
    502504                    'compare' => '=',
    503505                ),
    504             ),
     506            )
    505507        );
     508
     509        $current_post_id = !empty($entry['post_id']) ? $entry['post_id'] : 0;
     510        // $post_id = $form_data['id']; // Keep for form_id reference
    506511       
    507512        $the_query = new WP_Query($args);
     
    524529
    525530                }
    526                
     531            // Handle wpform special tags dynamically
     532                $predefined_tags = [
     533                    '_user_ip'          => isset($_SERVER['REMOTE_ADDR']) ? sanitize_text_field($_SERVER['REMOTE_ADDR']) : '',
     534                    '_date'             => date_i18n(get_option('date_format')),
     535                    '_time'             => date_i18n(get_option('time_format')),
     536                    '_submitted_date_time' => date_i18n(get_option('date_format')). ' ' .date_i18n(get_option('time_format')),
     537                    '_site_url'         => home_url(),
     538                    '_form_id'          => $form_id,
     539                    '_form_name'        => $form_title,
     540                    '_submission_source_url' => $current_post_id ? esc_url(get_permalink($current_post_id)) : '',
     541                    '_post_id'          => $current_post_id,
     542                    '_post_slug'        => $current_post_id ? basename(get_permalink($current_post_id)) : '',
     543                    '_post_title'       => $current_post_id ? get_the_title($current_post_id) : '',
     544                ];
     545               
     546                // Predefined tags mapping
     547                foreach ( $wpformapi_form_field as $key => $value ) {
     548                    if ( isset( $predefined_tags[$key] ) ) {
     549                        $api_post_array[$value] = $predefined_tags[$key];
     550                    }
     551                }
     552                // print_r($api_post_array);exit();
    527553                self::wpformapi_send_data_to_lead($api_post_array, $wpformapi_base_url, $wpformapi_input_type, $wpformapi_method, $form_id, get_the_ID(), $wpformapi_header_request, $posted_data);
    528554            }
     
    719745     *
    720746     * An Enable/Disable toggle switch in the "wpformstoanyapi_status" column.
    721      * The associated Contact Form 7 form link in the "wpformstoanyapi_form" column.
    722747     * */
    723748    public function wpformstoanyapi_posts_custom_column ($column, $post_id ){
     
    733758                  </label>';
    734759                break;
    735             case 'wpformstoanyapi_form':
    736                 $form_name = get_post_meta($post_id,'wpformstoanyapi_selected_form',true);
    737                 if($form_name){
    738                     echo '<a href="' . esc_url( site_url() . '/wp-admin/admin.php?page=wpcf7&post=' . $form_name . '&action=edit' ) . '" target="_blank">' . esc_html( get_the_title( $form_name ) ) . '</a>';
    739                 }
    740                 break;
    741760         }
    742761    }
  • connect-wpform-to-any-api/trunk/admin/css/wpform-to-any-api-admin.css

    r3420669 r3430425  
    113113
    114114
    115 /*CF7 Entries CSS*/
    116 .cf7_to_any_api_page_wpformapi_entries #wpwrap{
     115/*WPForms Entries CSS*/
     116.wpforms_to_any_api_page_wpformapi_entries #wpwrap{
    117117    background-color: #F0F0F1 !important;
    118118}
    119 .cf7toanyapi_entries{
     119.wpformstoanyapi_entries{
    120120    margin-top: 40px;
    121121}
    122 .cf7toanyapi_select_form{
     122.wpformstoanyapi_select_form{
    123123    margin-right: 40px !important;
    124124    font-weight: 600;
     
    127127    vertical-align: middle;
    128128}
    129 .cf7toanyapi_forms{
     129.wpformstoanyapi_forms{
    130130    background-color: #fff !important;
    131131    background-image: none !important;
     
    142142    width: 200px !important;
    143143}
    144 .cf_entries .buttons-csv, .cf_entries .buttons-excel, .cf_entries .buttons-pdf, .cf_entries .buttons-print, .cf7toanyapi-btn-delete{
     144.wpforms_entries .buttons-csv, .wpforms_entries .buttons-excel, .wpforms_entries .buttons-pdf, .wpforms_entries .buttons-print, .wpformstoanyapi-btn-delete{
    145145    border: 1px solid #0073aa;
    146146    background-color: #0073aa !important;
     
    152152    cursor: pointer;
    153153}
    154 .cf_entries .dataTables_length, .cf_entries .dataTables_info{
     154.wpforms_entries .dataTables_length, .wpforms_entries .dataTables_info{
    155155    display: inline-block;
    156156    margin: 15px;
    157157    padding: 0 !important;
    158158}
    159 .cf_entries .dataTables_length label{
     159.wpforms_entries .dataTables_length label{
    160160    word-spacing: 5px;
    161161}
    162 .cf_entries .dataTables_filter, .cf_entries .dataTables_paginate{
     162.wpforms_entries .dataTables_filter, .wpforms_entries .dataTables_paginate{
    163163    display: flex;
    164164    float: right;
    165165    margin: 15px !important;
    166166}
    167 .cf_entries .cf7toanyapi_table{
     167.wpforms_entries .wpformstoanyapi_table{
    168168    border: 1px solid #c3c4c7;
    169169    background: #fff;
     
    172172    overflow-x: scroll;
    173173}
    174 .cf_entries .cf7toanyapi_table thead{
     174.wpforms_entries .wpformstoanyapi_table thead{
    175175    border: 1px solid #c3c4c7 !important;
    176176}
    177 .cf_entries .cf7toanyapi_table tr, .cf_entries .cf7toanyapi_table th, .cf_entries .cf7toanyapi_table td{font-size: 15px;}
    178 
    179 .cf7toanyapi_table_wrap {display: flex; align-items: center;}
    180 .cf7toanyapi_table_wrap .dt-buttons{width: 80%;}
    181 .cf7toanyapi_table_wrap .dataTables_length, .cf7toanyapi_table_wrap .cf7toanyapi_table_filter{width: 10%;}
     177.wpforms_entries .wpformstoanyapi_table tr, .wpforms_entries .wpformstoanyapi_table th, .wpforms_entries .wpformstoanyapi_table td{font-size: 15px;}
     178
     179.wpformstoanyapi_table_wrap {display: flex; align-items: center;}
     180.wpformstoanyapi_table_wrap .dt-buttons{width: 80%;}
     181.wpformstoanyapi_table_wrap .dataTables_length, .wpformstoanyapi_table_wrap .wpformstoanyapi_table_filter{width: 10%;}
    182182
    183183.wpformapi-bottom-image {
     
    208208.dataTables_info .select-info{display: none;}
    209209/* Admin Css Improved -by drashti */
     210
     211.wpformapi_wrap .button.button-white {
     212    background: #fff;
     213    color: #189b9b;
     214    border-color: #189b9b;
     215    padding: 2px 15px;
     216    font-size: 14px;
     217    line-height: 30px;
     218}
     219
    210220.wpformapi_log_button{
    211221    display: inline;
     
    271281    padding: 0 20px;
    272282}
    273 .cf7anyapi-json-preview-modal h2 {
     283.wpforms-json-preview-modal h2 {
    274284    font-weight: 600 !important;
    275285    padding: 0 0 15px !important;
     
    278288}
    279289/*json preview*/
    280 .cf7anyapi-form-mapping-header {
     290.wpforms-form-mapping-header {
    281291display: flex
    282292;
     
    289299}
    290300
    291 .cf7anyapi-form-mapping-header span {
     301.wpforms-form-mapping-header span {
    292302    cursor: pointer;
    293303    font-size: 15px;
     
    297307    border-radius: 4px;
    298308}
    299 .cf7anyapi-json-preview-modal {
     309.wpforms-json-preview-modal {
    300310    display: none;
    301311    position: fixed;
     
    309319}
    310320
    311 .cf7anyapi-json-preview-modal-content {
     321.wpforms-json-preview-modal-content {
    312322    background: #fff;
    313323    padding: 20px 25px;
     
    322332    scrollbar-width: none;
    323333}
    324 .cf7anyapi-json-preview-close {
     334.wpforms-json-preview-close {
    325335    position: absolute;
    326336    top: 12px;
     
    332342    transition: color 0.2s ease-in-out;
    333343}
    334 .cf7anyapi-json-preview-close:hover {
     344.wpforms-json-preview-close:hover {
    335345    color: #e63946;
    336346}
    337 #jsonPreviewOutput {
     347#jsonPreviewOutputWpform {
    338348    background: rgb(24 155 155 / 5%);
    339349    padding: 15px;
     
    345355    border: 1px solid #ddd;
    346356}
    347 #jsonPreviewOutput pre {
     357#jsonPreviewOutputWpform pre {
    348358    background: #fff !important;
    349359    padding: 15px !important;
     
    359369}
    360370
    361 .cf7anyapi-json-preview-modal {
     371.wpforms-json-preview-modal {
    362372    display: none;
    363373    position: fixed;
     
    371381}
    372382
    373 .cf7anyapi-json-preview-modal-content {
     383.wpforms-json-preview-modal-content {
    374384    background: #fff;
    375385    padding: 20px 25px;
     
    495505}
    496506.wpformapi_tooltip::after {
    497   content: attr(data-cf7apitooltip);
     507  content: attr(data-wpformsapitooltip);
    498508  visibility: hidden;
    499509  opacity: 0;
     
    761771/*CF7 Entries CSS*/
    762772
    763 /* CF7 documentation CSS */
    764 .wpform_api_page_wpformapi_docs .contact_us {
     773/* WPForms documentation CSS */
     774.wpform-to-api_page_wpformapi_docs .contact_us {
    765775    margin: 12px;
    766776}
     
    768778    background-color: #2271b1 !important;
    769779}  */
    770 .wpform_api_page_wpformapi_docs .cf7anyapi_doc, .wpform_api_page_wpformapi_docs .cf7anyapi_doc p{
     780.wpform-to-api_page_wpformapi_docs .wpforms_doc, .wpform-to-api_page_wpformapi_docs .wpforms_doc p{
    771781    /*    font-size: 17px;*/
    772782        font-size:14px;
    773783}
    774 .wpform_api_page_wpformapi_docs .cf7anyapi_doc{
     784.wpform-to-api_page_wpformapi_docs .wpforms_doc{
    775785    padding: 40px;
    776786}
    777 .wpform_api_page_wpformapi_docs .row{
     787.wpform-to-api_page_wpformapi_docs .row{
    778788    margin-top: 25px;
    779789    border: 1px solid #ccc;
    780790}
    781 .wpform_api_page_wpformapi_docs .column-tab-nav.tab{
     791.wpform-to-api_page_wpformapi_docs .column-tab-nav.tab{
    782792    border: 1px solid #e0e0e0;
    783793    padding: 0px;
     
    787797    background-color: #ddd;
    788798  } */
    789 .wpform_api_page_wpformapi_docs .col-7.tab{
     799.wpform-to-api_page_wpformapi_docs .col-7.tab{
    790800    border: 1px solid #ccc;
    791801    padding: 20px;
    792802}
    793 .wpform_api_page_wpformapi_docs .col-3.image{
     803.wpform-to-api_page_wpformapi_docs .col-3.image{
    794804    padding-left: inherit;
    795805    padding-right: inherit;
    796806}
    797 .wpform_api_page_wpformapi_docs .contact_us.contact_image{
     807.wpform-to-api_page_wpformapi_docs .contact_us.contact_image{
    798808    margin: 0px;
    799809}
    800 .wpform_api_page_wpformapi_docs .contact_us.contact_image {
     810.wpform-to-api_page_wpformapi_docs .contact_us.contact_image {
    801811    width: 100%;
    802812}
    803813
    804814
    805 .wpform_api_page_wpformapi_docs .cf7anyapi_full_width pre { margin:15px 15px; }
    806 .wpform_api_page_wpformapi_docs .cf7anyapi_full_width ol li{margin-bottom:15px;  }
    807 
    808 .cf7-any-api-modal {
     815.wpform-to-api_page_wpformapi_docs .wpforms_full_width pre { margin:15px 15px; }
     816.wpform-to-api_page_wpformapi_docs .wpforms_full_width ol li{margin-bottom:15px;  }
     817
     818.wpforms-any-api-modal {
    809819    position: fixed;
    810820    height: 100%;
     
    816826    background: rgba(0,0,0,.8);
    817827}
    818 .cf7-any-api-modal .cf7-any-api-modal-dialog {
     828.wpforms-any-api-modal .wpforms-any-api-modal-dialog {
    819829    background: transparent;
    820830    position: absolute;
     
    825835    transform: translate(-50%, -50%);
    826836}
    827 .cf7-any-api-modal .cf7-any-api-modal-header {
     837.wpforms-any-api-modal .wpforms-any-api-modal-header {
    828838    border-bottom: #eee solid 1px;
    829839    background: #fbfbfb;
     
    832842    margin-bottom: -10px;
    833843}
    834 .cf7-any-api-modal .cf7-any-api-modal-body, .cf7-any-api-modal .cf7-any-api-modal-footer {
     844.wpforms-any-api-modal .wpforms-any-api-modal-body, .wpforms-any-api-modal .wpforms-any-api-modal-footer {
    835845    border: 0;
    836846    background: #fefefe;
    837847    padding: 20px;
    838848}
    839 .cf7-any-api-modal input[type="radio"]:checked ~ textarea {
     849.wpforms-any-api-modal input[type="radio"]:checked ~ textarea {
    840850    display: block;
    841851    width: 100%;
     
    844854    height: 100px;
    845855}
    846 /* .cf7-any-api-modal .reason textarea{
     856/* .wpforms-any-api-modal .reason textarea{
    847857    display: none;
    848858} */
    849 .cf7-any-api-modal .cf7-any-api-modal-header h4 {
     859.wpforms-any-api-modal .wpforms-any-api-modal-header h4 {
    850860    margin: 0;
    851861    padding: 0;
     
    858868    -webkit-font-smoothing: antialiased;
    859869}
    860 .cf7-any-api-modal h3 {
     870.wpforms-any-api-modal h3 {
    861871    margin-top: 0;
    862872    font-size: 15px;
     
    865875    color: #515962;
    866876}
    867 .cf7-any-api-modal h3 strong {
     877.wpforms-any-api-modal h3 strong {
    868878    font-weight: 700;
    869879}
    870 .cf7-any-api-modal-footer {
     880.wpforms-any-api-modal-footer {
    871881    border-top: #eee solid 1px !important;
    872882    text-align: right;
    873883}
    874 .cf7-any-api-modal .reason input[type="email"] {
     884.wpforms-any-api-modal .reason input[type="email"] {
    875885    margin-top: 8px;
    876886    width: 100%;
    877887}
    878 ul#cf7-any-api-list li{
     888ul#wpforms-any-api-list li{
    879889    margin-bottom: 10px;
    880890}
    881 ul#cf7-any-api-list li label span {
     891ul#wpforms-any-api-list li label span {
    882892    font-size: 13px;
    883893    color: #515962;
    884894}
    885 ul#cf7-any-api-list li.reason.email span {
     895ul#wpforms-any-api-list li.reason.email span {
    886896    font-weight: 700;
    887897    margin-right: 32px;
    888898}
    889 ul#cf7-any-api-list li.reason.email {
     899ul#wpforms-any-api-list li.reason.email {
    890900    margin-top: 20px;
    891901}
    892 ul#cf7-any-api-list {
     902ul#wpforms-any-api-list {
    893903    margin-bottom: 13px;
    894904}
     
    944954    border-radius: 5px;
    945955}
    946 .cf7anyapi_doc .nav.nav-pills .nav-link {
     956.wpforms_doc .nav.nav-pills .nav-link {
    947957    color: #007cba;
    948958    background-color: transparent;
     
    958968    box-shadow: inset 5px 0 0 0 transparent;
    959969}
    960 .cf7anyapi_doc .nav.nav-pills .nav-link:hover{
     970.wpforms_doc .nav.nav-pills .nav-link:hover{
    961971    background-color: #f6f7f7;
    962972}
    963 .cf7anyapi_doc .nav.nav-pills .nav-link:focus {
     973.wpforms_doc .nav.nav-pills .nav-link:focus {
    964974    box-shadow: none;
    965975}
    966976
    967 .cf7anyapi_doc .nav.nav-pills .nav-link.active {
     977.wpforms_doc .nav.nav-pills .nav-link.active {
    968978    box-shadow: inset 5px 0 0 0 #007cba;
    969979    transition: box-shadow .1s linear;
  • connect-wpform-to-any-api/trunk/admin/js/wpform-to-any-api-admin.js

    r3420669 r3430425  
    3131    $(document).ready(function(){
    3232
     33        jQuery('#wpformapi_predefined_tag_select option:disabled').prop('disabled', false);
    3334        // On click of Next button, trigger the main Update/Publish button
    3435        $(document).on('click', '#wpformapi_submit', function(e) {
     
    7576
    7677        // additional js for improved design - by drashti
     78
     79
     80        // Add predefined tag
     81        jQuery('#wpformapi_add_predefined_tag').on('click', function(){
     82            var tag = jQuery('#wpformapi_predefined_tag_select').val();
     83            if(tag && jQuery('#wpformapi-form-fields').find('[data-tag="'+tag+'"]').length === 0){
     84                var cleanLabel = tag.replace(/^_/, '').replace(/_/g, ' ');
     85                var html = '<div class="wpformapi_field" data-tag="'+tag+'">' +
     86                   '<label for="wpformapi_'+tag+'">'+tag+'</label>' +
     87                   '<input type="text" ' +
     88                       'id="wpformapi_'+tag+'" ' +
     89                       'name="wpformapi_form_field['+tag+']" ' +
     90                       'data-basetype="textarea" ' +
     91                       'placeholder="Enter your API mapping key">' +
     92                   '<button type="button" class="button wpformapi_remove_predefined_tag"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 511.76 511.76" style="enable-background:new 0 0 512 512" xml:space="preserve" class=""><g><path d="M436.896 74.869c-99.84-99.819-262.208-99.819-362.048 0-99.797 99.819-99.797 262.229 0 362.048 49.92 49.899 115.477 74.837 181.035 74.837s131.093-24.939 181.013-74.837c99.819-99.818 99.819-262.229 0-362.048zm-75.435 256.448c8.341 8.341 8.341 21.824 0 30.165a21.275 21.275 0 0 1-15.083 6.251 21.277 21.277 0 0 1-15.083-6.251l-75.413-75.435-75.392 75.413a21.348 21.348 0 0 1-15.083 6.251 21.277 21.277 0 0 1-15.083-6.251c-8.341-8.341-8.341-21.845 0-30.165l75.392-75.413-75.413-75.413c-8.341-8.341-8.341-21.845 0-30.165 8.32-8.341 21.824-8.341 30.165 0l75.413 75.413 75.413-75.413c8.341-8.341 21.824-8.341 30.165 0 8.341 8.32 8.341 21.824 0 30.165l-75.413 75.413 75.415 75.435z" fill="#189b9b" opacity="1" data-original="#189b9b" class=""></path></g></svg> Remove</button>' +
     93               '</div>'
     94               
     95                if( jQuery('#wpformapi-form-fields').text().trim() === 'No Fields Found for Selected Form.' || jQuery('#wpformapi-form-fields').text().trim() === 'Select Your Contact Form'){
     96                    jQuery('#wpformapi-form-fields').empty();
     97                }
     98                let lastField = jQuery('#wpformapi-form-fields .wpformapi_field:last');
     99
     100                if (lastField.length) {
     101                    jQuery(html).insertAfter(lastField);
     102                } else {
     103                    jQuery('#wpformapi-form-fields').append(html);
     104                }
     105
     106                jQuery('#wpformapi_predefined_tag_select option[value="'+tag+'"]').prop('disabled', true);
     107            }
     108        });
     109
     110        // Remove predefined tag
     111        jQuery(document).on('click', '.wpformapi_remove_predefined_tag', function(){
     112            var tag = jQuery(this).parent('.wpformapi_field').data('tag');
     113            jQuery(this).closest('.wpformapi_field').remove();
     114            jQuery('#wpformapi_predefined_tag_select option[value="'+tag+'"]').prop('disabled', false);
     115            if(jQuery('#wpformapi-form-fields').text().trim() == ''){
     116                jQuery('#wpformapi-form-fields').append("No Fields Found for Selected Form.");
     117            }
     118        });
     119
     120        // Disable options on page load if tag already exists
     121        jQuery('#wpformapi-form-fields .wpformapi_field').each(function(){
     122            var tag = jQuery(this).data('tag');
     123            if(tag){
     124                jQuery('#wpformapi_predefined_tag_select option[value="'+tag+'"]').prop('disabled', true);
     125            }
     126        });
     127
     128
     129
     130
    77131             //json Preview Model
    78             var modal =jQuery('#jsonPreviewModal');
    79             jQuery('#jsonPreviewBtn').on('click', function(){
     132            var modal =jQuery('#jsonPreviewModalWpform');
     133            jQuery('#jsonPreviewBtnWpform').on('click', function(){
    80134                console.log('clicked');
    81                 jQuery('#jsonPreviewOutput').html('');
     135                jQuery('#jsonPreviewOutputWpform').html('');
    82136                var apiUrl = jQuery('#wpformapi_base_url').val() || '';
    83137                var method = jQuery('#wpformapi_method').val() || '';
     
    104158                `;
    105159
    106                 jQuery('#jsonPreviewOutput').html(html);
     160                jQuery('#jsonPreviewOutputWpform').html(html);
    107161                modal.show();
    108162            });
    109             jQuery('.cf7anyapi-json-preview-close').on('click', function(){
     163            jQuery('.wpforms-json-preview-close').on('click', function(){
    110164                modal.hide();
    111165            });
  • connect-wpform-to-any-api/trunk/admin/partials/wpform-to-any-api-admin-display-docs.php

    r3276754 r3430425  
    1 <!-- CF7 to any API Documentatiom -->
     1<!-- WPForms to any API Documentation -->
    22<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" >
    33<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js"></script>
    4 <div class="cf7anyapi_doc">
     4<div class="wpforms_doc">
    55    <h3><?php esc_html_e( 'WP Form To Any API Documentation', 'connect-wpform-to-any-api' ); ?></h3>   
    66    <div class="row">
     
    1111        <a class="nav-link tab-index-3" id="v-pills-logs-tab" data-toggle="pill" href="#v-pills-logs" role="tab" aria-controls="v-pills-logs" aria-selected="false"><div class="tab-index"></div><?php esc_html_e( 'Logs', 'connect-wpform-to-any-api' ); ?></a>
    1212        <a class="nav-link tab-index-4" id="v-pills-json-format-tab" data-toggle="pill" href="#v-pills-json-format" role="tab" aria-controls="v-pills-json-format" aria-selected="false"><div class="tab-index"></div><?php esc_html_e( 'Supported JSON Format', 'connect-wpform-to-any-api' ); ?></a>
    13         <a class="nav-link tab-index-5" id="v-pills-contact-us-tab" data-toggle="pill" href="#v-pills-contact-us" role="tab" aria-controls="v-pills-contact-us" aria-selected="false"><div class="tab-index"></div><?php esc_html_e( 'Contact Us', 'connect-wpform-to-any-api' ); ?></a>
    14         <a class="nav-link tab-index-6" id="v-pills-other-plugins-tab" data-toggle="pill" href="#v-pills-other-plugins" role="tab" aria-controls="v-pills-other-plugins" aria-selected="false"><div class="tab-index"></div><?php esc_html_e( 'Our Other Plugins', 'connect-wpform-to-any-api' ); ?></a>
     13        <a class="nav-link tab-index-5" id="v-pills-pre-defined-tags-tab" data-toggle="pill" href="#v-pills-pre-defined-tags" role="tab" aria-controls="v-pills-pre-defined-tags" aria-selected="false">
     14            <div class="tab-index"></div>
     15            <?php esc_html_e( 'Pre Defined Tags', 'connect-wpform-to-any-api' ); ?>
     16        </a>
     17        <a class="nav-link tab-index-6" id="v-pills-contact-us-tab" data-toggle="pill" href="#v-pills-contact-us" role="tab" aria-controls="v-pills-contact-us" aria-selected="false"><div class="tab-index"></div><?php esc_html_e( 'Contact Us', 'connect-wpform-to-any-api' ); ?></a>
     18        <a class="nav-link tab-index-7" id="v-pills-other-plugins-tab" data-toggle="pill" href="#v-pills-other-plugins" role="tab" aria-controls="v-pills-other-plugins" aria-selected="false"><div class="tab-index"></div><?php esc_html_e( 'Our Other Plugins', 'connect-wpform-to-any-api' ); ?></a>
     19       
    1520        </div>
    1621    </div>
     
    1823        <div class="tab-content" id="v-pills-tabContent">
    1924        <!-- cf7 API -->
    20         <div class="tab-pane fade show active cf7anyapi_full_width" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">
     25        <div class="tab-pane fade show active wpforms_full_width" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">
    2126            <h5 class="tab-title"><?php esc_html_e( 'Guide to Adding a New WP Form API Integration', 'connect-wpform-to-any-api' ); ?></h5>
    2227
     
    117122        </div>
    118123        <!-- Logs -->
    119         <div class="tab-pane fade cf7anyapi_full_width" id="v-pills-logs" role="tabpanel" aria-labelledby="v-pills-logs-tab">
     124        <div class="tab-pane fade wpforms_full_width" id="v-pills-logs" role="tabpanel" aria-labelledby="v-pills-logs-tab">
    120125        <h5 class="tab-title"><?php esc_html_e( 'Logs', 'connect-wpform-to-any-api' ); ?></h5>
    121126            <ol>
     
    130135
    131136        <!-- Supported JSON Format -->
    132         <div class="tab-pane fade cf7anyapi_full_width" id="v-pills-json-format" role="tabpanel" aria-labelledby="v-pills-json-format-tab">
     137        <div class="tab-pane fade wpforms_full_width" id="v-pills-json-format" role="tabpanel" aria-labelledby="v-pills-json-format-tab">
    133138        <h5 class="tab-title"><?php esc_html_e( 'Supported JSON format', 'connect-wpform-to-any-api' ); ?></h5>
    134139            <ol>
     
    145150                    </li>
    146151
    147                     <li><?php echo wp_kses(__( '<b>Nested JSON Format Required Plugin Customization! </b><a href="https://www.contactformtoapi.com/#contact_us" class="cf7_to_any_api_doc_link" target="_blank"><strong>Connect Us For Paid Customization Service</strong></a>', 'connect-wpform-to-any-api' ), array('b' => array(), 'a' => array('href' => array(), 'class' => array(), 'target' => array() ), 'strong' => array() ) ); ?></br>
     152                    <li><?php echo wp_kses(__( '<b>Nested JSON Format Required Plugin Customization! </b><a href="https://www.contactformtoapi.com/#contact_us" class="wpforms_to_any_api_doc_link" target="_blank"><strong>Connect Us For Paid Customization Service</strong></a>', 'connect-wpform-to-any-api' ), array('b' => array(), 'a' => array('href' => array(), 'class' => array(), 'target' => array() ), 'strong' => array() ) ); ?></br>
    148153            <pre>
    149154  {
     
    164169        <!-- CF7 Hidden field -->
    165170       
     171        <!-- Pre Defined Tags -->
     172        <div class="tab-pane fade cf7anyapi_full_width" id="v-pills-pre-defined-tags" role="tabpanel" aria-labelledby="v-pills-pre-defined-tags">
     173            <h5 class="tab-title"><?php esc_html_e( 'Available Predefined Tags', 'connect-wpform-to-any-api' ); ?></h5>
     174            <br>
     175            <p>
     176                <?php esc_html_e( 'These predefined tags can be used directly in your JSON payload. When the form is submitted, their values are automatically replaced with dynamic data (e.g., user IP, page URL, submission date, etc.). This ensures real-time data is passed without manual input.', 'connect-wpform-to-any-api' ); ?>
     177            </p>
     178            <ul>
     179                <li><strong><?php esc_html_e( '[_user_ip]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'Captures the visitor\'s IP address at the time of form submission.', 'connect-wpform-to-any-api' ); ?></li>
     180                <li><strong><?php esc_html_e( '[_date]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'Displays the submission date (based on your WordPress Settings → General → Date Format).', 'connect-wpform-to-any-api' ); ?></li>
     181                <li><strong><?php esc_html_e( '[_time]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'Displays the submission time (based on your WordPress Settings → General → Time Format).', 'connect-wpform-to-any-api' ); ?></li>
     182                <li><strong><?php esc_html_e( '[_submitted_date_time]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'Displays both date and time of submission (follows your WordPress Date & Time Settings).', 'connect-wpform-to-any-api' ); ?></li>
     183                <li><strong><?php esc_html_e( '[_site_url]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The home URL of your website.', 'connect-wpform-to-any-api' ); ?></li>
     184                <li><strong><?php esc_html_e( '[_submission_source_url]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The URL of the page where the form was submitted.', 'connect-wpform-to-any-api' ); ?></li>
     185                <li><strong><?php esc_html_e( '[_post_id]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The ID of the current post or page where the form is placed.', 'connect-wpform-to-any-api' ); ?></li>
     186                <li><strong><?php esc_html_e( '[_post_slug]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The slug (URL-friendly name) of the current post or page.', 'connect-wpform-to-any-api' ); ?></li>
     187                <li><strong><?php esc_html_e( '[_post_title]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The title of the current post or page where the form is located.', 'connect-wpform-to-any-api' ); ?></li>
     188                <li><strong><?php esc_html_e( '[_form_id]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The unique ID of the Wpform.', 'connect-wpform-to-any-api' ); ?></li>
     189                <li><strong><?php esc_html_e( '[_form_name]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The name/title of the Wpform.', 'connect-wpform-to-any-api' ); ?></li>
     190                <li><strong><?php esc_html_e( '[_http_referer]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The previous page URL that referred the user to the form page.', 'connect-wpform-to-any-api' ); ?></li>
     191                <li><strong><?php esc_html_e( '[_browser_info]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'Captures the user’s browser and operating system information (User Agent).', 'connect-wpform-to-any-api' ); ?></li>
     192                <li><strong><?php esc_html_e( '[_server_name]', 'connect-wpform-to-any-api' ); ?></strong> – <?php esc_html_e( 'The server hostname where your WordPress website is hosted.', 'connect-wpform-to-any-api' ); ?></li>
     193            </ul>
     194        </div>
     195
    166196        <!-- video tutorial -->
    167         <div class="tab-pane fade cf7anyapi_full_width" id="v-pills-video" role="tabpanel" aria-labelledby="v-pills-video-tab">
     197        <div class="tab-pane fade wpforms_full_width" id="v-pills-video" role="tabpanel" aria-labelledby="v-pills-video-tab">
    168198            <h5 class="tab-title"><?php esc_html_e( 'WP Form to any API Video Tutorial', 'connect-wpform-to-any-api' ); ?></h5>
    169199            <div class="iframe-wrap embed-responsive embed-responsive-16by9">
    170                 <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/1K-JdXwDH_k" title="<?php esc_attr_e( 'YouTube video player', 'connect-wpform-to-any-api' ); ?>" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
     200                <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/5mlvMXaWDC8?si=voIIWfAYnfGH0T1o" title="<?php esc_attr_e( 'YouTube video player', 'connect-wpform-to-any-api' ); ?>" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
    171201            </div>
    172202        </div>
     
    175205       
    176206         <!-- contact us -->
    177          <div class="tab-pane fade cf7anyapi_full_width" id="v-pills-contact-us" role="tabpanel" aria-labelledby="v-pills-contact-us-tab">
     207         <div class="tab-pane fade wpforms_full_width" id="v-pills-contact-us" role="tabpanel" aria-labelledby="v-pills-contact-us-tab">
    178208            <h5 class="tab-title"><?php esc_html_e( 'Contact Us', 'connect-wpform-to-any-api' ); ?></h5><br>
    179209           <h5><?php echo wp_kses(__( 'Email : <a href="mailto:support@contactformtoapi.com">support@contactformtoapi.com</a>', 'connect-wpform-to-any-api' ), array('a' => array('href' => array() ) ) ); ?></h5>
     
    182212
    183213        <!-- other plugins -->
    184         <div class="tab-pane fade cf7anyapi_full_width" id="v-pills-other-plugins" role="tabpanel" aria-labelledby="v-pills-other-plugins-tab">
     214        <div class="tab-pane fade wpforms_full_width" id="v-pills-other-plugins" role="tabpanel" aria-labelledby="v-pills-other-plugins-tab">
    185215            <h5 class="tab-title"><?php esc_html_e( 'Our Other Plugins', 'connect-wpform-to-any-api' ); ?></h5><br>
    186216
  • connect-wpform-to-any-api/trunk/admin/partials/wpform-to-any-api-admin-display.php

    r3420669 r3430425  
    1818$wpformapi_options = $wpformapi_object->wpform_to_any_api_get_options();
    1919
    20 
    2120$selected_form          = (empty($wpformapi_options['wpformapi_selected_form']) ? '' : $wpformapi_options['wpformapi_selected_form']);
    2221$wpformapi_base_url     = (empty($wpformapi_options['wpformapi_base_url']) ? '' : $wpformapi_options['wpformapi_base_url']);
     
    2524$wpformapi_form_field   = (empty($wpformapi_options['wpformapi_form_field']) ? '' : $wpformapi_options['wpformapi_form_field']);
    2625$wpformapi_header_request = (empty($wpformapi_options['wpformapi_header_request']) ? '' : $wpformapi_options['wpformapi_header_request']);
     26
     27$predefined_tags = $wpformapi_object->get_predefined_tags();
     28$predefined_keys = array_keys( $predefined_tags );
    2729
    2830if(!class_exists('WPForms')){   ?>
     
    6264            <li><a href="javascript:;"><?php esc_html_e( 'Map Form Fields', 'connect-wpform-to-any-api' ); ?></a></li>
    6365        </ul>
    64         <a href="javascript:;" class="button button-primary json-preview" id="jsonPreviewBtn"><?php esc_html_e( 'Show API Payload', 'connect-wpform-to-any-api' ); ?></a>
     66        <a href="javascript:;" class="button button-primary json-preview" id="jsonPreviewBtnWpform"><?php esc_html_e( 'Show API Payload', 'connect-wpform-to-any-api' ); ?></a>
    6567    </div>
    6668    <!-- Step 1: API Setup -->
     
    6971        <div class="wpformapi_field">
    7072            <label for="wpformapi_base_url"><?php esc_html_e( 'API Endpoint URL', 'connect-wpform-to-any-api' ); ?>
    71                 <div class="wpformapi_tooltip" data-cf7apitooltip="<?php esc_html_e( 'Provide the URL where requests will be sent', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div>
     73                <div class="wpformapi_tooltip" data-wpformsapitooltip="<?php esc_html_e( 'Provide the URL where requests will be sent', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div>
    7274            </label>
    7375            <input type="text" id="wpformapi_base_url" name="wpformapi_base_url" value="<?php echo esc_url($wpformapi_base_url); ?>" placeholder="<?php esc_attr_e( 'API Endpoint URL', 'connect-wpform-to-any-api' ); ?>" required>
     
    7678            <div class="wpformapi_full_width">
    7779                <label for="wpformapi_header_request"><?php esc_html_e( 'Request Headers', 'connect-wpform-to-any-api' ); ?>
    78                 <div class="wpformapi_tooltip" data-cf7apitooltip="<?php esc_html_e( 'Custom headers to send with the API request.', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div><span class="sample_header"><?php esc_html_e( 'Add sample header', 'connect-wpform-to-any-api' ); ?></span>
     80                <div class="wpformapi_tooltip" data-wpformsapitooltip="<?php esc_html_e( 'Custom headers to send with the API request.', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div><span class="sample_header"><?php esc_html_e( 'Add sample header', 'connect-wpform-to-any-api' ); ?></span>
    7981            </label>
    8082                <textarea id="wpformapi_header_request" data-sample="<?php esc_attr_e( 'Authorization: Bearer YOUR_API_KEY
     
    8991            <div class="wpformapi_field">
    9092                <label for="wpformapi_input_type"><?php esc_html_e( 'Request Body Type', 'connect-wpform-to-any-api' ); ?>
    91                 <div class="wpformapi_tooltip" data-cf7apitooltip="<?php esc_html_e( 'Choose how your form data is sent to the API.', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div>
     93                <div class="wpformapi_tooltip" data-wpformsapitooltip="<?php esc_html_e( 'Choose how your form data is sent to the API.', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div>
    9294            </label>
    9395                <select id="wpformapi_input_type" name="wpformapi_input_type" required>
     
    98100            <div class="wpformapi_field">
    99101                <label for="wpformapi_method"><?php esc_html_e( 'Request Method', 'connect-wpform-to-any-api' ); ?>
    100                 <div class="wpformapi_tooltip" data-cf7apitooltip="<?php esc_html_e( 'Select the action for sending your form data.', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div>
     102                <div class="wpformapi_tooltip" data-wpformsapitooltip="<?php esc_html_e( 'Select the action for sending your form data.', 'connect-wpform-to-any-api' ); ?>"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg></div>
    101103            </label>
    102104                <select id="wpformapi_method" name="wpformapi_method" required>
     
    119121            <div class="wpformapi_field">
    120122                <label for="wpformapi_selected_form"><?php esc_html_e( 'Select WPForm', 'connect-wpform-to-any-api' ); ?>
    121                     <div class="wpformapi_tooltip" data-cf7apitooltip="<?php esc_html_e( 'Choose which WPForm should send data.', 'connect-wpform-to-any-api' ); ?>">
     123                    <div class="wpformapi_tooltip" data-wpformsapitooltip="<?php esc_html_e( 'Choose which WPForm should send data.', 'connect-wpform-to-any-api' ); ?>">
    122124                        <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg>
    123125                    </div>
     
    145147                    <label style="font-size: 16px; font-weight: 500; text-transform: capitalize;">
    146148                        <?php esc_html_e( 'Map Form Fields to API Keys', 'connect-wpform-to-any-api' ); ?>
    147                         <div class="wpformapi_tooltip" data-cf7apitooltip="<?php esc_html_e( 'Match your form fields with the API’s fields.', 'connect-wpform-to-any-api' ); ?>">
     149                        <div class="wpformapi_tooltip" data-wpformsapitooltip="<?php esc_html_e( 'Match your form fields with the API’s fields.', 'connect-wpform-to-any-api' ); ?>">
    148150                            <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg>
    149151                        </div>
     
    159161                    <?php
    160162                    if($wpformapi_form_field){
     163                       
    161164                        foreach($wpformapi_form_field as $key => $wpform_field_value){
    162                             ?>
    163                             <div class="wpformapi_field">
    164                                 <label for="wpformapi_<?php echo esc_html($key); ?>"><?php echo esc_html($wpform_field_value['label']); ?> </label>
    165                                 <input type="text" id="wpformapi_<?php echo esc_html($key); ?>" name="wpformapi_form_field[<?php echo esc_html($key); ?>]" value="<?php echo esc_html($wpform_field_value['value']); ?>" placeholder="<?php esc_attr_e('Enter your API mapping key', 'connect-wpform-to-any-api'); ?>" >
     165                            $is_predefined = in_array($key, $predefined_keys, true);
     166
     167                            // Ensure $wpform_field_value is an array with label/value
     168                            if (!is_array($wpform_field_value)) {
     169                                $wpform_field_value = [
     170                                    'label' => is_numeric($key) ? 'Field ' . $key : $key,
     171                                    'value' => $wpform_field_value
     172                                ];
     173                            }
     174                         ?>
     175                            <div class="wpformapi_field" <?php echo $is_predefined ? 'data-tag="' . esc_attr($key) . '"' : ''; ?>>
     176                                <label for="wpform_<?php echo esc_attr($key); ?>"><?php echo esc_html($wpform_field_value['label']); ?></label>
     177                                <input type="text" id="wpform_<?php echo esc_attr($key); ?>" name="wpformapi_form_field[<?php echo esc_attr($key); ?>]" value="<?php echo esc_html($wpform_field_value['value']); ?>" placeholder="<?php esc_attr_e('Enter your API mapping key', 'connect-wpform-to-any-api'); ?>" >
     178                               <?php if ($is_predefined) : ?>
     179                                        <button type="button" class="button wpformapi_remove_predefined_tag">
     180                                            <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 511.76 511.76" style="enable-background:new 0 0 512 512" xml:space="preserve" class=""><g><path d="M436.896 74.869c-99.84-99.819-262.208-99.819-362.048 0-99.797 99.819-99.797 262.229 0 362.048 49.92 49.899 115.477 74.837 181.035 74.837s131.093-24.939 181.013-74.837c99.819-99.818 99.819-262.229 0-362.048zm-75.435 256.448c8.341 8.341 8.341 21.824 0 30.165a21.275 21.275 0 0 1-15.083 6.251 21.277 21.277 0 0 1-15.083-6.251l-75.413-75.435-75.392 75.413a21.348 21.348 0 0 1-15.083 6.251 21.277 21.277 0 0 1-15.083-6.251c-8.341-8.341-8.341-21.845 0-30.165l75.392-75.413-75.413-75.413c-8.341-8.341-8.341-21.845 0-30.165 8.32-8.341 21.824-8.341 30.165 0l75.413 75.413 75.413-75.413c8.341-8.341 21.824-8.341 30.165 0 8.341 8.32 8.341 21.824 0 30.165l-75.413 75.413 75.415 75.435z" fill="#189b9b" opacity="1" data-original="#189b9b" class=""></path></g></svg>
     181                                            <?php echo esc_html__('Remove', 'connect-wpform-to-any-api'); ?>
     182                                        </button>
     183                                    <?php endif; ?>
    166184                            </div>
    167                             <?php
     185                        <?php
    168186                        }
    169187                    } else {
     
    174192            </div>
    175193        </div>
     194
     195        <!-- Predefined Tags Functionality -->
     196            <div class="wpformapi_col2">
     197                <div class="wpformapi_field">
     198                    <label class="wpformapi_title" for="wpformapi_predefined_tags" ><?php echo esc_html__( 'Built-in form fields', 'connect-wpform-to-any-api' ); ?>
     199                        <div class="wpformapi_tooltip" data-wpformapitooltip="<?php esc_html_e( 'Use default tags to automatically include dynamic data (like time, date, post title, user IP etc) when sending information to your API. No hidden fields needed!', 'connect-wpform-to-any-api' ); ?>">
     200                            <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 20 20" xml:space="preserve" class=""><g><path d="M10 1a8.987 8.987 0 0 0-7.921 13.257l-1.037 3.455A1 1 0 0 0 2 19a1.019 1.019 0 0 0 .288-.042l3.455-1.037A9 9 0 1 0 10 1zm0 4a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm1 10h-1a1 1 0 0 1-1-1v-4a1 1 0 0 1 0-2h1a1 1 0 0 1 1 1v4a1 1 0 0 1 0 2z" fill="#189b9b" opacity="1" data-original="#000000" class=""></path></g></svg>
     201                        </div>
     202                    </label>
     203                    <div class="wpformapi_dynamic_tags">
     204                        <select id="wpformapi_predefined_tag_select">
     205                            <option value=""><?php echo esc_html__( '--Select Tag--', 'connect-wpform-to-any-api' ); ?></option>
     206                            <?php           
     207                            foreach ( $predefined_tags as $tag_key => $tag_label ) {?>
     208                                <option value="<?php echo esc_attr( $tag_key ); ?>">
     209                                    <?php echo esc_html( $tag_label ); ?>
     210                                </option>
     211                            <?php } ?>
     212                        </select>
     213                        <button type="button" id="wpformapi_add_predefined_tag" class="button button-white"><?php echo esc_html__( 'Add Tag', 'connect-wpform-to-any-api' ); ?></button>
     214                    </div>
     215                </div>
     216            </div>
     217   
     218
    176219        <div class="bottom-button">
    177220            <button type="button" id="wpformapi_prev_btn" class="button button-white" style="margin-top:20px;">&larr; <?php echo esc_html__( 'Previous', 'connect-wpform-to-any-api' ); ?></button>
     
    180223    </div>
    181224
     225   
    182226         <!-- Popup Modal For the JSON-->
    183         <div id="jsonPreviewModal" class="cf7anyapi-json-preview-modal" style="display: none;">
    184             <div class="cf7anyapi-json-preview-modal-content">
    185                 <span class="cf7anyapi-json-preview-close">&times;</span>
     227        <div id="jsonPreviewModalWpform" class="wpforms-json-preview-modal" style="display: none;">
     228            <div class="wpforms-json-preview-modal-content">
     229                <span class="wpforms-json-preview-close">&times;</span>
    186230                <h2><?php echo esc_html__( 'Preview API Request', 'connect-wpform-to-any-api' ); ?></h2>
    187                 <div id="jsonPreviewOutput"></div>
     231                <div id="jsonPreviewOutputWpform"></div>
    188232               
    189233            </div>
     
    192236       
    193237
    194     <!-- <div class="cf7anyapi_loader" style="display: none;">
     238    <!-- <div class="anyapi_loader" style="display: none;">
    195239        <img class="" src="<?php echo esc_url( plugin_dir_url( __DIR__ ) . 'images/loader.gif' ); ?>" alt="loader" >
    196240    </div> -->
  • connect-wpform-to-any-api/trunk/includes/class-wpform-to-any-api-log-table.php

    r3420669 r3430425  
    230230        if ( $which === 'top' ) {
    231231            $selected_form = isset($_GET['wpform_filter']) ? absint($_GET['wpform_filter']) : '';
    232             $cf7_forms = get_posts( array(
     232            $wp_forms = get_posts( array(
    233233                'post_type'      => 'wpforms',
    234234                'posts_per_page' => -1,
     
    240240                <select name="wpform_filter" id="wpform_filter">
    241241                    <option value=""><?php esc_html_e( 'All Forms', 'connect-wpform-to-any-api' ); ?></option>
    242                     <?php foreach ( $cf7_forms as $form ) : ?>
     242                    <?php foreach ( $wp_forms as $form ) : ?>
    243243                        <option value="<?php echo esc_attr( $form->ID ); ?>" <?php selected( $selected_form, $form->ID ); ?>>
    244244                            <?php echo esc_html( $form->post_title ); ?>
  • connect-wpform-to-any-api/trunk/includes/class-wpform-to-any-api.php

    r3420669 r3430425  
    273273                }
    274274            }
     275
     276            // Add Predefined Tags (if available)
     277            if ( method_exists( $this, 'get_predefined_tags' ) ) {
     278                $predefined_tags = array_keys( $this->get_predefined_tags() );
     279                foreach ( $predefined_tags as $tag_key ) {
     280                   
     281                    if ( isset( $options['wpformapi_form_field'][ $tag_key ] ) ) {
     282                        // print_r($tag_key);
     283                        $form_fields_list[ $tag_key ] = $options['wpformapi_form_field'][ $tag_key ];
     284                    }
     285                }
     286            }
    275287            $options['wpformapi_form_field'] = $form_fields_list;
     288            // print_r($options['wpformapi_form_field'] );
    276289        }
    277290        return $options;
     
    326339    }
    327340
     341    /**
     342     * Get all predefined tags with labels.
     343     * @since     2.0.1
     344     * @return array
     345     */
     346    public static function get_predefined_tags() {
     347        return array(
     348            '_user_ip'                => __( 'User IP', 'connect-wpform-to-any-api' ),
     349            '_date'                   => __( 'Date', 'connect-wpform-to-any-api' ),
     350            '_time'                   => __( 'Time', 'connect-wpform-to-any-api' ),
     351            '_submitted_date_time'    => __( 'Submitted Date & Time', 'connect-wpform-to-any-api' ),
     352            '_site_url'               => __( 'Site URL', 'connect-wpform-to-any-api' ),
     353            '_submission_source_url'  => __( 'Submission Source URL', 'connect-wpform-to-any-api' ),
     354            '_post_id'                => __( 'Post ID', 'connect-wpform-to-any-api' ),
     355            '_post_slug'              => __( 'Post Slug', 'connect-wpform-to-any-api' ),
     356            '_post_title'             => __( 'Post Title', 'connect-wpform-to-any-api' ),
     357            '_form_id'                => __( 'Form ID', 'connect-wpform-to-any-api' ),
     358            '_form_name'              => __( 'Form Name', 'connect-wpform-to-any-api' ),
     359            '_http_referer'           => __( 'HTTP Referer', 'connect-wpform-to-any-api' ),
     360            '_browser_info'           => __( 'Browser Info', 'connect-wpform-to-any-api' ),
     361            '_server_name'            => __( 'Server Name', 'connect-wpform-to-any-api' ),
     362        );
     363    }
     364
     365
    328366}
  • connect-wpform-to-any-api/trunk/wpform-to-any-api.php

    r3420669 r3430425  
    1717 * Plugin URI:        https://wordpress.org/plugins/connect-wpform-to-any-api
    1818 * Description:       Send WPForms Lead/Data to Any CRM or Third Party APIs
    19  * Version:           1.0.0
     19 * Version:           1.0.1
    2020 * Author:            IT Path Solutions
    2121 * Author URI:        https://www.itpathsolutions.com/
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define( 'WPFORM_TO_ANY_API_VERSION', '1.0.0' );
     38define( 'WPFORM_TO_ANY_API_VERSION', '1.0.1' );
    3939
    4040/**
Note: See TracChangeset for help on using the changeset viewer.