From 8c3e9b00bbeb0a3493d5b0e9b6cc4c68d413a4b0 Mon Sep 17 00:00:00 2001
From: danix
Date: Wed, 4 Nov 2020 12:10:15 +0100
Subject: Linted files
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
modificato: include/index.php
modificato: index.php
modificato: uninstall.php
---
danixland-contact-form.php | 417 +++++++++++++++++++++++----------------------
1 file changed, 211 insertions(+), 206 deletions(-)
(limited to 'danixland-contact-form.php')
diff --git a/danixland-contact-form.php b/danixland-contact-form.php
index 8367d0d..7d5c8bd 100644
--- a/danixland-contact-form.php
+++ b/danixland-contact-form.php
@@ -1,7 +1,7 @@
@@ -73,28 +73,29 @@ $popup_content = <<< DNX6655788EOT
DNX6655788EOT;
-?>
+ ?>
- array(
- 'href' => array(),
- 'title' => array()
- ),
- 'br' => array(),
- 'em' => array(),
- 'strong' => array(),
- 'p' => array(),
- 'pre' => array(),
- 'code' => array()
- );
- // security checks before submitting the form
- if ( $_SERVER['REQUEST_URI'] == $_POST['_wp_http_referer'] && wp_verify_nonce( $_POST[ $dnxcf_form_name], $dnxcf_form_action ) ) {
+ if ( isset( $_POST[ $dnxcf_send_value ] ) ) { // the form has been submitted
+ $dnxcf_email_output = ( '1' == $dnxcf_options['dnxcf_content_type'] ) ? 'text/plain' : 'text/html';
+ $dnxcf_form_name = 'dnxcf_form_' . $dnxcf_pid;
+ $dnxcf_form_action = 'dnxcf_submit_' . $dnxcf_form_id;
+ // valid html used to validate the comment content.
+ $valid_html = array(
+ 'a' => array(
+ 'href' => array(),
+ 'title' => array(),
+ ),
+ 'br' => array(),
+ 'em' => array(),
+ 'strong' => array(),
+ 'p' => array(),
+ 'pre' => array(),
+ 'code' => array(),
+ );
+ // security checks before submitting the form
+ if ( $_SERVER['REQUEST_URI'] == $_POST['_wp_http_referer'] && wp_verify_nonce( $_POST[ $dnxcf_form_name ], $dnxcf_form_action ) ) {
- $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_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'];
- // check for our content type and arrange our info accordingly
- if ( 'text/html' == $dnxcf_email_output ) {
- require( apply_filters( 'dnxcf_template_file', dirname( __FILE__ ) . '/include/dnxcf_mail_template_danixland.php') );
- $dnxcf_email_data = array(
- 'ownname' => $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 \"%s\",\nyou are being contacted by %s on %s.\n%s has provided the following informations:\n\tEmail:\t\t%s\n\tWebsite:\t%s\n\tMessage:\n\n%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%s\n\tTime:\t\t%s\n\tIP Address:\t%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_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' ) ); ?>
+
- } else { // the post hasn't been submitted. Let's show the form
- global $dnxcf_options;
- $dnxcf_options = get_option('dnxcf_options');
-?>
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+ *
+
+
+
+
+
+
+
+
+
+
+ *
+
+ ' . $option . '';
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
+?>
--
cgit v1.2.3