FeedWordPress - Version 2017.1004

Version Description

Download this release

Release Info

Developer radgeek
Plugin Icon wp plugin FeedWordPress
Version 2017.1004
Comparing to
See all releases

Code changes from version 2017.0913 to 2017.1004

feedwordpress.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: FeedWordPress
4
  Plugin URI: http://feedwordpress.radgeek.com/
5
  Description: simple and flexible Atom/RSS syndication for WordPress
6
- Version: 2017.0913
7
  Author: Charles Johnson
8
  Author URI: http://radgeek.com/
9
  License: GPL
@@ -11,7 +11,7 @@ License: GPL
11
 
12
  /**
13
  * @package FeedWordPress
14
- * @version 2017.0913
15
  */
16
 
17
  # This uses code derived from:
@@ -32,7 +32,7 @@ License: GPL
32
 
33
  # -- Don't change these unless you know what you're doing...
34
 
35
- define ('FEEDWORDPRESS_VERSION', '2017.0913');
36
  define ('FEEDWORDPRESS_AUTHOR_CONTACT', 'http://radgeek.com/contact');
37
 
38
  if (!defined('FEEDWORDPRESS_BLEG')) :
@@ -634,7 +634,7 @@ function syndication_comments_feed_link ($link) {
634
  $source = get_syndication_feed_object();
635
  $replacement = NULL;
636
 
637
- if ($source->setting('munge comments feed links', 'munge_comments_feed_links', 'yes') != 'no') :
638
  $commentFeeds = get_post_custom_values('wfw:commentRSS');
639
  if (
640
  is_array($commentFeeds)
3
  Plugin Name: FeedWordPress
4
  Plugin URI: http://feedwordpress.radgeek.com/
5
  Description: simple and flexible Atom/RSS syndication for WordPress
6
+ Version: 2017.1004
7
  Author: Charles Johnson
8
  Author URI: http://radgeek.com/
9
  License: GPL
11
 
12
  /**
13
  * @package FeedWordPress
14
+ * @version 2017.1004
15
  */
16
 
17
  # This uses code derived from:
32
 
33
  # -- Don't change these unless you know what you're doing...
34
 
35
+ define ('FEEDWORDPRESS_VERSION', '2017.1004');
36
  define ('FEEDWORDPRESS_AUTHOR_CONTACT', 'http://radgeek.com/contact');
37
 
38
  if (!defined('FEEDWORDPRESS_BLEG')) :
634
  $source = get_syndication_feed_object();
635
  $replacement = NULL;
636
 
637
+ if (is_object($source) && $source->setting('munge comments feed links', 'munge_comments_feed_links', 'yes') != 'no') :
638
  $commentFeeds = get_post_custom_values('wfw:commentRSS');
639
  if (
640
  is_array($commentFeeds)
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Charles Johnson
3
  Donate link: http://feedwordpress.radgeek.com/
4
  Tags: syndication, aggregation, feed, atom, rss
5
  Requires at least: 4.5
6
- Tested up to: 4.8.1
7
- Stable tag: 2017.0913
8
 
9
  FeedWordPress syndicates content from feeds you choose into your WordPress weblog.
10
 
3
  Donate link: http://feedwordpress.radgeek.com/
4
  Tags: syndication, aggregation, feed, atom, rss
5
  Requires at least: 4.5
6
+ Tested up to: 4.8.2
7
+ Stable tag: 2017.1004
8
 
9
  FeedWordPress syndicates content from feeds you choose into your WordPress weblog.
10
 
syndicatedpost.class.php CHANGED
@@ -12,7 +12,7 @@ require_once(dirname(__FILE__).'/syndicatedpostxpathquery.class.php');
12
  * different feed formats, which may be useful to FeedWordPress users
13
  * who make use of feed data in PHP add-ons and filters.
14
  *
15
- * @version 2013.0525
16
  */
17
  class SyndicatedPost {
18
  var $item = null; // MagpieRSS representation
@@ -129,6 +129,7 @@ class SyndicatedPost {
129
  );
130
 
131
  $excerpt = apply_filters('syndicated_item_excerpt', $this->excerpt(), $this);
 
132
  if (!empty($excerpt)):
133
  $this->post['post_excerpt'] = $excerpt;
134
  endif;
@@ -258,7 +259,6 @@ class SyndicatedPost {
258
 
259
  $this->post['post_type'] = apply_filters('syndicated_post_type', $this->link->setting('syndicated post type', 'syndicated_post_type', 'post'), $this);
260
  endif;
261
-
262
  } /* SyndicatedPost::__construct() */
263
 
264
  #####################################
@@ -413,18 +413,23 @@ class SyndicatedPost {
413
  $content = $this->content();
414
 
415
  // Ignore whitespace, case, and tag cruft.
416
- $theExcerpt = preg_replace('/\s+/', '', strtolower(strip_tags($excerpt)));
417
- $theContent = preg_replace('/\s+/', '', strtolower(strip_tags($content)));
418
-
419
  if ( empty($excerpt) or $theExcerpt == $theContent ) :
420
  # If content is available, generate an excerpt.
421
  if ( strlen(trim($content)) > 0 ) :
422
  $excerpt = strip_tags($content);
423
  if (strlen($excerpt) > 255) :
424
- $excerpt = substr($excerpt,0,252).'...';
 
 
 
 
 
425
  endif;
426
  endif;
427
  endif;
 
428
  return $excerpt;
429
  } /* SyndicatedPost::excerpt() */
430
 
@@ -1449,7 +1454,7 @@ class SyndicatedPost {
1449
  return $this->_wp_id;
1450
  }
1451
 
1452
- function store () {
1453
  global $wpdb;
1454
 
1455
  if ($this->filtered()) : // This should never happen.
@@ -1711,6 +1716,7 @@ class SyndicatedPost {
1711
 
1712
  // Go ahead and insert the first post record to
1713
  // anchor the revision history.
 
1714
  $this->_wp_id = wp_insert_post($sdbpost, /*return wp_error=*/ true);
1715
 
1716
  $dbpost['ID'] = $this->_wp_id;
12
  * different feed formats, which may be useful to FeedWordPress users
13
  * who make use of feed data in PHP add-ons and filters.
14
  *
15
+ * @version 2017.1004
16
  */
17
  class SyndicatedPost {
18
  var $item = null; // MagpieRSS representation
129
  );
130
 
131
  $excerpt = apply_filters('syndicated_item_excerpt', $this->excerpt(), $this);
132
+
133
  if (!empty($excerpt)):
134
  $this->post['post_excerpt'] = $excerpt;
135
  endif;
259
 
260
  $this->post['post_type'] = apply_filters('syndicated_post_type', $this->link->setting('syndicated post type', 'syndicated_post_type', 'post'), $this);
261
  endif;
 
262
  } /* SyndicatedPost::__construct() */
263
 
264
  #####################################
413
  $content = $this->content();
414
 
415
  // Ignore whitespace, case, and tag cruft.
416
+ $theExcerpt = preg_replace('/\s+/', '', strtolower(strip_tags(html_entity_decode($excerpt))));
417
+ $theContent = preg_replace('/\s+/', '', strtolower(strip_tags(html_entity_decode($content))));
 
418
  if ( empty($excerpt) or $theExcerpt == $theContent ) :
419
  # If content is available, generate an excerpt.
420
  if ( strlen(trim($content)) > 0 ) :
421
  $excerpt = strip_tags($content);
422
  if (strlen($excerpt) > 255) :
423
+ if (is_object($this->link) and is_object($this->link->simplepie)) :
424
+ $encoding = $this->link->simplepie->get_encoding();
425
+ else :
426
+ $encoding = get_option('blog_charset', 'utf8');
427
+ endif;
428
+ $excerpt = mb_substr($excerpt,0,252,$encoding).'...';
429
  endif;
430
  endif;
431
  endif;
432
+
433
  return $excerpt;
434
  } /* SyndicatedPost::excerpt() */
435
 
1454
  return $this->_wp_id;
1455
  }
1456
 
1457
+ public function store () {
1458
  global $wpdb;
1459
 
1460
  if ($this->filtered()) : // This should never happen.
1716
 
1717
  // Go ahead and insert the first post record to
1718
  // anchor the revision history.
1719
+
1720
  $this->_wp_id = wp_insert_post($sdbpost, /*return wp_error=*/ true);
1721
 
1722
  $dbpost['ID'] = $this->_wp_id;
syndicationdataqueries.class.php CHANGED
@@ -15,7 +15,7 @@ class SyndicationDataQueries {
15
  $wp->add_query_var('guid');
16
  }
17
 
18
- function parse_query (&$q) {
19
  if ($q->get('guid')) :
20
  $q->is_single = false; // Causes nasty side-effects.
21
  $q->is_singular = true; // Doesn't?
@@ -27,18 +27,18 @@ class SyndicationDataQueries {
27
  endif;
28
  } /* SyndicationDataQueries::parse_query () */
29
 
30
- function pre_get_posts (&$q) {
31
  //
32
  }
33
 
34
- function posts_request ($sql, &$query) {
35
  if ($query->get('fields') == '_synfresh') :
36
  FeedWordPress::diagnostic('feed_items:freshness:sql', "SQL: ".$sql);
37
  endif;
38
  return $sql;
39
  }
40
 
41
- function posts_search ($search, &$query) {
42
  global $wpdb;
43
  if ($guid = $query->get('guid')) :
44
  if (strlen(trim($guid)) > 0) :
@@ -77,7 +77,7 @@ class SyndicationDataQueries {
77
  return $search;
78
  } /* SyndicationDataQueries::posts_search () */
79
 
80
- function posts_where ($where, &$q) {
81
  global $wpdb;
82
 
83
  // Ugly hack to ensure we ONLY check by guid in syndicated freshness
@@ -94,7 +94,7 @@ class SyndicationDataQueries {
94
  return $where;
95
  } /* SyndicationDataQueries::post_where () */
96
 
97
- function posts_fields ($fields, &$query) {
98
  global $wpdb;
99
  if ($f = $query->get('fields')) :
100
  switch ($f) :
15
  $wp->add_query_var('guid');
16
  }
17
 
18
+ function parse_query ($q) {
19
  if ($q->get('guid')) :
20
  $q->is_single = false; // Causes nasty side-effects.
21
  $q->is_singular = true; // Doesn't?
27
  endif;
28
  } /* SyndicationDataQueries::parse_query () */
29
 
30
+ function pre_get_posts ($q) {
31
  //
32
  }
33
 
34
+ function posts_request ($sql, $query) {
35
  if ($query->get('fields') == '_synfresh') :
36
  FeedWordPress::diagnostic('feed_items:freshness:sql', "SQL: ".$sql);
37
  endif;
38
  return $sql;
39
  }
40
 
41
+ function posts_search ($search, $query) {
42
  global $wpdb;
43
  if ($guid = $query->get('guid')) :
44
  if (strlen(trim($guid)) > 0) :
77
  return $search;
78
  } /* SyndicationDataQueries::posts_search () */
79
 
80
+ function posts_where ($where, $q) {
81
  global $wpdb;
82
 
83
  // Ugly hack to ensure we ONLY check by guid in syndicated freshness
94
  return $where;
95
  } /* SyndicationDataQueries::post_where () */
96
 
97
+ function posts_fields ($fields, $query) {
98
  global $wpdb;
99
  if ($f = $query->get('fields')) :
100
  switch ($f) :