• Resolved crweiner

    (@crweiner)


    Issue:

    The hCaptcha plugin throws a fatal error when saving a toggled-off Jetpack Form on the hcaptcha-integrations page.

    The fatal is below:

    Error Details
    =============
    An error of type E_ERROR was caused in line 949 of the file /srv/htdocs/wp-content/plugins/hcaptcha-for-forms-and-more/src/php/Settings/Abstracts/SettingsBase.php. Error message: Uncaught TypeError: KAGG\Settings\Abstracts\SettingsBase::sanitize_option_callback(): Return value must be of type array, null returned in /srv/htdocs/wp-content/plugins/hcaptcha-for-forms-and-more/src/php/Settings/Abstracts/SettingsBase.php:949
    Stack trace:
    #0 /wordpress/core/6.8.2/wp-includes/class-wp-hook.php(326): KAGG\Settings\Abstracts\SettingsBase->sanitize_option_callback(NULL)
    #1 /wordpress/core/6.8.2/wp-includes/plugin.php(205): WP_Hook->apply_filters(NULL, Array)
    #2 /wordpress/core/6.8.2/wp-includes/formatting.php(5119): apply_filters('sanitize_option...', NULL, 'hcaptcha_settin...', NULL)
    #3 /wordpress/core/6.8.2/wp-includes/option.php(887): sanitize_option('hcaptcha_settin...', NULL)
    #4 /wordpress/core/6.8.2/wp-admin/options.php(344): update_option('hcaptcha_settin...', NULL)
    #5 {main}
    thrown

    Steps to Recreate:

    • Start with a brand new site with Twenty-Twenty Five, hCaptcha for WP, and Jetpack. My testing setup also has Akismet and Jetpack Protect. The versions I am using are:
      • Akismet – Version 5.5
      • hCaptcha for WP – Version 4.16.0
      • Jetpack – Version 15.0-a.5 (this is managed by my host, Pressable. You may find this version in the plugin directory here)
      • Jetpack Protect – Version 4.3.0
    • Create a new Jetpack form under Jetpack -> Forms. Save the form and publish it.
    • Setup hCaptcha for WP and test that all works as intended.
    • Go to the Integrations page, toggle on hCaptcha for your Jetpack Form, and save.
    • Toggle off the Jetpack Form and save.
    • Observe the above PHP fatal error.

    This video also shows the fatal only occurs when trying to toggle the Jetpack Form off: https://d.pr/v/vz3oDw

    Thank you for looking into this and do let me know if I can help test anything further!

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

    (@kaggdesign)

    Hi @crweiner,

    Thank you for your detailed report. I have fixed the issue. Please download v4.17.0-RC2 and let me know.

    Plugin Contributor kaggdesign

    (@kaggdesign)

    Hi @crweiner,

    The RC2 contained some issues. Please test v4.17.0-RC3 and let me know. Thanks.

    Thread Starter crweiner

    (@crweiner)

    Thank you for responding so quickly, @kaggdesign!

    I tested v4.17.0-RC3, and that does allow me to turn off hCaptcha for Jetpack Forms without fatal errors, thank you!

    However, this RC has a different problem. I cannot submit a Jetpack Form with that RC version of hCaptcha enabled. After I prove I am human and go to submit the form, an error message comes up saying “Connection issue while submitting the form. Check that you are connected to the Internet and try again.”

    The POST request to /wp-admin/admin-ajax.php?action=grunion-contact-form has a 400 – Bad Request status code and the response payload says:

    <div class="form-error">
    <ul class="form-errors">
    <li class="form-error-message">Signature mismatch.</li>
    </ul>
    </div>

    I verified that the hCaptcha site config settings on /wp-admin/admin.php?page=hcaptcha say they are correct -> “Site config is valid. Save your changes.”

    I have not yet tested v4.17.0-RC2. Happy to test other versions or provide other logs, if that’s helpful!

    Plugin Contributor kaggdesign

    (@kaggdesign)

    Hi @crweiner,

    Thank you for your testing. I have removed access to RC2, so you cannot test it and it is not needed.

    In 4.17.0, I introduced the Anti-Spam checks for all forms. Some of them may still not work. This is what has happened with Jetpack. To circumvent the bug so far, you can turn off toggles in the Anti-Spam section on the General page.

    Today, I will fix the issue and let you test RC4 with Jetpack form having Anti-Spam checks.

    Thank you.

    Plugin Contributor kaggdesign

    (@kaggdesign)

    I do not see this problem locally with Jetpack. Could you share a link to the page where you see the issue?

    Plugin Contributor kaggdesign

    (@kaggdesign)

    The v4.17.0-RC5 has additional fix of anti-spam honeypot behavior. Please use it for testing.

    Plugin Contributor kaggdesign

    (@kaggdesign)

    Closed as having no response for a week.

    Thread Starter crweiner

    (@crweiner)

    Hi @kaggdesign! So sorry for my delay here, IRL things got in the way.

    I have a sample Jetpack contact form set up at: https://crweiner.net/jetpack-forms/ , if you would like to test it out too.

    I installed the v4.17.0-RC5 and that seems to be working as expected! I can both enable and disable the Jetpack Forms integration and the form submissions now go through.

    Thank you again for taking a closer look at this, and I appreciate you working incredibly quickly to get an RC out to fix the issue.

    • This reply was modified 2 months, 4 weeks ago by crweiner. Reason: Fix typos
    Plugin Contributor kaggdesign

    (@kaggdesign)

    Hi @crweiner,

    Thank you for the confirmation. I am glad that the fix has helped.

    I will be pleased if you will leave a review here.

    Many thanks.

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

You must be logged in to reply to this topic.