WordPress.org

Ready to get started?Download WordPress

Forums

Help with Auto-close comments (23 posts)

  1. gt
    Member
    Posted 9 years ago #

    I searched the forum and read the wiki. I don't think I'm doing it right. I am trying to install the plugin for auto-close comments. I don't know anything about scripts. I just followed the instructions and copied the non-cron script example on the site. I changed the first instance of "age-cutoff." It hasn't worked. Am I supposed to change it everywhere? What am I doing wrong? Help, spam is killing me on past posts.

  2. gt
    Member
    Posted 9 years ago #

    ^bump. Anyone?

  3. charle97
    Member
    Posted 9 years ago #

    did you activate the plugin?

    also look into installing wp hashcash.

  4. gt
    Member
    Posted 9 years ago #

    Yes, I activated the plugin. Any other thoughts? I will give hashcash a try if it's not too difficult to install. Thanks!

  5. charle97
    Member
    Posted 9 years ago #

    what did you do to test if auto close works? the plugin doesn't really auto close comments once the post hits the specified age. the plugin is triggered while doing one of a few normal administrative tasks, at which time the age of posts is checked. one of the triggers is editing a post, so you can edit a post and hit save. it doesn't matter if you changed anything or not. you just want to see if comments close on a few posts. if that doesn't work, you'll probably need to be more aggressive with the age cutoff. set it to 1, edit a post, and see what happens then.

  6. gt
    Member
    Posted 9 years ago #

    I did what you said. I edited a post and set the cutoff to 1. I tried to post a month old post and it still let me. I also installed wp-hashcash and apparently I'm not skilled in getting that right because I got hit with more spam. Any other ideas? Thanks for the help so far.

  7. gt
    Member
    Posted 9 years ago #

    Oh, another thing is, am I doing it write by cutting and pasting the sample script off the auto-close comment plugin and then uploading it to the respective drive? Thanks.

  8. Mark (podz)
    Support Maven
    Posted 9 years ago #

    The plugin:
    Copy everything from <?php to ?>
    Paste into notepad
    Save as 'autoclose.php'
    Upload to /plugins
    Activate

    You doing that ?

  9. gt
    Member
    Posted 9 years ago #

    Podz,

    I didn't have it saved as 'autoclose.php' It was saved as 'closedcomments.php' I will give it a try with that. But, I basically copied everything like on the plugin page:

    <?php
    /*
    Plugin Name: Auto-Close Comments
    Version: 0.1
    Plugin URI: http://wiki.wordpress.org/Auto%20shutoff%20comments
    Description: Autoclose comments after XX number of days without a cron job
    Author: Scott Hanson
    Author URI: http://www.papascott.de/
    */
    function autoclose_comments() {
    global $wpdb, $tableposts;
    // Set $age_cutoff to the age at which a post should become stale
    $age_cutoff = '15 DAY';
    $cutoff_date = $wpdb->get_var ("SELECT DATE_ADD(DATE_SUB(CURDATE(), INTERVAL $age_cutoff), INTERVAL 1 DAY)");
    $wpdb->query ("UPDATE $tableposts SET comment_status = 'closed' WHERE post_date < '$cutoff_date' AND post_status = 'publish'");
    }
    add_action('publish_post', 'autoclose_comments', 7);
    add_action('edit_post', 'autoclose_comments', 7);
    add_action('delete_post', 'autoclose_comments', 7);
    add_action('comment_post', 'autoclose_comments', 7);
    add_action('trackback_post', 'autoclose_comments', 7);
    add_action('pingback_post', 'autoclose_comments', 7);
    add_action('edit_comment', 'autoclose_comments', 7);
    add_action('delete_comment', 'autoclose_comments', 7);
    add_action('template_save', 'autoclose_comments', 7);
    ?>

    That's exactly what it is on the plugin page except for the interval. Is that right?

  10. gt
    Member
    Posted 9 years ago #

    Oh, there are appropriate spaces in the above. I just pasted it there like that.

  11. petiteanglaise
    Member
    Posted 9 years ago #

    I had the opposite problem with this plugin on my site. When activated, I get only error messages when I try to make a new comment on the most recent post. The older posts were closed to comments though.

    In the end I had to activate it then deactivate it (the closed comments stayed closed) to permit commenting on my most recent posts.

    Wierd.

  12. kitchie
    Member
    Posted 9 years ago #

    I get the same error. It says header alerady sent. I'm using WP 1.2.2

  13. kitchie
    Member
    Posted 9 years ago #

    Bump

  14. gt
    Member
    Posted 9 years ago #

    I can still leave a comment on older posts. Arrrgh! So frustrating.

  15. petiteanglaise
    Member
    Posted 9 years ago #

    When I go to older posts I can't leave a comment. But the spammers can!!! I've just had a flood of them on old posts. Very frustrating.

    I also can't get Kitten's spam words running on 1.2.2 - the delete as spam button has disappeared from admin altogether.

    When I activate spam karma on the other hand, regardless of changes I make to the set up page, everything gets moderated. Even my own comments when I'm logged in as admin.

    Grrrrrrrrrrr

  16. kitchie
    Member
    Posted 9 years ago #

    Bumping this topic

  17. Mark (podz)
    Support Maven
    Posted 9 years ago #

    There seem to be different issues from people here:

    kitchie: Do a search here for 'whitespace'

    petiteangliase: The spammers are leaving trackbacks, not comments. Check my spam page for some possible solutions.

    gt: any errors reported ? tried changing the '15 DAY' ? Link to your site ?

    This is getting a very complex thread. By all means continue here, but please do describe your problems as fully as possible - a "me too" is impossible to help with.

  18. gt
    Member
    Posted 9 years ago #

    Podz,

    I changed the interval to "1" I then followed what charlie said up top and edited a post. It still let me post on older posts. Does it make a difference if I'm using popup comments? My website is www[dot]gtquandary[com]/wordpress

  19. gt
    Member
    Posted 9 years ago #

    ^bump

  20. autumnqiu
    Member
    Posted 9 years ago #

    Just a question regarding this plugin. I activated this plugin and so far, all my old posts have the words "Sorry, comments are closed at this time" showing up instead of the comment form.

    So this means that spammers are unable to leave any comments on these posts even though they have access to the wp-comments-post.php file, right?

  21. Mark (podz)
    Support Maven
    Posted 9 years ago #

    @gt - that should not make a difference. It should show a "Comments closed" type message.

    @autumnqui - comment spamming is sorted, yes but trackback spamming is not. TB spamming uses a different route through WP code. Have a look at the section here on that:
    http://www.tamba2.org.uk/wordpress/spam

  22. autumnqiu
    Member
    Posted 9 years ago #

    podz: Okay! Thank you so much! :P

  23. gt
    Member
    Posted 9 years ago #

    Podz,

    I am out of ideas. Thanks for the help so far. Any other ideas? Did I do the install correctly? I hate spam!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.