CommentLuv - Version 2.92.5

Version Description

  • fixed : simplepie library changed to use separate class file for File
  • updated : better error reporting with simplepie for sites with undiscovered feeds
Download this release

Release Info

Developer commentluv
Plugin Icon 128x128 CommentLuv
Version 2.92.5
Comparing to
See all releases

Code changes from version 2.92.4 to 2.92.5

Files changed (2) hide show
  1. commentluv.php +18 -6
  2. readme.txt +6 -1
commentluv.php CHANGED
@@ -2,7 +2,7 @@
2
  Plugin Name: CommentLuv
3
  Plugin URI: http://comluv.com/
4
  Description: Reward your readers by automatically placing a link to their last blog post at the end of their comment. Encourage a community and discover new posts.
5
- Version: 2.92.4
6
  Author: Andy Bailey
7
  Author URI: http://www.commentluv.com
8
  Copyright (C) <2011> <Andy Bailey>
@@ -28,7 +28,7 @@
28
  var $plugin_url;
29
  var $plugin_dir;
30
  var $db_option = 'commentluv_options';
31
- var $version = "2.92.4";
32
  var $slug = 'commentluv-options';
33
  var $localize;
34
  var $is_commentluv_request = false;
@@ -804,6 +804,7 @@
804
  */
805
  function fetch_feed(){
806
  // check nonce
 
807
  $checknonce = check_ajax_referer('fetch',false,false);
808
  if(!$checknonce){
809
  die(' error! not authorized '.strip_tags($_REQUEST['_ajax_nonce']));
@@ -820,7 +821,8 @@
820
  include_once(ABSPATH.WPINC.'/class-simplepie.php');
821
  $options = $this->get_options();
822
  $num = 1;
823
- $url = strip_tags($_POST['url']);
 
824
  // add trailing slash (can help with some blogs)
825
  if(!strpos($url,'?')){
826
  $url = trailingslashit($url);
@@ -886,18 +888,28 @@
886
  $rss->init();
887
  $ferror = $rss->error();
888
  if($ferror || stripos($ferror,'invalid')){
 
889
  unset($rss);
890
  $rss = new SimplePie();
891
  $rss->set_useragent('Commentluv /'.$this->version.' (Feed Parser; http://www.commentluv.com; Allow like Gecko) Build/20110502' );
892
  $rss->enable_cache ( FALSE );
893
- $rss->set_feed_url($url);
894
  $rss->init();
895
  $ferror = $rss->error();
896
  // go back to original URL if error persisted
897
  if(stripos($ferror,'invalid')){
898
  //get raw file to show any errors
899
- $rawfile = new $rss->file_class($rss->feed_url, $rss->timeout, 5, null, $rss->useragent, $rss->force_fsockopen);
900
- $rawfile = $rawfile->body;
 
 
 
 
 
 
 
 
 
901
  }
902
  }
903
  }
2
  Plugin Name: CommentLuv
3
  Plugin URI: http://comluv.com/
4
  Description: Reward your readers by automatically placing a link to their last blog post at the end of their comment. Encourage a community and discover new posts.
5
+ Version: 2.92.5
6
  Author: Andy Bailey
7
  Author URI: http://www.commentluv.com
8
  Copyright (C) <2011> <Andy Bailey>
28
  var $plugin_url;
29
  var $plugin_dir;
30
  var $db_option = 'commentluv_options';
31
+ var $version = "2.92.5";
32
  var $slug = 'commentluv-options';
33
  var $localize;
34
  var $is_commentluv_request = false;
804
  */
805
  function fetch_feed(){
806
  // check nonce
807
+ //debugbreak();
808
  $checknonce = check_ajax_referer('fetch',false,false);
809
  if(!$checknonce){
810
  die(' error! not authorized '.strip_tags($_REQUEST['_ajax_nonce']));
821
  include_once(ABSPATH.WPINC.'/class-simplepie.php');
822
  $options = $this->get_options();
823
  $num = 1;
824
+ $url = esc_url($_POST['url']);
825
+ $orig_url = $url;
826
  // add trailing slash (can help with some blogs)
827
  if(!strpos($url,'?')){
828
  $url = trailingslashit($url);
888
  $rss->init();
889
  $ferror = $rss->error();
890
  if($ferror || stripos($ferror,'invalid')){
891
+ $suburl = $rss->subscribe_url() ? $rss->subscribe_url() : $orig_url;
892
  unset($rss);
893
  $rss = new SimplePie();
894
  $rss->set_useragent('Commentluv /'.$this->version.' (Feed Parser; http://www.commentluv.com; Allow like Gecko) Build/20110502' );
895
  $rss->enable_cache ( FALSE );
896
+ $rss->set_feed_url($orig_url);
897
  $rss->init();
898
  $ferror = $rss->error();
899
  // go back to original URL if error persisted
900
  if(stripos($ferror,'invalid')){
901
  //get raw file to show any errors
902
+ @include_once(ABSPATH.WPINC.'/SimplePie/File.php');
903
+ if(class_exists('SimplePie_File')){
904
+ $rawfile = new SimplePie_File($suburl, $rss->timeout, 5, null, $rss->useragent, $rss->force_fsockopen);
905
+ } elseif (class_exists($rss->file_class)){
906
+ $rawfile = new $rss->file_class($suburl, $rss->timeout, 5, null, $rss->useragent, $rss->force_fsockopen);
907
+ }
908
+ if(isset($rawfile->body)){
909
+ $rawfile = $rawfile->body;
910
+ } else {
911
+ $rawfile = __('Raw file could not be found',$this->plugin_domain);
912
+ }
913
  }
914
  }
915
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:http://comluv.com/about/donate
4
  Tags: commentluv, comments, last blog post, linkluv, comment luv , commentlove, comment love
5
  Requires at least: 3.0
6
  Tested up to: 3.5
7
- Stable tag: 2.92.4
8
 
9
  Reward your readers by automatically placing a link to their last blog post at the end of their comment. Encourage a community and discover new posts.
10
 
@@ -86,6 +86,11 @@ Please see the videos in the settings page for explanations of how they work.
86
 
87
  == ChangeLog ==
88
 
 
 
 
 
 
89
  = 2.92.4 =
90
 
91
  * updated : make ajax fetch more secure
4
  Tags: commentluv, comments, last blog post, linkluv, comment luv , commentlove, comment love
5
  Requires at least: 3.0
6
  Tested up to: 3.5
7
+ Stable tag: 2.92.5
8
 
9
  Reward your readers by automatically placing a link to their last blog post at the end of their comment. Encourage a community and discover new posts.
10
 
86
 
87
  == ChangeLog ==
88
 
89
+ = 2.92.5 =
90
+
91
+ * fixed : simplepie library changed to use separate class file for File
92
+ * updated : better error reporting with simplepie for sites with undiscovered feeds
93
+
94
  = 2.92.4 =
95
 
96
  * updated : make ajax fetch more secure