Contact Form by WPForms – Drag & Drop Form Builder for WordPress - Version 1.2.3.1

Version Description

  • Fixed: Blank form email notification defaults
Download this release

Release Info

Developer jaredatch
Plugin Icon 128x128 Contact Form by WPForms – Drag & Drop Form Builder for WordPress
Version 1.2.3.1
Comparing to
See all releases

Code changes from version 1.2.3 to 1.2.3.1

Files changed (3) hide show
  1. lite/wpforms-lite.php +122 -4
  2. readme.txt +3 -0
  3. wpforms.php +2 -2
lite/wpforms-lite.php CHANGED
@@ -24,6 +24,124 @@ class WPForms_Lite {
24
  add_action( 'wpforms_admin_page', array( $this, 'entries_page' ) );
25
  add_action( 'admin_enqueue_scripts', array( $this, 'addon_page_enqueues' ) );
26
  add_action( 'wpforms_admin_page', array( $this, 'addons_page' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  }
28
 
29
  /**
@@ -48,10 +166,10 @@ class WPForms_Lite {
48
 
49
  // Fetch next ID and handle backwards compatibility
50
  if ( empty( $settings->form_data['settings']['notifications'] ) ) {
51
- $settings->form_data['settings']['notifications'][1]['email'] = !empty( $settings->form_data['settings']['notification_email'] ) ? $settings->form_data['settings']['notification_email'] : '';
52
- $settings->form_data['settings']['notifications'][1]['subject'] = !empty( $settings->form_data['settings']['notification_subject'] ) ? $settings->form_data['settings']['notification_subject'] : '';
53
- $settings->form_data['settings']['notifications'][1]['sender_name'] = !empty( $settings->form_data['settings']['notification_fromname'] ) ? $settings->form_data['settings']['notification_fromname'] : '';
54
- $settings->form_data['settings']['notifications'][1]['sender_address'] = !empty( $settings->form_data['settings']['notification_fromaddress'] ) ? $settings->form_data['settings']['notification_fromaddress'] : '';
55
  $settings->form_data['settings']['notifications'][1]['replyto'] = !empty( $settings->form_data['settings']['notification_replyto'] ) ? $settings->form_data['settings']['notification_replyto'] : '';
56
  }
57
  $id = 1;
24
  add_action( 'wpforms_admin_page', array( $this, 'entries_page' ) );
25
  add_action( 'admin_enqueue_scripts', array( $this, 'addon_page_enqueues' ) );
26
  add_action( 'wpforms_admin_page', array( $this, 'addons_page' ) );
27
+ // Giveaway - 1.2.3.1
28
+ add_action( 'admin_notices', array( $this, 'giveaway_notice' ) );
29
+ add_action( 'admin_init', array( $this, 'giveaway_notice_dismiss' ) );
30
+ add_action( 'admin_menu', array( $this, 'giveaway_menu' ) );
31
+ }
32
+
33
+ /**
34
+ * Giveaway admin notice.
35
+ *
36
+ * @since 1.2.3.1
37
+ */
38
+ public function giveaway_notice() {
39
+
40
+ // Only display for admins
41
+ if ( ! current_user_can( apply_filters( 'wpforms_manage_cap', 'manage_options' ) ) )
42
+ return;
43
+
44
+ // Don't display if has been dismissed or user has been to giveaway page
45
+ if ( get_option( 'wpforms_giveaway_07072016', false ) )
46
+ return;
47
+
48
+ $dismiss = esc_url( add_query_arg( array( 'wpforms_giveaway_dismiss' => true ) ) );
49
+ $giveaway = admin_url( 'admin.php?page=wpforms-giveaway' );
50
+ ?>
51
+ <div class="notice wpforms-giveaway-notice">
52
+ <span class="dashicons dashicons-thumbs-up"></span>
53
+ Are you enjoying <strong>WPForms Lite</strong>? We are giving away 10 free licenses of WPForms Pro - <a href="<?php echo $giveaway; ?>">Enter the Giveaway Here</a> (It’s easy)
54
+ <a href="<?php echo $dismiss; ?>" class="wpforms-giveaway-dismiss"><span class="dashicons dashicons-dismiss"></span></a>
55
+ </div>
56
+ <style type="text/css">
57
+ .wpforms-giveaway-notice {
58
+ position: relative; padding: 8px 10px 8px 40px; border-left: 0;
59
+ }
60
+ .wpforms-giveaway-notice span.dashicons-thumbs-up {
61
+ color: white; background: #0e6cad; position: absolute; left: 0; height: 100%; top: 0; padding: 0 5px;
62
+ }
63
+ .wpforms-giveaway-notice span.dashicons-thumbs-up:before {
64
+ margin-top: 6px; display: inline-block;
65
+ }
66
+ .wpforms-giveaway-dismiss {
67
+ float: right; color: #999; text-decoration: none;
68
+ }
69
+ </style>
70
+ <?php
71
+ }
72
+
73
+ /**
74
+ * Giveaway admin notice dismiss.
75
+ *
76
+ * @since 1.2.3.1
77
+ */
78
+ public function giveaway_notice_dismiss() {
79
+
80
+ if ( !current_user_can( apply_filters( 'wpforms_manage_cap', 'manage_options' ) ) )
81
+ return;
82
+
83
+ if ( isset( $_GET[ 'wpforms_giveaway_dismiss' ] ) || ( isset( $_GET['page'] ) && 'wpforms-giveaway' == $_GET['page'] ) ) {
84
+ update_option( 'wpforms_giveaway_07072016', 'hide' );
85
+ }
86
+ }
87
+
88
+ /**
89
+ * Giveaway menu item for settings page.
90
+ *
91
+ * @since 1.2.3.1
92
+ */
93
+ public function giveaway_menu() {
94
+
95
+ add_submenu_page(
96
+ 'wpforms-settings',
97
+ __( 'WPForms Giveaway', 'wpforms' ),
98
+ __( 'WPForms Giveaway', 'wpforms' ),
99
+ apply_filters( 'wpforms_manage_cap', 'manage_options' ),
100
+ 'wpforms-giveaway',
101
+ array( $this, 'giveaway_page' )
102
+ );
103
+ }
104
+
105
+ /**
106
+ * Giveaway settings page.
107
+ *
108
+ * @since 1.2.3.1
109
+ */
110
+ public function giveaway_page() {
111
+
112
+ // Set option once user goes to this page so they don't see the admin
113
+ // notice again when using the WP dashboard
114
+ update_option( 'wpforms_giveaway_07072016', 'hide' );
115
+ ?>
116
+ <div id="wpforms-giveaway" class="wrap">
117
+ <img src="<?php echo WPFORMS_PLUGIN_URL; ?>assets/images/sullie.png" alt="Sullie WPForms mascot" class="sullie">
118
+ <h1>WPForms PRO Giveaway</h1>
119
+ <p>Thank you for using WPForms Lite. This week, we're giving away 10 Pro accounts of WPForms ($199 value each).</p>
120
+ <p>** Winners will be announced on Wednesday, July 6th **</p>
121
+ <p>Enter the giveaway below:</p>
122
+ <a class="rcptr" href="http://www.rafflecopter.com/rafl/display/2ec3ed916/" rel="nofollow" data-raflid="2ec3ed916" data-theme="classic" data-template="" id="rcwidget_oaxpe87z">a Rafflecopter giveaway</a>
123
+ <script src="https://widget-prime.rafflecopter.com/launch.js"></script>
124
+ </div>
125
+ <style type="text/css">
126
+ #wpforms-giveaway {
127
+ max-width: 800px;
128
+ }
129
+ #wpforms-giveaway .sullie {
130
+ float:right;
131
+ max-width:180px;
132
+ margin:20px 0 0 30px;
133
+ }
134
+ #wpforms-giveaway h1 {
135
+ font-size: 30px;
136
+ margin: 0 0 26px 0;
137
+ }
138
+ #wpforms-giveaway p {
139
+ font-size: 18px;
140
+ margin: 0 0 24px 0;
141
+ max-width: 540px;
142
+ }
143
+ </style>
144
+ <?php
145
  }
146
 
147
  /**
166
 
167
  // Fetch next ID and handle backwards compatibility
168
  if ( empty( $settings->form_data['settings']['notifications'] ) ) {
169
+ $settings->form_data['settings']['notifications'][1]['email'] = !empty( $settings->form_data['settings']['notification_email'] ) ? $settings->form_data['settings']['notification_email'] : '{admin_email}';
170
+ $settings->form_data['settings']['notifications'][1]['subject'] = !empty( $settings->form_data['settings']['notification_subject'] ) ? $settings->form_data['settings']['notification_subject'] : sprintf( __( 'New %s Entry', 'wpforms ' ), $settings->form_data['settings']['form_title'] );
171
+ $settings->form_data['settings']['notifications'][1]['sender_name'] = !empty( $settings->form_data['settings']['notification_fromname'] ) ? $settings->form_data['settings']['notification_fromname'] : get_bloginfo( 'name' );
172
+ $settings->form_data['settings']['notifications'][1]['sender_address'] = !empty( $settings->form_data['settings']['notification_fromaddress'] ) ? $settings->form_data['settings']['notification_fromaddress'] : '{admin_email}';
173
  $settings->form_data['settings']['notifications'][1]['replyto'] = !empty( $settings->form_data['settings']['notification_replyto'] ) ? $settings->form_data['settings']['notification_replyto'] : '';
174
  }
175
  $id = 1;
readme.txt CHANGED
@@ -160,6 +160,9 @@ Syed Balkhi
160
 
161
  == Changelog ==
162
 
 
 
 
163
  = 1.2.3 =
164
  - Added: Form notification message setting
165
  - Added: Additional Smart Tags available inside Form Settings panels
160
 
161
  == Changelog ==
162
 
163
+ = 1.2.3.1 =
164
+ - Fixed: Blank form email notification defaults
165
+
166
  = 1.2.3 =
167
  - Added: Form notification message setting
168
  - Added: Additional Smart Tags available inside Form Settings panels
wpforms.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Beginner friendly WordPress contact form plugin. Use our Drag & Drop form builder to create your WordPress forms.
6
  * Author: WPForms
7
  * Author URI: https://wpforms.com
8
- * Version: 1.2.3
9
  * Text Domain: wpforms
10
  * Domain Path: languages
11
  *
@@ -81,7 +81,7 @@ final class WPForms {
81
  * @since 1.0.0
82
  * @var sting
83
  */
84
- public $version = '1.2.3';
85
 
86
  /**
87
  * The form data handler instance.
5
  * Description: Beginner friendly WordPress contact form plugin. Use our Drag & Drop form builder to create your WordPress forms.
6
  * Author: WPForms
7
  * Author URI: https://wpforms.com
8
+ * Version: 1.2.3.1
9
  * Text Domain: wpforms
10
  * Domain Path: languages
11
  *
81
  * @since 1.0.0
82
  * @var sting
83
  */
84
+ public $version = '1.2.3.1';
85
 
86
  /**
87
  * The form data handler instance.