• Resolved jackrus60

    (@jackrus60)


    I have multiple sites that are seeing the following SQL error in the log file since Nov 4th (started after upgrade to 0.7.0). Can this be resolved? AI says the error is the quotes around the table name.

    [08-Nov-2025 21:38:16 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘‘prx_cf7a_blacklist’ WHERE ip = ‘XXX.XXX.XXX.XXX” at line 1 for query SELECT * FROM ‘prx_cf7a_blacklist’ WHERE ip = ‘XXX.XXX.XXX.XX’ made by require(‘wp-blog-header.php’), wp, WP->main, WP->parse_request, do_action_ref_array(‘parse_request’), WP_Hook->do_action, WP_Hook->apply_filters, wpcf7_control_init, WPCF7_ContactForm->submit, WPCF7_Submission::get_instance, WPCF7_Submission->proceed, wpcf7_switch_locale, call_user_func, WPCF7_Submission->{closure}, WPCF7_Submission->spam, apply_filters(‘wpcf7_spam’), WP_Hook->apply_filters, CF7_AntiSpam\Core\CF7_AntiSpam_Filters->cf7a_spam_filter, CF7_AntiSpam\Core\CF7_AntiSpam_Filters->cf7a_ban_by_ip, CF7_AntiSpam\Core\CF7_AntiSpam_Filters::cf7a_blacklist_get_ip, QM_DB->query

    Thanks!
    Rick

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Erik

    (@codekraft)

    Hi @jackrus60 ,

    Thank you very much for the detailed report and the full error trace! The issue stems from using single quotes ` around the table name in the query.
    This occurred because I recently updated many queries in the plugin to use $wpdb->prepare() for security best practices. In the latest WP versions, table/column identifiers should generally use the %i placeholder, whereas %s (for strings) causes the function to incorrectly quote the table name (e.g., FROM 'table_name'), leading to your SQL syntax error.

    I am preparing a patch release (likely v0.7.1) right now to correct this specific placeholder usage for table names.
    I plan to release this fix on tomorrow, Please update the plugin then, and let me know if the error disappears from your logs.

    Thanks again for catching this!



    • This reply was modified 1 month ago by Erik.
    Thread Starter jackrus60

    (@jackrus60)

    Thank you! Appreciate the quick fix! I just upgraded and the error message no longer appears.

    THanks!

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

You must be logged in to reply to this topic.