• Resolved dugost

    (@dugost)


    Hi,

    I just tried your plug-in for the first time and have it implemented successfully. I’ve been tweaking it to fit my layout without any problems except I noticed something odd with the password field (before and after I tweaked the layout).

    On one post, the password appears just fine in the copy field but on another nothing is showing up at all. I’ve checked this in a few browsers, all with the same results.

    Password showing up:
    Post with Password

    No password showing up:
    Post without Password

    And when I try to submit a comment for the post where the password doesn’t appear, I still get the message “Click back and type in the password”.

    Any ideas?

    https://www.ads-software.com/extend/plugins/spam-free-wordpress/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Todd Lahman

    (@toddlahman)

    The changes you are making are causing the password issue. The wrong placement of a single or double quote could disable another part of code if you aren’t careful when making these types of modifications. The variable called $sfw_comment_form_password_var is what you have disabled in this case. You need $sfw_comment_form_password_var to fetch the password, and of course you can’t submit a test comment with no password because the plugin will work regardless.

    The fix is to start again with the original code in the tl_spam_free_wordpress_comments_form function, then either try the modifications, or just leave them unmodified.

    Thread Starter dugost

    (@dugost)

    Thanks for checking that out so quickly, Todd. I just wanted to mention again that the problem existed before I did any tweaks to layout/code. I did what you suggested, though, and just deleted the plug-in and re-installed it with the original code.

    If you check out those two links again, you’ll see that the problem still exists with the unedited field layouts/css styling. One post has a password while another doesn’t, for some strange reason.

    I also double-checked my tweaked code and can’t see any issue with incorrect single or double-quotes:

    // Reader must enter this password manually on the comment form
    		echo "<div class='formelement spamfree'>
    			<label>Copy this password<abbr title='Required'>*</abbr></label>
    			<input type='text' value='".$sfw_comment_form_password_var."' onclick='this.select()' size='".$sfw_pw_field_size."' />
    			</div>";
    		echo "<div class='formelement spamfree'>
    			<label>Type or paste password here<abbr title='Required'>*</abbr></label>
    			<input type='text' name='passthis' id='passthis' value='".$comment_passthis."' size='".$sfw_pw_field_size."' tabindex='".$sfw_tab_index."' />
    			</div>";

    I’m stumped and thought I should bring it to your attention.

    Plugin Author Todd Lahman

    (@toddlahman)

    The issue is theme related. Try a different theme, then see if the password loads for both posts in the form.

    You can also edit each post and look under Custom Fields to see if the Name sfw_comment_form_password exists with a password for each post.

    Thread Starter dugost

    (@dugost)

    Ok, now I remember that a password gets applied to a custom field in the post itself. When I checked the problem post, it had none. I previewed the site with another theme (didn’t activate it) to quickly look but the form didn’t have the spam free portion displaying. I was about to go update the other theme’s comment template as a test but after going back to view the post on the front end a password had appeared!

    I’m assuming that either WP auto-saved the post and then inserted the password or previewing the post in the other theme forced a password into the custom field. In any case, it’s working now. Just some weird quirk and now I have the form tweaked as needed with a working password.

    Thanks for your time! ??

    Plugin Author Todd Lahman

    (@toddlahman)

    That confirms it is a theme related issue.

    Glad it is working for you now.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Spam Free WordPress] Password to copy not appearing consistently’ is closed to new replies.