• Resolved p1c2d3

    (@postcd)


    WordPress database error Table ‘myusername_simplex.hcaptcha_events’ doesn’t exist for query SHOW FULL COLUMNS FROM hcaptcha_events made by require(‘wp-blog-header.php’), …

    appeared in the log upon submitting HivePress Reviews form (where i have tried to add hcaptcha). I am not aware about deleting that table and disabling/enabling hcaptcha plugin does not create it.

    At /wp-admin/options-general.php?page=hcaptcha&tab=general (plugin version 5.0.0, WP 7, PHP 8.4) i have disabled “Enable Statistic” and click Save. Then enabled it again, click save.

    AI told me to run:

    CREATE TABLE IF NOT EXISTS hcaptcha_events (
    id bigint(20) unsigned AUTO_INCREMENT PRIMARY KEY,
    event_type varchar(50) NOT NULL,
    status varchar(20) NOT NULL,
    timestamp datetime DEFAULT CURRENT_TIMESTAMP,
    INDEX idx_timestamp (timestamp)
    );

    so i have ran it. I have free version of a plugin, no Pro.

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

    (@kaggdesign)

    Hi @postcd,

    Thanks for reporting this.

    The hcaptcha_events table is supposed to be created during plugin activation and also checked during plugin maintenance/migration flows. We have added an extra hardening change for the next release: activation will force a physical table check/create, and normal frontend requests will no longer perform table-existence checks when the table is not marked as created. This should be included in the next release soon.

    To help us understand how your site got into this state, could you please tell us how the plugin was installed/activated or updated on your site?

    For example:

    • WordPress admin Plugins page
    • WP-CLI
    • Composer or deployment script
    • hosting control panel / auto-installer
    • staging/production clone or database restore
    • multisite network activation

    Also, if you noticed any activation/update errors, or if the database user does not have CREATE / ALTER permissions, please mention that too.

    We’re trying to determine whether the activation hook did not run, or whether the migration/maintenance step was skipped.

    Thread Starter p1c2d3

    (@postcd)

    how the plugin was installed/activated or updated on your site?

    added, regularly from the WP store (internal installer, no manual), also updated automatically, if i remember correct, i have enabled statistics switch, this is free plugin. I have not noticed update errors. Unfortunately i had to restore database and files of a whole site from backup due to a bug in other plugin, so i have no logs.

    does not have CREATE / ALTER permissions, please mention that too.

    User has these permissions, all perms.

    Thank you for the attempt to fix. I am currently missing the events table so i will see if update will fix it, and will let you know if i spot any errors or weird behavior.

    Plugin Contributor kaggdesign

    (@kaggdesign)

    Thanks for the details.

    Given that the plugin was installed and updated normally, and the database user has CREATE/ALTER permissions, the most likely cause is the full-site restore from backup. The hcaptcha_events table is a plugin-created custom table, so if the backup/restore did not include it, or restored the database/files from different points in time, the plugin settings could remain while the custom events table is missing.

    We have hardened this for the next release. The plugin will recreate/check the Events statistics table during activation and maintenance/admin flows, while normal frontend requests will no longer run table-existence checks.

    After the next update, if the table is still missing, please deactivate and activate the hCaptcha plugin once. Do not uninstall it; just deactivate/activate. That should recreate the missing table. Existing historical Events statistics cannot be recovered if the table was not included in the backup, but new statistics should be recorded after the table is recreated.

    Please let us know if the next update or deactivate/activate cycle does not recreate the table on your site.

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

You must be logged in to reply to this topic.