Changeset 3037812
- Timestamp:
- 02/19/2024 10:25:59 AM (6 months ago)
- Location:
- contact-form-to-any-api
- Files:
-
- 43 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
contact-form-to-any-api/trunk/README.txt
r3016044 r3037812 1 1 === Contact Form to Any API === 2 Contributors: itpathsolutions,mayur8991,pateljaymin, vickymakwana11113 Tags: rest api, api, contact form, crm, lead, pro, export, contact form 72 Contributors: itpathsolutions,mayur8991,pateljaymin, 3 Tags: rest api, api, contact form, crm, lead, pro, export, contact form 7 4 4 Requires at least: 6.0 5 5 Tested up to: 6.4 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 87 Stable tag: 1.1. 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 35 35 * Multi File Upload Support <strong><a href="https://www.contactformtoapi.com/pricing/" target="_blank">(PRO)</a></strong> 36 36 * Compatible with Multiline files upload for contact form 7 Plugin <strong><a href="https://www.contactformtoapi.com/pricing/" target="_blank">(PRO)</a></strong> 37 38 37 39 * Save CF7 Entries Directly on Google Sheet <strong><a href="https://www.contactformtoapi.com/pricing/" target="_blank">(Coming Soon with PRO)</a></strong> 38 40 * Paid Plugin customization support based on Requirment <strong><a href="https://www.contactformtoapi.com/#contact_us" target="_blank">(Contact us)</a></strong> … … 64 66 * Compatible with Multiline files upload for contact form 7 Plugin 65 67 * Choose when to send data to API 68 69 66 70 * Paid plugin customization support 67 71 * Paid oauth 2.0 API Integration support … … 84 88 * Bats CRM 85 89 * FRS Labs API 90 91 92 86 93 * And many more 87 94 … … 156 163 157 164 == Changelog == 165 166 167 168 158 169 159 170 = 1.1.8 = -
contact-form-to-any-api/trunk/admin/class-cf7-to-any-api-admin.php
r3016044 r3037812 112 112 if(is_multisite()){ 113 113 if(!is_plugin_active_for_network('contact-form-7/wp-contact-form-7.php')){ 114 echo '<div class="notice notice-warning is-dismissible"> 115 <p>'.__( 'Contact form 7 API integrations requires CONTACT FORM 7 Plugin to be installed and active', 'contact-form-to-any-api' ).'</p> 116 </div>'; 114 115 echo '<div class="notice notice-warning is-dismissible"><p>'.esc_html__( 'Contact form 7 API integrations requires CONTACT FORM 7 Plugin to be installed and active', 'contact-form-to-any-api' ).'</p></div>'; 117 116 } 118 117 }else{ 119 if(!is_plugin_active('contact-form-7/wp-contact-form-7.php')){ 120 echo '<div class="notice notice-warning is-dismissible"> 121 <p>'.__( 'Contact form 7 API integrations requires CONTACT FORM 7 Plugin to be installed and active', 'contact-form-to-any-api' ).'</p> 122 </div>'; 118 if(!is_plugin_active('contact-form-7/wp-contact-form-7.php')){ 119 echo '<div class="notice notice-warning is-dismissible"> 120 <p>' . esc_html__( 'Contact form 7 API integrations requires CONTACT FORM 7 Plugin to be installed and active', 'contact-form-to-any-api' ) . '</p> 121 </div>'; 122 123 123 } 124 124 } … … 204 204 $form_name = get_post_meta($post_id,'cf7anyapi_selected_form',true); 205 205 if($form_name){ 206 echo '<a href="'.site_url()."/wp-admin/admin.php?page=wpcf7&post=".$form_name."&action=edit".'" target="_blank">'.get_the_title($form_name).'</a>'; 206 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>'; 207 207 208 } 208 209 … … 313 314 314 315 $options['cf7anyapi_selected_form'] = (int)stripslashes($_POST['cf7anyapi_selected_form']); 315 $options['cf7anyapi_base_url'] = sanitize_url($_POST['cf7anyapi_base_url']);316 $options['cf7anyapi_base_url'] = _url($_POST['cf7anyapi_base_url']); 316 317 if(isset($_POST['cf7anyapi_basic_auth'])){ 317 318 $options['cf7anyapi_basic_auth'] = sanitize_text_field($_POST['cf7anyapi_basic_auth']); … … 408 409 } 409 410 410 if($wpdb->get_var(sprintf("SHOW TABLES LIKE '%s%s'", $wpdb->prefix, 'cf _entries')) != $wpdb->prefix . 'cf_entries'){411 if($wpdb->get_var(sprintf("SHOW TABLES LIKE '%s%s'", $wpdb->prefix, 'cf_entries'){ 411 412 $charset_collate = $wpdb->get_charset_collate(); 412 413 $table_name2 = $wpdb->prefix.'cf7anyapi_entries'; … … 516 517 foreach($cf7anyapi_form_field as $key => $value){ 517 518 518 // if you would like to check if the submitted data is numeric or not519 520 // if(is_numeric($posted_data[$key]) && !is_array($posted_data[$key])){521 // $api_post_array[$value] = (int)sanitize_text_field($posted_data[$key]);522 // }523 // else{524 // $api_post_array[$value] = (is_array($posted_data[$key]) ? implode(',', self::Cf7_To_Any_Api_sanitize_array($posted_data[$key])) : sanitize_text_field($posted_data[$key]));525 // }526 527 //Submitted data as string only528 519 $api_post_array[$value] = (is_array($posted_data[$key]) ? implode(',', self::Cf7_To_Any_Api_sanitize_array($posted_data[$key])) : sanitize_text_field($posted_data[$key])); 529 520 … … 696 687 $wpdb->insert($table,$data); 697 688 } 689 698 690 public static function delete_cf7_records(){ 699 global $wpdb; 700 // Get user input from the HTTP request 701 $record_id = $_POST['id']; 702 // Use prepare() to create a prepared statement 703 $table_entries = $wpdb->prefix.'cf7anyapi_entries'; 704 $table = $wpdb->prefix.'cf7anyapi_entry_id'; 705 if ( !empty($record_id) && ( isset($_POST['cf_to_any_api_entrie_del_nonce']) && wp_verify_nonce($_POST['cf_to_any_api_entrie_del_nonce'],'cf_to_any_api_entrie_del_nonce') ) ) { 706 // Use $wpdb->prepare() to safely insert user input into the query 707 $query_entries = $wpdb->prepare("DELETE FROM $table_entries WHERE data_id IN ($record_id)", $record_id); 708 $query_id = $wpdb->prepare("DELETE FROM $table WHERE id IN ($record_id)", $record_id); 709 // Execute the prepared statements 710 $result_entries = $wpdb->query($query_entries); 711 $result_id = $wpdb->query($query_id); 691 692 if ( !empty($_POST['id']) && ( isset($_POST['nonce']) && wp_verify_nonce($_POST['nonce'],'cf_to_any_api_entrie_del_nonce') ) ) { 693 global $wpdb; 694 $record_id = isset($_POST['id']) ? $_POST['id'] : array(); 695 $placeholders = implode(',', array_fill(0, count($record_id), '%d')); 696 697 $table_entries = $wpdb->prefix.'cf7anyapi_entries'; 698 $table = $wpdb->prefix.'cf7anyapi_entry_id'; 699 700 $result_entries = $wpdb->query($wpdb->prepare("DELETE FROM $table_entries WHERE data_id IN ($placeholders)", $record_id)); 701 $result_id = $wpdb->query($wpdb->prepare("DELETE FROM $table WHERE id IN ($placeholders)", $record_id)); 712 702 if ($record_id !== false) { 713 703 echo json_encode(array('status' => 1, 'Message' => 'Success')); 714 704 }else { 715 echo json_encode(array('status' => -1, 'Message' => 'Failed'));705 echo json_encode(array('status' => -1, 'Message' => 'Failed')); 716 706 } 717 707 }else { 718 708 echo json_encode(array('status' => -1, 'Message' => 'Invalid')); 719 709 } 720 721 710 exit(); 722 711 } 712 723 713 public function _cf7_api_deactivation_feedback_popup(){ 724 714 $screen = get_current_screen(); -
contact-form-to-any-api/trunk/admin/js/cf7-to-any-api-admin.js
r3016044 r3037812 57 57 58 58 $('.cf7anyapi_bulk_log_delete').on('click',function(){ 59 60 61 62 63 64 59 65 60 var cf_to_any_api_log_del_nonce = jQuery(".cf7_to_any_api_page_cf7anyapi_logs #cf_to_any_api_log_del_nonce").val(); 61 var data = { 62 'action': 'cf7_to_any_api_bulk_log_delete', 63 'cf_to_any_api_log_del_nonce' : cf_to_any_api_log_del_nonce, 64 }; 65 66 var cf7anyapi_response = cf7anyapi_ajax_request(data); 67 cf7anyapi_response.done(function(result){ 68 window.location.reload(); 69 }); 66 var cf7anyapi_response = cf7anyapi_ajax_request(data); 67 cf7anyapi_response.done(function(result){ 68 window.location.reload(); 69 }); 70 } 70 71 }); 71 72 … … 114 115 className: 'cf7toanyapi-btn-delete', 115 116 action: function(){ 116 var array= [];117 var = []; 117 118 jQuery('.cf7toanyapi_dataid.selected').each(function(i){ 118 array.push($(this).attr('data-id'));119 .push($(this).attr('data-id')); 119 120 }); 120 121 //console.log(array); 121 var cf_to_any_api_entrie_del_nonce = jQuery('#cf_to_any_api_entrie_del_nonce').val();122 let data_ids = array.toString();122 var nonce = jQuery('#cf_to_any_api_entrie_del_nonce').val(); 123 let data_ids = array.toString(); 123 124 if(confirm("Are you Sure you want to delete selected records?") == true) 124 125 { … … 130 131 data:{ 131 132 action : 'delete_records', 132 cf_to_any_api_entrie_del_nonce : cf_to_any_api_entrie_del_nonce,133 nonce, 133 134 id : data_ids, 134 135 }, -
contact-form-to-any-api/trunk/admin/partials/cf7-to-any-api-admin-display-docs.php
r2986529 r3037812 38 38 </code> 39 39 <p><b><?php esc_html_e( 'Authorization having Username & Password with Base64 ?', 'contact-form-to-any-api' ); ?></br> 40 <?php printf(esc_html__( 'to convert online %1$sclick here%2$s and put it on header ', 'contact-form-to-any-api' ),'<a href="https://www.base64encode.net/" target="_blank">','</a>'); ?></b></p> 40 41 <?php __( 'To convert online <a href="https://www.base64encode.net/" target="_blank"> click here </a> and put it in the header.', 'contact-form-to-any-api' ); ?></b></p> 41 42 <b><?php esc_html_e( 'Example', 'contact-form-to-any-api' ); ?></b><code> 42 43 <pre> … … 62 63 <h5><?php esc_html_e( 'Logs', 'contact-form-to-any-api' ); ?></h5> 63 64 <ol> 64 <li><?php printf(esc_html__( 'After submitting data you can see your data in %1$sLogs%2$s tab.', 'contact-form-to-any-api' ),'<b>','</b>'); ?></li>65 <li><?php ); ?></li> 65 66 <li><?php esc_html_e( 'You can see your API logs and its data which is submitted by user', 'contact-form-to-any-api' ); ?></li> 66 <li><?php printf(esc_html__( 'You can see your %1$sAPI response too%2$s.', 'contact-form-to-any-api' ),'<b>','</b>'); ?></li>67 <li><?php '); ?></li> 67 68 <?php esc_html_e( 'Ex. ', 'contact-form-to-any-api' ); ?><img src="<?php echo plugins_url().'/contact-form-to-any-api/admin/images/logs.png';?>" alt="" style="height:100%; width:100%;"> 68 69 </ol> … … 74 75 <ol> 75 76 <li><?php esc_html_e( 'Select the form and its data will display.', 'contact-form-to-any-api' ); ?></li> 76 <li><?php printf(esc_html__( 'You can download your data in %1$sCSV%2$s, %1$sExcel%2$s, %1$sPDF%2$s and also you can %1$sPrint%2$s your data.', 'contact-form-to-any-api' ),'<b>','</b>'); ?></li>77 <li><?php ); ?></li> 77 78 <?php esc_html_e( 'Ex. ', 'contact-form-to-any-api' ); ?><img src="<?php echo plugins_url().'/contact-form-to-any-api/admin/images/entries.png';?>" alt="" style="height:100%; width:100%;"> 78 79 </ol> … … 97 98 </li> 98 99 99 <li><?php printf(esc_html__( '%1$sUnsupported JSON Format:%2$s Required %3$s%4$sPro Version%5$s%6$s', 'contact-form-to-any-api' ),'<b>','</b>','<a href="https://www.contactformtoapi.com/pricing/#pricing" class="cf7_to_any_api_doc_link" target="_blank">','<strong>','</strong>','</a>'); ?></br>100 <li><?php ); ?></br> 100 101 <code> 101 102 <pre> … … 112 113 </code> 113 114 114 <h5><?php printf(esc_html__( '%1$sYour API has Unsupported format of json ?? Don\'t worry our development team can customize our plugin as per your need%2$s %3$sClick here to contact us%4$s', 'contact-form-to-any-api' ),'<b>','</b>','<a target="_blank" href="https://www.itpathsolutions.com/contact-us/">','</a>'); ?></h5>115 <h5><?php ); ?></h5> 115 116 </li> 116 117 </ol> … … 168 169 <div class="tab-pane fade cf7anyapi_full_width" id="v-pills-contact-us" role="tabpanel" aria-labelledby="v-pills-contact-us-tab"> 169 170 <h5><?php esc_html_e( 'Contact Us', 'contact-form-to-any-api' ); ?></h5><br> 170 <h5><?php printf(esc_html__( 'Email : %1$ssupport@contactformtoapi.com%2$s', 'contact-form-to-any-api' ),'<a href="mailto:support@contactformtoapi.com">','</a>'); ?></h5>171 <p><?php printf(esc_html__( 'Need Help with Plugin Integration ? %1$sClick to Connect us%2$s', 'contact-form-to-any-api' ),'<a target="_blank" href="https://www.contactformtoapi.com/#contact_us">','</a>'); ?></p>171 <h5><?php ); ?></h5> 172 <p><?php ); ?></p> 172 173 </div> 173 174 </div> -
contact-form-to-any-api/trunk/admin/partials/cf7-to-any-api-admin-entries.php
r3016044 r3037812 71 71 ?> 72 72 <div id="table_data"> 73 <!-- <input type="submit" class="btn-delete cf7toanyapi_btn_delete" value="Delete"> -->74 73 <table class="tbl table table-striped table-bordered cf7toanyapi_table" id="cf7toanyapi_table"> 75 <?php 74 <?php echo wp_nonce_field('cf_to_any_api_entrie_del_nonce','cf_to_any_api_entrie_del_nonce' ); ?> 76 75 <thead> 77 76 <tr class="cf7toanyapi_dataid_all"> -
contact-form-to-any-api/trunk/cf7-to-any-api.php
r3016044 r3037812 17 17 * Plugin URI: https://wordpress.org/plugins/contact-form-to-any-api/ 18 18 * Description: Send CF7 Lead/Data to CRM or Any REST API. 19 * Version: 1.1. 820 * Author: IT Path Solutions PVT LTD19 * Version: 1.1. 20 * Author: IT Path Solutions 21 21 * Author URI: https://www.itpathsolutions.com/ 22 22 * License: GPL-2.0+ … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'CF7_TO_ANY_API_VERSION', '1.1. 8' );38 define( 'CF7_TO_ANY_API_VERSION', '1.1.' ); 39 39 40 40 define( 'CF7_CURL_DOMAIN', 'https://www.contactformtoapi.com' ); -
contact-form-to-any-api/trunk/includes/class-cf7-to-any-api-activator.php
r2901022 r3037812 34 34 if(!is_plugin_active_for_network('contact-form-7/wp-contact-form-7.php')){ 35 35 deactivate_plugins(plugin_basename( __FILE__)); 36 wp_die( __( 'Please activate '.' <a href="' . esc_url('https://wordpress.org/plugins/contact-form-7/').'" target="_blank">Contact Form 7.</a>', 'contact-form-to-any-api' ), 'Plugin dependency check', array( 'back_link' => true ) );36 wp_die( __( 'Please activate" target="_blank">Contact Form 7.</a>', 'contact-form-to-any-api' ), 'Plugin dependency check', array( 'back_link' => true ) ); 37 37 } 38 38 }else{ 39 39 if(!in_array( 'contact-form-7/wp-contact-form-7.php', apply_filters( 'active_plugins', get_option('active_plugins')))){ 40 40 deactivate_plugins(plugin_basename( __FILE__)); 41 wp_die( __( 'Please activate '.' <a href="' . esc_url('https://wordpress.org/plugins/contact-form-7/').'" target="_blank">Contact Form 7.</a>', 'contact-form-to-any-api' ), 'Plugin dependency check', array( 'back_link' => true ) );41 wp_die( __( 'Please activate" target="_blank">Contact Form 7.</a>', 'contact-form-to-any-api' ), 'Plugin dependency check', array( 'back_link' => true ) ); 42 42 } 43 43 }
Note: See TracChangeset
for help on using the changeset viewer.