CommentLuv - Version 2.90.9.9.3

Version Description

  • changed : try no whitespace in send_feed_file
  • changed : send application/atom+xml header before feed file to maybe prevent invalid mime type errors
  • changed : request feed set to feed
Download this release

Release Info

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

Code changes from version 2.90.9.9 to 2.90.9.9.3

Files changed (2) hide show
  1. commentluv.php +42 -25
  2. readme.txt +18 -4
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.90.9.9
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.90.9.9";
32
  var $slug = 'commentluv-options';
33
  var $localize;
34
  var $is_commentluv_request = false;
@@ -424,7 +424,7 @@
424
  // prevent wordpress.com stats from adding stats script
425
  global $wp_query;
426
  $wp_query->is_feed = true;
427
- // use own file to output feed
428
  add_action('template_redirect',array(&$this,'send_feed_file'),1);
429
  }
430
  }
@@ -815,7 +815,7 @@
815
  if(strstr($url,'blogspot')){
816
  $url = trailingslashit($url).'feeds/posts/default/';
817
  } else {
818
- $url = add_query_arg(array('feed'=>'rss2'),$url);
819
  }
820
  $rss->set_feed_url($url);
821
  $rss->init();
@@ -853,6 +853,7 @@
853
 
854
  $feed_items = $rss->get_items();
855
  foreach($feed_items as $item){
 
856
  $type = 'blog';
857
  $itemtags = $item->get_item_tags('','type');
858
  if($itemtags){
@@ -1198,39 +1199,51 @@
1198
  * called by add_action(template_redirect) in detect_useragent
1199
  *
1200
  */
1201
-
1202
  function send_feed_file(){
1203
  //debugbreak();
1204
- $posts = get_posts(array('numberposts'=>10,'post_type'=>'post'));
 
 
 
 
 
 
 
 
 
 
 
 
 
1205
  $enabled = $this->is_enabled();
1206
  $error = 'false';
1207
  if(sizeof($posts) < 1){
1208
  $error = 'true';
1209
  }
1210
- $feed = '<?xml version="1.0" encoding="UTF-8" ?>
1211
- <rss version="2.0">
1212
- <channel>
1213
- <title><![CDATA['. get_bloginfo('title') .']]></title>
1214
- <link>'. get_bloginfo('home') .'</link>
1215
- <description><![CDATA['. get_bloginfo('description') .']]></description>
1216
- <language>'.get_bloginfo('language').'</language>
1217
- <generator>commentluv?v='.$this->version.'</generator>
1218
- <commentluv>'.$enabled.'</commentluv>
1219
- <success>'.$error.'</success>';
1220
  if(is_array($posts)){
1221
  foreach($posts as $post){
1222
- $feed .= '<item><title><![CDATA['.get_the_title($post->ID).']]></title>
1223
- <link>'.get_permalink($post->ID).'</link>
1224
- <type>blog</type>
1225
- </item>';
1226
  }
1227
  } else {
1228
- $feed .= '<item><title>'.__('No Posts Were Found!',$pd).'</title>
1229
- <link>'.get_permalink($post->ID).'</link>
1230
- </item>';
1231
  }
1232
  $feed .= '</channel></rss>';
1233
- header("Content-Type: application/xml; charset=UTF-8");
1234
  echo $feed;
1235
  exit;
1236
 
@@ -1720,7 +1733,11 @@
1720
 
1721
  } // end class
1722
  } // end if class not exists
1723
-
 
 
 
 
1724
  $clbadgeshown = false;
1725
  // start commentluv class engines
1726
  if (class_exists ( 'commentluv' )) :
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.90.9.9.3
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.90.9.9.3";
32
  var $slug = 'commentluv-options';
33
  var $localize;
34
  var $is_commentluv_request = false;
424
  // prevent wordpress.com stats from adding stats script
425
  global $wp_query;
426
  $wp_query->is_feed = true;
427
+ // use own function to output feed
428
  add_action('template_redirect',array(&$this,'send_feed_file'),1);
429
  }
430
  }
815
  if(strstr($url,'blogspot')){
816
  $url = trailingslashit($url).'feeds/posts/default/';
817
  } else {
818
+ $url = add_query_arg(array('feed'=>'atom'),$url);
819
  }
820
  $rss->set_feed_url($url);
821
  $rss->init();
853
 
854
  $feed_items = $rss->get_items();
855
  foreach($feed_items as $item){
856
+ //debugbreak();
857
  $type = 'blog';
858
  $itemtags = $item->get_item_tags('','type');
859
  if($itemtags){
1199
  * called by add_action(template_redirect) in detect_useragent
1200
  *
1201
  */
 
1202
  function send_feed_file(){
1203
  //debugbreak();
1204
+ $postquery = array('numberposts'=>10,'post_type'=>'post');
1205
+ if(is_category()){
1206
+ $cat = get_query_var('cat');
1207
+ $postquery['category']=$cat;
1208
+ }
1209
+ if(is_author()){
1210
+ $author = get_query_var('author');
1211
+ $postquery['author'] = $author;
1212
+ }
1213
+ if(is_tag()){
1214
+ $tag = get_query_var('tag');
1215
+ $postquery['tag'] = $tag;
1216
+ }
1217
+ $posts = get_posts($postquery);
1218
  $enabled = $this->is_enabled();
1219
  $error = 'false';
1220
  if(sizeof($posts) < 1){
1221
  $error = 'true';
1222
  }
1223
+ $feed = '<?xml version="1.0" encoding="'.get_bloginfo('charset').'" ?>'.
1224
+ '<rss version="2.0">'.
1225
+ '<channel>'.
1226
+ '<title><![CDATA['. get_bloginfo('title') .']]></title>'.
1227
+ '<link>'. get_bloginfo('home') .'</link>'.
1228
+ '<description><![CDATA['. get_bloginfo('description') .']]></description>'.
1229
+ '<language>'.get_bloginfo('language').'</language>'.
1230
+ '<generator>commentluv?v='.$this->version.'</generator>'.
1231
+ '<commentluv>'.$enabled.'</commentluv>'.
1232
+ '<success>'.$error.'</success>';
1233
  if(is_array($posts)){
1234
  foreach($posts as $post){
1235
+ $feed .= '<item><title><![CDATA['.get_the_title($post->ID).']]></title>'.
1236
+ '<link>'.get_permalink($post->ID).'</link>'.
1237
+ '<type>blog</type>'.
1238
+ '</item>';
1239
  }
1240
  } else {
1241
+ $feed .= '<item><title>'.__('No Posts Were Found!',$pd).'</title>'.
1242
+ '<link>'.get_permalink($post->ID).'</link>'.
1243
+ '</item>';
1244
  }
1245
  $feed .= '</channel></rss>';
1246
+ header("Content-Type: application/atom+xml; charset=".get_bloginfo('charset'));
1247
  echo $feed;
1248
  exit;
1249
 
1733
 
1734
  } // end class
1735
  } // end if class not exists
1736
+ // Let's give commentluv plenty of room to work with
1737
+ $mem = abs(intval(@ini_get('memory_limit')));
1738
+ if( $mem and $mem < 128 ){
1739
+ @ini_set('memory_limit', '128M');
1740
+ }
1741
  $clbadgeshown = false;
1742
  // start commentluv class engines
1743
  if (class_exists ( 'commentluv' )) :
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.4
7
- Stable tag: 2.90.9.9
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
 
@@ -85,6 +85,19 @@ Please see the videos in the settings page for explanations of how they work.
85
 
86
  == ChangeLog ==
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  = 2.90.9.9 =
89
  * fixed : trying updated detection routines to be compatible with new WP 3.4 query code
90
 
@@ -93,7 +106,7 @@ Please see the videos in the settings page for explanations of how they work.
93
  * added : Vietnamese Translation
94
  * added : Slovak Translation
95
  * fixed : send_feed only to send post_type of post
96
- * updated : fall back to /feed/ in url for fetch feed if no feed found
97
  * updated : add query arg to site url when fetching feed so w3 total cache knows not to cache the response
98
  * updated : user can now choose to delete or spam a comment that has a link but no author url (prevent spammer abuse)
99
  * updated : Slovak flag fixed
@@ -324,9 +337,10 @@ Please see the videos in the settings page for explanations of how they work.
324
 
325
  == Upgrade Notice ==
326
 
327
- = 2.90.9.8 =
328
 
329
- More language packs added for Hungarian, Slovakian and Vietnamese and improved fetching routine
 
330
 
331
  == Configuration ==
332
 
4
  Tags: commentluv, comments, last blog post, linkluv, comment luv , commentlove, comment love
5
  Requires at least: 3.0
6
  Tested up to: 3.4
7
+ Stable tag: 2.90.9.9.3
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
 
85
 
86
  == ChangeLog ==
87
 
88
+ = 2.90.9.9.3 =
89
+ * changed : try no whitespace in send_feed_file
90
+ * changed : send application/atom+xml header before feed file to maybe prevent invalid mime type errors
91
+ * changed : request feed set to feed = atom in fetch_feed
92
+ * updated : can now request author/category and tag posts by using appropriate url in comment form of a commentluv enabled site
93
+
94
+ = 2.90.9.9.2 =
95
+ * added : try to increase memory available to commentluv
96
+ * changed : set encoding to match that of the blog in send_feed_file
97
+
98
+ = 2.90.9.9.1 =
99
+ * fixed : trying new encoding of send_feed_file to match blog encoding
100
+
101
  = 2.90.9.9 =
102
  * fixed : trying updated detection routines to be compatible with new WP 3.4 query code
103
 
106
  * added : Vietnamese Translation
107
  * added : Slovak Translation
108
  * fixed : send_feed only to send post_type of post
109
+ * updated : fall back to /?feed=rss2 in url for fetch feed if no feed found
110
  * updated : add query arg to site url when fetching feed so w3 total cache knows not to cache the response
111
  * updated : user can now choose to delete or spam a comment that has a link but no author url (prevent spammer abuse)
112
  * updated : Slovak flag fixed
337
 
338
  == Upgrade Notice ==
339
 
340
+ = 2.90.9.9.3 =
341
 
342
+ Ability to process category and author URLs
343
+ Better formatted XML and headers
344
 
345
  == Configuration ==
346