Contact Form & SMTP Plugin for WordPress by PirateForms - Version 1.0.7

Version Description

Download this release

Release Info

Developer codeinwp
Plugin Icon 128x128 Contact Form & SMTP Plugin for WordPress by PirateForms
Version 1.0.7
Comparing to
See all releases

Code changes from version 1.0.6 to 1.0.7

Files changed (4) hide show
  1. inc/settings.php +1 -1
  2. js/scripts-general.js +1 -1
  3. pirate-forms.php +29 -9
  4. readme.txt +1 -1
inc/settings.php CHANGED
@@ -88,7 +88,7 @@ function pirate_forms_plugin_options() {
88
  ),
89
  'pirateformsopt_email' => array(
90
  __( 'Contact notification sender email','pirate-forms' ),
91
- __( 'Email to use for the sender of the contact form emails both to the recipients below and the contact form submitter (if this is activated below). The domain for this email address should match your site\'s domain.',
92
  'email','pirate-forms' ),
93
  'text',
94
  pirate_forms_from_email()
88
  ),
89
  'pirateformsopt_email' => array(
90
  __( 'Contact notification sender email','pirate-forms' ),
91
+ __( '<strong>Insert [email] to use the contact form submitter\'s email.</strong><br> Email to use for the sender of the contact form emails both to the recipients below and the contact form submitter (if this is activated below). The domain for this email address should match your site\'s domain.',
92
  'email','pirate-forms' ),
93
  'text',
94
  pirate_forms_from_email()
js/scripts-general.js CHANGED
@@ -2,7 +2,7 @@ jQuery(document).ready(function() {
2
 
3
  var session_var = pirateFormsObject.errors;
4
 
5
- if( (typeof session_var != undefined) && (session_var != '') && (typeof jQuery('#contact') != undefined) ) {
6
 
7
  jQuery('html, body').animate({
8
  scrollTop: jQuery('#contact').offset().top
2
 
3
  var session_var = pirateFormsObject.errors;
4
 
5
+ if( (typeof session_var != 'undefined') && (session_var != '') && (typeof jQuery('#contact') != 'undefined') && (typeof jQuery('#contact').offset() != 'undefined') ) {
6
 
7
  jQuery('html, body').animate({
8
  scrollTop: jQuery('#contact').offset().top
pirate-forms.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Pirate Forms - Contact form and SMTP Plugin
4
  Plugin URI: http://themeisle.com/plugins/pirate-forms/
5
  Description: Easily creates a nice looking, simple contact form on your WP site.
6
- Version: 1.0.6
7
  Author: Themeisle
8
  Author URI: http://themeisle.com
9
  Text Domain: pirate-forms
@@ -496,8 +496,16 @@ function pirate_forms_process_contact() {
496
  // No errors? Go ahead and process the contact
497
  if ( empty( $_SESSION['pirate_forms_contact_errors'] ) ) {
498
 
499
- $site_email = sanitize_email( pirate_forms_get_key( 'pirateformsopt_email' ) );
500
- $site_name = htmlspecialchars_decode( get_bloginfo( 'name' ) );
 
 
 
 
 
 
 
 
501
 
502
  // Notification recipients
503
  $site_recipients = sanitize_text_field( pirate_forms_get_key( 'pirateformsopt_email_recipients' ) );
@@ -511,12 +519,24 @@ function pirate_forms_process_contact() {
511
  $pirate_forms_contact_name = ! empty( $pirate_forms_contact_email ) ? $pirate_forms_contact_email : '[None given]';
512
  }
513
 
514
- // Need an email address for the email notification
515
- if( !empty($site_email) ):
516
- $send_from = $site_email;
517
- else:
 
 
 
 
 
 
 
 
 
 
 
518
  $send_from = pirate_forms_from_email();
519
- endif;
 
520
  $send_from_name = $site_name;
521
 
522
 
@@ -551,7 +571,7 @@ function pirate_forms_process_contact() {
551
  endif;
552
  }
553
 
554
- wp_mail( $site_recipients, 'Contact on ' . $site_name, $body, $headers );
555
 
556
  // Should a confirm email be sent?
557
  $confirm_body = stripslashes( trim( pirate_forms_get_key( 'pirateformsopt_confirm_email' ) ) );
3
  Plugin Name: Pirate Forms - Contact form and SMTP Plugin
4
  Plugin URI: http://themeisle.com/plugins/pirate-forms/
5
  Description: Easily creates a nice looking, simple contact form on your WP site.
6
+ Version: 1.0.7
7
  Author: Themeisle
8
  Author URI: http://themeisle.com
9
  Text Domain: pirate-forms
496
  // No errors? Go ahead and process the contact
497
  if ( empty( $_SESSION['pirate_forms_contact_errors'] ) ) {
498
 
499
+ $pirate_forms_options_tmp = get_option( 'pirate_forms_settings_array' );
500
+ if( isset($pirate_forms_options_tmp['pirateformsopt_email']) ) {
501
+ $site_email = $pirate_forms_options_tmp['pirateformsopt_email'];
502
+ }
503
+
504
+ if( !empty($pirate_forms_contact_name) ):
505
+ $site_name = $pirate_forms_contact_name;
506
+ else:
507
+ $site_name = htmlspecialchars_decode( get_bloginfo( 'name' ) );
508
+ endif;
509
 
510
  // Notification recipients
511
  $site_recipients = sanitize_text_field( pirate_forms_get_key( 'pirateformsopt_email_recipients' ) );
519
  $pirate_forms_contact_name = ! empty( $pirate_forms_contact_email ) ? $pirate_forms_contact_email : '[None given]';
520
  }
521
 
522
+ // Need an email address for the email notification
523
+ if( !empty($site_email) ) {
524
+ if( $site_email == '[email]' ) {
525
+ if( !empty($pirate_forms_contact_email) ) {
526
+ $send_from = $pirate_forms_contact_email;
527
+ }
528
+ else {
529
+ $send_from = pirate_forms_from_email();
530
+ }
531
+ }
532
+ else {
533
+ $send_from = $site_email;
534
+ }
535
+ }
536
+ else {
537
  $send_from = pirate_forms_from_email();
538
+ }
539
+
540
  $send_from_name = $site_name;
541
 
542
 
571
  endif;
572
  }
573
 
574
+ wp_mail( $site_recipients, 'Contact on ' . htmlspecialchars_decode( get_bloginfo( 'name' ) ), $body, $headers );
575
 
576
  // Should a confirm email be sent?
577
  $confirm_body = stripslashes( trim( pirate_forms_get_key( 'pirateformsopt_confirm_email' ) ) );
readme.txt CHANGED
@@ -1,5 +1,5 @@
1
  === Pirate Forms - Contact Form and SMTP Plugin ===
2
- Contributors: themeisle, codeinwp
3
  Tags: Attachment, cnotact, conact, contact, contact button, contact form, contact form plugin, contact me, contacts, contacts form plugin, contatc, copy, email submit form, email subscription, feedback, feedback form, form, insert the shortcode, message form, post feedback, request, send, send copy, send messages, shortcode, text, web-page feedback,smtp,recaptcha
4
  Requires at least: 3.0
5
  Tested up to: 4.4
1
  === Pirate Forms - Contact Form and SMTP Plugin ===
2
+ Contributors: themeisle, codeinwp, rodicaelena
3
  Tags: Attachment, cnotact, conact, contact, contact button, contact form, contact form plugin, contact me, contacts, contacts form plugin, contatc, copy, email submit form, email subscription, feedback, feedback form, form, insert the shortcode, message form, post feedback, request, send, send copy, send messages, shortcode, text, web-page feedback,smtp,recaptcha
4
  Requires at least: 3.0
5
  Tested up to: 4.4