Postie - Version 1.5.21

Version Description

(2014.06.06) = * Fixed spelling errors * Added more debugging around image sizes * Clarified some image options on settings page * Removed call to wp_set_post_terms()

Download this release

Release Info

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

Code changes from version 1.5.20 to 1.5.21

config_form.php CHANGED
@@ -487,12 +487,14 @@
487
  <?php
488
  echo BuildBooleanSelect("Use First Image as Featured Image", "postie-settings[featured_image]", $featured_image, "If any images are attached, the first one will be the featured image for the post");
489
  echo BuildBooleanSelect("Automatically insert image gallery", "postie-settings[auto_gallery]", $auto_gallery, "If any images are attached, they will automatically be inserted as a gallery");
490
- echo BuildBooleanSelect("Image Location", "postie-settings[images_append]", $images_append, "No means they will be put before the text of the message.", array('After', 'Before'));
491
- echo BuildBooleanSelect("Start Image Count At 0", "postie-settings[start_image_count_at_zero]", $start_image_count_at_zero, '', array('Start at 0', 'Start at 1'));
492
  echo BuildBooleanSelect("Generate Thumbnails", "postie-settings[generate_thumbnails]", $generate_thumbnails, "Some hosts crash during thumbnail generation. Set this to 'No' if you have this issue.");
493
  ?>
494
  <tr>
495
- <th width="33%" valign="top" scope="row"><?php _e('Image Place Holder Tag:', 'postie') ?> </th>
 
 
496
  <td>
497
  <input name='postie-settings[image_placeholder]' type="text" id='postie-settings-image_placeholder' value="<?php echo esc_attr($image_placeholder); ?>" size="50" /><br />
498
  </td>
@@ -822,7 +824,7 @@
822
  name='postie-settings[generaltemplate]'><?php echo esc_attr($generaltemplate) ?></textarea>
823
  </td>
824
  </tr>
825
- <?php echo BuildBooleanSelect("Use custom image field for attachements", "postie-settings[custom_image_field]", $custom_image_field, "When set to 'Yes' no attachements will appear in the post (including images, video &amp; sound files). Instead the url to the attachement will be put into a custom field named 'image'. Your theme will need logic to display these attachements."); ?>
826
  </table>
827
  </div>
828
  <div id="simpleTabs-content-7" class="simpleTabs-content">
487
  <?php
488
  echo BuildBooleanSelect("Use First Image as Featured Image", "postie-settings[featured_image]", $featured_image, "If any images are attached, the first one will be the featured image for the post");
489
  echo BuildBooleanSelect("Automatically insert image gallery", "postie-settings[auto_gallery]", $auto_gallery, "If any images are attached, they will automatically be inserted as a gallery");
490
+ echo BuildBooleanSelect("Image Location", "postie-settings[images_append]", $images_append, "Location of attachments if using 'plain' format. Before or After content.", array('After', 'Before'));
491
+ echo BuildBooleanSelect("Start Image Count At", "postie-settings[start_image_count_at_zero]", $start_image_count_at_zero, 'For use if using "Image Place Holder Tag" below.', array('Start at 0', 'Start at 1'));
492
  echo BuildBooleanSelect("Generate Thumbnails", "postie-settings[generate_thumbnails]", $generate_thumbnails, "Some hosts crash during thumbnail generation. Set this to 'No' if you have this issue.");
493
  ?>
494
  <tr>
495
+ <th width="33%" valign="top" scope="row"><?php _e('Image Place Holder Tag:', 'postie') ?> <br />
496
+ <span class='recommendation'>For use in 'plain' messages. The code for inserting an image. I.e. put "#img1# in your email where you want the first image to show. See also "Start Image Count At" </span>
497
+ </th>
498
  <td>
499
  <input name='postie-settings[image_placeholder]' type="text" id='postie-settings-image_placeholder' value="<?php echo esc_attr($image_placeholder); ?>" size="50" /><br />
500
  </td>
824
  name='postie-settings[generaltemplate]'><?php echo esc_attr($generaltemplate) ?></textarea>
825
  </td>
826
  </tr>
827
+ <?php echo BuildBooleanSelect("Use custom image field for attachments", "postie-settings[custom_image_field]", $custom_image_field, "When set to 'Yes' no attachments will appear in the post (including images, video &amp; sound files). Instead the url to the attachment will be put into a custom field named 'image'. Your theme will need logic to display these attachments."); ?>
828
  </table>
829
  </div>
830
  <div id="simpleTabs-content-7" class="simpleTabs-content">
docs/Changes.txt CHANGED
@@ -22,6 +22,12 @@ All script, style and body tags are stripped from html emails.
22
  Attachments are now processed in the order they were attached.
23
 
24
  == CHANGELOG ==
 
 
 
 
 
 
25
  = 1.5.20 (2014.05.29) =
26
  * Added logic to prevent appending images when preferred text type is HTML.
27
  * Improved help text on several options and clarified options.
22
  Attachments are now processed in the order they were attached.
23
 
24
  == CHANGELOG ==
25
+ = 1.5.21 (2014.06.06) =
26
+ * Fixed spelling errors
27
+ * Added more debugging around image sizes
28
+ * Clarified some image options on settings page
29
+ * Removed call to wp_set_post_terms()
30
+
31
  = 1.5.20 (2014.05.29) =
32
  * Added logic to prevent appending images when preferred text type is HTML.
33
  * Improved help text on several options and clarified options.
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.9.1
9
- Stable tag: 1.5.20
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.9.1
9
+ Stable tag: 1.5.21
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
docs/TODO.txt CHANGED
@@ -11,8 +11,35 @@ send email notice when attachments are rejected.
11
  review http://wp.smashingmagazine.com/2011/11/23/improve-wordpress-plugins-readme-txt/
12
  more info in postie.txt
13
  configurable message for "post confirmation" - variable substitution
14
- hook for post failure, success, media attachment
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  collect and send last debug log and system info (see http://wordpress.org/plugins/send-system-info/)
 
16
 
17
  =========
18
  AddOn Ideas
11
  review http://wp.smashingmagazine.com/2011/11/23/improve-wordpress-plugins-readme-txt/
12
  more info in postie.txt
13
  configurable message for "post confirmation" - variable substitution
14
+ add hook for post meta data change
15
+ post type
16
+ post format
17
+ category
18
+ date
19
+ comment control
20
+ excerpt
21
+ tags
22
+ author
23
+ add hooks for content changes
24
+ attachment template
25
+ subject/title
26
+ post begin
27
+ post end
28
+ signature strip
29
+ hook for actions
30
+ post failure
31
+ post success
32
+ media attachment
33
+ non-permitted attachment types
34
+ email rejected
35
+ email connection failure
36
+ start check
37
+ end check
38
+ mail read
39
+ mail delete
40
+ content part
41
  collect and send last debug log and system info (see http://wordpress.org/plugins/send-system-info/)
42
+ Support EXIF orientation via PHP Exif Library https://github.com/lsolesen/pel
43
 
44
  =========
45
  AddOn Ideas
docs/Usage.txt CHANGED
@@ -38,7 +38,7 @@
38
  #eimg2# etc.
39
 
40
  = Post type/format =
41
- You can specify the post type or format by including it as the first part of the subject.
42
  E.g. aside//real subject
43
 
44
  = Categories =
38
  #eimg2# etc.
39
 
40
  = Post type/format =
41
+ You can specify the post type or format by including it as the first part of the subject followed by 2 forward slashes (//).
42
  E.g. aside//real subject
43
 
44
  = Categories =
postie-functions.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  /*
4
- $Id: postie-functions.php 923356 2014-05-29 22:23:55Z WayneAllen $
5
  */
6
 
7
  //to turn on debug output add the following line to wp-config.php
@@ -902,7 +902,7 @@ function PostToDB($details, $isReply, $customImageField, $postmodifiers) {
902
  wp_delete_post($details['ID']);
903
  }
904
  //evidently post_category was depricated at some point.
905
- wp_set_post_terms($post_ID, $details['post_category']);
906
  } else {
907
  $comment = array(
908
  'comment_author' => $details['comment_author'],
@@ -1863,7 +1863,7 @@ function postie_media_handle_upload($part, $post_id, $poster, $generate_thubnail
1863
  DebugEcho("before wp_insert_attachment");
1864
  $id = wp_insert_attachment($attachment, $file, $post_id);
1865
  DebugEcho("after wp_insert_attachment: attachement id: $id");
1866
-
1867
  if (!is_wp_error($id)) {
1868
  if ($generate_thubnails) {
1869
  $amd = wp_generate_attachment_metadata($id, $file);
@@ -1964,7 +1964,7 @@ function postie_handle_upload(&$file, $overrides = false, $time = null) {
1964
  // Set correct file permissions
1965
  $stat = stat(dirname($new_file));
1966
  $perms = $stat['mode'] & 0000666;
1967
- @chmod($new_file, $perms);
1968
  DebugEcho("upload: permissions changed");
1969
 
1970
  // Compute the URL
@@ -2274,11 +2274,22 @@ function parseTemplate($id, $type, $template, $orig_filename, $icon = "") {
2274
  $hwstrings = array();
2275
  $widths = array();
2276
  $heights = array();
 
 
 
 
2277
  for ($i = 0; $i < count($sizes); $i++) {
2278
  list( $img_src[$i], $widths[$i], $heights[$i] ) = image_downsize($id, $sizes[$i]);
2279
  $hwstrings[$i] = image_hwstring($widths[$i], $heights[$i]);
2280
  }
 
 
 
 
 
 
2281
  }
 
2282
  $attachment = get_post($id);
2283
  $the_parent = get_post($attachment->post_parent);
2284
  $uploadDir = wp_upload_dir();
@@ -2383,6 +2394,8 @@ function filter_ReplaceImagePlaceHolders(&$content, $attachments, $config, $post
2383
  $content = "$imageTemplate\n" . $content;
2384
  DebugEcho("Auto gallery: prepend");
2385
  }
 
 
2386
  return;
2387
  } else {
2388
  DebugEcho("Auto gallery: none");
@@ -3264,4 +3277,12 @@ function filter_VodafoneHandler(&$content, &$attachments, $config) {
3264
  }
3265
  }
3266
 
3267
- ?>
 
 
 
 
 
 
 
 
1
  <?php
2
 
3
  /*
4
+ $Id: postie-functions.php 927963 2014-06-06 20:30:47Z WayneAllen $
5
  */
6
 
7
  //to turn on debug output add the following line to wp-config.php
902
  wp_delete_post($details['ID']);
903
  }
904
  //evidently post_category was depricated at some point.
905
+ //wp_set_post_terms($post_ID, $details['post_category']);
906
  } else {
907
  $comment = array(
908
  'comment_author' => $details['comment_author'],
1863
  DebugEcho("before wp_insert_attachment");
1864
  $id = wp_insert_attachment($attachment, $file, $post_id);
1865
  DebugEcho("after wp_insert_attachment: attachement id: $id");
1866
+
1867
  if (!is_wp_error($id)) {
1868
  if ($generate_thubnails) {
1869
  $amd = wp_generate_attachment_metadata($id, $file);
1964
  // Set correct file permissions
1965
  $stat = stat(dirname($new_file));
1966
  $perms = $stat['mode'] & 0000666;
1967
+ chmod($new_file, $perms);
1968
  DebugEcho("upload: permissions changed");
1969
 
1970
  // Compute the URL
2274
  $hwstrings = array();
2275
  $widths = array();
2276
  $heights = array();
2277
+ $img_src = array();
2278
+
2279
+ DebugFiltersFor('image_downsize'); //possible overrides for image_downsize()
2280
+
2281
  for ($i = 0; $i < count($sizes); $i++) {
2282
  list( $img_src[$i], $widths[$i], $heights[$i] ) = image_downsize($id, $sizes[$i]);
2283
  $hwstrings[$i] = image_hwstring($widths[$i], $heights[$i]);
2284
  }
2285
+ DebugEcho('Sources');
2286
+ DebugDump($img_src);
2287
+ DebugEcho('Heights');
2288
+ DebugDump($heights);
2289
+ DebugEcho('Widths');
2290
+ DebugDump($widths);
2291
  }
2292
+
2293
  $attachment = get_post($id);
2294
  $the_parent = get_post($attachment->post_parent);
2295
  $uploadDir = wp_upload_dir();
2394
  $content = "$imageTemplate\n" . $content;
2395
  DebugEcho("Auto gallery: prepend");
2396
  }
2397
+ DebugFiltersFor('post_gallery'); //list gallery handler
2398
+
2399
  return;
2400
  } else {
2401
  DebugEcho("Auto gallery: none");
3277
  }
3278
  }
3279
 
3280
+ function DebugFiltersFor($hook = '') {
3281
+ global $wp_filter;
3282
+ if (empty($hook) || !isset($wp_filter[$hook])) {
3283
+ DebugEcho("No registered filters for $hook");
3284
+ return;
3285
+ }
3286
+ DebugEcho("Registered filters for $hook");
3287
+ DebugDump($wp_filter[$hook]);
3288
+ }
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.5.20
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
@@ -27,10 +27,10 @@
27
  */
28
 
29
  /*
30
- $Id: postie.php 923356 2014-05-29 22:23:55Z WayneAllen $
31
  */
32
 
33
- define('POSTIE_VERSION', '1.5.20');
34
  define("POSTIE_ROOT", dirname(__FILE__));
35
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
36
 
@@ -281,5 +281,3 @@ function postie_more_reccurences($schedules) {
281
 
282
  return $schedules;
283
  }
284
-
285
- ?>
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.5.21
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
27
  */
28
 
29
  /*
30
+ $Id: postie.php 927963 2014-06-06 20:30:47Z WayneAllen $
31
  */
32
 
33
+ define('POSTIE_VERSION', '1.5.21');
34
  define("POSTIE_ROOT", dirname(__FILE__));
35
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
36
 
281
 
282
  return $schedules;
283
  }
 
 
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.9.1
9
- Stable tag: 1.5.20
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -119,7 +119,7 @@ Then use the Task Scheduler control panel to call wget or cron.
119
  #eimg2# etc.
120
 
121
  = Post type/format =
122
- You can specify the post type or format by including it as the first part of the subject.
123
  E.g. aside//real subject
124
 
125
  = Categories =
@@ -444,6 +444,12 @@ All script, style and body tags are stripped from html emails.
444
  Attachments are now processed in the order they were attached.
445
 
446
  == CHANGELOG ==
 
 
 
 
 
 
447
  = 1.5.20 (2014.05.29) =
448
  * Added logic to prevent appending images when preferred text type is HTML.
449
  * Improved help text on several options and clarified options.
6
  Tags: e-mail, email
7
  Requires at least: 3.0
8
  Tested up to: 3.9.1
9
+ Stable tag: 1.5.21
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
119
  #eimg2# etc.
120
 
121
  = Post type/format =
122
+ You can specify the post type or format by including it as the first part of the subject followed by 2 forward slashes (//).
123
  E.g. aside//real subject
124
 
125
  = Categories =
444
  Attachments are now processed in the order they were attached.
445
 
446
  == CHANGELOG ==
447
+ = 1.5.21 (2014.06.06) =
448
+ * Fixed spelling errors
449
+ * Added more debugging around image sizes
450
+ * Clarified some image options on settings page
451
+ * Removed call to wp_set_post_terms()
452
+
453
  = 1.5.20 (2014.05.29) =
454
  * Added logic to prevent appending images when preferred text type is HTML.
455
  * Improved help text on several options and clarified options.