awesomemotive / WP-Mail-SMTP

The most popular WordPress SMTP and PHP Mailer plugin. Trusted by over 3 million sites.
https://wordpress.org/plugins/wp-mail-smtp/
GNU General Public License v3.0
55 stars 35 forks source link

error in health status of wp after update to version 2.2.1 #75

Closed nscunex closed 4 years ago

nscunex commented 4 years ago

Hi, i am getting the following error message after updating to WP Mail SMTP 2.2.1 under health status of my wp page:

Missing table: lzbD6m_wpmailsmtp_tasks_meta

WP Mail SMTP is using custom database tables for some of its features. In order to work properly, the custom tables should be created, and it seems they are missing. Please try to re-install the WP Mail SMTP plugin. If this issue persists, please contact our support.

The table already existis in my database and the access rights are set correctly. How to resolve this issue?

capuderg commented 4 years ago

Hi,

could you please let us know what version of MySQL and PHP is your site using?

We make a simple check for the needed tables, with this query: SHOW TABLES LIKE lzbD6m_wpmailsmtp_tasks_meta, would you mind executing this on your DB and see what it returns? It should return the exact same name of the DB table, so lzbD6m_wpmailsmtp_tasks_meta in your example.

Thank you and take care!

nscunex commented 4 years ago

We use MySQL 5.7 and PHP 7.4.7. Here are some addional information from our PHP errorlog for you: 2020-07-11T22:50:10+00:00 CRITICAL Uncaught Error: Call to undefined method WPMailSMTP\Tasks\Meta::get_table_name() in C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-content\plugins\wp-mail-smtp\src\Core.php:760 Stack trace:

0 C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-content\plugins\wp-mail-smtp\src\SiteHealth.php(247): WPMailSMTP\Core->get_custom_db_tables()

1 C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-content\plugins\wp-mail-smtp\src\SiteHealth.php(213): WPMailSMTP\SiteHealth->get_db_tables()

2 C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-admin\includes\class-wp-site-health.php(171): WPMailSMTP\SiteHealth->db_tables_test()

3 C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-admin\includes\class-wp-site-health.php(123): WP_Site_Health->perform_test()

4 C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-includes\class-wp-hook.php(287): WP_Site_Health->enqueue_scripts()

5 C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-includes\class-wp-hook.php(311): WP_Hook->apply_filters()

6 C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-i in C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-content\plugins\wp-mail-smtp\src\Core.php in Zeile 760

capuderg commented 4 years ago

This error is 2 days old... did it maybe occur only once after the update or is it reoccurring every time you load a page? If it only occurred once, it might be because of OPcache and is not causing the issue you are experiencing now on the WP Site Health page.

Please try the MySQL query and let me know what it returns.

nscunex commented 4 years ago

The error happens each time when i reload the page health status of Wordpress. The release before 2.2.1 dont caused this error message. Which SQL-query should i try ... "select * from ...?!"

capuderg commented 4 years ago

Oh, so you get this CRITICAL Uncaught Error: Call to undefined method WPMailSMTP\Tasks\Meta::get_table_name() error in your error log each time you refresh the WP Site Health page or do you mean that you get the Missing table: lzbD6m_wpmailsmtp_tasks_meta error on each WP Site Health page refresh?

Are you maybe using any caching plugins? Or is your hosting company using any caching systems?

Please try to clear such cache, especially "OPcache".

As for the SQL query, please try executing SHOW TABLES LIKE lzbD6m_wpmailsmtp_tasks_meta and let me know what exactly it returns (copy/paste it here).

nscunex commented 4 years ago

sql_output

nscunex commented 4 years ago

sql_test this sql syntax causes an error ...

capuderg commented 4 years ago

Thank you very much!

I see the issue now. Your DB prefix has an uppercase "D" in it and the returned string from the query has a lowercase "d" and so the check fails.

Could you please check in your DB if all your tables have a prefix with the uppercase or the lowercase "D".

Thank you very much!

nscunex commented 4 years ago

sql2 "select tables" shows me for all tables a lowercase "d". There seems to be a bug in the code to the new version 2.2.1.

The PHP errorkog shows here the following: 2020-07-11T22:50:10+00:00 CRITICAL Uncaught Error: Call to undefined method WPMailSMTP\Tasks\Meta::get_table_name() in C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-content\plugins\wp-mail-smtp\src\Core.php:760 Stack trace:

0 C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-content\plugins\wp-mail-smtp\src\SiteHealth.php(247): WPMailSMTP\Core->get_custom_db_tables()

1 C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-content\plugins\wp-mail-smtp\src\SiteHealth.php(213): WPMailSMTP\SiteHealth->get_db_tables()

2 C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-admin\includes\class-wp-site-health.php(171): WPMailSMTP\SiteHealth->db_tables_test()

3 C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-admin\includes\class-wp-site-health.php(123): WP_Site_Health->perform_test()

4 C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-includes\class-wp-hook.php(287): WP_Site_Health->enqueue_scripts()

5 C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-includes\class-wp-hook.php(311): WP_Hook->apply_filters()

6 C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-i in C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-content\plugins\wp-mail-smtp\src\Core.php in Zeile 760

Uncaught Error: Call to undefined method WPMailSMTP\Tasks\Meta::get_table_name() in C:\Inetpub\vhosts\antheia-seifen.de\httpdocs\wp-content\plugins\wp-mail-smtp\src\Core.php:760 Stack trace:

there goes something wrong obtaining tables names ,,,

nscunex commented 4 years ago

health This is the concerning error message in the health status of wp each time, when you open the page.

nscunex commented 4 years ago

Now i see the error. the database has a lower "d". you are getting an upper "D" as response from your php code ...

capuderg commented 4 years ago

We are getting the DB table prefix from the WordPress DB object: $wpdb. Could you please check your wp-config.php file and check what value does the $table_prefix variable hold?

nscunex commented 4 years ago

$table_prefix = 'lzbD6m_'; when changing the uppercase "D" to a lowercase "d" i will get the error message "Sie sind leider nicht berechtigt, auf diese Seite zuzugreifen." when accessing to the health status page. our system runs under plesk latest release.

capuderg commented 4 years ago

Yes, it looks like there is a MySQL setting which determines how the SHOW TABLES command will return the table names, either lower case only, original, or...

Anyway, we'll fix this in the plugin and the fix will be available in the next plugin update.

Thank you very much for reporting this issue.

capuderg commented 4 years ago

We've fixed the issue in our plugin code, so this fix will be available in the next plugin update.