Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Arlind Nushi

    (@arl1nd)

    Hi @andrewsupport

    Here I will describe in details what happens:

    I use captcha in my contact form (which is standalone and not uses any lib)

    To add support for custom contact form, I have added this PHP:

    function kalium_contact_form_recaptcha_support( $forms ) {
    	$forms['kalium-contact-form'] = [
    		'form_name' => 'Kalium Contact Form',
    	];
    
    	return $forms;
    }
    
    add_action( 'gglcptch_add_custom_form', 'kalium_contact_form_recaptcha_support' );

    Then in admin page I have selected Recaptcha v2 plugin and checked Kalium Contact Form to use:

    Then in contact form I use the she hook as described in your documentation:

    echo apply_filters( 'gglcptch_display_recaptcha', '', 'kalium-contact-form' );

    The form is submitted via AJAX and so it gets the g-recaptcha-response field on post request. Then in wp_ajax_process_contact_form hook I try to validate the captcha using this hook:

    $success = apply_filters( 'gglcptch_verify_recaptcha', true, 'bool', 'kalium-contact-form' );

    It used to work in the past and returned false when captcha was invalid, but now it returns always true, and after investigating I have found that the issue is related here:

    So the real problem stands here:

    If I comment this line it works as expected.

    The problem is that the request in AJAX from jQuery is sent using $.post( … ) as JSON type becuase it expects the response to be given in JSON as well.

    My advice is that you should differentiate the requests made in the REST API and admin-ajax.php file.

    Hopefully I was clear on my explanation

    Thread Starter Arlind Nushi

    (@arl1nd)

    Hi again,

    Actually that was happening in localhost, I’ve updated MAMP and also Loco Translate and now it seems to work fine. It seems there was an issue related more to host rather than Loco plugin, so if it happens again, I’ll update this topic.

    Thanks for your help buddy.

    Cheers and keep it up with this life saving plugin ??

    Thread Starter Arlind Nushi

    (@arl1nd)

    Hi timwhitlock,

    The video represents how the issue appears, you don’t need to download the video, just click “Play” and you will view it without need to download.

    Thanks for your reply

    Forum: Plugins
    In reply to: Out of memory Error

    I think you need to change PHP_INI value at php.ini file that is e.g.
    memory_limit = 280MB
    and restart the web server, it worked for me.

    Also check if the php.ini file is the correct that your php uses.

    I hope this will help you.

    Bye

Viewing 4 replies - 1 through 4 (of 4 total)