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 --- include/dnxcf_helper.php | 40 +++----------- include/dnxcf_mail_template_danixland.php | 2 +- include/dnxcf_options-display.php | 88 +++++++------------------------ include/dnxcf_options-register.php | 21 +------- include/dnxcf_settings.php | 2 +- 5 files changed, 29 insertions(+), 124 deletions(-) (limited to 'include') diff --git a/include/dnxcf_helper.php b/include/dnxcf_helper.php index d6b4aa0..50c3739 100644 --- a/include/dnxcf_helper.php +++ b/include/dnxcf_helper.php @@ -1,5 +1,5 @@ parent_base == 'edit' ) { - echo ''; - } -} -add_action( 'media_buttons', 'dnxcf_show_form_button', 11 ); - -// the actual function that outputs our shortcode once the button is pressed -function dnxcf_insert_shortcode() { - $currentScreen = get_current_screen(); - if ( $currentScreen->parent_base != 'edit' ) { - return; - } ?> - - '1', 'dnxcf_privacy' => '', - 'dnxcf_latitude' => '38.2704', - 'dnxcf_longitude' => '16.2971', - 'dnxcf_apikey' => '', - 'dnxcf_gmap_message' => '', 'dnxcf_DB_VERSION' => '2', ); return $defaults; @@ -106,10 +76,13 @@ function dnxcf_db_check() { } // helper function that sets the current DB Version for comparison +/* + * Latest DB version: 5 +*/ function dnxcf_set_db_version() { // Define plugin database version. This should only change when new settings are added. if ( ! defined( 'DNXCF_CURRENT_DB_VERSION' ) ) { - define( 'DNXCF_CURRENT_DB_VERSION', 4 ); + define( 'DNXCF_CURRENT_DB_VERSION', 5 ); } } @@ -144,6 +117,9 @@ if ( dnxcf_update_from_email() ) { add_filter( 'wp_mail_from', 'dnxcf_update_from_email' ); } +/* + * Set the content type for the email +*/ function dnxcf_update_content_type() { global $dnxcf_options; $dnxcf_options = get_option( 'dnxcf_options' ); diff --git a/include/dnxcf_mail_template_danixland.php b/include/dnxcf_mail_template_danixland.php index 1c7d5b7..fe3d1a2 100644 --- a/include/dnxcf_mail_template_danixland.php +++ b/include/dnxcf_mail_template_danixland.php @@ -1,5 +1,5 @@ -

+

-

+

-

+

-
+
%1$s < %2$s >', 'dnxcf' ), $dnxcf_options['dnxcf_from_name'], @@ -53,20 +48,14 @@ function dnxcf_settings_mailfrom_section_text() { ); ?>
- +

-

- -

Note: if the API Key value is missing the map will be disabled.', 'dnxcf' ); ?>

+

- value='1' />
- value='2' />
- + value='1' />
+ value='2' />
+
- +
- +
- +
- +
- +
- - -
-
-documentation on the google developers platform.', 'dnxcf' ), $dev_links ); ?>
- - -
- - -
-
- - -
-
- + array(), ); $valid_input['dnxcf_privacy'] = ( '' == $input['dnxcf_privacy'] ? false : wp_kses( $input['dnxcf_privacy'], $valid_html ) ); - // latitude and longitude - $valid_input['dnxcf_gmap_message'] = ( '' == $input['dnxcf_gmap_message'] ? $default_options['dnxcf_gmap_message'] : sanitize_text_field( $input['dnxcf_gmap_message'] ) ); - if ( '' != $input['dnxcf_latitude'] ) { - $valid_input['dnxcf_latitude'] = ( preg_match( '/^[-]?[0-8]?[0-9]\.\d+|[-]?90\.0+?/A', $input['dnxcf_latitude'] ) ? $input['dnxcf_latitude'] : '' ); - } else { - $valid_input['dnxcf_latitude'] = ''; - } - $valid_input['dnxcf_apikey'] = ( '' == $input['dnxcf_apikey'] ? $default_options['dnxcf_apikey'] : sanitize_html_class( $input['dnxcf_apikey'] ) ); - - if ( '' != $input['dnxcf_longitude'] ) { - $valid_input['dnxcf_longitude'] = ( preg_match( '/[-]?1[0-7][0-9]\.\d+|[-]?[0-9]?[0-9]\.\d+|[-]?180\.0+?/A', $input['dnxcf_longitude'] ) ? $input['dnxcf_longitude'] : '' ); - } else { - $valid_input['dnxcf_longitude'] = ''; - } } elseif ( $reset ) { $default_options = dnxcf_set_options(); // content type @@ -76,11 +62,6 @@ function dnxcf_setup_validate( $input ) { $valid_input['dnxcf_from_name'] = $default_options['dnxcf_from_name']; // subject options $valid_input['dnxcf_privacy'] = $default_options['dnxcf_privacy']; - // latitude and longitude - $valid_input['dnxcf_gmap_message'] = $default_options['dnxcf_gmap_message']; - $valid_input['dnxcf_apikey'] = $default_options['dnxcf_apikey']; - $valid_input['dnxcf_latitude'] = $default_options['dnxcf_latitude']; - $valid_input['dnxcf_longitude'] = $default_options['dnxcf_longitude']; } return $valid_input; } diff --git a/include/dnxcf_settings.php b/include/dnxcf_settings.php index 12eb5db..5ed0954 100644 --- a/include/dnxcf_settings.php +++ b/include/dnxcf_settings.php @@ -1,5 +1,5 @@