Plugin Directory

Changeset 2668396


Ignore:
Timestamp:
01/28/2022 04:58:58 PM (4 years ago)
Author:
f13dev
Message:

1.0.1 - Experimental honeypot

Location:
f13-email
Files:
26 added
4 edited

Legend:

Unmodified
Added
Removed
  • f13-email/trunk/controllers/control.php

    r2623145 r2668396  
    3030            $template = '';
    3131
     32            $agree_terms = (int) filter_input($this->request_method, 'agree-terms');
     33
    3234            foreach ($data->fields as $field) {
    3335                $id = 'field-'.$field->sort;
     
    4042                    $errors[$id] = sprintf(__('%s is a required field', 'f13-email'), esc_attr($field->title));
    4143                }
    42 
    43 
    4444
    4545                if ($field->type == 'email' && !empty($value) && !is_email($value)) {
     
    9090                    $headers[] = 'Reply-To: '.$reply_to;
    9191                }
    92                 if (wp_mail( 'jv@f13dev.com', 'Contact from blog', $template, $headers )) {
     92
     93                $subject = 'Contact from blog'.($agree_terms ? ' (Spam detected)' : '');
     94                if (wp_mail( get_bloginfo('admin_email'), $subject, $template, $headers )) {
    9395                    return '<div class="f13-success" role="alert" aria-live="notice">'.trim(esc_attr($data->success)).'</div>';
    9496                }
  • f13-email/trunk/f13-email.php

    r2623145 r2668396  
    44Plugin URI: https://f13.dev/wordpress-plugin-email/
    55Description: Use SMTP for sending emails, store email logs and build custom contact forms
    6 Version: 1.0.0
     6Version: 1.0.1
    77Author: f13dev
    88Author URI: http://f13.dev
  • f13-email/trunk/readme.txt

    r2623146 r2668396  
    33Tags: SMTP, email, forms, contact, form builder, email logs
    44Requires at least: 5.0
    5 Tested up to: 5.8.1
    6 Stable tag: 1.0.0
     5Tested up to: 5.9
     6Stable tag: 1.0.1
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    2121
    2222[Read more about F13 Email](https://f13.dev/wordpress-plugin-email/)
     23
     24== Changelog ==
     25=== 1.0.1 ==
     26* Add honeypot, emails are still sent, subject appended with (possible spam) while testing effectiveness
  • f13-email/trunk/views/contact_form.php

    r2623145 r2668396  
    2222    {
    2323        $v = '<div class="inner">';
    24 //            $v .= '<p>'.$this->data->title.'</p>';
    2524            $v .= $this->msg;
    2625
     
    5554                    } else
    5655                    if ($field->type == 'checkbox') {
    57 //                        $v .= '<label for="'.$id.'">'.esc_attr($field->title).$required.'</label>';
    5856                        $v .= '<fieldset class="f13-email-checkbox '.$error.'">';
    59 //                            if (!empty($field->title)) {
    6057                                $v .= '<legend style="display: none">'.esc_attr($field->title).$required.'</legend>';
    61 //                            }
    62 //                        $v .= '<div class="f13-email-checkbox">';
    6358                            $v .= '<input type="checkbox" name="'.$id.'" id="'.$id.'" '.(filter_input(INPUT_POST, $id) == $field->title ? 'checked="checked"' : '').' value="'.$field->title.'" autocomplete="on">';
    6459                            $v .= '<label for="'.$id.'">'.esc_attr($field->title).$required.'</label>';
    65 //                        $v .= '</div>';
    6660                        $v .= '</fieldset>';
    6761                    } else
    6862                    if ($field->type == 'radio') {
    69 //                        $v .= '<label for="'.$id.'">'.esc_attr($field->title).$required.'</label>';
    7063                        $v .= '<fieldset class="f13-email-checkbox '.$error.'">';
    7164                            if (!empty($field->title)) {
     
    8477                }
    8578
     79                $v .= '<div style="display: none">';
     80                    $v .= '<input type="checkbox" name="agree-terms" id="agree-terms" value="1" autocomplete="off">';
     81                    $v .= '<label for="agree-terms">'.__('I agree to the terms', 'f13-email').'*</label>';
     82                $v .= '</div>';
     83
    8684                $v .= apply_filters('f13_recaptcha_add', '');
    8785
Note: See TracChangeset for help on using the changeset viewer.