From 3c774bb9ecf740df073e36838ef3ed86acffc214 Mon Sep 17 00:00:00 2001 From: Opeyemi Ibrahim Date: Thu, 17 Oct 2024 17:10:18 +0100 Subject: [PATCH] Fixes #7028 PHP Notice: Undefined property: stdClass::$table_name when enable database options on apache server (#7031) --- inc/Engine/Admin/Database/OptimizationProcess.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/Engine/Admin/Database/OptimizationProcess.php b/inc/Engine/Admin/Database/OptimizationProcess.php index a901588a41..bfd0f7c2c6 100644 --- a/inc/Engine/Admin/Database/OptimizationProcess.php +++ b/inc/Engine/Admin/Database/OptimizationProcess.php @@ -124,7 +124,7 @@ protected function task( $item ) { } break; case 'database_optimize_tables': - $query = $wpdb->get_results( "SELECT table_name, data_free FROM information_schema.tables WHERE table_schema = '" . DB_NAME . "' and Engine <> 'InnoDB' and data_free > 0" ); + $query = $wpdb->get_results( "SELECT table_name AS table_name, data_free AS data_free FROM information_schema.tables WHERE table_schema = '" . DB_NAME . "' and Engine <> 'InnoDB' and data_free > 0" ); if ( $query ) { $number = 0; foreach ( $query as $table ) {