lesterchan / wp-dbmanager

Allows you to optimize database, repair database, backup database, restore database, delete backup database , drop/empty tables and run selected queries. Supports automatic scheduling of backing up, optimizing and repairing of database.
https://wordpress.org/plugins/wp-dbmanager/
71 stars 26 forks source link

unexpected sql files in wp-content/backup-db/ can cause critical error #32

Open tmuka opened 2 days ago

tmuka commented 2 days ago

I was getting a critical error viewing the "Manage Backup DB" page ( wp-admin/admin.php?page=wp-dbmanager%2Fdatabase-manage.php ). The wp-content/debug.log showed a Fatal error in line 308 of wp-dbmanager.php.

PHP Fatal error:  Uncaught TypeError: gmdate(): Argument #2 ($timestamp) must be of type ?int, string given in /var/www/vhosts/limestonefederal.com/httpdocs/wp-content/plugins/wp-dbmanager/wp-dbmanager.php:308

I figured out i had caused this error by using wp-cli db export to create manual db exports inside the wp-content/backup-db/ directory perhaps because they used a different filename convention than expected by this plugin? Moving the files out of this directory resolved the error.

I definitely caused the issue, but it might be a nice improvement if the plugin could handle this with a warning instead of a Fatal php "critical error" on the frontend ui.

Thanks for all the work on this essential plugin!

lesterchan commented 19 hours ago

Fair point! I have updated 2.80.10, should not be throwing an error.