Version Description
- Adds Feedburner support in anticipation of Genesis 1.9
- Security and translation updates
Download this release
Release Info
Developer | kraftbj |
Plugin | Genesis eNews Extended |
Version | 0.1.3 |
Comparing to | |
See all releases |
Code changes from version 0.1.2 to 0.1.3
- plugin.php +182 -167
- readme.txt +65 -62
plugin.php
CHANGED
@@ -1,168 +1,183 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Name: Genesis eNews Extended
|
4 |
-
* Plugin URI: http://www.brandonkraft.com/contrib/plugins/genesis-enews-extended/
|
5 |
-
* Description: Replaces the Genesis eNews Widget to allow easier use of additional mailing services.
|
6 |
-
* Version: 0.1.
|
7 |
-
* Author: Brandon Kraft
|
8 |
-
* Author URI: http://www.brandonkraft.com
|
9 |
-
*
|
10 |
-
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
|
11 |
-
* General Public License version 2, as published by the Free Software Foundation. You may NOT assume
|
12 |
-
* that you can use any other version of the GPL.
|
13 |
-
*
|
14 |
-
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
15 |
-
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
16 |
-
*
|
17 |
-
*
|
18 |
-
*
|
19 |
-
* @
|
20 |
-
* @
|
21 |
-
* @
|
22 |
-
* @
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
*
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
'
|
43 |
-
'
|
44 |
-
'
|
45 |
-
'
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
*
|
61 |
-
*
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
<input type="
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
<
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
<
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
<
|
142 |
-
<
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
<?php $
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: Genesis eNews Extended
|
4 |
+
* Plugin URI: http://www.brandonkraft.com/contrib/plugins/genesis-enews-extended/
|
5 |
+
* Description: Replaces the Genesis eNews Widget to allow easier use of additional mailing services.
|
6 |
+
* Version: 0.1.3
|
7 |
+
* Author: Brandon Kraft
|
8 |
+
* Author URI: http://www.brandonkraft.com
|
9 |
+
*
|
10 |
+
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
|
11 |
+
* General Public License version 2, as published by the Free Software Foundation. You may NOT assume
|
12 |
+
* that you can use any other version of the GPL.
|
13 |
+
*
|
14 |
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
15 |
+
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
16 |
+
*
|
17 |
+
* Code based on original eNews Widget in the Genesis Framework by StudioPress - http://www.studiopress.com
|
18 |
+
*
|
19 |
+
* @package BJGK_Genesis_enews_extended
|
20 |
+
* @version 0.1.3
|
21 |
+
* @author Brandon Kraft <bk@kraft.im>
|
22 |
+
* @copyright Copyright (c) 2012, Brandon Kraft
|
23 |
+
* @link http://www.brandonkraft.com
|
24 |
+
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
25 |
+
*/
|
26 |
+
|
27 |
+
class BJGK_Genesis_eNews_Extended extends WP_Widget {
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Holds widget settings defaults, populated in constructor.
|
31 |
+
*
|
32 |
+
* @var array
|
33 |
+
*/
|
34 |
+
protected $defaults;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Constructor. Set the default widget options and create widget.
|
38 |
+
*/
|
39 |
+
function __construct() {
|
40 |
+
|
41 |
+
$this->defaults = array(
|
42 |
+
'title' => '',
|
43 |
+
'text' => '',
|
44 |
+
'hidden_fields' => '',
|
45 |
+
'input_text' => '',
|
46 |
+
'button_text' => '',
|
47 |
+
'action' => '',
|
48 |
+
);
|
49 |
+
|
50 |
+
$widget_ops = array(
|
51 |
+
'classname' => 'enews-widget',
|
52 |
+
'description' => __( 'Displays subscribe form', 'genesis' ),
|
53 |
+
);
|
54 |
+
|
55 |
+
$this->WP_Widget( 'enews-ext', __( 'Genesis - eNews Extended', 'genesis' ), $widget_ops );
|
56 |
+
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Echo the widget content.
|
61 |
+
*
|
62 |
+
* @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
|
63 |
+
* @param array $instance The settings for the particular instance of the widget
|
64 |
+
*/
|
65 |
+
function widget( $args, $instance ) {
|
66 |
+
|
67 |
+
extract( $args );
|
68 |
+
|
69 |
+
/** Merge with defaults */
|
70 |
+
$instance = wp_parse_args( (array) $instance, $this->defaults );
|
71 |
+
|
72 |
+
echo $before_widget . '<div class="enews">';
|
73 |
+
|
74 |
+
if ( ! empty( $instance['title'] ) )
|
75 |
+
echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title;
|
76 |
+
|
77 |
+
echo wpautop( $instance['text'] ); // We run KSES on update
|
78 |
+
|
79 |
+
if ( ! empty( $instance['id'] ) ) : ?>
|
80 |
+
<form id="subscribe" action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open( 'http://feedburner.google.com/fb/a/mailverify?uri=<?php echo esc_js( $instance['id'] ); ?>', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">
|
81 |
+
<input type="text" value="<?php echo esc_attr( $instance['input_text'] ); ?>" id="subbox" onfocus="if ( this.value == '<?php echo esc_js( $instance['input_text'] ); ?>') { this.value = ''; }" onblur="if ( this.value == '' ) { this.value = '<?php echo esc_js( $instance['input_text'] ); ?>'; }" name="email" />
|
82 |
+
<input type="hidden" name="uri" value="<?php echo esc_attr( $instance['id'] ); ?>" />
|
83 |
+
<input type="hidden" name="loc" value="<?php echo esc_attr( get_locale() ); ?>" />
|
84 |
+
<input type="submit" value="<?php echo esc_attr( $instance['button_text'] ); ?>" id="subbutton" />
|
85 |
+
</form>
|
86 |
+
<?php elseif ( ! empty( $instance['action'] ) ) : ?>
|
87 |
+
<form id="subscribe" action="<?php echo esc_js( $instance['action'] ); ?>" method="post" target="_blank">
|
88 |
+
<input type="text" value="<?php echo esc_attr( $instance['input_text'] ); ?>" id="subbox" onfocus="if ( this.value == '<?php echo esc_js( $instance['input_text'] ); ?>') { this.value = ''; }" onblur="if ( this.value == '' ) { this.value = '<?php echo esc_js( $instance['input_text'] ); ?>'; }" name="<?php echo esc_js( $instance['email-field'] ); ?>" />
|
89 |
+
<?php echo $instance['hidden_fields']; ?>
|
90 |
+
<input type="submit" value="<?php echo esc_attr( $instance['button_text'] ); ?>" id="subbutton" />
|
91 |
+
</form>
|
92 |
+
<?php endif;
|
93 |
+
|
94 |
+
echo '</div>' . $after_widget;
|
95 |
+
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Update a particular instance.
|
100 |
+
*
|
101 |
+
* This function should check that $new_instance is set correctly.
|
102 |
+
* The newly calculated value of $instance should be returned.
|
103 |
+
* If "false" is returned, the instance won't be saved/updated.
|
104 |
+
*
|
105 |
+
* @param array $new_instance New settings for this instance as input by the user via form()
|
106 |
+
* @param array $old_instance Old settings for this instance
|
107 |
+
* @return array Settings to save or bool false to cancel saving
|
108 |
+
*/
|
109 |
+
function update( $new_instance, $old_instance ) {
|
110 |
+
|
111 |
+
$new_instance['title'] = strip_tags( $new_instance['title'] );
|
112 |
+
$new_instance['text'] = wp_kses( $new_instance['text'], genesis_formatting_allowedtags() );
|
113 |
+
$new_instance['hidden_fields'] = strip_tags( $new_instance['hidden_fields'], "<input>" );
|
114 |
+
return $new_instance;
|
115 |
+
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Echo the settings update form.
|
120 |
+
*
|
121 |
+
* @param array $instance Current settings
|
122 |
+
*/
|
123 |
+
function form( $instance ) {
|
124 |
+
|
125 |
+
/** Merge with defaults */
|
126 |
+
$instance = wp_parse_args( (array) $instance, $this->defaults );
|
127 |
+
|
128 |
+
?>
|
129 |
+
<p>
|
130 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'enews-ext' ); ?>:</label><br />
|
131 |
+
<input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" class="widefat" />
|
132 |
+
</p>
|
133 |
+
|
134 |
+
<p>
|
135 |
+
<label for="<?php echo $this->get_field_id( 'text' ); ?>"><?php _e( 'Text To Show', 'enews-ext' ); ?>:</label><br />
|
136 |
+
<textarea id="<?php echo $this->get_field_id( 'text' ); ?>" name="<?php echo $this->get_field_name( 'text' ); ?>" class="widefat" rows="6" cols="4"><?php echo htmlspecialchars( $instance['text'] ); ?></textarea>
|
137 |
+
</p>
|
138 |
+
<hr style="background: #ccc; border: 0; height: 1px; margin: 20px 0;">
|
139 |
+
<p>
|
140 |
+
<label for="<?php echo $this->get_field_id( 'id' ); ?>"><?php _e( 'Google/Feedburner ID', 'enews-ext' ); ?>:</label>
|
141 |
+
<input type="text" id="<?php echo $this->get_field_id( 'id' ); ?>" name="<?php echo $this->get_field_name( 'id' ); ?>" value="<?php echo esc_attr( $instance['id'] ); ?>" class="widefat" /><br />
|
142 |
+
<small><?php _e( 'Entering your Feedburner ID here will deactivate the custom options below.', 'enews-ext' ); ?></small>
|
143 |
+
</p>
|
144 |
+
<hr style="background: #ccc; border: 0; height: 1px; margin: 20px 0;">
|
145 |
+
<p>
|
146 |
+
<label for="<?php echo $this->get_field_id( 'action' ); ?>"><?php _e( 'Form Action', 'enews-ext' ); ?>:</label>
|
147 |
+
<input type="text" id="<?php echo $this->get_field_id( 'action' ); ?>" name="<?php echo $this->get_field_name( 'action' ); ?>" value="<?php echo esc_attr( $instance['action'] ); ?>" class="widefat" />
|
148 |
+
</p>
|
149 |
+
|
150 |
+
<p>
|
151 |
+
<label for="<?php echo $this->get_field_id( 'email-field' ); ?>"><?php _e( 'E-Mail Field', 'enews-ext' ); ?>:</label>
|
152 |
+
<input type="text" id="<?php echo $this->get_field_id( 'email-field' ); ?>" name="<?php echo $this->get_field_name( 'email-field' ); ?>" value="<?php echo esc_attr( $instance['email-field'] ); ?>" class="widefat" />
|
153 |
+
</p>
|
154 |
+
|
155 |
+
<p>
|
156 |
+
<label for="<?php echo $this->get_field_id( 'hidden_fields' ); ?>"><?php _e( 'Hidden Fields', 'enews-ext' ); ?>:</label>
|
157 |
+
<textarea id="<?php echo $this->get_field_id( 'hidden_fields' ); ?>" name="<?php echo $this->get_field_name( 'hidden_fields' ); ?>" class="widefat"><?php echo esc_attr( $instance['hidden_fields'] ); ?></textarea>
|
158 |
+
<br><small><?php _e( 'Not all services use hidden fields.', 'enews-ext'); ?></small>
|
159 |
+
</p>
|
160 |
+
<hr style="background: #ccc; border: 0; height: 1px; margin: 20px 0;">
|
161 |
+
<p>
|
162 |
+
<?php $input_text = empty( $instance['input_text'] ) ? __( 'Enter your email address...', 'enews-ext' ) : $instance['input_text']; ?>
|
163 |
+
<label for="<?php echo $this->get_field_id( 'id' ); ?>"><?php _e( 'Input Text', 'enews-ext' ); ?>:</label>
|
164 |
+
<input type="text" id="<?php echo $this->get_field_id( 'input_text' ); ?>" name="<?php echo $this->get_field_name( 'input_text' ); ?>" value="<?php echo esc_attr( $input_text ); ?>" class="widefat" />
|
165 |
+
</p>
|
166 |
+
|
167 |
+
<p>
|
168 |
+
<?php $button_text = empty( $instance['button_text'] ) ? __( 'Go', 'enews-ext' ) : $instance['button_text']; ?>
|
169 |
+
<label for="<?php echo $this->get_field_id( 'button_text' ); ?>"><?php _e( 'Button Text', 'enews-ext' ); ?>:</label>
|
170 |
+
<input type="text" id="<?php echo $this->get_field_id( 'button_text' ); ?>" name="<?php echo $this->get_field_name( 'button_text' ); ?>" value="<?php echo esc_attr( $button_text ); ?>" class="widefat" />
|
171 |
+
</p>
|
172 |
+
|
173 |
+
<?php
|
174 |
+
}
|
175 |
+
|
176 |
+
}
|
177 |
+
add_action( 'widgets_init', 'bjgk_genesis_enews_load_widgets' );
|
178 |
+
|
179 |
+
function bjgk_genesis_enews_load_widgets() {
|
180 |
+
|
181 |
+
register_widget( 'BJGK_Genesis_eNews_Extended' );
|
182 |
+
|
183 |
}
|
readme.txt
CHANGED
@@ -1,62 +1,65 @@
|
|
1 |
-
=== Genesis eNews Extended ===
|
2 |
-
Contributors: kraftbj
|
3 |
-
Tags: genesis
|
4 |
-
Requires at least: 3.0
|
5 |
-
Tested up to: 3.
|
6 |
-
Stable tag: 0.1.
|
7 |
-
|
8 |
-
Creates a new widget to
|
9 |
-
|
10 |
-
== Description ==
|
11 |
-
|
12 |
-
Creates a new widget to replace the Genesis eNews Widget
|
13 |
-
|
14 |
-
== Installation ==
|
15 |
-
|
16 |
-
1. Upload contents of the directory to /wp-content/plugins/ (or use the automatic installer)
|
17 |
-
1. Activate the plugin through the 'Plugins' menu in WordPress
|
18 |
-
1. In Appearance->Widgerts, add Genesis eNews Extended widget to any sidebar.
|
19 |
-
1. Using the mailing list contact form code provided by your vendor, add the form action URL, the form field ID for the e-mail field and any hidden fields (not all services use them) into the widget options.
|
20 |
-
1. Verify it works!
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
*
|
43 |
-
|
44 |
-
= 0.1.2 =
|
45 |
-
* Modifies class name to work with more StudioPress themes.
|
46 |
-
|
47 |
-
= 0.
|
48 |
-
* Adds
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
= 0.1
|
56 |
-
|
57 |
-
|
58 |
-
= 0.1.
|
59 |
-
|
60 |
-
|
61 |
-
= 0.2 =
|
62 |
-
|
|
|
|
|
|
1 |
+
=== Genesis eNews Extended ===
|
2 |
+
Contributors: kraftbj
|
3 |
+
Tags: genesis
|
4 |
+
Requires at least: 3.0
|
5 |
+
Tested up to: 3.5-beta1
|
6 |
+
Stable tag: 0.1.3
|
7 |
+
|
8 |
+
Creates a new widget to easily add mailing lists integration to a Genesis website. Works with FeedBurner, MailChimp, AWeber, FeedBlitz and more.
|
9 |
+
|
10 |
+
== Description ==
|
11 |
+
|
12 |
+
Creates a new widget to easily add mailing lists to a Genesis website. Recommended plugin to replace the Genesis eNews Widget being depreciated in Genesis 1.9. The widget allows the site administrator to set the either the Feedburner ID or form action, e-mail form field and hidden fields to mimic the subscribe form of other mailing list services.
|
13 |
+
|
14 |
+
== Installation ==
|
15 |
+
|
16 |
+
1. Upload contents of the directory to /wp-content/plugins/ (or use the automatic installer)
|
17 |
+
1. Activate the plugin through the 'Plugins' menu in WordPress
|
18 |
+
1. In Appearance->Widgerts, add Genesis eNews Extended widget to any sidebar.
|
19 |
+
1. Using the mailing list contact form code provided by your vendor, add the form action URL, the form field ID for the e-mail field and any hidden fields (not all services use them) into the widget options.
|
20 |
+
1. Verify it works!
|
21 |
+
|
22 |
+
== Frequently Asked Questions ==
|
23 |
+
|
24 |
+
= What services work with this plugin? =
|
25 |
+
|
26 |
+
Feedburner, MailChimp, Aweber and Constant Contact are confirmed to work, but it should work with almost all services. If you have tested this with other services, please [contact me](http://brandonkraft.com/contact/)
|
27 |
+
|
28 |
+
= I need help! Where I can get it? =
|
29 |
+
|
30 |
+
"Official" tutorials will be maintained on the [plugin's website](http://www.brandonkraft.com/contrib/plugins/genesis-enews-extended/).
|
31 |
+
|
32 |
+
Questions can be asked at the [WordPress.org Support Forum](http://wordpress.org/support/plugin/genesis-enews-extended) for this plugin.
|
33 |
+
|
34 |
+
== Screenshots ==
|
35 |
+
1. Example of the plugin in use on a site running Streamline 2.0.
|
36 |
+
2. Widget setting screen.
|
37 |
+
|
38 |
+
== Changelog ==
|
39 |
+
|
40 |
+
= 0.1.3 =
|
41 |
+
* Adds Feedburner support in anticipation of Genesis 1.9
|
42 |
+
* Security and translation updates
|
43 |
+
|
44 |
+
= 0.1.2 =
|
45 |
+
* Modifies class name to work with more StudioPress themes.
|
46 |
+
|
47 |
+
= 0.1.1 =
|
48 |
+
* Adds "Hidden Fields" widget setting to make widget compatible with more mailing services.
|
49 |
+
|
50 |
+
= 0.1 =
|
51 |
+
* Inital release.
|
52 |
+
|
53 |
+
== Upgrade Notice ==
|
54 |
+
|
55 |
+
= 0.1 =
|
56 |
+
Initial stable release. Please update from alpha now.
|
57 |
+
|
58 |
+
= 0.1.1 =
|
59 |
+
Adds "Hidden Fields" widget setting to make widget compatible with more mailing services. Upgrade if you want to use AWeber or other services that require one or more hidden fields.
|
60 |
+
|
61 |
+
= 0.1.2 =
|
62 |
+
Expands widget's usefulness to more StudioPress themes (Balance, etc).
|
63 |
+
|
64 |
+
= 0.1.3 =
|
65 |
+
Security update and adds Feedburner support natively.
|