WordPress.org

Ready to get started?Download WordPress

Forums

Disqus Comment System
DISQUS disregarding per-post comments allowed setting (11 posts)

  1. archon810
    Member
    Posted 2 years ago #

    DISQUS is completely disregarding the setting to disable comments on specific posts, showing the comment entry box in both old and new DISQUS (2012).

    For instance, http://www.androidpolice.com/2011/12/17/new-game-pirates-of-the-caribbean-master-of-the-seas-hits-the-android-market-finally-allowing-us-to-plunder-the-high-seas-from-the-comfort-of-home - I closed comments because people were posting their usernames, asking to be added to the buddy system, which would give them gold, or something equally as annoying, and I closed comments, yet the box is still there, and I'm now getting comments on that post again (we just went live with DISQUS yesterday).

    Here's the debug info for the plugin (with some stuff snipped):

    URL: http://www.androidpolice.comPHP Version: 5.3.9Version: 3.3.1Active Theme: ap1 URLOpen Method: curl
    Plugin Version: 2.72
    Settings:
    dsq_is_installed: 1
    _disqus_sync_lock:
    _disqus_sync_post_ids:
    disqus_active: 1
    disqus_public_key:
    disqus_secret_key:
    disqus_forum_url: androidpolice
    disqus_api_key: snip
    disqus_user_api_key: snip
    disqus_partner_key:
    disqus_replace: all
    disqus_cc_fix: 1
    disqus_manual_sync:
    disqus_disable_ssr:
    disqus_last_comment_id: 498695025
    disqus_version: 2.72

    http://wordpress.org/extend/plugins/disqus-comment-system/

  2. Disqus Community Support
    Member
    Posted 2 years ago #

    Hi Artem,

    To clarify, did you close comments in WordPress or in Disqus itself?

    - If the former, would you kindly verify that the post is closed in the Edit Post window? See http://en.support.wordpress.com/enable-disable-comments/ for more on that. Mainly what we're looking for is to make sure the "Allow Comments" checkbox is no longer enabled.

    (I realize you likely already know all of this; these links are mostly to make sure we've covered all the bases and also for posterity.)

    - If the latter, have you tried clicking the Settings icon at the top of the embed (while not using Disqus 2012) > clicking "Close thread"?

    Best,

    Tyler

  3. archon810
    Member
    Posted 2 years ago #

    Tyler, I closed it in WP by clicking the very same checkbox you're talking about and unchecking it.

    Closing directly in the Disqus form does work fine. However, the above should be working instead.

  4. archon810
    Member
    Posted 2 years ago #

    Tyler, I looked through the code, and I'm not sure I follow its logic.

    What is the expected result here? I would expect to see a Disqusified comment list with the exact same words "Comments are closed" as you'd get if you closed comments from within Disqus.

    Looking through the code, I have a suspicion that instead the intention is to not load Disqus at all and rather show the theme's comment template instead. I may be missing some logic, but the functions I was looking at are dsq_comments_template() and dsq_can_replace().

    Specifically, I verified that $post->comment_status in dsq_comments_template() returns "closed" correctly. The logic then doesn't enter either if statement and proceeds to set $EMBED=true (see below, I added a few debug statements, out of which only dsq1 was printed).

    The code enters dsq_can_replace() in the 2nd if clause and returns true at else if ( 'all' == $replace ) { return true; } meaning Disqus can indeed replace and the form is embedded.

    This is confusing behavior, but then again, I'm not sure what the end result should be - in my opinion the correct logic should be to pass an additional parameter to the JS form that embeds comments which would then disallow showing of the comment entry field but otherwise show all the comments from Disqus and *not* the local db.

    If the idea behind the logic is indeed what I think it is now, the theme comments would be shown which means comments from the local database, which can be vastly out of sync compared to Disqus due to moderation, editing, spamming, etc. Either way, neither behavior is happening, and the Disqus form shows itself with an open comment box.

    If you need to take a look at all the variables (including disqus_replace = all), I pasted them in the original report.

    // ugly global hack for comments closing
    $EMBED = false;
    function dsq_comments_template($value) {
        global $EMBED;
        global $post;
        global $comments;
    error_log("dsq1: " . $post->post_title . " " . $value . " " . $post->comment_status);
        if ( !( is_singular() && ( have_comments() || 'open' == $post->comment_status ) ) ) {
    error_log("dsq2: " . $post->post_title . " " . $post->comment_status);
            return;
        }
    
        if ( !dsq_is_installed() || !dsq_can_replace() ) {
    error_log("dsq3: " . $post->post_title . " " . $post->comment_status);
            return $value;
        }
    
        // TODO: If a disqus-comments.php is found in the current template's
        // path, use that instead of the default bundled comments.php
        //return TEMPLATEPATH . '/disqus-comments.php';
        $EMBED = true;
        return dirname(__FILE__) . '/comments.php';
    }
  5. Disqus Community Support
    Member
    Posted 2 years ago #

    Hi Artem,

    We're looking at the same things and coming to similar conclusions. My hunch is that the logic for how/when to replace comments simply needs a bit of updating.

    As for Disqus disregarding equivalency of comment status (either enabled or disabled) in WP itself, this was never how the plugin was meant to be used. Once the plugin is installed, comment threads should be moderated in all senses via the plugin itself and its functionalities; in this case that means the plugin was designed with the assumption that comment threads would be opened/closed in Disqus itself. Fragmenting moderation actions is something we try to avoid and, if anything, we're looking to make the plugin feel more native.

    We're still discussing how this could be implemented but the bottom line is we want the overall UX to be more obvious, elegant, and easy. In the meantime you'll want to continue closing comment threads via Disqus itself.

    Thanks,
    Tyler

  6. archon810
    Member
    Posted 2 years ago #

    Tyler, I'm sorry but the 2nd part of your answer directly contradicts what's written here: http://docs.disqus.com/help/18/

    Specifically: "Using the WordPress plugin?
    Disqus will respect the WordPress settings with regards to closing comment threads.
    If you're using WordPress, you can close comments by disabling comments for each post, or setting an Automatic closing timer in your WordPress discussion settings."

    Imagine a blog with 500 closed comments - you can't expect people to close them all manually in Disqus one by one, can you? I mean, that's specifically what the document above is addressing. This functionality is broken.

  7. Disqus Community Support
    Member
    Posted 2 years ago #

    I just posted a comment on a pull request along these same lines too, which may be of interest: https://github.com/disqus/disqus-wordpress/pull/1#issuecomment-5166286

    Tyler

  8. archon810
    Member
    Posted 2 years ago #

    Tyler, I'm not sure that solution in the comment on that request would be ideal either - I've just replied there with my thoughts. Here they are, for posterity:

    Tyler, what you're saying is better, but if the close action is fired from WordPress upon closing comments, that means existing closed comments wouldn't be supported by this if you've migrated to Disqus after having an established comment base.

    Disqus should perhaps try to detect whether a given post has comments closed in WP but not in Disqus, and if they're not closed on the remote side, issue a close action. Not sure what the best way is, but simply setting a flag that gets passed to the JS form would be a good start. The problem is, spammers can figure this out and unset the flag, unless you have a security mechanism in place that uses hashed API secret/key to pass parameters to the form.

  9. Disqus Community Support
    Member
    Posted 2 years ago #

    Thanks Artem. As I said I think that is due to some logic that needs cleaning up. I believe the plugin used to simply not render at all when comments were closed in WP itself and that is somehow now no longer the case (as you also pointed out). This has presented us with an opportunity to step back and take a larger look at what the integration should be and what's feasible (see my previous pull request comment).

    In other words, this is now part of a larger discussion and rest assured the issue will be fixed either way in the next plugin release.

    Thanks again,
    Tyler

  10. Disqus Community Support
    Member
    Posted 2 years ago #

    I'll respond to your second thought in the pull request.

    Tyler

  11. archon810
    Member
    Posted 2 years ago #

    That's great to hear that all of this is not in vain and movement will be made. What I keep finding though is that DISQUS features that are supposed to work are broken as if there is no QA in place for releases, and that's making me nervous. I can't even imagine how much I'm going to need to test every plugin update before my paranoia is satisfied. I think you can understand why, given how much time was spent on our integration, you know?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic