• Resolved mirrorofzen

    (@mirrorofzen)


    Hi there,

    i’m using hcaptcha 4.8 and tutorlms 3.1.

    It seems tutor pages conflict with the hcaptcha plugin. i think it happens on the pages where there is an add to cart button for a tutor course. I contacted the tutorLMS developers which said, this needs to be fixed on your end. I’m getting those fatal errors:

    [19-Dec-2024 13:35:21 UTC] PHP Fatal error: Uncaught TypeError: HCaptcha\Abstracts\LoginBase::add_signature(): Argument #2 ($args) must be of type array, string given, called in /home/gc66xyx/public_html/wp-includes/class-wp-hook.php on line 324 and defined in /home/gc66xyx/public_html/wp-content/plugins/hcaptcha-for-forms-and-more/src/php/Abstracts/LoginBase.php:102 Stack trace:0 /home/gc66xyx/public_html/wp-includes/class-wp-hook.php(324): HCaptcha\Abstracts\LoginBase->add_signature() 1 /home/gc66xyx/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters() 2 /home/gc66xyx/public_html/wp-content/plugins/tutor/templates/login-form.php(70): apply_filters() 3 /home/gc66xyx/public_html/wp-content/plugins/tutor/includes/tutor-template-functions.php(1556): include_once(‘/home/gc66xyx/p…’) 4 /home/gc66xyx/public_html/wp-content/plugins/tutor/views/modal/login.php(30): tutor_load_template_from_custom_path() 5 /home/gc66xyx/public_html/wp-content/plugins/tutor/includes/tutor-template-functions.php(1556): include_once(‘/home/gc66xyx/p…’) 6 /home/gc66xyx/public_html/wp-content/plugins/tutor-lms-elementor-addons/templates/course/course-list.php(193): tutor_load_template_from_custom_path() 7 /home/gc66xyx/public_html/wp-content/plugins/tutor-lms-elementor-addons/includes/addons/CourseList.php(2168): include(‘/home/gc66xyx/p…’) 8 /home/gc66xyx/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php(2325): TutorLMS\Elementor\Addons\CourseList->render() 9 /home/gc66xyx/public_html/wp-content/plugins/elementor/includes/base/widget-base.php(636): Elementor\Controls_Stack->render_by_mode() 10 /home/gc66xyx/public_html/wp-content/plugins/elementor/includes/base/widget-base.php(775): Elementor\Widget_Base->render_content() 11 /home/gc66xyx/public_html/wp-content/plugins/elementor/includes/base/element-base.php(483): Elementor\Widget_Base->print_content() 12 /home/gc66xyx/public_html/wp-content/plugins/elementor/modules/element-cache/module.php(69): Elementor\Element_Base->print_element() 13 /home/gc66xyx/public_html/wp-includes/shortcodes.php(434): Elementor\Modules\ElementCache\Module->Elementor\Modules\ElementCache{closure}() 14 [internal function]: do_shortcode_tag() 15 /home/gc66xyx/public_html/wp-includes/shortcodes.php(273): preg_replace_callback() 16 /home/gc66xyx/public_html/wp-content/plugins/elementor/core/base/document.php(1865): do_shortcode() 17 /home/gc66xyx/public_html/wp-content/plugins/elementor/core/base/document.php(1200): Elementor\Core\Base\Document->print_elements() 18 /home/gc66xyx/public_html/wp-content/plugins/elementor/includes/frontend.php(1184): Elementor\Core\Base\Document->print_elements_with_wrapper() 19 /home/gc66xyx/public_html/wp-content/plugins/elementor/includes/frontend.php(1079): Elementor\Frontend->get_builder_content() 20 /home/gc66xyx/public_html/wp-includes/class-wp-hook.php(324): Elementor\Frontend->apply_builder_in_content() 21 /home/gc66xyx/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters() 22 /home/gc66xyx/public_html/wp-includes/post-template.php(256): apply_filters() 23 /home/gc66xyx/public_html/wp-content/plugins/elementor/modules/page-templates/module.php(190): the_content() 24 [internal function]: Elementor\Modules\PageTemplates\Module->print_callback() 25 /home/gc66xyx/public_html/wp-content/plugins/elementor/modules/page-templates/module.php(207): call_user_func() 26 /home/gc66xyx/public_html/wp-content/plugins/elementor/modules/page-templates/templates/header-footer.php(19): Elementor\Modules\PageTemplates\Module->print_content() 27 /home/gc66xyx/public_html/wp-includes/template-loader.php(106): include(‘/home/gc66xyx/p…’) 28 /home/gc66xyx/public_html/wp-blog-header.php(19): require_once(‘/home/gc66xyx/p…’) 29 /home/gc66xyx/public_html/index.php(17): require(‘/home/gc66xyx/p…’) 30 {main}

    thrown in /home/gc66xyx/public_html/wp-content/plugins/hcaptcha-for-forms-and-more/src/php/Abstracts/LoginBase.php on line 102

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor kaggdesign

    (@kaggdesign)

    Hi @mirrorofzen,

    Thank you for reporting. This is the bug in the TutorLMS. In the WordPress core (wp-includes/general-template.php:571), the definition of the filter is provided

    /**
    * Filters content to display in the middle of the login form.
    *
    * The filter evaluates just following the location where the 'login-password'
    * field is displayed.
    *
    * @since 3.0.0
    *
    * @param string $content Content to display. Default empty.
    * @param array $args Array of login form arguments.
    */
    $login_form_middle = apply_filters( 'login_form_middle', '', $args );

    The second argument $args must be an array, but TutorLMS in wp-content/plugins/tutor/templates/login-form.php(70) executes apply_filters with wrong $args, sending a string instead of an array.

    I can fix it on our end but again – it is not our bug.

    Also, I do not think that hCaptcha can work with TutorLMS – we do not have integration with this premium plugin. We can consider integration with TutorLMS, if you can provide its zip file for testing on my email info@kagg.eu.

    Many thanks,

    Plugin Contributor kaggdesign

    (@kaggdesign)

    I see that Tutor LMS exists also in free version; I have found it on wp.org. So no need to send zip file to me.

    I have reproduced and fixed the problem on our end. The fix will be included into next v4.9.0 and released in the beginning of January. Problem is created by Tutor LMS. In templates/login-form.php:70 they do the following:

    apply_filters( 'login_form_middle', '', '' );

    This is the pure bug. The second argument must be an array, not ''. I will report in their repo.

    Also, we will try to make an integrations with Tutor LMS. so you can add hCaptcha to their forms.

    Plugin Contributor kaggdesign

    (@kaggdesign)

    I have added Tutor LMS support to v4.9.0, to be released in January. Now hCaptcha is supported on Login, Registration, Lost Password and Checkout pages of the Tutor LMS.

    Thread Starter mirrorofzen

    (@mirrorofzen)

    Wow, thank you very much for your help in providing a fix and even adding compatibility in the next version!

    I additionally contacted the developers directly to report that bug.

    • This reply was modified 11 months, 3 weeks ago by mirrorofzen.
    Plugin Contributor kaggdesign

    (@kaggdesign)

    The 4.9.0 with Tutor support is released. You may leave a review on WordPress.org. Thank you!

    Thread Starter mirrorofzen

    (@mirrorofzen)

    Hi there,

    i tested the Tutor integration and encountered some problems.

    I enabled hcaptcha on tutorlms login, but did not enable it on wordpress login and on woocommerce login.

    now when i try my wordpress login it says invalid hcaptcha without showing an hcaptcha. Same on woo login.

    See https://drive.google.com/file/d/1Z__KwM8Mp8qWY0Qa6LBu_nXgSXlypZfs/view?usp=sharing

    Plugin Contributor kaggdesign

    (@kaggdesign)

    Hi, thank you for the report.

    I feel the fix should be easy and I will make it soon. So far, you can keep WP login protection also enabled.

    Plugin Contributor kaggdesign

    (@kaggdesign)

    But wait – I do not see any issue here. Tutor has its own login form on /dashboard page when not logged in.

    The appearance of hCaptcha on this page does not depend on “WP Login” switch.

    The same is for WC. It has own login form on my-account page.

    Thread Starter mirrorofzen

    (@mirrorofzen)

    Hi there,

    thank you for your answer and for looking into this issue.

    Let my try to explain more clearly how to reproduce the issue:

    1. Enable hCaptcha on tutor login
    2. DISABLE hcaptcha on wordpress and woocommerce login
    3. try to log in using wordpress or woocommerce login

    Then you should see the error i shared with you.

    Plugin Contributor kaggdesign

    (@kaggdesign)

    Thank you for the explanation. I have fixed this issue. The next version 4.10.0 will be released at the beginning of February.

    Thread Starter mirrorofzen

    (@mirrorofzen)

    thank you!

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

The topic ‘TutorLMS 3.0 Compatibility’ is closed to new replies.