Postie - Version 1.9.3

Version Description

(2017.08.04) = * Feature: Add "every 2 hours" option * Fix: Include actual response when IMAP authentication fails * Fix: Incorrectly processing text/html sections as attachments in some cases

Download this release

Release Info

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

Code changes from version 1.9.2 to 1.9.3

config_form_server.php CHANGED
@@ -85,6 +85,13 @@
85
  echo "selected='selected'";
86
  }
87
  ?>><?php _e('daily', 'postie') ?>
 
 
 
 
 
 
 
88
  </option>
89
 
90
  <option value="hourly" <?php
@@ -98,7 +105,7 @@
98
  if ($interval == "twiceperhour") {
99
  echo "selected='selected'";
100
  }
101
- ?>><?php _e('twice per hour', 'postie') ?>
102
  </option>
103
 
104
  <option value="tenminutes" <?php
85
  echo "selected='selected'";
86
  }
87
  ?>><?php _e('daily', 'postie') ?>
88
+ </option>
89
+
90
+ <option value="twohours"<?php
91
+ if ($interval == "twohours") {
92
+ echo "selected='selected'";
93
+ }
94
+ ?>><?php _e('every 2 hours', 'postie') ?>
95
  </option>
96
 
97
  <option value="hourly" <?php
105
  if ($interval == "twiceperhour") {
106
  echo "selected='selected'";
107
  }
108
+ ?>><?php _e('every 30 minutes', 'postie') ?>
109
  </option>
110
 
111
  <option value="tenminutes" <?php
docs/Changes.txt CHANGED
@@ -35,6 +35,11 @@ All script, style and body tags are stripped from html emails.
35
  Attachments are now processed in the order they were attached.
36
 
37
  == CHANGELOG ==
 
 
 
 
 
38
  = 1.9.2 (2017.07.24) =
39
  * Fix: Uninitialized variable in Postie::create_post()
40
  * Fix: More robust tag detection
35
  Attachments are now processed in the order they were attached.
36
 
37
  == CHANGELOG ==
38
+ = 1.9.3 (2017.08.04) =
39
+ * Feature: Add "every 2 hours" option
40
+ * Fix: Include actual response when IMAP authentication fails
41
+ * Fix: Incorrectly processing text/html sections as attachments in some cases
42
+
43
  = 1.9.2 (2017.07.24) =
44
  * Fix: Uninitialized variable in Postie::create_post()
45
  * Fix: More robust tag detection
docs/Postie.txt CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.8
9
- Stable tag: 1.9.2
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.8
9
+ Stable tag: 1.9.3
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
lib/fMailbox.php CHANGED
@@ -310,7 +310,7 @@ class fMailbox {
310
  if (!isset($info['html'])) {
311
  $info['html'] = '';
312
  }
313
-
314
  // If the part doesn't have a disposition and is not the default text or html, set the disposition to inline
315
  if (!$has_disposition && ((!$is_text || !empty($info['text'])) && (!$is_html || !empty($info['html'])))) {
316
  $is_web_image = $structure['type'] == 'image' && in_array($structure['subtype'], array('gif', 'png', 'jpeg', 'pjpeg'));
@@ -329,29 +329,38 @@ class fMailbox {
329
 
330
  if ($is_text) {
331
  if (empty($info['text'])) {
 
332
  $info['text'] = $content;
333
  return $info;
334
  } else {
 
335
  $info['text'] .= "\r\n$content";
336
  return $info;
337
  }
 
 
338
  }
339
 
340
- if ($is_html && !isset($info['html'])) {
 
341
  $info['html'] = $content;
342
  return $info;
 
 
343
  }
344
  }
345
 
346
  if ($structure['disposition'] == 'inline' && $structure['type'] == 'image') {
 
347
  $info['text'] .= "<:inline $filename inline:>";
348
  }
349
 
350
  if (!isset($info[$structure['disposition']])) {
 
351
  $info[$structure['disposition']] = array();
352
  }
353
 
354
- DebugEcho("handlePart: disposition: $filename {$structure['type']} / {$structure['subtype']}");
355
  $info[$structure['disposition']][] = array(
356
  'filename' => $filename,
357
  'mimetype' => $structure['type'] . '/' . $structure['subtype'],
310
  if (!isset($info['html'])) {
311
  $info['html'] = '';
312
  }
313
+
314
  // If the part doesn't have a disposition and is not the default text or html, set the disposition to inline
315
  if (!$has_disposition && ((!$is_text || !empty($info['text'])) && (!$is_html || !empty($info['html'])))) {
316
  $is_web_image = $structure['type'] == 'image' && in_array($structure['subtype'], array('gif', 'png', 'jpeg', 'pjpeg'));
329
 
330
  if ($is_text) {
331
  if (empty($info['text'])) {
332
+ DebugEcho("handlePart: text (first time)");
333
  $info['text'] = $content;
334
  return $info;
335
  } else {
336
+ DebugEcho("handlePart: text (nth time)");
337
  $info['text'] .= "\r\n$content";
338
  return $info;
339
  }
340
+ } else {
341
+ DebugEcho("handlePart: not text");
342
  }
343
 
344
+ if ($is_html && empty($info['html'])) {
345
+ DebugEcho("handlePart: html");
346
  $info['html'] = $content;
347
  return $info;
348
+ } else {
349
+ DebugEcho("handlePart: not html");
350
  }
351
  }
352
 
353
  if ($structure['disposition'] == 'inline' && $structure['type'] == 'image') {
354
+ DebugEcho("handlePart: inline image");
355
  $info['text'] .= "<:inline $filename inline:>";
356
  }
357
 
358
  if (!isset($info[$structure['disposition']])) {
359
+ DebugEcho("handlePart: blank disposition");
360
  $info[$structure['disposition']] = array();
361
  }
362
 
363
+ DebugEcho("handlePart: disposition: '$filename' {$structure['type']}/{$structure['subtype']}");
364
  $info[$structure['disposition']][] = array(
365
  'filename' => $filename,
366
  'mimetype' => $structure['type'] . '/' . $structure['subtype'],
lib/pSocketConnection.php CHANGED
@@ -59,7 +59,7 @@ class pSocketConnection extends pConnection {
59
  }
60
  $response = $this->write('LOGIN ' . $this->username . ' ' . $this->password);
61
  if (!$response || !preg_match('#^[^ ]+\s+OK#', $response[count($response) - 1])) {
62
- throw new fValidationException('The username and password provided were not accepted for the %1$s server %2$s on port %3$s', strtoupper($this->type), $this->host, $this->port);
63
  }
64
  $this->write('SELECT "' . $this->mailbox . '"');
65
  } elseif ($this->type == 'pop3') {
59
  }
60
  $response = $this->write('LOGIN ' . $this->username . ' ' . $this->password);
61
  if (!$response || !preg_match('#^[^ ]+\s+OK#', $response[count($response) - 1])) {
62
+ throw new fValidationException('The username and password provided were not accepted for the %1$s server %2$s on port %3$s. %4$s', strtoupper($this->type), $this->host, $this->port, $response[count($response) - 1]);
63
  }
64
  $this->write('SELECT "' . $this->mailbox . '"');
65
  } elseif ($this->type == 'pop3') {
postie.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Significantly upgrades the Post by Email features of WordPress.
7
- Version: 1.9.2
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL3
@@ -28,14 +28,14 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 1702006 2017-07-24 23:03:24Z WayneAllen $
32
  */
33
 
34
  if (!defined('WPINC')) {
35
  die; // Exit if accessed directly
36
  }
37
 
38
- define('POSTIE_VERSION', '1.9.2');
39
  define('POSTIE_ROOT', dirname(__FILE__));
40
  define('POSTIE_URL', WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
41
 
@@ -186,6 +186,7 @@ if (!class_exists('PostieInit')) {
186
  //Do not echo output in filters, it seems to break some installs
187
  //error_log("cron_schedules_filter: setting cron schedules");
188
  $schedules['weekly'] = array('interval' => (60 * 60 * 24 * 7), 'display' => __('Once Weekly', 'postie'));
 
189
  $schedules['twiceperhour'] = array('interval' => 60 * 30, 'display' => __('Twice per hour', 'postie'));
190
  $schedules['tenminutes'] = array('interval' => 60 * 10, 'display' => __('Every 10 minutes', 'postie'));
191
  $schedules['fiveminutes'] = array('interval' => 60 * 5, 'display' => __('Every 5 minutes', 'postie'));
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Significantly upgrades the Post by Email features of WordPress.
7
+ Version: 1.9.3
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL3
28
  */
29
 
30
  /*
31
+ $Id: postie.php 1708609 2017-08-04 20:39:43Z WayneAllen $
32
  */
33
 
34
  if (!defined('WPINC')) {
35
  die; // Exit if accessed directly
36
  }
37
 
38
+ define('POSTIE_VERSION', '1.9.3');
39
  define('POSTIE_ROOT', dirname(__FILE__));
40
  define('POSTIE_URL', WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
41
 
186
  //Do not echo output in filters, it seems to break some installs
187
  //error_log("cron_schedules_filter: setting cron schedules");
188
  $schedules['weekly'] = array('interval' => (60 * 60 * 24 * 7), 'display' => __('Once Weekly', 'postie'));
189
+ $schedules['twohours'] = array('interval' => 60 * 60 * 2, 'display' => __('Every 2 hours', 'postie'));
190
  $schedules['twiceperhour'] = array('interval' => 60 * 30, 'display' => __('Twice per hour', 'postie'));
191
  $schedules['tenminutes'] = array('interval' => 60 * 10, 'display' => __('Every 10 minutes', 'postie'));
192
  $schedules['fiveminutes'] = array('interval' => 60 * 5, 'display' => __('Every 5 minutes', 'postie'));
readme.txt CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.8
9
- Stable tag: 1.9.2
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -242,6 +242,11 @@ All script, style and body tags are stripped from html emails.
242
  Attachments are now processed in the order they were attached.
243
 
244
  == CHANGELOG ==
 
 
 
 
 
245
  = 1.9.2 (2017.07.24) =
246
  * Fix: Uninitialized variable in Postie::create_post()
247
  * Fix: More robust tag detection
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.8
9
+ Stable tag: 1.9.3
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
242
  Attachments are now processed in the order they were attached.
243
 
244
  == CHANGELOG ==
245
+ = 1.9.3 (2017.08.04) =
246
+ * Feature: Add "every 2 hours" option
247
+ * Fix: Include actual response when IMAP authentication fails
248
+ * Fix: Incorrectly processing text/html sections as attachments in some cases
249
+
250
  = 1.9.2 (2017.07.24) =
251
  * Fix: Uninitialized variable in Postie::create_post()
252
  * Fix: More robust tag detection