Plugin Directory

Changeset 2408325


Ignore:
Timestamp:
10/28/2020 02:12:31 PM (5 years ago)
Author:
kylerboudreau
Message:

Fixed Contact Form 7 submission problem.

Location:
follow-hook/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • follow-hook/trunk/follow-hook.php

    r2318605 r2408325  
    44Plugin URI: https://followhook.com/
    55Description: A custom CRM plugin developed by Kyler Boudreau and Ian Lincicome.
    6 Version: 1.2.1
    7 Author: Kyler Boudreau and Ian Lincicome of Follow Hook 
     6Version: 1.2.2
     7Author: Kyler Boudreau and Ian Lincicome of Follow Hook
    88Author URI: https://followhook.com
    99License:     GPL2
     
    1313the Free Software Foundation, either version 2 of the License, or
    1414any later version.
    15  
     15
    1616Follow Hook is distributed in the hope that it will be useful,
    1717but WITHOUT ANY WARRANTY; without even the implied warranty of
    1818MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    1919GNU General Public License for more details.
    20  
     20
    2121You should have received a copy of the GNU General Public License
    2222along with Follow Hook. If not, see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
     
    152152function Follow_Hook_addJSscripts() {
    153153    $cdir = plugin_dir_url(__FILE__);
    154     wp_enqueue_script('date-js-code', $cdir.'js/js-date-functions.js'); 
     154    wp_enqueue_script('date-js-code', $cdir.'js/js-date-functions.js');
    155155}//end Follow_Hook_addJSscripts PHP function
    156156
     
    174174    if(is_a( $post, 'WP_Post') && has_shortcode($post->post_content, 'manage_communication_preferences')) {
    175175        $cdir = plugin_dir_url(__FILE__);
    176         wp_enqueue_style('fh_mcp_style', $cdir.'css/opt-in-opt-out.css');   
    177     }
    178 }//End Follow_Hook_add_manage_communication_preferences_style function 
     176        wp_enqueue_style('fh_mcp_style', $cdir.'css/opt-in-opt-out.css');
     177    }
     178}//End Follow_Hook_add_manage_communication_preferences_style function
    179179add_action('wp_enqueue_scripts', 'Follow_Hook_add_manage_communication_preferences_style');
    180180
     
    186186    if($currents =='people' && $currenta == 'edit'){
    187187        $cdir = plugin_dir_url(__FILE__);
    188         wp_enqueue_script('cal-js-code', $cdir.'js/calendar-code.js'); 
     188        wp_enqueue_script('cal-js-code', $cdir.'js/calendar-code.js');
    189189    }
    190190}
     
    195195    if ($page !== 'toplevel_page_follow_hook_settings') return;
    196196    $cdir = plugin_dir_url(__FILE__);
    197     wp_enqueue_script('cal-js-code', $cdir.'js/calendar-code.js'); 
     197    wp_enqueue_script('cal-js-code', $cdir.'js/calendar-code.js');
    198198}//end Follow_Hook_add_JS_to_calendar_for_dash function
    199199
     
    228228    if(is_a( $post, 'WP_Post') && has_shortcode($post->post_content, 'manage_communication_preferences')) {
    229229        $cdir = plugin_dir_url(__FILE__);
    230         wp_enqueue_script('fh_mcp_js', $cdir.'js/opt-out.js'); 
    231     }
    232 }//End Follow_Hook_add_manage_communication_preferences_js function 
     230        wp_enqueue_script('fh_mcp_js', $cdir.'js/opt-out.js');
     231    }
     232}//End Follow_Hook_add_manage_communication_preferences_js function
    233233add_action('wp_enqueue_scripts', 'Follow_Hook_add_manage_communication_preferences_js');
    234234
     
    261261    wp_enqueue_script('jquery-ui-datepicker');
    262262    wp_register_style('jquery-ui', $cdir.'css/jquery-ui.css');
    263     wp_enqueue_style('jquery-ui'); 
     263    wp_enqueue_style('jquery-ui');
    264264//Here I added css for span into buttons for campaign admin pages:
    265265wp_enqueue_style('button_span', $cdir.'css/span_buttons.css');
     
    298298add_action('admin_enqueue_scripts', 'Follow_Hook_my_custom_fonts');
    299299function Follow_Hook_my_custom_fonts() {
    300 wp_enqueue_style('custom_wp_admin_fonts', plugins_url('css/admin.css', __FILE__)); 
     300wp_enqueue_style('custom_wp_admin_fonts', plugins_url('css/admin.css', __FILE__));
    301301}
    302302
     
    308308wp_enqueue_script('fix_FH_icon', plugins_url('js/fix_FH_icon.js', __FILE__));
    309309wp_localize_script('fix_FH_icon', 'myScript', array(
    310     'ppath' => $ppath, 
     310    'ppath' => $ppath,
    311311    'ppath2' => $ppath2,
    312312));
     
    887887    remove_menu_page('edit.php?post_type=touchpoints');
    888888    remove_menu_page('edit.php?post_type=people');
    889    
     889
    890890 //Then add menu items:
    891891    $page_title='Follow Hook';
     
    912912    add_submenu_page(NULL, 'Select GDPR for Forms', 'Select GDPR for Forms',$capability, 'forms_GDPR_admin_pg','Follow_Hook_create_GDPR_pg');
    913913    //custom fields link:
    914     add_submenu_page($menu_slug,'Custom Fields', 'Custom Fields',$capability, 'Follow_Hook_custom_fields_admin_pg', 'Follow_Hook_custom_fields_admin_pg'); 
     914    add_submenu_page($menu_slug,'Custom Fields', 'Custom Fields',$capability, 'Follow_Hook_custom_fields_admin_pg', 'Follow_Hook_custom_fields_admin_pg');
    915915        //add_submenu_page($menu_slug, 'Test Page 2', 'Test Page 2',$capability, 'testpg2','testpg2');//remove when not testing by commenting out!
    916916}//end follow_hook_free_admin_menu function to build the cultivate menu in wp-admin for free plugin
     
    997997            $formdata = $submission->get_posted_data();
    998998            //get the submitted form's ID:
    999             $form_id = $formdata['_wpcf7'];
     999            //$form_id = $formdata['_wpcf7'];
     1000
     1001            //$form_id = $formdata['_wpcf7'];
     1002            $wpcf = WPCF7_ContactForm::get_current();
     1003            $form_id = $wpcf->id;
     1004
     1005
    10001006            $log .= "CF7 Form ID: $form_id\n";
    10011007            //if $form_id is in formids array, then use data to build a new people post:
     
    10561062
    10571063                    //if cfld is email or _email, then check for existing email before moving forward:
    1058                    
     1064
    10591065                    if($cfld == "email" || $cfld == "_email"){
    10601066            $args = array(
     
    10781084            }//end if found people with email
    10791085                    }//end if cfld is email or _email then check for existing email...
    1080            
    1081            
    1082            
    1083            
    1084            
    1085            
     1086
     1087
     1088
     1089
     1090
     1091
    10861092                    if($cfld=='_status'){
    10871093                        $_status = $GDPR_opt;
     
    10921098                        //$log .= "*Field name $cfld set to $vl\n";
    10931099                    }
    1094                    
     1100
    10951101                }//and for each result
    10961102                $ii++;
     
    14081414    $tFile = $cdir.'time.txt';
    14091415    $ftime = "";
    1410     if($file = fopen($tFile, "r")){ 
     1416    if($file = fopen($tFile, "r")){
    14111417    //Output a line of the file until the end is reached:
    14121418        if($file){
     
    14221428        Follow_Hook_log_debug("failed to read time.txt time\n","a.log");
    14231429    }
    1424    
     1430
    14251431    $lasttime = new DateTime($ftime);
    14261432    $dt = new DateTime("now");//for use of keeping track of function runs
    1427            
     1433
    14281434    $dtf = $dt->format('Y-m-d H:i:s');//formats $dt to display it
    14291435    Follow_Hook_log_debug("Current time: $dtf\n","a.log");
     
    14451451    Follow_Hook_log_debug("------NOT enough time since last run function stopped!\n","a.log");
    14461452        return;
    1447     }       
     1453    }
    14481454    //store the time the function is being ran:
    14491455    //store time in time.txt:
     
    14511457    fwrite($fh, $dtf);
    14521458    fclose($fh);
    1453     if(function_exists('check_import_queue')) check_import_queue(); 
     1459    if(function_exists('check_import_queue')) check_import_queue();
    14541460    }//end if it's been more than cron_min
    14551461    //}//end if times don't match!
     
    15551561function Follow_Hook_remove_TP_on_del_pod_from_person($object_id, $tt_ids, $taxonomy) {
    15561562   // Follow_Hook_log_debug("\n---Follow_Hook_remove_TP_on_del_pod_from_person function fired!---\n\n");
    1557    
     1563
    15581564    //Follow_Hook_log_debug("Obj ID: $object_id\n");
    15591565    //Follow_Hook_log_debug("tt id: $tt_ids\n");
     
    19211927add_filter('update_post_metadata', 'FH_check_people_email', 10, 4);
    19221928add_filter( 'add_post_metadata', 'FH_check_people_email', 10, 4 );
    1923 // define the update_post_metadata callback 
    1924 function FH_check_people_email($array, $post_id, $k, $val) { 
     1929// define the update_post_metadata callback
     1930function FH_check_people_email($array, $post_id, $k, $val) {
    19251931
    19261932$post_type = get_post_type($post_id);
     
    19281934    return $null;
    19291935    }else{
    1930     // make filter magic happen here... 
     1936    // make filter magic happen here...
    19311937    //Follow_Hook_log_debug("array value: $array\n","eml.log");
    19321938    Follow_Hook_log_debug("Post ID: $post_id\n","eml.log");
     
    19341940    Follow_Hook_log_debug("Val: $val\n","eml.log");
    19351941    //Follow_Hook_log_debug("next value: $a\n","eml.log");
    1936     //return $array; 
     1942    //return $array;
    19371943    //see if email exists:
    19381944  global $wpdb;
     
    19431949  //If email exists don't save it and throw error:
    19441950    if(!empty($exists)){
    1945        
     1951
    19461952        $foundid = $exists[0];
    19471953        Follow_Hook_log_debug("Found email for user with id: $foundid\n\n","eml.log");
     
    19511957            //add_action( 'admin_notices', 'FH_people_admin_notice',10, 2 );
    19521958        fh_error('email_exists','Oops! The email you have entered belongs to another person, please use another email address.');
    1953         Follow_Hook_log_debug("Sent error.... This user id: $post_id Other user using email id: $foundid\n\n","eml.log");           
     1959        Follow_Hook_log_debug("Sent error.... This user id: $post_id Other user using email id: $foundid\n\n","eml.log");
    19541960        //throw wp-admin error:
    1955        
     1961
    19561962        $_SESSION['Follow_Hook_my_admin_notices'] .=  '<div class="notice notice-error is-dismissible"><p>Opps! Sorry, a person with email '.$val.' already exists, please use a different email address to continue.</p></div>';
    19571963        return false;
     
    20142020
    20152021//add_action( 'admin_notices', 'FH_people_admin_notice' );
    2016              
     2022
    20172023
    20182024
     
    20472053    $screen = get_current_screen();
    20482054    if($screen->post_type == 'people') {
    2049         wp_enqueue_script('del_tp_hist', plugins_url('js/del_tp_history.js', __FILE__));       
     2055        wp_enqueue_script('del_tp_hist', plugins_url('js/del_tp_history.js', __FILE__));
    20502056    }//end if people screen
    20512057}
     
    20612067        $personsid = '';//sets the person's ID as blank
    20622068    }
    2063    
     2069
    20642070    //now build the option name as personal_tp_note_ or _tp_note_(it should be one or the other) followed by tp id:
    20652071    //$opt_name = "personal_tp_note_".$tpidof;
  • follow-hook/trunk/readme.txt

    r2318605 r2408325  
    44Plugin Name:  Follow Hook CRM
    55Plugin URI: https://followhook.com/
    6 Tags: CRM, Contact Management, ConvertKit, Mailchimp, Email Marketing, Text Marketing, Project Broadcast
     6Tags: CRM, Contact Management, Project Broadcast, ConvertKit, Mailchimp, Contact Form 7, Email Marketing, Text Marketing
    77Author URI: https://followhook.com/
    88Author:  Kyler Boudreau and Ian Lincicome of Follow Hook
    9 Requires at least: 5.0
    10 Tested up to: 5.4
     9Requires at least: 5.5.0
     10Tested up to: 5.5.1
    1111Stable tag: trunk
    12 Version:   2.0.1
     12Version:   1.2.2
    1313Requires PHP: 7.1
    1414License URI: https://followhook.com/downloads/follow-hook/
     
    6565For general CRM documentation, please visit [Follow Hook University](https://followhook.com/university/).
    6666
    67 == Upgrade Notice ==
    68 = 2.0 =
    69 This is the first free version of Follow Hook made available publicly via wordpress.org
    70 
    7167== Frequently Asked Questions ==
    7268
     
    108104* Version 1.0.3 converted Follow Hook Tags into Follow Hook Groups
    109105* Version 1.0.4 fixes a hard-coded URL by replacing it with it's dynamic counter-part.
    110 * Version 1.2.0 includes code that works in tandem with V1.4.1 of the Pro add-on.
     106* Version 1.2.1 includes code that works in tandem with V1.4.1 of the Pro add-on.
     107* Version 1.2.2 includes fix for Contact Form 7 submissions.
  • follow-hook/trunk/time.txt

    r2141463 r2408325  
     12020-10-28 13:41:17
Note: See TracChangeset for help on using the changeset viewer.