get_db_info()->get_version(); $tablesstatus = $wp_optimize->get_optimizer()->get_tables(); $is_multisite_mode = $wp_optimize->is_multisite_mode(); $total_gain = 0; $no = 0; $row_usage = 0; $data_usage = 0; $index_usage = 0; $overhead_usage = 0; $non_inno_db_tables = 0; $inno_db_tables = 0; $small_overhead_size = 1048576; foreach ($tablesstatus as $tablestatus) { $no++; echo ''."\n"; echo ''.esc_html(number_format_i18n($no)).''."\n"; echo ''.esc_html($tablestatus->Name); if (!empty($tablestatus->plugin_status)) { if ($tablestatus->wp_core_table) { echo "
".esc_html__('Belongs to:', 'wp-optimize')." "; echo "".esc_html__('WordPress core', 'wp-optimize').""; } elseif (false !== stripos($tablestatus->Name, 'actionscheduler_')) { $message = __('This table is used by many plugins for batch processing.', 'wp-optimize'); $message .= ' '; echo "
". esc_html($message) ." "; echo "".esc_html__('Thus, it cannot be deleted.', 'wp-optimize').""; } else { echo '
'; echo "".esc_html__('Known plugins that use this table name:', 'wp-optimize')." "; foreach ($tablestatus->plugin_status as $plugins_status) { $plugin = $plugins_status['plugin']; $status = $plugins_status['status']; echo '
'; $closed_plugins = array('404-monitor', 'redirections'); if (in_array($plugin, $closed_plugins)) { continue; } if ('sfwd-lms' === $plugin) { $wp_optimize->wp_optimize_url('https://www.learndash.com/', '', 'LearnDash'); } else { $wp_optimize->wp_optimize_url('https://wordpress.org/plugins/'.$plugin.'/', '', ''.esc_html($plugin).''); } if (false == $status['installed']) { echo ' ['.esc_html__('not installed', 'wp-optimize').']'; } elseif (false == $status['active']) { echo ' ['.esc_html__('inactive', 'wp-optimize').']'; } } echo '
'; } } echo "\n"; echo ''.esc_html(number_format_i18n($tablestatus->Rows)).''."\n"; echo ''. esc_html($wp_optimize->format_size($tablestatus->Data_length)).''."\n"; echo ''. esc_html($wp_optimize->format_size($tablestatus->Index_length)).''."\n"; if ($tablestatus->is_optimizable) { echo ''.esc_html($tablestatus->Engine).''."\n"; echo ''; $font_colour = ($optimize_db ? (($tablestatus->Data_free > $small_overhead_size) ? '#0000FF' : '#004600') : (($tablestatus->Data_free > $small_overhead_size) ? '#9B0000' : '#004600')); echo ''; echo esc_html($wp_optimize->format_size($tablestatus->Data_free)); echo ''; echo ''."\n"; $overhead_usage += $tablestatus->Data_free; $total_gain += $tablestatus->Data_free; $non_inno_db_tables++; } else { echo ''.esc_html($tablestatus->Engine).''."\n"; echo ''; echo '-'; echo ''."\n"; $inno_db_tables++; } echo ''. apply_filters('wpo_tables_list_additional_column_data', '', $tablestatus) .''; $row_usage += $tablestatus->Rows; $data_usage += $tablestatus->Data_length; $index_usage += $tablestatus->Index_length; echo ''."\n"; } // THis extra tbody with class of tablesorter-no-sort // Is for tablesorter and it will not allow the total bar // At the bottom of the table information to be sorted with the rest of the data echo ''."\n"; echo ''."\n"; echo ''.esc_html__('Total:', 'wp-optimize').''."\n"; echo ''.esc_html(sprintf(_n('%s Table', '%s Tables', $no, 'wp-optimize'), number_format_i18n($no))).''."\n"; echo ''.esc_html(number_format_i18n($row_usage)).''."\n"; echo ''.esc_html($wp_optimize->format_size($data_usage)).''."\n"; echo ''.esc_html($wp_optimize->format_size($index_usage)).''."\n"; echo ''.'-'.''."\n"; echo ''; $font_colour = (($optimize_db) ? (($overhead_usage > $small_overhead_size) ? '#0000FF' : '#004600') : (($overhead_usage > $small_overhead_size) ? '#9B0000' : '#004600')); echo ''.esc_html($wp_optimize->format_size($overhead_usage)).''; ?>