wpnia
Forum Replies Created
-
Hello,
Could you please give me more details about the issue?
Its about Contact form plugin?
Could you please give me the names of plugins installed in order to reproduce the issue?
Thank you,
NIA
Hello jolive,
This plugin does not treat this case.
So, to achive what you desire you need to edit source code of this plugin.
- For that you need to go to your WordPress administrator page->Plugins->Plugin File Editor
- From the right side -> Select plugin to edit -> search for Duplicate Killer
- From Plugin files search for ‘functions_cf7.php’ file under ‘includes’ folder
- You need to replace the entire function duplicateKiller_cf7_before_send_email from line 48 to 127.
Replace with:
function duplicateKiller_cf7_before_send_email($contact_form, &$abort, $object) { global $wpdb; $table_name = $wpdb->prefix.'dk_forms_duplicate'; $cf7_page = get_option("CF7_page"); $submission = WPCF7_Submission::get_instance(); $form_name = $contact_form->title(); $form_cookie = isset($_COOKIE['dk_form_cookie'])? $form_cookie=$_COOKIE['dk_form_cookie']: $form_cookie='NULL'; if($submission){ $abort = false; $no_form = false; $AND = array(); $data = $submission->get_posted_data(); $form_data = array(); foreach ($data as $key => $d) { $tmpD = $d; if (!is_array($d)){ $bl = array('\"',"\'",'/','\\','"',"'"); $wl = array('"',''','/', '\','"','''); $tmpD = str_replace($bl, $wl, $tmpD ); } //$form_data[$key] = $tmpD; foreach($cf7_page as $cf7_form => $cf7_tag){ if($form_name == $cf7_form){ $i = count($cf7_tag); if(array_key_exists($key,$cf7_tag)){ $no_form = true; if($result = duplicateKiller_check_duplicate("CF7",$form_name)){ foreach($result as $row){ $form_value = unserialize($row->form_value); if(isset($form_value[$key]) AND duplicateKiller_check_values_with_lowercase_filter($form_value[$key],$tmpD)){ $AND[$key] = $form_value[$key]; //echo $j.' '.$form_value[$key].'</br>'; if(function_exists('cfdb7_before_send_mail')){ remove_action('wpcf7_before_send_mail', 'cfdb7_before_send_mail'); } $cookies_setup = [ 'plugin_name' => "cf7_cookie_option", 'get_option' => $cf7_page, 'cookie_stored' => $form_cookie, 'cookie_db_set' => $row->form_cookie ]; }else{ if(!empty($tmpD)) $form_data[$key] = $tmpD; } } }else{ if(!empty($tmpD)) $form_data[$key] = $tmpD; } } } } } //print_r($AND); if($i==count($AND)){ if(dk_check_cookie($cookies_setup)){ $abort = true; $object->set_response($cf7_page['cf7_error_message']); } } //echo $i.' '.$j; //exit(); if(!$abort AND $no_form){ $form_value = serialize($form_data); $wpdb->insert( $table_name, array( 'form_plugin' => "CF7", 'form_name' => $form_name, 'form_value' => $form_value, 'form_cookie' => $form_cookie ) ); } } }
NOTE: This code is for Contact Form 7, it wasn’t tested with other form plugins!
Also, please test it rigorous before going live!Let me know if you have any question.
Thank you,
NIAHello MasG,
For the moment your additional request will not be implemented in the plugin.
It is possible to see this type of feature in the future versions.
Sorry for this inconvenience.
I closed this topic.
Please open a new thread if you have more suggestions or find any bug.
Hello Douglas,
The change you required will not resolve the problem.
Indeed, “wp_kses_post” will let you put HTML there but the error message will be text plain.
Please see here the test.
Duplicate Killer use the function “set_response” from CF7 to show the error message as below:
“$object->set_response($cf7_page[‘cf7_error_message’])” on line 87, includes/functions_cf7.php
So, this feature cannot be implemented due to Contact Form 7 plugin. The problem is not at Duplicate Killer
Thank you,
Hello MasG,
Please update the plugin to the last version. 1.1.6
Let me know if everything is ok.
Thank you,
Hello Douglas,
Sorry for my late reply.
Please update the plugin to the last version, 1.1.5
The last version contain an interface to manage the saved values in your WordPress database.
Regarding the feature request: “Please enable basic HTML”.
I made some tests regarding this situation and this feature cannot be implemented due to Contact Form 7 plugin. The problem is not at Duplicate Killer.Please read more here and here, on official plugin website regarding html.
Thank you,
N. IonutHello Douglas,
Please update Duplicate Killer to last version 1.1.4 and test it.
I also recommend to update Contact Form 7 and CFDB7 to the last verson.
Let me know if everything is in order now.
Thank you very much,
Hello,
Sorry for my late reply.
Please update the plugin to the last version, 1.1.3.
Let me know if the problem persist.
Thank you very much,
NIA
No words from you. Topic closed!
Hello @jdowns1,
Sorry for this delay.
Please update the plugin to the last version and check how it works.
Thank you,
NIA