PluginProbe
SweepPress: Website Cleanup and Optimization / 2.4
SweepPress: Website Cleanup and Optimization v2.4
trunk 1.1 1.2 1.3 1.4 1.4.1 1.5 1.6 1.7 1.8 2.0 2.1 2.1.1 2.2 2.3 2.3.1 2.4 2.4.1 2.4.2 2.5 2.6 3.0 3.1 3.1.1 3.2 All 39 releases
sweeppress / forms / content-dashboard-auto.php

content-dashboard-auto.php in SweepPress: Website Cleanup and Optimization 2.4, at forms/content-dashboard-auto.php

92 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use Dev4Press\v43\Core\Quick\File;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit;
7 }
8
9 $method = sweeppress_settings()->get_method();
10 $list = sweeppress_core()->available();
11 $_auto = array(
12 'sweepers' => 0,
13 'tasks' => 0,
14 'records' => 0,
15 'size' => 0,
16 );
17
18 foreach ( $list as $category => $sweepers ) {
19 foreach ( $sweepers as $sweeper ) {
20 $run = $method == 'normal' || ( $method == 'partial' && ! $sweeper->has_high_system_requirements() );
21
22 if ( ! $run && $sweeper->has_cached_data() ) {
23 $run = true;
24 }
25
26 if ( $run && $sweeper->for_auto_cleanup() ) {
27 if ( $sweeper->is_sweepable() ) {
28 $_auto['sweepers'] ++;
29
30 foreach ( $sweeper->get_tasks() as $task => $data ) {
31 if ( $data['records'] > 0 || $data['size'] > 0 ) {
32 $_auto['tasks'] ++;
33 $_auto['records'] += $data['records'];
34 $_auto['size'] += $data['size'];
35 }
36 }
37 }
38 }
39 }
40 }
41
42 require( SWEEPPRESS_PATH . 'forms/misc-notices-backup.php' );
43
44 ?>
45 <div class="d4p-group d4p-dashboard-card sweeper-dashboard-auto">
46 <h3>
47 <?php esc_html_e( 'Auto Sweep', 'sweeppress' ); ?>
48 <a class="d4p-kb-group" href="https://support.dev4press.com/kb/article/auto-and-quick-sweeping/" target="_blank" rel="noopener">KB</a>
49 </h3>
50 <div class="d4p-group-inner">
51 <div id="sweeppress-information-auto">
52 <div class="sweeppress-info-block">
53 <p><?php esc_html_e( 'From here, you can run automatic cleanup of WordPress database that includes some of the sweepers. Auto sweeping is not available for many of the sweepers, because of the limitations of some of the sweepers, or the performance issues that some sweepers can cause.', 'sweeppress' ); ?></p>
54 <p><?php esc_html_e( 'Switch to Quick Sweep Mode to see all Sweepers available for quick cleanup. If you want to get full control over all Sweepers, read additional information and limitations for some sweepers, visit the Sweep panel.', 'sweeppress' ); ?></p>
55 <p><?php esc_html_e( 'Make sure to check out plugin Settings panel and options related to additional Sweepers control.', 'sweeppress' ); ?></p>
56 </div>
57 <div class="sweeppress-request-block">
58 <dl>
59 <dt><?php esc_html_e( 'Auto Sweepers', 'sweeppress' ); ?>:</dt>
60 <dd><?php echo esc_html( sweeppress_core()->get_sweepers_count( 'auto' ) ); ?></dd>
61 <dt><?php esc_html_e( 'Active Sweepers', 'sweeppress' ); ?>:</dt>
62 <dd><?php echo esc_html( $_auto['sweepers'] ); ?></dd>
63 </dl>
64 <dl>
65 <dt><?php esc_html_e( 'Tasks', 'sweeppress' ); ?>:</dt>
66 <dd><?php echo esc_html( $_auto['tasks'] ); ?></dd>
67 <dt><?php esc_html_e( 'Records', 'sweeppress' ); ?>:</dt>
68 <dd><?php echo esc_html( $_auto['records'] ); ?></dd>
69 <dt><?php esc_html_e( 'Size', 'sweeppress' ); ?>:</dt>
70 <dd><?php echo File::size_format( absint( $_auto['size'] ), 1 ); ?></dd>
71 </dl>
72 <button type="button" class="button-primary" data-nonce="<?php echo wp_create_nonce( "sweeppress-dashboard-auto-sweep" ); ?>"><?php esc_html_e( 'Auto Sweep', 'sweeppress' ); ?></button>
73 <button type="button" class="button-secondary"><?php esc_html_e( 'Switch to Quick Sweep Mode', 'sweeppress' ); ?></button>
74 </div>
75 </div>
76 <div id="sweeppress-results-auto" style="display: none">
77 <div class="sweeppress-results-loader">
78 <i class="d4p-icon d4p-ui-spinner d4p-icon-spin"></i>
79 <span><?php esc_html_e( 'Please wait for the sweeping to finish...', 'sweeppress' ); ?></span>
80 </div>
81 </div>
82 </div>
83 </div>
84 <div style="display: none">
85 <div title="<?php esc_attr_e( 'Are you sure?', 'sweeppress' ); ?>" id="sweeppress-dialog-dashboard-auto">
86 <div class="sweeppress-inner-content">
87 <p><?php esc_html_e( 'Auto Sweep will run most of the available Sweepers and will show you results after it finishes the process. Do not close this window while the process is running.', 'sweeppress' ); ?></p>
88 <p><?php esc_html_e( 'Are you sure you want to proceed with the auto sweeping process?', 'sweeppress' ); ?></p>
89 </div>
90 </div>
91 </div>
92