WordPress.org

Ready to get started?Download WordPress

Forums

Anti-spam
[resolved] Error posting comments (25 posts)

  1. juventuz
    Member
    Posted 1 year ago #

    When logged in I can comment without an issue, but when not logged in, or when readers are wanting to comment the following error occurs.

    Go back and try again.
    Error: answer is wrong.
    Error: field should be empty.

    http://wordpress.org/extend/plugins/anti-spam/

  2. webvitaly
    Member
    Plugin Author

    Posted 1 year ago #

    Submit url with the problem via feedback form and I will check it.

  3. juventuz
    Member
    Posted 1 year ago #

    Here is a link to the dev version of our site where the plugin is activated.

    Now we get the error...

    Go back and try again.
    Error: answer is wrong. [Current month ye@r day*]
    Error: field should be empty. [Leave this field empty*]

    I deleted the old plugin, and uploaded the latest version 1.6

  4. juventuz
    Member
    Posted 1 year ago #

    I apologize, I left the link out... try here http://dev.8bitsoul.com/gears-of-war-judgement/

  5. webvitaly
    Member
    Plugin Author

    Posted 1 year ago #

    Anti-spam plugin has conflict with javascript from "Origin" theme.

    The Anti-spam plugin answer question about current year instead of user via javascript.

    You use the theme where text from label inserted into input value and works like placeholder.

    So javascript from your theme (custom.js) inserts into anti-spam inputs text from labels and it breaks the work of Anti-spam plugin.

    This code does it:

    $comment_form.find('input:text, textarea').each(function(index,domEle){
    			var $et_current_input = jQuery(domEle),
    				$et_comment_label = $et_current_input.siblings('label'),
    				et_comment_label_value = $et_current_input.siblings('label').text();
    			if ( $et_comment_label.length ) {
    				$et_comment_label.hide();
    				if ( $et_current_input.siblings('span.required') ) {
    					et_comment_label_value += $et_current_input.siblings('span.required').text();
    					$et_current_input.siblings('span.required').hide();
    				}
    				$et_current_input.val(et_comment_label_value);
    			}
    		}).bind('focus',function(){
    			var et_label_text = jQuery(this).siblings('label').text();
    			if ( jQuery(this).siblings('span.required').length ) et_label_text += jQuery(this).siblings('span.required').text();
    			if (jQuery(this).val() === et_label_text) jQuery(this).val("");
    		}).bind('blur',function(){
    			var et_label_text = jQuery(this).siblings('label').text();
    			if ( jQuery(this).siblings('span.required').length ) et_label_text += jQuery(this).siblings('span.required').text();
    			if (jQuery(this).val() === "") jQuery(this).val( et_label_text );
    		});
    
    		// remove placeholder text before form submission
    		$comment_form.submit(function(){
    			$comment_form.find('input:text, textarea').each(function(index,domEle){
    				var $et_current_input = jQuery(domEle),
    					$et_comment_label = $et_current_input.siblings('label'),
    					et_comment_label_value = $et_current_input.siblings('label').text();
    
    				if ( $et_comment_label.length && $et_comment_label.is(':hidden') ) {
    					if ( $et_comment_label.text() == $et_current_input.val() )
    						$et_current_input.val( '' );
    				}
    			});
    		});

    You can fix it by excluding anti-spam inputs from being processed via javascript placeholder script.

  6. juventuz
    Member
    Posted 1 year ago #

    I'm sorry, but I'm not that familiar with js. How would I go about excluding anti-spam inputs from being processed via javascript?

  7. webvitaly
    Member
    Plugin Author

    Posted 1 year ago #

    I tried to fix it via js but have no luck.

    So the easiest solution for you is to fix it via plugin patch.
    I made special version of anti-spam plugin for your case. Let me know if it worked.

    https://mega.co.nz/#!gYpRBK6C!ZYmfiRsrzfRA4MUOWGmRrHKy2wBbNxHUK2VXBgv2-IY

  8. simplefinanz
    Member
    Posted 1 year ago #

    Hi Vitaly,

    I have same issue on my site, for example check page below:
    http://simplefinanz.com/apple-earnings-release-q2-2013/

    Tried your latest special version as well, without success.

    Many thanks in advance for the help.

  9. webvitaly
    Member
    Plugin Author

    Posted 1 year ago #

    @simplefinanz: I cannot see hidden Anti-spam inputs on your site in comments form.
    Anti-spam plugin use 'comment_form' action and I think it is missed somehow in your theme.
    You may check out how 'comment_form' action used on other themes with custom comments form (instead of default comment_form() function) and do the same with your theme.

    Or just try to add this code to comments.php file before closing form-tag:

    <?php
    	do_action('comment_form()', $post->ID); // comment_form();
    ?>
  10. simplefinanz
    Member
    Posted 1 year ago #

    Tried adding the code, same error:
    Error: empty answer. []

    I have disabled the plugin until finding a solution.

  11. webvitaly
    Member
    Plugin Author

    Posted 1 year ago #

    @simplefinanz:

    Error: empty answer. []

    "Empty answer" means that you don't have anti-spam inputs in your comments foorm. At the end of the form should be such html block:

    <p class="comment-form-anti-spam" style="clear:both;">
    		<label for="anti-spam-q">Current <span style="display:none;">month</span> <span style="display:inline;">ye@r</span> <span style="display:none;">day</span></label> <span class="required">*</span>
    		<input type="hidden" name="anti-spam-a" id="anti-spam-a" value="2013" />
    		<input type="text" name="anti-spam-q" id="anti-spam-q" size="30" value="1980" />
    	</p>
    
    	<p class="comment-form-anti-spam-2" style="display:none;">
    		<label for="anti-spam-e-email-url">Leave this field empty</label> <span class="required">*</span>
    		<input type="text" name="anti-spam-e-email-url" id="anti-spam-e-email-url" size="30" value=""/>
    	</p>

    Sorry, I think I told you to add the wrong code.
    Try to add this code to the end of your comments form:

    <?php do_action('comment_form', $post->ID); ?>
  12. juventuz
    Member
    Posted 1 year ago #

    webvitaly... I uploaded the new file you made for me. Unfortunately it didn't work, the submit button no longer works once the plug-in is activated. I can fill out the comment form, but submit is not clickable. Once I turn off the plugin it works.

  13. webvitaly
    Member
    Plugin Author

    Posted 1 year ago #

    @juventuz:

    I think I know where I made a mistake.

    Please, try this one: https://mega.co.nz/#!gVQ3nZCB!N7gYeQV9CkIyWXzBlFM5RjFxK6gr9KMUGGrSleWt_B4. I hoppe this version will work for you.

  14. juventuz
    Member
    Posted 1 year ago #

    Thank you for your help. It works! I really appreciate you taking the effort to fix the issue.

    Thanks again!

  15. webvitaly
    Member
    Plugin Author

    Posted 1 year ago #

    @juventuz:

    You are welcome.

    Just remember that you use separate branch version of Anti-spam plugin (because of conflicts with your theme) and it will not update from official repository. But don't be afraid, it will block spam pretty good as main version.

    If you will switch theme on your site than you may re-install Anti-spam plugin and you will be up-to-date.

  16. a.po123
    Member
    Posted 1 year ago #

    Hello webvitaly
    i'ha just installed your plug in into this website http://armadiosemprevuoto.com
    but when i try to comment a post it gives me the same error of juventuz:
    Error: answer is wrong. [Current month ye@r day*]
    Error: field should be empty. [Leave this field empty*]

    by the way, i tried even with the version you mentioned above but no way.. always the same error..

    right now i need the comments to be active, so i need to deactivate the plugin, could you help me anyway?

    thanks in advance

  17. webvitaly
    Member
    Plugin Author

    Posted 1 year ago #

    @a.po123: You could submit the link to your theme (where I could download it) and I will check it - http://web-profile.com.ua/feedback/

  18. a.po123
    Member
    Posted 1 year ago #

    Hi webvitaly

    in the url you gave me, i have just sent you a link where download our used theme

    Thanks in advance again

  19. webvitaly
    Member
    Plugin Author

    Posted 1 year ago #

    @a.po123: I got your message and I installed your theme.
    You have similar problem with theme javascript as prev user (juventuz).

    Your theme inserted text from the label into nearest text input and it breaks the work of anti-spam plugin.

    I made forked version of the plugin for you.
    Try it and please write me back if it helped.

    https://mega.co.nz/#!1Ehl0SKb!f_tdf0-tt5YO8miET7Sr8FuXpVsYvhdLDupV7EvdYoY

  20. bitofgrace
    Member
    Posted 11 months ago #

    Hi Webvitaly :)

    Looks like there are a bunch of themes out here that don't play nice with your plugin... im sorry to bother you - but Sommerce by YIThemes looks like its one of them.
    Can you check mine out and see if it can be resolved too?
    http://poochie-pets.net

    I'm getting the error of
    Go back and try again.
    Error: answer is wrong. [1980]

  21. webvitaly
    Member
    Plugin Author

    Posted 11 months ago #

    @bitofgrace: Sorry, but I cannot find comment form on your site to test it.
    But from an error I could tell that anti-spam fields were included into the form but javascript did not worked. That means that js error happened or js-file were not included into the page.

  22. bitofgrace
    Member
    Posted 11 months ago #

    Thank you so much for looking into it webvitaly -
    In this theme it has Woocommerce - so the "comments" are actually product "Reviews" and include the star rating.

    Your plugin works fantastically for eliminating the spam that floods in every day through review! :)

    There is a bit of js on the page templates already - can you tell me how/where to look for the problem? Or is it not possible to use this for this kind of theme?

  23. webvitaly
    Member
    Plugin Author

    Posted 11 months ago #

    @bitofgrace: Now I got it.
    I tried to submit a comment and it passed thru, but I am not sure if Anti-spam plugin was activated right now.
    I did not tested it fully with Woocommerce and I cannot tell for sure.
    You may try to install Anti-spam plugin, activate it and try to submit review while being logged out. If you will not see an error - it means it is working.
    If you will see an error - try to search a solution in other Support sections, maybe it was been resolved.

  24. bitofgrace
    Member
    Posted 11 months ago #

    Hi again- yes i had to turn it off to allow comments from customers : /

    What is the problem that i should be searching for solution for ?
    You mentioned "js error happened or js-file were not included into the page." What should i be trying to fix?

  25. webvitaly
    Member
    Plugin Author

    Posted 11 months ago #

    @bitofgrace: Anti-spam plugins adds two extra hidden text inputs into the comment form. Both are hidden in css, but exists in the html code of the form.
    If you will use developer tools and unhide them - you will see them.
    First input should have current year as value. This value is set by anti-spam javascript. Second input should be empty. Both inputs should be submitted via form and on the server anti-spam plugin scripts checks the value of this inputs. This is how Anti-spam plugin works.

    So you should check the existence of these inputs and their values (year and empty).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.