Genesis eNews Extended - Version 2.2.0

Version Description

  • Adds "enews-{$field_count}-field" classes to form to aid in additional styling. See https://github.com/kraftbj/genesis-enews-extended/pull/152 Props to JiveDig for the contribution.
Download this release

Release Info

Developer kraftbj
Plugin Icon wp plugin Genesis eNews Extended
Version 2.2.0
Comparing to
See all releases

Code changes from version 2.1.5 to 2.2.0

class-bjgk-genesis-enews-extended.php CHANGED
@@ -3,7 +3,7 @@
3
  * Genesis eNews Extended
4
  *
5
  * @package BJGK\Genesis_enews_extended
6
- * @version 2.1.4
7
  * @author Brandon Kraft <public@brandonkraft.com>
8
  * @link https://kraft.blog/genesis-enews-extended/
9
  * @copyright Copyright (c) 2012-2018, Brandon Kraft
@@ -90,7 +90,7 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
90
  $instance = apply_filters( 'genesis-enews-extended-args', $instance ); //phpcs:ignore WordPress.NamingConventions.ValidHookName
91
 
92
  // Checks if MailPoet exists. If so, a check for form submission will take place.
93
- // phpcs:disable WordPress.Security.NonceVerification.Missing
94
  if ( class_exists( 'WYSIJA' ) && isset( $_POST['submission-type'] ) && 'mailpoet' === $_POST['submission-type'] && ! empty( $instance['mailpoet-list'] ) ) { // Input var okay.
95
  $subscriber_data = array(
96
  'user' => array(
@@ -116,11 +116,44 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
116
  $instance['lname_text'] = 'Last Name';
117
  }
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  // Establishes current URL for MailPoet action fields.
120
  $current_url = ( is_ssl() ? 'https://' : 'http://' ) . wp_unslash( $_SERVER['HTTP_HOST'] ) . wp_unslash( $_SERVER['REQUEST_URI'] ); // Input var okay; sanitization okay.
121
 
122
  // We run KSES on update since we want to allow some HTML, so ignoring the ouput escape check.
123
- echo $before_widget . '<div class="enews">'; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
 
125
  if ( ! empty( $instance['title'] ) ) {
126
  // We run KSES on update since we want to allow some HTML, so ignoring the ouput escape check.
@@ -157,7 +190,7 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
157
  <?php endif; ?>
158
  </form>
159
  <?php elseif ( ! empty( $instance['action'] ) ) : ?>
160
- <form id="subscribe<?php echo esc_attr( $this->id ); ?>" action="<?php echo esc_attr( $instance['action'] ); ?>" method="post"
161
  <?php
162
  // The AMP condition is used here because if the form submission handler does a redirect, the amp-form component will error with:
163
  // "Redirecting to target=_blank using AMP-Redirect-To is currently not supported, use target=_top instead".
@@ -170,18 +203,18 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
170
  <?php
171
  if ( ! empty( $instance['fname-field'] ) ) :
172
  ?>
173
- <input type="text" id="subbox1" class="enews-subbox" value="" aria-label="<?php echo esc_attr( $instance['fname_text'] ); ?>" placeholder="<?php echo esc_attr( $instance['fname_text'] ); ?>" name="<?php echo esc_attr( $instance['fname-field'] ); ?>" /><?php endif ?>
174
  <?php
175
  if ( ! empty( $instance['lname-field'] ) ) :
176
  ?>
177
- <input type="text" id="subbox2" class="enews-subbox" value="" aria-label="<?php echo esc_attr( $instance['lname_text'] ); ?>" placeholder="<?php echo esc_attr( $instance['lname_text'] ); ?>" name="<?php echo esc_attr( $instance['lname-field'] ); ?>" /><?php endif ?>
178
- <input type="<?php echo current_theme_supports( 'html5' ) ? 'email' : 'text'; ?>" value="" id="subbox" aria-label="<?php echo esc_attr( $instance['input_text'] ); ?>" placeholder="<?php echo esc_attr( $instance['input_text'] ); ?>" name="<?php echo esc_js( $instance['email-field'] ); ?>"
179
  <?php
180
  if ( current_theme_supports( 'html5' ) ) :
181
  ?>
182
  required="required"<?php endif; ?> />
183
  <?php echo $instance['hidden_fields']; // phpcs:ignore ?>
184
- <input type="submit" value="<?php echo esc_attr( $instance['button_text'] ); ?>" id="subbutton" />
185
  </form>
186
  <?php elseif ( ! empty( $instance['mailpoet-list'] ) && 'disabled' !== $instance['mailpoet-list'] ) : ?>
187
  <form id="subscribe<?php echo esc_attr( $this->id ); ?>" action="<?php echo esc_attr( $current_url ); ?>" method="post" name="<?php echo esc_attr( $this->id ); ?>">
@@ -221,7 +254,23 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
221
  // We run KSES on update since we want to allow some HTML, so ignoring the ouput escape check.
222
  echo wpautop( apply_filters( 'gee_after_text', $instance['after_text'] ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
223
 
224
- echo '</div>' . $after_widget; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
 
226
  // phpcs:enable WordPress.CSRF.NonceVerification
227
  }
3
  * Genesis eNews Extended
4
  *
5
  * @package BJGK\Genesis_enews_extended
6
+ * @version 2.2.0
7
  * @author Brandon Kraft <public@brandonkraft.com>
8
  * @link https://kraft.blog/genesis-enews-extended/
9
  * @copyright Copyright (c) 2012-2018, Brandon Kraft
90
  $instance = apply_filters( 'genesis-enews-extended-args', $instance ); //phpcs:ignore WordPress.NamingConventions.ValidHookName
91
 
92
  // Checks if MailPoet exists. If so, a check for form submission will take place.
93
+ // phpcs:disable WordPress.Security.NonceVerification.Missing
94
  if ( class_exists( 'WYSIJA' ) && isset( $_POST['submission-type'] ) && 'mailpoet' === $_POST['submission-type'] && ! empty( $instance['mailpoet-list'] ) ) { // Input var okay.
95
  $subscriber_data = array(
96
  'user' => array(
116
  $instance['lname_text'] = 'Last Name';
117
  }
118
 
119
+ // Get field count for wrapper class.
120
+ $field_count = 1;
121
+
122
+ if ( ! empty( $instance['fname-field'] ) ) {
123
+ $field_count++;
124
+ }
125
+
126
+ if ( ! empty( $instance['lname-field'] ) ) {
127
+ $field_count++;
128
+ }
129
+
130
+ // Adds classes, including field count classes.
131
+ $classes = 'enews ' . sprintf( _n( 'enews-%s-field', 'enews-%s-fields', $field_count ), $field_count );
132
+
133
  // Establishes current URL for MailPoet action fields.
134
  $current_url = ( is_ssl() ? 'https://' : 'http://' ) . wp_unslash( $_SERVER['HTTP_HOST'] ) . wp_unslash( $_SERVER['REQUEST_URI'] ); // Input var okay; sanitization okay.
135
 
136
  // We run KSES on update since we want to allow some HTML, so ignoring the ouput escape check.
137
+ echo $before_widget; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
138
+
139
+ // If Genesis is the parent theme.
140
+ if ( function_exists( 'genesis_markup' ) ) {
141
+ genesis_markup(
142
+ [
143
+ 'open' => '<div %s>',
144
+ 'context' => 'enews',
145
+ 'echo' => true,
146
+ 'atts' => [
147
+ 'class' => $classes,
148
+ ],
149
+ 'params' => [
150
+ 'instance' => $instance,
151
+ ],
152
+ ]
153
+ );
154
+ } else {
155
+ printf( '<div class="%s">', $classes );
156
+ }
157
 
158
  if ( ! empty( $instance['title'] ) ) {
159
  // We run KSES on update since we want to allow some HTML, so ignoring the ouput escape check.
190
  <?php endif; ?>
191
  </form>
192
  <?php elseif ( ! empty( $instance['action'] ) ) : ?>
193
+ <form id="subscribe<?php echo esc_attr( $this->id ); ?>" class="enews-form" action="<?php echo esc_attr( $instance['action'] ); ?>" method="post"
194
  <?php
195
  // The AMP condition is used here because if the form submission handler does a redirect, the amp-form component will error with:
196
  // "Redirecting to target=_blank using AMP-Redirect-To is currently not supported, use target=_top instead".
203
  <?php
204
  if ( ! empty( $instance['fname-field'] ) ) :
205
  ?>
206
+ <input type="text" id="subbox1" class="enews-subbox enews-fname" value="" aria-label="<?php echo esc_attr( $instance['fname_text'] ); ?>" placeholder="<?php echo esc_attr( $instance['fname_text'] ); ?>" name="<?php echo esc_attr( $instance['fname-field'] ); ?>" /><?php endif ?>
207
  <?php
208
  if ( ! empty( $instance['lname-field'] ) ) :
209
  ?>
210
+ <input type="text" id="subbox2" class="enews-subbox enews-lname" value="" aria-label="<?php echo esc_attr( $instance['lname_text'] ); ?>" placeholder="<?php echo esc_attr( $instance['lname_text'] ); ?>" name="<?php echo esc_attr( $instance['lname-field'] ); ?>" /><?php endif ?>
211
+ <input type="<?php echo current_theme_supports( 'html5' ) ? 'email' : 'text'; ?>" value="" id="subbox" class="enews-email" aria-label="<?php echo esc_attr( $instance['input_text'] ); ?>" placeholder="<?php echo esc_attr( $instance['input_text'] ); ?>" name="<?php echo esc_js( $instance['email-field'] ); ?>"
212
  <?php
213
  if ( current_theme_supports( 'html5' ) ) :
214
  ?>
215
  required="required"<?php endif; ?> />
216
  <?php echo $instance['hidden_fields']; // phpcs:ignore ?>
217
+ <input type="submit" value="<?php echo esc_attr( $instance['button_text'] ); ?>" id="subbutton" class="enews-submit" />
218
  </form>
219
  <?php elseif ( ! empty( $instance['mailpoet-list'] ) && 'disabled' !== $instance['mailpoet-list'] ) : ?>
220
  <form id="subscribe<?php echo esc_attr( $this->id ); ?>" action="<?php echo esc_attr( $current_url ); ?>" method="post" name="<?php echo esc_attr( $this->id ); ?>">
254
  // We run KSES on update since we want to allow some HTML, so ignoring the ouput escape check.
255
  echo wpautop( apply_filters( 'gee_after_text', $instance['after_text'] ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
256
 
257
+ // If Genesis is the parent theme.
258
+ if ( function_exists( 'genesis_markup' ) ) {
259
+ genesis_markup(
260
+ [
261
+ 'close' => '</div>',
262
+ 'context' => 'enews',
263
+ 'echo' => true,
264
+ 'params' => [
265
+ 'instance' => $instance,
266
+ ],
267
+ ]
268
+ );
269
+ } else {
270
+ echo '</div>';
271
+ }
272
+
273
+ echo $after_widget; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
274
 
275
  // phpcs:enable WordPress.CSRF.NonceVerification
276
  }
index.php CHANGED
@@ -3,7 +3,7 @@
3
  * Genesis eNews Extended
4
  *
5
  * @package BJGK\Genesis_enews_extended
6
- * @version 2.1.1
7
  * @author Brandon Kraft <public@brandonkraft.com>
8
  * @link https://kraft.blog/genesis-enews-extended/
9
  * @copyright Copyright (c) 2012-2018, Brandon Kraft
3
  * Genesis eNews Extended
4
  *
5
  * @package BJGK\Genesis_enews_extended
6
+ * @version 2.2.0
7
  * @author Brandon Kraft <public@brandonkraft.com>
8
  * @link https://kraft.blog/genesis-enews-extended/
9
  * @copyright Copyright (c) 2012-2018, Brandon Kraft
languages/genesis-enews-extended-es_ES.mo DELETED
Binary file
languages/genesis-enews-extended-es_ES.po DELETED
@@ -1,159 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Genesis eNews Extended v0.1.5\n"
4
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/genesis-enews-extended\n"
5
- "POT-Creation-Date: 2014-01-09 20:12:54+00:00\n"
6
- "PO-Revision-Date: 2014-01-14 08:51-0600\n"
7
- "Last-Translator: Brandon Kraft <public@brandonkraft.com>\n"
8
- "Language-Team: Brandon Kraft <public@brandonkraft.com>\n"
9
- "Language: en_US\n"
10
- "MIME-Version: 1.0\n"
11
- "Content-Type: text/plain; charset=UTF-8\n"
12
- "Content-Transfer-Encoding: 8bit\n"
13
- "X-Poedit-KeywordsList: __;_e\n"
14
- "X-Poedit-Basepath: .\n"
15
- "X-Poedit-SourceCharset: utf-8\n"
16
- "X-Generator: Poedit 1.6.3\n"
17
- "X-Poedit-SearchPath-0: ..\n"
18
-
19
- # @ genesis-enews-extended
20
- #: class-bjgk-genesis-enews-extended.php:53
21
- msgid "Displays subscribe form"
22
- msgstr "Muestra formulario de suscripci&#243;n"
23
-
24
- # @ genesis-enews-extended
25
- #: class-bjgk-genesis-enews-extended.php:56
26
- msgid "Genesis - eNews Extended"
27
- msgstr "Genesis - eNews Extended"
28
-
29
- #: class-bjgk-genesis-enews-extended.php:127
30
- msgid "Check your inbox now to confirm your subscription."
31
- msgstr ""
32
-
33
- #: class-bjgk-genesis-enews-extended.php:127
34
- msgid "You've successfully subscribed."
35
- msgstr ""
36
-
37
- # @ genesis-enews-extended
38
- #: class-bjgk-genesis-enews-extended.php:182
39
- msgid "Title"
40
- msgstr "T&#237;tulo"
41
-
42
- # @ genesis-enews-extended
43
- #: class-bjgk-genesis-enews-extended.php:187
44
- msgid "Text To Show Before Form"
45
- msgstr ""
46
-
47
- # @ genesis-enews-extended
48
- #: class-bjgk-genesis-enews-extended.php:191
49
- msgid "Text To Show After Form"
50
- msgstr ""
51
-
52
- #: class-bjgk-genesis-enews-extended.php:197
53
- msgid "MailPoet List"
54
- msgstr ""
55
-
56
- #: class-bjgk-genesis-enews-extended.php:217
57
- #, fuzzy
58
- msgid "Show Fields:"
59
- msgstr "Campos escondidos"
60
-
61
- #: class-bjgk-genesis-enews-extended.php:220
62
- #: class-bjgk-genesis-enews-extended.php:275
63
- #, fuzzy
64
- msgid "First Name"
65
- msgstr "Nombre..."
66
-
67
- #: class-bjgk-genesis-enews-extended.php:224
68
- #: class-bjgk-genesis-enews-extended.php:280
69
- #, fuzzy
70
- msgid "Last Name"
71
- msgstr "Apellido..."
72
-
73
- #: class-bjgk-genesis-enews-extended.php:232
74
- msgid ""
75
- "MailPoet is not currently activated. Genesis eNews Extended works with "
76
- "MailPoet, a free newsletter plugin. See <a href='%s' "
77
- "target='blank'>MailPoet's plugin page on WordPress.org</a>"
78
- msgstr ""
79
-
80
- # @ genesis-enews-extended
81
- #: class-bjgk-genesis-enews-extended.php:238
82
- msgid "Google/Feedburner ID"
83
- msgstr "Google/Feedburner ID"
84
-
85
- # @ genesis-enews-extended
86
- #: class-bjgk-genesis-enews-extended.php:240
87
- msgid ""
88
- "Entering your Feedburner ID here will deactivate the custom options below."
89
- msgstr ""
90
- "Al entrar de su Feedburner ID aqu&#237; se desactivar&#224; las opciones "
91
- "debajo."
92
-
93
- # @ genesis-enews-extended
94
- #: class-bjgk-genesis-enews-extended.php:244
95
- msgid "Form Action"
96
- msgstr "Acci&#243;n de formulario (Form Action)"
97
-
98
- # @ genesis-enews-extended
99
- #: class-bjgk-genesis-enews-extended.php:249
100
- msgid "E-Mail Field"
101
- msgstr "Campo de Email"
102
-
103
- #: class-bjgk-genesis-enews-extended.php:254
104
- msgid "First Name Field"
105
- msgstr "Campo de Nombre"
106
-
107
- #: class-bjgk-genesis-enews-extended.php:259
108
- msgid "Last Name Field"
109
- msgstr "Campo de Apellido"
110
-
111
- # @ genesis-enews-extended
112
- #: class-bjgk-genesis-enews-extended.php:264
113
- msgid "Hidden Fields"
114
- msgstr "Campos escondidos"
115
-
116
- # @ genesis-enews-extended
117
- #: class-bjgk-genesis-enews-extended.php:266
118
- msgid "Not all services use hidden fields."
119
- msgstr "Todos los servicios no usan campos escondidos."
120
-
121
- #: class-bjgk-genesis-enews-extended.php:271
122
- msgid "Open confirmation page in same window?"
123
- msgstr "&#191;Abrir la p&#225;gina de confirmaci&#243;n en la misma ventana?"
124
-
125
- #: class-bjgk-genesis-enews-extended.php:276
126
- msgid "First Name Input Text"
127
- msgstr "Nombre de entrada de texto"
128
-
129
- # @ genesis-enews-extended
130
- #: class-bjgk-genesis-enews-extended.php:281
131
- msgid "Last Name Input Text"
132
- msgstr "Apellido de entrada de texto"
133
-
134
- # @ genesis-enews-extended
135
- #: class-bjgk-genesis-enews-extended.php:285
136
- #, fuzzy
137
- msgid "E-Mail Address"
138
- msgstr "Campo de Email"
139
-
140
- # @ genesis-enews-extended
141
- #: class-bjgk-genesis-enews-extended.php:286
142
- msgid "E-Mail Input Text"
143
- msgstr "Email de entrada su texto"
144
-
145
- # @ genesis-enews-extended
146
- #: class-bjgk-genesis-enews-extended.php:291
147
- msgid "Go"
148
- msgstr "Ir"
149
-
150
- # @ genesis-enews-extended
151
- #: class-bjgk-genesis-enews-extended.php:292
152
- msgid "Button Text"
153
- msgstr "Texto de bot&#243;n"
154
-
155
- #~ msgid "First Name..."
156
- #~ msgstr "Nombre..."
157
-
158
- #~ msgid "Last Name..."
159
- #~ msgstr "Apellido..."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
license.txt CHANGED
@@ -1,6 +1,6 @@
1
  Genesis eNews Extended is licensed under the GPL version 2 or any later version.
2
 
3
- Copyright 2012-2016 Brandon Kraft and other contributors.
4
  --------------------------------------------------------------------------------
5
  GNU GENERAL PUBLIC LICENSE
6
  Version 2, June 1991
1
  Genesis eNews Extended is licensed under the GPL version 2 or any later version.
2
 
3
+ Copyright 2012-2021 Brandon Kraft and other contributors.
4
  --------------------------------------------------------------------------------
5
  GNU GENERAL PUBLIC LICENSE
6
  Version 2, June 1991
plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Genesis eNews Extended
4
  *
5
  * @package BJGK\Genesis_enews_extended
6
- * @version 2.1.5
7
  * @author Brandon Kraft <public@brandonkraft.com>
8
  * @copyright Copyright (c) 2012-2020, Brandon Kraft
9
  * @link https://kraft.blog/genesis-enews-extended/
@@ -13,7 +13,7 @@
13
  * Plugin Name: Genesis eNews Extended
14
  * Plugin URI: https://kraft.blog/genesis-enews-extended/
15
  * Description: Replaces the Genesis eNews Widget to allow easier use of additional mailing services.
16
- * Version: 2.1.5
17
  * Author: Brandon Kraft
18
  * Author URI: https://kraft.blog/
19
  * License: GPL-2.0+
3
  * Genesis eNews Extended
4
  *
5
  * @package BJGK\Genesis_enews_extended
6
+ * @version 2.2.0
7
  * @author Brandon Kraft <public@brandonkraft.com>
8
  * @copyright Copyright (c) 2012-2020, Brandon Kraft
9
  * @link https://kraft.blog/genesis-enews-extended/
13
  * Plugin Name: Genesis eNews Extended
14
  * Plugin URI: https://kraft.blog/genesis-enews-extended/
15
  * Description: Replaces the Genesis eNews Widget to allow easier use of additional mailing services.
16
+ * Version: 2.2.0
17
  * Author: Brandon Kraft
18
  * Author URI: https://kraft.blog/
19
  * License: GPL-2.0+
readme.txt CHANGED
@@ -4,9 +4,9 @@ Donate link: https://kraft.blog/donate/
4
  Tags: genesis, genesiswp, mailchimp, aweber, studiopress, newsletter, subscribe
5
  Requires at least: 4.9.6
6
  Requires PHP: 5.4.0
7
- Tested up to: 5.6.0
8
  Text Domain: genesis-enews-extended
9
- Stable tag: 2.1.5
10
 
11
  Creates a new widget to easily add mailing lists integration to a Genesis website. Works with FeedBurner, MailChimp, AWeber, FeedBlitz, ConvertKit and more.
12
 
@@ -51,6 +51,10 @@ Questions can be asked at the [WordPress.org Support Forum](https://wordpress.or
51
  2. Widget setting screen.
52
 
53
  == Changelog ==
 
 
 
 
54
  = 2.1.4 =
55
  * Accessibility: Use aria-label instead of <label> to prevent CSS being either over-agressive or not enough.
56
 
@@ -178,6 +182,7 @@ A special thanks to all who have contributed to Genesis eNews Extended.
178
 
179
  = Code Contributions =
180
  * Gary Jones (many, many times over)
 
181
  * John Levandowski
182
  * David Decker
183
  * Kim Parsell
4
  Tags: genesis, genesiswp, mailchimp, aweber, studiopress, newsletter, subscribe
5
  Requires at least: 4.9.6
6
  Requires PHP: 5.4.0
7
+ Tested up to: 6.0
8
  Text Domain: genesis-enews-extended
9
+ Stable tag: 2.2.0
10
 
11
  Creates a new widget to easily add mailing lists integration to a Genesis website. Works with FeedBurner, MailChimp, AWeber, FeedBlitz, ConvertKit and more.
12
 
51
  2. Widget setting screen.
52
 
53
  == Changelog ==
54
+ = 2.2.0 =
55
+ * Adds "enews-{$field_count}-field" classes to form to aid in additional styling. See https://github.com/kraftbj/genesis-enews-extended/pull/152
56
+ Props to JiveDig for the contribution.
57
+
58
  = 2.1.4 =
59
  * Accessibility: Use aria-label instead of <label> to prevent CSS being either over-agressive or not enough.
60
 
182
 
183
  = Code Contributions =
184
  * Gary Jones (many, many times over)
185
+ * Mike Hemberger
186
  * John Levandowski
187
  * David Decker
188
  * Kim Parsell