Postie - Version 1.7.25

Version Description

(2015-12-15) = * Fix settings page for new category matching flavors

Download this release

Release Info

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

Code changes from version 1.7.23 to 1.7.25

config_form_message.php CHANGED
@@ -20,6 +20,32 @@
20
  </tr>
21
  <?php echo BuildBooleanSelect(__("Match short category", 'postie'), "postie-settings[category_match]", $category_match, __("Try to match categories using 'starts with logic' otherwise only do exact matches.<br />Note that custom taxonomies will not be found if this setting is 'No'", 'postie')); ?>
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  <tr valign="top">
24
  <th scope="row">
25
  <?php _e('Default tag(s)', 'postie') ?><br />
20
  </tr>
21
  <?php echo BuildBooleanSelect(__("Match short category", 'postie'), "postie-settings[category_match]", $category_match, __("Try to match categories using 'starts with logic' otherwise only do exact matches.<br />Note that custom taxonomies will not be found if this setting is 'No'", 'postie')); ?>
22
 
23
+ <tr>
24
+ <th scope="row">
25
+ <?php _e('Category matching', 'postie') ?><br />
26
+ </th>
27
+ <td>
28
+ <table class="checkbox-table">
29
+ <tr>
30
+ <td>
31
+ <input type='checkbox' value='1' name='postie-settings[category_colon]' <?php echo ($category_colon ? ' checked' :'') ?>/>Use colon to match category
32
+ </td>
33
+ </tr>
34
+ <tr>
35
+ <td>
36
+ <input type='checkbox' value='1' name='postie-settings[category_dash]' <?php echo ($category_dash ? ' checked' :'') ?>/>Use dash to match category
37
+ </td>
38
+ </tr>
39
+ <tr>
40
+ <td>
41
+ <input type='checkbox' value='1' name='postie-settings[category_bracket]' <?php echo ($category_bracket ? ' checked' :'') ?>/>Use square bracket to match category
42
+ </td>
43
+ </tr>
44
+ </table>
45
+ <p class='description'><?php _e('See the following article for more information <a href="http://postieplugin.com/faq/override-post-categories/" target="_blank">http://postieplugin.com/faq/override-post-categories/</a>', 'postie') ?></p>
46
+ </td>
47
+ </tr>
48
+
49
  <tr valign="top">
50
  <th scope="row">
51
  <?php _e('Default tag(s)', 'postie') ?><br />
config_form_video.php CHANGED
@@ -1,7 +1,7 @@
1
  <div id="simpleTabs-content-5" class="simpleTabs-content">
2
  <table class='form-table'>
3
  <?php
4
- echo BuildBooleanSelect(__("Use shortcode for embedding video (youtube or vimeo)", 'postie'), "postie-settings[shortcode]", $shortcode, "Only change this value to 'Yes' if you have another plugin that will process the shortcode.");
5
  ?>
6
  <tr>
7
  <th scope='row'><?php _e('Video template 1', 'postie') ?></th>
1
  <div id="simpleTabs-content-5" class="simpleTabs-content">
2
  <table class='form-table'>
3
  <?php
4
+ //echo BuildBooleanSelect(__("Use shortcode for embedding video (youtube or vimeo)", 'postie'), "postie-settings[shortcode]", $shortcode, "Only change this value to 'Yes' if you have another plugin that will process the shortcode.");
5
  ?>
6
  <tr>
7
  <th scope='row'><?php _e('Video template 1', 'postie') ?></th>
docs/Changes.txt CHANGED
@@ -27,6 +27,13 @@ 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.7.23 (2015-12-09) =
31
  * Fix bug where emails inside shortcodes were being linkified
32
  * Lookup categories by slug as well as by name
27
  Attachments are now processed in the order they were attached.
28
 
29
  == CHANGELOG ==
30
+ = 1.7.25 (2015-12-15) =
31
+ * Fix settings page for new category matching flavors
32
+
33
+ = 1.7.24 (2015-12-15) =
34
+ * Don't process youtube and vimeo links specially.
35
+ * New setting to turn off category matching flavors
36
+
37
  = 1.7.23 (2015-12-09) =
38
  * Fix bug where emails inside shortcodes were being linkified
39
  * Lookup categories by slug as well as by name
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.4
9
- Stable tag: 1.7.23
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.4
9
+ Stable tag: 1.7.25
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
docs/TODO.txt CHANGED
@@ -5,7 +5,6 @@ Change successful post message to take post status into account (i.e. draft real
5
  Verify that WP is honoring the wp_set_current_user() call. I.e. if the user is not an "author" role can they publish?
6
  Test server port combination by opening a socket connection to see if any service responds. (via ajax call)
7
  Option to not process forwarded emails (getPostAuthorDetails)
8
- Separate out video linkifying from normal url linkifying - separate settings
9
  Add Message-ID header value to custom field (postie_message_id?) to both posts and comments.
10
  Use In-Reply-To header value as a better way to detect replies
11
  Verify that {TITLE} is doing the right thing.
@@ -13,13 +12,11 @@ Automatic updates for AddOns:
13
  https://github.com/seedprod/sellwp-updater
14
  http://code.tutsplus.com/series/create-a-license-controlled-theme-and-plugin-update-system--cms-760
15
  automatically create category if it doesn't exist. new option to allow this feature?
16
- Add setting for category detection. I.e. checkboxes for [], -- and : styles. Default to all on.
17
  Add setting to not remove category text from subject/title
18
  Comment not being created when subject contains category command []. I.e. listserv subject lines
19
  date: tag is being detected in body when not wanted
20
  Update tag_* and filter_* to handle HTML (per tag_Tags)
21
  dynamically determine video size (height/width) - https://code.google.com/p/phpvideotoolkit/
22
- new video template with <video> tag
23
  gallery logic does not handle both images and non-images
24
  plugin conflict - Image Rotation Fixer/Image Rotation Repair
25
  send email notice when attachments are rejected.
@@ -51,7 +48,7 @@ hook for actions
51
  post failure
52
  post success
53
  media attachment
54
- non-permitted attachment types
55
  email rejected
56
  email connection failure
57
  mail read
5
  Verify that WP is honoring the wp_set_current_user() call. I.e. if the user is not an "author" role can they publish?
6
  Test server port combination by opening a socket connection to see if any service responds. (via ajax call)
7
  Option to not process forwarded emails (getPostAuthorDetails)
 
8
  Add Message-ID header value to custom field (postie_message_id?) to both posts and comments.
9
  Use In-Reply-To header value as a better way to detect replies
10
  Verify that {TITLE} is doing the right thing.
12
  https://github.com/seedprod/sellwp-updater
13
  http://code.tutsplus.com/series/create-a-license-controlled-theme-and-plugin-update-system--cms-760
14
  automatically create category if it doesn't exist. new option to allow this feature?
 
15
  Add setting to not remove category text from subject/title
16
  Comment not being created when subject contains category command []. I.e. listserv subject lines
17
  date: tag is being detected in body when not wanted
18
  Update tag_* and filter_* to handle HTML (per tag_Tags)
19
  dynamically determine video size (height/width) - https://code.google.com/p/phpvideotoolkit/
 
20
  gallery logic does not handle both images and non-images
21
  plugin conflict - Image Rotation Fixer/Image Rotation Repair
22
  send email notice when attachments are rejected.
48
  post failure
49
  post success
50
  media attachment
51
+ unpermitted attachment types
52
  email rejected
53
  email connection failure
54
  mail read
postie-functions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- $Id: postie-functions.php 1304718 2015-12-09 21:40:56Z WayneAllen $
4
  */
5
 
6
  class PostiePostModifiers {
@@ -276,7 +276,7 @@ function CreatePost($poster, $mimeDecodedEmail, $post_id, &$is_reply, $config, $
276
  DebugEcho("pre category: $default_categoryid");
277
  $default_categoryid = apply_filters('postie_category_default', $default_categoryid);
278
  DebugEcho("post postie_category_default $default_categoryid");
279
- $post_categories = tag_Categories($subject, $default_categoryid, $config['category_match'], $post_id);
280
  if ($fulldebug) {
281
  DebugEcho("post category: $content");
282
  }
@@ -551,6 +551,8 @@ function LoadDOM($text) {
551
  }
552
 
553
  function filter_Videos($text, $shortcode = false) {
 
 
554
  $ret = ' ' . $text;
555
  if (strpos($ret, 'youtube') !== false) {
556
  // try to embed youtube videos
@@ -2663,36 +2665,41 @@ function tag_Excerpt(&$content, $config) {
2663
  * This function determines the categories ids for the post
2664
  * @return array
2665
  */
2666
- function tag_Categories(&$subject, $defaultCategoryId, $category_match, $post_id) {
 
2667
  $original_subject = $subject;
2668
  $found = false;
2669
  $post_categories = array();
2670
  $matchtypes = array();
2671
  $matches = array();
2672
 
2673
- if (preg_match_all('/\[(.[^\[]*)\]/', $subject, $matches)) { // [<category1>] [<category2>] <Subject>
2674
- //preg_match("/]([^\[]*)$/", $subject, $subject_matches);
2675
- //$subject = trim($subject_matches[1]);
2676
- $matchtypes[] = $matches;
2677
  }
2678
- if (preg_match_all('/-(.[^-]*)-/', $subject, $matches)) { // -<category>- -<category2>- <Subject>
2679
- //preg_match("/-(.[^-]*)$/", $subject, $subject_matches);
2680
- //$subject = trim($subject_matches[1]);
2681
- $matchtypes[] = $matches;
 
2682
  }
2683
- if (preg_match('/(.+): (.*)/', $subject, $matches)) { // <category>:<Subject>
2684
- $category = lookup_category($matches[1], $category_match);
2685
- if (!empty($category)) {
2686
- $found = true;
2687
- DebugEcho("colon category: $category");
2688
- $subject = trim($matches[2]);
2689
- DebugEcho("colon category: subject: $subject");
2690
- $tax = lookup_taxonomy($category);
2691
- if ('category' == $tax) {
2692
- $post_categories[] = $category;
2693
- } else {
2694
- DebugEcho("colon category: custom taxonomy $tax");
2695
- wp_set_object_terms($post_id, $category, $tax, true);
 
 
 
2696
  }
2697
  }
2698
  }
@@ -2993,7 +3000,10 @@ function config_GetDefaults() {
2993
  'ignore_mail_state' => false,
2994
  'strip_reply' => true,
2995
  'postie_log_error' => true,
2996
- 'postie_log_debug' => false
 
 
 
2997
  );
2998
  }
2999
 
1
  <?php
2
  /*
3
+ $Id: postie-functions.php 1309274 2015-12-15 17:33:07Z WayneAllen $
4
  */
5
 
6
  class PostiePostModifiers {
276
  DebugEcho("pre category: $default_categoryid");
277
  $default_categoryid = apply_filters('postie_category_default', $default_categoryid);
278
  DebugEcho("post postie_category_default $default_categoryid");
279
+ $post_categories = tag_Categories($subject, $default_categoryid, $config, $post_id);
280
  if ($fulldebug) {
281
  DebugEcho("post category: $content");
282
  }
551
  }
552
 
553
  function filter_Videos($text, $shortcode = false) {
554
+ return $text;
555
+
556
  $ret = ' ' . $text;
557
  if (strpos($ret, 'youtube') !== false) {
558
  // try to embed youtube videos
2665
  * This function determines the categories ids for the post
2666
  * @return array
2667
  */
2668
+ function tag_Categories(&$subject, $defaultCategoryId, $config, $post_id) {
2669
+ $category_match = $config['category_match'];
2670
  $original_subject = $subject;
2671
  $found = false;
2672
  $post_categories = array();
2673
  $matchtypes = array();
2674
  $matches = array();
2675
 
2676
+ if ($config['category_bracket']) {
2677
+ if (preg_match_all('/\[(.[^\[]*)\]/', $subject, $matches)) { // [<category1>] [<category2>] <Subject>
2678
+ $matchtypes[] = $matches;
2679
+ }
2680
  }
2681
+
2682
+ if ($config['category_dash']) {
2683
+ if (preg_match_all('/-(.[^-]*)-/', $subject, $matches)) { // -<category>- -<category2>- <Subject>
2684
+ $matchtypes[] = $matches;
2685
+ }
2686
  }
2687
+
2688
+ if ($config['category_colon']) {
2689
+ if (preg_match('/(.+): (.*)/', $subject, $matches)) { // <category>:<Subject>
2690
+ $category = lookup_category($matches[1], $category_match);
2691
+ if (!empty($category)) {
2692
+ $found = true;
2693
+ DebugEcho("colon category: $category");
2694
+ $subject = trim($matches[2]);
2695
+ DebugEcho("colon category: subject: $subject");
2696
+ $tax = lookup_taxonomy($category);
2697
+ if ('category' == $tax) {
2698
+ $post_categories[] = $category;
2699
+ } else {
2700
+ DebugEcho("colon category: custom taxonomy $tax");
2701
+ wp_set_object_terms($post_id, $category, $tax, true);
2702
+ }
2703
  }
2704
  }
2705
  }
3000
  'ignore_mail_state' => false,
3001
  'strip_reply' => true,
3002
  'postie_log_error' => true,
3003
+ 'postie_log_debug' => false,
3004
+ 'category_colon' => true,
3005
+ 'category_dash' => true,
3006
+ 'category_bracket' => true
3007
  );
3008
  }
3009
 
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.7.23
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
@@ -28,12 +28,12 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 1304718 2015-12-09 21:40:56Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib_autolink.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
35
 
36
- define('POSTIE_VERSION', '1.7.23');
37
  define("POSTIE_ROOT", dirname(__FILE__));
38
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
39
 
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.7.25
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
28
  */
29
 
30
  /*
31
+ $Id: postie.php 1309308 2015-12-15 18:34:13Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib_autolink.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
35
 
36
+ define('POSTIE_VERSION', '1.7.25');
37
  define("POSTIE_ROOT", dirname(__FILE__));
38
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
39
 
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.4
9
- Stable tag: 1.7.23
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -235,6 +235,13 @@ All script, style and body tags are stripped from html emails.
235
  Attachments are now processed in the order they were attached.
236
 
237
  == CHANGELOG ==
 
 
 
 
 
 
 
238
  = 1.7.23 (2015-12-09) =
239
  * Fix bug where emails inside shortcodes were being linkified
240
  * Lookup categories by slug as well as by name
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.4
9
+ Stable tag: 1.7.25
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
235
  Attachments are now processed in the order they were attached.
236
 
237
  == CHANGELOG ==
238
+ = 1.7.25 (2015-12-15) =
239
+ * Fix settings page for new category matching flavors
240
+
241
+ = 1.7.24 (2015-12-15) =
242
+ * Don't process youtube and vimeo links specially.
243
+ * New setting to turn off category matching flavors
244
+
245
  = 1.7.23 (2015-12-09) =
246
  * Fix bug where emails inside shortcodes were being linkified
247
  * Lookup categories by slug as well as by name