• For those of you migrating away from the rate-limited reCAPTCHA, you may discover your TutorLMS course pages will break for logged out users, creating a 500 error code with the page wrapped in WordPress’ gray error page (id=”error-page” included in the body class).

    This happens if hCaptcha has WordPress login form protection enabled (hCaptcha > Integrations > WordPress > Login Form). This is caused by the following line of code in course-entry-box.php:

    if ( ! is_user_logged_in() ) {
    tutor_load_template_from_custom_path( tutor()->path . '/views/modal/login.php' );
    }

    This may cause issues if you are running the Tutor login modal box. We have not tested this with the Tutor modal, as we’re running a separate login system across our site.

    Hope this might help some out there.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @wsp-kk,

    Thank you for sharing this information!

    Currently, hCaptcha is not officially supported by Tutor LMS. I recommend using the default reCAPTCHA for best results. If you’re facing issues, it may be helpful to disable the hCaptcha for login.

    Thread Starter kidznc

    (@wsp-kk)

    ^

    As typical with the developers of this plugin, their response is unhelpful and encourages compromises to suit their bundled limitations, rather than accepting that some users may be seeking a workaround regardless.

    Remember, folks – reCAPTCHA is no longer free over 10,000 assessments.

    There’s no other reason for someone to wind up on this post UNLESS they were seeking an alternative, so the dev’s reply here is both patronizing to the intended audience and presents poor advice by encouraging lesser site security.

    abhishekspatil

    (@abhishekspatil)

    @wsp-kk: Thanks for initiating this thread.. I also faced this issue. I did some code analysis and found the root cause. To get to the point, adding the snippet below to my “theme” functions.php worked.
    You can get there by -> wp-contents -> theme -> theme name -> functions.php

    /*
    Fix Name: Custom Fixes for Tutor LMS and hCaptcha
    Description: Ensures compatibility between Tutor LMS and hCaptcha.
    Version: 1.0
    */
    add_filter('login_form_middle', function($content, $args = []) {
    if (!is_array($args)) {
    $args = [];
    }
    return $content;
    }, 5, 2);
    abhishekspatil

    (@abhishekspatil)

    @wsp-kk : Update to my earlier comment:
    So, the solution that worked for me:
    Adding below code in wp-contents -> theme -> theme name -> functions.php

    /*
    Fix Name: Custom Fixes for Tutor LMS and hCaptcha
    Description: Ensures compatibility between Tutor LMS and hCaptcha.
    Version: 1.0
    */
    add_filter('login_form_middle', function($content, $args = []) {
    if (!is_array($args)) {
    $args = [];
    }
    return $content;
    }, 5, 2);

    And update wp-contents -> plugins -> tutor -> templates -> login-form.php

    Change line number 70 (double check)
    from apply_filters( 'login_form_middle', '', '');
    to apply_filters( 'login_form_middle', '', []);

    NOTE: These changes might be overridden once you update the plugins.

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