Postie - Version 1.6.16

Version Description

(2015-03-17) = * If using the #img# feature and you supply a caption it will be added to the attachment's alt text.

Download this release

Release Info

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

Code changes from version 1.6.15 to 1.6.16

Files changed (6) hide show
  1. docs/Changes.txt +3 -0
  2. docs/Postie.txt +1 -1
  3. docs/TODO.txt +20 -0
  4. postie-functions.php +14 -2
  5. postie.php +3 -3
  6. readme.txt +4 -1
docs/Changes.txt CHANGED
@@ -27,6 +27,9 @@ All script, style and body tags are stripped from html emails.
27
  Attachments are now processed in the order they were attached.
28
 
29
  == CHANGELOG ==
 
 
 
30
  = 1.6.15 (2015-03-04) =
31
  * Remove "Wrap content in pre tags" option as it was defaulted to "yes" but never correctly applied.
32
  * Allow time correction values of 0.5
27
  Attachments are now processed in the order they were attached.
28
 
29
  == CHANGELOG ==
30
+ = 1.6.16 (2015-03-17) =
31
+ * If using the #img# feature and you supply a caption it will be added to the attachment's alt text.
32
+
33
  = 1.6.15 (2015-03-04) =
34
  * Remove "Wrap content in pre tags" option as it was defaulted to "yes" but never correctly applied.
35
  * Allow time correction values of 0.5
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.0
8
  Tested up to: 4.1.1
9
- Stable tag: 1.6.15
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.0
8
  Tested up to: 4.1.1
9
+ Stable tag: 1.6.16
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
docs/TODO.txt CHANGED
@@ -1,3 +1,5 @@
 
 
1
  Separate out video linkifying from normal url linkifying - separate settings
2
  Add Message-ID header value to custom field (postie_message_id?) to both posts and comments.
3
  Use In-Reply-To header value as a better way to detect replies
@@ -22,6 +24,24 @@ use wordpress plugin template
22
  starter-plugin https://github.com/mattyza/starter-plugin
23
  WordPress-Plugin-Template https://github.com/hlashbrooke/WordPress-Plugin-Template
24
  configurable message for "post confirmation" - variable substitution
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  add hooks for post meta data change
26
  post type
27
  post format
1
+ Verify that WP is honoring the wp_set_current_user() call. I.e. if the user is not an "author" role can they publish?
2
+ Option to not process forwarded emails (getPostAuthorDetails)
3
  Separate out video linkifying from normal url linkifying - separate settings
4
  Add Message-ID header value to custom field (postie_message_id?) to both posts and comments.
5
  Use In-Reply-To header value as a better way to detect replies
24
  starter-plugin https://github.com/mattyza/starter-plugin
25
  WordPress-Plugin-Template https://github.com/hlashbrooke/WordPress-Plugin-Template
26
  configurable message for "post confirmation" - variable substitution
27
+
28
+ Shortcodes
29
+ Note: Postie will need to temporarily save the global $shortcode_tags variable off to the side, register its own
30
+ shortcodes (action for user supplied shortcodes?) process the emails then restore the global $shortcode_tags.
31
+ [postie_status draft | publish | pending | private]
32
+ [postie_date <the date>]
33
+ [postie_delay [0-99d][0-99h][0-99m]]
34
+ [postie_comments 0 | 1 | 2]
35
+ [postie_excerpt]<excerpt>[/postie_excerpt]
36
+ [postie_type <posttype>]
37
+ [postie_format <postformat>]
38
+ [postie_category <comma separated categories>]
39
+ [postie_tag <comma separated tags>]
40
+ [postie_title <title>]
41
+ [postie_image <image #> caption="<optional caption>"]
42
+ [postie_more]
43
+
44
+ Hooks
45
  add hooks for post meta data change
46
  post type
47
  post format
postie-functions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- $Id: postie-functions.php 1105352 2015-03-04 19:24:11Z WayneAllen $
4
  */
5
 
6
  //to turn on debug output add the following line to wp-config.php
@@ -1447,7 +1447,15 @@ function ValidatePoster(&$mimeDecodedEmail, $config) {
1447
  }
1448
  return '';
1449
  }
1450
- wp_set_current_user($poster); //needed by some wp functions who check permissions for the logged in user
 
 
 
 
 
 
 
 
1451
 
1452
  return $poster;
1453
  }
@@ -2470,6 +2478,7 @@ function filter_ReplaceImagePlaceHolders(&$content, $attachments, $config, $post
2470
  'numberposts' => -1,
2471
  'post_mime_type' => 'image',));
2472
  DebugEcho("images in post: " . count($images));
 
2473
 
2474
  if ((count($images) > 0) && $config['auto_gallery']) {
2475
  $imageTemplate = '[gallery]';
@@ -2505,6 +2514,9 @@ function filter_ReplaceImagePlaceHolders(&$content, $attachments, $config, $post
2505
  $caption = substr($caption, 1, strlen($caption) - 2);
2506
  }
2507
  DebugEcho("caption: $caption");
 
 
 
2508
 
2509
  $img_placeholder_temp = substr($matches[0], 0, -1);
2510
  DebugEcho($img_placeholder_temp);
1
  <?php
2
  /*
3
+ $Id: postie-functions.php 1114943 2015-03-18 00:10:27Z WayneAllen $
4
  */
5
 
6
  //to turn on debug output add the following line to wp-config.php
1447
  }
1448
  return '';
1449
  }
1450
+
1451
+ //actually log in as the user
1452
+ $user = get_user_by('id', $poster);
1453
+ if ($user) {
1454
+ DebugEcho("logging in as {$user->user_login}");
1455
+ wp_set_current_user($poster);
1456
+ //wp_set_auth_cookie($poster);
1457
+ do_action('wp_login', $user->user_login);
1458
+ }
1459
 
1460
  return $poster;
1461
  }
2478
  'numberposts' => -1,
2479
  'post_mime_type' => 'image',));
2480
  DebugEcho("images in post: " . count($images));
2481
+ DebugDump($images);
2482
 
2483
  if ((count($images) > 0) && $config['auto_gallery']) {
2484
  $imageTemplate = '[gallery]';
2514
  $caption = substr($caption, 1, strlen($caption) - 2);
2515
  }
2516
  DebugEcho("caption: $caption");
2517
+
2518
+ DebugEcho("Adding alt text to image {$images[$i]->ID}");
2519
+ update_post_meta($images[$i]->ID, '_wp_attachment_image_alt', $caption);
2520
 
2521
  $img_placeholder_temp = substr($matches[0], 0, -1);
2522
  DebugEcho($img_placeholder_temp);
postie.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Signifigantly upgrades the Post by Email features of Word Press.
7
- Version: 1.6.15
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
@@ -27,11 +27,11 @@
27
  */
28
 
29
  /*
30
- $Id: postie.php 1105355 2015-03-04 19:27:05Z WayneAllen $
31
  */
32
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
33
 
34
- define('POSTIE_VERSION', '1.6.15');
35
  define("POSTIE_ROOT", dirname(__FILE__));
36
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
37
 
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Signifigantly upgrades the Post by Email features of Word Press.
7
+ Version: 1.6.16
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
27
  */
28
 
29
  /*
30
+ $Id: postie.php 1114943 2015-03-18 00:10:27Z WayneAllen $
31
  */
32
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
33
 
34
+ define('POSTIE_VERSION', '1.6.16');
35
  define("POSTIE_ROOT", dirname(__FILE__));
36
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
37
 
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.0
8
  Tested up to: 4.1.1
9
- Stable tag: 1.6.15
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -234,6 +234,9 @@ All script, style and body tags are stripped from html emails.
234
  Attachments are now processed in the order they were attached.
235
 
236
  == CHANGELOG ==
 
 
 
237
  = 1.6.15 (2015-03-04) =
238
  * Remove "Wrap content in pre tags" option as it was defaulted to "yes" but never correctly applied.
239
  * Allow time correction values of 0.5
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.0
8
  Tested up to: 4.1.1
9
+ Stable tag: 1.6.16
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
234
  Attachments are now processed in the order they were attached.
235
 
236
  == CHANGELOG ==
237
+ = 1.6.16 (2015-03-17) =
238
+ * If using the #img# feature and you supply a caption it will be added to the attachment's alt text.
239
+
240
  = 1.6.15 (2015-03-04) =
241
  * Remove "Wrap content in pre tags" option as it was defaulted to "yes" but never correctly applied.
242
  * Allow time correction values of 0.5