From 244ec72c6d7d554518ff89598cb999d39614af0d Mon Sep 17 00:00:00 2001 From: danix Date: Wed, 4 Nov 2020 15:35:56 +0100 Subject: Removed Genericons. Added dnxcf-font which is a subset of fontawesome. Removed every reference to gmaps. Added honeypot field. NEEDS TESTING!! modificato: danixland-contact-form.php modificato: include/dnxcf_helper.php modificato: include/dnxcf_mail_template_danixland.php modificato: include/dnxcf_options-display.php modificato: include/dnxcf_options-register.php modificato: include/dnxcf_settings.php nuovo file: style/dnxcf-font.css modificato: style/dnxcf_style.css nuovo file: style/font/dnxcf.eot nuovo file: style/font/dnxcf.svg nuovo file: style/font/dnxcf.ttf nuovo file: style/font/dnxcf.woff nuovo file: style/font/dnxcf.woff2 eliminato: style/genericons/Genericons.eot eliminato: style/genericons/Genericons.svg eliminato: style/genericons/Genericons.ttf eliminato: style/genericons/Genericons.woff eliminato: style/genericons/genericons.css --- danixland-contact-form.php | 269 +++++++++++++++++++-------------------------- 1 file changed, 111 insertions(+), 158 deletions(-) (limited to 'danixland-contact-form.php') diff --git a/danixland-contact-form.php b/danixland-contact-form.php index 7d5c8bd..e5348d3 100644 --- a/danixland-contact-form.php +++ b/danixland-contact-form.php @@ -1,11 +1,11 @@ -
-
-

$sitename

-
-

$sitemsg

-

$visitus

-
- -DNX6655788EOT; - ?> - - - - - $dnxcf_options['dnxcf_recv_name'], - 'site' => get_bloginfo( 'name' ), - 'time' => $dnxcf_ltd, - 'host' => $dnxcf_hst, - 'ua' => $dnxcf_ua, - ); - $dnxcf_message = dnxcf_email_content( $dnxcf_email_data, $dnxcf_posted ); - } else { // content_type is set to text/plain - $dnxcf_message = sprintf( - __( "Hello \"%1\$s\",\nyou are being contacted by %2\$s on %3\$s.\n%4\$s has provided the following informations:\n\tEmail:\t\t%5\$s\n\tWebsite:\t%6\$s\n\tMessage:\n\n%7\$s", 'dnxcf' ), - $dnxcf_options['dnxcf_recv_name'], - $dnxcf_posted['dnxcf_name'], - get_bloginfo( 'name' ), - $dnxcf_posted['dnxcf_name'], - $dnxcf_posted['dnxcf_email'], - $dnxcf_posted['dnxcf_website'], - $dnxcf_posted['dnxcf_message'] - ); - $dnxcf_message .= "\n\n##-----------#-----------#-----------##\n\n"; - $dnxcf_message .= sprintf( - __( "We have also collected the following informations:\n\tBrowser:\t%1\$s\n\tTime:\t\t%2\$s\n\tIP Address:\t%3\$s\n", 'dnxcf' ), - $dnxcf_ua, - $dnxcf_ltd, - $dnxcf_hst - ); - } // end check for mail_content_type - $dnxcf_mailed = wp_mail( $dnxcf_to, $dnxcf_subject, $dnxcf_message, $dnxcf_headers ); - if ( $dnxcf_mailed ) { - ?> -

-

-

-
-
-
-
-
-
-
-
-
-

-

-

-

-
-
-
-
-
-

- -

administrator.', 'dnxcf' ), get_bloginfo( 'admin_email' ) ); ?>

- + $dnxcf_posted = array(); + // let's gather some data about the user submitting the form + $dnxcf_ltd = trim( strip_tags( stripslashes( current_time( 'mysql' ) ) ) ); + $dnxcf_hst = trim( strip_tags( stripslashes( getenv( 'REMOTE_ADDR' ) ) ) ); + $dnxcf_ua = trim( strip_tags( stripslashes( $_SERVER['HTTP_USER_AGENT'] ) ) ); + // our posted options, arranged in one nice array + $dnxcf_posted['dnxcf_name'] = sanitize_text_field( $_POST['dnxcf_name'] ); + $dnxcf_posted['dnxcf_email'] = sanitize_email( $_POST['dnxcf_email'] ); + $dnxcf_posted['dnxcf_website'] = esc_url( $_POST['dnxcf_website'] ); + $dnxcf_posted['dnxcf_subject'] = sanitize_text_field( $_POST['dnxcf_subject'] ); + $dnxcf_posted['dnxcf_message'] = wp_kses( $_POST['dnxcf_message'], $valid_html ); + // let's begin with our email data, like receiver email, subject ecc. + $dnxcf_to = $dnxcf_options['dnxcf_recv_email']; + $dnxcf_headers = 'Reply-To: ' . $dnxcf_posted['dnxcf_email']; + $dnxcf_subject = __( 'Contact from "', 'dnxcf' ) . get_bloginfo( 'name' ) . '" - ' . $dnxcf_posted['dnxcf_subject']; - $dnxcf_options['dnxcf_recv_name'], + 'site' => get_bloginfo( 'name' ), + 'time' => $dnxcf_ltd, + 'host' => $dnxcf_hst, + 'ua' => $dnxcf_ua, + ); + $dnxcf_message = dnxcf_email_content( $dnxcf_email_data, $dnxcf_posted ); + } else { // content_type is set to text/plain + $dnxcf_message = sprintf( + __( "Hello \"%1\$s\",\nyou are being contacted by %2\$s on %3\$s.\n%4\$s has provided the following informations:\n\tEmail:\t\t%5\$s\n\tWebsite:\t%6\$s\n\tMessage:\n\n%7\$s", 'dnxcf' ), + $dnxcf_options['dnxcf_recv_name'], + $dnxcf_posted['dnxcf_name'], + get_bloginfo( 'name' ), + $dnxcf_posted['dnxcf_name'], + $dnxcf_posted['dnxcf_email'], + $dnxcf_posted['dnxcf_website'], + $dnxcf_posted['dnxcf_message'] + ); + $dnxcf_message .= "\n\n##-----------#-----------#-----------##\n\n"; + $dnxcf_message .= sprintf( + __( "We have also collected the following informations:\n\tBrowser:\t%1\$s\n\tTime:\t\t%2\$s\n\tIP Address:\t%3\$s\n", 'dnxcf' ), + $dnxcf_ua, + $dnxcf_ltd, + $dnxcf_hst + ); + } // end check for mail_content_type + + $dnxcf_mailed = wp_mail( $dnxcf_to, $dnxcf_subject, $dnxcf_message, $dnxcf_headers ); + + if ( $dnxcf_mailed ) { + ?> +

+

+

+
+
+
+
+
+
+
+
+
+

+

+

+

+
+
+
+
+
+

+ +

administrator.', 'dnxcf' ), get_bloginfo( 'admin_email' ) ); ?>

+ +

+ @@ -243,41 +198,39 @@ function dnxcf_display_form() { $dnxcf_options = get_option( 'dnxcf_options' ); ?> -
- -

-
- + +

*

-
+
-
+

-
+
-
+

-

- +

+

-

- +

-

- +

+

-
-
+

+ + +

+ +

-

- +

+

-

- +

+

-
-
+ +
-
-
+ +