CommentLuv - Version 2.91

Version Description

  • new changes implimented for author/category urls
  • remove ugly red box for upgrade notice. replace with calming yellow one with a convenient link to update the plugin.
  • fixed : prevent DOING_AJAX from being defined if is already defined
  • updated : clear output buffer before sending feed
  • updated : prevent simplepie deprecated notices from showing when fetching feed if php is set to show them
  • updated : add trailing slash to url for fetching feed (some sites that have errors bork without trailing slash)
  • updated : do first round of effecient action setting so ajax only functions are much better for memory
Download this release

Release Info

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

Code changes from version 2.90.9.9.3 to 2.91

Files changed (4) hide show
  1. commentluv.php +124 -49
  2. css/commentluv.css +2 -0
  3. js/commentluv.js +12 -2
  4. readme.txt +13 -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.3
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.3";
32
  var $slug = 'commentluv-options';
33
  var $localize;
34
  var $is_commentluv_request = false;
@@ -63,15 +63,20 @@
63
  // plugin dir and url
64
  $this->plugin_url = trailingslashit ( WP_PLUGIN_URL . '/' . dirname ( plugin_basename ( __FILE__ ) ) );
65
  $this->plugin_dir = dirname(__FILE__);
66
-
67
- add_action ( 'clversion', array (&$this,'check_version') ); // check commentluv version
68
- add_action ( 'init', array (&$this,'init') ); // to register styles and scripts
69
- add_action ( 'admin_init', array (&$this, 'admin_init' ) ); // to register settings group
70
- add_action ( 'admin_menu', array (&$this, 'admin_menu' ) ); // to setup menu link for settings page
71
- add_action ( 'admin_print_scripts-settings_page_commentluv-options', array(&$this,'add_settings_page_script')); // script for settings page ajax function
72
- add_action ( 'admin_print_styles-settings_page_commentluv-options', array(&$this,'add_settings_page_style')); // script for settings page ajax function
73
- add_action ( 'wp_ajax_notify_signup', array(&$this,'notify_signup')); // ajax handler for settings page subscribe button
74
- add_action ( 'init', array(&$this,'detect_useragent'));
 
 
 
 
 
75
  // filters
76
  add_filter ( 'cron_schedules', array (&$this, 'cron_schedules') ); // for my own recurrence
77
  add_filter ( 'plugin_action_links', array (&$this, 'plugin_action_link' ), - 10, 2 ); // add a settings page link to the plugin description. use 2 for allowed vars
@@ -82,6 +87,8 @@
82
  if(!isset($options['enable']) || ( isset($options['enable']) && $options['enable'] != 'no')){
83
  $this->setup_hooks();
84
  }
 
 
85
  }
86
  /**
87
  * PHP4 constructor
@@ -222,15 +229,15 @@
222
  }
223
  wp_enqueue_script('commentluv_script');
224
  $this->localize = array ('name' => $author_name, 'url' => $url_name, 'comment' => $comment_name, 'email' => $email_name,
225
- 'infopanel' => $infopanel, 'default_on' => $default_on, 'default_on_admin' => $default_on_admin,
226
- 'cl_version' => $this->version, 'images' => $this->plugin_url . 'images/', 'api_url' => $api_url,
227
- '_fetch' => wp_create_nonce('fetch'), '_info' => wp_create_nonce('info'),
228
- 'infoback' => $infoback, 'infotext'=>$infotext,'template_insert'=>$template_insert, 'logged_in'=>is_user_logged_in(),
229
- 'refer' => get_permalink(),
230
- 'no_url_message'=>__('Please enter a URL and then click the CommentLuv checkbox if you want to add your last blog post',$this->plugin_domain),
231
- 'no_http_message'=>__('Please use http:// in front of your url',$this->plugin_domain),
232
- 'no_url_logged_in_message'=>__('You need to visit your profile in the dashboard and update your details with your site URL',$this->plugin_domain),
233
- 'no_info_message'=>__('No info was available or an error occured',$this->plugin_domain));
234
  if($minifying != 'on'){
235
  wp_localize_script('commentluv_script','cl_settings',$this->localize);
236
  }
@@ -274,7 +281,8 @@
274
  // whitelist options
275
  register_setting( 'commentluv_options_group', $this->db_option ,array(&$this,'options_sanitize' ) );
276
  $options = $this->get_options();
277
- if(isset($options['upgrade'])){
 
278
  add_action('admin_notices',array(&$this,'show_upgrade_notice'));
279
  }
280
  }
@@ -372,6 +380,25 @@
372
  wp_delete_comment($id);
373
  return;
374
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
  }
376
  $prem = 'p' == $_POST['cl_prem'] ? 'p' : 'u';
377
  $data = array('cl_post_title'=>$title,'cl_post_url'=>$link,'cl_prem'=>$prem);
@@ -386,8 +413,8 @@
386
  */
387
  function cron_schedules($schedules){
388
  $schedules['clfortnightly'] = array(
389
- 'interval' => 1209600,
390
- 'display' => __('Twice Monthly')
391
  );
392
  return $schedules;
393
  }
@@ -418,7 +445,8 @@
418
  // is this commentluv calling?
419
  if (preg_match("/Commentluv/i", $_SERVER['HTTP_USER_AGENT'])){
420
  $this->is_commentluv_request = true;
421
- if($options['disable_detect'] != 'on'){
 
422
  remove_all_actions('wp_head');
423
  remove_all_actions('wp_footer');
424
  // prevent wordpress.com stats from adding stats script
@@ -713,6 +741,20 @@
713
  $showlink = true;
714
  if($authurl == '' && isset($options['hide_link_no_url']) && $options['hide_link_no_url'] == 'on'){
715
  $showlink = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
716
  }
717
  if($showlink){
718
  // construct string to be added to comment
@@ -755,11 +797,20 @@
755
  if(!$checknonce){
756
  die(' error! not authorized '.$_REQUEST['_ajax_nonce']);
757
  }
758
- define('DOING_AJAX', true);
 
 
 
 
 
759
  include_once(ABSPATH.WPINC.'/class-simplepie.php');
760
  $options = $this->get_options();
761
  $num = 1;
762
  $url = strip_tags($_POST['url']);
 
 
 
 
763
  // fetch 10 last posts?
764
  if((is_user_logged_in() && $options['whogets'] == 'registered') || (!is_user_logged_in() && $options['whogets'] == 'everybody')){
765
  $num = 10;
@@ -806,7 +857,7 @@
806
  $ferror = $rss->error();
807
  // try a fall back and add /?feed=rss2 to the end of url if the found subscribe url hasn't already got it
808
  // also try known blogspot feed location if this is a blogspot url
809
- if(strstr($ferror,'could not be found') && !strstr($su,'feed')){
810
  unset($rss);
811
  $rss = new SimplePie();
812
  $rss->set_useragent('Commentluv /'.$this->version.' (Feed Parser; http://www.commentluv.com; Allow like Gecko) Build/20110502' );
@@ -819,6 +870,11 @@
819
  }
820
  $rss->set_feed_url($url);
821
  $rss->init();
 
 
 
 
 
822
  }
823
  $rss->handle_content_type();
824
  $gen = $rss->get_channel_tags('','generator');
@@ -883,8 +939,8 @@
883
  }
884
  $response = json_encode(array('error'=>'','items'=>$arr,'meta'=>$meta));
885
  } else {
886
- // had an error trying to read the feed
887
- $response = json_encode(array('error'=>$error,'meta'=>$meta));
888
  }
889
  unset($rss);
890
  header( "Content-Type: application/json" );
@@ -916,12 +972,12 @@
916
  // default values
917
  $this->handle_load_domain ();
918
  $default = array ('version'=>$this->version,'enable'=>'yes','enable_for'=>'both', 'default_on' => 'on', 'default_on_admin'=>'on',
919
- 'badge_choice' => 'drop_down', 'badge_type'=>'default', 'link'=>'off','infopanel'=>'on', 'infoback'=>'white', 'infotext'=>'black',
920
- 'comment_text'=>'[name] '.__('recently posted',$this->plugin_domain).'..[lastpost]', 'whogets'=>'registered', 'dofollow' => 'registered',
921
- 'unreg_user_text'=>__('If you register as a user on my site, you can get your 10 most recent blog posts to choose from in this box.',$this->plugin_domain).' '.$register_link,
922
- 'unreg_user_text_panel'=>__('If this user had registered to my site then they could get 10 last posts to choose from when they comment and you would be able to see a list of their recent posts in this panel',$this->plugin_domain),
923
- 'template_insert'=>'','minifying'=>'','api_url'=>admin_url('admin-ajax.php'),'author_name'=>'author','email_name'=>'email','url_name'=>'url','comment_name'=>'comment',
924
- 'hide_link_no_url'=>'nothing');
925
  $options = get_option ( $this->db_option, $default);
926
  // return the options
927
  if($reset == 'yes'){
@@ -1019,14 +1075,14 @@
1019
  */
1020
  function kindergarten_html($input){
1021
  $allowedtags = array(
1022
- 'h1' => array(),
1023
- 'br' => array(),
1024
- 'a' => array('href' => array(),'title' => array(),'rel' => array(),'target'=>array(), 'class'=>array()),
1025
- 'small' =>array(),
1026
- 'p' =>array( 'class'=>array()),
1027
- 'strong' => array(),
1028
- 'img' => array('src' => array(),'alt' => array(),'width' => array(),'height' => array(),'align'=> array()),
1029
- 'span' => array('class'=>array())
1030
  );
1031
  return wp_kses($input,$allowedtags);
1032
  }
@@ -1075,7 +1131,7 @@
1075
  return $old_options;
1076
  }
1077
  // check for reset
1078
- if($options['reset'] == 'yes'){
1079
  return $this->get_options('yes');
1080
  }
1081
  // if on multisite and this isnt super admin saving,
@@ -1243,7 +1299,8 @@
1243
  '</item>';
1244
  }
1245
  $feed .= '</channel></rss>';
1246
- header("Content-Type: application/atom+xml; charset=".get_bloginfo('charset'));
 
1247
  echo $feed;
1248
  exit;
1249
 
@@ -1258,9 +1315,7 @@
1258
  add_action ( 'template_redirect',array(&$this,'add_script')); // add commentluv script
1259
  add_action ( 'admin_print_scripts-edit-comments.php', array (&$this, 'add_removeluv_script') ); // add the removeluv script to admin page
1260
  add_action ( 'wp_footer',array(&$this,'add_footer')); // add localize to footer
1261
- add_action ( 'wp_ajax_removeluv', array (&$this, 'ajax_remove_luv') ); // handle the call to the admin-ajax for removing luv
1262
- add_action ( 'wp_ajax_nopriv_cl_ajax',array(&$this,'do_ajax'));
1263
- add_action ( 'wp_ajax_cl_ajax',array(&$this,'do_ajax'));
1264
  add_action ( 'wp_insert_comment', array (&$this, 'comment_posted'),1,2); // add member id and other data to comment meta priority 1, 2 vars
1265
 
1266
  add_filter ( 'comments_array', array (&$this, 'do_shortcode' ), 1 ); // add last blog post data to comment content
@@ -1273,14 +1328,17 @@
1273
  */
1274
  function show_upgrade_notice(){
1275
  $options = $this->get_options();
1276
- echo '<div id="clupgrade" class="error">';
 
1277
  if($options['upgrade_message']){
1278
  echo $options['upgrade_message'];
 
 
1279
  } else {
1280
  echo __('There is a new version of Commentluv available, please upgrade by visiting this site',$this->plugin_domain);
1281
  echo '<br><a href="http://www.commentluv.com" target="_blank">www.commentluv.com</a>';
1282
  }
1283
- echo '<span style="float:right"><a href="'.admin_url('options-general.php?page='.$this->slug.'&dismiss=true').'">'.__('Dismiss notice',$this->plugin_domain).'</a></span>';
1284
  echo '</div>';
1285
  }
1286
 
@@ -1336,6 +1394,11 @@
1336
  <div id="notify_message"></div>
1337
  </td>
1338
  </tr>
 
 
 
 
 
1339
  </tbody>
1340
  </table>
1341
 
@@ -1603,6 +1666,18 @@
1603
  <br /><strong>(<?php _e('Prevents spammer abuse',$this->plugin_domain);?>)</strong>
1604
 
1605
  </td>
 
 
 
 
 
 
 
 
 
 
 
 
1606
  </tr>
1607
  <tr>
1608
  <td style="background-color: #dfdfdf; text-align: center; font-weight: bolder;" colspan="5"><?php _e('Diagnostics Info',$pd);?></td>
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.91
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.91";
32
  var $slug = 'commentluv-options';
33
  var $localize;
34
  var $is_commentluv_request = false;
63
  // plugin dir and url
64
  $this->plugin_url = trailingslashit ( WP_PLUGIN_URL . '/' . dirname ( plugin_basename ( __FILE__ ) ) );
65
  $this->plugin_dir = dirname(__FILE__);
66
+ if(defined('DOING_AJAX') && DOING_AJAX){
67
+ add_action ( 'wp_ajax_removeluv', array (&$this, 'ajax_remove_luv') ); // handle the call to the admin-ajax for removing luv
68
+ add_action ( 'wp_ajax_nopriv_cl_ajax',array(&$this,'do_ajax'));
69
+ add_action ( 'wp_ajax_cl_ajax',array(&$this,'do_ajax'));
70
+ } else {
71
+ add_action ( 'clversion', array (&$this,'check_version') ); // check commentluv version
72
+ add_action ( 'init', array (&$this,'init') ); // to register styles and scripts
73
+ add_action ( 'admin_init', array (&$this, 'admin_init' ) ); // to register settings group
74
+ add_action ( 'admin_menu', array (&$this, 'admin_menu' ) ); // to setup menu link for settings page
75
+ add_action ( 'admin_print_scripts-settings_page_commentluv-options', array(&$this,'add_settings_page_script')); // script for settings page ajax function
76
+ add_action ( 'admin_print_styles-settings_page_commentluv-options', array(&$this,'add_settings_page_style')); // script for settings page ajax function
77
+ add_action ( 'wp_ajax_notify_signup', array(&$this,'notify_signup')); // ajax handler for settings page subscribe button
78
+ add_action ( 'init', array(&$this,'detect_useragent'));
79
+ }
80
  // filters
81
  add_filter ( 'cron_schedules', array (&$this, 'cron_schedules') ); // for my own recurrence
82
  add_filter ( 'plugin_action_links', array (&$this, 'plugin_action_link' ), - 10, 2 ); // add a settings page link to the plugin description. use 2 for allowed vars
87
  if(!isset($options['enable']) || ( isset($options['enable']) && $options['enable'] != 'no')){
88
  $this->setup_hooks();
89
  }
90
+
91
+
92
  }
93
  /**
94
  * PHP4 constructor
229
  }
230
  wp_enqueue_script('commentluv_script');
231
  $this->localize = array ('name' => $author_name, 'url' => $url_name, 'comment' => $comment_name, 'email' => $email_name,
232
+ 'infopanel' => $infopanel, 'default_on' => $default_on, 'default_on_admin' => $default_on_admin,
233
+ 'cl_version' => $this->version, 'images' => $this->plugin_url . 'images/', 'api_url' => $api_url,
234
+ '_fetch' => wp_create_nonce('fetch'), '_info' => wp_create_nonce('info'),
235
+ 'infoback' => $infoback, 'infotext'=>$infotext,'template_insert'=>$template_insert, 'logged_in'=>is_user_logged_in(),
236
+ 'refer' => get_permalink(),
237
+ 'no_url_message'=>__('Please enter a URL and then click the CommentLuv checkbox if you want to add your last blog post',$this->plugin_domain),
238
+ 'no_http_message'=>__('Please use http:// in front of your url',$this->plugin_domain),
239
+ 'no_url_logged_in_message'=>__('You need to visit your profile in the dashboard and update your details with your site URL',$this->plugin_domain),
240
+ 'no_info_message'=>__('No info was available or an error occured',$this->plugin_domain));
241
  if($minifying != 'on'){
242
  wp_localize_script('commentluv_script','cl_settings',$this->localize);
243
  }
281
  // whitelist options
282
  register_setting( 'commentluv_options_group', $this->db_option ,array(&$this,'options_sanitize' ) );
283
  $options = $this->get_options();
284
+ //if(isset($options['upgrade'])){
285
+ if(isset($options['upgrade']) && version_compare($options['upgrade'],$this->php_version($this->version),'>')){
286
  add_action('admin_notices',array(&$this,'show_upgrade_notice'));
287
  }
288
  }
380
  wp_delete_comment($id);
381
  return;
382
  }
383
+ // check for matching comment
384
+ if(!isset($options['hide_link_no_url_match'])){
385
+ $options['hide_link_no_url_match'] = 'nothing';
386
+ }
387
+ $authorurlarr = parse_url($commentdata->comment_author_url);
388
+ $linkurlarr = parse_url($link);
389
+ if($options['hide_link_no_url_match'] != 'nothing'){
390
+ if($authorurlarr['host'] != $linkurlarr['host']){
391
+ // link has different domain
392
+ if($options['hide_link_no_url_match'] == 'spam'){
393
+ $commentdata->comment_approved = 'spam';
394
+ $update = wp_update_comment((array)$commentdata);
395
+ }
396
+ if($options['hide_link_no_url_match'] == 'delete'){
397
+ wp_delete_comment($id);
398
+ return;
399
+ }
400
+ }
401
+ }
402
  }
403
  $prem = 'p' == $_POST['cl_prem'] ? 'p' : 'u';
404
  $data = array('cl_post_title'=>$title,'cl_post_url'=>$link,'cl_prem'=>$prem);
413
  */
414
  function cron_schedules($schedules){
415
  $schedules['clfortnightly'] = array(
416
+ 'interval' => 1209600,
417
+ 'display' => __('Twice Monthly')
418
  );
419
  return $schedules;
420
  }
445
  // is this commentluv calling?
446
  if (preg_match("/Commentluv/i", $_SERVER['HTTP_USER_AGENT'])){
447
  $this->is_commentluv_request = true;
448
+ ob_start();
449
+ if(!isset($options['disable_detect'])){
450
  remove_all_actions('wp_head');
451
  remove_all_actions('wp_footer');
452
  // prevent wordpress.com stats from adding stats script
741
  $showlink = true;
742
  if($authurl == '' && isset($options['hide_link_no_url']) && $options['hide_link_no_url'] == 'on'){
743
  $showlink = false;
744
+ }
745
+ // check link domain matches author url domain
746
+ if(!isset($options['hide_link_no_url_match'])){
747
+ $options['hide_link_no_url_match'] = 'nothing';
748
+ }
749
+ $authorurlarr = parse_url($authurl);
750
+ $linkurlarr = parse_url($data['cl_post_url']);
751
+ if($options['hide_link_no_url_match'] != 'nothing'){
752
+ if($authorurlarr['host'] != $linkurlarr['host']){
753
+ // link has different domain
754
+ if($options['hide_link_no_url_match'] == 'on'){
755
+ $showlink = false;
756
+ }
757
+ }
758
  }
759
  if($showlink){
760
  // construct string to be added to comment
797
  if(!$checknonce){
798
  die(' error! not authorized '.$_REQUEST['_ajax_nonce']);
799
  }
800
+ if(!defined('DOING_AJAX')){
801
+ define('DOING_AJAX',true);
802
+ }
803
+ // try to prevent deprecated notices
804
+ ini_set('display_errors',0);
805
+ error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
806
  include_once(ABSPATH.WPINC.'/class-simplepie.php');
807
  $options = $this->get_options();
808
  $num = 1;
809
  $url = strip_tags($_POST['url']);
810
+ // add trailing slash (can help with some blogs)
811
+ if(!strpos($url,'?')){
812
+ $url = trailingslashit($url);
813
+ }
814
  // fetch 10 last posts?
815
  if((is_user_logged_in() && $options['whogets'] == 'registered') || (!is_user_logged_in() && $options['whogets'] == 'everybody')){
816
  $num = 10;
857
  $ferror = $rss->error();
858
  // try a fall back and add /?feed=rss2 to the end of url if the found subscribe url hasn't already got it
859
  // also try known blogspot feed location if this is a blogspot url
860
+ if($ferror || strstr($ferror,'could not be found') && !strstr($su,'feed')){
861
  unset($rss);
862
  $rss = new SimplePie();
863
  $rss->set_useragent('Commentluv /'.$this->version.' (Feed Parser; http://www.commentluv.com; Allow like Gecko) Build/20110502' );
870
  }
871
  $rss->set_feed_url($url);
872
  $rss->init();
873
+ if(stripos($ferror,'invalid')){
874
+ //get raw file to show any errors
875
+ $rawfile = new $rss->file_class($rss->feed_url, $rss->timeout, 5, null, $rss->useragent, $rss->force_fsockopen);
876
+ $rawfile = $rawfile->body;
877
+ }
878
  }
879
  $rss->handle_content_type();
880
  $gen = $rss->get_channel_tags('','generator');
939
  }
940
  $response = json_encode(array('error'=>'','items'=>$arr,'meta'=>$meta));
941
  } else {
942
+ // had an error trying to read the feed
943
+ $response = json_encode(array('error'=>$error,'meta'=>$meta,'rawfile'=>htmlspecialchars($rawfile)));
944
  }
945
  unset($rss);
946
  header( "Content-Type: application/json" );
972
  // default values
973
  $this->handle_load_domain ();
974
  $default = array ('version'=>$this->version,'enable'=>'yes','enable_for'=>'both', 'default_on' => 'on', 'default_on_admin'=>'on',
975
+ 'badge_choice' => 'drop_down', 'badge_type'=>'default', 'link'=>'off','infopanel'=>'on', 'infoback'=>'white', 'infotext'=>'black',
976
+ 'comment_text'=>'[name] '.__('recently posted',$this->plugin_domain).'..[lastpost]', 'whogets'=>'registered', 'dofollow' => 'registered',
977
+ 'unreg_user_text'=>__('If you register as a user on my site, you can get your 10 most recent blog posts to choose from in this box.',$this->plugin_domain).' '.$register_link,
978
+ 'unreg_user_text_panel'=>__('If this user had registered to my site then they could get 10 last posts to choose from when they comment and you would be able to see a list of their recent posts in this panel',$this->plugin_domain),
979
+ 'template_insert'=>'','minifying'=>'','api_url'=>admin_url('admin-ajax.php'),'author_name'=>'author','email_name'=>'email','url_name'=>'url','comment_name'=>'comment',
980
+ 'hide_link_no_url'=>'nothing','hide_link_no_url_match'=>'nothing');
981
  $options = get_option ( $this->db_option, $default);
982
  // return the options
983
  if($reset == 'yes'){
1075
  */
1076
  function kindergarten_html($input){
1077
  $allowedtags = array(
1078
+ 'h1' => array(),
1079
+ 'br' => array(),
1080
+ 'a' => array('href' => array(),'title' => array(),'rel' => array(),'target'=>array(), 'class'=>array()),
1081
+ 'small' =>array(),
1082
+ 'p' =>array( 'class'=>array()),
1083
+ 'strong' => array(),
1084
+ 'img' => array('src' => array(),'alt' => array(),'width' => array(),'height' => array(),'align'=> array()),
1085
+ 'span' => array('class'=>array())
1086
  );
1087
  return wp_kses($input,$allowedtags);
1088
  }
1131
  return $old_options;
1132
  }
1133
  // check for reset
1134
+ if(isset($options['reset'])){
1135
  return $this->get_options('yes');
1136
  }
1137
  // if on multisite and this isnt super admin saving,
1299
  '</item>';
1300
  }
1301
  $feed .= '</channel></rss>';
1302
+ ob_end_clean();
1303
+ header("Content-Type: application/atom+xml; charset=".get_bloginfo('charset'));
1304
  echo $feed;
1305
  exit;
1306
 
1315
  add_action ( 'template_redirect',array(&$this,'add_script')); // add commentluv script
1316
  add_action ( 'admin_print_scripts-edit-comments.php', array (&$this, 'add_removeluv_script') ); // add the removeluv script to admin page
1317
  add_action ( 'wp_footer',array(&$this,'add_footer')); // add localize to footer
1318
+
 
 
1319
  add_action ( 'wp_insert_comment', array (&$this, 'comment_posted'),1,2); // add member id and other data to comment meta priority 1, 2 vars
1320
 
1321
  add_filter ( 'comments_array', array (&$this, 'do_shortcode' ), 1 ); // add last blog post data to comment content
1328
  */
1329
  function show_upgrade_notice(){
1330
  $options = $this->get_options();
1331
+ $update_url = wp_nonce_url('update.php?action=upgrade-plugin&amp;plugin=commentluv%2Fcommentluv.php', 'upgrade-plugin_commentluv/commentluv.php');
1332
+ echo '<div id="clupgrade" class="update-nag">';
1333
  if($options['upgrade_message']){
1334
  echo $options['upgrade_message'];
1335
+ $details_link = '<br /><a href="'.admin_url().'plugin-install.php?tab=plugin-information&amp;plugin=commentluv&amp;TB_iframe=true&amp;width=640&amp;height=350" class="thickbox" title="commentluv"> View new version details</a>';
1336
+ printf( __('%s or <a href="%s">update now</a>.', $this->plugin_domain), $details_link, $update_url ) ;
1337
  } else {
1338
  echo __('There is a new version of Commentluv available, please upgrade by visiting this site',$this->plugin_domain);
1339
  echo '<br><a href="http://www.commentluv.com" target="_blank">www.commentluv.com</a>';
1340
  }
1341
+ //echo '<span style="float:right"><a href="'.admin_url('options-general.php?page='.$this->slug.'&dismiss=true').'">'.__('Dismiss notice',$this->plugin_domain).'</a></span>';
1342
  echo '</div>';
1343
  }
1344
 
1394
  <div id="notify_message"></div>
1395
  </td>
1396
  </tr>
1397
+ <tr>
1398
+ <td colspan="2">
1399
+ <?php _e('<b>Are you getting targeted by spammers?</b> CommentLuv links are valuable which is why it promotes comments but some nasty spammers try to take advantage of this by leaving spam just to get the link. Don\'t worry, there is answer!... you can get CommentLuv Premium which has advanced anti-spam features which has been proven to almost eliminate spam on users blogs. You can upgrade by clicking the link above. <p><b>Not ready to buy premium yet?</b> that\'s ok too! Why not try GASP which is a lite version of the anti spam plugin that CommentLuv Premium uses. You can get it for FREE by searching for GASP in your "add new" section of your plugins page in your dashboard.',$pd);?>
1400
+ </td>
1401
+ </tr>
1402
  </tbody>
1403
  </table>
1404
 
1666
  <br /><strong>(<?php _e('Prevents spammer abuse',$this->plugin_domain);?>)</strong>
1667
 
1668
  </td>
1669
+ <td></td>
1670
+ <td>
1671
+ <select name="<?php echo $dbo;?>[hide_link_no_url_match]">
1672
+ <option value="nothing" <?php selected($o['hide_link_no_url_match'],'nothing',true);?>><?php _e('Nothing',$this->plugin_domain);?></option>
1673
+ <option value="on" <?php selected($o['hide_link_no_url_match'],'on',true);?>><?php _e('Hide Link',$this->plugin_domain);?></option>
1674
+ <option value="spam" <?php selected($o['hide_link_no_url_match'],'spam',true);?>><?php _e('Spam Comment',$this->plugin_domain);?></option>
1675
+ <option value="delete" <?php selected($o['hide_link_no_url_match'],'delete',true);?>><?php _e('Delete Comment',$this->plugin_domain);?></option>
1676
+ </select>
1677
+ <br/><label for="<?php echo $dbo;?>[hide_link_no_url_match]"><?php _e('Action to take if link does not match domain of author',$this->plugin_domain);?></label>
1678
+ <br /><strong>(<?php _e('Prevents users from adding fake author URLs to get around Akismet',$this->plugin_domain);?>)</strong>
1679
+
1680
+ </td>
1681
  </tr>
1682
  <tr>
1683
  <td style="background-color: #dfdfdf; text-align: center; font-weight: bolder;" colspan="5"><?php _e('Diagnostics Info',$pd);?></td>
css/commentluv.css CHANGED
@@ -6,6 +6,8 @@ span#mylastpost { clear: both;}
6
  span#showmorespan { width: 30px; height: 15px; cursor: pointer;}
7
  div#lastposts { padding: 3px; border: 1px dashed #dfdfdf; background-color: white;}
8
  input.cl_error { border: 1px solid red !important;}
 
 
9
  /** drop down **/
10
  span.choosepost {background-color: #fff; color: black; line-height: 1.4em; display: block;border-bottom: 1px dashed #bbb;cursor: pointer; margin-bottom: 5px;}
11
  span.choosepost:hover { font-weight: bolder; text-shadow: #dfdfdf 2px 2px 1px ; filter: Shadow(Color=gray,
6
  span#showmorespan { width: 30px; height: 15px; cursor: pointer;}
7
  div#lastposts { padding: 3px; border: 1px dashed #dfdfdf; background-color: white;}
8
  input.cl_error { border: 1px solid red !important;}
9
+ .rawfilewrap {border: 1px solid #cdcdcd; padding: 2px; cursor: pointer;}
10
+ .rawfile {display: none; border: 2px dashed #00ff00; padding: 2px; overflow: auto; height: 300px;}
11
  /** drop down **/
12
  span.choosepost {background-color: #fff; color: black; line-height: 1.4em; display: block;border-bottom: 1px dashed #bbb;cursor: pointer; margin-bottom: 5px;}
13
  span.choosepost:hover { font-weight: bolder; text-shadow: #dfdfdf 2px 2px 1px ; filter: Shadow(Color=gray,
js/commentluv.js CHANGED
@@ -62,6 +62,10 @@ jQuery(document).ready(function(){
62
  jQuery(document).click(heart_small);
63
  // add info panel to page
64
  jQuery("body").append('<span id="heart_tip_big" style="display: none;position:absolute; z-index: 1001; background-color: ' + cl_settings['infoback'] + '; color: ' + cl_settings['infotext'] + '; width: 62px;"></span>');
 
 
 
 
65
 
66
  });
67
 
@@ -168,7 +172,10 @@ function cl_dostuff(){
168
  jQuery('#mylastpost').html('<a href="' + jQuery(this).attr('id') +'"> ' + jQuery(this).text() + '</a>').fadeIn(1000);
169
  });
170
  } else {
171
- cl_message(data.error);
 
 
 
172
  }
173
  },
174
  error: function(x,e){
@@ -202,8 +209,11 @@ function cl_dostuff(){
202
  * adds a message to tell the user something in the cl_message div and then slides it down
203
  * @param string message - the message to show
204
  */
205
- function cl_message(message){
206
  jQuery('#cl_messages').empty().hide().text(message).slideDown();
 
 
 
207
  }
208
  function heart_big(e){
209
  // get url and data from link
62
  jQuery(document).click(heart_small);
63
  // add info panel to page
64
  jQuery("body").append('<span id="heart_tip_big" style="display: none;position:absolute; z-index: 1001; background-color: ' + cl_settings['infoback'] + '; color: ' + cl_settings['infotext'] + '; width: 62px;"></span>');
65
+ // hover over to see raw file wrapper open
66
+ jQuery('.rawfilewrap').live('hover',function(){
67
+ jQuery('.rawfile').toggle();
68
+ });
69
 
70
  });
71
 
172
  jQuery('#mylastpost').html('<a href="' + jQuery(this).attr('id') +'"> ' + jQuery(this).text() + '</a>').fadeIn(1000);
173
  });
174
  } else {
175
+ if(typeof(data.rawfile) == 'undefined'){
176
+ data.rawfile = 'no raw data sent back';
177
+ }
178
+ cl_message(data.error,data.rawfile);
179
  }
180
  },
181
  error: function(x,e){
209
  * adds a message to tell the user something in the cl_message div and then slides it down
210
  * @param string message - the message to show
211
  */
212
+ function cl_message(message,rawfile){
213
  jQuery('#cl_messages').empty().hide().text(message).slideDown();
214
+ if(typeof(rawfile) != 'undefined'){
215
+ jQuery('#cl_messages').append('<div class="rawfilewrap"><p>Hover your mouse here to see the data that CommentLuv got back from your site..<br />If you see a warning or other error message then that might help you locate the problem (maybe another plugin is spitting out an error?)</p><div class="rawfile"><pre>'+rawfile+'</pre></div></div>');
216
+ }
217
  }
218
  function heart_big(e){
219
  // get url and data from link
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.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,6 +85,15 @@ Please see the videos in the settings page for explanations of how they work.
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
@@ -337,10 +346,10 @@ Please see the videos in the settings page for explanations of how they work.
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
 
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.91
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.91 =
89
+ * new changes implimented for author/category urls
90
+ * remove ugly red box for upgrade notice. replace with calming yellow one with a convenient link to update the plugin.
91
+ * fixed : prevent DOING_AJAX from being defined if is already defined
92
+ * updated : clear output buffer before sending feed
93
+ * updated : prevent simplepie deprecated notices from showing when fetching feed if php is set to show them
94
+ * updated : add trailing slash to url for fetching feed (some sites that have errors bork without trailing slash)
95
+ * updated : do first round of effecient action setting so ajax only functions are much better for memory
96
+
97
  = 2.90.9.9.3 =
98
  * changed : try no whitespace in send_feed_file
99
  * changed : send application/atom+xml header before feed file to maybe prevent invalid mime type errors
346
 
347
  == Upgrade Notice ==
348
 
349
+ = 2.1 =
350
 
351
+ Lots of good error reporting stuff
352
+ added efficiency to ajax actions
353
 
354
  == Configuration ==
355