Changeset 2415019
- Timestamp:
- 11/09/2020 08:35:50 AM (5 years ago)
- Location:
- crm-thrive
- Files:
-
- 30 added
- 5 edited
-
tags/1.7 (added)
-
tags/1.7/admin (added)
-
tags/1.7/admin/class-wsl-admin.php (added)
-
tags/1.7/admin/editor-panel.php (added)
-
tags/1.7/admin/partials (added)
-
tags/1.7/admin/partials/send_to_company_field.php (added)
-
tags/1.7/assets (added)
-
tags/1.7/assets/custom.js (added)
-
tags/1.7/crm-thrive.php (added)
-
tags/1.7/helpers.php (added)
-
tags/1.7/includes (added)
-
tags/1.7/includes/class-wsl-api.php (added)
-
tags/1.7/includes/class-wsl-beaver-api.php (added)
-
tags/1.7/includes/class-wsl-cf7-api.php (added)
-
tags/1.7/includes/class-wsl-divi-api.php (added)
-
tags/1.7/includes/class-wsl-elementor-api.php (added)
-
tags/1.7/includes/class-wsl-gravity-api.php (added)
-
tags/1.7/includes/class-wsl-ninja-api.php (added)
-
tags/1.7/includes/class-wsl-typeform-api.php (added)
-
tags/1.7/includes/class-wsl-wpbrizy-api.php (added)
-
tags/1.7/includes/class-wsl-wpf-api.php (added)
-
tags/1.7/includes/class-wsl-wpff-api.php (added)
-
tags/1.7/includes/helpers.php (added)
-
tags/1.7/includes/wsl-base.php (added)
-
tags/1.7/readme.txt (added)
-
trunk/admin/class-wsl-admin.php (modified) (2 diffs)
-
trunk/assets (added)
-
trunk/assets/custom.js (added)
-
trunk/crm-thrive.php (modified) (4 diffs)
-
trunk/includes/class-wsl-beaver-api.php (added)
-
trunk/includes/class-wsl-divi-api.php (modified) (1 diff)
-
trunk/includes/class-wsl-typeform-api.php (added)
-
trunk/includes/class-wsl-wpbrizy-api.php (added)
-
trunk/includes/helpers.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
crm-thrive/trunk/admin/class-wsl-admin.php
r2328704 r2415019 80 80 'wsl_section' // Section 81 81 ); 82 83 if(in_array('typeform/index.php', apply_filters('active_plugins', get_option('active_plugins')))){ 84 add_settings_field( 85 'typeform_api_key', // ID 86 'TypeForm Access Token', // Title 87 array( $this, 'get_typeform_token' ), // Callback 88 'wsl-setting-admin', // Page 89 'wsl_section' // Section 90 ); 91 } 82 92 } 83 93 … … 124 134 include_once WSL_ADMIN_DIR.'/partials/send_to_company_field.php'; 125 135 } 136 137 public function get_typeform_token(){ 138 printf( 139 '<input type="text" id="typeform_api_key" name="wsl_settings[typeform_api_key]" class="regular-text" value="%s" />', 140 isset( $this->options['typeform_api_key'] ) ? esc_attr( $this->options['typeform_api_key']) : '' 141 ); 142 } 126 143 127 144 } -
crm-thrive/trunk/crm-thrive.php
r2396628 r2415019 5 5 * Plugin URI: https://www.crmthrive.com/ 6 6 * Description: Save the leads to Thrive system generated by various form plugins. We currently support CF7, Ninja Forms, WP Forms, Gravity Forms and Elementor Builder. 7 * Version: 1. 67 * Version: 1.7 8 8 * Author: Thrive 9 9 * Author URI: https://profiles.wordpress.org/crmthrive/ … … 42 42 require_once WSL_INCLUDES_DIR . '/class-wsl-divi-api.php'; 43 43 require_once WSL_INCLUDES_DIR . '/class-wsl-wpff-api.php'; 44 require_once WSL_INCLUDES_DIR . '/class-wsl-wpformidable-api.php'; 45 require_once WSL_INCLUDES_DIR . '/class-wsl-typeform-api.php'; 46 require_once WSL_INCLUDES_DIR . '/class-wsl-beaver-api.php'; 47 require_once WSL_INCLUDES_DIR . '/class-wsl-wpbrizy-api.php'; 44 48 45 49 if(is_admin()){ … … 144 148 145 149 function wsl_divi(){ 146 $laravel_api = new Wsl_Divi_Api($_POST["et_pb_contact_email_fields_0"]); 147 $laravel_api->set_submission_instance($_POST["et_pb_contact_email_fields_0"]); 150 reset($_POST); 151 $key = key($_POST); 152 $counter = substr($key, -1); 153 $laravel_api = new Wsl_Divi_Api($_POST["et_pb_contact_email_fields_".$counter]); 154 $laravel_api->set_submission_instance($_POST["et_pb_contact_email_fields_".$counter]); 148 155 $laravel_api->call(); 149 156 } … … 157 164 $laravel_api->call(); 158 165 } 166 167 add_action("wp_ajax_nopriv_wsl_typeform", "wsl_typeform"); 168 add_action("wp_ajax_wsl_typeform", "wsl_typeform"); 169 170 function wsl_typeform() { 171 $fields = typeform_api($_POST['response_id']); 172 173 $laravel_api = new Wsl_Typeform_Api($fields); 174 $laravel_api->set_submission_instance($fields); 175 $laravel_api->call(); 176 } 177 178 add_action( 'wp_ajax_fl_builder_email', 'wsl_beaver' ); 179 add_action("wp_ajax_nopriv_fl_builder_email", "wsl_beaver"); 180 181 function wsl_beaver(){ 182 $laravel_api = new Wsl_Beaver_Api($_POST); 183 $laravel_api->set_submission_instance($_POST); 184 $laravel_api->call(); 185 } 186 187 add_action( 'wp_ajax_brizy_submit_form', 'wsl_brizy' ); 188 add_action("wp_ajax_nopriv_brizy_submit_form", "wsl_brizy"); 189 190 function wsl_brizy(){ 191 $fields_data = $_POST["data"]; 192 193 $laravel_api = new Wsl_Brizy_Api($fields_data); 194 $laravel_api->set_submission_instance($_POST); 195 $laravel_api->call(); 196 } -
crm-thrive/trunk/includes/class-wsl-divi-api.php
r2396628 r2415019 196 196 break; 197 197 } 198 if(str pos(strtolower($field['label']), 'address') !== false){198 if(strtolower($field['label']) == 'address'){ 199 199 $value['address'] = $field['value']; 200 200 $this->unset_additional_data($field['key']); -
crm-thrive/trunk/includes/helpers.php
r2238078 r2415019 1 1 <?php 2 function is_send_to_crm(){ 3 return wsl_get_setting('send_to_crm'); 4 } 2 5 3 6 function wsl_get_default_cf7_post_settings(){ … … 65 68 } 66 69 70 function typeform_script() { 71 wp_register_script( "my_custom_script", WP_PLUGIN_URL.'/crm-thrive/assets/custom.js', array('jquery') ); 72 wp_localize_script( 'my_custom_script', 'localize', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ))); 73 74 wp_enqueue_script( 'jquery' ); 75 wp_enqueue_script( 'my_custom_script' ); 76 } 77 add_action( 'plugins_loaded', 'typeform_script' ); 78 79 function typeform_api($response_id){ 80 81 $get_settings = wsl_get_settings(); 82 $token = $get_settings["typeform_api_key"]; 83 84 //setup the request, you can also use CURLOPT_URL 85 $ret_form = curl_init('https://api.typeform.com/forms'); 86 sleep(30); 87 curl_setopt($ret_form, CURLOPT_RETURNTRANSFER, true); 88 curl_setopt($ret_form, CURLOPT_HTTPHEADER, array( 89 'Content-Type: application/json', 90 'Authorization: Bearer ' . $token 91 )); 92 $data_form = curl_exec($ret_form); 93 $strip = stripslashes($data_form); 94 $decode_obj = json_decode($strip, true); 95 foreach($decode_obj["items"] as $key=>$v){ 96 $ch = curl_init('https://api.typeform.com/forms/'.$v["id"].'/responses?included_response_ids='.$response_id); 97 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 98 curl_setopt($ch, CURLOPT_HTTPHEADER, array( 99 'Content-Type: application/json', 100 'Authorization: Bearer ' . $token 101 )); 102 103 $data = curl_exec($ch); 104 $strip_data = stripslashes($data); 105 $decode_obj_data = json_decode($strip_data, true); 106 if($decode_obj_data["total_items"] > 0){ 107 $data_items = $decode_obj_data["items"]; 108 return $data_items; 109 }else{ 110 return 'Response: false'; 111 } 112 113 $info = curl_getinfo($ch); 114 curl_close($ch); 115 } 116 117 $info_form = curl_getinfo($ret_form); 118 curl_close($ret_form); 119 } 120 -
crm-thrive/trunk/readme.txt
r2396628 r2415019 4 4 Requires at least: 2.0 5 5 Tested up to: 5.3.2 6 Stable tag: 1. 67 Requires PHP: 5. 2.46 Stable tag: 1.7 7 Requires PHP: 5.5.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 15 Form submissions instantly available in Thrive. We currently support CF7, Ninja Forms, WP Forms, Gravity Forms and Elementor Builder . More coming soon. For more information on features, plans and more check out [crmthrive.com](https://www.crmthrive.com/).15 Form submissions instantly available in Thrive. We currently support CF7, Ninja Forms, WP Forms, Gravity Forms and Elementor Builder, DIVI, Fluent Forms, Beaver Builder, TypeForms, Brizy Builder. More coming soon. For more information on features, plans and more check out [crmthrive.com](https://www.crmthrive.com/). 16 16 17 17 == Installation == … … 49 49 = 1.6 = 50 50 * Added fluent forms support 51 52 = 1.7 = 53 * Added TypeForms support 54 * Added Beaver Builder support 55 * Added Brizy Builder support
Note: See TracChangeset
for help on using the changeset viewer.