PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.2.3
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.2.3
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
wp-optimize / templates / database / status-box-contents.php

status-box-contents.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.2.3, at templates/database/status-box-contents.php

128 lines 4.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('WPO_VERSION')) die('No direct access allowed');
4
5 $retention_enabled = $options->get_option('retention-enabled', 'false');
6 $retention_period = $options->get_option('retention-period', '2');
7 $admin_page_url = $options->admin_page_url();
8
9 $revisions_retention_enabled = $options->get_option('revisions-retention-enabled', 'false');
10 $revisions_retention_count = $options->get_option('revisions-retention-count', '2');
11
12 ?>
13
14 <h3 class="wpo-first-child"><?php _e('Status', 'wp-optimize'); ?></h3>
15
16 <div class="wpo-fieldgroup" id="wp_optimize_status_box">
17 <p>
18 <?php
19 $lastopt = $options->get_option('last-optimized', 'Never');
20 if ('Never' !== $lastopt) {
21 // check if last optimized value is integer.
22 if (is_numeric($lastopt)) {
23 $lastopt = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $lastopt + ( get_option('gmt_offset') * HOUR_IN_SECONDS ));
24 }
25 echo __('Last scheduled optimization was at', 'wp-optimize').': ';
26 echo '<span style="font-color: #004600; font-weight:bold;">';
27 echo htmlspecialchars($lastopt);
28 echo '</span>';
29 } else {
30 echo __('There was no scheduled optimization', 'wp-optimize');
31 }
32 ?>
33 <br>
34
35 <?php
36
37 $scheduled_optimizations_enabled = false;
38
39 if (WP_Optimize::is_premium()) {
40 $scheduled_optimizations = WP_Optimize_Premium()->get_scheduled_optimizations();
41
42 if (!empty($scheduled_optimizations)) {
43 foreach ($scheduled_optimizations as $optimization) {
44 if (isset($optimization['status']) && 1 == $optimization['status']) {
45 $scheduled_optimizations_enabled = true;
46 break;
47 }
48 }
49 }
50 } else {
51 $scheduled_optimizations_enabled = $options->get_option('schedule', 'false') == 'true';
52 }
53
54 if ($scheduled_optimizations_enabled) {
55 echo '<strong>';
56 _e('Scheduled cleaning', 'wp-optimize');
57 echo ' <span style="color: #009B24;">'.__('enabled', 'wp-optimize').'</span>';
58 echo ', </strong>';
59
60 $timestamp = apply_filters('wpo_cron_next_event', wp_next_scheduled('wpo_cron_event2'));
61
62 if ($timestamp) {
63
64 $timestamp = $timestamp + 60 * 60 * get_option('gmt_offset');
65
66 $wp_optimize->cron_activate();
67
68 $date = new DateTime("@".$timestamp);
69 _e('Next schedule:', 'wp-optimize');
70 echo ' ';
71 echo '<span style="font-color: #004600">';
72 echo gmdate(get_option('date_format') . ' ' . get_option('time_format'), $timestamp);
73 echo '</span>';
74 echo ' - <a id="wp_optimize_status_box_refresh" href="'.esc_attr($admin_page_url).'">'.__('Refresh', 'wp-optimize').'</a>';
75 }
76 } else {
77 echo '<strong>';
78 _e('Scheduled cleaning disabled', 'wp-optimize');
79 echo '</strong>';
80 }
81 echo '<br>';
82
83 if ('true' == $retention_enabled) {
84 echo '<strong><span style="font-color: #0000FF;">';
85 printf(__('Keeping last %s weeks data', 'wp-optimize'), $retention_period);
86 echo '</span></strong>';
87 } else {
88 echo '<strong>'.__('Not keeping recent data', 'wp-optimize').'</strong>';
89 }
90
91 echo '<br>';
92
93 if ('true' == $revisions_retention_enabled) {
94 echo '<strong><span style="font-color: #0000FF;">';
95 printf(__('Keeping last %s revisions', 'wp-optimize'), $revisions_retention_count);
96 echo '</span></strong>';
97 } else {
98 echo '<strong>'.__('Not keeping any revisions', 'wp-optimize').'</strong>';
99 }
100 ?>
101 </p>
102
103 <p>
104 <?php
105 $total_cleaned = $options->get_option('total-cleaned');
106 $total_cleaned_num = floatval($total_cleaned);
107
108 if ($total_cleaned_num > 0) {
109 echo '<h5>'.__('Total clean up overall:', 'wp-optimize').' ';
110 echo '<span style="font-color: #004600">';
111 echo $wp_optimize->format_size($total_cleaned);
112 echo '</span></h5>';
113 }
114 ?>
115 </p>
116
117 <?php
118 $corrupted_tables_count = $options->get_option('corrupted-tables-count', 0);
119
120 if ($corrupted_tables_count > 0) {
121 ?>
122 <p>
123 <span style="color: #E07575;"><?php printf(_n('Your database has %s corrupted table.', 'Your database has %s corrupted tables.', $corrupted_tables_count, 'wp-optimize'), $corrupted_tables_count); ?></span><br>
124 <a href="<?php echo esc_attr($admin_page_url); ?>&tab=wp_optimize_tables" onclick="jQuery('.wpo-pages-menu > a').first().trigger('click'); jQuery('#wp-optimize-nav-tab-wpo_database-tables').trigger('click'); return false;"><?php _e('Repair corrupted tables here.', 'wp-optimize'); ?></a>
125 </p>
126 <?php } ?>
127 </div>
128