Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1118434

    I have a contact form on my site that looks just fine except that the submit button doesn’t do anything when I press it. There is no form validation and no email sent. But even if I leave all required fields blank, they are not highlighted. This is a new problem for me on version 4.5.7. I have a site on 4.4.1 whose contat form works just fine.

    I did try deleting and recreating the form, but it acts the same way.

    Any ideas?

    #1118539

    Hey osaez,

    Can you disable caching and minification for now?

    Best regards,
    Victoria

    #1118545

    I turned off CSS and JS merging and compression (what I think you meant by minification) and no change.

    I had this problem before I had any caching, as well, but I turned that off, again, and no change.

    Any other ideas? This is really odd… simply nothing happens!

    Thanks!

    #1118546

    OK… I found something… I turned OFF reCAPTCHA and now it works. So… how do I debug why that’s not working? I have an account, set up my keys and such but it seems to not be working. Is there anything on the server that could help em determine what’s wrong?

    To be clear, I see no sessions on my ReCAPTCHA account on Google. So it seems nothing is getting there.

    Thanks!

    • This reply was modified 5 years, 5 months ago by osaez.
    #1118583

    OK… this is getting stranger. If I turn off caching and minification, when I go to the site for the first time in a new browser window, the reCAPTCHA shows up. But even without typing anything, if I refresh the page, the reCAPTCHA disappears and the Submit button is back and non-functional. Only closing that window and reopening it will bring the reCAPTCHA back.

    #1118661

    Hi,

    Did you set jQuery to load in the footer? We can see a few jQuery errors in the console, which seems to be related to another plugin. Is “ct_fkp_” familiar to you?

    Best regards,
    Ismael

    #1118808

    Hey,

    I have a similar problem. I have a contact form in the footer. With Google Recaptcha enabled it doesn’t do anything after clicking the submit button.
    I traced the error a bit and came to the following insights:
    – no JavaScript errors in the console
    – the required JavaScript for Recaptcha isn’t placed in the DOM
    – if another contact form is placed in the main content of a page the footer contact form also works, because the main content contact form placed the required JavaScript
    – in the class-grecaptcha.php file line 271/272 the regex $regex = "!\[av_contact!"; preg_match( $regex, $post->post_content, $matches ); evaluates to false

    I haven’t looked any further into the problem as to why this is, but I hope this helps in any way to fix the issue for me and others.

    Regards,
    Daniel

    #1119025

    Yes, it is a bit fickle. It seems to be working well for me, today. But it’s 100% broken using Microsoft Edge (which is a minor issue, but I test with lots of browsers). I think I’m going to let this be for a while as I have more pressing issues, but I’ll keep my eye on it.

    To the previous question from Ismael, no “ct_fkp_” is not familiar to me (but not much of this is as I inherited it from the previous administrators). My main tasks have been to upgrade the server, WP and Enfold to get things “modern.” There are just a few lingering issues, like this.

    Thanks!

    #1119441

    Hi,

    @xoidberg: Thanks for the info. You can actually remove that code because what it does is prevent the recapcha script from loading when there is no contact form element in the page. Try to replace the whole is_recaptcha_active function with the following code.

    		public function is_recaptcha_active() {
    		    global $post;
    
    		    if( ! $post instanceof WP_Post ) {	
    		        return false;	
                        }
    
    		    $api_vn = $this->api_vn;
    
    		    if( $api_vn == '' ) return false;
    
    		    $secret_key = $this->get_secret_key();
    		    $public_key = $this->get_public_key();
    
    		    return $public_key && $secret_key;
    		}
    

    @osaez: We are going to include a new and better version of the spam protection in the next patch. Please wait for that. If you want to test it now, check the private field.

    Best regards,
    Ismael

    #1119566

    Hey,


    @Ismael
    Thanks for your reply. However, your provided code does not work at all. Now my regular contact form in the page does not work, because recaptcha is not loaded anymore.
    I looked through your provided code and does not unterstand why you scan for widgets and then look for a contact form in them. This does not make sense to me. I have a newsletter contact form in the footer area, but not as a widget. And on my contact page my contact form is in the main content.
    I think the previous original code was fine that it looks for a contact form in the page. However, in addition it should also look for one in the footer area as $post->post_content apparently does not include the footer area.
    As a workaround I reverted to the original code and removed the regex check. This means, that recaptcha is loaded on every page, but my newsletter contact form is displayed on every page anyway.
    I hope this gets a proper fix in the future.

    Regards,
    Daniel

    #1119834

    Hi,


    @xoidberg
    : I forgot to remove the widget scan. I edited the code a bit. If you want to test the latest version of the spam protection, create your own thread and I’ll post the link to the beta or silent version.

    Best regards,
    Ismael

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.