WordPress Email Marketing Plugin – WP Email Capture - Version 2.1.1

Version Description

(03/02/12) = * Actually fixed the display bug talked about in 2.1 * Edited the Dashboard widget so that it's only displayed to user admins.

Download this release

Release Info

Developer rhyswynne
Plugin Icon 128x128 WordPress Email Marketing Plugin – WP Email Capture
Version 2.1.1
Comparing to
See all releases

Code changes from version 1.0 to 2.1.1

inc/checks.php DELETED
@@ -1,179 +0,0 @@
1
- <?php
2
-
3
- /**
4
-
5
- Validate an email address.
6
-
7
- Provide email address (raw input)
8
-
9
- Returns true if the email address has the email
10
-
11
- address format and the domain exists.
12
-
13
- */
14
-
15
- if(!function_exists('checkdnsrr'))
16
- {
17
- function checkdnsrr($hostName, $recType = '')
18
- {
19
- if(!empty($hostName)) {
20
- if( $recType == '' ) $recType = "MX";
21
- exec("nslookup -type=$recType $hostName", $result);
22
- // check each line to find the one that starts with the host
23
- // name. If it exists then the function succeeded.
24
- foreach ($result as $line) {
25
- if(eregi("^$hostName",$line)) {
26
- return true;
27
- }
28
- }
29
- // otherwise there was no mail handler for the domain
30
- return false;
31
- }
32
- return false;
33
- }
34
- }
35
-
36
- function addLastCharacter($url)
37
- {
38
- $last = $url[strlen($url)-1];
39
- if ($last != "/")
40
- {
41
- $url = $url . "/";
42
- }
43
- return $url;
44
- }
45
-
46
-
47
- function validEmail($email)
48
-
49
- {
50
-
51
- $isValid = true;
52
-
53
- $atIndex = strrpos($email, "@");
54
-
55
- if (is_bool($atIndex) && !$atIndex)
56
-
57
- {
58
-
59
- $isValid = false;
60
-
61
- }
62
-
63
- else
64
-
65
- {
66
-
67
- $domain = substr($email, $atIndex+1);
68
-
69
- $local = substr($email, 0, $atIndex);
70
-
71
- $localLen = strlen($local);
72
-
73
- $domainLen = strlen($domain);
74
-
75
- if ($localLen < 1 || $localLen > 64)
76
-
77
- {
78
-
79
- // local part length exceeded
80
-
81
- $isValid = false;
82
-
83
- }
84
-
85
- else if ($domainLen < 1 || $domainLen > 255)
86
-
87
- {
88
-
89
- // domain part length exceeded
90
-
91
- $isValid = false;
92
-
93
- }
94
-
95
- else if ($local[0] == '.' || $local[$localLen-1] == '.')
96
-
97
- {
98
-
99
- // local part starts or ends with '.'
100
-
101
- $isValid = false;
102
-
103
- }
104
-
105
- else if (preg_match('/\\.\\./', $local))
106
-
107
- {
108
-
109
- // local part has two consecutive dots
110
-
111
- $isValid = false;
112
-
113
- }
114
-
115
- else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain))
116
-
117
- {
118
-
119
- // character not valid in domain part
120
-
121
- $isValid = false;
122
-
123
- }
124
-
125
- else if (preg_match('/\\.\\./', $domain))
126
-
127
- {
128
-
129
- // domain part has two consecutive dots
130
-
131
- $isValid = false;
132
-
133
- }
134
-
135
- else if
136
-
137
- (!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/',
138
-
139
- str_replace("\\\\","",$local)))
140
-
141
- {
142
-
143
- // character not valid in local part unless
144
-
145
- // local part is quoted
146
-
147
- if (!preg_match('/^"(\\\\"|[^"])+"$/',
148
-
149
- str_replace("\\\\","",$local)))
150
-
151
- {
152
-
153
- $isValid = false;
154
-
155
- }
156
-
157
- }
158
-
159
- if ($isValid && !(checkdnsrr($domain,"MX") ||
160
-
161
- checkdnsrr($domain,"A")))
162
-
163
- {
164
-
165
- // domain not found in DNS
166
-
167
- $isValid = false;
168
-
169
- }
170
-
171
- }
172
-
173
- return $isValid;
174
-
175
- }
176
-
177
-
178
-
179
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/core.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- require_once(WP_EMAIL_CAPTURE_PATH . '/inc/functions.php');
3
- require_once(WP_EMAIL_CAPTURE_PATH . '/inc/install.php');
4
- require_once(WP_EMAIL_CAPTURE_PATH . '/inc/pagedresults.php');
5
- require_once(WP_EMAIL_CAPTURE_PATH . '/inc/tabledata.php');
6
- require_once(WP_EMAIL_CAPTURE_PATH . '/inc/options.php');
7
- require_once(WP_EMAIL_CAPTURE_PATH . '/inc/exportcsv.php');
8
- require_once(WP_EMAIL_CAPTURE_PATH . '/inc/tempdata.php');
9
- require_once(WP_EMAIL_CAPTURE_PATH . '/inc/display.php');
10
- require_once(WP_EMAIL_CAPTURE_PATH . '/inc/process.php');
11
- require_once(WP_EMAIL_CAPTURE_PATH . '/inc/widget.php');
12
- require_once(WP_EMAIL_CAPTURE_PATH . '/inc/security.php');
13
- require_once(WP_EMAIL_CAPTURE_PATH . '/inc/dashboard.php');
14
- require_once(WP_EMAIL_CAPTURE_PATH . '/inc/checks.php');
15
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/dashboard.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
-
3
- function wp_email_capture_dashboard_widget() {
4
- // Display whatever it is you want to show
5
- wp_email_capture_writetable(3, "<strong>Last Three Members To Join</strong><br/><br/>");
6
- $tempemails = wp_email_capture_count_temp();
7
- echo '<br/><br/><a name="list"></a><strong>Export</strong>';
8
- echo '<form name="wp_email_capture_export" action="'. $_SERVER["REQUEST_URI"] . '#list" method="post">';
9
- echo '<label>Use the button below to export your list as a CSV to use in software such as <a href="http://www.gospelrhys.co.uk/go/aweber.php" title="Email Marketing">Aweber</a>.</label>';
10
- echo '<input type="hidden" name="wp_email_capture_export" />';
11
- echo '<div class="submit"><input type="submit" value="Export List" /></div>';
12
- echo "</form><br/><br/";
13
- $tempemails = wp_email_capture_count_temp();
14
- echo "<a name='truncate'></a><strong>Temporary e-mails</strong>\n";
15
- echo '<form name="wp_email_capture_truncate" action="'. $_SERVER["REQUEST_URI"] . '#truncate" method="post">';
16
- echo '<label>There are '. $tempemails . ' e-mail addresses that have been unconfirmed. Delete them to save space below.</label>';
17
- echo '<input type="hidden" name="wp_email_capture_truncate"/>';
18
- echo '<div class="submit"><input type="submit" value="Delete Unconfirmed e-mail Addresses" /></div>';
19
- echo "</form>";
20
-
21
- }
22
-
23
- function wp_email_capture_add_dashboard_widgets() {
24
- wp_add_dashboard_widget('wp_email_capture_dashboard_widget', 'WP Email Capture - At A Glance', 'wp_email_capture_dashboard_widget');
25
- }
26
-
27
-
28
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/display.php DELETED
@@ -1,95 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
- function wp_email_capture_form($error = 0)
6
-
7
- {
8
-
9
- $url = get_option('home');
10
- $url = addLastCharacter($url);
11
-
12
- ?> <div id="wp_email_capture"><form name="wp_email_capture" method="post" action="<?php echo $url; ?>">
13
-
14
- <?php if (isset($_GET["wp_email_capture_error"])) {
15
-
16
- $error = sanitize($_GET["wp_email_capture_error"]);
17
-
18
- echo "<div style='width:80%;background-color: #FFCCCC; margin: 5px;font-weight'>Error: ". $error ."</div>";
19
-
20
- } ?>
21
-
22
- <label class="wp-email-capture-name">Name:</label> <input name="wp-email-capture-name" type="text" class="wp-email-capture-name"><br/>
23
-
24
- <label class="wp-email-capture-email">Email:</label> <input name="wp-email-capture-email" type="text" class="wp-email-capture-email"><br/>
25
-
26
- <input type="hidden" name="wp_capture_action" value="1">
27
-
28
- <input name="Submit" type="submit" value="Submit" class="wp-email-capture-submit">
29
-
30
- </form></div>
31
-
32
- <?php if (get_option("wp_email_capture_link") == 1) {
33
-
34
- echo "<p style='font-size:10px;'>Powered by <a href='http://www.gospelrhys.co.uk/plugins/wordpress-plugins/wordpress-email-capture-plugin' target='_blank'>WP Email Capture</a></p>\n";
35
-
36
- }
37
-
38
- }
39
-
40
-
41
-
42
- function wp_email_capture_form_page($error = 0)
43
-
44
- {
45
-
46
- $url = get_option('home');
47
- $url = addLastCharacter($url);
48
-
49
- $display .= "<div id='wp_email_capture_2'><form name='wp_email_capture_display' method='post' action='" . $url ."'>\n";
50
-
51
- if (isset($_GET["wp_email_capture_error"])) {
52
-
53
- $error = sanitize($_GET["wp_email_capture_error"]);
54
-
55
- $display .= "<div style='width:80%;background-color: #FFCCCC; margin: 5px;font-weight'>Error: ". $error ."</div>\n";
56
-
57
- }
58
-
59
- $display .= "<label class='wp-email-capture-name'>Name:</label> <input name='wp-email-capture-name' type='text' class='wp-email-capture-name'><br/>\n";
60
-
61
- $display .= "<label class='wp-email-capture-email'>Email:</label> <input name='wp-email-capture-email' type='text' class='wp-email-capture-email'><br/>\n";
62
-
63
- $display .= "<input type='hidden' name='wp_capture_action' value='1'>\n";
64
-
65
- $display .= "<input name='Submit' type='submit' value='Submit' class='wp-email-capture-submit'></form></div>\n";
66
-
67
- if (get_option("wp_email_capture_link") == 1) {
68
-
69
- $display .= "<p style='font-size:10px;'>Powered by <a href='http://www.gospelrhys.co.uk/plugins/wordpress-plugins/wordpress-email-capture-plugin' target='_blank'>WP Email Capture</a></p>\n";
70
-
71
- }
72
-
73
- return $display;
74
-
75
- }
76
-
77
-
78
-
79
- function wp_email_capture_display_form_in_post($content)
80
-
81
- {
82
-
83
- $get_form = wp_email_capture_form_page();
84
-
85
- $content = str_replace("[wp_email_capture_form]", $get_form, $content);
86
-
87
- return $content;
88
-
89
- }
90
-
91
-
92
-
93
-
94
-
95
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/exportcsv.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
-
3
-
4
- function wp_email_capture_export()
5
- {
6
- global $wpdb;
7
-
8
- $csv_output .= "Name,Email";
9
- $csv_output .= "\n";
10
-
11
-
12
- $table_name = $wpdb->prefix . "wp_email_capture_registered_members";
13
- $sql = "SELECT name, email FROM " . $table_name;
14
- $results = $wpdb->get_results($wpdb->prepare($sql));
15
- foreach ($results as $result) {
16
- $csv_output .= $result->name ."," . $result->email ."\n";
17
- }
18
-
19
- $filename = $file."_".date("Y-m-d_H-i",time());
20
- header("Content-type: application/vnd.ms-excel");
21
- header("Content-disposition: csv" . date("Y-m-d") . ".csv");
22
- header( "Content-disposition: filename=".$filename.".csv");
23
- print $csv_output;
24
- exit;
25
- }
26
-
27
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/functions.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- function sanitize($string)
3
- {
4
- $string = mysql_real_escape_string($string);
5
- $string = htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
6
- return $string;
7
- }
8
-
9
- function checkIfPresent($email){
10
- global $wpdb;
11
- $table_name = $wpdb->prefix . "wp_email_capture_temp_members";
12
- $sql = 'SELECT COUNT(*)
13
- FROM '. $table_name;
14
- $prep = $wpdb->prepare($sql);
15
- $result = $wpdb->get_var($prep);
16
- if($count=='1')
17
- {
18
- return true;
19
- }else{
20
- return false;
21
- }
22
- }
23
-
24
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/install.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
-
3
- function wp_email_capture_install() {
4
- global $wpdb;
5
- global $wp_email_capture_db_version;
6
- require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
7
- $table_name = $wpdb->prefix . "wp_email_capture_registered_members";
8
- if($wpdb->get_var("show tables like '$table_name'") != $table_name) {
9
-
10
- $sql = "CREATE TABLE " . $table_name . " (
11
- id INT( 255 ) NOT NULL AUTO_INCREMENT ,
12
- name TINYTEXT NOT NULL ,
13
- email TEXT NOT NULL ,
14
- PRIMARY KEY (id)
15
- );";
16
- dbDelta($sql);
17
- }
18
- $table_name = $wpdb->prefix . "wp_email_capture_temp_members";
19
- if($wpdb->get_var("show tables like '$table_name'") != $table_name) {
20
-
21
- $sql = "CREATE TABLE " . $table_name . " (
22
- id INT( 255 ) NOT NULL AUTO_INCREMENT ,
23
- name TINYTEXT NOT NULL ,
24
- email TEXT NOT NULL ,
25
-
26
- confirm_code TEXT NOT NULL,
27
- PRIMARY KEY (id)
28
- );";
29
-
30
- dbDelta($sql);
31
-
32
-
33
- }
34
- add_option('wp_email_capture_link', 1);
35
- add_option("wp_email_capture_db_version", $wp_email_capture_db_version);
36
- }
37
-
38
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/options.php DELETED
@@ -1,110 +0,0 @@
1
- <?php
2
- function wp_email_capture_menus() {
3
- add_options_page('WP Email Capture Options', 'WP Email Capture', 8, 'wpemailcaptureoptions', 'wp_email_capture_options');
4
- }
5
-
6
- function wp_email_capture_options() {
7
- echo '<div class="wrap">';
8
- echo '<h2>WP Email Capture Options</h2>';
9
- ?>
10
- <h3>Recommendations</h3>
11
- <p>We recommend <a href="http://www.gospelrhys.co.uk/go/aweber.php" title="Email Marketing">Aweber</a> to run your email campaigns. We have tested this plugin with it.
12
- </p>
13
- <table width="50%" border="0">
14
- <tr>
15
- <td><div style="text-align:center;">
16
- <a href="http://www.gospelrhys.co.uk/go/aweber.php" title="Email Marketing">
17
- <img src="http://www.aweber.com/banners/email_marketing_easy/726x90.gif" alt="AWeber - Email Marketing Made Easy" style="border:none;" /></a>
18
- </div></td>
19
- </tr>
20
- </table>
21
- <p>
22
- <?php
23
-
24
- echo '<h3>Options</h3>';
25
- ?>
26
-
27
- </p>
28
- <form method="post" action="options.php">
29
- <?php wp_nonce_field('update-options'); ?>
30
- <?php settings_fields( 'wp-email-capture-group' ); ?>
31
- <table class="form-table">
32
- <tbody>
33
- <tr valign="top">
34
- <th scope="row">Page to redirect to on sign up</th>
35
- <td><input type="text" name="wp_email_capture_signup" class="regular-text code" value="<?php echo get_option('wp_email_capture_signup'); ?>" /></td>
36
- </tr>
37
- <tr valign="top">
38
- <th scope="row"><label>Page to redirect to on confirmation of email address</label></th>
39
- <td><input type="text" name="wp_email_capture_redirection" class="regular-text code" value="<?php echo get_option('wp_email_capture_redirection'); ?>" /></td>
40
- </tr>
41
- <tr valign="top">
42
- <th scope="row"><label>From Which Email Address</label></th>
43
- <td><input type="text" name="wp_email_capture_from" class="regular-text code" value="<?php echo get_option('wp_email_capture_from'); ?>" /></td>
44
- </tr>
45
- <tr valign="top">
46
- <th scope="row"><label>From Which Name</label></th>
47
- <td><input type="text" name="wp_email_capture_from_name" class="regular-text code" value="<?php echo get_option('wp_email_capture_from_name'); ?>" /></td>
48
- </tr>
49
- <tr valign="top">
50
- <th scope="row">Subject of Email</th>
51
- <td><input type="text" name="wp_email_capture_subject" class="regular-text code" value="<?php echo get_option('wp_email_capture_subject'); ?>" /></td>
52
- </tr>
53
- <tr valign="top">
54
- <th scope="row"><label>Body of Email</label></th>
55
- <td><textarea name="wp_email_capture_body" style="width: 25em;"><?php echo get_option('wp_email_capture_body'); ?></textarea></td>
56
- </tr>
57
- <tr valign="top">
58
- <th scope="row"><label>Link to us (optional, but appreciated)</label></th>
59
- <td><input type="checkbox" name="wp_email_capture_link" value="1"
60
- <?php
61
- if (get_option('wp_email_capture_link') == 1) { echo "checked"; } ?>
62
- ></td>
63
- </tr>
64
- </tbody>
65
- </table>
66
-
67
- <input type="hidden" name="action" value="update" />
68
- <input type="hidden" name="page_options" value="wp_email_capture_redirection,wp_email_capture_from,wp_email_capture_subject,wp_email_capture_signup,wp_email_capture_body,wp_email_capture_from_name,wp_email_capture_link" />
69
- <p class="submit">
70
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
71
- </p>
72
- </form>
73
-
74
- <?php
75
- wp_email_capture_writetable();
76
- echo '<a name="list"></a><h3>Export</h3>';
77
- echo '<form name="wp_email_capture_export" action="'. $_SERVER["REQUEST_URI"] . '#list" method="post">';
78
- echo '<label>Use the button below to export your list as a CSV to use in software such as <a href="http://www.gospelrhys.co.uk/go/aweber.php" title="Email Marketing">Aweber</a> or <a href="http://www.gospelrhys.co.uk/go/mailchimp.php">Mailchimp</a></label>';
79
- echo '<input type="hidden" name="wp_email_capture_export" />';
80
- echo '<div class="submit"><input type="submit" value="Export List" /></div>';
81
- echo "</form>";
82
- $tempemails = wp_email_capture_count_temp();
83
- echo "<a name='truncate'></a><h3>Temporary e-mails</h3>\n";
84
- echo '<form name="wp_email_capture_truncate" action="'. $_SERVER["REQUEST_URI"] . '#truncate" method="post">';
85
- echo '<label>There are '. $tempemails . ' e-mail addresses that have been unconfirmed. Delete them to save space below.</label>';
86
- echo '<input type="hidden" name="wp_email_capture_truncate"/>';
87
- echo '<div class="submit"><input type="submit" value="Delete Unconfirmed e-mail Addresses" /></div>';
88
- echo "</form>";
89
- echo '</div>';
90
- }
91
-
92
- function wp_email_capture_options_process() { // whitelist options
93
- register_setting( 'wp-email-capture-group', 'wp_email_capture_signup' );
94
- register_setting( 'wp-email-capture-group', 'wp_email_capture_redirection' );
95
- register_setting( 'wp-email-capture-group', 'wp_email_capture_from' );
96
- register_setting( 'wp-email-capture-group', 'wp_email_capture_subject' );
97
- register_setting( 'wp-email-capture-group', 'wp_email_capture_body' );
98
- register_setting( 'wp-email-capture-group', 'wp_email_capture_link');
99
- register_setting( 'wp-email-capture-group', 'wp_email_capture_from_name' );
100
- if(isset($_REQUEST['wp_email_capture_export'])) {
101
- wp_email_capture_export();
102
- }
103
-
104
-
105
- if(isset($_REQUEST['wp_email_capture_truncate'])) {
106
-
107
- wp_email_capture_truncate();
108
- }
109
- }
110
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/pagedresults.php DELETED
@@ -1,183 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
- class MySQLPagedResultSet
6
-
7
- {
8
-
9
-
10
-
11
- var $results;
12
-
13
- var $pageSize;
14
-
15
- var $page;
16
-
17
- var $row;
18
-
19
-
20
-
21
- function MySQLPagedResultSet($query,$pageSize)
22
-
23
- {
24
-
25
-
26
-
27
- $resultpage = $_GET['resultpage'];
28
-
29
-
30
-
31
- $this->results = mysql_query($query);
32
-
33
- $this->pageSize = $pageSize;
34
-
35
- if ((int)$resultpage <= 0) $resultpage = 1;
36
-
37
- if ($resultpage > $this->getNumPages())
38
-
39
- $resultpage = $this->getNumPages();
40
-
41
- $this->setPageNum($resultpage);
42
-
43
- }
44
-
45
-
46
-
47
- function getNumPages()
48
-
49
- {
50
-
51
- if (!$this->results) return FALSE;
52
-
53
-
54
-
55
- return ceil(mysql_num_rows($this->results) /
56
-
57
- (float)$this->pageSize);
58
-
59
- }
60
-
61
-
62
-
63
- function setPageNum($pageNum)
64
-
65
- {
66
-
67
- if ($pageNum > $this->getNumPages() or
68
-
69
- $pageNum <= 0) return FALSE;
70
-
71
-
72
-
73
- $this->page = $pageNum;
74
-
75
- $this->row = 0;
76
-
77
- mysql_data_seek($this->results,($pageNum-1) * $this->pageSize);
78
-
79
- }
80
-
81
-
82
-
83
- function getPageNum()
84
-
85
- {
86
-
87
- return $this->page;
88
-
89
- }
90
-
91
-
92
-
93
- function isLastPage()
94
-
95
- {
96
-
97
- return ($this->page >= $this->getNumPages());
98
-
99
- }
100
-
101
-
102
-
103
- function isFirstPage()
104
-
105
- {
106
-
107
- return ($this->page <= 1);
108
-
109
- }
110
-
111
-
112
-
113
- function fetchArray()
114
-
115
- {
116
-
117
- if (!$this->results) return FALSE;
118
-
119
- if ($this->row >= $this->pageSize) return FALSE;
120
-
121
- $this->row++;
122
-
123
- return mysql_fetch_array($this->results);
124
-
125
- }
126
-
127
-
128
-
129
- function getPageNav($queryvars = '')
130
-
131
- {
132
-
133
- $nav = '';
134
-
135
- if (!$this->isFirstPage())
136
-
137
- {
138
-
139
- $nav .= "<a href=\"?resultpage=".
140
-
141
- ($this->getPageNum()-1).'&'.$queryvars.'">Prev</a> ';
142
-
143
- }
144
-
145
- if ($this->getNumPages() > 1)
146
-
147
- for ($i=1; $i<=$this->getNumPages(); $i++)
148
-
149
- {
150
-
151
- if ($i==$this->page)
152
-
153
- $nav .= "$i ";
154
-
155
- else
156
-
157
- $nav .= "<a href=\"?resultpage={$i}&".
158
-
159
- $queryvars."\">{$i}</a> ";
160
-
161
- }
162
-
163
- if (!$this->isLastPage())
164
-
165
- {
166
-
167
- $nav .= "<a href=\"?resultpage=".
168
-
169
- ($this->getPageNum()+1).'&'.$queryvars.'">Next</a> ';
170
-
171
- }
172
-
173
-
174
-
175
- return $nav;
176
-
177
- }
178
-
179
- }
180
-
181
-
182
-
183
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/process.php DELETED
@@ -1,286 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
- function wp_email_capture_process()
6
-
7
- {
8
-
9
- if(isset($_REQUEST['wp_capture_action'])) {
10
- wp_email_capture_signup();
11
- }
12
-
13
- if(isset($_GET['wp_email_confirm']) || isset($_REQUEST['wp_email_confirm'])) {
14
- wp_capture_email_confirm();
15
- }
16
-
17
- }
18
-
19
-
20
-
21
- function wp_email_capture_double_check_everything($name, $email)
22
-
23
- {
24
-
25
- if (wp_email_injection_chars($name) || wp_email_injection_chars($email) || wp_email_injection_chars($name) || wp_email_injection_chars($email))
26
-
27
- {
28
-
29
- return FALSE;
30
-
31
- } else {
32
-
33
- return TRUE;
34
- }
35
-
36
- }
37
-
38
-
39
-
40
- function wp_email_capture_signup()
41
-
42
- {
43
-
44
- global $wpdb;
45
-
46
-
47
-
48
- // Random confirmation code
49
-
50
- $confirm_code=md5(uniqid(rand()));
51
-
52
- $name = $_REQUEST['wp-email-capture-name'];
53
-
54
- $email = $_REQUEST['wp-email-capture-email'];
55
-
56
-
57
- if (!validEmail($email))
58
-
59
- {
60
-
61
- $url = $_SERVER['PHP_SELF'] . "?wp_email_capture_error=Not%20a%20valid%20email";
62
-
63
- header("Location: $url");
64
-
65
- die();
66
-
67
- }
68
-
69
-
70
-
71
- if (wp_email_capture_double_check_everything($name, $email))
72
-
73
- {
74
-
75
- // values sent from form
76
-
77
- $name = sanitize($name);
78
-
79
- $email= sanitize($email);
80
-
81
- $name = wp_email_injection_test($name);
82
-
83
- $email = wp_email_injection_test($email);
84
-
85
- $name = wp_email_stripslashes($name);
86
-
87
- $email = wp_email_stripslashes($email);
88
-
89
-
90
-
91
- $sqlcheck = checkIfPresent($email);
92
-
93
-
94
-
95
- if ($sqlcheck){
96
-
97
-
98
-
99
- $url = $_SERVER['PHP_SELF'] . "?wp_email_capture_error=User%20already%20present";
100
-
101
- header("Location: $url");
102
-
103
- die();
104
-
105
- }
106
-
107
-
108
-
109
- // Insert data into database
110
-
111
- $table_name = $wpdb->prefix . "wp_email_capture_temp_members";
112
-
113
-
114
-
115
-
116
-
117
- $sql="INSERT INTO ".$table_name."(confirm_code, name, email)VALUES('$confirm_code', '$name', '$email')";
118
-
119
- $result=$wpdb->query($wpdb->prepare($sql));
120
-
121
-
122
-
123
- // if suceesfully inserted data into database, send confirmation link to email
124
-
125
- if($result){
126
-
127
-
128
-
129
- // ---------------- SEND MAIL FORM ----------------
130
-
131
-
132
-
133
- // send e-mail to ...
134
-
135
- $to=$email;
136
-
137
- $siteurl = get_option('home');
138
- $siteurl = addLastCharacter($siteurl);
139
-
140
- // Your subject
141
-
142
- $subject=get_option('wp_email_capture_subject');
143
-
144
- // From
145
-
146
- $header = "MIME-Version: 1.0\n" . "From: " . get_option('wp_email_capture_from_name') . "<" . get_option('wp_email_capture_from') . ">\n";
147
-
148
- $header .= "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";
149
-
150
- // Your message
151
-
152
- $message.= get_option('wp_email_capture_body') . "\n\n";
153
-
154
- $message.= $siteurl ."?wp_email_confirm=1&wp_email_capture_passkey=$confirm_code";
155
-
156
-
157
-
158
- // send email
159
-
160
- $sentmail = wp_mail($to,$subject,$message,$header);
161
-
162
- }
163
-
164
- }
165
-
166
-
167
-
168
- // if not found
169
-
170
- else {
171
-
172
- echo "Not found your email in our database";
173
-
174
- }
175
-
176
-
177
-
178
- // if your email succesfully sent
179
-
180
- if($sentmail){
181
-
182
- $halfreg = get_option('wp_email_capture_signup');
183
-
184
- header("Location: $halfreg");
185
-
186
- die();
187
-
188
- }
189
-
190
- else {
191
-
192
- $url = $_SERVER['PHP_SELF'] . "?wp_email_capture_error=Email%20unable%20to%20be%sent";
193
-
194
- header("Location: $url");
195
-
196
- die();
197
-
198
- //echo "<meta http-equiv='refresh' content='0;". $url . "?wp_email_capture_error=Email%20unable%20to%20be%sent'>";
199
-
200
- }
201
-
202
- }
203
-
204
-
205
-
206
-
207
-
208
- function wp_capture_email_confirm()
209
-
210
- {
211
-
212
- global $wpdb;
213
-
214
- // Passkey that got from link
215
-
216
- $passkey=sanitize($_GET['wp_email_capture_passkey']);
217
-
218
- $table_name = $wpdb->prefix . "wp_email_capture_temp_members";
219
-
220
- $sql1="SELECT id FROM $table_name WHERE confirm_code ='$passkey'";
221
-
222
- $result=$wpdb->get_var($wpdb->prepare($sql1));
223
-
224
- if ($result != '')
225
-
226
- {
227
-
228
- $table_name2 = $wpdb->prefix . "wp_email_capture_registered_members";
229
-
230
- $sql2="SELECT * FROM $table_name WHERE confirm_code ='$passkey'";
231
-
232
- $rowresults = $wpdb->get_results($wpdb->prepare($sql2));
233
-
234
- foreach ($rowresults as $rowresult) {
235
-
236
- $name = $rowresult->name;
237
-
238
- $email = $rowresult->email;
239
-
240
- $sql3="INSERT INTO $table_name2(name, email)VALUES('$name', '$email')";
241
-
242
- $result3=$wpdb->query($wpdb->prepare($sql3));
243
-
244
- }
245
-
246
- }
247
-
248
- else {
249
-
250
- $url = $url . "?wp_email_capture_error=Wrong%20confirmation%20code";
251
-
252
- header("Location: $url");
253
-
254
- }
255
-
256
- // if successfully moved data from table"temp_members_db" to table "registered_members" displays message "Your account has been activated" and don't forget to delete confirmation code from table "temp_members_db"
257
-
258
-
259
-
260
- if($result3){
261
-
262
- $sql4="DELETE FROM $table_name WHERE confirm_code = '$passkey'";
263
-
264
- $result4=$wpdb->query($wpdb->prepare($sql4));
265
-
266
- $fullreg = get_option('wp_email_capture_redirection');
267
-
268
-
269
-
270
- //echo "<meta http-equiv='refresh' content='0;". $fullreg ."'>";
271
-
272
- header("Location: $fullreg");
273
-
274
- }
275
-
276
-
277
-
278
-
279
-
280
- }
281
-
282
-
283
-
284
-
285
-
286
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/security.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
- /* Check for injection characters */
6
-
7
- function wp_email_injection_chars($s) {
8
-
9
- return (eregi("\r", $s) || eregi("\n", $s) || eregi("%0a", $s) || eregi("%0d", $s)) ? TRUE : FALSE;
10
-
11
- }
12
-
13
-
14
-
15
-
16
-
17
- /* Make output safe for the browser */
18
-
19
- function wp_email_capture_bsafe($input) {
20
-
21
- return htmlspecialchars(stripslashes($input));
22
-
23
- }
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
- function wp_email_stripslashes($s) {
34
-
35
- if (defined('TEMPLATEPATH') || (get_magic_quotes_gpc())) {
36
-
37
- return stripslashes($s);
38
-
39
- } else {
40
-
41
- return $s;
42
-
43
- }
44
-
45
- }
46
-
47
-
48
-
49
-
50
-
51
- function wp_email_injection_test($str) {
52
-
53
- $tests = array("/bcc\:/i", "/Content\-Type\:/i", "/Mime\-Version\:/i", "/cc\:/i", "/from\:/i", "/to\:/i", "/Content\-Transfer\-Encoding\:/i");
54
-
55
- return preg_replace($tests, "", $str);
56
-
57
- }
58
-
59
-
60
-
61
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tabledata.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
-
3
- function wp_email_capture_writetable($limit = 0, $header = '')
4
- {
5
- global $wpdb;
6
- $table_name = $wpdb->prefix . "wp_email_capture_registered_members";
7
- $sql = "SELECT id, name, email FROM " . $table_name;
8
- if ($limit != 0) {
9
- $sql .= " ORDER BY id DESC LIMIT 3";
10
- }
11
- $results = $wpdb->get_results($wpdb->prepare($sql));
12
-
13
- if ($header == '') {
14
- $header = "<h3>Members</h3>";
15
- }
16
- echo $header;
17
- ?>
18
- <table>
19
- <tr><td><strong>Name</strong></td><td><strong>Email</strong></td></tr>
20
- <?php foreach ($results as $result) {
21
- echo "<tr><td style='width: 400px;'>" . $result->name ."</td><td style='width: 400px;'>" . $result->email ."</td></tr>";
22
- }
23
- ?>
24
- </table>
25
- <?php
26
- }
27
-
28
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tempdata.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
- function wp_email_capture_truncate()
3
- {
4
- global $wpdb;
5
- $table_name = $wpdb->prefix . "wp_email_capture_temp_members";
6
- $sql = "TRUNCATE " . $table_name;
7
- $result = $wpdb->query($wpdb->prepare($sql));
8
- }
9
- function wp_email_capture_count_temp()
10
- {
11
- global $wpdb;
12
- $table_name = $wpdb->prefix . "wp_email_capture_temp_members";
13
- $sql = 'SELECT COUNT(*)
14
- FROM '. $table_name;
15
- $prep = $wpdb->prepare($sql);
16
- $result = $wpdb->get_var($prep);
17
- return $result;
18
- }
19
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/widget.php DELETED
@@ -1,153 +0,0 @@
1
- <?php
2
-
3
- function wp_email_capture_widget_init() {
4
-
5
-
6
-
7
- // Check to see required Widget API functions are defined...
8
-
9
- if ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') )
10
-
11
- return; // ...and if not, exit gracefully from the script.
12
-
13
-
14
-
15
- // This function prints the sidebar widget--the cool stuff!
16
-
17
- function wp_email_capture_widget($args) {
18
-
19
-
20
-
21
- // $args is an array of strings which help your widget
22
-
23
- // conform to the active theme: before_widget, before_title,
24
-
25
- // after_widget, and after_title are the array keys.
26
-
27
- extract($args);
28
-
29
-
30
-
31
- // Collect our widget's options, or define their defaults.
32
-
33
- $options = get_option('wp_email_capture_widget');
34
-
35
- $title = empty($options['title']) ? 'My Widget' : $options['title'];
36
-
37
- $text = empty($options['text']) ? 'Hello World!' : $options['text'];
38
-
39
-
40
-
41
- // It's important to use the $before_widget, $before_title,
42
-
43
- // $after_title and $after_widget variables in your output.
44
-
45
- echo $before_widget;
46
-
47
- echo $before_title . $title . $after_title;
48
-
49
- echo $text;
50
-
51
- wp_email_capture_form();
52
-
53
- echo $after_widget;
54
-
55
- }
56
-
57
-
58
-
59
- // This is the function that outputs the form to let users edit
60
-
61
- // the widget's title and so on. It's an optional feature, but
62
-
63
- // we'll use it because we can!
64
-
65
- function wp_email_capture_widget_control() {
66
-
67
-
68
-
69
- // Collect our widget's options.
70
-
71
- $options = get_option('wp_email_capture_widget');
72
-
73
- $newoptions = get_option('wp_email_capture_widget');
74
-
75
- // This is for handing the control form submission.
76
-
77
- if ( $_POST['wp-email-capture-submit'] ) {
78
-
79
- // Clean up control form submission options
80
-
81
- $newoptions['title'] = strip_tags(stripslashes($_POST['wp-email-capture-title']));
82
-
83
- $newoptions['text'] = strip_tags(stripslashes($_POST['wp-email-capture-text']));
84
-
85
- }
86
-
87
-
88
-
89
- // If original widget options do not match control form
90
-
91
- // submission options, update them.
92
-
93
- if ( $options != $newoptions ) {
94
-
95
- $options = $newoptions;
96
-
97
- update_option('wp_email_capture_widget', $options);
98
-
99
- }
100
-
101
-
102
-
103
- // Format options as valid HTML. Hey, why not.
104
-
105
- $title = htmlspecialchars($options['title'], ENT_QUOTES);
106
-
107
- $text = htmlspecialchars($options['text'], ENT_QUOTES);
108
-
109
-
110
-
111
- // The HTML below is the control form for editing options.
112
-
113
- ?>
114
-
115
- <div>
116
-
117
- <label for="wp-email-capture-title" style="line-height:35px;display:block;">Widget title: <input type="text" id="wp-email-capture-title" name="wp-email-capture-title" value="<?php echo $title; ?>" /></label>
118
-
119
- <label for="wp-email-capture-text" style="line-height:35px;display:block;">Widget text: <input type="text" id="wp-email-capture-text" name="wp-email-capture-text" value="<?php echo $text; ?>" /></label>
120
-
121
- <input type="hidden" name="wp-email-capture-submit" id="wp-email-capture-submit" value="1" />
122
-
123
- </div>
124
-
125
- <?php
126
-
127
- // end of widget_mywidget_control()
128
-
129
- }
130
-
131
-
132
-
133
- // This registers the widget. About time.
134
-
135
- register_sidebar_widget('WP Email Capture', 'wp_email_capture_widget');
136
-
137
-
138
-
139
- // This registers the (optional!) widget control form.
140
-
141
- register_widget_control('WP Email Capture', 'wp_email_capture_widget_control');
142
-
143
- }
144
-
145
-
146
-
147
- // Delays plugin execution until Dynamic Sidebar has loaded first.
148
-
149
- add_action('plugins_loaded', 'wp_email_capture_widget_init');
150
-
151
-
152
-
153
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === WP Email Capture ===
2
  Tags: email, marketing, capture, form, affiliates, mailing lists, email marketing, widget ready
3
- Requires at least: 2.8
4
- Tested up to: 2.8.4
5
- Version: 1.1 revision 2
6
- Stable tag: 1.1 revision 2
7
  Contributors: rhyswynne
8
- Donate link: http://www.gospelrhys.co.uk/donations/
9
 
10
  Double opt-in form for building your email list. Define landing pages to distribute your ebooks & software.
11
 
@@ -22,6 +22,19 @@ Features:-
22
  * Double opt in, so compatible with CAN-SPAM act.
23
  * And completely free!
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  == Installation ==
26
  Upload the plugin (unzipped) into `/wp-content/plugins/`.
27
 
@@ -37,42 +50,53 @@ After having these, please then fill in the settings in the "Settings > WP Email
37
 
38
  The form can be inserted into the site at any location. However, to put the form anywhere, insert the following code into your template
39
 
40
- <?php if (function_exists('wp_email_capture_form')) { wp_email_capture_form(); } ?>
41
 
42
- If you want to insert the form within a page, insert into any page the string [wp_email_capture_form]. It will be replaced with a simple form.
43
 
44
  == Stylings ==
45
- To style your form, you need to add to your CSS file the following ID declarations. "wp_email_capture" is for sidebar & template widgets, "wp_email_capture_2" is for on page forms.
46
 
47
- #wp_email_capture
48
  {
49
 
50
  }
51
-
52
- #wp_email_capture label
53
  {
54
 
55
  }
 
 
56
 
57
- #wp_email_capture input
 
58
  {
59
 
60
  }
 
 
61
 
 
62
  #wp_email_capture_2
63
  {
64
 
65
  }
66
-
67
- #wp_email_capture_2 label
68
  {
69
 
70
  }
 
 
71
 
72
- #wp_email_capture_2 input
 
73
  {
74
 
75
  }
 
 
 
 
76
 
77
  == Screenshots ==
78
  1. It's appearance within the template
@@ -84,40 +108,90 @@ To style your form, you need to add to your CSS file the following ID declaratio
84
  = Does this piece of software send out email? =
85
  No. I feel that to do so would be counter productive, as sending out email could have a detrimental effect on your server. There are a number of services we recommend, such as Aweber, to send out lists built on WP Email Capture.
86
 
87
- == Bugs/Suggestions ==
88
- Please report any bugs to me (rhys@gospelrhys.co.uk)
 
 
 
 
 
 
 
 
 
89
 
90
  == Donate ==
91
- To donate to this plugin, please visit:
 
92
 
93
- http://www.gospelrhys.co.uk/donations
94
 
95
  == Change Log ==
96
- 1.1 revision 2 (24/09/09)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  * Fixed compatability issue with All in One SEO.
98
  * Blogs which are on a subdomain now can use the plugin (http://www.domian.com/wordpress/)
99
 
100
- 1.1 revision 1 (23/09/09)
101
  * Fixed small upgrade bug
102
 
103
- 1.1 (22/09/09)
104
  * Fixed short tag problem in tempdata.php
105
  * Emails that are not valid emails aren't processed
106
 
107
- 1.0 RC 1 (17/09/09)
108
  * First Release!
109
  * Dashboard Widget added.
110
 
111
- 0.4 (14/09/09)
112
  * Used more secure internal wp_mail class for sending out mail
113
  * Implemented [wp_email_form] class for implementing plugin on form
114
 
115
- 0.3 (12/09/09)
116
  * Switch to headers, rather than meta refreshes for updating the page
117
 
118
- 0.2 (09/09/09)
119
  * Fixed small error in the plugin when using permalinks
120
  * Implemented more security to the plugin
121
 
122
- 0.1 (07/09/09)
123
  * Plugin Launched
1
  === WP Email Capture ===
2
  Tags: email, marketing, capture, form, affiliates, mailing lists, email marketing, widget ready
3
+ Requires at least: 3.0
4
+ Tested up to: 3.3.1
5
+ Version: 2.1.1
6
+ Stable tag: 2.1.1
7
  Contributors: rhyswynne
8
+ Donate link: http://www.wpemailcapture.com/donations/
9
 
10
  Double opt-in form for building your email list. Define landing pages to distribute your ebooks & software.
11
 
22
  * Double opt in, so compatible with CAN-SPAM act.
23
  * And completely free!
24
 
25
+ For more details please visit the official site of [WP Email Capture](http://www.wpemailcapture.com/)
26
+
27
+ Keep in Contact:-
28
+
29
+ * [WP Email Capture on Facebook](http://www.facebook.com/wpemailcapture)
30
+ * [@WPEmailCapture](http://www.twitter.com/wpemailcapture) on Twitter
31
+
32
+ Translation Credits:-
33
+
34
+ Translations have been done by the following parties. Thank you!
35
+
36
+ * French: Olivier - http://www.ticket-system.net/
37
+
38
  == Installation ==
39
  Upload the plugin (unzipped) into `/wp-content/plugins/`.
40
 
50
 
51
  The form can be inserted into the site at any location. However, to put the form anywhere, insert the following code into your template
52
 
53
+ `<?php if (function_exists('wp_email_capture_form')) { wp_email_capture_form(); } ?>`
54
 
55
+ If you want to insert the form within a page, insert into any page the string `[wp_email_capture_form]`. It will be replaced with a simple form.
56
 
57
  == Stylings ==
58
+ To style your form, you need to add to your CSS file the following ID declarations. `wp_email_capture` is for sidebar & template widgets, `wp_email_capture_2` is for on page forms.
59
 
60
+ `#wp_email_capture
61
  {
62
 
63
  }
64
+ #wp_email_capture label.wp-email-capture-name
 
65
  {
66
 
67
  }
68
+ #wp_email_capture label.wp-email-capture-email
69
+ {
70
 
71
+ }
72
+ #wp_email_capture input.wp-email-capture-name
73
  {
74
 
75
  }
76
+ #wp_email_capture input.wp-email-capture-email
77
+ {
78
 
79
+ }
80
  #wp_email_capture_2
81
  {
82
 
83
  }
84
+ #wp_email_capture_2 label.wp-email-capture-name
 
85
  {
86
 
87
  }
88
+ #wp_email_capture_2 label.wp-email-capture-email
89
+ {
90
 
91
+ }
92
+ #wp_email_capture_2 input.wp-email-capture-name
93
  {
94
 
95
  }
96
+ #wp_email_capture_2 input.wp-email-capture-email
97
+ {
98
+
99
+ }`
100
 
101
  == Screenshots ==
102
  1. It's appearance within the template
108
  = Does this piece of software send out email? =
109
  No. I feel that to do so would be counter productive, as sending out email could have a detrimental effect on your server. There are a number of services we recommend, such as Aweber, to send out lists built on WP Email Capture.
110
 
111
+ = Does it work with Wordpress MU? =
112
+ This plugin is unsupported for Wordpress MU. Some people have reported success in using it. Others haven't. I have been unable to figure out why (I've been unable to get it working for Wordpress MU).
113
+
114
+ = Does it work with [theme_name]? =
115
+ This plugin does use widgets, so probably yes :)
116
+
117
+ = How do I include the name in my emails I send to people? =
118
+ Wherever you put in %NAME% (spelt exactly like that, uppercase as well), it will be replaced with the name given by the user.
119
+
120
+ == Bugs/Suggestions/Support ==
121
+ Please report any bugs, support and suggestions to the [WP Email Capture Support Page](http://www.wpemailcapture.com/support/)
122
 
123
  == Donate ==
124
+ To donate to this plugin, please visit the [WP Email Capture Donations Page](http://www.wpemailcapture.com/donations/)
125
+
126
 
 
127
 
128
  == Change Log ==
129
+ = 2.1.1 (03/02/12) =
130
+ * Actually fixed the display bug talked about in 2.1
131
+ * Edited the Dashboard widget so that it's only displayed to user admins.
132
+
133
+ = 2.1 (30/01/12) =
134
+ * Internationalisation Completed - with French Language Pack
135
+ * Fixed a Small Display bug with the Plugin that occured in latest version of Wordpress.
136
+
137
+ = 2.0.1 (28/10/10) =
138
+ * Fixed a small security bug which occurred in the previous version.
139
+
140
+ = 2.0 (3/10/10) =
141
+ * Switched functions to use the non depreciated functions
142
+ * Compatible with Spam Free
143
+ * Added a "Delete entire list" button in Wordpress.
144
+
145
+ = 1.9 (20/01/10) =
146
+ * Fixed a small bug that resulted in the display for [The plugin does not have a valid header.]
147
+ * Fixed a small phpmail bug
148
+
149
+ = 1.8.1 (13/01/10) =
150
+ * Included more information in sent mail including IP, Date & Referral Page
151
+
152
+ = 1.6 (18/10/09) =
153
+ * You can now delete people from the confirmed members list (requested update!)
154
+
155
+ = 1.5 (04/10/09) =
156
+ * Fixed small error on the error checking form.
157
+
158
+ = 1.4 (03/10/09) =
159
+ * Added a check for duplicate emails.
160
+
161
+ = 1.3 (30/09/09) =
162
+ * Added a new feature where you can mention the name of the recipient of the email within the email by using the %NAME% string.
163
+ * Better default title & text for the WP Email Capture Widget.
164
+ * Fixed a bug that dropped the last character of the "From" name.
165
+
166
+ = 1.2 (27/09/09) =
167
+ * Fixed errors with the programme when using non pretty permalinks (they now work now)
168
+ * Compatible with windows based PHP configurations (1.1 introduced a function that didn't work on windows boxes).
169
+
170
+ = 1.1 revision 2 (24/09/09) =
171
  * Fixed compatability issue with All in One SEO.
172
  * Blogs which are on a subdomain now can use the plugin (http://www.domian.com/wordpress/)
173
 
174
+ = 1.1 revision 1 (23/09/09) =
175
  * Fixed small upgrade bug
176
 
177
+ = 1.1 (22/09/09) =
178
  * Fixed short tag problem in tempdata.php
179
  * Emails that are not valid emails aren't processed
180
 
181
+ = 1.0 RC 1 (17/09/09) =
182
  * First Release!
183
  * Dashboard Widget added.
184
 
185
+ = 0.4 (14/09/09) =
186
  * Used more secure internal wp_mail class for sending out mail
187
  * Implemented [wp_email_form] class for implementing plugin on form
188
 
189
+ = 0.3 (12/09/09) =
190
  * Switch to headers, rather than meta refreshes for updating the page
191
 
192
+ = 0.2 (09/09/09) =
193
  * Fixed small error in the plugin when using permalinks
194
  * Implemented more security to the plugin
195
 
196
+ = 0.1 (07/09/09) =
197
  * Plugin Launched
screenshot-1.jpg DELETED
Binary file
screenshot-2.jpg DELETED
Binary file
screenshot-3.jpg DELETED
Binary file
wp-email-capture.php CHANGED
@@ -4,15 +4,15 @@
4
 
5
  Plugin Name: WP Email Capture
6
 
7
- Plugin URI: http://www.gospelrhys.co.uk/plugins/wordpress-plugins/wordpress-email-capture-plugin
8
 
9
- Description: Captures email addresses for insertion into software such as <a href="http://www.gospelrhys.co.uk/go/aweber.php" title="Email Marketing">Aweber</a> or <a href="http://www.gospelrhys.co.uk/go/mailchimp.php">Mailchimp</a>
10
 
11
- Version: 1.1 revision 2
12
 
13
  Author: Rhys Wynne
14
 
15
- Author URI: http://www.gospelrhys.co.uk/
16
 
17
  */
18
 
@@ -24,15 +24,26 @@ define(WP_EMAIL_CAPTURE_PATH, dirname(__FILE__));
24
 
25
  require_once(WP_EMAIL_CAPTURE_PATH . '/inc/core.php');
26
 
 
27
 
 
 
28
 
29
- if ( is_admin() ){ // admin actions
 
 
 
 
 
 
 
30
 
31
- add_action('admin_menu', 'wp_email_capture_menus');
32
 
33
  add_action( 'admin_init', 'wp_email_capture_options_process' );
34
 
35
  add_action('wp_dashboard_setup', 'wp_email_capture_add_dashboard_widgets' );
 
36
 
37
  } else {
38
 
4
 
5
  Plugin Name: WP Email Capture
6
 
7
+ Plugin URI: http://www.wpemailcapture.com
8
 
9
+ Description: Captures email addresses for insertion into software such as <a href="http://wpemailcapture.com/recommends/aweber" title="Email Marketing">Aweber</a> or <a href="http://wpemailcapture.com/recommends/mailchimp/">Mailchimp</a>
10
 
11
+ Version: 2.1.1
12
 
13
  Author: Rhys Wynne
14
 
15
+ Author URI: http://www.rhyswynne.co.uk/
16
 
17
  */
18
 
24
 
25
  require_once(WP_EMAIL_CAPTURE_PATH . '/inc/core.php');
26
 
27
+ add_action('plugins_loaded','wp_email_capture_plugins_loaded');
28
 
29
+ function wp_email_capture_plugins_loaded()
30
+ {
31
 
32
+ if (function_exists('load_plugin_textdomain'))
33
+ {
34
+ $plugin_dir = basename(dirname(__FILE__));
35
+ load_plugin_textdomain('WPEC','wp-content/plugins/'.$plugin_dir.'/languages',$plugin_dir.'/languages');
36
+ }
37
+
38
+ return;
39
+ }
40
 
41
+ if ( is_admin() ){ // admin actions
42
 
43
  add_action( 'admin_init', 'wp_email_capture_options_process' );
44
 
45
  add_action('wp_dashboard_setup', 'wp_email_capture_add_dashboard_widgets' );
46
+ add_action('admin_menu', 'wp_email_capture_menus');
47
 
48
  } else {
49