SQL Errors in Email Logs – wpdb::prepare() Incorrect Usage
-
Hi,
I’m experiencing issues with the Post SMTP plugin on my WordPress site (WooCommerce enabled). When I try to view email logs, I encounter the following errors in my debug log:
</strong><br>[01-Feb-2025 09:40:32 UTC] PHP Notice: Function wpdb::prepare was called <strong>incorrectly</strong>. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see <a href="https://ww.wp.xz.cn/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 4.8.3.) in /var/www/clients/client5/web5/web/wp-includes/functions.php on line 5835<br>[01-Feb-2025 09:40:32 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%i AS pl ORDER BY pl.<code>time</code> desc LIMIT 0, 25' at line 1 for query SELECT pl.<code>id</code>,pl.<code>original_subject</code>,pl.<code>to_header</code>,pl.<code>success</code>,pl.<code>time</code> FROM %i AS pl ORDER BY pl.<code>time</code> desc LIMIT 0, 25 made by do_action('wp_ajax_ps-get-email-logs'), WP_Hook->do_action, WP_Hook->apply_filters, PostmanEmailLogs->get_logs_ajax, PostmanEmailQueryLog->get_logs<br>[01-Feb-2025 09:40:32 UTC] PHP Notice: Function wpdb::prepare was called <strong>incorrectly</strong>. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see <a href="https://ww.wp.xz.cn/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 4.8.3.) in /var/www/clients/client5/web5/web/wp-includes/functions.php on line 5835<br>[01-Feb-2025 09:40:32 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%i' at line 1 for query SELECT COUNT(<em>) as count FROM %i; made by do_action('wp_ajax_ps-get-email-logs'), WP_Hook->do_action, WP_Hook->apply_filters, PostmanEmailLogs->get_logs_ajax, PostmanEmailQueryLog->get_total_row_count [01-Feb-2025 09:40:32 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%i AS pl ORDER BY pl.<code>time</code> desc' at line 1 for query SELECT COUNT(</em>) as count FROM %i AS pl ORDER BY pl.<code>time</code> desc made by do_action('wp_ajax_ps-get-email-logs'), WP_Hook->do_action, WP_Hook->apply_filters, PostmanEmailLogs->get_logs_ajax, PostmanEmailQueryLog->get_filtered_rows_count<br><strong>
I’m using a custom prefix for my database tables.Using Post SMTP version 3.0.2
I tried deactivating and reactivating the plugin.
This issue arose while troubleshooting duplicate order confirmation emails. I rely on Post SMTP to track outgoing emails, but the error prevents me from accessing the logs.Is there a fix or workaround for this issue? Would a patch be released soon?
Thanks in advance for your support!
The topic ‘SQL Errors in Email Logs – wpdb::prepare() Incorrect Usage’ is closed to new replies.