PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
← All changes | templates/database/tables-body.php +52 -54 4.5.3 → 4.7.0 View file →
@@ -2,30 +2,29 @@
2 2
3 3 <tbody id="the-list">
4 4 <?php
5 5
6 - foreach ($table_list_object_format as $index => $tablestatus) {
7 - echo '<tr
8 - data-tablename="'.esc_attr($tablestatus->Name).'"
9 - data-type="'.esc_attr($tablestatus->Engine).'"
10 - data-optimizable="'.($tablestatus->is_optimizable ? 1 : 0).'"
11 - '.($is_multisite_mode ? 'data-blog_id="'.esc_attr($tablestatus->blog_id).'"' : '').'
12 - >'."\n";
13 - echo '<td data-colname="'.esc_attr__('No.', 'wp-optimize').'">'.esc_html(number_format_i18n($table_list[$index]['index'])).'</td>'."\n";
14 - echo '<td data-tablename="'.esc_attr($tablestatus->Name).'" data-colname="'.esc_attr__('Table', 'wp-optimize').'">'.esc_html($tablestatus->Name);
6 + $row_number = 0;
7 + foreach ($table_list_object_format as $tablestatus) {
8 + $row_number++;
9 + printf('<tr data-tablename="%1$s" data-type="%2$s" data-optimizable="%3$s" data-blog_id="%4$s">',
10 + esc_attr($tablestatus->Name),
11 + esc_attr($tablestatus->Engine),
12 + $tablestatus->is_optimizable ? 1 : 0,
13 + $is_multisite_mode ? esc_attr($tablestatus->blog_id) : '');
14 + printf('<td data-colname="%1$s">%2$s</td>', esc_attr__('No.', 'wp-optimize'), esc_html(number_format_i18n($row_number)));
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));
15 16
16 17 if (!empty($tablestatus->plugin_status)) {
17 18 if ($tablestatus->wp_core_table) {
18 - echo "<br><span style='font-size: 11px;'>".esc_html__('Belongs to:', 'wp-optimize')."</span> ";
19 - echo "<span style='font-size: 11px;'>".esc_html__('WordPress core', 'wp-optimize')."</span>";
19 + printf('<br><span>%s</span> ', esc_html__('Belongs to:', 'wp-optimize'));
20 + printf('<span>%s</span>', esc_html__('WordPress core', 'wp-optimize'));
20 21 } elseif (false !== stripos($tablestatus->Name, 'actionscheduler_')) {
21 - $message = __('This table is used by many plugins for batch processing.', 'wp-optimize');
22 - $message .= ' ';
23 - echo "<br><span style='font-size: 11px;'>". esc_html($message) ."</span> ";
24 - echo "<span style='font-size: 11px;'>".esc_html__('Thus, it cannot be deleted.', 'wp-optimize')."</span>";
22 + printf('<br><span>%s</span> ', esc_html__('This table is used by many plugins for batch processing.', 'wp-optimize'));
23 + printf('<span>%s</span>', esc_html__('Thus, it cannot be deleted.', 'wp-optimize'));
25 24 } else {
26 25 echo '<div class="table-plugins">';
27 - echo "<span style='font-size: 11px;'>".esc_html__('Known plugins that use this table name:', 'wp-optimize')."</span> ";
26 + printf('<span>%s</span> ', esc_html__('Known plugins that use this table name:', 'wp-optimize'));
28 27 foreach ($tablestatus->plugin_status as $plugins_status) {
29 28 $plugin = $plugins_status['plugin'];
30 29 $status = $plugins_status['status'];
31 30
@@ -35,17 +34,17 @@
35 34 continue;
36 35 }
37 36
38 37 if ('sfwd-lms' === $plugin) {
39 - $wp_optimize->wp_optimize_url('https://www.learndash.com/', '', '<span style="font-size: 11px;">LearnDash</span>');
38 + $wp_optimize->wp_optimize_url('https://www.learndash.com/', '', '<span>LearnDash</span>');
40 39 } else {
41 - $wp_optimize->wp_optimize_url('https://wordpress.org/plugins/'.$plugin.'/', '', '<span style="font-size: 11px;">'.esc_html($plugin).'</span>');
40 + $wp_optimize->wp_optimize_url('https://wordpress.org/plugins/'.$plugin.'/', '', '<span>'.esc_html($plugin).'</span>');
42 41 }
43 42
44 43 if (false === $status['installed']) {
45 - echo ' <span style="font-size: 11px; color: #9B0000; font-weight: bold;">['.esc_html__('not installed', 'wp-optimize').']</span>';
44 + printf(' <span class="status">[%s]</span>', esc_html__('not installed', 'wp-optimize'));
46 45 } elseif (false === $status['active']) {
47 - echo ' <span style="font-size: 11px; color: #9B0000; font-weight: bold;">['.esc_html__('inactive', 'wp-optimize').']</span>';
46 + printf(' <span class="status">[%s]</span>', esc_html__('inactive', 'wp-optimize'));
48 47 }
49 48 }
50 49 echo '</div>';
51 50 }
@@ -52,51 +51,50 @@
52 51 }
53 52
54 53 echo "</td>\n";
55 54
56 - echo '<td data-colname="'.esc_attr__('Records', 'wp-optimize').'" data-sort="'.esc_attr(intval($tablestatus->Rows)).'">'.esc_html(number_format_i18n($tablestatus->Rows)).'</td>'."\n";
57 - echo '<td data-colname="'.esc_attr__('Data Size', 'wp-optimize').'" data-sort="'.esc_attr(intval($tablestatus->Data_length)).'">'. esc_html($wp_optimize->format_size($tablestatus->Data_length)).'</td>'."\n";
58 - echo '<td data-colname="'.esc_attr__('Index Size', 'wp-optimize').'" data-sort="'.esc_attr(intval($tablestatus->Index_length)).'">'. esc_html($wp_optimize->format_size($tablestatus->Index_length)).'</td>'."\n";
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)));
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)));
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)));
59 59
60 60 if ($tablestatus->is_optimizable) {
61 - echo '<td data-colname="'.esc_attr__('Type', 'wp-optimize').'" data-optimizable="1">'.esc_html($tablestatus->Engine).'</td>'."\n";
62 -
63 - echo '<td data-colname="'.esc_attr__('Overhead', 'wp-optimize').'" data-sort="'.esc_attr(intval($tablestatus->Data_free)).'">';
61 + printf('<td data-colname="%1$s" data-optimizable="1">%2$s</td>', esc_attr__('Type', 'wp-optimize'), esc_html($tablestatus->Engine));
62 + printf('<td data-colname="%1$s" data-sort="%2$s">', esc_attr__('Overhead', 'wp-optimize'), esc_attr(intval($tablestatus->Data_free)));
64 63 $font_colour = ($optimize_db ? (($tablestatus->Data_free > $small_overhead_size) ? '#0000FF' : '#004600') : (($tablestatus->Data_free > $small_overhead_size) ? '#9B0000' : '#004600'));
65 - echo '<span style="color:'. esc_attr($font_colour) .';">';
66 - echo esc_html($wp_optimize->format_size($tablestatus->Data_free));
67 - echo '</span>';
68 - echo '</td>'."\n";
64 + printf('<span style="color:%1$s;">%2$s</span>', esc_attr($font_colour), esc_html($wp_optimize->format_size($tablestatus->Data_free)));
65 + echo "</td>\n";
69 66 } else {
70 - echo '<td data-colname="'.esc_attr__('Type', 'wp-optimize').'" data-optimizable="0">'.esc_html($tablestatus->Engine).'</td>'."\n";
71 - echo '<td data-colname="'.esc_attr__('Overhead', 'wp-optimize').'">';
72 - echo '<span style="color:#0000FF;">-</span>';
73 - echo '</td>'."\n";
67 + printf('<td data-colname="%1$s" data-optimizable="0">%2$s</td>', esc_attr__('Type', 'wp-optimize'), esc_html($tablestatus->Engine));
68 + printf('<td data-colname="%s">', esc_attr__('Overhead', 'wp-optimize'));
69 + ?>
70 + <span style="color:#0000FF;">-</span>
71 + </td>
72 + <?php
74 73 }
75 74
76 - echo '<td data-colname="'.esc_attr__('Actions', 'wp-optimize').'">'. wp_kses_post(apply_filters('wpo_tables_list_additional_column_data', '', $tablestatus)) .'</td>';
75 + printf('<td data-colname="%1$s">%2$s</td>', esc_attr__('Actions', 'wp-optimize'), wp_kses_post(apply_filters('wpo_tables_list_additional_column_data', '', $tablestatus)));
77 76
78 - echo '</tr>'."\n";
77 + echo "</tr>\n";
79 78 }
80 79 ?>
81 80 </tbody>
82 81 <tfoot>
83 -<?php
84 - echo '<tr class="thead">'."\n";
85 - echo '<th>'.esc_html__('Total:', 'wp-optimize').'</th>'."\n";
86 - // translators: %s is the number of tables
87 - echo '<th>'.esc_html(sprintf(_n('%s Table', '%s Tables', $no, 'wp-optimize'), $no)).'</th>'."\n";
88 - echo '<th>'.esc_html($row_usage).'</th>'."\n";
89 - echo '<th>'.esc_html($data_usage).'</th>'."\n";
90 - echo '<th>'.esc_html($index_usage).'</th>'."\n";
91 - echo '<th>'.'-'.'</th>'."\n";
92 - echo '<th>';
93 -
94 - $font_colour = (($optimize_db) ? (($overhead_usage > $small_overhead_size) ? '#0000FF' : '#004600') : (($overhead_usage > $small_overhead_size) ? '#9B0000' : '#004600'));
95 -
96 - echo '<span style="color:'.esc_attr($font_colour).'">'.esc_html($overhead_usage_formatted).'</span>';
97 -
98 -?>
99 - </th>
100 - <th><?php esc_html_e('Actions', 'wp-optimize'); ?></th>
82 + <tr class="thead">
83 + <th><?php esc_html_e('Total:', 'wp-optimize'); ?></th>
84 + <th>
85 + <?php
86 + // translators: %s is the number of tables
87 + echo esc_html(sprintf(_n('%s Table', '%s Tables', $no, 'wp-optimize'), $no));
88 + ?>
89 + </th>
90 + <th><?php echo esc_html($row_usage); ?></th>
91 + <th><?php echo esc_html($data_usage); ?></th>
92 + <th><?php echo esc_html($index_usage); ?></th>
93 + <th>-</th>
94 + <th>
95 + <?php $font_colour = (($optimize_db) ? (($overhead_usage > $small_overhead_size) ? '#0000FF' : '#004600') : (($overhead_usage > $small_overhead_size) ? '#9B0000' : '#004600')); ?>
96 + <span style="color:<?php echo esc_attr($font_colour); ?>"><?php echo esc_html($overhead_usage_formatted); ?></span>
97 + </th>
98 + <th><?php esc_html_e('Actions', 'wp-optimize'); ?></th>
101 99 </tr>
102 100 </tfoot>