Subscribe to Comments 2.1

Subscribe to Comments 2.1 is a plugin that allows commenters on your blog to check a box before commenting and get e-mail notification of further comments. It is one of the most popular WordPress plugins out there for the simple reason that it helps foster a community around your blog by encouraging commenters to come back and stay engaged in the dialog.

Features

  • Rudimentary security
    • Users cannot enter a random e-mail into the subscription manager and modify someone else’s subscriptions
    • In order to modify subscriptions, users need to use a special link, given in notification e-mails, and printed in the comments form as long as they have their comment cookie
  • Recognition of subscription status
    • Unsubscribed users see the “subscribe to comments” checkbox, but subscribed users see a “Manage your subscriptions” link
    • The author of the post is recognized by either login or comment cookie and is assumed to be subscribed to the entry (as they will receive notifications through WordPress)
  • Themeable subscription manager
    • Uses visual style of WordPress interface
    • Can be optionally accessed via “Manage” menu in WordPress
    • E-mail verification of block requests
    • Javascript “invert selection” link to check/uncheck subscriptions for mass deletion
    • “Return to the page you were viewing” link that persists at the top of the page, so that users can easily return to the post they were reading once they are done modifying subscriptions
  • Ability to let users change notification e-mail address
    • In the subscription manager, users can request that their notification address be changed for all their subscriptions
    • Special link is sent to the old address for verification
    • Once clicked, their e-mail address will be changed instantly for all their comments
  • Easy integration into comments form
    • No modification of comments form needed for WP 1.5+ (supported themes)
    • For users who want custom placement of the checkbox/link to subscription manager, this can be done with one simple function call, placed anywhere in the comment form
  • Subscription without leaving a comment
    • By popular demand, you can now offer visitors the option of subscribing to comments on an entry without having to leave a comment themselves
    • If the reader later decides to join the conversation, their subscription continues without them having to explicitly set it
  • Customization
    • You can make the Subscription Manager that your users see use your theme’s header, footer and sidebar, using CSS to style it to fit your site
  • Internationalization
    • I’ve written Subscribe to Comments 2.1 with i18n in mind, making full use of __() and _e() functions. The domain is “subscribe-to-comments”.

Download

Version 2.1 Update

Version 2.1 of Subscribe to Comments has a feature that people have been begging me to implement for many months: you can view the list of people who are subscribed to posts on your blog, and you can also see a list of the most “subscribed” posts. Also in this version is a new one-file install. You just put subscribe-to-comments.php in your /plugins/ directory, activate, and you’re done. This version will work on WordPress versions from 2.0.6 through 2.3.1 (highest tested).

Versions

  • 2.1.2 Fixed a few bugs that’d send bad notifications (thanks Donncha!), cleaned up some code and moved to using proper WP escaping functions
  • 2.1.1 WordPress 2.2 compatibility! Also note that support for attribute_escape() is needed, so if you get errors about that, upgrade to the latest version in your branch
  • 2.1 big update, fixing a few potential XSS holes, and misc error messages… see above for details
  • 2.0.8 XSS security fixes, hopefully fixed “+” symbols in e-mail for good
  • 2.0.7 additional “funky e-mail” fixes
  • 2.0.6 support for e-mail addresses with “+” symbols, option to disable CSS “clearing”
  • 2.0.4 potential security bugs, better WP 2.0 capabilities compat

Feedback/Bugs

Feel free to leave bug reports or feature requests here. Use this entry’s comments to ask support questions or offer general feedback

I’ve spent a lot of time writing this code and supporting it. If you derive some benefit from this code, please consider showing your gratitute in a more tangible
way. Thanks!

I have received $0 this month for my coding efforts.

Donate with PayPalAmazon.com Wishlist


4,469 Responses to “Subscribe to Comments 2.1”

Comment pages: « 1 [2] 3 4 5 6 7 8 9 10 1145 »

  1. Mark (post author) |

    Ah, my mistake. wp-subscription-manager.php goes in your WordPress root directory (the one with wp-config.php).

  2. Arno |

    Uploaded a quick and dirty (but complete) fr_FR.mo on the WikiPage. Peace out, Frenches, Canadians, and other francophile of the world..

  3. Mark (post author) |

    Arno, you rule! Please, please let me know if you come across any strings that aren’t translatable (i.e. not passed to the translation functions). Some people reported some strings that were bare, and I think I got them all, but let me know if I didn’t.

  4. Mark (post author) |

    readme.html has been added to the zip download.

  5. Arno |

    Mark > I will. BTW, just realized I uploaded a MO that contains only the plugins strings… I’ll make sure to push the merged-with-official-wordpress-MO version tonight.

  6. Mark (post author) |

    Arno, no, you had it right. According to what I see here, you shouldn’t merge it with the main WordPress MO. Each plugin loads its own MO file.

    WordPress will attempt to load a catalog named $domain-$locale.mo based on the specified domain and the locale setting of WordPress, as specified by the define WPLANG in wp-settings.php. WordPress will search for this file in the same directory as the plugin file.

  7. Mark (post author) |

    Note that the file should be called subscribe_to_comments-fr_FR.mo and should go in the /wp-content/plugins/ directory.

  8. Arno |

    Not sur I can change the name of the uploaded file on the WikiPage so I guess I’ll drop a paragraph there to copy you’re explanation

  9. Arno |

    One remark : as a matter of concistency, you may want to name the plugin file subscribe_to_comments.php instead or subscribe-to-comments.php

  10. Arno |

    In the wp file, line 180 :

    instead of

    same file, line 191, same idea for :
    " />

    same file, line 94:

    should be something like

    or whatever you prefer.

    That’s all I got for the time being : if needed I’ll update the MO file but those should be in already, and just not translated on the fly because of the lack of context.

  11. Arno |

    Sh*t. My previous post is all messed up. I thought I put enough spaces in there.

    Mark : care to correct the little issue (and then may be trash this comment)

  12. Mark (post author) |

    Arno, I think I got what you were saying by the line numbers. Not sure about line 94 though.

    Anyway, I’ve changed the translation domain to “subscribe-to-comments” to match the filename. I prefer dashes over underscores anyway. I added the domain to two strings that didn’t have it. You can grab the absolute latest versions of the files here.

    WordPress comments really aren’t the best place to paste PHP code, so you may want to report further bugs here.

    I also found out how to delete files from the wiki, so I deleted your older MO file. Do you think you could also upload a POT file? I’m not really sure how to create those for plugins… I’ve tried before but I don’t think my result was quite right. Maybe you could tell me the steps you take to create one.

  13. Arno |

    Line 94 : instaed of calling bloginfo('name'); _e('Comment Subscription Manager', 'subscribe_to_comments');
    perfer something like _e( get_bloginfo('name') .
    'Comment Subscription Manager', 'subscribe_to_comments');
    as the name of the blog may not be placed first in other language (among those, french)

    I’ll push a PO (note it’s is not a POT file anymore since it is not a template file anymore) asap.

  14. Mark (post author) |

    You can’t place a variable function directly into a translation function like that, I don’t think. But what I can do is use printf() so that the blogname will be represented as %s in the translation table.

    printf(__('%s Comment Subscription Manager', 'subscribe-to-comments'), get_bloginfo('name')); looks about right to me.

    Thanks!

  15. Arno |

    I’ll update the PO/MO files tonite

  16. Fiona |

    Thanks for the updates :)

  17. Fletcher |

    Is there a possibility to show all the subscribers of a post when I’m the author of the post? Something like “Show me all subscribers of this post”…

  18. Dimitris Glezos |

    Is there a possibility to show a link to the Subscriptions Manager outside a post page?

  19. Arno |

    One more thing : you should probably add the header of the admin page something like:

    charset= «?php bloginfo('charset'); ?»

    Required to use MO file in any language that uses accentued if you want Windows users to see the stuff properly.

  20. Mark (post author) |

    Fletcher, there is the a function that can be used within the comments loop to check for subscription status:

    It returns true/false.

    For example:

    If you want just a list of subscribed people, you could start a second comments loop, somewhere in your comments template:

    <?php
    
    function wp_filter_unique_emails($comment) {
    global $unique_comment_emails;
    if (@in_array($comment->comment_author_email, $unique_comment_emails)) {
    return false;
    } else {
    $unique_comment_emails[] = $comment->comment_author_email;
    return true;
    }
    }
    
    $unique_email_comments = array_filter($comments, 'wp_filter_unique_emails');
    
    echo 'Subscribed:<br />';
    
    foreach ($unique_email_comments as $comment) {
    if (comment_subscription_status()) {
    comment_author_link();
    echo "<br />";
    }
    }
    ?>

    The filter thing it just so that you get a unique list, instead of a hit for each comment each subscriber made.

    You can also do it this way… but you should restrict to this to your use, as it will show the e-mails of the subscribers:

    <?php
    if ($_GET['show_subs']) {
    
    global $sg_subscribe; sg_subscribe_start();
    
    foreach($sg_subscribe->subscriptions_from_post($id) as $subscriber) {
    echo $subscriber->comment_author_email . '<br />';
    }
    
    } ?>

    Hope that helps.

    Dimitris, you’ll want to look into the $sg_subscribe->manage_link() method which accepts the e-mail address of the subscriber as a parameter. In general, though, I’ve found that there’s not much use for a link appearing on the front page. The main thing people do with the Subscription Manager is unsubscribe from posts, and they usually do that by clicking on the link in the e-mail. Otherwise, how would they know they want to unsubscribe?

    Arno, I’ll add that in, thanks!

  21. aquel Eric |

    Spanish / Español MO and PO added.

  22. Ajay D'Souza |

    I don’t know if you considered this, but could it be made possible for the Admin to view all the subscribed users along with which post they are subscribed to?

  23. Mark (post author) |

    Aquel, thank you so much!

    Ajay, yeah, it’s on the to-do list for the next major version.

  24. Marcel von Mein Parteibuch |

    I just quickly translated the User Interface of the Plugin to German directly in source. Shame on my body, I didn’t do it using i18n as a mo file.

    Maybe, anyway somebody else is interested in this quick hack? Here it is in Deutsch:
    Quick hack Subscribe to Comments (Deutsch)

    Thanx for the great plugin.

    Marcel

  25. Uncino |

    Uploaded Italian PO and MO files on the WikiPage.

  26. Arno |

    Hey, was lurking in the code of the latest version from the Wiki : I saw you call mail() to send out the e-mails. You probably want to switch this to the pluggable function wp-mail() (found in /wp-function/pluggable-function.php) for forward compatibility sack

  27. Mark (post author) |

    Arno, good call. I’ll use wp_mail() in the next version.

  28. meeciteewurkor |

    Mark,
    Everything worked great after I installed the plugin.
    However, when I place the manual subscribe form code into my comments.php, and someone subscribes using this method, their email address is displayed above the comments form on the web site!
    It’s got some kind of php function followed by the email address.
    Any ideas? I’m sure this is not supposed to happen.

  29. meeciteewurkor |

    This is what it says right above the comments form:

    _sg_subscribe-to-comments: email @ email.com

    This happens after I enter this after the comments form code:

  30. Mark (post author) |

    Meeciteewurkor,

    That’s not a glitch. If they have submitted a comment, it should automatically fill in that “Subscribe without commenting” field with their e-mail address from the cookie. This saves them the trouble of having to type it in (but still gives them the option to alter it).

  31. Mich |

    Hi there. I added a Dutch translation to the wiki. Thanks for the great plugin!

  32. Colya |

    Is there a way to configure this plugin to send a notification if there has been any new post on a blog, not just a new comment under a presently existing topic?

    We’re setting up a blog for our trip to Europe from Canada and would love to has a certain group notified each time we make a new post.

  33. Shelby |

    Yesterday I just customized the old 1.5 by Scriptygoddess to have some of your newly introduced features, just to find out this morning that you have done all the modifications I’d like to see. You need more advertising ;)

  34. Shelby |

    Hi, I translated this great plugin into german and uploaded the .po and .mo files to the wiki page. Have fun…

    P.S. If someone knows how to put UTF-8 and ISO-8859-1 into one .mo file, I’d like to hear from you (this was the first time I was engaged in this l10n stuff).

  35. Arno |

    Shelby : you can’t.

    THis is something set as a parameter in the po files before compiling it into its mo counterpart.

    So you got to generate 2 separated mo files to have both UTF8 and ISO-8859-1.

  36. Shelby |

    Ah, I have expected this. The Wordpress language files do not have this problem. If I switch between UTF-8 and ISO-8859-1 in my blog, the Wordpress translation still looks fine. Because I do not have the Wordpress.po file I only can assume that they are using HTML entities. Thanks Arno. I will upload a modified de_DE.mo file, fixing this issue.

  37. Arno |

    Just to let you know : you’re blog is definitively throwing ISO-8859-1 stuff. Changing the setting in the admin panel will not change the previously posted text.

    But just go ahead and try to switch the encoding your browser is using (for Firefox, view -> characters encoding -> …) and you’ll propably see some weird stuff as I did.

  38. McShelby |

    I’m aware that my blog is using ISO-8859-1. This is not by accident. This was because of some strange issues my ISP had when setting the pages to UTF-8. Now it seems that they changed this issue, but I somehow have to convert my posts in the database to change all the umlauts. I am currently trying to figure out how to do this. After that I can switch back to UTF-8.

    What idiot had this great idea of only defining 127 ASCII characters and thought this is enough to display any given language until the end of mankind? Nargh. Must be the same who thought two digits are enough for save the year of a date.

  39. Jessica |

    I used the older version 1.4.4 and it worked fine, but since I saw the fancy new administration panel of the new version, I got to get it. ;-)
    Thanks a lot for this great plugin! :-)

  40. Robert Stuart |

    Truly a lovely and wonderful plugin. Thank you!

  41. Ken Savage |

    Is there a way I can auto subscribe every email that already made comments in the blog.

    The few people I work with want to enable this without going in and enabling past posts.

  42. Mark (post author) |

    Ken Savage,

    If you have access to the MySQL command line or to a PHPmyAdmin, you could do a query like this:

    UPDATE `wp_comments` SET `comment_subscribe` = 'Y';

    The wp_comments might be different… check your WP table prefix.

    This will subscribe every commenter.

  43. Ken Savage |

    UPDATE `wp_comments` SET `comment_subscribe` = ‘Y’;

    is the code I type at the mysql prompt????

  44. Mark (post author) |

    Yes. Or on PHPmyAdmin’s “SQL” tab.

  45. Bilal |

    Great plugin!
    Thanks a lot. :)

  46. Ken Savage |

    Mark thank you that SQL command worked perfectly. Now we’re all subscribed to everything we’ve posted to in the past.

  47. bobby |

    hmmm, can’t get it to work, anybody else having trouble?

  48. KoZ |

    Hello ! Congralutations and many thanks for developing this plugin. I really wanted make subscriptions possible… and this plugin is so easy to install ! Thanks !

  49. Alan Cooper |

    Is it possible to subscribe an email address to all comments on all posts?

  50. Stefan |

    Thank you so much for the plugin! I installed it and I’m able to subscribe to a comment using an old email, but I don’t see where the subscription manager comes up to allow me to unsubscribe. I’ve uploaded the php file into my root directory… any ideas/suggestions?

    thanks again!

  51. Mark (post author) |

    Stefan,
    It looks like you hardcoded the “subscribe” checkbox into your comments form. Don’t do that. Use <?php show_subscription_checkbox(); ?> instead. Or better yet, install the hook in your comment form that is missing:
    <?php do_action('comment_form', $post->ID); ?>

    Then, the subscribe checkbox will turn into a link to the subscription manager. Also note that subscribers will get the link at the bottom of every single notification e-mail, for easy unsubscription.

  52. Stefan |

    thanks Mark - I uploaded the original comment.php file. I don’t even remember hardcoding, but maybe its from an earlier or different subscribe plugin. Anyway, does the go inside the form tags? I tried both inside and out and get this error message:

    Fatal error: Call to undefined function: show_subscription_checkbox() in /home/stefan/public_html/wp-content/themes/BlueTan/comments.php on line 72

    Something stupid on my part I’m sure. I double-checked to make sure I had the plugin activated. It might be best for me to just delete all files and re-upload. I had some older versions of things and also some files from scriptygoddess too.

    Thoughts?

  53. Mark (post author) |

    Stefan, if you’re getting that error, you either didn’t activate the plugin, have the wrong plugin, or have a corrupted plugin.

    I’d delete, download, and upload again.

  54. Stefan |

    Thanks for your help today, Mark. It may have been a mix up between the old old old version and your newer version. I did just delete all of the files and then unpacked the zip again and uploaded. It is working great now.

    Thanks again!

  55. lafrance |

    great plugin Is it possible to make it more visual impair in next version ?

  56. umesh_joshi@spanners4us.com |

    Thanks for your help today, Mark. It may have been a mix up between the old old old version and your newer version. I did just delete all of the files and then unpacked the zip again and uploaded. It is working great now.

    Thanks again!
    umesh_joshi@spanners4us.com

  57. Visa |

    This may be a temporary problem, but the download URL http://txfx.net/wp-plugins.org/subscribe-to-comments/download/ which redirects to http://downloads.wordpress.org/plugin/subscribe-to-comments.zip throws an error 500 after trying to load the file. Is there a mirror available?

  58. Visa |

    Now the download seems to be working fine again.

Comment pages: « 1 [2] 3 4 5 6 7 8 9 10 1145 »

Leave a Reply