Support » Plugin: Subscribe2 » [Plugin: Subscribe2] Allow subscriptions from the comment form not working

Viewing 9 replies - 1 through 9 (of 9 total)
  • @ellyn,

    I’ve just tested this on my site and it works for me.

    The only thing that might need explained is if the comment is in moderation. If the comment is there then the subscription is held until the comment is approved. This was done to avoid administrators have to erase spam email addresses from the public subscriber database in the event that anti-spam measures were not used or temporarily non-functional.

    How should it behave it comments are not held for moderation?

    Just to be clear, here are the WP Discussion Settings:

    Other comment settings
    checked Other comment settings Comment author must fill out name and e-mail
    unchecked Users must be registered and logged in to comment

    E-mail me whenever
    E-mail me whenever Anyone posts a comment
    A comment is held for moderation

    Before a comment appears
    unchecked Before a comment appears An administrator must always approve the comment
    unchecked Comment author must have a previously approved comment


    If comments are instantly approved (as would appear the case from your settings), then provided the email address given is not already subscribed and the box is checked it should be automatically added as a public subscriber.

    I’ll check this again later after duplicating your settings.

    I also just tested this again after upgrading to 7.1 and still don’t see the subscriber listed in s2/subscribers.


    Thanks for persisting and posting the information I needed. I’ve tracked it down and fixed it now.

    If you want to apply the fix yourself open up the subscribe2.php file in a text editor and find the s2_comment_meta() function. Replace what’s there with this:

    function s2_comment_meta($comment_ID, $approved) {
    		if ( $_POST['s2_comment_request'] == '1' ) {
    			global $wpdb;
    			$sql = "SELECT comment_author_email, comment_approved FROM $wpdb->comments WHERE comment_ID='$comment_ID' LIMIT 1";
    			$comment = $wpdb->get_row($sql, OBJECT);
    			if ( empty($comment) ) { return $comment_ID; }
    			switch ($approved) {
    				case '0':
    					// Unapproved so hold in meta data pending moderation
    					add_comment_meta($comment_ID, 's2_comment_request', $_POST['s2_comment_request']);
    				case '1':
    					// Approved so add
    					$is_public = $this->is_public($comment->comment_author_email);
    					if ( $is_public == 0 ) {
    					$is_registered = $this->is_registered($comment->comment_author_email);
    					if ( !$is_public && !$is_registered ) {
    				default :


    Oh yes and you’ll also need to look for this line”
    add_action('comment_post', array(&$this, 's2_comment_meta'), 1);

    And change it to:
    add_action('comment_post', array(&$this, 's2_comment_meta'), 1, 2);

    Any chance you can give me line numbers or send your updated code?

    The function to replace starts at lone 3305 in subscribe2.php if you are using version 7.1. The add_action() line is on 4001.

    Hi MattyRob,

    Thanks for the line numbers. I tested it fairly extensively and it functioned as I would think it should. That did the trick, and now subscriptions from comments are working! Thank you very much.

    BTW, I am also using the plugins Subscribe to Comments Reloaded and Theme My Login, should anyone else be interested in their compatibility, and they are compatible.


Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Subscribe2] Allow subscriptions from the comment form not working’ is closed to new replies.