Version Description
- NEW: Delete 'languages' folder from the plugin
- NEW: Use translate.wordpress.org to translate the plugin
- FIXED: Works only with WordPress 4.4 because of new term meta
Download this release
Release Info
Developer | GamerZ |
Plugin | WP-Sweep |
Version | 1.0.6 |
Comparing to | |
See all releases |
Code changes from version 1.0.5 to 1.0.6
- admin.php +512 -469
- composer.json +9 -3
- languages/wp-sweep.pot +0 -321
- readme.txt +11 -3
- wp-sweep.php +850 -799
admin.php
CHANGED
@@ -8,9 +8,9 @@ $message = '';
|
|
8 |
|
9 |
### Sweeping
|
10 |
if( ! empty( $_GET['sweep'] ) ) {
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
}
|
15 |
|
16 |
### Database Table Status
|
@@ -23,6 +23,7 @@ $total_usermeta = WPSweep::get_instance()->total_count( 'usermeta' )
|
|
23 |
$total_term_relationships = WPSweep::get_instance()->total_count( 'term_relationships' );
|
24 |
$total_term_taxonomy = WPSweep::get_instance()->total_count( 'term_taxonomy' );
|
25 |
$total_terms = WPSweep::get_instance()->total_count( 'terms' );
|
|
|
26 |
$total_options = WPSweep::get_instance()->total_count( 'options' );
|
27 |
$total_tables = WPSweep::get_instance()->total_count( 'tables' );
|
28 |
|
@@ -45,476 +46,518 @@ $duplicated_usermeta = WPSweep::get_instance()->count( 'duplicated_userme
|
|
45 |
|
46 |
$orphan_term_relationships = WPSweep::get_instance()->count( 'orphan_term_relationships' );
|
47 |
$unused_terms = WPSweep::get_instance()->count( 'unused_terms' );
|
|
|
|
|
48 |
|
49 |
$transient_options = WPSweep::get_instance()->count( 'transient_options' );
|
50 |
?>
|
51 |
<style type="text/css">
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
</style>
|
62 |
<div class="wrap">
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
520 |
</div>
|
8 |
|
9 |
### Sweeping
|
10 |
if( ! empty( $_GET['sweep'] ) ) {
|
11 |
+
if ( check_admin_referer( 'wp_sweep_' . $_GET['sweep'] ) ) {
|
12 |
+
$message = WPSweep::get_instance()->sweep( $_GET['sweep'] );
|
13 |
+
}
|
14 |
}
|
15 |
|
16 |
### Database Table Status
|
23 |
$total_term_relationships = WPSweep::get_instance()->total_count( 'term_relationships' );
|
24 |
$total_term_taxonomy = WPSweep::get_instance()->total_count( 'term_taxonomy' );
|
25 |
$total_terms = WPSweep::get_instance()->total_count( 'terms' );
|
26 |
+
$total_termmeta = WPSweep::get_instance()->total_count( 'termmeta' );
|
27 |
$total_options = WPSweep::get_instance()->total_count( 'options' );
|
28 |
$total_tables = WPSweep::get_instance()->total_count( 'tables' );
|
29 |
|
46 |
|
47 |
$orphan_term_relationships = WPSweep::get_instance()->count( 'orphan_term_relationships' );
|
48 |
$unused_terms = WPSweep::get_instance()->count( 'unused_terms' );
|
49 |
+
$orphan_termmeta = WPSweep::get_instance()->count( 'orphan_termmeta' );
|
50 |
+
$duplicated_termmeta = WPSweep::get_instance()->count( 'duplicated_termmeta' );
|
51 |
|
52 |
$transient_options = WPSweep::get_instance()->count( 'transient_options' );
|
53 |
?>
|
54 |
<style type="text/css">
|
55 |
+
.table-sweep thead th {
|
56 |
+
width: 12%;
|
57 |
+
}
|
58 |
+
.table-sweep thead th.col-sweep-details {
|
59 |
+
width: 56%;
|
60 |
+
}
|
61 |
+
.table-sweep thead th.col-sweep-action {
|
62 |
+
width: 20%;
|
63 |
+
}
|
64 |
</style>
|
65 |
<div class="wrap">
|
66 |
+
<h2><?php _e( 'WP-Sweep', 'wp-sweep' ); ?></h2>
|
67 |
+
<div class="update-nag">
|
68 |
+
<?php printf( __( 'Before you do any sweep, please <a href="%s" target="%s">backup your database</a> first because any sweep done is irreversible.', 'wp-sweep' ), 'https://wordpress.org/plugins/wp-dbmanager/', '_blank' ); ?>
|
69 |
+
</div>
|
70 |
+
<p>
|
71 |
+
<?php printf( __( 'For performance reasons, only %s items will be shown if you click Details', 'wp-sweep' ), number_format_i18n( WPSweep::get_instance()->limit_details ) ); ?>
|
72 |
+
</p>
|
73 |
+
<h3><?php _e( 'Post Sweep', 'wp-sweep' ); ?></h3>
|
74 |
+
<p><?php printf( __( 'There are a total of <strong class="attention"><span class="sweep-count-type-posts">%s</span> Posts</strong> and <strong class="attention"><span class="sweep-count-type-postmeta">%s</span> Post Meta</strong>.', 'wp-sweep' ), number_format_i18n( $total_posts ), number_format_i18n( $total_postmeta ) ); ?></p>
|
75 |
+
<div class="sweep-message"></div>
|
76 |
+
<table class="widefat table-sweep">
|
77 |
+
<thead>
|
78 |
+
<tr>
|
79 |
+
<th class="col-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></th>
|
80 |
+
<th class="col-sweep-count"><?php _e( 'Count', 'wp-sweep' ); ?></th>
|
81 |
+
<th class="col-sweep-percent"><?php _e( '% Of', 'wp-sweep' ); ?></th>
|
82 |
+
<th class="col-sweep-action"><?php _e( 'Action', 'wp-sweep' ); ?></th>
|
83 |
+
</tr>
|
84 |
+
</thead>
|
85 |
+
<tbody>
|
86 |
+
<tr>
|
87 |
+
<td>
|
88 |
+
<strong><?php _e( 'Revisions', 'wp-sweep' ); ?></strong>
|
89 |
+
<p class="sweep-details" style="display: none;"></p>
|
90 |
+
</td>
|
91 |
+
<td>
|
92 |
+
<span class="sweep-count"><?php echo number_format_i18n( $revisions ); ?></span>
|
93 |
+
</td>
|
94 |
+
<td>
|
95 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $revisions, $total_posts ); ?></span>
|
96 |
+
</td>
|
97 |
+
<td>
|
98 |
+
<?php if( ! empty( $revisions ) ): ?>
|
99 |
+
<button data-action="sweep" data-sweep_name="revisions" data-sweep_type="posts" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_revisions' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
100 |
+
<button data-action="sweep_details" data-sweep_name="revisions" data-sweep_type="posts" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_revisions' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
101 |
+
<?php else: ?>
|
102 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
103 |
+
<?php endif; ?>
|
104 |
+
</td>
|
105 |
+
</tr>
|
106 |
+
<tr class="alternate">
|
107 |
+
<td>
|
108 |
+
<strong><?php _e( 'Auto Drafts', 'wp-sweep' ); ?></strong>
|
109 |
+
<p class="sweep-details" style="display: none;"></p>
|
110 |
+
</td>
|
111 |
+
<td>
|
112 |
+
<span class="sweep-count"><?php echo number_format_i18n( $auto_drafts ); ?></span>
|
113 |
+
</td>
|
114 |
+
<td>
|
115 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $auto_drafts, $total_posts ); ?></span>
|
116 |
+
</td>
|
117 |
+
<td>
|
118 |
+
<?php if( ! empty( $auto_drafts ) ): ?>
|
119 |
+
<button data-action="sweep" data-sweep_name="auto_drafts" data-sweep_type="posts" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_auto_drafts' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
120 |
+
<button data-action="sweep_details" data-sweep_name="auto_drafts" data-sweep_type="posts" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_auto_drafts' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
121 |
+
<?php else: ?>
|
122 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
123 |
+
<?php endif; ?>
|
124 |
+
</td>
|
125 |
+
</tr>
|
126 |
+
<tr>
|
127 |
+
<td>
|
128 |
+
<strong><?php _e( 'Deleted Posts', 'wp-sweep' ); ?></strong>
|
129 |
+
<p class="sweep-details" style="display: none;"></p>
|
130 |
+
</td>
|
131 |
+
<td>
|
132 |
+
<span class="sweep-count"><?php echo number_format_i18n( $deleted_posts ); ?></span>
|
133 |
+
</td>
|
134 |
+
<td>
|
135 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $deleted_posts, $total_posts ); ?></span>
|
136 |
+
</td>
|
137 |
+
<td>
|
138 |
+
<?php if( ! empty( $deleted_posts ) ): ?>
|
139 |
+
<button data-action="sweep" data-sweep_name="deleted_posts" data-sweep_type="posts" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_deleted_posts' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
140 |
+
<button data-action="sweep_details" data-sweep_name="deleted_posts" data-sweep_type="posts" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_deleted_posts' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
141 |
+
<?php else: ?>
|
142 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
143 |
+
<?php endif; ?>
|
144 |
+
</td>
|
145 |
+
</tr>
|
146 |
+
<tr class="alternate">
|
147 |
+
<td>
|
148 |
+
<strong><?php _e( 'Orphaned Post Meta', 'wp-sweep' ); ?></strong>
|
149 |
+
<p class="sweep-details" style="display: none;"></p>
|
150 |
+
</td>
|
151 |
+
<td>
|
152 |
+
<span class="sweep-count"><?php echo number_format_i18n( $orphan_postmeta ); ?></span>
|
153 |
+
</td>
|
154 |
+
<td>
|
155 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $orphan_postmeta, $total_postmeta ); ?></span>
|
156 |
+
</td>
|
157 |
+
<td>
|
158 |
+
<?php if( ! empty( $orphan_postmeta ) ): ?>
|
159 |
+
<button data-action="sweep" data-sweep_name="orphan_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_orphan_postmeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
160 |
+
<button data-action="sweep_details" data-sweep_name="orphan_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_orphan_postmeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
161 |
+
<?php else: ?>
|
162 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
163 |
+
<?php endif; ?>
|
164 |
+
</td>
|
165 |
+
</tr>
|
166 |
+
<tr>
|
167 |
+
<td>
|
168 |
+
<strong><?php _e( 'Duplicated Post Meta', 'wp-sweep' ); ?></strong>
|
169 |
+
<p class="sweep-details" style="display: none;"></p>
|
170 |
+
</td>
|
171 |
+
<td>
|
172 |
+
<span class="sweep-count"><?php echo number_format_i18n( $duplicated_postmeta ); ?></span>
|
173 |
+
</td>
|
174 |
+
<td>
|
175 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $duplicated_postmeta, $total_postmeta ); ?></span>
|
176 |
+
</td>
|
177 |
+
<td>
|
178 |
+
<?php if( ! empty( $duplicated_postmeta ) ): ?>
|
179 |
+
<button data-action="sweep" data-sweep_name="duplicated_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_duplicated_postmeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
180 |
+
<button data-action="sweep_details" data-sweep_name="duplicated_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_duplicated_postmeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
181 |
+
<?php else: ?>
|
182 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
183 |
+
<?php endif; ?>
|
184 |
+
</td>
|
185 |
+
</tr>
|
186 |
+
<tr class="alternate">
|
187 |
+
<td>
|
188 |
+
<strong><?php _e( 'oEmbed Caches In Post Meta', 'wp-sweep' ); ?></strong>
|
189 |
+
<p class="sweep-details" style="display: none;"></p>
|
190 |
+
</td>
|
191 |
+
<td>
|
192 |
+
<span class="sweep-count"><?php echo number_format_i18n( $oembed_postmeta ); ?></span>
|
193 |
+
</td>
|
194 |
+
<td>
|
195 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $oembed_postmeta, $total_postmeta ); ?></span>
|
196 |
+
</td>
|
197 |
+
<td>
|
198 |
+
<?php if( ! empty( $oembed_postmeta ) ): ?>
|
199 |
+
<button data-action="sweep" data-sweep_name="oembed_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_oembed_postmeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
200 |
+
<button data-action="sweep_details" data-sweep_name="oembed_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_oembed_postmeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
201 |
+
<?php else: ?>
|
202 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
203 |
+
<?php endif; ?>
|
204 |
+
</td>
|
205 |
+
</tr>
|
206 |
+
</tbody>
|
207 |
+
</table>
|
208 |
+
<?php do_action( 'wp_sweep_admin_post_sweep' ); ?>
|
209 |
+
<p> </p>
|
210 |
+
<h3><?php _e( 'Comment Sweep', 'wp-sweep' ); ?></h3>
|
211 |
+
<p><?php printf( __( 'There are a total of <strong class="attention"><span class="sweep-count-type-comments">%s</span> Comments</strong> and <strong class="attention"><span class="sweep-count-type-commentmeta">%s</span> Comment Meta</strong>.', 'wp-sweep' ), number_format_i18n( $total_comments ), number_format_i18n( $total_commentmeta ) ); ?></p>
|
212 |
+
<div class="sweep-message"></div>
|
213 |
+
<table class="widefat table-sweep">
|
214 |
+
<thead>
|
215 |
+
<tr>
|
216 |
+
<th class="col-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></th>
|
217 |
+
<th class="col-sweep-count"><?php _e( 'Count', 'wp-sweep' ); ?></th>
|
218 |
+
<th class="col-sweep-percent"><?php _e( '% Of', 'wp-sweep' ); ?></th>
|
219 |
+
<th class="col-sweep-action"><?php _e( 'Action', 'wp-sweep' ); ?></th>
|
220 |
+
</tr>
|
221 |
+
</thead>
|
222 |
+
<tbody>
|
223 |
+
<tr>
|
224 |
+
<td>
|
225 |
+
<strong><?php _e( 'Unapproved Comments', 'wp-sweep' ); ?></strong>
|
226 |
+
<p class="sweep-details" style="display: none;"></p>
|
227 |
+
</td>
|
228 |
+
<td>
|
229 |
+
<span class="sweep-count"><?php echo number_format_i18n( $unapproved_comments ); ?></span>
|
230 |
+
</td>
|
231 |
+
<td>
|
232 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $unapproved_comments, $total_comments ); ?></span>
|
233 |
+
</td>
|
234 |
+
<td>
|
235 |
+
<?php if( ! empty( $unapproved_comments ) ): ?>
|
236 |
+
<button data-action="sweep" data-sweep_name="unapproved_comments" data-sweep_type="comments" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_unapproved_comments' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
237 |
+
<button data-action="sweep_details" data-sweep_name="unapproved_comments" data-sweep_type="comments" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_unapproved_comments' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
238 |
+
<?php else: ?>
|
239 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
240 |
+
<?php endif; ?>
|
241 |
+
</td>
|
242 |
+
</tr>
|
243 |
+
<tr class="alternate">
|
244 |
+
<td>
|
245 |
+
<strong><?php _e( 'Spammed Comments', 'wp-sweep' ); ?></strong>
|
246 |
+
<p class="sweep-details" style="display: none;"></p>
|
247 |
+
</td>
|
248 |
+
<td>
|
249 |
+
<span class="sweep-count"><?php echo number_format_i18n( $spam_comments ); ?></span>
|
250 |
+
</td>
|
251 |
+
<td>
|
252 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $spam_comments, $total_comments ); ?></span>
|
253 |
+
</td>
|
254 |
+
<td>
|
255 |
+
<?php if( ! empty( $spam_comments ) ): ?>
|
256 |
+
<button data-action="sweep" data-sweep_name="spam_comments" data-sweep_type="comments" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_spam_comments' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
257 |
+
<button data-action="sweep_details" data-sweep_name="spam_comments" data-sweep_type="comments" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_spam_comments' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
258 |
+
<?php else: ?>
|
259 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
260 |
+
<?php endif; ?>
|
261 |
+
</td>
|
262 |
+
</tr>
|
263 |
+
<tr>
|
264 |
+
<td>
|
265 |
+
<strong><?php _e( 'Deleted Comments', 'wp-sweep' ); ?></strong>
|
266 |
+
<p class="sweep-details" style="display: none;"></p>
|
267 |
+
</td>
|
268 |
+
<td>
|
269 |
+
<span class="sweep-count"><?php echo number_format_i18n( $deleted_comments ); ?></span>
|
270 |
+
</td>
|
271 |
+
<td>
|
272 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $deleted_comments, $total_comments ); ?></span>
|
273 |
+
</td>
|
274 |
+
<td>
|
275 |
+
<?php if( ! empty( $deleted_comments ) ): ?>
|
276 |
+
<button data-action="sweep" data-sweep_name="deleted_comments" data-sweep_type="comments" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_deleted_comments' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
277 |
+
<button data-action="sweep_details" data-sweep_name="deleted_comments" data-sweep_type="comments" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_deleted_comments' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
278 |
+
<?php else: ?>
|
279 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
280 |
+
<?php endif; ?>
|
281 |
+
</td>
|
282 |
+
</tr>
|
283 |
+
<tr class="alternate">
|
284 |
+
<td>
|
285 |
+
<strong><?php _e( 'Orphaned Comment Meta', 'wp-sweep' ); ?></strong>
|
286 |
+
<p class="sweep-details" style="display: none;"></p>
|
287 |
+
</td>
|
288 |
+
<td>
|
289 |
+
<span class="sweep-count"><?php echo number_format_i18n( $orphan_commentmeta ); ?></span>
|
290 |
+
</td>
|
291 |
+
<td>
|
292 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $orphan_commentmeta, $total_commentmeta ); ?></span>
|
293 |
+
</td>
|
294 |
+
<td>
|
295 |
+
<?php if( ! empty( $orphan_commentmeta ) ): ?>
|
296 |
+
<button data-action="sweep" data-sweep_name="orphan_commentmeta" data-sweep_type="commentmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_orphan_commentmeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
297 |
+
<button data-action="sweep_details" data-sweep_name="orphan_commentmeta" data-sweep_type="commentmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_orphan_commentmeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
298 |
+
<?php else: ?>
|
299 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
300 |
+
<?php endif; ?>
|
301 |
+
</td>
|
302 |
+
</tr>
|
303 |
+
<tr>
|
304 |
+
<td>
|
305 |
+
<strong><?php _e( 'Duplicated Comment Meta', 'wp-sweep' ); ?></strong>
|
306 |
+
<p class="sweep-details" style="display: none;"></p>
|
307 |
+
</td>
|
308 |
+
<td>
|
309 |
+
<span class="sweep-count"><?php echo number_format_i18n( $duplicated_commentmeta ); ?></span>
|
310 |
+
</td>
|
311 |
+
<td>
|
312 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $duplicated_commentmeta, $total_commentmeta ); ?></span>
|
313 |
+
</td>
|
314 |
+
<td>
|
315 |
+
<?php if( ! empty( $duplicated_commentmeta ) ): ?>
|
316 |
+
<button data-action="sweep" data-sweep_name="duplicated_commentmeta" data-sweep_type="commentmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_duplicated_commentmeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
317 |
+
<button data-action="sweep_details" data-sweep_name="duplicated_commentmeta" data-sweep_type="commentmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_duplicated_commentmeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
318 |
+
<?php else: ?>
|
319 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
320 |
+
<?php endif; ?>
|
321 |
+
</td>
|
322 |
+
</tr>
|
323 |
+
</tbody>
|
324 |
+
</table>
|
325 |
+
<?php do_action( 'wp_sweep_admin_comment_sweep' ); ?>
|
326 |
+
<p> </p>
|
327 |
+
<h3><?php _e( 'User Sweep', 'wp-sweep' ); ?></h3>
|
328 |
+
<p><?php printf( __( 'There are a total of <strong class="attention"><span class="sweep-count-type-users">%s</span> Users</strong> and <strong class="attention"><span class="sweep-count-type-usermeta">%s</span> User Meta</strong>.', 'wp-sweep' ), number_format_i18n( $total_users ), number_format_i18n( $total_usermeta ) ); ?></p>
|
329 |
+
<div class="sweep-message"></div>
|
330 |
+
<table class="widefat table-sweep">
|
331 |
+
<thead>
|
332 |
+
<tr>
|
333 |
+
<th class="col-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></th>
|
334 |
+
<th class="col-sweep-count"><?php _e( 'Count', 'wp-sweep' ); ?></th>
|
335 |
+
<th class="col-sweep-percent"><?php _e( '% Of', 'wp-sweep' ); ?></th>
|
336 |
+
<th class="col-sweep-action"><?php _e( 'Action', 'wp-sweep' ); ?></th>
|
337 |
+
</tr>
|
338 |
+
</thead>
|
339 |
+
<tbody>
|
340 |
+
<tr>
|
341 |
+
<td>
|
342 |
+
<strong><?php _e( 'Orphaned User Meta', 'wp-sweep' ); ?></strong>
|
343 |
+
<p class="sweep-details" style="display: none;"></p>
|
344 |
+
</td>
|
345 |
+
<td>
|
346 |
+
<span class="sweep-count"><?php echo number_format_i18n( $orphan_usermeta ); ?></span>
|
347 |
+
</td>
|
348 |
+
<td>
|
349 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $orphan_usermeta, $total_usermeta ); ?></span>
|
350 |
+
</td>
|
351 |
+
<td>
|
352 |
+
<?php if( ! empty( $orphan_usermeta ) ): ?>
|
353 |
+
<button data-action="sweep" data-sweep_name="orphan_usermeta" data-sweep_type="usermeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_orphan_usermeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
354 |
+
<button data-action="sweep_details" data-sweep_name="orphan_usermeta" data-sweep_type="usermeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_orphan_usermeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
355 |
+
<?php else: ?>
|
356 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
357 |
+
<?php endif; ?>
|
358 |
+
</td>
|
359 |
+
</tr>
|
360 |
+
<tr class="alternate">
|
361 |
+
<td>
|
362 |
+
<strong><?php _e( 'Duplicated User Meta', 'wp-sweep' ); ?></strong>
|
363 |
+
<p class="sweep-details" style="display: none;"></p>
|
364 |
+
</td>
|
365 |
+
<td>
|
366 |
+
<span class="sweep-count"><?php echo number_format_i18n( $duplicated_usermeta ); ?></span>
|
367 |
+
</td>
|
368 |
+
<td>
|
369 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $duplicated_usermeta, $total_usermeta ); ?></span>
|
370 |
+
</td>
|
371 |
+
<td>
|
372 |
+
<?php if( ! empty( $duplicated_usermeta ) ): ?>
|
373 |
+
<button data-action="sweep" data-sweep_name="duplicated_usermeta" data-sweep_type="usermeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_duplicated_usermeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
374 |
+
<button data-action="sweep_details" data-sweep_name="duplicated_usermeta" data-sweep_type="usermeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_duplicated_usermeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
375 |
+
<?php else: ?>
|
376 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
377 |
+
<?php endif; ?>
|
378 |
+
</td>
|
379 |
+
</tr>
|
380 |
+
</tbody>
|
381 |
+
</table>
|
382 |
+
<?php do_action( 'wp_sweep_admin_user_sweep' ); ?>
|
383 |
+
<p> </p>
|
384 |
+
<h3><?php _e( 'Term Sweep', 'wp-sweep' ); ?></h3>
|
385 |
+
<p><?php printf( __( 'There are a total of <strong class="attention "><span class="sweep-count-type-terms">%s</span> Terms</strong>, <strong class="attention "><span class="sweep-count-type-termmeta">%s</span> Term Meta</strong>, <strong class="attention"><span class="sweep-count-type-term_taxonomy">%s</span> Term Taxonomy</strong> and <strong class="attention"><span class="sweep-count-type-term_relationships">%s</span> Term Relationships</strong>.', 'wp-sweep' ), number_format_i18n( $total_terms ), number_format_i18n( $total_termmeta ), number_format_i18n( $total_term_taxonomy ), number_format_i18n( $total_term_relationships ) ); ?></p>
|
386 |
+
<div class="sweep-message"></div>
|
387 |
+
<table class="widefat table-sweep">
|
388 |
+
<thead>
|
389 |
+
<tr>
|
390 |
+
<th class="col-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></th>
|
391 |
+
<th class="col-sweep-count"><?php _e( 'Count', 'wp-sweep' ); ?></th>
|
392 |
+
<th class="col-sweep-percent"><?php _e( '% Of', 'wp-sweep' ); ?></th>
|
393 |
+
<th class="col-sweep-action"><?php _e( 'Action', 'wp-sweep' ); ?></th>
|
394 |
+
</tr>
|
395 |
+
</thead>
|
396 |
+
<tbody>
|
397 |
+
<tr>
|
398 |
+
<td>
|
399 |
+
<strong><?php _e( 'Orphaned Term Meta', 'wp-sweep' ); ?></strong>
|
400 |
+
<p class="sweep-details" style="display: none;"></p>
|
401 |
+
</td>
|
402 |
+
<td>
|
403 |
+
<span class="sweep-count"><?php echo number_format_i18n( $orphan_termmeta ); ?></span>
|
404 |
+
</td>
|
405 |
+
<td>
|
406 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $orphan_termmeta, $total_termmeta ); ?></span>
|
407 |
+
</td>
|
408 |
+
<td>
|
409 |
+
<?php if( ! empty( $orphan_termmeta ) ): ?>
|
410 |
+
<button data-action="sweep" data-sweep_name="orphan_termmeta" data-sweep_type="termmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_orphan_termmeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
411 |
+
<button data-action="sweep_details" data-sweep_name="orphan_termmeta" data-sweep_type="termmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_orphan_termmeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
412 |
+
<?php else: ?>
|
413 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
414 |
+
<?php endif; ?>
|
415 |
+
</td>
|
416 |
+
</tr>
|
417 |
+
<tr class="alternate">
|
418 |
+
<td>
|
419 |
+
<strong><?php _e( 'Duplicated Term Meta', 'wp-sweep' ); ?></strong>
|
420 |
+
<p class="sweep-details" style="display: none;"></p>
|
421 |
+
</td>
|
422 |
+
<td>
|
423 |
+
<span class="sweep-count"><?php echo number_format_i18n( $duplicated_termmeta ); ?></span>
|
424 |
+
</td>
|
425 |
+
<td>
|
426 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $duplicated_termmeta, $total_termmeta ); ?></span>
|
427 |
+
</td>
|
428 |
+
<td>
|
429 |
+
<?php if( ! empty( $duplicated_termmeta ) ): ?>
|
430 |
+
<button data-action="sweep" data-sweep_name="duplicated_termmeta" data-sweep_type="termmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_duplicated_termmeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
431 |
+
<button data-action="sweep_details" data-sweep_name="duplicated_termmeta" data-sweep_type="termmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_duplicated_termmeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
432 |
+
<?php else: ?>
|
433 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
434 |
+
<?php endif; ?>
|
435 |
+
</td>
|
436 |
+
</tr>
|
437 |
+
<tr>
|
438 |
+
<td>
|
439 |
+
<strong><?php _e( 'Orphaned Term Relationship', 'wp-sweep' ); ?></strong>
|
440 |
+
<p class="sweep-details" style="display: none;"></p>
|
441 |
+
</td>
|
442 |
+
<td>
|
443 |
+
<span class="sweep-count"><?php echo number_format_i18n( $orphan_term_relationships ); ?></span>
|
444 |
+
</td>
|
445 |
+
<td>
|
446 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $orphan_term_relationships, $total_term_relationships ); ?></span>
|
447 |
+
</td>
|
448 |
+
<td>
|
449 |
+
<?php if( ! empty( $orphan_term_relationships ) ): ?>
|
450 |
+
<button data-action="sweep" data-sweep_name="orphan_term_relationships" data-sweep_type="term_relationships" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_orphan_term_relationships' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
451 |
+
<button data-action="sweep_details" data-sweep_name="orphan_term_relationships" data-sweep_type="term_relationships" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_orphan_term_relationships' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
452 |
+
<?php else: ?>
|
453 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
454 |
+
<?php endif; ?>
|
455 |
+
</td>
|
456 |
+
</tr>
|
457 |
+
<tr class="alternate">
|
458 |
+
<td>
|
459 |
+
<strong><?php _e( 'Unused Terms', 'wp-sweep' ); ?></strong>
|
460 |
+
<p><?php _e( 'Note that some unused terms might belong to draft posts that have not been published yet. Only sweep this when you do not have any draft posts.', 'wp-sweep' ); ?></p>
|
461 |
+
<p class="sweep-details" style="display: none;"></p>
|
462 |
+
</td>
|
463 |
+
<td>
|
464 |
+
<span class="sweep-count"><?php echo number_format_i18n( $unused_terms ); ?></span>
|
465 |
+
</td>
|
466 |
+
<td>
|
467 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $unused_terms, $total_terms ); ?></span>
|
468 |
+
</td>
|
469 |
+
<td>
|
470 |
+
<?php if( ! empty( $unused_terms ) ): ?>
|
471 |
+
<button data-action="sweep" data-sweep_name="unused_terms" data-sweep_type="terms" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_unused_terms' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
472 |
+
<button data-action="sweep_details" data-sweep_name="unused_terms" data-sweep_type="terms" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_unused_terms' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
473 |
+
<?php else: ?>
|
474 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
475 |
+
<?php endif; ?>
|
476 |
+
</td>
|
477 |
+
</tr>
|
478 |
+
</tbody>
|
479 |
+
</table>
|
480 |
+
<?php do_action( 'wp_sweep_admin_term_sweep' ); ?>
|
481 |
+
<p> </p>
|
482 |
+
<h3><?php _e( 'Option Sweep', 'wp-sweep' ); ?></h3>
|
483 |
+
<p><?php printf( __( 'There are a total of <strong class="attention"><span class="sweep-count-type-options">%s</span> Options</strong>.', 'wp-sweep' ), number_format_i18n( $total_options ) ); ?></p>
|
484 |
+
<div class="sweep-message"></div>
|
485 |
+
<table class="widefat table-sweep">
|
486 |
+
<thead>
|
487 |
+
<tr>
|
488 |
+
<th class="col-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></th>
|
489 |
+
<th class="col-sweep-count"><?php _e( 'Count', 'wp-sweep' ); ?></th>
|
490 |
+
<th class="col-sweep-percent"><?php _e( '% Of', 'wp-sweep' ); ?></th>
|
491 |
+
<th class="col-sweep-action"><?php _e( 'Action', 'wp-sweep' ); ?></th>
|
492 |
+
</tr>
|
493 |
+
</thead>
|
494 |
+
<tbody>
|
495 |
+
<tr>
|
496 |
+
<td>
|
497 |
+
<strong><?php _e( 'Transient Options', 'wp-sweep' ); ?></strong>
|
498 |
+
<p class="sweep-details" style="display: none;"></p>
|
499 |
+
</td>
|
500 |
+
<td>
|
501 |
+
<span class="sweep-count"><?php echo number_format_i18n( $transient_options ); ?></span>
|
502 |
+
</td>
|
503 |
+
<td>
|
504 |
+
<span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $transient_options, $total_options ); ?></span>
|
505 |
+
</td>
|
506 |
+
<td>
|
507 |
+
<?php if( ! empty( $transient_options ) ): ?>
|
508 |
+
<button data-action="sweep" data-sweep_name="transient_options" data-sweep_type="options" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_transient_options' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
509 |
+
<button data-action="sweep_details" data-sweep_name="transient_options" data-sweep_type="options" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_transient_options' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
510 |
+
<?php else: ?>
|
511 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
512 |
+
<?php endif; ?>
|
513 |
+
</td>
|
514 |
+
</tr>
|
515 |
+
</tbody>
|
516 |
+
</table>
|
517 |
+
<?php do_action( 'wp_sweep_admin_option_sweep' ); ?>
|
518 |
+
<p> </p>
|
519 |
+
<h3><?php _e( 'Database Sweep', 'wp-sweep' ); ?></h3>
|
520 |
+
<p><?php printf( __( 'There are a total of <strong class="attention"><span class="sweep-count-type-tables">%s</span> Tables</strong>.', 'wp-sweep' ), number_format_i18n( $total_tables ) ); ?></p>
|
521 |
+
<div class="sweep-message"></div>
|
522 |
+
<table class="widefat table-sweep">
|
523 |
+
<thead>
|
524 |
+
<tr>
|
525 |
+
<th class="col-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></th>
|
526 |
+
<th class="col-sweep-count"><?php _e( 'Count', 'wp-sweep' ); ?></th>
|
527 |
+
<th class="col-sweep-percent"><?php _e( '% Of', 'wp-sweep' ); ?></th>
|
528 |
+
<th class="col-sweep-action"><?php _e( 'Action', 'wp-sweep' ); ?></th>
|
529 |
+
</tr>
|
530 |
+
</thead>
|
531 |
+
<tbody>
|
532 |
+
<tr>
|
533 |
+
<td>
|
534 |
+
<strong><?php _e( 'Optimize Tables', 'wp-sweep' ); ?></strong>
|
535 |
+
<p class="sweep-details" style="display: none;"></p>
|
536 |
+
</td>
|
537 |
+
<td>
|
538 |
+
<span class="sweep-count"><?php echo number_format_i18n( $total_tables ); ?></span>
|
539 |
+
</td>
|
540 |
+
<td>
|
541 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
542 |
+
</td>
|
543 |
+
<td>
|
544 |
+
<?php if( ! empty( $total_tables ) ): ?>
|
545 |
+
<button data-action="sweep" data-sweep_name="optimize_database" data-sweep_type="tables" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_optimize_database' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button>
|
546 |
+
<button data-action="sweep_details" data-sweep_name="optimize_database" data-sweep_type="tables" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_optimize_database' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button>
|
547 |
+
<?php else: ?>
|
548 |
+
<?php _e( 'N/A', 'wp-sweep' ); ?>
|
549 |
+
<?php endif; ?>
|
550 |
+
</td>
|
551 |
+
</tr>
|
552 |
+
</tbody>
|
553 |
+
</table>
|
554 |
+
<?php do_action( 'wp_sweep_admin_database_sweep' ); ?>
|
555 |
+
<p> </p>
|
556 |
+
<h3><?php _e( 'Sweep All', 'wp-sweep' ); ?></h3>
|
557 |
+
<p><?php _e( 'Note that some unused terms might belong to draft posts that have not been published yet. Only sweep all when you do not have any draft posts.', 'wp-sweep' ); ?></p>
|
558 |
+
<div class="sweep-all">
|
559 |
+
<p style="text-align: center;">
|
560 |
+
<button class="button button-primary btn-sweep-all"><?php _e( 'Sweep All', 'wp-sweep' ); ?></button>
|
561 |
+
</p>
|
562 |
+
</div>
|
563 |
</div>
|
composer.json
CHANGED
@@ -1,10 +1,16 @@
|
|
1 |
{
|
2 |
-
"name": "wp-sweep
|
3 |
"description": "WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It also optimizes your database tables.",
|
4 |
"keywords": ["wordpress", "plugin", "wp-sweep", "sweep"],
|
5 |
-
"homepage": "https://wordpress.org/plugins/wp-sweep/",
|
6 |
"type": "wordpress-plugin",
|
7 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
"require": {
|
9 |
"php": ">=5.3.2",
|
10 |
"composer/installers": "~1.0"
|
1 |
{
|
2 |
+
"name": "lesterchan/wp-sweep",
|
3 |
"description": "WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It also optimizes your database tables.",
|
4 |
"keywords": ["wordpress", "plugin", "wp-sweep", "sweep"],
|
|
|
5 |
"type": "wordpress-plugin",
|
6 |
+
"homepage": "https://wordpress.org/plugins/wp-sweep/",
|
7 |
+
"authors": [
|
8 |
+
{
|
9 |
+
"name": "Lester Chan",
|
10 |
+
"email": "lesterchan@gmail.com"
|
11 |
+
}
|
12 |
+
],
|
13 |
+
"license" : "GPL-2.0+",
|
14 |
"require": {
|
15 |
"php": ">=5.3.2",
|
16 |
"composer/installers": "~1.0"
|
languages/wp-sweep.pot
DELETED
@@ -1,321 +0,0 @@
|
|
1 |
-
# Copyright (C) 2015 WP-Sweep
|
2 |
-
# This file is distributed under the same license as the WP-Sweep package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: WP-Sweep 1.0.5\n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/wp-sweep\n"
|
7 |
-
"POT-Creation-Date: 2015-04-23 07:55:55+00:00\n"
|
8 |
-
"MIME-Version: 1.0\n"
|
9 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
-
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
|
12 |
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
-
|
15 |
-
#. #-#-#-#-# plugin.pot (WP-Sweep 1.0.5) #-#-#-#-#
|
16 |
-
#. Plugin Name of the plugin/theme
|
17 |
-
#: admin.php:63
|
18 |
-
msgid "WP-Sweep"
|
19 |
-
msgstr ""
|
20 |
-
|
21 |
-
#: admin.php:65
|
22 |
-
msgid ""
|
23 |
-
"Before you do any sweep, please <a href=\"%s\" target=\"%s\">backup your "
|
24 |
-
"database</a> first because any sweep done is irreversible."
|
25 |
-
msgstr ""
|
26 |
-
|
27 |
-
#: admin.php:68
|
28 |
-
msgid ""
|
29 |
-
"For performance reasons, only %s items will be shown if you click Details"
|
30 |
-
msgstr ""
|
31 |
-
|
32 |
-
#: admin.php:70
|
33 |
-
msgid "Post Sweep"
|
34 |
-
msgstr ""
|
35 |
-
|
36 |
-
#: admin.php:71
|
37 |
-
msgid ""
|
38 |
-
"There are a total of <strong class=\"attention\"><span class=\"sweep-count-"
|
39 |
-
"type-posts\">%s</span> Posts</strong> and <strong class=\"attention\"><span "
|
40 |
-
"class=\"sweep-count-type-postmeta\">%s</span> Post Meta</strong>."
|
41 |
-
msgstr ""
|
42 |
-
|
43 |
-
#: admin.php:76 admin.php:97 admin.php:117 admin.php:137 admin.php:157
|
44 |
-
#: admin.php:177 admin.php:197 admin.php:213 admin.php:234 admin.php:254
|
45 |
-
#: admin.php:274 admin.php:294 admin.php:314 admin.php:330 admin.php:351
|
46 |
-
#: admin.php:371 admin.php:387 admin.php:408 admin.php:429 admin.php:445
|
47 |
-
#: admin.php:466 admin.php:482 admin.php:503
|
48 |
-
msgid "Details"
|
49 |
-
msgstr ""
|
50 |
-
|
51 |
-
#: admin.php:77 admin.php:214 admin.php:331 admin.php:388 admin.php:446
|
52 |
-
#: admin.php:483
|
53 |
-
msgid "Count"
|
54 |
-
msgstr ""
|
55 |
-
|
56 |
-
#: admin.php:78 admin.php:215 admin.php:332 admin.php:389 admin.php:447
|
57 |
-
#: admin.php:484
|
58 |
-
msgid "% Of"
|
59 |
-
msgstr ""
|
60 |
-
|
61 |
-
#: admin.php:79 admin.php:216 admin.php:333 admin.php:390 admin.php:448
|
62 |
-
#: admin.php:485
|
63 |
-
msgid "Action"
|
64 |
-
msgstr ""
|
65 |
-
|
66 |
-
#: admin.php:85
|
67 |
-
msgid "Revisions"
|
68 |
-
msgstr ""
|
69 |
-
|
70 |
-
#: admin.php:96 admin.php:116 admin.php:136 admin.php:156 admin.php:176
|
71 |
-
#: admin.php:196 admin.php:233 admin.php:253 admin.php:273 admin.php:293
|
72 |
-
#: admin.php:313 admin.php:350 admin.php:370 admin.php:407 admin.php:428
|
73 |
-
#: admin.php:465 admin.php:502 wp-sweep.php:146 wp-sweep.php:162
|
74 |
-
msgid "Sweep"
|
75 |
-
msgstr ""
|
76 |
-
|
77 |
-
#: admin.php:99 admin.php:119 admin.php:139 admin.php:159 admin.php:179
|
78 |
-
#: admin.php:199 admin.php:236 admin.php:256 admin.php:276 admin.php:296
|
79 |
-
#: admin.php:316 admin.php:353 admin.php:373 admin.php:410 admin.php:431
|
80 |
-
#: admin.php:468 admin.php:498 admin.php:505 wp-sweep.php:149
|
81 |
-
msgid "N/A"
|
82 |
-
msgstr ""
|
83 |
-
|
84 |
-
#: admin.php:105
|
85 |
-
msgid "Auto Drafts"
|
86 |
-
msgstr ""
|
87 |
-
|
88 |
-
#: admin.php:125
|
89 |
-
msgid "Deleted Posts"
|
90 |
-
msgstr ""
|
91 |
-
|
92 |
-
#: admin.php:145
|
93 |
-
msgid "Orphaned Post Meta"
|
94 |
-
msgstr ""
|
95 |
-
|
96 |
-
#: admin.php:165
|
97 |
-
msgid "Duplicated Post Meta"
|
98 |
-
msgstr ""
|
99 |
-
|
100 |
-
#: admin.php:185
|
101 |
-
msgid "oEmbed Caches In Post Meta"
|
102 |
-
msgstr ""
|
103 |
-
|
104 |
-
#: admin.php:207
|
105 |
-
msgid "Comment Sweep"
|
106 |
-
msgstr ""
|
107 |
-
|
108 |
-
#: admin.php:208
|
109 |
-
msgid ""
|
110 |
-
"There are a total of <strong class=\"attention\"><span class=\"sweep-count-"
|
111 |
-
"type-comments\">%s</span> Comments</strong> and <strong class=\"attention"
|
112 |
-
"\"><span class=\"sweep-count-type-commentmeta\">%s</span> Comment Meta</"
|
113 |
-
"strong>."
|
114 |
-
msgstr ""
|
115 |
-
|
116 |
-
#: admin.php:222
|
117 |
-
msgid "Unapproved Comments"
|
118 |
-
msgstr ""
|
119 |
-
|
120 |
-
#: admin.php:242
|
121 |
-
msgid "Spammed Comments"
|
122 |
-
msgstr ""
|
123 |
-
|
124 |
-
#: admin.php:262
|
125 |
-
msgid "Deleted Comments"
|
126 |
-
msgstr ""
|
127 |
-
|
128 |
-
#: admin.php:282
|
129 |
-
msgid "Orphaned Comment Meta"
|
130 |
-
msgstr ""
|
131 |
-
|
132 |
-
#: admin.php:302
|
133 |
-
msgid "Duplicated Comment Meta"
|
134 |
-
msgstr ""
|
135 |
-
|
136 |
-
#: admin.php:324
|
137 |
-
msgid "User Sweep"
|
138 |
-
msgstr ""
|
139 |
-
|
140 |
-
#: admin.php:325
|
141 |
-
msgid ""
|
142 |
-
"There are a total of <strong class=\"attention\"><span class=\"sweep-count-"
|
143 |
-
"type-users\">%s</span> Users</strong> and <strong class=\"attention\"><span "
|
144 |
-
"class=\"sweep-count-type-usermeta\">%s</span> User Meta</strong>."
|
145 |
-
msgstr ""
|
146 |
-
|
147 |
-
#: admin.php:339
|
148 |
-
msgid "Orphaned User Meta"
|
149 |
-
msgstr ""
|
150 |
-
|
151 |
-
#: admin.php:359
|
152 |
-
msgid "Duplicated User Meta"
|
153 |
-
msgstr ""
|
154 |
-
|
155 |
-
#: admin.php:381
|
156 |
-
msgid "Term Sweep"
|
157 |
-
msgstr ""
|
158 |
-
|
159 |
-
#: admin.php:382
|
160 |
-
msgid ""
|
161 |
-
"There are a total of <strong class=\"attention \"><span class=\"sweep-count-"
|
162 |
-
"type-terms\">%s</span> Terms</strong>, <strong class=\"attention\"><span "
|
163 |
-
"class=\"sweep-count-type-term_taxonomy\">%s</span> Term Taxonomy</strong> "
|
164 |
-
"and <strong class=\"attention\"><span class=\"sweep-count-type-"
|
165 |
-
"term_relationships\">%s</span> Term Relationships</strong>."
|
166 |
-
msgstr ""
|
167 |
-
|
168 |
-
#: admin.php:396
|
169 |
-
msgid "Orphaned Term Relationship"
|
170 |
-
msgstr ""
|
171 |
-
|
172 |
-
#: admin.php:416
|
173 |
-
msgid "Unused Terms"
|
174 |
-
msgstr ""
|
175 |
-
|
176 |
-
#: admin.php:417
|
177 |
-
msgid ""
|
178 |
-
"Note that some unused terms might belong to draft posts that have not been "
|
179 |
-
"published yet. Only sweep this when you do not have any draft posts."
|
180 |
-
msgstr ""
|
181 |
-
|
182 |
-
#: admin.php:439
|
183 |
-
msgid "Option Sweep"
|
184 |
-
msgstr ""
|
185 |
-
|
186 |
-
#: admin.php:440
|
187 |
-
msgid ""
|
188 |
-
"There are a total of <strong class=\"attention\"><span class=\"sweep-count-"
|
189 |
-
"type-options\">%s</span> Options</strong>."
|
190 |
-
msgstr ""
|
191 |
-
|
192 |
-
#: admin.php:454
|
193 |
-
msgid "Transient Options"
|
194 |
-
msgstr ""
|
195 |
-
|
196 |
-
#: admin.php:476
|
197 |
-
msgid "Database Sweep"
|
198 |
-
msgstr ""
|
199 |
-
|
200 |
-
#: admin.php:477
|
201 |
-
msgid ""
|
202 |
-
"There are a total of <strong class=\"attention\"><span class=\"sweep-count-"
|
203 |
-
"type-tables\">%s</span> Tables</strong>."
|
204 |
-
msgstr ""
|
205 |
-
|
206 |
-
#: admin.php:491
|
207 |
-
msgid "Optimize Tables"
|
208 |
-
msgstr ""
|
209 |
-
|
210 |
-
#: admin.php:513 admin.php:517 wp-sweep.php:147
|
211 |
-
msgid "Sweep All"
|
212 |
-
msgstr ""
|
213 |
-
|
214 |
-
#: admin.php:514
|
215 |
-
msgid ""
|
216 |
-
"Note that some unused terms might belong to draft posts that have not been "
|
217 |
-
"published yet. Only sweep all when you do not have any draft posts."
|
218 |
-
msgstr ""
|
219 |
-
|
220 |
-
#: wp-sweep.php:145
|
221 |
-
msgid ""
|
222 |
-
"Sweeping is in progress. If you leave now the process won't be completed."
|
223 |
-
msgstr ""
|
224 |
-
|
225 |
-
#: wp-sweep.php:148
|
226 |
-
msgid "Sweeping ..."
|
227 |
-
msgstr ""
|
228 |
-
|
229 |
-
#: wp-sweep.php:179 wp-sweep.php:200
|
230 |
-
msgid "Failed to verify referrer."
|
231 |
-
msgstr ""
|
232 |
-
|
233 |
-
#: wp-sweep.php:488
|
234 |
-
msgid "%s Revisions Processed"
|
235 |
-
msgstr ""
|
236 |
-
|
237 |
-
#: wp-sweep.php:498
|
238 |
-
msgid "%s Auto Drafts Processed"
|
239 |
-
msgstr ""
|
240 |
-
|
241 |
-
#: wp-sweep.php:508
|
242 |
-
msgid "%s Deleted Posts Processed"
|
243 |
-
msgstr ""
|
244 |
-
|
245 |
-
#: wp-sweep.php:518
|
246 |
-
msgid "%s Unapproved Comments Processed"
|
247 |
-
msgstr ""
|
248 |
-
|
249 |
-
#: wp-sweep.php:528
|
250 |
-
msgid "%s Spam Comments Processed"
|
251 |
-
msgstr ""
|
252 |
-
|
253 |
-
#: wp-sweep.php:538
|
254 |
-
msgid "%s Trash Comments Processed"
|
255 |
-
msgstr ""
|
256 |
-
|
257 |
-
#: wp-sweep.php:552
|
258 |
-
msgid "%s Transient Options Processed"
|
259 |
-
msgstr ""
|
260 |
-
|
261 |
-
#: wp-sweep.php:567
|
262 |
-
msgid "%s Orphaned Post Meta Processed"
|
263 |
-
msgstr ""
|
264 |
-
|
265 |
-
#: wp-sweep.php:582
|
266 |
-
msgid "%s Orphaned Comment Meta Processed"
|
267 |
-
msgstr ""
|
268 |
-
|
269 |
-
#: wp-sweep.php:597
|
270 |
-
msgid "%s Orphaned User Meta Processed"
|
271 |
-
msgstr ""
|
272 |
-
|
273 |
-
#: wp-sweep.php:607
|
274 |
-
msgid "%s Orphaned Term Relationships Processed"
|
275 |
-
msgstr ""
|
276 |
-
|
277 |
-
#: wp-sweep.php:627
|
278 |
-
msgid "%s Unused Terms Processed"
|
279 |
-
msgstr ""
|
280 |
-
|
281 |
-
#: wp-sweep.php:639
|
282 |
-
msgid "%s Duplicated Post Meta Processed"
|
283 |
-
msgstr ""
|
284 |
-
|
285 |
-
#: wp-sweep.php:651
|
286 |
-
msgid "%s Duplicated Comment Meta Processed"
|
287 |
-
msgstr ""
|
288 |
-
|
289 |
-
#: wp-sweep.php:663
|
290 |
-
msgid "%s Duplicated User Meta Processed"
|
291 |
-
msgstr ""
|
292 |
-
|
293 |
-
#: wp-sweep.php:671
|
294 |
-
msgid "%s Tables Processed"
|
295 |
-
msgstr ""
|
296 |
-
|
297 |
-
#: wp-sweep.php:686
|
298 |
-
msgid "%s oEmbed Caches In Post Meta Processed"
|
299 |
-
msgstr ""
|
300 |
-
|
301 |
-
#. Plugin URI of the plugin/theme
|
302 |
-
msgid "http://lesterchan.net/portfolio/programming/php/"
|
303 |
-
msgstr ""
|
304 |
-
|
305 |
-
#. Description of the plugin/theme
|
306 |
-
msgid ""
|
307 |
-
"WP-Sweep allows you to clean up unused, orphaned and duplicated data in your "
|
308 |
-
"WordPress. It cleans up revisions, auto drafts, unapproved comments, spam "
|
309 |
-
"comments, trashed comments, orphan post meta, orphan comment meta, orphan "
|
310 |
-
"user meta, orphan term relationships, unused terms, duplicated post meta, "
|
311 |
-
"duplicated comment meta, duplicated user meta and transient options. It also "
|
312 |
-
"optimizes your database tables."
|
313 |
-
msgstr ""
|
314 |
-
|
315 |
-
#. Author of the plugin/theme
|
316 |
-
msgid "Lester 'GaMerZ' Chan"
|
317 |
-
msgstr ""
|
318 |
-
|
319 |
-
#. Author URI of the plugin/theme
|
320 |
-
msgid "http://lesterchan.net"
|
321 |
-
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: GamerZ
|
3 |
Donate link: http://lesterchan.net/site/donation/
|
4 |
Tags: sweep, clean, cleanup, clean up, optimize, orphan, unused, duplicated, posts, post meta, comments, comment meta, users, user meta, terms, term relationships, revisions, auto drafts, transient, database, tables, oembed
|
5 |
-
Requires at least: 4.
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 1.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -22,11 +22,13 @@ This plugin cleans up:
|
|
22 |
* Orphaned post meta
|
23 |
* Orphaned comment meta
|
24 |
* Orphaned user meta
|
|
|
25 |
* Orphan term relationships
|
26 |
* Unused terms
|
27 |
* Duplicated post meta
|
28 |
* Duplicated comment meta
|
29 |
* Duplicated user meta
|
|
|
30 |
* Transient options
|
31 |
* Optimizes database tables
|
32 |
* oEmbed caches in post meta
|
@@ -41,6 +43,7 @@ Following delete functions are used:
|
|
41 |
* delete_post_meta()
|
42 |
* delete_comment_meta()
|
43 |
* delete_user_meta()
|
|
|
44 |
* wp_remove_object_terms()
|
45 |
* wp_delete_term()
|
46 |
* delete_transient()
|
@@ -59,6 +62,11 @@ Following delete functions are used:
|
|
59 |
I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.
|
60 |
|
61 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
62 |
= 1.0.5 =
|
63 |
* FIXED: apply_filters() wrong arguments
|
64 |
|
2 |
Contributors: GamerZ
|
3 |
Donate link: http://lesterchan.net/site/donation/
|
4 |
Tags: sweep, clean, cleanup, clean up, optimize, orphan, unused, duplicated, posts, post meta, comments, comment meta, users, user meta, terms, term relationships, revisions, auto drafts, transient, database, tables, oembed
|
5 |
+
Requires at least: 4.4
|
6 |
+
Tested up to: 4.4
|
7 |
+
Stable tag: 1.0.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
22 |
* Orphaned post meta
|
23 |
* Orphaned comment meta
|
24 |
* Orphaned user meta
|
25 |
+
* Orphaned term meta
|
26 |
* Orphan term relationships
|
27 |
* Unused terms
|
28 |
* Duplicated post meta
|
29 |
* Duplicated comment meta
|
30 |
* Duplicated user meta
|
31 |
+
* Duplicated term meta
|
32 |
* Transient options
|
33 |
* Optimizes database tables
|
34 |
* oEmbed caches in post meta
|
43 |
* delete_post_meta()
|
44 |
* delete_comment_meta()
|
45 |
* delete_user_meta()
|
46 |
+
* delete_term_meta()
|
47 |
* wp_remove_object_terms()
|
48 |
* wp_delete_term()
|
49 |
* delete_transient()
|
62 |
I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.
|
63 |
|
64 |
== Changelog ==
|
65 |
+
= 1.0.6 =
|
66 |
+
* NEW: Delete 'languages' folder from the plugin
|
67 |
+
* NEW: Use translate.wordpress.org to translate the plugin
|
68 |
+
* FIXED: Works only with WordPress 4.4 because of new term meta
|
69 |
+
|
70 |
= 1.0.5 =
|
71 |
* FIXED: apply_filters() wrong arguments
|
72 |
|
wp-sweep.php
CHANGED
@@ -3,11 +3,10 @@
|
|
3 |
Plugin Name: WP-Sweep
|
4 |
Plugin URI: http://lesterchan.net/portfolio/programming/php/
|
5 |
Description: WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It cleans up revisions, auto drafts, unapproved comments, spam comments, trashed comments, orphan post meta, orphan comment meta, orphan user meta, orphan term relationships, unused terms, duplicated post meta, duplicated comment meta, duplicated user meta and transient options. It also optimizes your database tables.
|
6 |
-
Version: 1.0.
|
7 |
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: http://lesterchan.net
|
9 |
Text Domain: wp-sweep
|
10 |
-
Domain Path: /languages/
|
11 |
License: GPL2
|
12 |
*/
|
13 |
|
@@ -32,7 +31,7 @@ License: GPL2
|
|
32 |
*
|
33 |
* @since 1.0.0
|
34 |
*/
|
35 |
-
define( 'WP_SWEEP_VERSION', '1.0.
|
36 |
|
37 |
/**
|
38 |
* WP-Sweep class
|
@@ -40,804 +39,856 @@ define( 'WP_SWEEP_VERSION', '1.0.4' );
|
|
40 |
* @since 1.0.0
|
41 |
*/
|
42 |
class WPSweep {
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
838 |
}
|
839 |
|
840 |
/**
|
841 |
* Init WP-Sweep
|
842 |
*/
|
843 |
-
WPSweep::get_instance();
|
3 |
Plugin Name: WP-Sweep
|
4 |
Plugin URI: http://lesterchan.net/portfolio/programming/php/
|
5 |
Description: WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It cleans up revisions, auto drafts, unapproved comments, spam comments, trashed comments, orphan post meta, orphan comment meta, orphan user meta, orphan term relationships, unused terms, duplicated post meta, duplicated comment meta, duplicated user meta and transient options. It also optimizes your database tables.
|
6 |
+
Version: 1.0.6
|
7 |
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: http://lesterchan.net
|
9 |
Text Domain: wp-sweep
|
|
|
10 |
License: GPL2
|
11 |
*/
|
12 |
|
31 |
*
|
32 |
* @since 1.0.0
|
33 |
*/
|
34 |
+
define( 'WP_SWEEP_VERSION', '1.0.6' );
|
35 |
|
36 |
/**
|
37 |
* WP-Sweep class
|
39 |
* @since 1.0.0
|
40 |
*/
|
41 |
class WPSweep {
|
42 |
+
/**
|
43 |
+
* Limit the number of items to show for sweep details
|
44 |
+
*
|
45 |
+
* @since 1.0.3
|
46 |
+
*
|
47 |
+
* @access public
|
48 |
+
* @var int
|
49 |
+
*/
|
50 |
+
public $limit_details = 500;
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Static instance
|
54 |
+
*
|
55 |
+
* @since 1.0.0
|
56 |
+
*
|
57 |
+
* @access private
|
58 |
+
* @var $instance
|
59 |
+
*/
|
60 |
+
private static $instance;
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Constructor method
|
64 |
+
*
|
65 |
+
* @since 1.0.0
|
66 |
+
*
|
67 |
+
* @access public
|
68 |
+
*/
|
69 |
+
public function __construct() {
|
70 |
+
// Add Plugin Hooks
|
71 |
+
add_action( 'plugins_loaded', array( $this, 'add_hooks' ) );
|
72 |
+
|
73 |
+
// Load Translation
|
74 |
+
load_plugin_textdomain( 'wp-sweep' );
|
75 |
+
|
76 |
+
// Plugin Activation/Deactivation
|
77 |
+
register_activation_hook( __FILE__, array( $this, 'plugin_activation' ) );
|
78 |
+
register_deactivation_hook( __FILE__, array( $this, 'plugin_deactivation' ) );
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Initializes the plugin object and returns its instance
|
83 |
+
*
|
84 |
+
* @since 1.0.0
|
85 |
+
*
|
86 |
+
* @access public
|
87 |
+
* @return object The plugin object instance
|
88 |
+
*/
|
89 |
+
public static function get_instance() {
|
90 |
+
if ( ! isset( self::$instance ) ) {
|
91 |
+
self::$instance = new self();
|
92 |
+
}
|
93 |
+
return self::$instance;
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Init this plugin
|
98 |
+
*
|
99 |
+
* @since 1.0.0
|
100 |
+
*
|
101 |
+
* @access public
|
102 |
+
* @return void
|
103 |
+
*/
|
104 |
+
public function init() {}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Adds all the plugin hooks
|
108 |
+
*
|
109 |
+
* @since 1.0.0
|
110 |
+
*
|
111 |
+
* @access public
|
112 |
+
* @return void
|
113 |
+
*/
|
114 |
+
public function add_hooks() {
|
115 |
+
// Actions
|
116 |
+
add_action( 'init', array( $this, 'init' ) );
|
117 |
+
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
118 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
119 |
+
add_action( 'wp_ajax_sweep_details', array( $this, 'ajax_sweep_details' ) );
|
120 |
+
add_action( 'wp_ajax_sweep', array( $this, 'ajax_sweep' ) );
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Enqueue JS/CSS files used for admin
|
125 |
+
*
|
126 |
+
* @since 1.0.3
|
127 |
+
*
|
128 |
+
* @access public
|
129 |
+
* @param string $hook
|
130 |
+
* @return void
|
131 |
+
*/
|
132 |
+
public function admin_enqueue_scripts( $hook ) {
|
133 |
+
if( 'wp-sweep/admin.php' !== $hook ) {
|
134 |
+
return;
|
135 |
+
}
|
136 |
+
|
137 |
+
if( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
|
138 |
+
wp_enqueue_script( 'wp-sweep', plugins_url( 'wp-sweep/js/wp-sweep.js' ), array( 'jquery' ) , WP_SWEEP_VERSION, true );
|
139 |
+
} else {
|
140 |
+
wp_enqueue_script( 'wp-sweep', plugins_url( 'wp-sweep/js/wp-sweep.min.js' ), array( 'jquery' ) , WP_SWEEP_VERSION, true );
|
141 |
+
}
|
142 |
+
|
143 |
+
wp_localize_script( 'wp-sweep', 'wp_sweep', array(
|
144 |
+
'text_close_warning' => __( 'Sweeping is in progress. If you leave now, the process won\'t be completed.', 'wp-sweep' ),
|
145 |
+
'text_sweep' => __( 'Sweep', 'wp-sweep' ),
|
146 |
+
'text_sweep_all' => __( 'Sweep All', 'wp-sweep' ),
|
147 |
+
'text_sweeping' => __( 'Sweeping ...', 'wp-sweep' ),
|
148 |
+
'text_na' => __( 'N/A', 'wp-sweep' )
|
149 |
+
) );
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Admin menu
|
154 |
+
*
|
155 |
+
* @since 1.0.3
|
156 |
+
*
|
157 |
+
* @access public
|
158 |
+
* @return void
|
159 |
+
*/
|
160 |
+
public function admin_menu() {
|
161 |
+
add_management_page( __( 'Sweep', 'wp-sweep' ), __( 'Sweep', 'wp-sweep' ), 'activate_plugins', 'wp-sweep/admin.php' );
|
162 |
+
}
|
163 |
+
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Sweep Details loaded via AJAX
|
167 |
+
*
|
168 |
+
* @since 1.0.3
|
169 |
+
*
|
170 |
+
* @access public
|
171 |
+
* @return void
|
172 |
+
*/
|
173 |
+
public function ajax_sweep_details() {
|
174 |
+
if( ! empty( $_GET['action'] ) && $_GET['action'] === 'sweep_details' && ! empty( $_GET['sweep_name'] ) && ! empty( $_GET['sweep_type'] ) ) {
|
175 |
+
// Verify Referer
|
176 |
+
if ( ! check_admin_referer( 'wp_sweep_details_' . $_GET['sweep_name'] ) ) {
|
177 |
+
wp_send_json_error( array(
|
178 |
+
'error' => __( 'Failed to verify referrer.', 'wp-sweep' )
|
179 |
+
) );
|
180 |
+
} else {
|
181 |
+
wp_send_json_success( $this->details( $_GET['sweep_name'] ) );
|
182 |
+
}
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Sweep via AJAX
|
188 |
+
*
|
189 |
+
* @since 1.0.3
|
190 |
+
*
|
191 |
+
* @access public
|
192 |
+
* @return void
|
193 |
+
*/
|
194 |
+
public function ajax_sweep() {
|
195 |
+
if( ! empty( $_GET['action'] ) && $_GET['action'] === 'sweep' && ! empty( $_GET['sweep_name'] ) && ! empty( $_GET['sweep_type'] ) ) {
|
196 |
+
// Verify Referer
|
197 |
+
if ( ! check_admin_referer( 'wp_sweep_' . $_GET['sweep_name'] ) ) {
|
198 |
+
wp_send_json_error( array(
|
199 |
+
'error' => __( 'Failed to verify referrer.', 'wp-sweep' )
|
200 |
+
) );
|
201 |
+
} else {
|
202 |
+
$sweep = $this->sweep( $_GET['sweep_name'] );
|
203 |
+
$count = $this->count( $_GET['sweep_name'] );
|
204 |
+
$total_count = $this->total_count( $_GET['sweep_type'] );
|
205 |
+
$total_stats = array();
|
206 |
+
switch( $_GET['sweep_type'] ) {
|
207 |
+
case 'posts':
|
208 |
+
case 'postmeta':
|
209 |
+
$total_stats = array( 'posts' => $this->total_count( 'posts' ), 'postmeta' => $this->total_count( 'postmeta' ) );
|
210 |
+
break;
|
211 |
+
case 'comments':
|
212 |
+
case 'commentmeta':
|
213 |
+
$total_stats = array( 'comments' => $this->total_count( 'comments' ), 'commentmeta' => $this->total_count( 'commentmeta' ) );
|
214 |
+
break;
|
215 |
+
case 'users':
|
216 |
+
case 'usermeta':
|
217 |
+
$total_stats = array( 'users' => $this->total_count( 'users' ), 'usermeta' => $this->total_count( 'usermeta' ) );
|
218 |
+
break;
|
219 |
+
case 'term_relationships':
|
220 |
+
case 'term_taxonomy':
|
221 |
+
case 'terms':
|
222 |
+
case 'termmeta':
|
223 |
+
$total_stats = array( 'term_relationships' => $this->total_count( 'term_relationships' ), 'term_taxonomy' => $this->total_count( 'term_taxonomy' ), 'terms' => $this->total_count( 'terms' ), 'termmeta' => $this->total_count( 'termmeta' ) );
|
224 |
+
break;
|
225 |
+
case 'options':
|
226 |
+
$total_stats = array( 'options' => $this->total_count( 'options' ) );
|
227 |
+
break;
|
228 |
+
case 'tables':
|
229 |
+
$total_stats = array( 'tables' => $this->total_count( 'tables' ) );
|
230 |
+
break;
|
231 |
+
}
|
232 |
+
|
233 |
+
wp_send_json_success( array(
|
234 |
+
'sweep' => $sweep,
|
235 |
+
'count' => $count,
|
236 |
+
'total' => $total_count,
|
237 |
+
'percentage' => $this->format_percentage( $count, $total_count ),
|
238 |
+
'stats' => $total_stats
|
239 |
+
) );
|
240 |
+
}
|
241 |
+
}
|
242 |
+
}
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Count the number of total items belonging to each sweep
|
246 |
+
*
|
247 |
+
* @since 1.0.0
|
248 |
+
*
|
249 |
+
* @access public
|
250 |
+
* @param string $name
|
251 |
+
* @return int Number of items belonging to each sweep
|
252 |
+
*/
|
253 |
+
public function total_count( $name ) {
|
254 |
+
global $wpdb;
|
255 |
+
|
256 |
+
$count = 0;
|
257 |
+
|
258 |
+
switch( $name ) {
|
259 |
+
case 'posts':
|
260 |
+
$count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts" );
|
261 |
+
break;
|
262 |
+
case 'postmeta':
|
263 |
+
$count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->postmeta" );
|
264 |
+
break;
|
265 |
+
case 'comments':
|
266 |
+
$count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments" );
|
267 |
+
break;
|
268 |
+
case 'commentmeta':
|
269 |
+
$count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->commentmeta" );
|
270 |
+
break;
|
271 |
+
case 'users':
|
272 |
+
$count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->users" );
|
273 |
+
break;
|
274 |
+
case 'usermeta':
|
275 |
+
$count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->usermeta" );
|
276 |
+
break;
|
277 |
+
case 'term_relationships':
|
278 |
+
$count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->term_relationships" );
|
279 |
+
break;
|
280 |
+
case 'term_taxonomy':
|
281 |
+
$count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->term_taxonomy" );
|
282 |
+
break;
|
283 |
+
case 'terms':
|
284 |
+
$count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->terms" );
|
285 |
+
break;
|
286 |
+
case 'termmeta':
|
287 |
+
$count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->termmeta" );
|
288 |
+
break;
|
289 |
+
case 'options':
|
290 |
+
$count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->options" );
|
291 |
+
break;
|
292 |
+
case 'tables':
|
293 |
+
$count = sizeof( $wpdb->get_col( 'SHOW TABLES' ) );
|
294 |
+
break;
|
295 |
+
}
|
296 |
+
|
297 |
+
return apply_filters( 'wp_sweep_total_count', $count, $name );
|
298 |
+
}
|
299 |
+
|
300 |
+
/**
|
301 |
+
* Count the number of items belonging to each sweep
|
302 |
+
*
|
303 |
+
* @since 1.0.0
|
304 |
+
*
|
305 |
+
* @access public
|
306 |
+
* @param string $name
|
307 |
+
* @return int Number of items belonging to each sweep
|
308 |
+
*/
|
309 |
+
public function count( $name ) {
|
310 |
+
global $wpdb;
|
311 |
+
|
312 |
+
$count = 0;
|
313 |
+
|
314 |
+
switch( $name ) {
|
315 |
+
case 'revisions':
|
316 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_type = %s", 'revision' ) );
|
317 |
+
break;
|
318 |
+
case 'auto_drafts':
|
319 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_status = %s", 'auto-draft' ) );
|
320 |
+
break;
|
321 |
+
case 'deleted_posts':
|
322 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_status = %s", 'trash' ) );
|
323 |
+
break;
|
324 |
+
case 'unapproved_comments':
|
325 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = %s", '0' ) );
|
326 |
+
break;
|
327 |
+
case 'spam_comments':
|
328 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = %s", 'spam' ) );
|
329 |
+
break;
|
330 |
+
case 'deleted_comments':
|
331 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE (comment_approved = %s OR comment_approved = %s)", 'trash', 'post-trashed' ) );
|
332 |
+
break;
|
333 |
+
case 'transient_options':
|
334 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(option_id) FROM $wpdb->options WHERE option_name LIKE(%s)", '%_transient_%' ) );
|
335 |
+
break;
|
336 |
+
case 'orphan_postmeta':
|
337 |
+
$count = $wpdb->get_var( "SELECT COUNT(meta_id) FROM $wpdb->postmeta WHERE post_id NOT IN (SELECT ID FROM $wpdb->posts)" );
|
338 |
+
break;
|
339 |
+
case 'orphan_commentmeta':
|
340 |
+
$count = $wpdb->get_var( "SELECT COUNT(meta_id) FROM $wpdb->commentmeta WHERE comment_id NOT IN (SELECT comment_ID FROM $wpdb->comments)" );
|
341 |
+
break;
|
342 |
+
case 'orphan_usermeta':
|
343 |
+
$count = $wpdb->get_var( "SELECT COUNT(umeta_id) FROM $wpdb->usermeta WHERE user_id NOT IN (SELECT ID FROM $wpdb->users)" );
|
344 |
+
break;
|
345 |
+
case 'orphan_termmeta':
|
346 |
+
$count = $wpdb->get_var( "SELECT COUNT(meta_id) FROM $wpdb->termmeta WHERE term_id NOT IN (SELECT term_id FROM $wpdb->terms)" );
|
347 |
+
break;
|
348 |
+
case 'orphan_term_relationships':
|
349 |
+
$count = $wpdb->get_var( "SELECT COUNT(object_id) FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy != 'link_category' AND tr.object_id NOT IN (SELECT ID FROM $wpdb->posts)" );
|
350 |
+
break;
|
351 |
+
case 'unused_terms':
|
352 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(t.term_id) FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.count = %d AND t.term_id NOT IN (" . implode( ',', $this->get_excluded_termids() ) . ")", 0 ) );
|
353 |
+
break;
|
354 |
+
case 'duplicated_postmeta':
|
355 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT(meta_id) AS count FROM $wpdb->postmeta GROUP BY post_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
356 |
+
if( is_array( $query ) ) {
|
357 |
+
$count = array_sum( array_map( 'intval', $query ) );
|
358 |
+
}
|
359 |
+
break;
|
360 |
+
case 'duplicated_commentmeta':
|
361 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT(meta_id) AS count FROM $wpdb->commentmeta GROUP BY comment_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
362 |
+
if( is_array( $query ) ) {
|
363 |
+
$count = array_sum( array_map( 'intval', $query ) );
|
364 |
+
}
|
365 |
+
break;
|
366 |
+
case 'duplicated_usermeta':
|
367 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT(umeta_id) AS count FROM $wpdb->usermeta GROUP BY user_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
368 |
+
if( is_array( $query ) ) {
|
369 |
+
$count = array_sum( array_map( 'intval', $query ) );
|
370 |
+
}
|
371 |
+
break;
|
372 |
+
case 'duplicated_termmeta':
|
373 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT(meta_id) AS count FROM $wpdb->termmeta GROUP BY term_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
374 |
+
if( is_array( $query ) ) {
|
375 |
+
$count = array_sum( array_map( 'intval', $query ) );
|
376 |
+
}
|
377 |
+
break;
|
378 |
+
case 'optimize_database':
|
379 |
+
$count = sizeof( $wpdb->get_col( 'SHOW TABLES' ) );
|
380 |
+
break;
|
381 |
+
case 'oembed_postmeta':
|
382 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(meta_id) FROM $wpdb->postmeta WHERE meta_key LIKE(%s)", '%_oembed_%' ) );
|
383 |
+
break;
|
384 |
+
}
|
385 |
+
|
386 |
+
return apply_filters( 'wp_sweep_count', $count, $name );
|
387 |
+
}
|
388 |
+
|
389 |
+
/**
|
390 |
+
* Return more details about a sweep
|
391 |
+
*
|
392 |
+
* @since 1.0.3
|
393 |
+
*
|
394 |
+
* @access public
|
395 |
+
* @param string $name
|
396 |
+
* @return int Number of items belonging to each sweep
|
397 |
+
*/
|
398 |
+
public function details( $name ) {
|
399 |
+
global $wpdb;
|
400 |
+
|
401 |
+
$details = array();
|
402 |
+
|
403 |
+
switch( $name ) {
|
404 |
+
case 'revisions':
|
405 |
+
$details = $wpdb->get_col( $wpdb->prepare( "SELECT post_title FROM $wpdb->posts WHERE post_type = %s LIMIT %d", 'revision', $this->limit_details ) );
|
406 |
+
break;
|
407 |
+
case 'auto_drafts':
|
408 |
+
$details = $wpdb->get_col( $wpdb->prepare( "SELECT post_title FROM $wpdb->posts WHERE post_status = %s LIMIT %d", 'auto-draft', $this->limit_details ) );
|
409 |
+
break;
|
410 |
+
case 'deleted_posts':
|
411 |
+
$details = $wpdb->get_col( $wpdb->prepare( "SELECT post_title FROM $wpdb->posts WHERE post_status = %s LIMIT %d", 'trash', $this->limit_details ) );
|
412 |
+
break;
|
413 |
+
case 'unapproved_comments':
|
414 |
+
$details = $wpdb->get_col( $wpdb->prepare( "SELECT comment_author FROM $wpdb->comments WHERE comment_approved = %s LIMIT %d", '0', $this->limit_details ) );
|
415 |
+
break;
|
416 |
+
case 'spam_comments':
|
417 |
+
$details = $wpdb->get_col( $wpdb->prepare( "SELECT comment_author FROM $wpdb->comments WHERE comment_approved = %s LIMIT %d", 'spam', $this->limit_details ) );
|
418 |
+
break;
|
419 |
+
case 'deleted_comments':
|
420 |
+
$details = $wpdb->get_col( $wpdb->prepare( "SELECT comment_author FROM $wpdb->comments WHERE (comment_approved = %s OR comment_approved = %s) LIMIT %d", 'trash', 'post-trashed', $this->limit_details ) );
|
421 |
+
break;
|
422 |
+
case 'transient_options':
|
423 |
+
$details = $wpdb->get_col( $wpdb->prepare( "SELECT option_name FROM $wpdb->options WHERE option_name LIKE(%s) LIMIT %d", '%_transient_%', $this->limit_details ) );
|
424 |
+
break;
|
425 |
+
case 'orphan_postmeta':
|
426 |
+
$details = $wpdb->get_col( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE post_id NOT IN (SELECT ID FROM $wpdb->posts) LIMIT %d", $this->limit_details ) );
|
427 |
+
break;
|
428 |
+
case 'orphan_commentmeta':
|
429 |
+
$details = $wpdb->get_col( $wpdb->prepare( "SELECT meta_key FROM $wpdb->commentmeta WHERE comment_id NOT IN (SELECT comment_ID FROM $wpdb->comments) LIMIT %d", $this->limit_details ) );
|
430 |
+
break;
|
431 |
+
case 'orphan_usermeta':
|
432 |
+
$details = $wpdb->get_col( $wpdb->prepare( "SELECT meta_key FROM $wpdb->usermeta WHERE user_id NOT IN (SELECT ID FROM $wpdb->users) LIMIT %d", $this->limit_details ) );
|
433 |
+
break;
|
434 |
+
case 'orphan_termmeta':
|
435 |
+
$details = $wpdb->get_col( $wpdb->prepare( "SELECT meta_key FROM $wpdb->termmeta WHERE term_id NOT IN (SELECT term_id FROM $wpdb->terms) LIMIT %d", $this->limit_details ) );
|
436 |
+
break;
|
437 |
+
case 'orphan_term_relationships':
|
438 |
+
$details = $wpdb->get_col( $wpdb->prepare( "SELECT tt.taxonomy FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy != 'link_category' AND tr.object_id NOT IN (SELECT ID FROM $wpdb->posts) LIMIT %d", $this->limit_details ) );
|
439 |
+
break;
|
440 |
+
case 'unused_terms':
|
441 |
+
$details = $wpdb->get_col( $wpdb->prepare( "SELECT t.name FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.count = %d AND t.term_id NOT IN (" . implode( ',', $this->get_excluded_termids() ) . ") LIMIT %d", 0, $this->limit_details ) );
|
442 |
+
break;
|
443 |
+
case 'duplicated_postmeta':
|
444 |
+
$query = $wpdb->get_results( $wpdb->prepare( "SELECT COUNT(meta_id) AS count, meta_key FROM $wpdb->postmeta GROUP BY post_id, meta_key, meta_value HAVING count > %d LIMIT %d", 1, $this->limit_details ) );
|
445 |
+
$details = array();
|
446 |
+
if( $query ) {
|
447 |
+
foreach( $query as $meta ) {
|
448 |
+
$details[] = $meta->meta_key;
|
449 |
+
}
|
450 |
+
}
|
451 |
+
break;
|
452 |
+
case 'duplicated_commentmeta':
|
453 |
+
$query = $wpdb->get_results( $wpdb->prepare( "SELECT COUNT(meta_id) AS count, meta_key FROM $wpdb->commentmeta GROUP BY comment_id, meta_key, meta_value HAVING count > %d LIMIT %d", 1, $this->limit_details ) );
|
454 |
+
$details = array();
|
455 |
+
if( $query ) {
|
456 |
+
foreach( $query as $meta ) {
|
457 |
+
$details[] = $meta->meta_key;
|
458 |
+
}
|
459 |
+
}
|
460 |
+
break;
|
461 |
+
case 'duplicated_usermeta':
|
462 |
+
$query = $wpdb->get_results( $wpdb->prepare( "SELECT COUNT(umeta_id) AS count, meta_key FROM $wpdb->usermeta GROUP BY user_id, meta_key, meta_value HAVING count > %d LIMIT %d", 1, $this->limit_details ) );
|
463 |
+
$details = array();
|
464 |
+
if( $query ) {
|
465 |
+
foreach( $query as $meta ) {
|
466 |
+
$details[] = $meta->meta_key;
|
467 |
+
}
|
468 |
+
}
|
469 |
+
break;
|
470 |
+
case 'duplicated_termmeta':
|
471 |
+
$query = $wpdb->get_results( $wpdb->prepare( "SELECT COUNT(meta_id) AS count, meta_key FROM $wpdb->termmeta GROUP BY term_id, meta_key, meta_value HAVING count > %d LIMIT %d", 1, $this->limit_details ) );
|
472 |
+
$details = array();
|
473 |
+
if( $query ) {
|
474 |
+
foreach( $query as $meta ) {
|
475 |
+
$details[] = $meta->meta_key;
|
476 |
+
}
|
477 |
+
}
|
478 |
+
break;
|
479 |
+
case 'optimize_database':
|
480 |
+
$details = $wpdb->get_col( 'SHOW TABLES' );
|
481 |
+
break;
|
482 |
+
case 'oembed_postmeta':
|
483 |
+
$details = $wpdb->get_col( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key LIKE(%s) LIMIT %d", '%_oembed_%', $this->limit_details ) );
|
484 |
+
break;
|
485 |
+
}
|
486 |
+
|
487 |
+
return apply_filters( 'wp_sweep_details', $details, $name );
|
488 |
+
}
|
489 |
+
|
490 |
+
/**
|
491 |
+
* Does the sweeping/cleaning up
|
492 |
+
*
|
493 |
+
* @since 1.0.0
|
494 |
+
*
|
495 |
+
* @access public
|
496 |
+
* @param string $name
|
497 |
+
* @return string Processed message
|
498 |
+
*/
|
499 |
+
public function sweep( $name ) {
|
500 |
+
global $wpdb;
|
501 |
+
|
502 |
+
$message = '';
|
503 |
+
|
504 |
+
switch( $name ) {
|
505 |
+
case 'revisions':
|
506 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type = %s", 'revision' ) );
|
507 |
+
if( $query ) {
|
508 |
+
foreach ( $query as $id ) {
|
509 |
+
wp_delete_post_revision( intval( $id ) );
|
510 |
+
}
|
511 |
+
|
512 |
+
$message = sprintf( __( '%s Revisions Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
513 |
+
}
|
514 |
+
break;
|
515 |
+
case 'auto_drafts':
|
516 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_status = %s", 'auto-draft' ) );
|
517 |
+
if( $query ) {
|
518 |
+
foreach ( $query as $id ) {
|
519 |
+
wp_delete_post( intval( $id ), true );
|
520 |
+
}
|
521 |
+
|
522 |
+
$message = sprintf( __( '%s Auto Drafts Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
523 |
+
}
|
524 |
+
break;
|
525 |
+
case 'deleted_posts':
|
526 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_status = %s", 'trash' ) );
|
527 |
+
if( $query ) {
|
528 |
+
foreach ( $query as $id ) {
|
529 |
+
wp_delete_post( $id, true );
|
530 |
+
}
|
531 |
+
|
532 |
+
$message = sprintf( __( '%s Deleted Posts Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
533 |
+
}
|
534 |
+
break;
|
535 |
+
case 'unapproved_comments':
|
536 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s", '0' ) );
|
537 |
+
if( $query ) {
|
538 |
+
foreach ( $query as $id ) {
|
539 |
+
wp_delete_comment( intval( $id ), true );
|
540 |
+
}
|
541 |
+
|
542 |
+
$message = sprintf( __( '%s Unapproved Comments Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
543 |
+
}
|
544 |
+
break;
|
545 |
+
case 'spam_comments':
|
546 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s", 'spam' ) );
|
547 |
+
if( $query ) {
|
548 |
+
foreach ( $query as $id ) {
|
549 |
+
wp_delete_comment( intval( $id ), true );
|
550 |
+
}
|
551 |
+
|
552 |
+
$message = sprintf( __( '%s Spam Comments Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
553 |
+
}
|
554 |
+
break;
|
555 |
+
case 'deleted_comments':
|
556 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE (comment_approved = %s OR comment_approved = %s)", 'trash', 'post-trashed' ) );
|
557 |
+
if( $query ) {
|
558 |
+
foreach ( $query as $id ) {
|
559 |
+
wp_delete_comment( intval( $id ), true );
|
560 |
+
}
|
561 |
+
|
562 |
+
$message = sprintf( __( '%s Trash Comments Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
563 |
+
}
|
564 |
+
break;
|
565 |
+
case 'transient_options':
|
566 |
+
$query = $wpdb->get_col( $wpdb->prepare( "SELECT option_name FROM $wpdb->options WHERE option_name LIKE(%s)", '%_transient_%' ) );
|
567 |
+
if( $query ) {
|
568 |
+
foreach ( $query as $option_name ) {
|
569 |
+
if( strpos( $option_name, '_site_transient_' ) !== false ) {
|
570 |
+
delete_site_transient( str_replace( '_site_transient_', '', $option_name ) );
|
571 |
+
} else {
|
572 |
+
delete_transient( str_replace( '_transient_', '', $option_name ) );
|
573 |
+
}
|
574 |
+
}
|
575 |
+
|
576 |
+
$message = sprintf( __( '%s Transient Options Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
577 |
+
}
|
578 |
+
break;
|
579 |
+
case 'orphan_postmeta':
|
580 |
+
$query = $wpdb->get_results( "SELECT post_id, meta_key FROM $wpdb->postmeta WHERE post_id NOT IN (SELECT ID FROM $wpdb->posts)" );
|
581 |
+
if( $query ) {
|
582 |
+
foreach ( $query as $meta ) {
|
583 |
+
$post_id = intval( $meta->post_id );
|
584 |
+
if( $post_id === 0 ) {
|
585 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta->meta_key ) );
|
586 |
+
} else {
|
587 |
+
delete_post_meta( $post_id, $meta->meta_key );
|
588 |
+
}
|
589 |
+
}
|
590 |
+
|
591 |
+
$message = sprintf( __( '%s Orphaned Post Meta Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
592 |
+
}
|
593 |
+
break;
|
594 |
+
case 'orphan_commentmeta':
|
595 |
+
$query = $wpdb->get_results( "SELECT comment_id, meta_key FROM $wpdb->commentmeta WHERE comment_id NOT IN (SELECT comment_ID FROM $wpdb->comments)" );
|
596 |
+
if( $query ) {
|
597 |
+
foreach ( $query as $meta ) {
|
598 |
+
$comment_id = intval( $meta->comment_id );
|
599 |
+
if( $comment_id === 0 ) {
|
600 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->commentmeta WHERE comment_id = %d AND meta_key = %s", $comment_id, $meta->meta_key ) );
|
601 |
+
} else {
|
602 |
+
delete_comment_meta( $comment_id, $meta->meta_key );
|
603 |
+
}
|
604 |
+
}
|
605 |
+
|
606 |
+
$message = sprintf( __( '%s Orphaned Comment Meta Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
607 |
+
}
|
608 |
+
break;
|
609 |
+
case 'orphan_usermeta':
|
610 |
+
$query = $wpdb->get_results( "SELECT user_id, meta_key FROM $wpdb->usermeta WHERE user_id NOT IN (SELECT ID FROM $wpdb->users)" );
|
611 |
+
if( $query ) {
|
612 |
+
foreach ( $query as $meta ) {
|
613 |
+
$user_id = intval( $meta->user_id );
|
614 |
+
if( $user_id === 0 ) {
|
615 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta->meta_key ) );
|
616 |
+
} else {
|
617 |
+
delete_user_meta( $user_id, $meta->meta_key );
|
618 |
+
}
|
619 |
+
}
|
620 |
+
|
621 |
+
$message = sprintf( __( '%s Orphaned User Meta Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
622 |
+
}
|
623 |
+
break;
|
624 |
+
case 'orphan_termmeta':
|
625 |
+
$query = $wpdb->get_results( "SELECT term_id, meta_key FROM $wpdb->termmeta WHERE term_id NOT IN (SELECT term_id FROM $wpdb->terms)" );
|
626 |
+
if( $query ) {
|
627 |
+
foreach ( $query as $meta ) {
|
628 |
+
$term_id = intval( $meta->term_id );
|
629 |
+
if( $term_id === 0 ) {
|
630 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->termmeta WHERE term_id = %d AND meta_key = %s", $term_id, $meta->meta_key ) );
|
631 |
+
} else {
|
632 |
+
delete_term_meta( $term_id, $meta->meta_key );
|
633 |
+
}
|
634 |
+
}
|
635 |
+
|
636 |
+
$message = sprintf( __( '%s Orphaned Term Meta Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
637 |
+
}
|
638 |
+
break;
|
639 |
+
case 'orphan_term_relationships':
|
640 |
+
$query = $wpdb->get_results( "SELECT tr.object_id, tt.term_id, tt.taxonomy FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy != 'link_category' AND tr.object_id NOT IN (SELECT ID FROM $wpdb->posts)" );
|
641 |
+
if( $query ) {
|
642 |
+
foreach ( $query as $tax ) {
|
643 |
+
wp_remove_object_terms( intval( $tax->object_id ), intval( $tax->term_id ), $tax->taxonomy );
|
644 |
+
}
|
645 |
+
|
646 |
+
$message = sprintf( __( '%s Orphaned Term Relationships Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
647 |
+
}
|
648 |
+
break;
|
649 |
+
case 'unused_terms':
|
650 |
+
$query = $wpdb->get_results( $wpdb->prepare( "SELECT tt.term_taxonomy_id, t.term_id, tt.taxonomy FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.count = %d AND t.term_id NOT IN (" . implode( ',', $this->get_excluded_termids() ) . ")", 0 ) );
|
651 |
+
if( $query ) {
|
652 |
+
$check_wp_terms = false;
|
653 |
+
foreach ( $query as $tax ) {
|
654 |
+
if( taxonomy_exists( $tax->taxonomy ) ) {
|
655 |
+
wp_delete_term( intval( $tax->term_id ), $tax->taxonomy );
|
656 |
+
} else {
|
657 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", intval( $tax->term_taxonomy_id ) ) );
|
658 |
+
$check_wp_terms = true;
|
659 |
+
}
|
660 |
+
}
|
661 |
+
// We need this for invalid taxonomies
|
662 |
+
if( $check_wp_terms ) {
|
663 |
+
$wpdb->get_results( "DELETE FROM $wpdb->terms WHERE term_id NOT IN (SELECT term_id FROM $wpdb->term_taxonomy)" );
|
664 |
+
}
|
665 |
+
|
666 |
+
$message = sprintf( __( '%s Unused Terms Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
667 |
+
}
|
668 |
+
break;
|
669 |
+
case 'duplicated_postmeta':
|
670 |
+
$query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, post_id, COUNT(*) AS count FROM $wpdb->postmeta GROUP BY post_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
671 |
+
if( $query ) {
|
672 |
+
foreach ( $query as $meta ) {
|
673 |
+
$ids = array_map( 'intval', explode( ',', $meta->ids ) );
|
674 |
+
array_pop( $ids );
|
675 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_id IN (" . implode( ',', $ids ) . ") AND post_id = %d", intval( $meta->post_id ) ) );
|
676 |
+
}
|
677 |
+
|
678 |
+
$message = sprintf( __( '%s Duplicated Post Meta Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
679 |
+
}
|
680 |
+
break;
|
681 |
+
case 'duplicated_commentmeta':
|
682 |
+
$query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, comment_id, COUNT(*) AS count FROM $wpdb->commentmeta GROUP BY comment_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
683 |
+
if( $query ) {
|
684 |
+
foreach ( $query as $meta ) {
|
685 |
+
$ids = array_map( 'intval', explode( ',', $meta->ids ) );
|
686 |
+
array_pop( $ids );
|
687 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->commentmeta WHERE meta_id IN (" . implode( ',', $ids ) . ") AND comment_id = %d", intval( $meta->comment_id ) ) );
|
688 |
+
}
|
689 |
+
|
690 |
+
$message = sprintf( __( '%s Duplicated Comment Meta Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
691 |
+
}
|
692 |
+
break;
|
693 |
+
case 'duplicated_usermeta':
|
694 |
+
$query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(umeta_id ORDER BY umeta_id DESC) AS ids, user_id, COUNT(*) AS count FROM $wpdb->usermeta GROUP BY user_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
695 |
+
if( $query ) {
|
696 |
+
foreach ( $query as $meta ) {
|
697 |
+
$ids = array_map( 'intval', explode( ',', $meta->ids ) );
|
698 |
+
array_pop( $ids );
|
699 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE umeta_id IN (" . implode( ',', $ids ) . ") AND user_id = %d", intval( $meta->user_id ) ) );
|
700 |
+
}
|
701 |
+
|
702 |
+
$message = sprintf( __( '%s Duplicated User Meta Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
703 |
+
}
|
704 |
+
break;
|
705 |
+
case 'duplicated_termmeta':
|
706 |
+
$query = $wpdb->get_results( $wpdb->prepare( "SELECT GROUP_CONCAT(meta_id ORDER BY meta_id DESC) AS ids, term_id, COUNT(*) AS count FROM $wpdb->termmeta GROUP BY term_id, meta_key, meta_value HAVING count > %d", 1 ) );
|
707 |
+
if( $query ) {
|
708 |
+
foreach ( $query as $meta ) {
|
709 |
+
$ids = array_map( 'intval', explode( ',', $meta->ids ) );
|
710 |
+
array_pop( $ids );
|
711 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->termmeta WHERE meta_id IN (" . implode( ',', $ids ) . ") AND term_id = %d", intval( $meta->term_id ) ) );
|
712 |
+
}
|
713 |
+
|
714 |
+
$message = sprintf( __( '%s Duplicated Term Meta Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
715 |
+
}
|
716 |
+
break;
|
717 |
+
case 'optimize_database':
|
718 |
+
$query = $wpdb->get_col( 'SHOW TABLES' );
|
719 |
+
if( $query ) {
|
720 |
+
$tables = implode( ',', $query );
|
721 |
+
$wpdb->query( "OPTIMIZE TABLE $tables" );
|
722 |
+
$message = sprintf( __( '%s Tables Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
723 |
+
}
|
724 |
+
break;
|
725 |
+
case 'oembed_postmeta':
|
726 |
+
$query = $wpdb->get_results( $wpdb->prepare( "SELECT post_id, meta_key FROM $wpdb->postmeta WHERE meta_key LIKE(%s)", '%_oembed_%' ) );
|
727 |
+
if( $query ) {
|
728 |
+
foreach ( $query as $meta ) {
|
729 |
+
$post_id = intval( $meta->post_id );
|
730 |
+
if( $post_id === 0 ) {
|
731 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta->meta_key ) );
|
732 |
+
} else {
|
733 |
+
delete_post_meta( $post_id, $meta->meta_key );
|
734 |
+
}
|
735 |
+
}
|
736 |
+
|
737 |
+
$message = sprintf( __( '%s oEmbed Caches In Post Meta Processed', 'wp-sweep' ), number_format_i18n( sizeof( $query ) ) );
|
738 |
+
}
|
739 |
+
break;
|
740 |
+
}
|
741 |
+
|
742 |
+
return apply_filters( 'wp_sweep_sweep', $message, $name );
|
743 |
+
}
|
744 |
+
|
745 |
+
/**
|
746 |
+
* Format number to percentage, taking care of division by 0.
|
747 |
+
* Props @barisunver https://github.com/barisunver
|
748 |
+
*
|
749 |
+
* @since 1.0.2
|
750 |
+
*
|
751 |
+
* @access public
|
752 |
+
* @param int $current
|
753 |
+
* @param int $total
|
754 |
+
* @return string Number in percentage
|
755 |
+
*/
|
756 |
+
public function format_percentage( $current, $total ) {
|
757 |
+
return ( $total > 0 ? round( ( $current / $total ) * 100, 2 ) : 0 ) . '%';
|
758 |
+
}
|
759 |
+
|
760 |
+
/*
|
761 |
+
* Get excluded term IDs
|
762 |
+
*
|
763 |
+
* @since 1.0.3
|
764 |
+
*
|
765 |
+
* @access private
|
766 |
+
* @return array Excluded term IDs
|
767 |
+
*/
|
768 |
+
private function get_excluded_termids() {
|
769 |
+
$default_term_ids = $this->get_default_taxonomy_termids();
|
770 |
+
if( ! is_array( $default_term_ids ) ) {
|
771 |
+
$default_term_ids = array();
|
772 |
+
}
|
773 |
+
$parent_term_ids = $this->get_parent_termids();
|
774 |
+
if( ! is_array( $parent_term_ids ) ) {
|
775 |
+
$parent_term_ids = array();
|
776 |
+
}
|
777 |
+
return array_merge( $default_term_ids, $parent_term_ids );
|
778 |
+
}
|
779 |
+
|
780 |
+
/*
|
781 |
+
* Get all default taxonomy term IDs
|
782 |
+
*
|
783 |
+
* @since 1.0.3
|
784 |
+
*
|
785 |
+
* @access private
|
786 |
+
* @return array Default taxonomy term IDs
|
787 |
+
*/
|
788 |
+
private function get_default_taxonomy_termids() {
|
789 |
+
$taxonomies = get_taxonomies();
|
790 |
+
$default_term_ids = array();
|
791 |
+
if( $taxonomies ) {
|
792 |
+
$tax = array_keys( $taxonomies );
|
793 |
+
if( $tax ) {
|
794 |
+
foreach( $tax as $t ) {
|
795 |
+
$term_id = intval( get_option( 'default_' . $t ) );
|
796 |
+
if( $term_id > 0 ) {
|
797 |
+
$default_term_ids[] = $term_id;
|
798 |
+
}
|
799 |
+
}
|
800 |
+
}
|
801 |
+
}
|
802 |
+
return $default_term_ids;
|
803 |
+
}
|
804 |
+
|
805 |
+
/*
|
806 |
+
* Get terms that has a parent term
|
807 |
+
*
|
808 |
+
* @since 1.0.3
|
809 |
+
*
|
810 |
+
* @access private
|
811 |
+
* @return array Parent term IDs
|
812 |
+
*/
|
813 |
+
private function get_parent_termids() {
|
814 |
+
global $wpdb;
|
815 |
+
return $wpdb->get_col( $wpdb->prepare( "SELECT tt.parent FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.parent > %d", 0 ) );
|
816 |
+
}
|
817 |
+
|
818 |
+
/**
|
819 |
+
* What to do when the plugin is being deactivated
|
820 |
+
*
|
821 |
+
* @since 1.0.0
|
822 |
+
*
|
823 |
+
* @access public
|
824 |
+
* @param boolean $network_wide
|
825 |
+
* @return void
|
826 |
+
*/
|
827 |
+
public function plugin_activation( $network_wide ) {
|
828 |
+
if ( is_multisite() && $network_wide ) {
|
829 |
+
$ms_sites = wp_get_sites();
|
830 |
+
|
831 |
+
if( 0 < sizeof( $ms_sites ) ) {
|
832 |
+
foreach ( $ms_sites as $ms_site ) {
|
833 |
+
switch_to_blog( $ms_site['blog_id'] );
|
834 |
+
$this->plugin_activated();
|
835 |
+
}
|
836 |
+
}
|
837 |
+
|
838 |
+
restore_current_blog();
|
839 |
+
} else {
|
840 |
+
$this->plugin_activated();
|
841 |
+
}
|
842 |
+
}
|
843 |
+
|
844 |
+
/**
|
845 |
+
* Perform plugin activation tasks
|
846 |
+
*
|
847 |
+
* @since 1.0.0
|
848 |
+
*
|
849 |
+
* @access private
|
850 |
+
* @return void
|
851 |
+
*/
|
852 |
+
private function plugin_activated() {}
|
853 |
+
|
854 |
+
/**
|
855 |
+
* What to do when the plugin is being activated
|
856 |
+
*
|
857 |
+
* @since 1.0.0
|
858 |
+
*
|
859 |
+
* @access public
|
860 |
+
* @param boolean $network_wide
|
861 |
+
* @return void
|
862 |
+
*/
|
863 |
+
public function plugin_deactivation( $network_wide ) {
|
864 |
+
if ( is_multisite() && $network_wide ) {
|
865 |
+
$ms_sites = wp_get_sites();
|
866 |
+
|
867 |
+
if( 0 < sizeof( $ms_sites ) ) {
|
868 |
+
foreach ( $ms_sites as $ms_site ) {
|
869 |
+
switch_to_blog( $ms_site['blog_id'] );
|
870 |
+
$this->plugin_deactivated();
|
871 |
+
}
|
872 |
+
}
|
873 |
+
|
874 |
+
restore_current_blog();
|
875 |
+
} else {
|
876 |
+
$this->plugin_deactivated();
|
877 |
+
}
|
878 |
+
}
|
879 |
+
|
880 |
+
/**
|
881 |
+
* Perform plugin deactivation tasks
|
882 |
+
*
|
883 |
+
* @since 1.0.0
|
884 |
+
*
|
885 |
+
* @access private
|
886 |
+
* @return void
|
887 |
+
*/
|
888 |
+
private function plugin_deactivated() {}
|
889 |
}
|
890 |
|
891 |
/**
|
892 |
* Init WP-Sweep
|
893 |
*/
|
894 |
+
WPSweep::get_instance();
|