Version Description
- Accessibility: Updates
- Coding Standards: Implement WPCS.
Download this release
Release Info
Developer | kraftbj |
Plugin | Genesis eNews Extended |
Version | 2.1.2 |
Comparing to | |
See all releases |
Code changes from version 2.1.1 to 2.1.2
- class-bjgk-genesis-enews-extended.php +104 -54
- composer.json +16 -0
- composer.lock +426 -0
- languages/index.php +9 -1
- phpunit.xml.dist +8 -0
- plugin.php +4 -4
- readme.txt +10 -3
class-bjgk-genesis-enews-extended.php
CHANGED
@@ -47,8 +47,8 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
|
|
47 |
'email-field' => '',
|
48 |
'action' => '',
|
49 |
'display_privacy' => 0,
|
50 |
-
'mailpoet_check' => __( 'Check your inbox or spam folder now to confirm your subscription.', '
|
51 |
-
'mailpoet_subbed' => __( "You've successfully subscribed.", '
|
52 |
);
|
53 |
|
54 |
$widget_ops = array(
|
@@ -59,6 +59,15 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
|
|
59 |
parent::__construct( 'enews-ext', __( 'Genesis - eNews Extended', 'genesis-enews-extended' ), $widget_ops );
|
60 |
}
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
/**
|
63 |
* Echo the widget content.
|
64 |
*
|
@@ -81,6 +90,7 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
|
|
81 |
$instance = apply_filters( 'genesis-enews-extended-args', $instance ); //phpcs:ignore WordPress.NamingConventions.ValidHookName
|
82 |
|
83 |
// Checks if MailPoet exists. If so, a check for form submission will take place.
|
|
|
84 |
if ( class_exists( 'WYSIJA' ) && isset( $_POST['submission-type'] ) && 'mailpoet' === $_POST['submission-type'] && ! empty( $instance['mailpoet-list'] ) ) { // Input var okay.
|
85 |
$subscriber_data = array(
|
86 |
'user' => array(
|
@@ -96,6 +106,8 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
|
|
96 |
$mailpoet_subscriber_id = WYSIJA::get( 'user', 'helper' )->addSubscriber( $subscriber_data );
|
97 |
}
|
98 |
|
|
|
|
|
99 |
// Set default fname_text, lname_text for backwards compat for installs upgraded from 0.1.6+ to 0.3.0+.
|
100 |
if ( empty( $instance['fname_text'] ) ) {
|
101 |
$instance['fname_text'] = 'First Name';
|
@@ -119,40 +131,60 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
|
|
119 |
echo wpautop( apply_filters( 'gee_text', $instance['text'] ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
|
120 |
|
121 |
if ( ! empty( $instance['id'] ) ) : ?>
|
122 |
-
<form
|
123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
<?php
|
125 |
if ( current_theme_supports( 'html5' ) ) :
|
126 |
-
|
127 |
-
|
128 |
<input type="hidden" name="uri" value="<?php echo esc_attr( $instance['id'] ); ?>" />
|
129 |
<input type="hidden" name="loc" value="<?php echo esc_attr( get_locale() ); ?>" />
|
130 |
<input type="submit" value="<?php echo esc_attr( $instance['button_text'] ); ?>" id="subbutton" />
|
|
|
|
|
|
|
|
|
131 |
</form>
|
132 |
<?php elseif ( ! empty( $instance['action'] ) ) : ?>
|
133 |
<form id="subscribe<?php echo esc_attr( $this->id ); ?>" action="<?php echo esc_attr( $instance['action'] ); ?>" method="post"
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
|
|
|
|
|
|
|
|
|
|
138 |
<?php
|
139 |
if ( ! empty( $instance['fname-field'] ) ) :
|
140 |
-
?>
|
141 |
-
<label
|
142 |
<?php
|
143 |
if ( ! empty( $instance['lname-field'] ) ) :
|
144 |
-
?>
|
145 |
-
<label
|
146 |
-
<label
|
147 |
<?php
|
148 |
if ( current_theme_supports( 'html5' ) ) :
|
149 |
-
|
150 |
-
|
151 |
<?php echo $instance['hidden_fields']; // phpcs:ignore ?>
|
152 |
<input type="submit" value="<?php echo esc_attr( $instance['button_text'] ); ?>" id="subbutton" />
|
153 |
</form>
|
154 |
<?php elseif ( ! empty( $instance['mailpoet-list'] ) && 'disabled' !== $instance['mailpoet-list'] ) : ?>
|
155 |
-
<form id="subscribe<?php echo esc_attr( $this->id ); ?>" action="<?php echo esc_attr( $current_url ); ?>" method="post"
|
156 |
<?php
|
157 |
if ( ! empty( $mailpoet_subscriber_id ) && is_int( $mailpoet_subscriber_id ) ) :
|
158 |
// confirmation message phrasing depends on whether the user has to verify his subscription or not.
|
@@ -165,25 +197,25 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
|
|
165 |
<?php endif; ?>
|
166 |
<?php
|
167 |
if ( isset( $instance['mailpoet-show-fname'] ) ) :
|
168 |
-
?>
|
169 |
-
<label
|
170 |
<?php
|
171 |
if ( isset( $instance['mailpoet-show-lname'] ) ) :
|
172 |
-
?>
|
173 |
-
<label
|
174 |
-
<label
|
175 |
<?php
|
176 |
if ( current_theme_supports( 'html5' ) ) :
|
177 |
-
|
178 |
-
|
179 |
<?php echo $instance['hidden_fields']; // phpcs:ignore ?>
|
180 |
<input type="hidden" name="submission-type" value="mailpoet" />
|
181 |
<input type="submit" value="<?php echo esc_attr( $instance['button_text'] ); ?>" id="subbutton" />
|
182 |
</form>
|
183 |
-
|
184 |
endif;
|
185 |
if ( $instance['display_privacy'] && function_exists( 'the_privacy_policy_link' ) ) {
|
186 |
-
the_privacy_policy_link( '<small class="enews-privacy">', '</small>');
|
187 |
|
188 |
}
|
189 |
// We run KSES on update since we want to allow some HTML, so ignoring the ouput escape check.
|
@@ -209,12 +241,12 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
|
|
209 |
*
|
210 |
* @return array Settings to save or bool false to cancel saving
|
211 |
*/
|
212 |
-
public function update( $new_instance, $old_instance ) {
|
213 |
-
$new_instance['title'] = strip_tags( $new_instance['title'], '<i>' );
|
214 |
-
$new_instance['text'] = wp_kses_post( $new_instance['text'] );
|
215 |
$new_instance['hidden_fields'] = strip_tags( $new_instance['hidden_fields'], '<a>, <div>, <fieldset>, <input>, <label>, <legend>, <option>, <optgroup>, <select>, <textarea>' );
|
216 |
-
$new_instance['after_text'] = wp_kses_post( $new_instance['after_text'] );
|
217 |
-
$new_instance['id'] = str_replace( 'http://feeds.feedburner.com/', '', $new_instance['id'] );
|
218 |
$new_instance['display_privacy'] = ( isset( $new_instance['display_privacy'] ) ) ? (int) $new_instance['display_privacy'] : 0;
|
219 |
|
220 |
if ( isset( $new_instance['mailpoet_check'] ) ) {
|
@@ -240,17 +272,20 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
|
|
240 |
$instance = wp_parse_args( (array) $instance, $this->defaults );
|
241 |
?>
|
242 |
<p>
|
243 |
-
<label
|
244 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" class="widefat" />
|
|
|
245 |
</p>
|
246 |
|
247 |
<p>
|
248 |
-
<label
|
249 |
<textarea id="<?php echo esc_attr( $this->get_field_id( 'text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'text' ) ); ?>" class="widefat" rows="6" cols="4"><?php echo esc_html( $instance['text'] ); ?></textarea>
|
|
|
250 |
</p>
|
251 |
<p>
|
252 |
-
<label
|
253 |
<textarea id="<?php echo esc_attr( $this->get_field_id( 'after_text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'after_text' ) ); ?>" class="widefat" rows="6" cols="4"><?php echo esc_html( $instance['after_text'] ); ?></textarea>
|
|
|
254 |
</p>
|
255 |
|
256 |
<hr style="background-color: #ccc; border: 0; height: 1px; margin: 20px 0;">
|
@@ -258,11 +293,12 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
|
|
258 |
if ( class_exists( 'WYSIJA' ) ) :
|
259 |
$mp_model_list = WYSIJA::get( 'list', 'model' );
|
260 |
$mp_lists = $mp_model_list->get(
|
261 |
-
array( 'name', 'list_id' ),
|
|
|
262 |
'is_enabled' => 1,
|
263 |
)
|
264 |
);
|
265 |
-
|
266 |
<p>
|
267 |
<label for="<?php echo esc_attr( $this->get_field_id( 'mailpoet-list' ) ); ?>"><?php esc_html_e( 'MailPoet List', 'genesis-enews-extended' ); ?>:</label>
|
268 |
<fieldset>
|
@@ -274,7 +310,7 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
|
|
274 |
<?php
|
275 |
if ( isset( $instance['mailpoet-list'] ) ) {
|
276 |
checked( in_array( $mp_list['list_id'], (array) $instance['mailpoet-list'], true ) ); }
|
277 |
-
?>
|
278 |
/>
|
279 |
<?php echo esc_html( $mp_list['name'] ); ?>
|
280 |
</label>
|
@@ -296,81 +332,95 @@ class BJGK_Genesis_ENews_Extended extends WP_Widget {
|
|
296 |
</small>
|
297 |
|
298 |
<p>
|
299 |
-
<label
|
300 |
<textarea id="<?php echo esc_attr( $this->get_field_id( 'mailpoet_check' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'mailpoet_check' ) ); ?>" class="widefat" rows="6" cols="4"><?php echo esc_html( $instance['mailpoet_check'] ); ?></textarea>
|
|
|
301 |
</p>
|
302 |
<p>
|
303 |
-
|
304 |
<textarea id="<?php echo esc_attr( $this->get_field_id( 'mailpoet_subbed' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'mailpoet_subbed' ) ); ?>" class="widefat" rows="6" cols="4"><?php echo esc_html( $instance['mailpoet_subbed'] ); ?></textarea>
|
|
|
305 |
</p>
|
306 |
</fieldset>
|
307 |
</p>
|
308 |
<hr style="background: #ccc; border: 0; height: 1px; margin: 20px 0;">
|
309 |
<?php endif; ?>
|
310 |
<p>
|
311 |
-
<label
|
312 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'id' ) ); ?>" value="<?php echo esc_attr( $instance['id'] ); ?>" class="widefat" /><br />
|
|
|
313 |
<small><?php esc_html_e( 'Entering your Feedburner ID here will deactivate the custom options below.', 'genesis-enews-extended' ); ?></small>
|
314 |
</p>
|
315 |
<hr style="background-color: #ccc; border: 0; height: 1px; margin: 20px 0;">
|
316 |
<p>
|
317 |
-
<label
|
318 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'action' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'action' ) ); ?>" value="<?php echo esc_attr( $instance['action'] ); ?>" class="widefat" />
|
|
|
319 |
</p>
|
320 |
|
321 |
<p>
|
322 |
-
<label
|
323 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'email-field' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'email-field' ) ); ?>" value="<?php echo esc_attr( $instance['email-field'] ); ?>" class="widefat" />
|
|
|
324 |
</p>
|
325 |
|
326 |
<p>
|
327 |
-
<label
|
328 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'fname-field' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'fname-field' ) ); ?>" value="<?php echo esc_attr( $instance['fname-field'] ); ?>" class="widefat" />
|
|
|
329 |
</p>
|
330 |
|
331 |
<p>
|
332 |
-
<label
|
333 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'lname-field' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'lname-field' ) ); ?>" value="<?php echo esc_attr( $instance['lname-field'] ); ?>" class="widefat" />
|
|
|
334 |
</p>
|
335 |
|
336 |
<p>
|
337 |
-
<label
|
338 |
<textarea id="<?php echo esc_attr( $this->get_field_id( 'hidden_fields' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'hidden_fields' ) ); ?>" class="widefat"><?php echo esc_attr( $instance['hidden_fields'] ); ?></textarea>
|
|
|
339 |
<br><small><?php esc_html_e( 'Not all services use hidden fields.', 'genesis-enews-extended' ); ?></small>
|
340 |
</p>
|
341 |
|
342 |
-
<p>
|
343 |
<input id="<?php echo esc_attr( $this->get_field_id( 'open_same_window' ) ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'open_same_window' ) ); ?>" value="1" <?php checked( $instance['open_same_window'] ); ?>/>
|
344 |
-
|
|
|
345 |
</p>
|
346 |
<hr style="background-color: #ccc; border: 0; height: 1px; margin: 20px 0;">
|
347 |
<p>
|
348 |
<?php $fname_text = empty( $instance['fname_text'] ) ? __( 'First Name', 'genesis-enews-extended' ) : $instance['fname_text']; ?>
|
349 |
-
<label
|
350 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'fname_text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'fname_text' ) ); ?>" value="<?php echo esc_attr( $fname_text ); ?>" class="widefat" />
|
|
|
351 |
</p>
|
352 |
<p>
|
353 |
<?php $lname_text = empty( $instance['lname_text'] ) ? __( 'Last Name', 'genesis-enews-extended' ) : $instance['lname_text']; ?>
|
354 |
-
<label
|
355 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'lname_text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'lname_text' ) ); ?>" value="<?php echo esc_attr( $lname_text ); ?>" class="widefat" />
|
|
|
356 |
</p>
|
357 |
<p>
|
358 |
<?php $input_text = empty( $instance['input_text'] ) ? __( 'E-Mail Address', 'genesis-enews-extended' ) : $instance['input_text']; ?>
|
359 |
-
<label
|
360 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'input_text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'input_text' ) ); ?>" value="<?php echo esc_attr( $input_text ); ?>" class="widefat" />
|
|
|
361 |
</p>
|
362 |
|
363 |
<p>
|
364 |
<?php $button_text = empty( $instance['button_text'] ) ? __( 'Go', 'genesis-enews-extended' ) : $instance['button_text']; ?>
|
365 |
-
<label
|
366 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'button_text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'button_text' ) ); ?>" value="<?php echo esc_attr( $button_text ); ?>" class="widefat" />
|
|
|
367 |
</p>
|
368 |
<p>
|
|
|
369 |
<input id="<?php echo esc_attr( $this->get_field_id( 'display_privacy' ) ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'display_privacy' ) ); ?>" value="1" <?php checked( $instance['display_privacy'] ); ?>/>
|
370 |
-
|
371 |
</p>
|
372 |
|
373 |
-
|
374 |
}
|
375 |
|
376 |
}
|
47 |
'email-field' => '',
|
48 |
'action' => '',
|
49 |
'display_privacy' => 0,
|
50 |
+
'mailpoet_check' => __( 'Check your inbox or spam folder now to confirm your subscription.', 'genesis-enews-extended' ),
|
51 |
+
'mailpoet_subbed' => __( "You've successfully subscribed.", 'genesis-enews-extended' ),
|
52 |
);
|
53 |
|
54 |
$widget_ops = array(
|
59 |
parent::__construct( 'enews-ext', __( 'Genesis - eNews Extended', 'genesis-enews-extended' ), $widget_ops );
|
60 |
}
|
61 |
|
62 |
+
/**
|
63 |
+
* Returns whether it is an AMP page.
|
64 |
+
*
|
65 |
+
* @return bool
|
66 |
+
*/
|
67 |
+
protected function is_amp() {
|
68 |
+
return function_exists( 'is_amp_endpoint' ) && is_amp_endpoint();
|
69 |
+
}
|
70 |
+
|
71 |
/**
|
72 |
* Echo the widget content.
|
73 |
*
|
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(
|
106 |
$mailpoet_subscriber_id = WYSIJA::get( 'user', 'helper' )->addSubscriber( $subscriber_data );
|
107 |
}
|
108 |
|
109 |
+
// phpcs:enable
|
110 |
+
|
111 |
// Set default fname_text, lname_text for backwards compat for installs upgraded from 0.1.6+ to 0.3.0+.
|
112 |
if ( empty( $instance['fname_text'] ) ) {
|
113 |
$instance['fname_text'] = 'First Name';
|
131 |
echo wpautop( apply_filters( 'gee_text', $instance['text'] ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
|
132 |
|
133 |
if ( ! empty( $instance['id'] ) ) : ?>
|
134 |
+
<form
|
135 |
+
id="subscribe-<?php echo esc_attr( $this->id ); ?>"
|
136 |
+
action="https://feedburner.google.com/fb/a/mailverify"
|
137 |
+
method="post"
|
138 |
+
name="<?php echo esc_attr( $this->id ); ?>"
|
139 |
+
<?php if ( ! $this->is_amp() ) : ?>
|
140 |
+
target="popupwindow"
|
141 |
+
onsubmit="window.open( 'https://feedburner.google.com/fb/a/mailverify?uri=<?php echo esc_js( $instance['id'] ); ?>', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true"
|
142 |
+
<?php else : ?>
|
143 |
+
on="<?php echo esc_attr( sprintf( 'submit-success:AMP.navigateTo( url=%s, target=_blank )', wp_json_encode( 'https://feedburner.google.com/fb/a/mailverify?uri=' . $instance['id'], JSON_UNESCAPED_SLASHES ) ) ); ?>"
|
144 |
+
<?php endif; ?>
|
145 |
+
xmlns="http://www.w3.org/1999/html">
|
146 |
+
<label class="screenread"><?php echo esc_attr( $instance['input_text'] ); ?><input type="<?php echo current_theme_supports( 'html5' ) ? 'email' : 'text'; ?>" value="" id="subbox" placeholder="<?php echo esc_attr( $instance['input_text'] ); ?>" name="email"
|
147 |
<?php
|
148 |
if ( current_theme_supports( 'html5' ) ) :
|
149 |
+
?>
|
150 |
+
required="required"<?php endif; ?> /></label>
|
151 |
<input type="hidden" name="uri" value="<?php echo esc_attr( $instance['id'] ); ?>" />
|
152 |
<input type="hidden" name="loc" value="<?php echo esc_attr( get_locale() ); ?>" />
|
153 |
<input type="submit" value="<?php echo esc_attr( $instance['button_text'] ); ?>" id="subbutton" />
|
154 |
+
|
155 |
+
<?php if ( $this->is_amp() ) : ?>
|
156 |
+
<div submit-success><!-- Suppress the success message from the AMP plugin because the result is shown in the opened window. --></div>
|
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".
|
164 |
+
if ( 0 === $instance['open_same_window'] && ! $this->is_amp() ) {
|
165 |
+
echo ' target="_blank" ';
|
166 |
+
}
|
167 |
+
?>
|
168 |
+
name="<?php echo esc_attr( $this->id ); ?>"
|
169 |
+
>
|
170 |
<?php
|
171 |
if ( ! empty( $instance['fname-field'] ) ) :
|
172 |
+
?>
|
173 |
+
<label class="screenread"><?php echo esc_attr( $instance['fname_text'] ); ?><input type="text" id="subbox1" class="enews-subbox" value="" placeholder="<?php echo esc_attr( $instance['fname_text'] ); ?>" name="<?php echo esc_attr( $instance['fname-field'] ); ?>" /></label><?php endif ?>
|
174 |
<?php
|
175 |
if ( ! empty( $instance['lname-field'] ) ) :
|
176 |
+
?>
|
177 |
+
<label class="screenread"><?php echo esc_attr( $instance['lname_text'] ); ?><input type="text" id="subbox2" class="enews-subbox" value="" placeholder="<?php echo esc_attr( $instance['lname_text'] ); ?>" name="<?php echo esc_attr( $instance['lname-field'] ); ?>" /></label><?php endif ?>
|
178 |
+
<label class="screenread"><?php echo esc_attr( $instance['input_text'] ); ?><input type="<?php echo current_theme_supports( 'html5' ) ? 'email' : 'text'; ?>" value="" id="subbox" 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; ?> /></label>
|
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 ); ?>">
|
188 |
<?php
|
189 |
if ( ! empty( $mailpoet_subscriber_id ) && is_int( $mailpoet_subscriber_id ) ) :
|
190 |
// confirmation message phrasing depends on whether the user has to verify his subscription or not.
|
197 |
<?php endif; ?>
|
198 |
<?php
|
199 |
if ( isset( $instance['mailpoet-show-fname'] ) ) :
|
200 |
+
?>
|
201 |
+
<label class="screenread"><?php echo esc_attr( $instance['fname_text'] ); ?><input type="text" id="subbox1" class="enews-subbox" value="" placeholder="<?php echo esc_attr( $instance['fname_text'] ); ?>" name="mailpoet-firstname" /></label><?php endif ?>
|
202 |
<?php
|
203 |
if ( isset( $instance['mailpoet-show-lname'] ) ) :
|
204 |
+
?>
|
205 |
+
<label class="screenread"><?php echo esc_attr( $instance['lname_text'] ); ?><input type="text" id="subbox2" class="enews-subbox" value="" placeholder="<?php echo esc_attr( $instance['lname_text'] ); ?>" name="mailpoet-lastname" /></label><?php endif ?>
|
206 |
+
<label class="screenread"><?php echo esc_attr( $instance['input_text'] ); ?><input type="<?php echo current_theme_supports( 'html5' ) ? 'email' : 'text'; ?>" value="" id="subbox" placeholder="<?php echo esc_attr( $instance['input_text'] ); ?>" name="mailpoet-email"
|
207 |
<?php
|
208 |
if ( current_theme_supports( 'html5' ) ) :
|
209 |
+
?>
|
210 |
+
required="required"<?php endif; ?> /></label>
|
211 |
<?php echo $instance['hidden_fields']; // phpcs:ignore ?>
|
212 |
<input type="hidden" name="submission-type" value="mailpoet" />
|
213 |
<input type="submit" value="<?php echo esc_attr( $instance['button_text'] ); ?>" id="subbutton" />
|
214 |
</form>
|
215 |
+
<?php
|
216 |
endif;
|
217 |
if ( $instance['display_privacy'] && function_exists( 'the_privacy_policy_link' ) ) {
|
218 |
+
the_privacy_policy_link( '<small class="enews-privacy">', '</small>' );
|
219 |
|
220 |
}
|
221 |
// We run KSES on update since we want to allow some HTML, so ignoring the ouput escape check.
|
241 |
*
|
242 |
* @return array Settings to save or bool false to cancel saving
|
243 |
*/
|
244 |
+
public function update( $new_instance, $old_instance ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
|
245 |
+
$new_instance['title'] = trim( strip_tags( $new_instance['title'], '<i>' ) );
|
246 |
+
$new_instance['text'] = trim( wp_kses_post( $new_instance['text'] ) );
|
247 |
$new_instance['hidden_fields'] = strip_tags( $new_instance['hidden_fields'], '<a>, <div>, <fieldset>, <input>, <label>, <legend>, <option>, <optgroup>, <select>, <textarea>' );
|
248 |
+
$new_instance['after_text'] = trim( wp_kses_post( $new_instance['after_text'] ) );
|
249 |
+
$new_instance['id'] = trim( str_replace( 'http://feeds.feedburner.com/', '', $new_instance['id'] ) );
|
250 |
$new_instance['display_privacy'] = ( isset( $new_instance['display_privacy'] ) ) ? (int) $new_instance['display_privacy'] : 0;
|
251 |
|
252 |
if ( isset( $new_instance['mailpoet_check'] ) ) {
|
272 |
$instance = wp_parse_args( (array) $instance, $this->defaults );
|
273 |
?>
|
274 |
<p>
|
275 |
+
<label><?php esc_html_e( 'Title', 'genesis-enews-extended' ); ?>:<br />
|
276 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" class="widefat" />
|
277 |
+
</label>
|
278 |
</p>
|
279 |
|
280 |
<p>
|
281 |
+
<label><?php esc_html_e( 'Text To Show Before Form', 'genesis-enews-extended' ); ?>:<br />
|
282 |
<textarea id="<?php echo esc_attr( $this->get_field_id( 'text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'text' ) ); ?>" class="widefat" rows="6" cols="4"><?php echo esc_html( $instance['text'] ); ?></textarea>
|
283 |
+
</label>
|
284 |
</p>
|
285 |
<p>
|
286 |
+
<label><?php esc_html_e( 'Text To Show After Form', 'genesis-enews-extended' ); ?>:<br />
|
287 |
<textarea id="<?php echo esc_attr( $this->get_field_id( 'after_text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'after_text' ) ); ?>" class="widefat" rows="6" cols="4"><?php echo esc_html( $instance['after_text'] ); ?></textarea>
|
288 |
+
</label>
|
289 |
</p>
|
290 |
|
291 |
<hr style="background-color: #ccc; border: 0; height: 1px; margin: 20px 0;">
|
293 |
if ( class_exists( 'WYSIJA' ) ) :
|
294 |
$mp_model_list = WYSIJA::get( 'list', 'model' );
|
295 |
$mp_lists = $mp_model_list->get(
|
296 |
+
array( 'name', 'list_id' ),
|
297 |
+
array(
|
298 |
'is_enabled' => 1,
|
299 |
)
|
300 |
);
|
301 |
+
?>
|
302 |
<p>
|
303 |
<label for="<?php echo esc_attr( $this->get_field_id( 'mailpoet-list' ) ); ?>"><?php esc_html_e( 'MailPoet List', 'genesis-enews-extended' ); ?>:</label>
|
304 |
<fieldset>
|
310 |
<?php
|
311 |
if ( isset( $instance['mailpoet-list'] ) ) {
|
312 |
checked( in_array( $mp_list['list_id'], (array) $instance['mailpoet-list'], true ) ); }
|
313 |
+
?>
|
314 |
/>
|
315 |
<?php echo esc_html( $mp_list['name'] ); ?>
|
316 |
</label>
|
332 |
</small>
|
333 |
|
334 |
<p>
|
335 |
+
<label><?php esc_html_e( 'Text Displayed If Confirmation Needed', 'genesis-enews-extended' ); ?>:<br />
|
336 |
<textarea id="<?php echo esc_attr( $this->get_field_id( 'mailpoet_check' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'mailpoet_check' ) ); ?>" class="widefat" rows="6" cols="4"><?php echo esc_html( $instance['mailpoet_check'] ); ?></textarea>
|
337 |
+
</label>
|
338 |
</p>
|
339 |
<p>
|
340 |
+
<><?php esc_html_e( 'Text Displayed If Subscribed', 'genesis-enews-extended' ); ?>:<br />
|
341 |
<textarea id="<?php echo esc_attr( $this->get_field_id( 'mailpoet_subbed' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'mailpoet_subbed' ) ); ?>" class="widefat" rows="6" cols="4"><?php echo esc_html( $instance['mailpoet_subbed'] ); ?></textarea>
|
342 |
+
</label>
|
343 |
</p>
|
344 |
</fieldset>
|
345 |
</p>
|
346 |
<hr style="background: #ccc; border: 0; height: 1px; margin: 20px 0;">
|
347 |
<?php endif; ?>
|
348 |
<p>
|
349 |
+
<label><?php esc_html_e( 'Google/Feedburner ID', 'genesis-enews-extended' ); ?>:
|
350 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'id' ) ); ?>" value="<?php echo esc_attr( $instance['id'] ); ?>" class="widefat" /><br />
|
351 |
+
</label>
|
352 |
<small><?php esc_html_e( 'Entering your Feedburner ID here will deactivate the custom options below.', 'genesis-enews-extended' ); ?></small>
|
353 |
</p>
|
354 |
<hr style="background-color: #ccc; border: 0; height: 1px; margin: 20px 0;">
|
355 |
<p>
|
356 |
+
<label><?php esc_html_e( 'Form Action', 'genesis-enews-extended' ); ?>:
|
357 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'action' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'action' ) ); ?>" value="<?php echo esc_attr( $instance['action'] ); ?>" class="widefat" />
|
358 |
+
</label>
|
359 |
</p>
|
360 |
|
361 |
<p>
|
362 |
+
<label><?php esc_html_e( 'E-Mail Field', 'genesis-enews-extended' ); ?>:
|
363 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'email-field' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'email-field' ) ); ?>" value="<?php echo esc_attr( $instance['email-field'] ); ?>" class="widefat" />
|
364 |
+
</label>
|
365 |
</p>
|
366 |
|
367 |
<p>
|
368 |
+
<label><?php esc_html_e( 'First Name Field', 'genesis-enews-extended' ); ?>:
|
369 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'fname-field' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'fname-field' ) ); ?>" value="<?php echo esc_attr( $instance['fname-field'] ); ?>" class="widefat" />
|
370 |
+
</label>
|
371 |
</p>
|
372 |
|
373 |
<p>
|
374 |
+
<label><?php esc_html_e( 'Last Name Field', 'genesis-enews-extended' ); ?>:
|
375 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'lname-field' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'lname-field' ) ); ?>" value="<?php echo esc_attr( $instance['lname-field'] ); ?>" class="widefat" />
|
376 |
+
</label>
|
377 |
</p>
|
378 |
|
379 |
<p>
|
380 |
+
<label><?php esc_html_e( 'Hidden Fields', 'genesis-enews-extended' ); ?>:
|
381 |
<textarea id="<?php echo esc_attr( $this->get_field_id( 'hidden_fields' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'hidden_fields' ) ); ?>" class="widefat"><?php echo esc_attr( $instance['hidden_fields'] ); ?></textarea>
|
382 |
+
</label>
|
383 |
<br><small><?php esc_html_e( 'Not all services use hidden fields.', 'genesis-enews-extended' ); ?></small>
|
384 |
</p>
|
385 |
|
386 |
+
<p><label>
|
387 |
<input id="<?php echo esc_attr( $this->get_field_id( 'open_same_window' ) ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'open_same_window' ) ); ?>" value="1" <?php checked( $instance['open_same_window'] ); ?>/>
|
388 |
+
<?php esc_html_e( 'Open confirmation page in same window?', 'genesis-enews-extended' ); ?>
|
389 |
+
</label>
|
390 |
</p>
|
391 |
<hr style="background-color: #ccc; border: 0; height: 1px; margin: 20px 0;">
|
392 |
<p>
|
393 |
<?php $fname_text = empty( $instance['fname_text'] ) ? __( 'First Name', 'genesis-enews-extended' ) : $instance['fname_text']; ?>
|
394 |
+
<label><?php esc_html_e( 'First Name Input Text', 'genesis-enews-extended' ); ?>:
|
395 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'fname_text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'fname_text' ) ); ?>" value="<?php echo esc_attr( $fname_text ); ?>" class="widefat" />
|
396 |
+
</label>
|
397 |
</p>
|
398 |
<p>
|
399 |
<?php $lname_text = empty( $instance['lname_text'] ) ? __( 'Last Name', 'genesis-enews-extended' ) : $instance['lname_text']; ?>
|
400 |
+
<label><?php esc_html_e( 'Last Name Input Text', 'genesis-enews-extended' ); ?>:
|
401 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'lname_text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'lname_text' ) ); ?>" value="<?php echo esc_attr( $lname_text ); ?>" class="widefat" />
|
402 |
+
</label>
|
403 |
</p>
|
404 |
<p>
|
405 |
<?php $input_text = empty( $instance['input_text'] ) ? __( 'E-Mail Address', 'genesis-enews-extended' ) : $instance['input_text']; ?>
|
406 |
+
<label><?php esc_html_e( 'E-Mail Input Text', 'genesis-enews-extended' ); ?>:
|
407 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'input_text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'input_text' ) ); ?>" value="<?php echo esc_attr( $input_text ); ?>" class="widefat" />
|
408 |
+
</label>
|
409 |
</p>
|
410 |
|
411 |
<p>
|
412 |
<?php $button_text = empty( $instance['button_text'] ) ? __( 'Go', 'genesis-enews-extended' ) : $instance['button_text']; ?>
|
413 |
+
<label><?php esc_html_e( 'Button Text', 'genesis-enews-extended' ); ?>:
|
414 |
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'button_text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'button_text' ) ); ?>" value="<?php echo esc_attr( $button_text ); ?>" class="widefat" />
|
415 |
+
</label>
|
416 |
</p>
|
417 |
<p>
|
418 |
+
<label>
|
419 |
<input id="<?php echo esc_attr( $this->get_field_id( 'display_privacy' ) ); ?>" type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'display_privacy' ) ); ?>" value="1" <?php checked( $instance['display_privacy'] ); ?>/>
|
420 |
+
<?php esc_html_e( 'Display link to privacy policy?', 'genesis-enews-extended' ); ?></label>
|
421 |
</p>
|
422 |
|
423 |
+
<?php
|
424 |
}
|
425 |
|
426 |
}
|
composer.json
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "kraftbj/genesis-enews-extended",
|
3 |
+
"description": "Mailing subscription form plugin for WordPress",
|
4 |
+
"type": "project",
|
5 |
+
"require-dev": {
|
6 |
+
"automattic/jetpack-codesniffer": "^1.0"
|
7 |
+
},
|
8 |
+
"license": "GPL2+",
|
9 |
+
"authors": [
|
10 |
+
{
|
11 |
+
"name": "Brandon Kraft",
|
12 |
+
"email": "public@brandonkraft.com"
|
13 |
+
}
|
14 |
+
],
|
15 |
+
"require": {}
|
16 |
+
}
|
composer.lock
ADDED
@@ -0,0 +1,426 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_readme": [
|
3 |
+
"This file locks the dependencies of your project to a known state",
|
4 |
+
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
+
"This file is @generated automatically"
|
6 |
+
],
|
7 |
+
"content-hash": "5ff4eaa15543d7d0b2b06ad214db3399",
|
8 |
+
"packages": [],
|
9 |
+
"packages-dev": [
|
10 |
+
{
|
11 |
+
"name": "automattic/jetpack-codesniffer",
|
12 |
+
"version": "v1.0.0",
|
13 |
+
"source": {
|
14 |
+
"type": "git",
|
15 |
+
"url": "https://github.com/Automattic/jetpack-codesniffer.git",
|
16 |
+
"reference": "6251c655757fd77b049f5b89e2c89e30caf4cd51"
|
17 |
+
},
|
18 |
+
"dist": {
|
19 |
+
"type": "zip",
|
20 |
+
"url": "https://api.github.com/repos/Automattic/jetpack-codesniffer/zipball/6251c655757fd77b049f5b89e2c89e30caf4cd51",
|
21 |
+
"reference": "6251c655757fd77b049f5b89e2c89e30caf4cd51",
|
22 |
+
"shasum": ""
|
23 |
+
},
|
24 |
+
"require": {
|
25 |
+
"dealerdirect/phpcodesniffer-composer-installer": "0.*",
|
26 |
+
"phpcompatibility/phpcompatibility-wp": "2.1.0",
|
27 |
+
"sirbrillig/phpcs-variable-analysis": "2.9.0",
|
28 |
+
"wp-coding-standards/wpcs": "2.3.0"
|
29 |
+
},
|
30 |
+
"require-dev": {
|
31 |
+
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5"
|
32 |
+
},
|
33 |
+
"type": "phpcodesniffer-standard",
|
34 |
+
"autoload": {
|
35 |
+
"psr-4": {
|
36 |
+
"Automattic\\Jetpack\\Sniffs\\": "Jetpack/Sniffs"
|
37 |
+
}
|
38 |
+
},
|
39 |
+
"notification-url": "https://packagist.org/downloads/",
|
40 |
+
"license": [
|
41 |
+
"GPL-2.0-or-later"
|
42 |
+
],
|
43 |
+
"description": "Jetpack Coding Standards. Based on the WordPress Coding Standards, with some additions.",
|
44 |
+
"time": "2020-10-19T20:39:57+00:00"
|
45 |
+
},
|
46 |
+
{
|
47 |
+
"name": "dealerdirect/phpcodesniffer-composer-installer",
|
48 |
+
"version": "v0.7.0",
|
49 |
+
"source": {
|
50 |
+
"type": "git",
|
51 |
+
"url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
|
52 |
+
"reference": "e8d808670b8f882188368faaf1144448c169c0b7"
|
53 |
+
},
|
54 |
+
"dist": {
|
55 |
+
"type": "zip",
|
56 |
+
"url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e8d808670b8f882188368faaf1144448c169c0b7",
|
57 |
+
"reference": "e8d808670b8f882188368faaf1144448c169c0b7",
|
58 |
+
"shasum": ""
|
59 |
+
},
|
60 |
+
"require": {
|
61 |
+
"composer-plugin-api": "^1.0 || ^2.0",
|
62 |
+
"php": ">=5.3",
|
63 |
+
"squizlabs/php_codesniffer": "^2 || ^3 || 4.0.x-dev"
|
64 |
+
},
|
65 |
+
"require-dev": {
|
66 |
+
"composer/composer": "*",
|
67 |
+
"phpcompatibility/php-compatibility": "^9.0",
|
68 |
+
"sensiolabs/security-checker": "^4.1.0"
|
69 |
+
},
|
70 |
+
"type": "composer-plugin",
|
71 |
+
"extra": {
|
72 |
+
"class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
|
73 |
+
},
|
74 |
+
"autoload": {
|
75 |
+
"psr-4": {
|
76 |
+
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
|
77 |
+
}
|
78 |
+
},
|
79 |
+
"notification-url": "https://packagist.org/downloads/",
|
80 |
+
"license": [
|
81 |
+
"MIT"
|
82 |
+
],
|
83 |
+
"authors": [
|
84 |
+
{
|
85 |
+
"name": "Franck Nijhof",
|
86 |
+
"email": "franck.nijhof@dealerdirect.com",
|
87 |
+
"homepage": "http://www.frenck.nl",
|
88 |
+
"role": "Developer / IT Manager"
|
89 |
+
}
|
90 |
+
],
|
91 |
+
"description": "PHP_CodeSniffer Standards Composer Installer Plugin",
|
92 |
+
"homepage": "http://www.dealerdirect.com",
|
93 |
+
"keywords": [
|
94 |
+
"PHPCodeSniffer",
|
95 |
+
"PHP_CodeSniffer",
|
96 |
+
"code quality",
|
97 |
+
"codesniffer",
|
98 |
+
"composer",
|
99 |
+
"installer",
|
100 |
+
"phpcs",
|
101 |
+
"plugin",
|
102 |
+
"qa",
|
103 |
+
"quality",
|
104 |
+
"standard",
|
105 |
+
"standards",
|
106 |
+
"style guide",
|
107 |
+
"stylecheck",
|
108 |
+
"tests"
|
109 |
+
],
|
110 |
+
"time": "2020-06-25T14:57:39+00:00"
|
111 |
+
},
|
112 |
+
{
|
113 |
+
"name": "phpcompatibility/php-compatibility",
|
114 |
+
"version": "9.3.5",
|
115 |
+
"source": {
|
116 |
+
"type": "git",
|
117 |
+
"url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
|
118 |
+
"reference": "9fb324479acf6f39452e0655d2429cc0d3914243"
|
119 |
+
},
|
120 |
+
"dist": {
|
121 |
+
"type": "zip",
|
122 |
+
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243",
|
123 |
+
"reference": "9fb324479acf6f39452e0655d2429cc0d3914243",
|
124 |
+
"shasum": ""
|
125 |
+
},
|
126 |
+
"require": {
|
127 |
+
"php": ">=5.3",
|
128 |
+
"squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
|
129 |
+
},
|
130 |
+
"conflict": {
|
131 |
+
"squizlabs/php_codesniffer": "2.6.2"
|
132 |
+
},
|
133 |
+
"require-dev": {
|
134 |
+
"phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
|
135 |
+
},
|
136 |
+
"suggest": {
|
137 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
|
138 |
+
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
139 |
+
},
|
140 |
+
"type": "phpcodesniffer-standard",
|
141 |
+
"notification-url": "https://packagist.org/downloads/",
|
142 |
+
"license": [
|
143 |
+
"LGPL-3.0-or-later"
|
144 |
+
],
|
145 |
+
"authors": [
|
146 |
+
{
|
147 |
+
"name": "Wim Godden",
|
148 |
+
"homepage": "https://github.com/wimg",
|
149 |
+
"role": "lead"
|
150 |
+
},
|
151 |
+
{
|
152 |
+
"name": "Juliette Reinders Folmer",
|
153 |
+
"homepage": "https://github.com/jrfnl",
|
154 |
+
"role": "lead"
|
155 |
+
},
|
156 |
+
{
|
157 |
+
"name": "Contributors",
|
158 |
+
"homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors"
|
159 |
+
}
|
160 |
+
],
|
161 |
+
"description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.",
|
162 |
+
"homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
|
163 |
+
"keywords": [
|
164 |
+
"compatibility",
|
165 |
+
"phpcs",
|
166 |
+
"standards"
|
167 |
+
],
|
168 |
+
"time": "2019-12-27T09:44:58+00:00"
|
169 |
+
},
|
170 |
+
{
|
171 |
+
"name": "phpcompatibility/phpcompatibility-paragonie",
|
172 |
+
"version": "1.3.0",
|
173 |
+
"source": {
|
174 |
+
"type": "git",
|
175 |
+
"url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
|
176 |
+
"reference": "b862bc32f7e860d0b164b199bd995e690b4b191c"
|
177 |
+
},
|
178 |
+
"dist": {
|
179 |
+
"type": "zip",
|
180 |
+
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/b862bc32f7e860d0b164b199bd995e690b4b191c",
|
181 |
+
"reference": "b862bc32f7e860d0b164b199bd995e690b4b191c",
|
182 |
+
"shasum": ""
|
183 |
+
},
|
184 |
+
"require": {
|
185 |
+
"phpcompatibility/php-compatibility": "^9.0"
|
186 |
+
},
|
187 |
+
"require-dev": {
|
188 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5",
|
189 |
+
"paragonie/random_compat": "dev-master",
|
190 |
+
"paragonie/sodium_compat": "dev-master"
|
191 |
+
},
|
192 |
+
"suggest": {
|
193 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
|
194 |
+
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
195 |
+
},
|
196 |
+
"type": "phpcodesniffer-standard",
|
197 |
+
"notification-url": "https://packagist.org/downloads/",
|
198 |
+
"license": [
|
199 |
+
"LGPL-3.0-or-later"
|
200 |
+
],
|
201 |
+
"authors": [
|
202 |
+
{
|
203 |
+
"name": "Wim Godden",
|
204 |
+
"role": "lead"
|
205 |
+
},
|
206 |
+
{
|
207 |
+
"name": "Juliette Reinders Folmer",
|
208 |
+
"role": "lead"
|
209 |
+
}
|
210 |
+
],
|
211 |
+
"description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.",
|
212 |
+
"homepage": "http://phpcompatibility.com/",
|
213 |
+
"keywords": [
|
214 |
+
"compatibility",
|
215 |
+
"paragonie",
|
216 |
+
"phpcs",
|
217 |
+
"polyfill",
|
218 |
+
"standards"
|
219 |
+
],
|
220 |
+
"time": "2019-11-04T15:17:54+00:00"
|
221 |
+
},
|
222 |
+
{
|
223 |
+
"name": "phpcompatibility/phpcompatibility-wp",
|
224 |
+
"version": "2.1.0",
|
225 |
+
"source": {
|
226 |
+
"type": "git",
|
227 |
+
"url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git",
|
228 |
+
"reference": "41bef18ba688af638b7310666db28e1ea9158b2f"
|
229 |
+
},
|
230 |
+
"dist": {
|
231 |
+
"type": "zip",
|
232 |
+
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/41bef18ba688af638b7310666db28e1ea9158b2f",
|
233 |
+
"reference": "41bef18ba688af638b7310666db28e1ea9158b2f",
|
234 |
+
"shasum": ""
|
235 |
+
},
|
236 |
+
"require": {
|
237 |
+
"phpcompatibility/php-compatibility": "^9.0",
|
238 |
+
"phpcompatibility/phpcompatibility-paragonie": "^1.0"
|
239 |
+
},
|
240 |
+
"require-dev": {
|
241 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5"
|
242 |
+
},
|
243 |
+
"suggest": {
|
244 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
|
245 |
+
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
246 |
+
},
|
247 |
+
"type": "phpcodesniffer-standard",
|
248 |
+
"notification-url": "https://packagist.org/downloads/",
|
249 |
+
"license": [
|
250 |
+
"LGPL-3.0-or-later"
|
251 |
+
],
|
252 |
+
"authors": [
|
253 |
+
{
|
254 |
+
"name": "Wim Godden",
|
255 |
+
"role": "lead"
|
256 |
+
},
|
257 |
+
{
|
258 |
+
"name": "Juliette Reinders Folmer",
|
259 |
+
"role": "lead"
|
260 |
+
}
|
261 |
+
],
|
262 |
+
"description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.",
|
263 |
+
"homepage": "http://phpcompatibility.com/",
|
264 |
+
"keywords": [
|
265 |
+
"compatibility",
|
266 |
+
"phpcs",
|
267 |
+
"standards",
|
268 |
+
"wordpress"
|
269 |
+
],
|
270 |
+
"time": "2019-08-28T14:22:28+00:00"
|
271 |
+
},
|
272 |
+
{
|
273 |
+
"name": "sirbrillig/phpcs-variable-analysis",
|
274 |
+
"version": "v2.9.0",
|
275 |
+
"source": {
|
276 |
+
"type": "git",
|
277 |
+
"url": "https://github.com/sirbrillig/phpcs-variable-analysis.git",
|
278 |
+
"reference": "ff54d4ec7f2bd152d526fdabfeff639aa9b8be01"
|
279 |
+
},
|
280 |
+
"dist": {
|
281 |
+
"type": "zip",
|
282 |
+
"url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/ff54d4ec7f2bd152d526fdabfeff639aa9b8be01",
|
283 |
+
"reference": "ff54d4ec7f2bd152d526fdabfeff639aa9b8be01",
|
284 |
+
"shasum": ""
|
285 |
+
},
|
286 |
+
"require": {
|
287 |
+
"php": ">=5.4.0",
|
288 |
+
"squizlabs/php_codesniffer": "^3.1"
|
289 |
+
},
|
290 |
+
"require-dev": {
|
291 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4 || ^0.5 || ^0.6",
|
292 |
+
"limedeck/phpunit-detailed-printer": "^3.1 || ^4.0 || ^5.0",
|
293 |
+
"phpstan/phpstan": "^0.11.8",
|
294 |
+
"phpunit/phpunit": "^5.0 || ^6.5 || ^7.0 || ^8.0",
|
295 |
+
"sirbrillig/phpcs-import-detection": "^1.1"
|
296 |
+
},
|
297 |
+
"type": "phpcodesniffer-standard",
|
298 |
+
"autoload": {
|
299 |
+
"psr-4": {
|
300 |
+
"VariableAnalysis\\": "VariableAnalysis/"
|
301 |
+
}
|
302 |
+
},
|
303 |
+
"notification-url": "https://packagist.org/downloads/",
|
304 |
+
"license": [
|
305 |
+
"BSD-2-Clause"
|
306 |
+
],
|
307 |
+
"authors": [
|
308 |
+
{
|
309 |
+
"name": "Sam Graham",
|
310 |
+
"email": "php-codesniffer-variableanalysis@illusori.co.uk"
|
311 |
+
},
|
312 |
+
{
|
313 |
+
"name": "Payton Swick",
|
314 |
+
"email": "payton@foolord.com"
|
315 |
+
}
|
316 |
+
],
|
317 |
+
"description": "A PHPCS sniff to detect problems with variables.",
|
318 |
+
"time": "2020-10-07T23:32:29+00:00"
|
319 |
+
},
|
320 |
+
{
|
321 |
+
"name": "squizlabs/php_codesniffer",
|
322 |
+
"version": "3.5.6",
|
323 |
+
"source": {
|
324 |
+
"type": "git",
|
325 |
+
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
|
326 |
+
"reference": "e97627871a7eab2f70e59166072a6b767d5834e0"
|
327 |
+
},
|
328 |
+
"dist": {
|
329 |
+
"type": "zip",
|
330 |
+
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e97627871a7eab2f70e59166072a6b767d5834e0",
|
331 |
+
"reference": "e97627871a7eab2f70e59166072a6b767d5834e0",
|
332 |
+
"shasum": ""
|
333 |
+
},
|
334 |
+
"require": {
|
335 |
+
"ext-simplexml": "*",
|
336 |
+
"ext-tokenizer": "*",
|
337 |
+
"ext-xmlwriter": "*",
|
338 |
+
"php": ">=5.4.0"
|
339 |
+
},
|
340 |
+
"require-dev": {
|
341 |
+
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
|
342 |
+
},
|
343 |
+
"bin": [
|
344 |
+
"bin/phpcs",
|
345 |
+
"bin/phpcbf"
|
346 |
+
],
|
347 |
+
"type": "library",
|
348 |
+
"extra": {
|
349 |
+
"branch-alias": {
|
350 |
+
"dev-master": "3.x-dev"
|
351 |
+
}
|
352 |
+
},
|
353 |
+
"notification-url": "https://packagist.org/downloads/",
|
354 |
+
"license": [
|
355 |
+
"BSD-3-Clause"
|
356 |
+
],
|
357 |
+
"authors": [
|
358 |
+
{
|
359 |
+
"name": "Greg Sherwood",
|
360 |
+
"role": "lead"
|
361 |
+
}
|
362 |
+
],
|
363 |
+
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
|
364 |
+
"homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
|
365 |
+
"keywords": [
|
366 |
+
"phpcs",
|
367 |
+
"standards"
|
368 |
+
],
|
369 |
+
"time": "2020-08-10T04:50:15+00:00"
|
370 |
+
},
|
371 |
+
{
|
372 |
+
"name": "wp-coding-standards/wpcs",
|
373 |
+
"version": "2.3.0",
|
374 |
+
"source": {
|
375 |
+
"type": "git",
|
376 |
+
"url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
|
377 |
+
"reference": "7da1894633f168fe244afc6de00d141f27517b62"
|
378 |
+
},
|
379 |
+
"dist": {
|
380 |
+
"type": "zip",
|
381 |
+
"url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62",
|
382 |
+
"reference": "7da1894633f168fe244afc6de00d141f27517b62",
|
383 |
+
"shasum": ""
|
384 |
+
},
|
385 |
+
"require": {
|
386 |
+
"php": ">=5.4",
|
387 |
+
"squizlabs/php_codesniffer": "^3.3.1"
|
388 |
+
},
|
389 |
+
"require-dev": {
|
390 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6",
|
391 |
+
"phpcompatibility/php-compatibility": "^9.0",
|
392 |
+
"phpcsstandards/phpcsdevtools": "^1.0",
|
393 |
+
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
|
394 |
+
},
|
395 |
+
"suggest": {
|
396 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
|
397 |
+
},
|
398 |
+
"type": "phpcodesniffer-standard",
|
399 |
+
"notification-url": "https://packagist.org/downloads/",
|
400 |
+
"license": [
|
401 |
+
"MIT"
|
402 |
+
],
|
403 |
+
"authors": [
|
404 |
+
{
|
405 |
+
"name": "Contributors",
|
406 |
+
"homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors"
|
407 |
+
}
|
408 |
+
],
|
409 |
+
"description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
|
410 |
+
"keywords": [
|
411 |
+
"phpcs",
|
412 |
+
"standards",
|
413 |
+
"wordpress"
|
414 |
+
],
|
415 |
+
"time": "2020-05-13T23:57:56+00:00"
|
416 |
+
}
|
417 |
+
],
|
418 |
+
"aliases": [],
|
419 |
+
"minimum-stability": "stable",
|
420 |
+
"stability-flags": [],
|
421 |
+
"prefer-stable": false,
|
422 |
+
"prefer-lowest": false,
|
423 |
+
"platform": [],
|
424 |
+
"platform-dev": [],
|
425 |
+
"plugin-api-version": "1.1.0"
|
426 |
+
}
|
languages/index.php
CHANGED
@@ -1,2 +1,10 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Shh... I'm sleeping here.
|
4 |
+
*
|
5 |
+
* Just an empty file.
|
6 |
+
*
|
7 |
+
* @package kraftbj/genesis-enews-extended.
|
8 |
+
*/
|
9 |
+
|
10 |
+
// Silence.
|
phpunit.xml.dist
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<phpunit bootstrap="tests/bootstrap.php" backupGlobals="false" colors="true">
|
2 |
+
<testsuites>
|
3 |
+
<!-- Default test suite to run all tests -->
|
4 |
+
<testsuite>
|
5 |
+
<directory prefix="test-" suffix=".php">tests</directory>
|
6 |
+
</testsuite>
|
7 |
+
</testsuites>
|
8 |
+
</phpunit>
|
plugin.php
CHANGED
@@ -3,9 +3,9 @@
|
|
3 |
* Genesis eNews Extended
|
4 |
*
|
5 |
* @package BJGK\Genesis_enews_extended
|
6 |
-
* @version 2.1.
|
7 |
* @author Brandon Kraft <public@brandonkraft.com>
|
8 |
-
* @copyright Copyright (c) 2012-
|
9 |
* @link https://kraft.blog/genesis-enews-extended/
|
10 |
* @license GPL-2.0+
|
11 |
*
|
@@ -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.
|
17 |
* Author: Brandon Kraft
|
18 |
* Author URI: https://kraft.blog/
|
19 |
* License: GPL-2.0+
|
@@ -64,7 +64,7 @@ function bjgk_genesis_enews_load_widgets() {
|
|
64 |
* @since 0.1.0
|
65 |
*/
|
66 |
function bjgk_genesis_enews_css() {
|
67 |
-
echo '<style type="text/css"> .enews .screenread {
|
68 |
height: 1px;
|
69 |
left: -1000em;
|
70 |
overflow: hidden;
|
3 |
* Genesis eNews Extended
|
4 |
*
|
5 |
* @package BJGK\Genesis_enews_extended
|
6 |
+
* @version 2.1.2
|
7 |
* @author Brandon Kraft <public@brandonkraft.com>
|
8 |
+
* @copyright Copyright (c) 2012-2020, Brandon Kraft
|
9 |
* @link https://kraft.blog/genesis-enews-extended/
|
10 |
* @license GPL-2.0+
|
11 |
*
|
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.2
|
17 |
* Author: Brandon Kraft
|
18 |
* Author URI: https://kraft.blog/
|
19 |
* License: GPL-2.0+
|
64 |
* @since 0.1.0
|
65 |
*/
|
66 |
function bjgk_genesis_enews_css() {
|
67 |
+
echo '<style type="text/css"> .enews .screenread :not( input, textarea ){
|
68 |
height: 1px;
|
69 |
left: -1000em;
|
70 |
overflow: hidden;
|
readme.txt
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
=== Genesis eNews Extended ===
|
2 |
Contributors: kraftbj
|
3 |
Donate link: https://kraft.blog/donate/
|
4 |
-
Tags: genesis, genesiswp, mailchimp, aweber, studiopress, newsletter, subscribe
|
5 |
Requires at least: 4.9.6
|
6 |
-
|
|
|
7 |
Text Domain: genesis-enews-extended
|
8 |
-
Stable tag: 2.1.
|
9 |
|
10 |
Creates a new widget to easily add mailing lists integration to a Genesis website. Works with FeedBurner, MailChimp, AWeber, FeedBlitz, ConvertKit and more.
|
11 |
|
@@ -50,6 +51,12 @@ Questions can be asked at the [WordPress.org Support Forum](https://wordpress.or
|
|
50 |
2. Widget setting screen.
|
51 |
|
52 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
= 2.1.0 =
|
55 |
* Provide option to link to the site's Privacy Policy.
|
1 |
=== Genesis eNews Extended ===
|
2 |
Contributors: kraftbj
|
3 |
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.2
|
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.1.2 =
|
55 |
+
* Accessibility: Updates <label> to be implicit to eliminate duplication when multiple instances are used on a page.
|
56 |
+
* Coding Standards: Implement WPCS.
|
57 |
+
|
58 |
+
= 2.1.1 =
|
59 |
+
* Remove comment that was displaying on the front end.
|
60 |
|
61 |
= 2.1.0 =
|
62 |
* Provide option to link to the site's Privacy Policy.
|