Postie - Version 1.4.7

Version Description

(2012.12.07) = * Fixed bug in cron setup that was preventing Weekly, twice an hour and every ten minute schedules from running.

Download this release

Release Info

Developer WayneAllen
Plugin Icon 128x128 Postie
Version 1.4.7
Comparing to
See all releases

Code changes from version 1.4.6 to 1.4.7

deploy/_deploy.txt CHANGED
@@ -1,5 +1,8 @@
 
 
1
  update version number in postie.php
2
  update version number in docs\postie.txt
3
  run deploy.cmd
4
  commit
5
- branch trunk to new version
 
1
+ see: http://codex.wordpress.org/Writing_a_Plugin#Updating_your_Plugin
2
+ update docs\Changes.txt
3
  update version number in postie.php
4
  update version number in docs\postie.txt
5
  run deploy.cmd
6
  commit
7
+ branch trunk to new version
8
+ add release post on http://postieplugin.com/
docs/Changes.txt CHANGED
@@ -4,6 +4,9 @@
4
 
5
  == CHANGELOG ==
6
 
 
 
 
7
  = 1.4.6 (2012.12.06) =
8
  * Changed XSS check to only emit warning until a better solution can be developed
9
  * Fixed bug where authorized addresses were being checked with case sensitive rather than insensitive.
4
 
5
  == CHANGELOG ==
6
 
7
+ = 1.4.7 (2012.12.07)
8
+ * Fixed bug in cron setup that was preventing Weekly, twice an hour and every ten minute schedules from running.
9
+
10
  = 1.4.6 (2012.12.06) =
11
  * Changed XSS check to only emit warning until a better solution can be developed
12
  * Fixed bug where authorized addresses were being checked with case sensitive rather than insensitive.
docs/FAQ.txt CHANGED
@@ -7,7 +7,7 @@ ports 993 and 995 (for pop3-ssl and imap-ssl) by default. I have heard that
7
  you can request that they open them for you ( you might have to pay extra).
8
 
9
  You can check for open ports with the following command on your server:
10
- netstat -ln|grep -E ':::(993|995|143)'
11
 
12
  If nothing shows up, then the ports are not open.
13
 
@@ -183,4 +183,4 @@ that doesn't allow you access to cron you can use a service like
183
  <a href="https://www.setcronjob.com/" target="_blank">SetCronJob</a>.
184
 
185
  It is also possible to turn the WordPress cron off. Please make sure something like
186
- define('DISABLE_WP_CRON', true); is not in your wp-config.php file.
7
  you can request that they open them for you ( you might have to pay extra).
8
 
9
  You can check for open ports with the following command on your server:
10
+ `netstat -ln|grep -E ':::(993|995|143)'`
11
 
12
  If nothing shows up, then the ports are not open.
13
 
183
  <a href="https://www.setcronjob.com/" target="_blank">SetCronJob</a>.
184
 
185
  It is also possible to turn the WordPress cron off. Please make sure something like
186
+ `define('DISABLE_WP_CRON', true);` is not in your wp-config.php file.
docs/Postie.txt CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email
7
  Requires at least: 3.0
8
  Tested up to: 3.4.2
9
- Stable tag: 1.4.6
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
6
  Tags: e-mail, email
7
  Requires at least: 3.0
8
  Tested up to: 3.4.2
9
+ Stable tag: 1.4.7
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
faq.html CHANGED
@@ -24,8 +24,9 @@
24
  ports 993 and 995 (for pop3-ssl and imap-ssl) by default. I have heard that
25
  you can request that they open them for you ( you might have to pay extra).</p>
26
 
27
- <p>You can check for open ports with the following command on your server:
28
- netstat -ln|grep -E ':::(993|995|143)'</p>
 
29
 
30
  <p>If nothing shows up, then the ports are not open.</p>
31
 
@@ -216,5 +217,8 @@ curl on Windows and use the Scheduled Tasks control panel. If you are using a ho
216
  that doesn't allow you access to cron you can use a service like
217
  <a href="https://www.setcronjob.com/">SetCronJob</a>.</p>
218
 
219
- <p>It is also possible to turn the WordPress cron off. Please make sure something like
220
- define('DISABLE_WP_CRON', true); is not in your wp-config.php file.</p>
 
 
 
24
  ports 993 and 995 (for pop3-ssl and imap-ssl) by default. I have heard that
25
  you can request that they open them for you ( you might have to pay extra).</p>
26
 
27
+ <p>You can check for open ports with the following command on your server:</p>
28
+
29
+ <pre><code>netstat -ln|grep -E &#039;:::(993|995|143)&#039;</code></pre>
30
 
31
  <p>If nothing shows up, then the ports are not open.</p>
32
 
217
  that doesn't allow you access to cron you can use a service like
218
  <a href="https://www.setcronjob.com/">SetCronJob</a>.</p>
219
 
220
+ <p>It is also possible to turn the WordPress cron off. Please make sure something like</p>
221
+
222
+ <pre><code>define(&#039;DISABLE_WP_CRON&#039;, true);</code></pre>
223
+
224
+ <p>is not in your wp-config.php file.</p>
postie-functions.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  /*
4
- $Id: postie-functions.php 635140 2012-12-06 22:58:27Z WayneAllen $
5
  */
6
 
7
  /* TODO
@@ -2335,8 +2335,7 @@ function GetDBConfig() {
2335
  if (!isset($config["FILTERN
2336
  EWLINES"]))
2337
  $config["FILTERNEWLINES"] = true;
2338
- include('templates/video2_templ
2339
- ates.php');
2340
  $config['VIDEO2TEMPLATES'] = $video2Templates;
2341
  if (!isset($config["V
2342
  IDEO2TEMPLATE"]))
@@ -2344,12 +2343,10 @@ function GetDBConfig() {
2344
 
2345
  //image
2346
  if (!isset($config["SELECTED_IMAGETEMPLATE"]))
2347
- $config['SELECTED_IMAGETEMPLATE'] = 'wordpr
2348
- ess_default';
2349
  if (!isset($config["SMTP"]))
2350
  $config["SMTP"] = array();
2351
- include('templates/image_tem
2352
- plates.php');
2353
  if (!isset($config["IMAGETEMPLATE"]))
2354
  $config["IMAGETEMPLATE"] = $wordpress_default;
2355
  $config['IMAGETEMPLATES'] = $imageTemplates;
@@ -2486,8 +2483,7 @@ function postie_validate_settings($in) {
2486
  $out[$key] = array_key_exists($key, $in) ? $in[$key] : $default;
2487
 
2488
  // some fields are always forced to lower case:
2489
- $lowercase = array('authorized_add
2490
- resses', 'smtp', 'supported_file_types', 'video1types', 'video2types', 'audiotypes');
2491
  foreach ($lowercase as $field) {
2492
  $out[$field] = ( is_array($out[$field]) ) ? array_map("strtolower", $out[$field]) : strtolower($out[$field]);
2493
  }
1
  <?php
2
 
3
  /*
4
+ $Id: postie-functions.php 635465 2012-12-07 17:38:23Z WayneAllen $
5
  */
6
 
7
  /* TODO
2335
  if (!isset($config["FILTERN
2336
  EWLINES"]))
2337
  $config["FILTERNEWLINES"] = true;
2338
+ include('templates/video2_templates.php');
 
2339
  $config['VIDEO2TEMPLATES'] = $video2Templates;
2340
  if (!isset($config["V
2341
  IDEO2TEMPLATE"]))
2343
 
2344
  //image
2345
  if (!isset($config["SELECTED_IMAGETEMPLATE"]))
2346
+ $config['SELECTED_IMAGETEMPLATE'] = 'wordpress_default';
 
2347
  if (!isset($config["SMTP"]))
2348
  $config["SMTP"] = array();
2349
+ include('templates/image_templates.php');
 
2350
  if (!isset($config["IMAGETEMPLATE"]))
2351
  $config["IMAGETEMPLATE"] = $wordpress_default;
2352
  $config['IMAGETEMPLATES'] = $imageTemplates;
2483
  $out[$key] = array_key_exists($key, $in) ? $in[$key] : $default;
2484
 
2485
  // some fields are always forced to lower case:
2486
+ $lowercase = array('authorized_addresses', 'smtp', 'supported_file_types', 'video1types', 'video2types', 'audiotypes');
 
2487
  foreach ($lowercase as $field) {
2488
  $out[$field] = ( is_array($out[$field]) ) ? array_map("strtolower", $out[$field]) : strtolower($out[$field]);
2489
  }
postie.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Signifigantly upgrades the posting by mail features of Word Press (See <a href='options-general.php?page=postie/postie.php'>Settings and options</a>) to configure your e-mail settings. See the <a href='http://wordpress.org/extend/plugins/postie/other_notes'>Readme</a> for usage. Visit the <a href='http://wordpress.org/support/plugin/postie'>postie forum</a> for support.
7
- Version: 1.4.6
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
@@ -27,7 +27,7 @@
27
  */
28
 
29
  /*
30
- $Id: postie.php 635157 2012-12-06 23:55:51Z WayneAllen $
31
  * -= Requests Pending =-
32
  * German Umlats don't work
33
  * Problems under PHP5
@@ -53,8 +53,8 @@
53
  * Support private posts
54
  * Make it possible to post without a script at all
55
  * * TODO - fix corruption of rtf attachments
56
- * TODO - add port checking in tests
57
- * TODO - non-image uploads get ignored in content when using autogallery - see
58
  replaceimageplaceholders
59
  */
60
 
@@ -160,7 +160,7 @@ function postie_warnings() {
160
  add_action('admin_notices', 'postie_enter_info');
161
  }
162
 
163
- if (!function_exists('imap_mime_header_decode') && $_GET['activate'] == true) {
164
 
165
  function postie_imap_warning() {
166
  echo "<div id='postie-imap-warning' class='error'><p><strong>";
@@ -225,7 +225,10 @@ function postie_cron($interval = false) {
225
  if ($interval == 'manual') {
226
  wp_clear_scheduled_hook('check_postie_hook');
227
  } else {
228
- wp_schedule_event(time(), $interval, 'check_postie_hook');
 
 
 
229
  }
230
  }
231
 
@@ -233,17 +236,17 @@ function postie_decron() {
233
  wp_clear_scheduled_hook('check_postie_hook');
234
  }
235
 
236
- /* here we add some more options for how often to check for e-mail */
237
 
238
- function more_reccurences($schedules) {
239
- $schedules['postie-weekly'] = array('interval' => 60 * 60 * 24 * 7, 'display' => __('Once Weekly'));
240
- $schedules['postie-twiceperhour'] = array('interval' => 60 * 30, 'display' => __('Twice per hour '));
241
- $schedules['postie-tenminutes'] = array('interval' => 60 * 10, 'display' => __('Every 10 minutes'));
242
 
243
  return $schedules;
244
  }
245
 
246
- add_filter('cron_schedules', 'more_reccurences');
247
  register_activation_hook(__FILE__, 'postie_cron');
248
  register_deactivation_hook(__FILE__, 'postie_decron');
249
  add_action('check_postie_hook', 'check_postie');
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Signifigantly upgrades the posting by mail features of Word Press (See <a href='options-general.php?page=postie/postie.php'>Settings and options</a>) to configure your e-mail settings. See the <a href='http://wordpress.org/extend/plugins/postie/other_notes'>Readme</a> for usage. Visit the <a href='http://wordpress.org/support/plugin/postie'>postie forum</a> for support.
7
+ Version: 1.4.7
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
27
  */
28
 
29
  /*
30
+ $Id: postie.php 635465 2012-12-07 17:38:23Z WayneAllen $
31
  * -= Requests Pending =-
32
  * German Umlats don't work
33
  * Problems under PHP5
53
  * Support private posts
54
  * Make it possible to post without a script at all
55
  * * TODO - fix corruption of rtf attachments
56
+ * TODO - add port checking in tests
57
+ * TODO - non-image uploads get ignored in content when using autogallery - see
58
  replaceimageplaceholders
59
  */
60
 
160
  add_action('admin_notices', 'postie_enter_info');
161
  }
162
 
163
+ if (!function_exists('imap_mime_header_decode') && array_key_exists('activate', $_GET) && $_GET['activate'] == true) {
164
 
165
  function postie_imap_warning() {
166
  echo "<div id='postie-imap-warning' class='error'><p><strong>";
225
  if ($interval == 'manual') {
226
  wp_clear_scheduled_hook('check_postie_hook');
227
  } else {
228
+ DebugEcho("Setting $interval cron schedule");
229
+ if (false === wp_schedule_event(time(), $interval, 'check_postie_hook')) {
230
+ EchoInfo("Failed to set up cron task.");
231
+ }
232
  }
233
  }
234
 
236
  wp_clear_scheduled_hook('check_postie_hook');
237
  }
238
 
239
+ /* here we add some more cron options for how often to check for e-mail */
240
 
241
+ function postie_more_reccurences($schedules) {
242
+ $schedules['weekly'] = array('interval' => (60 * 60 * 24 * 7), 'display' => __('Once Weekly'));
243
+ $schedules['twiceperhour'] = array('interval' => 60 * 30, 'display' => __('Twice per hour '));
244
+ $schedules['tenminutes'] = array('interval' => 60 * 10, 'display' => __('Every 10 minutes'));
245
 
246
  return $schedules;
247
  }
248
 
249
+ add_filter('cron_schedules', 'postie_more_reccurences');
250
  register_activation_hook(__FILE__, 'postie_cron');
251
  register_deactivation_hook(__FILE__, 'postie_decron');
252
  add_action('check_postie_hook', 'check_postie');
readme.txt CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email
7
  Requires at least: 3.0
8
  Tested up to: 3.4.2
9
- Stable tag: 1.4.6
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -176,7 +176,7 @@ ports 993 and 995 (for pop3-ssl and imap-ssl) by default. I have heard that
176
  you can request that they open them for you ( you might have to pay extra).
177
 
178
  You can check for open ports with the following command on your server:
179
- netstat -ln|grep -E ':::(993|995|143)'
180
 
181
  If nothing shows up, then the ports are not open.
182
 
@@ -352,13 +352,16 @@ that doesn't allow you access to cron you can use a service like
352
  <a href="https://www.setcronjob.com/" target="_blank">SetCronJob</a>.
353
 
354
  It is also possible to turn the WordPress cron off. Please make sure something like
355
- define('DISABLE_WP_CRON', true); is not in your wp-config.php file.
356
  == Upgrade Notice ==
357
  * Attachments are now processed in the order they were attached.
358
  * XSS detection only issues a warning now
359
 
360
  == CHANGELOG ==
361
 
 
 
 
362
  = 1.4.6 (2012.12.06) =
363
  * Changed XSS check to only emit warning until a better solution can be developed
364
  * Fixed bug where authorized addresses were being checked with case sensitive rather than insensitive.
6
  Tags: e-mail, email
7
  Requires at least: 3.0
8
  Tested up to: 3.4.2
9
+ Stable tag: 1.4.7
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
176
  you can request that they open them for you ( you might have to pay extra).
177
 
178
  You can check for open ports with the following command on your server:
179
+ `netstat -ln|grep -E ':::(993|995|143)'`
180
 
181
  If nothing shows up, then the ports are not open.
182
 
352
  <a href="https://www.setcronjob.com/" target="_blank">SetCronJob</a>.
353
 
354
  It is also possible to turn the WordPress cron off. Please make sure something like
355
+ `define('DISABLE_WP_CRON', true);` is not in your wp-config.php file.
356
  == Upgrade Notice ==
357
  * Attachments are now processed in the order they were attached.
358
  * XSS detection only issues a warning now
359
 
360
  == CHANGELOG ==
361
 
362
+ = 1.4.7 (2012.12.07) =
363
+ * Fixed bug in cron setup that was preventing Weekly, twice an hour and every ten minute schedules from running.
364
+
365
  = 1.4.6 (2012.12.06) =
366
  * Changed XSS check to only emit warning until a better solution can be developed
367
  * Fixed bug where authorized addresses were being checked with case sensitive rather than insensitive.
test/postie-functionsTest.php CHANGED
@@ -3,6 +3,7 @@
3
  require 'wpstub.php';
4
  require'../postie-functions.php';
5
  require'../simple_html_dom.php';
 
6
 
7
  class postiefunctionsTest extends PHPUnit_Framework_TestCase {
8
 
@@ -286,7 +287,12 @@ class postiefunctionsTest extends PHPUnit_Framework_TestCase {
286
  $this->assertEquals("line 1\nline 2\n", remove_signature("line 1\nline 2\n--", array("--", "- --")));
287
  }
288
 
289
-
 
 
 
 
 
290
  }
291
 
292
  ?>
3
  require 'wpstub.php';
4
  require'../postie-functions.php';
5
  require'../simple_html_dom.php';
6
+ require '../postie.php';
7
 
8
  class postiefunctionsTest extends PHPUnit_Framework_TestCase {
9
 
287
  $this->assertEquals("line 1\nline 2\n", remove_signature("line 1\nline 2\n--", array("--", "- --")));
288
  }
289
 
290
+ public function testmore_reccurences() {
291
+ $sched = array();
292
+ $newsched = more_reccurences($sched);
293
+ $this->assertEquals(3, count($newsched));
294
+ }
295
+
296
  }
297
 
298
  ?>
test/wpstub.php CHANGED
@@ -31,6 +31,11 @@ function current_time() {
31
  return '2005-08-05 10:41:13';
32
  }
33
 
 
 
 
 
 
34
  function get_post() {
35
  $r = new stdClass();
36
  $r->post_date = '';
@@ -82,4 +87,20 @@ function get_attachment_link() {
82
  function get_user_by(){
83
  return false;
84
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  ?>
31
  return '2005-08-05 10:41:13';
32
  }
33
 
34
+ function is_admin()
35
+ {
36
+ return false;
37
+ }
38
+
39
  function get_post() {
40
  $r = new stdClass();
41
  $r->post_date = '';
87
  function get_user_by(){
88
  return false;
89
  }
90
+
91
+ function register_activation_hook(){
92
+
93
+ }
94
+
95
+ function add_action(){
96
+
97
+ }
98
+
99
+ function add_filter(){
100
+
101
+ }
102
+
103
+ function register_deactivation_hook(){
104
+
105
+ }
106
  ?>