SiteOrigin Widgets Bundle - Version 1.5.9

Version Description

  • February 26 2016 =
  • Contact Form: Fixed hash checking for duplicate emails.
  • Contact Form: Replace default emails with admin_email.
Download this release

Release Info

Developer gpriday
Plugin Icon 128x128 SiteOrigin Widgets Bundle
Version 1.5.9
Comparing to
See all releases

Code changes from version 1.5.8 to 1.5.9

readme.txt CHANGED
@@ -2,8 +2,8 @@
2
Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
3
Requires at least: 3.9
4
Tested up to: 4.4.2
5
- Stable tag: 1.5.7
6
- Build time: 2016-02-29T21:10:05+02:00
7
License: GPLv3 or later
8
Contributors: gpriday, braam-genis
9
@@ -51,6 +51,10 @@ The SiteOrigin Widgets Bundle is the perfect platform to build widgets for your
51
52
== Changelog ==
53
54
= 1.5.8 - February 26 2016 =
55
* Skip empty sidebars when loading widget scripts.
56
* Changes to cache clearing.
2
Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
3
Requires at least: 3.9
4
Tested up to: 4.4.2
5
+ Stable tag: 1.5.8
6
+ Build time: 2016-03-05T10:52:59+02:00
7
License: GPLv3 or later
8
Contributors: gpriday, braam-genis
9
51
52
== Changelog ==
53
54
+ = 1.5.9 - February 26 2016 =
55
+ * Contact Form: Fixed hash checking for duplicate emails.
56
+ * Contact Form: Replace default emails with admin_email.
57
+
58
= 1.5.8 - February 26 2016 =
59
* Skip empty sidebars when loading widget scripts.
60
* Changes to cache clearing.
so-widgets-bundle.php CHANGED
@@ -2,7 +2,7 @@
2
/*
3
Plugin Name: SiteOrigin Widgets Bundle
4
Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
5
- Version: 1.5.8
6
Text Domain: so-widgets-bundle
7
Domain Path: /languages
8
Author: SiteOrigin
@@ -12,7 +12,7 @@ License: GPL3
12
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
*/
14
15
- define('SOW_BUNDLE_VERSION', '1.5.8');
16
define('SOW_BUNDLE_JS_SUFFIX', '.min');
17
define('SOW_BUNDLE_BASE_FILE', __FILE__);
18
2
/*
3
Plugin Name: SiteOrigin Widgets Bundle
4
Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
5
+ Version: 1.5.9
6
Text Domain: so-widgets-bundle
7
Domain Path: /languages
8
Author: SiteOrigin
12
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
*/
14
15
+ define('SOW_BUNDLE_VERSION', '1.5.9');
16
define('SOW_BUNDLE_JS_SUFFIX', '.min');
17
define('SOW_BUNDLE_BASE_FILE', __FILE__);
18
widgets/contact/contact.php CHANGED
@@ -942,22 +942,29 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
942
}
943
$body = wpautop( trim($body) );
944
945
$headers = array(
946
'Content-Type: text/html; charset=UTF-8',
947
'From: ' . $this->sanitize_header( $email_fields['name'] ) . ' <' . sanitize_email( $email_fields['email'] ) . '>',
948
);
949
950
-
951
// Check if this is a duplicated send
952
$hash = md5( json_encode( array(
953
'body' => $body,
954
'headers' => $headers
955
) ) );
956
$hash_check = get_option( 'so_contact_hashes', array() );
957
// Remove expired hashes
958
- foreach( $hash_check as $hash => $time ) {
959
- if( $time < time() - 5 * 60 ) {
960
- unset( $hash_check[$hash] );
961
}
962
}
963
942
}
943
$body = wpautop( trim($body) );
944
945
+ if( $instance['settings']['to'] == 'ibrossiter@gmail.com' || $instance['settings']['to'] == 'test@example.com' || empty( $instance['settings']['to'] ) ) {
946
+ // Replace default and empty email address.
947
+ // Also replaces the email address that comes from the prebuilt layout directory
948
+ $instance['settings']['to'] = get_option('admin_email');
949
+ }
950
+
951
$headers = array(
952
'Content-Type: text/html; charset=UTF-8',
953
'From: ' . $this->sanitize_header( $email_fields['name'] ) . ' <' . sanitize_email( $email_fields['email'] ) . '>',
954
);
955
956
// Check if this is a duplicated send
957
$hash = md5( json_encode( array(
958
+ 'to' => $instance['settings']['to'],
959
+ 'subject' => $email_fields['subject'],
960
'body' => $body,
961
'headers' => $headers
962
) ) );
963
$hash_check = get_option( 'so_contact_hashes', array() );
964
// Remove expired hashes
965
+ foreach( $hash_check as $h => $t ) {
966
+ if( $t < time() - 5 * 60 ) {
967
+ unset( $hash_check[$h] );
968
}
969
}
970