• Resolved Oliver Campion

    (@domainsupport)


    Hi,

    We found this in our error log …

    [07-May-2026 07:16:48 UTC] EXCEPTION: HCaptcha\DelayedScript\DelayedScript::enqueue(): Argument #1 ($handle) must be of type string, array given, called in /wp-content/plugins/hcaptcha-for-forms-and-more/src/php/Main.php on line 898 in /wp-content/plugins/hcaptcha-for-forms-and-more/src/php/DelayedScript/DelayedScript.php on line 104
    [07-May-2026 07:16:56 UTC] Error sending plugin statistics: 404
    [07-May-2026 07:16:56 UTC] Error sending plugin statistics: 404
    [07-May-2026 07:16:56 UTC] Error sending plugin statistics: 404
    [07-May-2026 07:16:57 UTC] Error sending plugin statistics: 404

    This is a worry because we specifically have “Enable Statistics” set to off in your settings.

    Looking at it you seem to be sending statistics to https://a.hcaptcha.com/api/event despite this setting being off. There is a hcap_allow_send_plugin_stats filter but this is only set to false when in “Playground”.

    Can you please look into it as this would appear to contravene Plugin Guideline 7 and we have a lot of clients that use your plugin.

    Thank you,

    Oliver

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

    (@kaggdesign)

    Hi @domainsupport,

    Thank you for your report. I agree – it shouldn’t be so. It’s a bug. I will fix it in a day or two, include into the next release and share -RC version with you.

    Thread Starter Oliver Campion

    (@domainsupport)

    Thanks for looking into this so quickly, very much appreciated!

    Plugin Contributor kaggdesign

    (@kaggdesign)

    I analyzed code and cannot see the issue so far. Taking into account that your request is first of that kind, I assume the issue is related to your specific environment, preventing saving the option.

    Could you provide the System Info from the plugin admin page?

    Also, what is the result of execution wp option get hcaptcha_versions?

    In any case, you can stop sending statistics right now by adding the filter to a mu-plugin:

    add_filter( 'hcap_allow_send_plugin_stats', '__return_false' );
    Plugin Contributor kaggdesign

    (@kaggdesign)

    Please install v4.27.0-RC1 and let me know.

    Thread Starter Oliver Campion

    (@domainsupport)

    Hi,

    Many thanks for your replies and RC plugin to test.

    In order to test if this works, however, we’ll first need to find out what event causes the stats to be sent, namely …

    • add_filter( 'pre_update_option_' . $this->option_name(), [ $this, 'maybe_send_stats' ], 20, 2 );
    • add_filter( 'pre_update_site_option_' . $this->option_name(), [ $this, 'maybe_send_stats' ], 20, 2 );
    • private function check_plugin_update( array $migrated )

    Seeing as we were not updating an option when we saw the notices in our debug.log it is likely that this happened when the last plugin update was applied.

    This tracks because the modified date on the plugin folder is [07-May-2026 07:16 UTC] which matches the timestamps on the logs in the original post above.

    Therefore, in order to test your RC plugin I would imagine we would need to run an update from the repository as it would run normally? As such this would be tricky to test seeing as we only picked it up because there happened to be a problem with it sending.

    As such, if you say you have been able to identify and resolve the issue, that’s good enough for us.

    Thanks again for your swift action in this matter.

    Oliver

    Plugin Contributor kaggdesign

    (@kaggdesign)

    You should simply download the -RC1 zip file and install it in admin via Plugins->Add Plugins->Upload plugin.

    Statistics can be sent from 2 methods:

    • \HCaptcha\Settings\General::maybe_send_stats – when the switch turns on (it is not your case)
    • \HCaptcha\Migrations\Migrations::send_plugin_stats – when the plugin is migrated to a higher version.

    To help me understand the reason in your environment, I need answers to my questions above:

    1. System Info from the plugin admin page
    2. What is the result of execution wp option get hcaptcha_versions?
    • This reply was modified 1 month ago by kaggdesign.
    Thread Starter Oliver Campion

    (@domainsupport)

    Very sorry but the site we are referring to is not one that we can expose information about in a public forum for security reasons.

    As stated, we were not updating the plugin options and the date of the log notifications match the date the plugin last updated so you should be able to see that stats are being sent when your plugin updates.

    There’s no need for us to install your update, you have all the information you need to resolve the bug. Furthermore, manually installing the update from a .zip file will not replicate the environment when updating automatically and finally, it is highly unlikely that the notifications will appear again seeing as the cause of the notification was un-related to our issue (namely that stats were being sent at all).

    OIiver

    Plugin Contributor kaggdesign

    (@kaggdesign)

    Hi Oliver,

    Thank you for the additional information.Just to clarify: the System Info section is intentionally designed not to expose any personal, private, or sensitive information, even when copied from a private or production website. It only includes technical environment details that help us troubleshoot plugin-specific issues.Based on the information provided, I believe we have enough context here. Since the workaround has also been shared above, I am going to close this ticket now.

    Thank you again for reporting this.

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

You must be logged in to reply to this topic.