| @@ -2,15 +2,17 @@ | ||
| 2 | 2 | |
| 3 | 3 | <tbody id="the-list"> |
| 4 | 4 | <?php |
| 5 | 5 | |
| 6 | - foreach ($table_list_object_format as $index => $tablestatus) { | |
| 6 | + $row_number = 0; | |
| 7 | + foreach ($table_list_object_format as $tablestatus) { | |
| 8 | + $row_number++; | |
| 7 | 9 | printf('<tr data-tablename="%1$s" data-type="%2$s" data-optimizable="%3$s" data-blog_id="%4$s">', |
| 8 | 10 | esc_attr($tablestatus->Name), |
| 9 | 11 | esc_attr($tablestatus->Engine), |
| 10 | 12 | $tablestatus->is_optimizable ? 1 : 0, |
| 11 | 13 | $is_multisite_mode ? esc_attr($tablestatus->blog_id) : ''); |
| 12 | - printf('<td data-colname="%1$s">%2$s</td>', esc_attr__('No.', 'wp-optimize'), esc_html(number_format_i18n($table_list[$index]['index']))); | |
| 14 | + printf('<td data-colname="%1$s">%2$s</td>', esc_attr__('No.', 'wp-optimize'), esc_html(number_format_i18n($row_number))); | |
| 13 | 15 | printf('<td data-tablename="%1$s" data-colname="%2$s">%3$s', esc_attr($tablestatus->Name), esc_attr__('Table', 'wp-optimize'), esc_html($tablestatus->Name)); |
| 14 | 16 | |
| 15 | 17 | if (!empty($tablestatus->plugin_status)) { |
| 16 | 18 | if ($tablestatus->wp_core_table) { |
| @@ -49,9 +51,10 @@ | ||
| 49 | 51 | } |
| 50 | 52 | |
| 51 | 53 | echo "</td>\n"; |
| 52 | 54 | |
| 53 | - printf('<td data-colname="%1$s" data-sort="%2$s">%3$s</td>', esc_attr__('Records', 'wp-optimize'), esc_attr(intval($tablestatus->Rows)), esc_html(number_format_i18n($tablestatus->Rows))); | |
| 55 | + $table_rows = intval($tablestatus->Rows); | |
| 56 | + printf('<td data-colname="%1$s" data-sort="%2$s">%3$s</td>', esc_attr__('Records', 'wp-optimize'), esc_attr($table_rows), esc_html(number_format_i18n($table_rows))); | |
| 54 | 57 | printf('<td data-colname="%1$s" data-sort="%2$s">%3$s</td>', esc_attr__('Data Size', 'wp-optimize'), esc_attr(intval($tablestatus->Data_length)), esc_html($wp_optimize->format_size($tablestatus->Data_length))); |
| 55 | 58 | printf('<td data-colname="%1$s" data-sort="%2$s">%3$s</td>', esc_attr__('Index Size', 'wp-optimize'), esc_attr(intval($tablestatus->Index_length)), esc_html($wp_optimize->format_size($tablestatus->Index_length))); |
| 56 | 59 | |
| 57 | 60 | if ($tablestatus->is_optimizable) { |