WordPress Email Marketing Plugin – WP Email Capture - Version 2.7.2

Version Description

(11/12/12) = * Compatible with WordPress 3.5. Critical upgrade if you're using WP 3.5 * Fixed an admin page error so if the news feed wasn't pulling from my site, then you will get an empty box, rather than an ugly error.

Download this release

Release Info

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

Code changes from version 2.7 to 2.7.2

inc/admin-sidebar.php CHANGED
@@ -78,12 +78,14 @@ function wp_email_capture_admin_sidebar($sidestring)
78
  echo '<h3 class="hndle"><span>'.__('Latest News','WPEC').'</span></h3><div class="inside">
79
  <p>'.__('The latest news and tutorials from WP Email Capture','WPEC').'.</p>';
80
  echo '<ul>';
81
- foreach ( $wpemailcapturefeed as $item ) {
82
- $url = preg_replace( '/#.*/', '', esc_url( $item->get_permalink(), $protocolls=null, 'display' ) );
83
- echo '<li>';
84
- echo '<a href="'.$url.'#utm_source=wpadmin&utm_medium=sidebarwidget&utm_term=newsitem&utm_campaign=wpemailcapture">'. esc_html( $item->get_title() ) .'</a> ';
85
- echo '</li>';
86
- }
 
 
87
  echo '</ul></div>';
88
  break;
89
  case 'supportus':
78
  echo '<h3 class="hndle"><span>'.__('Latest News','WPEC').'</span></h3><div class="inside">
79
  <p>'.__('The latest news and tutorials from WP Email Capture','WPEC').'.</p>';
80
  echo '<ul>';
81
+ if ($wpemailcapturefeed) {
82
+ foreach ( $wpemailcapturefeed as $item ) {
83
+ $url = preg_replace( '/#.*/', '', esc_url( $item->get_permalink(), $protocolls=null, 'display' ) );
84
+ echo '<li>';
85
+ echo '<a href="'.$url.'#utm_source=wpadmin&utm_medium=sidebarwidget&utm_term=newsitem&utm_campaign=wpemailcapture">'. esc_html( $item->get_title() ) .'</a> ';
86
+ echo '</li>';
87
+ }
88
+ }
89
  echo '</ul></div>';
90
  break;
91
  case 'supportus':
inc/exportcsv.php CHANGED
@@ -24,7 +24,7 @@ function wp_email_capture_export()
24
 
25
  $sql = "SELECT name, email FROM " . $table_name;
26
 
27
- $results = $wpdb->get_results($wpdb->prepare($sql));
28
 
29
  foreach ($results as $result) {
30
 
24
 
25
  $sql = "SELECT name, email FROM " . $table_name;
26
 
27
+ $results = $wpdb->get_results($sql);
28
 
29
  foreach ($results as $result) {
30
 
inc/functions.php CHANGED
@@ -22,9 +22,9 @@ function checkIfPresent($email){
22
 
23
  $sql = 'SELECT COUNT(*)
24
 
25
- FROM '. $table_name . ' WHERE email = "'. $email .'"';
26
 
27
- $prep = $wpdb->prepare($sql);
28
 
29
  $result = $wpdb->get_var($prep);
30
 
22
 
23
  $sql = 'SELECT COUNT(*)
24
 
25
+ FROM '. $table_name . ' WHERE email = "%s"';
26
 
27
+ $prep = $wpdb->prepare($sql,$email);
28
 
29
  $result = $wpdb->get_var($prep);
30
 
inc/process.php CHANGED
@@ -49,11 +49,13 @@ global $wpdb;
49
  $confirm_code=md5(uniqid(rand()));
50
 
51
  $name = $_REQUEST['wp-email-capture-name'];
 
 
52
 
53
  if (get_option("wp_email_capture_name_required") == 1 && $name == "")
54
  {
55
 
56
- $url = $_SERVER['PHP_SELF'] . "?wp_email_capture_error=Please%20Provide%20A%20Name";
57
  wp_redirect($url);
58
  die();
59
 
@@ -66,7 +68,7 @@ if (!is_email($email))
66
 
67
  {
68
 
69
- $url = $_SERVER['PHP_SELF'] . "?wp_email_capture_error=Not%20a%20valid%20email";
70
 
71
  wp_redirect($url);
72
 
@@ -107,7 +109,7 @@ if (wp_email_capture_double_check_everything($name, $email))
107
 
108
  if ($sqlcheck){
109
 
110
- $url = $_SERVER['PHP_SELF'] . "?wp_email_capture_error=User%20already%20present";
111
 
112
  wp_redirect($url);
113
 
@@ -123,9 +125,6 @@ if (wp_email_capture_double_check_everything($name, $email))
123
 
124
 
125
  $result=$wpdb->insert($table_name, array('confirm_code' => $confirm_code, 'name' => $name,'email' => $email), array('%s','%s', '%s'));
126
- //$sql="INSERT INTO ".$table_name."(confirm_code, name, email)VALUES('$confirm_code', '$name', '$email')";
127
-
128
- //$result=$wpdb->query($wpdb->prepare($sql));
129
 
130
 
131
 
@@ -224,7 +223,7 @@ if($sentmail){
224
 
225
  else {
226
 
227
- $url = $_SERVER['PHP_SELF'] . "?wp_email_capture_error=Email%20unable%20to%20be%20sent";
228
 
229
  wp_redirect($url);
230
 
@@ -252,9 +251,9 @@ function wp_capture_email_confirm()
252
 
253
  $table_name = $wpdb->prefix . "wp_email_capture_temp_members";
254
 
255
- $sql1="SELECT id FROM $table_name WHERE confirm_code ='$passkey'";
256
 
257
- $result=$wpdb->get_var($wpdb->prepare($sql1));
258
 
259
  if ($result != '')
260
 
@@ -262,9 +261,9 @@ function wp_capture_email_confirm()
262
 
263
  $table_name2 = $wpdb->prefix . "wp_email_capture_registered_members";
264
 
265
- $sql2="SELECT * FROM $table_name WHERE confirm_code ='$passkey'";
266
 
267
- $rowresults = $wpdb->get_results($wpdb->prepare($sql2));
268
 
269
  foreach ($rowresults as $rowresult) {
270
 
@@ -274,16 +273,15 @@ function wp_capture_email_confirm()
274
 
275
  $result3 = $wpdb->insert($table_name2, array( 'name' => $name, 'email' => $email),array('%s','%s'));
276
 
277
- //$sql3="INSERT INTO $table_name2(name, email)VALUES('$name', '$email')";
278
- //$result3=$wpdb->query($wpdb->prepare($sql3));
279
 
280
  }
281
 
282
  }
283
 
284
  else {
285
-
286
- $url = $url . "?wp_email_capture_error=Wrong%20confirmation%20code";
287
 
288
  wp_redirect($url);
289
 
@@ -295,9 +293,9 @@ function wp_capture_email_confirm()
295
 
296
  if($result3){
297
 
298
- $sql4="DELETE FROM $table_name WHERE confirm_code = '$passkey'";
299
 
300
- $result4=$wpdb->query($wpdb->prepare($sql4));
301
  $fullreg = "";
302
  $fullreg = get_option('wp_email_capture_redirection');
303
  if ($fullreg == "")
49
  $confirm_code=md5(uniqid(rand()));
50
 
51
  $name = $_REQUEST['wp-email-capture-name'];
52
+ $starturl = $_SERVER['HTTP_REFERER'];
53
+ if (strpos($starturl, "?") === false) { $extrastring = "?"; } else { $extrastring = "&"; }
54
 
55
  if (get_option("wp_email_capture_name_required") == 1 && $name == "")
56
  {
57
 
58
+ $url = $starturl . $extrastring . "wp_email_capture_error=Please%20Provide%20A%20Name";
59
  wp_redirect($url);
60
  die();
61
 
68
 
69
  {
70
 
71
+ $url = $starturl . $extrastring . "wp_email_capture_error=Not%20a%20valid%20email";
72
 
73
  wp_redirect($url);
74
 
109
 
110
  if ($sqlcheck){
111
 
112
+ $url = $starturl . $extrastring . "wp_email_capture_error=User%20already%20present";
113
 
114
  wp_redirect($url);
115
 
125
 
126
 
127
  $result=$wpdb->insert($table_name, array('confirm_code' => $confirm_code, 'name' => $name,'email' => $email), array('%s','%s', '%s'));
 
 
 
128
 
129
 
130
 
223
 
224
  else {
225
 
226
+ $url = $starturl . $extrastring . "wp_email_capture_error=Email%20unable%20to%20be%20sent";
227
 
228
  wp_redirect($url);
229
 
251
 
252
  $table_name = $wpdb->prefix . "wp_email_capture_temp_members";
253
 
254
+ $sql1="SELECT id FROM $table_name WHERE confirm_code ='%s'";
255
 
256
+ $result=$wpdb->get_var($wpdb->prepare($sql1,$passkey));
257
 
258
  if ($result != '')
259
 
261
 
262
  $table_name2 = $wpdb->prefix . "wp_email_capture_registered_members";
263
 
264
+ $sql2="SELECT * FROM $table_name WHERE confirm_code ='%s'";
265
 
266
+ $rowresults = $wpdb->get_results($wpdb->prepare($sql2,$passkey));
267
 
268
  foreach ($rowresults as $rowresult) {
269
 
273
 
274
  $result3 = $wpdb->insert($table_name2, array( 'name' => $name, 'email' => $email),array('%s','%s'));
275
 
276
+
 
277
 
278
  }
279
 
280
  }
281
 
282
  else {
283
+ if (strpos($url, "?") === false) { $extrastring = "?"; } else { $extrastring = "&"; }
284
+ $url = $url . $extrastring . "wp_email_capture_error=Wrong%20confirmation%20code";
285
 
286
  wp_redirect($url);
287
 
293
 
294
  if($result3){
295
 
296
+ $sql4="DELETE FROM $table_name WHERE confirm_code = '%s'";
297
 
298
+ $result4=$wpdb->query($wpdb->prepare($sql4,$passkey));
299
  $fullreg = "";
300
  $fullreg = get_option('wp_email_capture_redirection');
301
  if ($fullreg == "")
inc/tabledata.php CHANGED
@@ -18,7 +18,7 @@ function wp_email_capture_writetable($limit = 0, $header = '')
18
 
19
  }
20
 
21
- $results = $wpdb->get_results($wpdb->prepare($sql));
22
 
23
 
24
 
@@ -70,9 +70,9 @@ function wp_email_capture_deleteid($id)
70
 
71
  $table_name = $wpdb->prefix . "wp_email_capture_registered_members";
72
 
73
- $sql = "DELETE FROM " . $table_name . " WHERE id = '" . $id ."'";
74
 
75
- $result = $wpdb->query($wpdb->prepare($sql));
76
 
77
  }
78
  ?>
18
 
19
  }
20
 
21
+ $results = $wpdb->get_results($sql);
22
 
23
 
24
 
70
 
71
  $table_name = $wpdb->prefix . "wp_email_capture_registered_members";
72
 
73
+ $sql = "DELETE FROM " . $table_name . " WHERE id = '%d'";
74
 
75
+ $result = $wpdb->query($wpdb->prepare($sql,$id));
76
 
77
  }
78
  ?>
inc/tempdata.php CHANGED
@@ -10,7 +10,7 @@ function wp_email_capture_truncate()
10
 
11
  $sql = "TRUNCATE " . $table_name;
12
 
13
- $result = $wpdb->query($wpdb->prepare($sql));
14
 
15
  }
16
 
@@ -24,7 +24,7 @@ function wp_email_capture_delete()
24
 
25
  $sql = "TRUNCATE " . $table_name;
26
 
27
- $result = $wpdb->query($wpdb->prepare($sql));
28
 
29
  }
30
 
@@ -41,9 +41,8 @@ function wp_email_capture_count_temp()
41
 
42
  FROM '. $table_name;
43
 
44
- $prep = $wpdb->prepare($sql);
45
 
46
- $result = $wpdb->get_var($prep);
47
 
48
  return $result;
49
 
10
 
11
  $sql = "TRUNCATE " . $table_name;
12
 
13
+ $result = $wpdb->query($sql);
14
 
15
  }
16
 
24
 
25
  $sql = "TRUNCATE " . $table_name;
26
 
27
+ $result = $wpdb->query($sql);
28
 
29
  }
30
 
41
 
42
  FROM '. $table_name;
43
 
 
44
 
45
+ $result = $wpdb->get_var($sql);
46
 
47
  return $result;
48
 
readme.txt CHANGED
@@ -1,9 +1,9 @@
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.4.2
5
- Version: 2.7
6
- Stable tag: 2.7
7
  Contributors: rhyswynne
8
  Donate link: http://wpemailcapture.com/pricing/
9
 
@@ -118,6 +118,9 @@ To style your form, you need to add to your CSS file the following ID declaratio
118
  3. It's appearance within the template
119
 
120
  == Frequently Asked Questions ==
 
 
 
121
  = I am Upgrading to WP Email Capture 2.3+, why has my WP Email Capture Sidebar Widget disappeared? =
122
  The WP Email Capture version 2.3 saw the introduction of multiple sidebar widgets. This was coded differently to the pre 2.3 WP Email Capture sidebar widget. As such you will have to recreate the sidebar widget. It's easy to do, but apologies for this - I am working on a fix!
123
 
@@ -146,6 +149,14 @@ Please report any bugs, support and suggestions to the [WP Email Capture Support
146
  To donate to this plugin, please visit the [WP Email Capture Donations Page](http://www.wpemailcapture.com/pricing/)
147
 
148
  == Change Log ==
 
 
 
 
 
 
 
 
149
  = 2.7 (20/11/12) =
150
  * Upgraded Hungarian Translation (thanks [Surbma](http://surbma.hu/)!)
151
  * Rewritten areas of the readme file as it was confusing people (sorry!)
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.5
5
+ Version: 2.7.2
6
+ Stable tag: 2.7.2
7
  Contributors: rhyswynne
8
  Donate link: http://wpemailcapture.com/pricing/
9
 
118
  3. It's appearance within the template
119
 
120
  == Frequently Asked Questions ==
121
+ = Can Registered Users access the "thank you" page after signup? They try signing up again and get a 'user has already been registered' error =
122
+ Yes they can, however they can't go through the registration process. If you are using [WP Email Capture Premium](http://www.wpemailcapture.com/pricing/), you can send an autoresponder after signing up (which can contain a link to the "thank you" page). Alternatively, add a notice on your landing page to encourage users to bookmark the page.
123
+
124
  = I am Upgrading to WP Email Capture 2.3+, why has my WP Email Capture Sidebar Widget disappeared? =
125
  The WP Email Capture version 2.3 saw the introduction of multiple sidebar widgets. This was coded differently to the pre 2.3 WP Email Capture sidebar widget. As such you will have to recreate the sidebar widget. It's easy to do, but apologies for this - I am working on a fix!
126
 
149
  To donate to this plugin, please visit the [WP Email Capture Donations Page](http://www.wpemailcapture.com/pricing/)
150
 
151
  == Change Log ==
152
+ = 2.7.2 (11/12/12) =
153
+ * Compatible with WordPress 3.5. Critical upgrade if you're using WP 3.5
154
+ * Fixed an admin page error so if the news feed wasn't pulling from my site, then you will get an empty box, rather than an ugly error.
155
+
156
+ = 2.7.1 (24/11/12) =
157
+ * Fixed a small bug that appears that error messages weren't appearing when sites had the defeault permalink structure.
158
+ * Fixed a redirection bug that users using the default URL structure were having, that caused a usability error.
159
+
160
  = 2.7 (20/11/12) =
161
  * Upgraded Hungarian Translation (thanks [Surbma](http://surbma.hu/)!)
162
  * Rewritten areas of the readme file as it was confusing people (sorry!)
wp-email-capture.php CHANGED
@@ -8,7 +8,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.7
12
 
13
  Author: Rhys Wynne
14
 
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.7.2
12
 
13
  Author: Rhys Wynne
14