Optimize Database after Deleting Revisions - Version 4.7.3

Version Description

[12/12/2018] = * CHANGE: The deletion of transients has been fully rewritten and is many times faster now! * CHANGE: Increased the time_limit * CHANGE: German translations have been updated

Download this release

Release Info

Developer cageehv
Plugin Icon 128x128 Optimize Database after Deleting Revisions
Version 4.7.3
Comparing to
See all releases

Code changes from version 4.7.2 to 4.7.3

classes/odb-cleaner.php CHANGED
@@ -1,1738 +1,1715 @@
1
- <?php
2
- /************************************************************************************************
3
- *
4
- * CLEANER CLASS: DOING THE REAL CLEANING / OPTIMIZATION
5
- *
6
- ************************************************************************************************/
7
- ?>
8
- <?php
9
- class ODB_Cleaner {
10
- var $start_size;
11
- var $nr_of_optimized_tables;
12
-
13
-
14
- /********************************************************************************************
15
- * CONSTRUCTOR
16
- ********************************************************************************************/
17
- function __construct() {
18
- } // __construct()
19
-
20
-
21
- /********************************************************************************************
22
- * RUN CLEANER
23
- ********************************************************************************************/
24
- function odb_run_cleaner($scheduler, $analyzing = false) {
25
- global $odb_class;
26
-
27
- if(!$scheduler) {
28
- if ($analyzing) {
29
- echo '
30
- <div id="odb-cleaner" class="odb-padding-left">
31
- <div class="odb-title-bar">
32
- <h2>'.__('Analyzing Database', $odb_class->odb_txt_domain).'</h2>
33
- </div>
34
- <br>
35
- <br>
36
- ';
37
- } else {
38
- echo '
39
- <div id="odb-cleaner" class="odb-padding-left">
40
- <div class="odb-title-bar">
41
- <h2>'.__('Cleaning Database', $odb_class->odb_txt_domain).'</h2>
42
- </div>
43
- <br>
44
- <br>
45
- ';
46
- }
47
- } // if(!$scheduler)
48
-
49
- // GET THE SIZE OF THE DATABASE BEFORE OPTIMIZATION
50
- $this->start_size = $odb_class->odb_utilities_obj->odb_get_db_size();
51
-
52
- // TIMESTAMP FOR LOG FILE - v4.6
53
- $ct = ($scheduler) ? ' (cron)' : '';
54
-
55
- $odb_class->log_arr["timestamp"] = current_time('YmdHis', 0);
56
- $odb_class->log_arr["after"] = 0;
57
- $odb_class->log_arr["before"] = 0;
58
- $odb_class->log_arr["orphans"] = 0;
59
- $odb_class->log_arr["pingbacks"] = 0;
60
- $odb_class->log_arr["oembeds"] = 0;
61
- $odb_class->log_arr["orphans"] = 0;
62
- $odb_class->log_arr["revisions"] = 0;
63
- $odb_class->log_arr["savings"] = 0;
64
- $odb_class->log_arr["spam"] = 0;
65
- $odb_class->log_arr["tables"] = 0;
66
- $odb_class->log_arr["tags"] = 0;
67
- $odb_class->log_arr["transients"] = 0;
68
- $odb_class->log_arr["trash"] = 0;
69
-
70
- /****************************************************************************************
71
- * DELETE REVISIONS
72
- ****************************************************************************************/
73
- if($odb_class->odb_rvg_options['delete_older'] == 'Y' || $odb_class->odb_rvg_options['rvg_revisions'] == 'Y') {
74
- // FIND REVISIONS
75
- $results_older_than = array();
76
- if($odb_class->odb_rvg_options['delete_older'] == 'Y') {
77
- $results_older_than = $this->odb_get_revisions_older_than();
78
- }
79
-
80
- $results_keep_revisions = array();
81
- if($odb_class->odb_rvg_options['rvg_revisions'] == 'Y') {
82
- $results_keep_revisions = $this->odb_get_revisions_keep_revisions();
83
- }
84
-
85
- $total_deleted = 0;
86
- if(count($results_older_than) > 0 || count($results_keep_revisions) > 0) {
87
- // WE HAVE REVISIONS TO DELETE!
88
- if(!$scheduler) {
89
- if ($analyzing) {
90
- $msg1 = __('REVISIONS','rvg-optimize-database');
91
- $msg2 = __('revisions', $odb_class->odb_txt_domain);
92
- } else {
93
- $msg1 = __('DELETED REVISIONS','rvg-optimize-database');
94
- $msg2 = __('revisions deleted', $odb_class->odb_txt_domain);
95
- }
96
- ?>
97
- <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
98
- <tr>
99
- <td colspan="4"><div class="odb-found"><?php echo $msg1?></div></td>
100
- </tr>
101
- <tr>
102
- <th align="right" class="odb-border-bottom">#</th>
103
- <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
104
- <th align="left" class="odb-border-bottom"><?php _e('post / page', $odb_class->odb_txt_domain);?></th>
105
- <th align="left" class="odb-border-bottom"><?php _e('revision date', $odb_class->odb_txt_domain);?></th>
106
- <th align="right" class="odb-border-bottom"><?php echo $msg2?></th>
107
- </tr>
108
- <?php
109
- } // if(!$scheduler)
110
-
111
- // LOOP THROUGH THE REVISIONS AND DELETE THEM
112
- $total_deleted = $this->odb_delete_revisions($scheduler, $analyzing);
113
-
114
- if(!$scheduler) {
115
- if ($analyzing) {
116
- $msg1 = __('total number of revisions', $odb_class->odb_txt_domain);
117
- } else {
118
- $msg1 = __('total number of revisions deleted', $odb_class->odb_txt_domain);
119
- } // if (!$analyzing)
120
- ?>
121
- <tr>
122
- <td colspan="5" align="right" class="odb-border-top odb-bold"><?php echo $msg1 ?>: <?php echo $total_deleted?></td>
123
- </tr>
124
- </table>
125
- <?php
126
- } // if(!$scheduler)
127
- } else {
128
- if(!$scheduler) {
129
- ?>
130
- <div class="odb-not-found">
131
- <?php _e('No REVISIONS found to delete', $odb_class->odb_txt_domain);?>
132
- </div>
133
- <?php
134
- } // if(!$scheduler)
135
- } // if(count($results)>0)
136
-
137
- // NUMBER OF DELETED REVISIONS FOR LOG FILE
138
- $odb_class->log_arr["revisions"] = $total_deleted;
139
- } // if($odb_class->odb_rvg_options['delete_older'] == 'Y' || $odb_class->odb_rvg_options['rvg_revisions'] == 'Y')
140
-
141
-
142
- /****************************************************************************************
143
- * DELETE TRASHED ITEMS
144
- ****************************************************************************************/
145
- if($odb_class->odb_rvg_options['clear_trash'] == 'Y') {
146
- // GET TRASHED POSTS / PAGES AND COMMENTS
147
- $results = $this->odb_get_trash($analyzing);
148
-
149
- $total_deleted = 0;
150
- if(count($results)>0) {
151
- // WE HAVE TRASH TO DELETE!
152
- if(!$scheduler) {
153
- if ($analyzing) {
154
- $msg1 = __('TRASHED ITEMS', $odb_class->odb_txt_domain);
155
- $msg2 = __('total number of trashed items', $odb_class->odb_txt_domain);
156
- } else {
157
- $msg1 = __('DELETED TRASHED ITEMS', $odb_class->odb_txt_domain);
158
- $msg2 = __('total number of trashed items deleted', $odb_class->odb_txt_domain);
159
- } // if ($analyzing)
160
- ?>
161
- <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
162
- <tr>
163
- <td colspan="4"><div class="odb-found">
164
- <?php echo $msg1 ?>
165
- </div></td>
166
- </tr>
167
- <tr>
168
- <th align="right" class="odb-border-bottom">#</th>
169
- <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
170
- <th align="left" class="odb-border-bottom"><?php _e('type', $odb_class->odb_txt_domain);?></th>
171
- <th align="left" class="odb-border-bottom"><?php _e('IP address / title', $odb_class->odb_txt_domain);?></th>
172
- <th align="left" nowrap="nowrap" class="odb-border-bottom"><?php _e('date', $odb_class->odb_txt_domain);?></th>
173
- </tr>
174
- <?php
175
- } // if(!$scheduler)
176
-
177
- // LOOP THROUGH THE TRASHED ITEMS AND DELETE THEM
178
- $total_deleted = $this->odb_delete_trash($results, $scheduler, $analyzing);
179
-
180
- if(!$scheduler) {
181
- ?>
182
- <tr>
183
- <td colspan="5" align="right" class="odb-border-top odb-bold"><?php echo $msg2 ?>: <?php echo $total_deleted?></td>
184
- </tr>
185
- </table>
186
- <?php
187
- } // if(!$scheduler)
188
- } else {
189
- if(!$scheduler) {
190
- ?>
191
- <div class="odb-not-found">
192
- <?php _e('No TRASHED ITEMS found to delete', $odb_class->odb_txt_domain);?>
193
- </div>
194
- <?php
195
- } // if(!$scheduler)
196
- } // if(count($results)>0)
197
-
198
- // NUMBER OF DELETED TRASH FOR LOG FILE
199
- $odb_class->log_arr["trash"] = $total_deleted;
200
- } // if($odb_class->odb_rvg_options['clear_trash'] == 'Y')
201
-
202
-
203
- /****************************************************************************************
204
- * DELETE SPAMMED ITEMS
205
- ****************************************************************************************/
206
- if($odb_class->odb_rvg_options['clear_spam'] == 'Y') {
207
- // GET SPAMMED COMMENTS
208
- $results = $this->odb_get_spam($analyzing);
209
-
210
- $total_deleted = 0;
211
- if(count($results)>0) {
212
- // WE HAVE SPAM TO DELETE!
213
- if (!$scheduler) {
214
- if ($analyzing) {
215
- $msg1 = __('SPAMMED ITEMS', $odb_class->odb_txt_domain);
216
- $msg2 = __('total number of spammed items', $odb_class->odb_txt_domain);
217
- } else {
218
- $msg1 = __('DELETED SPAMMED ITEMS', $odb_class->odb_txt_domain);
219
- $msg2 = __('total number of spammed items deleted', $odb_class->odb_txt_domain);
220
- } // if ($analyzing)
221
- ?>
222
- <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
223
- <tr>
224
- <td colspan="4"><div class="odb-found">
225
- <?php echo $msg1 ?>
226
- </div></td>
227
- </tr>
228
- <tr>
229
- <th align="right" class="odb-border-bottom">#</th>
230
- <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
231
- <th align="left" class="odb-border-bottom"><?php _e('comment author', $odb_class->odb_txt_domain);?></th>
232
- <th align="left" class="odb-border-bottom"><?php _e('comment author email', $odb_class->odb_txt_domain);?></th>
233
- <th align="left" nowrap="nowrap" class="odb-border-bottom"><?php _e('comment date', $odb_class->odb_txt_domain);?></th>
234
- </tr>
235
- <?php
236
- } // if (!$scheduler)
237
-
238
- // LOOP THROUGH SPAMMED ITEMS AND DELETE THEM
239
- $total_deleted = $this->odb_delete_spam($results, $scheduler, $analyzing);
240
-
241
- if (!$scheduler) {
242
- ?>
243
- <tr>
244
- <td colspan="5" align="right" class="odb-border-top odb-bold"><?php echo $msg2 ?>: <?php echo $total_deleted?></td>
245
- </tr>
246
- </table>
247
- <?php
248
- } // if (!$scheduler)
249
- } else{
250
- if (!$scheduler) {
251
- ?>
252
- <div class="odb-not-found">
253
- <?php _e('No SPAMMED ITEMS found to delete', $odb_class->odb_txt_domain);?>
254
- </div>
255
- <?php
256
- } // if (!$scheduler)
257
- } // if(count($results)>0)
258
-
259
- // NUMBER OF SPAM DELETED FOR LOG FILE
260
- $odb_class->log_arr["spam"] = $total_deleted;
261
- } // if($odb_class->odb_rvg_options['clear_spam'] == 'Y')
262
-
263
-
264
- /****************************************************************************************
265
- * DELETE UNUSED TAGS
266
- ****************************************************************************************/
267
- if($odb_class->odb_rvg_options['clear_tags'] == 'Y') {
268
- // GET UNUSED TAGS
269
- $results = $this->odb_get_unused_tags($analyzing);
270
-
271
- $total_deleted = 0;
272
-
273
- if(count($results)>0) {
274
- // WE HAVE TAGS TO DELETE!
275
- if (!$scheduler) {
276
- if ($analyzing) {
277
- $msg1 = __('UNUSED TAGS', $odb_class->odb_txt_domain);
278
- $msg2 = __('total number of unused tags', $odb_class->odb_txt_domain);
279
- } else {
280
- $msg1 = __('DELETED UNUSED TAGS', $odb_class->odb_txt_domain);
281
- $msg2 = __('total number of unused tags deleted', $odb_class->odb_txt_domain);
282
- }
283
- ?>
284
- <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
285
- <tr>
286
- <td colspan="4"><div class="odb-found">
287
- <?php echo $msg1 ?>
288
- </div></td>
289
- </tr>
290
- <tr>
291
- <th align="right" class="odb-border-bottom">#</th>
292
- <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
293
- <th align="left" class="odb-border-bottom"><?php _e('tag', $odb_class->odb_txt_domain);?></th>
294
- </tr>
295
- <?php
296
- } // if (!$scheduler)
297
-
298
- // LOOP THROUGH UNUSED TAGS AND DELETE THEM
299
- $total_deleted = $this->odb_delete_unused_tags($results, $scheduler, $analyzing);
300
-
301
- if (!$scheduler) {
302
- ?>
303
- <tr>
304
- <td colspan="5" align="right" class="odb-border-top odb-bold"><?php echo $msg2 ?>: <?php echo $total_deleted?></td>
305
- </tr>
306
- </table>
307
- <?php
308
- } // if (!$scheduler)
309
- } else {
310
- if (!$scheduler) {
311
- ?>
312
- <div class="odb-not-found">
313
- <?php _e('No UNUSED TAGE found to delete', $odb_class->odb_txt_domain);?>
314
- </div>
315
- <?php
316
- } // if (!$scheduler)
317
- } // if(count($results)>0)
318
-
319
- // NUMBER OF SPAM DELETED FOR LOG FILE
320
- $odb_class->log_arr["tags"] = $total_deleted;
321
- } // if($odb_class->odb_rvg_options['clear_spam'] == 'Y')
322
-
323
-
324
- /****************************************************************************************
325
- * DELETE EXPIRED TRANSIENTS
326
- ****************************************************************************************/
327
- if($odb_class->odb_rvg_options['clear_transients'] != 'N') {
328
- // GET TRANSIENTS
329
- $results = $this->odb_get_transients($analyzing);
330
-
331
- $total_deleted = 0;
332
-
333
- if(count($results)>0) {
334
- // WE HAVE SPAM TO DELETE!
335
- if (!$scheduler) {
336
- if ($odb_class->odb_rvg_options['clear_transients'] == 'Y') {
337
- if ($analyzing){
338
- $msg1 = __('EXPIRED TRANSIENTS', $odb_class->odb_txt_domain);
339
- $msg2 = __('total number of expired transients', $odb_class->odb_txt_domain);
340
- } else {
341
- $msg1 = __('EXPIRED TRANSIENTS DELETED', $odb_class->odb_txt_domain);
342
- $msg2 = __('total number of expired transients deleted', $odb_class->odb_txt_domain);
343
- }
344
- } else {
345
- if ($analyzing){
346
- $msg1 = __('TRANSIENTS', $odb_class->odb_txt_domain);
347
- $msg2 = __('total number of transients', $odb_class->odb_txt_domain);
348
- } else {
349
- $msg1 = __('TRANSIENTS DELETED', $odb_class->odb_txt_domain);
350
- $msg2 = __('total number of transients', $odb_class->odb_txt_domain);
351
- }
352
- } // if ($odb_class->odb_rvg_options['clear_transients'] == 'Y') {
353
- ?>
354
- <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
355
- <tr>
356
- <td colspan="4"><div class="odb-found">
357
- <?php echo $msg1 ?>
358
- </div></td>
359
- </tr>
360
- <tr>
361
- <th align="right" class="odb-border-bottom">#</th>
362
- <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
363
- <th align="left" class="odb-border-bottom"><?php _e('option name', $odb_class->odb_txt_domain);?></th>
364
- </tr>
365
- <?php
366
- } // if (!$scheduler)
367
-
368
- // LOOP THROUGH SPAMMED ITEMS AND DELETE THEM
369
- $total_deleted = $this->odb_delete_transients($results, $scheduler, $analyzing);
370
-
371
- if (!$scheduler) {
372
- ?>
373
- <tr>
374
- <td colspan="3" align="right" class="odb-border-top odb-bold"><?php echo $msg2 ?>: <?php echo $total_deleted?></td>
375
- </tr>
376
- </table>
377
- <?php
378
- } // if (!$scheduler)
379
- } else{
380
- if (!$scheduler) {
381
- ?>
382
- <div class="odb-not-found">
383
- <?php
384
- if ($odb_class->odb_rvg_options['clear_transients'] == 'Y') {
385
- $msg = __('No EXPIRED TRANSIENTS found to delete', $odb_class->odb_txt_domain);
386
- } else {
387
- $msg = __('No TRANSIENTS found to delete', $odb_class->odb_txt_domain);
388
- }
389
- ?>
390
- </div>
391
- <?php
392
- } // if (!$scheduler)
393
- } // if(count($results)>0)
394
-
395
- // NUMBER OF SPAM DELETED FOR LOG FILE
396
- $odb_class->log_arr["transients"] = $total_deleted;
397
- } // if($odb_class->odb_rvg_options['clear_transients'] == 'Y')
398
-
399
- /****************************************************************************************
400
- * DELETE PINGBACKS AND TRACKBACKS
401
- ****************************************************************************************/
402
- if($odb_class->odb_rvg_options['clear_pingbacks'] == 'Y') {
403
- // GET PINGBACKS AND TRACKBACKS
404
- $results = $this->odb_get_pingbacks($analyzing);
405
-
406
- $total_deleted = 0;
407
- if(count($results)>0) {
408
- // WE HAVE TRASH TO DELETE!
409
- if(!$scheduler) {
410
- if ($analyzing) {
411
- $msg1 = __('PINGBACKS AND TRACKBACKS', $odb_class->odb_txt_domain);
412
- $msg2 = __('total number of pingbacks and trackbacks', $odb_class->odb_txt_domain);
413
- } else {
414
- $msg1 = __('DELETED PINGBACKS AND TRACKBACKS', $odb_class->odb_txt_domain);
415
- $msg2 = __('total number of pingbacks and trackbacks deleted', $odb_class->odb_txt_domain);
416
- } // if ($analyzing)
417
- ?>
418
- <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
419
- <tr>
420
- <td colspan="4"><div class="odb-found">
421
- <?php echo $msg1 ?>
422
- </div></td>
423
- </tr>
424
- <tr>
425
- <th align="right" class="odb-border-bottom">#</th>
426
- <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
427
- <th align="left" class="odb-border-bottom"><?php _e('type', $odb_class->odb_txt_domain);?></th>
428
- <th align="left" class="odb-border-bottom"><?php _e('comment_author', $odb_class->odb_txt_domain);?></th>
429
- <th align="left" nowrap="nowrap" class="odb-border-bottom"><?php _e('date', $odb_class->odb_txt_domain);?></th>
430
- </tr>
431
- <?php
432
- } // if(!$scheduler)
433
-
434
- // LOOP THROUGH THE TRASHED ITEMS AND DELETE THEM
435
- $total_deleted = $this->odb_delete_pingbacks($results, $scheduler, $analyzing);
436
-
437
- if(!$scheduler) {
438
- ?>
439
- <tr>
440
- <td colspan="5" align="right" class="odb-border-top odb-bold"><?php echo $msg2 ?>: <?php echo $total_deleted?></td>
441
- </tr>
442
- </table>
443
- <?php
444
- } // if(!$scheduler)
445
- } else {
446
- if(!$scheduler) {
447
- ?>
448
- <div class="odb-not-found">
449
- <?php _e('No PINGBACKS nor TRACKBACKS found to delete', $odb_class->odb_txt_domain);?>
450
- </div>
451
- <?php
452
- } // if(!$scheduler)
453
- } // if(count($results)>0)
454
-
455
- // NUMBER OF DELETED PINGBACKS FOR LOG FILE
456
- $odb_class->log_arr["pingbacks"] = $total_deleted;
457
- } // if($odb_class->odb_rvg_options['clear_pingbacks'] == 'Y')
458
-
459
-
460
- /****************************************************************************************
461
- * DELETE OEMBED CACHE
462
- ****************************************************************************************/
463
- if($odb_class->odb_rvg_options['clear_oembed'] == 'Y') {
464
-
465
- // GET OEMBED CACHE
466
- $results = $this->odb_get_oembed($analyzing);
467
-
468
- $total_deleted = 0;
469
- if(count($results)>0) {
470
- // WE HAVE TRASH TO DELETE!
471
- if(!$scheduler) {
472
- if ($analyzing) {
473
- $msg1 = __('OEMBED CACHE', $odb_class->odb_txt_domain);
474
- $msg2 = __('total number of oEmbeds', $odb_class->odb_txt_domain);
475
- } else {
476
- $msg1 = __('DELETED OEMBEDS', $odb_class->odb_txt_domain);
477
- $msg2 = __('total number of oEmbeds deleted', $odb_class->odb_txt_domain);
478
- } // if ($analyzing)
479
- ?>
480
- <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
481
- <tr>
482
- <td colspan="4"><div class="odb-found">
483
- <?php echo $msg1 ?>
484
- </div></td>
485
- </tr>
486
- <tr>
487
- <th align="right" class="odb-border-bottom">#</th>
488
- <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
489
- <th align="left" class="odb-border-bottom"><?php _e('meta key', $odb_class->odb_txt_domain);?></th>
490
- <th align="left" class="odb-border-bottom"><?php _e('meta value', $odb_class->odb_txt_domain);?></th>
491
- </tr>
492
- <?php
493
- } // if(!$scheduler)
494
-
495
- // LOOP THROUGH THE TRASHED ITEMS AND DELETE THEM
496
- $total_deleted = $this->odb_delete_oembed($results, $scheduler, $analyzing);
497
-
498
- if(!$scheduler) {
499
- ?>
500
- <tr>
501
- <td colspan="4" align="right" class="odb-border-top odb-bold"><?php echo $msg2 ?>: <?php echo $total_deleted?></td>
502
- </tr>
503
- </table>
504
- <?php
505
- } // if(!$scheduler)
506
- } else {
507
- if(!$scheduler) {
508
- ?>
509
- <div class="odb-not-found">
510
- <?php _e('No OEMED CHACHE found to delete', $odb_class->odb_txt_domain);?>
511
- </div>
512
- <?php
513
- } // if(!$scheduler)
514
- } // if(count($results)>0)
515
-
516
- // NUMBER OF DELETED PINGBACKS FOR LOG FILE
517
- $odb_class->log_arr["oembeds"] = $total_deleted;
518
- } // if($odb_class->odb_rvg_options['clear_oembed'] == 'Y')
519
-
520
-
521
- /****************************************************************************************
522
- * DELETE ORPHANS
523
- ****************************************************************************************/
524
- if($odb_class->odb_rvg_options['clear_orphans'] == 'Y') {
525
- $results = $this->odb_get_orphans($results, $scheduler,$analyzing);
526
-
527
- $total_deleted = count($results);
528
-
529
- //$total_deleted = $this->odb_delete_orphans($analyzing);
530
-
531
- if($total_deleted > 0) {
532
- if (!$scheduler) {
533
- if ($analyzing) {
534
- $msg1 = __('POSTMETA ORPHANS', $odb_class->odb_txt_domain);
535
- $msg2 = __('total number of orphans', $odb_class->odb_txt_domain);
536
- } else {
537
- $msg1 = __('DELETED POSTMETA ORPHANS', $odb_class->odb_txt_domain);
538
- $msg2 = __('total number of orphans', $odb_class->odb_txt_domain);
539
- }
540
- ?>
541
- <!-- <div class="odb-found-number">
542
- <?php echo $msg1 ?>: <span class="odb-blue"><?php echo $total_deleted;?></span>
543
- </div>-->
544
- <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
545
- <tr>
546
- <td colspan="8"><div class="odb-found">
547
- <?php echo $msg1 ?>
548
- </div></td>
549
- </tr>
550
- <tr>
551
- <th align="right" class="odb-border-bottom">#</th>
552
- <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
553
- <th align="left" class="odb-border-bottom"><?php _e('type', $odb_class->odb_txt_domain);?></th>
554
- <th align="left" class="odb-border-bottom"><?php _e('id', $odb_class->odb_txt_domain);?></th>
555
- <th align="left" class="odb-border-bottom"><?php _e('title', $odb_class->odb_txt_domain);?></th>
556
- <th align="left" nowrap="nowrap" class="odb-border-bottom"><?php _e('modified', $odb_class->odb_txt_domain);?></th>
557
- <th align="left" class="odb-border-bottom"><?php _e('meta key', $odb_class->odb_txt_domain);?></th>
558
- <th align="left" class="odb-border-bottom"><?php _e('meta value', $odb_class->odb_txt_domain);?></th>
559
- </tr>
560
- <?php
561
- } // if(!$scheduler)
562
-
563
- // LOOP THROUGH THE TRASHED ITEMS AND DELETE THEM
564
- $total_deleted = $this->odb_delete_orphans($results, $scheduler, $analyzing);
565
-
566
- if(!$scheduler) {
567
- ?>
568
- <tr>
569
- <td colspan="8" align="right" class="odb-border-top odb-bold"><?php echo $msg2 ?> <?php echo $total_deleted?></td>
570
- </tr>
571
- </table>
572
-
573
- <?php
574
- } // if (!$scheduler)
575
- } else {
576
- if (!$scheduler) {
577
- ?>
578
- <div class="odb-not-found">
579
- <?php _e('No POSTMETA ORPHANS found to delete', $odb_class->odb_txt_domain);?>
580
- </div>
581
- <?php
582
- } // if (!$scheduler)
583
- } // if($total_deleted > 0)
584
- // FOR LOG FILE
585
- $odb_class->log_arr["orphans"] = $total_deleted;
586
-
587
- if (!$scheduler) {
588
- ?>
589
- </div><!-- /odb-cleaner -->
590
- <?php
591
- } // if (!$scheduler)
592
- } // if($odb_class->odb_rvg_options['clear_oembed'] == 'Y')
593
- } // odb_run_cleaner()
594
-
595
-
596
- /********************************************************************************************
597
- * RUN OPTIMIZER
598
- ********************************************************************************************/
599
- function odb_run_optimizer($scheduler) {
600
- global $odb_class;
601
-
602
- if(!$scheduler) {
603
- ?>
604
- <div class="odb-optimizing-table" class="odb-padding-left">
605
- <div class="odb-title-bar">
606
- <h2><?php _e('Optimizing Database Tables', $odb_class->odb_txt_domain);?></h2>
607
- </div>
608
- <br>
609
- <br>
610
- <table border="0" cellspacing="8" cellpadding="2">
611
- <tr>
612
- <th class="odb-border-bottom" align="right">#</th>
613
- <th class="odb-border-bottom" align="left"><?php _e('table name', $odb_class->odb_txt_domain);?></th>
614
- <th class="odb-border-bottom" align="left"><?php _e('optimization result', $odb_class->odb_txt_domain);?></th>
615
- <th class="odb-border-bottom" align="left"><?php _e('engine', $odb_class->odb_txt_domain);?></th>
616
- <th class="odb-border-bottom" align="right"><?php _e('table rows', $odb_class->odb_txt_domain);?></th>
617
- <th class="odb-border-bottom" align="right"><?php _e('table size', $odb_class->odb_txt_domain);?></th>
618
- </tr>
619
- <?php
620
- } // if(!$scheduler)
621
-
622
- # OPTIMIZE THE DATABASE TABLES
623
- $this->nr_of_optimized_tables = $this->odb_optimize_tables($scheduler);
624
-
625
- if(!$scheduler) {
626
- ?>
627
- </table>
628
- </div><!-- /odb-optimizing-table -->
629
- <?php
630
- } // if(!$scheduler)
631
- } // odb_run_optimizer()
632
-
633
-
634
- /********************************************************************************************
635
- * CALCULATE AND DISPLAY SAVINGS
636
- ********************************************************************************************/
637
- function odb_savings($scheduler) {
638
- global $odb_class;
639
- global $odb_logger_obj;
640
-
641
- // NUMBER OF TABLES
642
- $odb_class->log_arr["tables"] = $this->nr_of_optimized_tables;
643
- // DATABASE SIZE BEFORE OPTIMIZATION
644
- $odb_class->log_arr["before"] = $odb_class->odb_utilities_obj->odb_format_size($this->start_size,3);
645
- // DATABASE SIZE AFTER OPTIMIZATION
646
- $end_size = $odb_class->odb_utilities_obj->odb_get_db_size();
647
- $odb_class->log_arr["after"] = $odb_class->odb_utilities_obj->odb_format_size($end_size,3);
648
- // TOTAL SAVING
649
- $odb_class->log_arr["savings"] = $odb_class->odb_utilities_obj->odb_format_size(($this->start_size - $end_size),3);
650
-
651
- // WRITE RESULTS TO LOG FILE - v4.6
652
- $odb_class->odb_logger_obj->odb_add_log($odb_class->log_arr);
653
-
654
- $total_savings = $odb_class->odb_rvg_options['total_savings'];
655
- $total_savings += ($this->start_size - $end_size);
656
- $odb_class->odb_rvg_options['total_savings'] = $total_savings;
657
-
658
- $odb_class->odb_multisite_obj->odb_ms_update_option('odb_rvg_options', $odb_class->odb_rvg_options);
659
-
660
- if(!$scheduler) {
661
- ?>
662
- <div id="odb-savings" class="odb-padding-left">
663
- <div class="odb-title-bar">
664
- <h2><?php _e('Savings', $odb_class->odb_txt_domain);?></h2>
665
- </div>
666
- <br>
667
- <br>
668
- <table border="0" cellspacing="8" cellpadding="2">
669
- <tr>
670
- <th>&nbsp;</th>
671
- <th class="odb-border-bottom"><?php _e('size of the database', $odb_class->odb_txt_domain);?></th>
672
- </tr>
673
- <tr>
674
- <td align="right"><?php _e('BEFORE optimization', $odb_class->odb_txt_domain);?></td>
675
- <td align="right" class="odb-bold"><?php echo $odb_class->odb_utilities_obj->odb_format_size($this->start_size,3); ?></td>
676
- </tr>
677
- <tr>
678
- <td align="right"><?php _e('AFTER optimization', $odb_class->odb_txt_domain);?></td>
679
- <td align="right" class="odb-bold"><?php echo $odb_class->odb_utilities_obj->odb_format_size($end_size,3); ?></td>
680
- </tr>
681
- <tr>
682
- <td align="right" class="odb-bold"><?php _e('SAVINGS THIS TIME', $odb_class->odb_txt_domain);?></td>
683
- <td align="right" class="odb-border-top odb-bold"><?php echo $odb_class->odb_utilities_obj->odb_format_size(($this->start_size - $end_size),3); ?></td>
684
- </tr>
685
- <tr>
686
- <td align="right" class="odb-bold"><?php _e('TOTAL SAVINGS SINCE THE FIRST RUN', $odb_class->odb_txt_domain);?></td>
687
- <td align="right" class="odb-border-top odb-bold"><?php echo $odb_class->odb_utilities_obj->odb_format_size($total_savings,3); ?></td>
688
- </tr>
689
- </table>
690
- </div><!-- /odb-savings -->
691
- <?php
692
- } // if(!$scheduler)
693
- } // odb_savings()
694
-
695
-
696
- /********************************************************************************************
697
- * SHOW LOADING TIME
698
- ********************************************************************************************/
699
- function odb_done($analyze = false) {
700
- global $odb_class;
701
-
702
- $time = microtime();
703
- $time = explode(' ', $time);
704
- $time = $time[1] + $time[0];
705
- $finish = $time;
706
-
707
- $total_time = round(($finish - $odb_class->odb_start_time), 4);
708
- ?>
709
- <div id="odb-done" class="odb-padding-left">
710
- <div class="odb-title-bar">
711
- <h2>
712
- <?php _e('DONE!', $odb_class->odb_txt_domain);?>
713
- </h2>
714
- </div>
715
- <br>
716
- <br>
717
- <?php
718
- if ($analyze) {
719
- ?>
720
- <span class="odb-padding-left"><?php _e('Analysis took', $odb_class->odb_txt_domain)?>&nbsp;<strong><?php echo $total_time;?></strong>&nbsp;<?php _e('seconds', $odb_class->odb_txt_domain)?>.</span>
721
- <?php
722
- } else {
723
- ?>
724
- <span class="odb-padding-left"><?php _e('Optimization took', $odb_class->odb_txt_domain)?>&nbsp;<strong><?php echo $total_time;?></strong>&nbsp;<?php _e('seconds', $odb_class->odb_txt_domain)?>.</span>
725
- <?php
726
- } // if ($analyze)
727
- ?>
728
- <?php
729
- // v4.5.1
730
- $odb_class->odb_last_run_seconds = $total_time;
731
-
732
- if($odb_class->odb_logger_obj->odb_log_count() > 0) {
733
- ?>
734
- <script>
735
- function odb_confirm_delete() {
736
- <?php
737
- // v4.6.2
738
- $msg = str_replace("'", "\'", __('Clear the log?', $odb_class->odb_txt_domain));
739
- ?>
740
- if(confirm('<?php echo $msg?>')) {
741
- self.location = 'tools.php?page=rvg-optimize-database&action=clear_log'
742
- return;
743
- }
744
- } // odb_confirm_delete()
745
- </script>
746
- <br><br>
747
- &nbsp;
748
- <input class="button odb-normal" type="button" name="view_log" value="<?php _e('View Log', $odb_class->odb_txt_domain);?>" onclick="self.location='tools.php?page=rvg-optimize-database&action=view_log'" />
749
- &nbsp;
750
- <input class="button odb-normal" type="button" name="clear_log" value="<?php _e('Clear Log', $odb_class->odb_txt_domain);?>" onclick="return odb_confirm_delete();" />
751
- <?php
752
- } // if($odb_class->odb_logger_obj->odb_log_count() > 0)
753
- ?>
754
- </div><!-- /odb-done -->
755
- <?php
756
- } // odb_done()
757
-
758
-
759
- /********************************************************************************************
760
- * GET REVISIONS (OLDER THAN x DAYS)
761
- ********************************************************************************************/
762
- function odb_get_revisions_older_than() {
763
- global $odb_class, $wpdb;
764
-
765
- $res_arr = array();
766
-
767
- // CUSTOM POST TYPES (from v4.4)
768
- $rel_posttypes = $odb_class->odb_rvg_options['post_types'];
769
- $in = '';
770
- foreach ($rel_posttypes as $posttype => $value) {
771
- if ($value == 'Y') {
772
- if ($in != '') $in .= ',';
773
- $in .= "'" . $posttype . "'";
774
- } // if ($value == 'Y')
775
- } // foreach($rel_posttypes as $posttypes)
776
-
777
- $where = '';
778
- if($in != '') {
779
- $where = " AND p2.`post_type` IN ($in)";
780
- } else {
781
- // NO POST TYPES TO DELETE REVISIONS FOR... SKIP!
782
- return $res_arr;
783
- } // if($in != '')
784
-
785
- $older_than = $odb_class->odb_rvg_options['older_than'];
786
-
787
- $index = 0;
788
-
789
- // LOOP THROUGH THE SITES (IF MULTI SITE)
790
- for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
791
- $prefix = $odb_class->odb_ms_prefixes[$i];
792
-
793
- $sql = sprintf("
794
- SELECT '%s' AS site,
795
- p1.`ID`,
796
- p1.`post_parent`,
797
- p1.`post_title`,
798
- p1.`post_modified`
799
- FROM %sposts p1, %sposts p2
800
- WHERE p1.`post_type` = 'revision'
801
- AND p1.`post_parent` = p2.ID
802
- %s
803
- AND p1.`post_modified` < date_sub(now(), INTERVAL %d DAY)
804
- ORDER BY UCASE(p1.`post_title`)
805
- ",
806
- $prefix,
807
- $prefix,
808
- $prefix,
809
- $where,
810
- $older_than);
811
-
812
- //echo 'OLDER: '.$sql.'<br>';
813
-
814
- $res = $wpdb->get_results($sql, ARRAY_A);
815
-
816
- for($j=0; $j<count($res); $j++) {
817
- if(isset($res[$j]) && !$this->odb_post_is_excluded($res[$j]['post_parent'])) {
818
- $res_arr[$index] = $res[$j];
819
- $index++;
820
- } // if(isset($res[$j]) && !$this->odb_post_is_excluded($res[$j]['post_parent']))
821
- } // for($j=0; $j<count($res); $j++)
822
-
823
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
824
-
825
- return $res_arr;
826
- } // odb_get_revisions_older_than()
827
-
828
-
829
- /********************************************************************************************
830
- * GET REVISIONS (KEEP MAX NUMBER OF REVISIONS)
831
- ********************************************************************************************/
832
- function odb_get_revisions_keep_revisions() {
833
- global $odb_class, $wpdb;
834
-
835
- $res_arr = array();
836
-
837
- // CUSTOM POST TYPES (from v4.4)
838
- $rel_posttypes = $odb_class->odb_rvg_options['post_types'];
839
- $in = '';
840
- foreach ($rel_posttypes as $posttype => $value) {
841
- if ($value == 'Y') {
842
- if ($in != '') $in .= ',';
843
- $in .= "'" . $posttype . "'";
844
- } // if ($value == 'Y')
845
- } // foreach($rel_posttypes as $posttypes)
846
-
847
- $where1 = '';
848
- if($in != '') {
849
- $where1 = " AND p2.`post_type` IN ($in)";
850
- } else {
851
- // NO POST TYPES TO DELETE REVISIONS FOR... SKIP!
852
- return $res_arr;
853
- } // if($in != '')
854
-
855
- // MAX NUMBER OF REVISIONS TO KEEP
856
- $max_revisions = $odb_class->odb_rvg_options['nr_of_revisions'];
857
-
858
- $index = 0;
859
-
860
- // SKIP REVISIONS THAT WILL BE DELETED BY THE 'OLDER THAN' OPTION
861
- $where2 = '';
862
- if($odb_class->odb_rvg_options['delete_older'] == 'Y') {
863
- $older_than = $odb_class->odb_rvg_options['older_than'];
864
- $where2 = 'AND p1.`post_modified` >= date_sub(now(), INTERVAL '.$older_than.' DAY)';
865
- }
866
-
867
- for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
868
- $prefix = $odb_class->odb_ms_prefixes[$i];
869
-
870
- $sql = sprintf ("
871
- SELECT '%s' AS site,
872
- p1.`ID`, p1.`post_parent`, p1.`post_title`, COUNT(*) cnt
873
- FROM %sposts p1, %sposts p2
874
- WHERE p1.`post_type` = 'revision'
875
- AND p1.`post_parent` = p2.ID
876
- %s
877
- %s
878
- GROUP BY p1.`post_parent`
879
- HAVING COUNT(*) > %d
880
- ORDER BY UCASE(p1.`post_title`)
881
- ",
882
- $prefix,
883
- $prefix,
884
- $prefix,
885
- $where1,
886
- $where2,
887
- $max_revisions);
888
-
889
- //echo 'KEEP: '.$sql.'<br>';
890
-
891
- $res = $wpdb->get_results($sql, ARRAY_A);
892
- for($j=0; $j<count($res); $j++) {
893
- if(isset($res[$j]) && !$this->odb_post_is_excluded($res[$j]['post_parent'])) {
894
- $res_arr[$index] = $res[$j];
895
- $index++;
896
- }
897
- } // for($j=0; $j<count($res); $j++)
898
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
899
-
900
- return $res_arr;
901
- } // odb_get_revisions_keep_revisions()
902
-
903
-
904
- /********************************************************************************************
905
- * DELETE THE REVISIONS
906
- ********************************************************************************************/
907
- function odb_delete_revisions($scheduler, $analyzing = false) {
908
- global $odb_class, $wpdb;
909
-
910
- $total_deleted = 0;
911
- $nr = 1;
912
-
913
- if($odb_class->odb_rvg_options['delete_older'] == 'Y') {
914
- // DELETE REVISIONS OLDER THAN x DAYS
915
- $results = $this->odb_get_revisions_older_than();
916
- $older_than = $odb_class->odb_rvg_options['older_than'];
917
- $total_deleted += count($results);
918
-
919
- for($i=0; $i<count($results); $i++) {
920
- if (!$scheduler) {
921
- ?>
922
- <tr>
923
- <td align="right" valign="top"><?php echo $nr?>.</td>
924
- <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
925
- <td valign="top" class="odb-bold"><?php echo $results[$i]['post_title']?></td>
926
- <td valign="top" class="odb-bold"><?php echo $results[$i]['post_modified']?></td><?php
927
- } // if (!$scheduler)
928
-
929
- if (!$analyzing) {
930
- $sql_delete = sprintf ("
931
- DELETE FROM %sposts
932
- WHERE `ID` = %d
933
- ", $results[$i]['site'], $results[$i]['ID']);
934
-
935
- $wpdb->get_results($sql_delete);
936
- } // if (!$analyzing)
937
-
938
- $nr++;
939
- if(!$scheduler) {
940
- ?>
941
- <td align="right" valign="top" class="odb-bold">1</td>
942
- </tr>
943
- <?php
944
- } // if(!$scheduler)
945
- } // for($i=0; $i<count($results); $i++)
946
- } // if($odb_class->odb_rvg_options['delete_older'] == 'Y')
947
-
948
- if($odb_class->odb_rvg_options['rvg_revisions'] == 'Y') {
949
- // KEEP MAX NUMBER OF REVISIONS
950
- $results = $this->odb_get_revisions_keep_revisions();
951
- $max_revisions = $odb_class->odb_rvg_options['nr_of_revisions'];
952
-
953
- for($i=0; $i<count($results); $i++) {
954
- $nr_to_delete = $results[$i]['cnt'] - $max_revisions;
955
- $total_deleted += $nr_to_delete;
956
-
957
- if (!$scheduler) {
958
- ?>
959
- <tr>
960
- <td align="right" valign="top"><?php echo $nr?>.</td>
961
- <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
962
- <td valign="top" class="odb-bold"><?php echo $results[$i]['post_title']?></td>
963
- <td valign="top"><?php
964
- } // if (!$scheduler)
965
-
966
- $sql_get_posts = sprintf( "
967
- SELECT `ID`, `post_modified`
968
- FROM %sposts
969
- WHERE `post_parent` = %d
970
- AND `post_type` = 'revision'
971
- ORDER BY `post_modified` ASC
972
- ", $results[$i]['site'], $results[$i]['post_parent']);
973
-
974
- $results_get_posts = $wpdb->get_results($sql_get_posts);
975
-
976
- for($j=0; $j<$nr_to_delete; $j++) {
977
- if(!$scheduler) echo $results_get_posts[$j]->post_modified.'<br>';
978
- if (!$analyzing) {
979
- $sql_delete = sprintf ("
980
- DELETE FROM %sposts
981
- WHERE `ID` = %d
982
- ", $results[$i]['site'], $results_get_posts[$j]->ID);
983
-
984
- $wpdb->get_results($sql_delete);
985
- } // if (!$analyzing)
986
- } // for($j=0; $j<$nr_to_delete; $j++)
987
-
988
- $nr++;
989
- if(!$scheduler) {
990
- ?></td>
991
- <td align="right" valign="top" class="odb-bold"><?php echo $nr_to_delete?> <?php _e('of', $odb_class->odb_txt_domain)?> <?php echo $results[$i]['cnt'];?></td>
992
- </tr>
993
- <?php
994
- } // if(!$scheduler)
995
- } // for($i=0; $i<count($results); $i++)
996
- } // if($odb_class->odb_rvg_options['rvg_revisions'] == 'Y')
997
-
998
- return $total_deleted;
999
- } // function odb_delete_revisions()
1000
-
1001
-
1002
- /********************************************************************************************
1003
- * CHECK IF POST IS EXCLUDED BY A CUSTOM FIELD ('keep_revisions')
1004
- ********************************************************************************************/
1005
- function odb_post_is_excluded($parent_id) {
1006
- $keep_revisions = get_post_meta($parent_id, 'keep_revisions', true);
1007
- return ($keep_revisions === 'Y');
1008
- } // odb_post_is_exclude()
1009
-
1010
-
1011
- /********************************************************************************************
1012
- * GET TRASHED POSTS / PAGES AND COMMENTS
1013
- ********************************************************************************************/
1014
- function odb_get_trash($analyzing = false) {
1015
- global $wpdb, $odb_class;
1016
-
1017
- $res_arr = array();
1018
-
1019
- $index = 0;
1020
- // LOOP TROUGH SITES
1021
- for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1022
- $prefix = $odb_class->odb_ms_prefixes[$i];
1023
-
1024
- $sql = sprintf ("
1025
- SELECT '%s' AS site,
1026
- `ID` AS id,
1027
- 'post' AS post_type,
1028
- `post_title` AS title,
1029
- `post_modified` AS modified
1030
- FROM %sposts
1031
- WHERE `post_status` = 'trash'
1032
- UNION ALL
1033
- SELECT '%s' AS site,
1034
- `comment_ID` AS id,
1035
- 'comment' AS post_type,
1036
- `comment_author_IP` AS title,
1037
- `comment_date` AS modified
1038
- FROM %scomments
1039
- WHERE `comment_approved` = 'trash'
1040
- ORDER BY post_type, UCASE(title)
1041
- ", $prefix, $prefix, $prefix, $prefix);
1042
-
1043
- $res = $wpdb->get_results($sql, ARRAY_A);
1044
-
1045
- if($res != null) {
1046
- $res_arr[$index] = $res[0];
1047
- $index++;
1048
- } // if($res != null)
1049
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1050
-
1051
- return $res_arr;
1052
- } // odb_get_trash()
1053
-
1054
-
1055
- /********************************************************************************************
1056
- * DELETE TRASHED POSTS AND PAGES
1057
- ********************************************************************************************/
1058
- function odb_delete_trash($results, $scheduler, $analyzing) {
1059
- global $wpdb;
1060
-
1061
- $nr = 1;
1062
- $total_deleted = count($results);
1063
-
1064
- for($i=0; $i<$total_deleted; $i++) {
1065
- if(!$scheduler) {
1066
- ?>
1067
- <tr>
1068
- <td align="right" valign="top"><?php echo $nr; ?></td>
1069
- <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
1070
- <td valign="top"><?php echo $results[$i]['post_type']; ?></td>
1071
- <td valign="top"><?php echo $results[$i]['title']; ?></td>
1072
- <td valign="top" nowrap="nowrap"><?php echo $results[$i]['modified']; ?></td>
1073
- </tr>
1074
- <?php
1075
- } // if(!$scheduler)
1076
-
1077
- if($results[$i]['post_type'] == 'comment') {
1078
- // DELETE META DATA (IF ANY...)
1079
- if (!$analyzing) {
1080
- $sql_delete = sprintf ("
1081
- DELETE FROM %scommentmeta
1082
- WHERE `comment_id` = %d
1083
- ", $results[$i]['site'], $results[$i]['id']);
1084
- $wpdb->get_results($sql_delete);
1085
- } // if (!$analyzing)
1086
- } // if($results[$i]['post_type'] == 'comment')
1087
-
1088
- if (!$analyzing) {
1089
- // DELETE TRASHED POSTS / PAGES
1090
- $sql_delete = sprintf ("
1091
- DELETE FROM %sposts
1092
- WHERE `post_status` = 'trash'
1093
- ", $results[$i]['site']);
1094
- $wpdb->get_results($sql_delete);
1095
-
1096
- // DELETE TRASHED COMMENTS
1097
- $sql_delete = sprintf ("
1098
- DELETE FROM %scomments
1099
- WHERE `comment_approved` = 'trash'
1100
- ", $results[$i]['site']);
1101
- $wpdb->get_results($sql_delete);
1102
- } // if (!$analyzing)
1103
-
1104
- $nr++;
1105
- } // for($i=0; $i<count($results); $i++)
1106
-
1107
- return $total_deleted;
1108
- } // odb_delete_trash()
1109
-
1110
-
1111
- /********************************************************************************************
1112
- * GET SPAMMED COMMENTS
1113
- ********************************************************************************************/
1114
- function odb_get_spam($analyzing = false) {
1115
- global $wpdb, $odb_class;
1116
-
1117
- $res_arr = array();
1118
-
1119
- // LOOP THROUGH SITES
1120
- for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1121
- $prefix = $odb_class->odb_ms_prefixes[$i];
1122
-
1123
- $sql = sprintf ("
1124
- SELECT '%s' AS site,
1125
- `comment_ID`,
1126
- `comment_author`,
1127
- `comment_author_email`,
1128
- `comment_date`
1129
- FROM %scomments
1130
- WHERE `comment_approved` = 'spam'
1131
- ORDER BY UCASE(`comment_author`)
1132
- ", $prefix, $prefix);
1133
-
1134
- $res = $wpdb->get_results($sql, ARRAY_A);
1135
-
1136
- for($j = 0; $j < count($res); $j++) {
1137
- array_push($res_arr, $res[$j]);
1138
- } // for($j = 0; $j < count($res); $j++)
1139
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1140
- return $res_arr;
1141
- } // odb_get_spam()
1142
-
1143
-
1144
- /********************************************************************************************
1145
- * DELETE SPAMMED ITEMS
1146
- ********************************************************************************************/
1147
- function odb_delete_spam($results, $scheduler, $analyzing = false) {
1148
- global $wpdb;
1149
-
1150
- $nr = 1;
1151
- $total_deleted = count($results);
1152
- for($i=0; $i<count($results); $i++) {
1153
- if (!$scheduler) {
1154
- ?>
1155
- <tr>
1156
- <td align="right" valign="top"><?php echo $nr; ?></td>
1157
- <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
1158
- <td valign="top"><?php echo $results[$i]['comment_author']; ?></td>
1159
- <td valign="top"><?php echo $results[$i]['comment_author_email']; ?></td>
1160
- <td valign="top" nowrap="nowrap"><?php echo $results[$i]['comment_date']; ?></td>
1161
- </tr>
1162
- <?php
1163
- } // if (!$scheduler)
1164
-
1165
- if (!$analyzing) {
1166
- $sql_delete = sprintf ("
1167
- DELETE FROM %scommentmeta
1168
- WHERE `comment_id` = %d
1169
- ", $results[$i]['site'], $results[$i]['comment_ID']);
1170
- $wpdb->get_results($sql_delete);
1171
-
1172
- $sql_delete = sprintf ("
1173
- DELETE FROM %scomments
1174
- WHERE `comment_approved` = 'spam'
1175
- ", $results[$i]['site']);
1176
- $wpdb->get_results($sql_delete);
1177
- } // if (!$analyzing)
1178
-
1179
- $nr++;
1180
- } // for($i=0; $i<count($results); $i++)
1181
-
1182
- return $total_deleted;
1183
- } // odb_delete_spam()
1184
-
1185
-
1186
- /********************************************************************************************
1187
- * GET UNUSED TAGS
1188
- ********************************************************************************************/
1189
- function odb_get_unused_tags($analyzing = false) {
1190
- global $wpdb, $odb_class;
1191
-
1192
- $res_arr = array();
1193
-
1194
- // LOOP THROUGH SITES
1195
- for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1196
- $prefix = $odb_class->odb_ms_prefixes[$i];
1197
-
1198
- $sql = sprintf ("
1199
- SELECT '%s' AS site,
1200
- a.term_id AS term_id, a.name AS name
1201
- FROM `%sterms` a, `%sterm_taxonomy` b
1202
- WHERE a.term_id = b.term_id
1203
- AND b.taxonomy = 'post_tag'
1204
- AND b.term_taxonomy_id NOT IN (
1205
- SELECT term_taxonomy_id
1206
- FROM %sterm_relationships
1207
- )
1208
- ORDER BY name
1209
- ", $prefix, $prefix, $prefix, $prefix);
1210
-
1211
- $res = $wpdb->get_results($sql, ARRAY_A);
1212
-
1213
- for($j = 0; $j < count($res); $j++) {
1214
- array_push($res_arr, $res[$j]);
1215
- } // for($j = 0; $j < count($res); $j++)
1216
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1217
- return $res_arr;
1218
- } // odb_get_unused_tags
1219
-
1220
-
1221
- /********************************************************************************************
1222
- * DELETE UNUSED TAGS
1223
- ********************************************************************************************/
1224
- function odb_delete_unused_tags($results, $scheduler, $analyzing = false) {
1225
- global $wpdb, $odb_class;
1226
-
1227
- $nr = 1;
1228
- $total_deleted = count($results);
1229
- for($i=0; $i<count($results); $i++) {
1230
- if (!$scheduler) {
1231
- ?>
1232
- <tr>
1233
- <td align="right" valign="top"><?php echo $nr; ?></td>
1234
- <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
1235
- <td valign="top"><?php echo $results[$i]['name']; ?></td>
1236
- </tr>
1237
- <?php
1238
- } // if (!$scheduler)
1239
-
1240
- if (!$analyzing) {
1241
- $sql_del = sprintf ("
1242
- DELETE FROM %sterm_taxonomy
1243
- WHERE term_id = %d
1244
- ", $results[$i]['site'], $results[$i]['term_id']);
1245
- $wpdb->get_results($sql_del);
1246
-
1247
- $sql_del = sprintf ("
1248
- DELETE FROM %sterms
1249
- WHERE term_id = %d
1250
- ", $results[$i]['site'], $results[$i]['term_id']);
1251
- $wpdb->get_results($sql_del);
1252
- } // if (!$analyzing)
1253
-
1254
- $nr++;
1255
- } // for($i=0; $i<count($results); $i++)
1256
-
1257
- return $total_deleted;
1258
- } // odb_delete_unused_tags()
1259
-
1260
-
1261
- /********************************************************************************************
1262
- * IS THE UNUSED TAG USED IN ONE OR MORE SCHEDULED POSTS?
1263
- ********************************************************************************************/
1264
- function odb_delete_tags_is_scheduled($term_id, $odb_prefix) {
1265
- global $wpdb;
1266
-
1267
- $sql_get_posts = sprintf ("
1268
- SELECT p.post_status
1269
- FROM %sterm_relationships t, %sposts p
1270
- WHERE t.term_taxonomy_id = '%s'
1271
- AND t.object_id = p.ID
1272
- ", $odb_prefix, $odb_prefix, $term_id);
1273
-
1274
- $results_get_posts = $wpdb->get_results($sql_get_posts);
1275
- for($i=0; $i<count($results_get_posts); $i++)
1276
- if($results_get_posts[$i]->post_status == 'future') return true;
1277
-
1278
- return false;
1279
- } // odb_delete_tags_is_scheduled()
1280
-
1281
-
1282
- /********************************************************************************************
1283
- * DELETE TRANSIENTS (v4.3.1)
1284
- ********************************************************************************************/
1285
- function odb_get_transients($analyzing = false) {
1286
- global $wpdb, $odb_class;
1287
-
1288
- $res_arr = array();
1289
-
1290
- // LOOP THROUGH SITES
1291
- $delay = time() - 60; // ONE MINUTE DELAY
1292
-
1293
- for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1294
- $prefix = $odb_class->odb_ms_prefixes[$i];
1295
-
1296
- if ($odb_class->odb_rvg_options['clear_transients'] == 'Y' || $odb_class->odb_rvg_options['clear_transients'] == 'A') {
1297
- // DELETE TRANSIENTS
1298
- if ($odb_class->odb_rvg_options['clear_transients'] == 'Y') {
1299
- // EXPIRED TRANSIENTS ONLY
1300
- $sql = "
1301
- SELECT '" . $prefix . "' AS site,
1302
- `option_name`
1303
- FROM " . $prefix . "options
1304
- WHERE (
1305
- option_name LIKE '_transient_timeout_%'
1306
- OR option_name LIKE '_site_transient_timeout_%'
1307
- )
1308
- AND option_value < '" . $delay . "'" . "
1309
- ORDER BY `option_name`
1310
- ";
1311
- } else {
1312
- // ALL TRANSIENTS
1313
- $sql = "
1314
- SELECT '" . $prefix . "' AS site,
1315
- `option_name`
1316
- FROM " . $prefix . "options
1317
- WHERE (
1318
- option_name LIKE '_transient_timeout_%'
1319
- OR option_name LIKE '_site_transient_timeout_%'
1320
- )
1321
- ORDER BY `option_name`
1322
- ";
1323
- } // if ($odb_class->odb_rvg_options['clear_transients'] == 'Y')
1324
- $res = $wpdb->get_results($sql, ARRAY_A);
1325
-
1326
- for($j = 0; $j < count($res); $j++) {
1327
- array_push($res_arr, $res[$j]);
1328
- } // for($j = 0; $j < count($res); $j++)
1329
- } // if ($odb_class->odb_rvg_options['clear_transients'] == 'Y' || $odb_class->odb_rvg_options['clear_transients'] == 'A')
1330
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1331
- return $res_arr;
1332
- } // odb_get_transients()
1333
-
1334
-
1335
- /********************************************************************************************
1336
- * DELETE TRANSIENTS (v4.3.1)
1337
- ********************************************************************************************/
1338
- function odb_delete_transients($results, $scheduler, $analyzing = false) {
1339
- global $wpdb;
1340
-
1341
- $total_deleted = 0;
1342
-
1343
- $nr = 1;
1344
- $total_deleted = count($results);
1345
- for($i=0; $i<count($results); $i++) {
1346
- if (!$scheduler) {
1347
- ?>
1348
- <tr>
1349
- <td align="right" valign="top"><?php echo $nr; ?></td>
1350
- <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
1351
- <td valign="top"><?php echo $results[$i]['option_name']; ?></td>
1352
- </tr>
1353
- <?php
1354
- } // if (!$scheduler)
1355
-
1356
- // LOOP THROUGH THE RESULTS
1357
- if (!$analyzing) {
1358
- for($j=0; $j<count($results); $j++) {
1359
- if(substr($results[$j]['option_name'], 0, 19) == '_transient_timeout_') {
1360
- // _transient_timeout_%
1361
- $transient = substr($results[$j]['option_name'], 19);
1362
- // DELETE THE TRANSIENT
1363
- delete_transient($transient);
1364
- } else {
1365
- // _site_transient_timeout_%
1366
- $transient = substr($results[$j]['option_name'], 24);
1367
- // DELETE THE TRANSIENT
1368
- delete_site_transient($transient);
1369
- } // if(substr($results[$j]->option_name, 0, 19) == '_transient_timeout_')
1370
- } // for($j=0; $j<count($results); $j++)
1371
- } // if (!$analyzing)
1372
-
1373
- $nr++;
1374
- } // for($i=0; $i<count($results); $i++)
1375
-
1376
- return $total_deleted;
1377
- } // odb_delete_transients()
1378
-
1379
-
1380
- /********************************************************************************************
1381
- * GET PINGBACKS AND TRACKBACKS
1382
- ********************************************************************************************/
1383
- function odb_get_pingbacks($analyzing = false) {
1384
-
1385
- global $wpdb, $odb_class;
1386
-
1387
- $res_arr = array();
1388
-
1389
- // LOOP THROUGH SITES
1390
- for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1391
- $prefix = $odb_class->odb_ms_prefixes[$i];;
1392
-
1393
- $sql = sprintf ("
1394
- SELECT '%s' AS site,
1395
- `comment_ID`,
1396
- `comment_type`,
1397
- `comment_author`,
1398
- `comment_date`
1399
- FROM %scomments
1400
- WHERE (
1401
- `comment_type` = 'pingback' OR `comment_type` = 'trackback'
1402
- )
1403
- ORDER BY `comment_type`, `comment_author`
1404
- ", $prefix, $prefix);
1405
-
1406
- $res = $wpdb->get_results($sql, ARRAY_A);
1407
-
1408
- for($j = 0; $j < count($res); $j++) {
1409
- array_push($res_arr, $res[$j]);
1410
- } // for($j = 0; $j < count($res); $j++)
1411
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1412
- return $res_arr;
1413
- } // odb_get_pingbacks
1414
-
1415
-
1416
- /********************************************************************************************
1417
- * DELETE PINGBACKS AND TRACKBACKS
1418
- ********************************************************************************************/
1419
- function odb_delete_pingbacks($results, $scheduler, $analyzing) {
1420
- global $wpdb, $odb_class;
1421
-
1422
- $nr = 1;
1423
- $total_deleted = count($results);
1424
- for($i=0; $i<count($results); $i++) {
1425
- if (!$scheduler) {
1426
- ?>
1427
- <tr>
1428
- <td align="right" valign="top"><?php echo $nr; ?></td>
1429
- <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
1430
- <td valign="top"><?php echo $results[$i]['comment_type']?></td>
1431
- <td valign="top"><?php echo $results[$i]['comment_author']?></td>
1432
- <td valign="top" nowrap="nowrap"><?php echo $results[$i]['comment_date']; ?></td>
1433
- </tr>
1434
- <?php
1435
- } // if (!$scheduler)
1436
-
1437
- if (!$analyzing) {
1438
- for($j=0; $j<count($results); $j++) {
1439
- // DELETE METADATA FOR THIS COMMENT (IF ANY)
1440
- $sql = sprintf ("
1441
- DELETE FROM %scommentmeta
1442
- WHERE `comment_id` = %d
1443
- ", $results[$j]['site'], $results[$j]['comment_ID']);
1444
- $wpdb->get_results($sql);
1445
-
1446
- $sql = sprintf ("
1447
- DELETE FROM %scomments
1448
- WHERE (
1449
- `comment_type` = 'pingback'
1450
- OR `comment_type` = 'trackback'
1451
- )
1452
- ", $results[$j]['site']);
1453
- $wpdb->get_results($sql);
1454
- } // for($j=0; $j<count($results); $j++)
1455
- } // if (!$analyzing)
1456
-
1457
- $nr++;
1458
- } // for($i=0; $i<count($results); $i++)
1459
-
1460
- return $total_deleted;
1461
- } // odb_delete_pingbacks()
1462
-
1463
-
1464
- /********************************************************************************************
1465
- * GET OEMBED CACHE
1466
- ********************************************************************************************/
1467
- function odb_get_oembed($analyzing = false) {
1468
- global $wpdb, $odb_class;
1469
-
1470
- $res_arr = array();
1471
-
1472
- // LOOP THROUGH SITES
1473
- for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1474
- $prefix = $odb_class->odb_ms_prefixes[$i];
1475
-
1476
- $sql = sprintf ("
1477
- SELECT '%s' AS site,
1478
- `meta_id`,
1479
- `meta_key`,
1480
- `meta_value`
1481
- FROM %spostmeta
1482
- WHERE `meta_key` LIKE '_oembed_%%'
1483
- ORDER BY `meta_key`
1484
- ", $prefix, $prefix);
1485
-
1486
- $res = $wpdb->get_results($sql, ARRAY_A);
1487
-
1488
- for($j = 0; $j < count($res); $j++) {
1489
- array_push($res_arr, $res[$j]);
1490
- } // for($j = 0; $j < count($res); $j++)
1491
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1492
- return $res_arr;
1493
- } // odb_get_oembed()
1494
-
1495
-
1496
- /********************************************************************************************
1497
- * CLEAR OEMBED CACHE
1498
- ********************************************************************************************/
1499
- function odb_delete_oembed($results, $scheduler, $analyzing) {
1500
- global $wpdb, $odb_class;
1501
-
1502
- $nr = 1;
1503
- $total_deleted = count($results);
1504
- for($i=0; $i<count($results); $i++) {
1505
- if (!$scheduler) {
1506
- ?>
1507
- <tr>
1508
- <td align="right" valign="top"><?php echo $nr; ?></td>
1509
- <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
1510
- <td valign="top"><?php echo $results[$i]['meta_key']?></td>
1511
- <td valign="top"><?php echo $results[$i]['meta_value']?></td>
1512
- </tr>
1513
- <?php
1514
- } // if (!$scheduler)
1515
-
1516
- if (!$analyzing) {
1517
- // DELETE COMMENTS
1518
- $sql = sprintf ("
1519
- DELETE FROM %spostmeta
1520
- WHERE `meta_key` LIKE '_oembed_%%'
1521
- ", $results[$i]['site']);
1522
-
1523
- $wpdb->get_results($sql);
1524
- } // if (!$analyzing)
1525
-
1526
- $nr++;
1527
- } // for($i=0; $i<count($results); $i++)
1528
-
1529
- return $total_deleted;
1530
- } // odb_delete_oembed()
1531
-
1532
-
1533
- /********************************************************************************************
1534
- * GET ORPHAN POSTMETA AND MEDIA RECORDS
1535
- ********************************************************************************************/
1536
- function odb_get_orphans($results, $scheduler, $analyzing) {
1537
- global $wpdb, $odb_class;
1538
-
1539
- $res_arr = array();
1540
-
1541
- // LOOP THROUGH SITES
1542
- for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1543
- $prefix = $odb_class->odb_ms_prefixes[$i];
1544
-
1545
- $sql = sprintf ("
1546
- SELECT '%s' AS site,
1547
- `ID`,
1548
- 'post' AS type,
1549
- `post_title`,
1550
- `post_modified`,
1551
- '' AS meta_key,
1552
- '' AS meta_value
1553
- FROM %sposts
1554
- WHERE ID NOT IN (SELECT post_id FROM %spostmeta)
1555
- AND post_status = 'auto-draft'
1556
- ORDER BY `ID`
1557
- ", $prefix, $prefix, $prefix);
1558
-
1559
- $results = $wpdb->get_results($sql, ARRAY_A);
1560
- for ($j = 0; $j < count($results); $j++) {
1561
- array_push($res_arr, $results[$j]);
1562
- } // for ($j = 0; $j < count($results); $j++)
1563
-
1564
- // DELETE POSTMETA ORPHANS
1565
- $sql = sprintf ("
1566
- SELECT '%s' AS site,
1567
- `post_id` AS ID,
1568
- 'meta' AS type,
1569
- '' AS post_title,
1570
- '' AS post_modified,`meta_key`, `meta_value`
1571
- FROM %spostmeta
1572
- WHERE post_id NOT IN (SELECT ID FROM %sposts)
1573
- ORDER BY `meta_key`
1574
- ", $prefix, $prefix, $prefix);
1575
-
1576
- $results = $wpdb->get_results($sql, ARRAY_A);
1577
- for ($j = 0; $j < count($results); $j++) {
1578
- array_push($res_arr, $results[$j]);
1579
- } // for ($j = 0; $j < count($results); $j++)
1580
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1581
- return $res_arr;
1582
- } // odb_get_orphans()
1583
-
1584
-
1585
- /********************************************************************************************
1586
- * DELETE ORPHAN POSTMETA AND MEDIA RECORDS
1587
- ********************************************************************************************/
1588
- function odb_delete_orphans($results, $scheduler, $analyzing) {
1589
-
1590
- global $wpdb, $odb_class;
1591
-
1592
- $nr = 1;
1593
- $total_deleted = count($results);
1594
- for($i=0; $i<count($results); $i++) {
1595
- if (!$scheduler) {
1596
- ?>
1597
- <tr>
1598
- <td align="right" valign="top"><?php echo $nr; ?></td>
1599
- <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
1600
- <td valign="top"><?php echo $results[$i]['type']?></td>
1601
- <td valign="top"><?php echo $results[$i]['ID']?></td>
1602
- <td valign="top"><?php echo $results[$i]['post_title']?></td>
1603
- <td valign="top" nowrap="nowrap"><?php echo substr($results[$i]['post_modified'], 0, 10); ?></td>
1604
- <td valign="top" nowrap="nowrap"><?php echo $results[$i]['meta_key']; ?></td>
1605
- <td valign="top" nowrap="nowrap"><?php echo $results[$i]['meta_value']; ?></td>
1606
- </tr>
1607
- <?php
1608
- } // if (!$scheduler)
1609
-
1610
- if (!$analyzing) {
1611
- for($j=0; $j<count($results); $j++) {
1612
- // DELETE METADATA FOR THIS COMMENT (IF ANY)
1613
- if ($results[$j]['type'] == 'meta') {
1614
- $sql = sprintf ("
1615
- DELETE FROM %spostmeta
1616
- WHERE `post_id` = %d
1617
- ", $results[$j]['site'], $results[$j]['ID']);
1618
- } else if ($results[$j]['type'] == 'post') {
1619
- $sql = sprintf ("
1620
- DELETE FROM %sposts
1621
- WHERE `ID` = %d
1622
- ", $results[$j]['site'], $results[$j]['ID']);
1623
- } // if ($results[$j]['type'] == 'meta')
1624
- //echo 'SQL: ' . $sql.'<br>';
1625
- $wpdb->get_results($sql);
1626
- }// for($j=0; $j<count($results); $j++)
1627
- } // if (!$analyzing)
1628
- $nr++;
1629
- } // for($i=0; $i<count($results); $i++)
1630
-
1631
- return $total_deleted;
1632
- } // odb_delete_orphans()
1633
-
1634
-
1635
- /********************************************************************************************
1636
- * OPTIMIZE DATABASE TABLES
1637
- ********************************************************************************************/
1638
- function odb_optimize_tables($scheduler) {
1639
- global $odb_class, $wpdb;
1640
-
1641
- $cnt = 0;
1642
- for ($i=0; $i<count($odb_class->odb_tables); $i++) {
1643
- if(!isset($odb_class->odb_rvg_excluded_tabs[$odb_class->odb_tables[$i][0]])) {
1644
- # TABLE NOT EXCLUDED
1645
- $cnt++;
1646
-
1647
- $sql = sprintf ("
1648
- SELECT engine, (data_length + index_length) AS size, table_rows
1649
- FROM information_schema.TABLES
1650
- WHERE table_schema = '%s'
1651
- AND table_name = '%s'
1652
- ", DB_NAME, $odb_class->odb_tables[$i][0]);
1653
- $table_info = $wpdb->get_results($sql);
1654
-
1655
- if($odb_class->odb_rvg_options["optimize_innodb"] == 'N' && strtolower($table_info[0]->engine) == 'innodb') {
1656
- // SKIP InnoDB tables
1657
- $msg = __('InnoDB table: skipped...', 'rvg-optimize-database');
1658
- } else {
1659
- // v4.6.3
1660
- if (strtolower($table_info[0]->engine) == 'myisam') {
1661
- $result = $this->odb_optimize_myisam($odb_class->odb_tables[$i][0]);
1662
- $msg = $result[0]->Msg_text;
1663
- if ($msg == 'OK') {
1664
- $msg = __('<span class="odb-optimized">TABLE OPTIMIZED</span>', 'rvg-optimize-database');
1665
- } else if ($msg == 'Table is already up to date') {
1666
- $msg = __('Table is already up to date', 'rvg-optimize-database');
1667
- }
1668
- } else {
1669
- $result = $this->odb_optimize_innodb($odb_class->odb_tables[$i][0]);
1670
- $msg = $result[0]->Msg_text;
1671
- if ($msg == 'Table is already up to date') {
1672
- $msg = __('Table is already up to date', 'rvg-optimize-database');
1673
- } else {
1674
- $msg = __('<span class="odb-optimized">TABLE OPTIMIZED</span>', 'rvg-optimize-database');
1675
- }
1676
- } // if (strtolower($table_info[0]->engine) == 'myisam')
1677
- } // if($odb_class->odb_rvg_options["optimize_innodb"] == 'N' && strtolower($table_info[0]->engine) == 'innodb')
1678
-
1679
- if (!$scheduler)
1680
- { // NOT FROM THE SCEDULER
1681
- ?>
1682
- <tr>
1683
- <td align="right" valign="top"><?php echo $cnt?>.</td>
1684
- <td valign="top" class="odb-bold"><?php echo $odb_class->odb_tables[$i][0] ?></td>
1685
- <td valign="top"><?php echo $msg ?></td>
1686
- <td valign="top"><?php echo $table_info[0]->engine ?></td>
1687
- <td align="right" valign="top"><?php echo $table_info[0]->table_rows ?></td>
1688
- <td align="right" valign="top"><?php echo $odb_class->odb_utilities_obj->odb_format_size($table_info[0]->size) ?></td>
1689
- </tr>
1690
- <?php
1691
- } // if (!$scheduler)
1692
- } // if(!$excluded)
1693
- } // for ($i=0; $i<count($tables); $i++)
1694
- return $cnt;
1695
-
1696
- } // odb_optimize_tables()
1697
-
1698
-
1699
- /********************************************************************************************
1700
- * OPTIMIZE A MyISAM TABLE
1701
- ********************************************************************************************/
1702
- function odb_optimize_myisam($table_name) {
1703
- global $wpdb;
1704
- $query = "OPTIMIZE TABLE " . $table_name;
1705
- return $wpdb->get_results($query);
1706
- } // odb_optimize_myisam()
1707
-
1708
-
1709
- /********************************************************************************************
1710
- * OPTIMIZE AN InnoDB TABLE
1711
- ********************************************************************************************/
1712
- function odb_optimize_innodb($table_name) {
1713
- global $wpdb;
1714
-
1715
- $query = "OPTIMIZE TABLE " . $table_name;
1716
- return $wpdb->get_results($query);
1717
-
1718
- /* // https://www.percona.com/blog/2010/12/09/mysql-optimize-tables-innodb-stop/
1719
- $query = "SHOW KEYS FROM " . $table_name . " WHERE Key_name <> 'PRIMARY'";
1720
- $result = $wpdb->get_results($query);
1721
- if (count($result) > 0) {
1722
- for ($i = 0; $i < count($result); $i++) {
1723
- $key_name = $result[$i]->Key_name;
1724
-
1725
- $query = "ALTER TABLE " . $table_name . " DROP KEY " . $key_name;
1726
- $result = $wpdb->get_results($query);
1727
-
1728
- $query = "ALTER TABLE " . $table_name . " add key(" . $key_name . ")";
1729
- $result = $wpdb->get_results($query);
1730
- } // for ($i = 0; $i < count($result); $i++)
1731
- return __('<span class="odb-optimized">TABLE OPTIMIZED</span>', 'rvg-optimize-database');
1732
- } else {
1733
- return __('Table is already up to date', 'rvg-optimize-database');
1734
- } // if (count($result) > 0*/
1735
- } // odb_optimize_innodb()
1736
-
1737
- } // ODB_Cleaner
1738
  ?>
1
+ <?php
2
+ /************************************************************************************************
3
+ *
4
+ * CLEANER CLASS: DOING THE REAL CLEANING / OPTIMIZATION
5
+ *
6
+ ************************************************************************************************/
7
+ ?>
8
+ <?php
9
+ class ODB_Cleaner {
10
+ var $start_size;
11
+ var $nr_of_optimized_tables;
12
+
13
+
14
+ /********************************************************************************************
15
+ * CONSTRUCTOR
16
+ ********************************************************************************************/
17
+ function __construct() {
18
+ } // __construct()
19
+
20
+
21
+ /********************************************************************************************
22
+ * RUN CLEANER
23
+ ********************************************************************************************/
24
+ function odb_run_cleaner($scheduler, $analyzing = false) {
25
+ global $odb_class;
26
+
27
+ if(!$scheduler) {
28
+ if ($analyzing) {
29
+ echo '
30
+ <div id="odb-cleaner" class="odb-padding-left">
31
+ <div class="odb-title-bar">
32
+ <h2>'.__('Analyzing Database', $odb_class->odb_txt_domain).'</h2>
33
+ </div>
34
+ <br>
35
+ <br>
36
+ ';
37
+ } else {
38
+ echo '
39
+ <div id="odb-cleaner" class="odb-padding-left">
40
+ <div class="odb-title-bar">
41
+ <h2>'.__('Cleaning Database', $odb_class->odb_txt_domain).'</h2>
42
+ </div>
43
+ <br>
44
+ <br>
45
+ ';
46
+ }
47
+ } // if(!$scheduler)
48
+
49
+ // GET THE SIZE OF THE DATABASE BEFORE OPTIMIZATION
50
+ $this->start_size = $odb_class->odb_utilities_obj->odb_get_db_size();
51
+
52
+ // TIMESTAMP FOR LOG FILE - v4.6
53
+ $ct = ($scheduler) ? ' (cron)' : '';
54
+
55
+ $odb_class->log_arr["timestamp"] = current_time('YmdHis', 0);
56
+ $odb_class->log_arr["after"] = 0;
57
+ $odb_class->log_arr["before"] = 0;
58
+ $odb_class->log_arr["orphans"] = 0;
59
+ $odb_class->log_arr["pingbacks"] = 0;
60
+ $odb_class->log_arr["oembeds"] = 0;
61
+ $odb_class->log_arr["orphans"] = 0;
62
+ $odb_class->log_arr["revisions"] = 0;
63
+ $odb_class->log_arr["savings"] = 0;
64
+ $odb_class->log_arr["spam"] = 0;
65
+ $odb_class->log_arr["tables"] = 0;
66
+ $odb_class->log_arr["tags"] = 0;
67
+ $odb_class->log_arr["transients"] = 0;
68
+ $odb_class->log_arr["trash"] = 0;
69
+
70
+ /****************************************************************************************
71
+ * DELETE REVISIONS
72
+ ****************************************************************************************/
73
+ if($odb_class->odb_rvg_options['delete_older'] == 'Y' || $odb_class->odb_rvg_options['rvg_revisions'] == 'Y') {
74
+ // FIND REVISIONS
75
+ $results_older_than = array();
76
+ if($odb_class->odb_rvg_options['delete_older'] == 'Y') {
77
+ $results_older_than = $this->odb_get_revisions_older_than();
78
+ }
79
+
80
+ $results_keep_revisions = array();
81
+ if($odb_class->odb_rvg_options['rvg_revisions'] == 'Y') {
82
+ $results_keep_revisions = $this->odb_get_revisions_keep_revisions();
83
+ }
84
+
85
+ $total_deleted = 0;
86
+ if(count($results_older_than) > 0 || count($results_keep_revisions) > 0) {
87
+ // WE HAVE REVISIONS TO DELETE!
88
+ if(!$scheduler) {
89
+ if ($analyzing) {
90
+ $msg1 = __('REVISIONS','rvg-optimize-database');
91
+ $msg2 = __('revisions', $odb_class->odb_txt_domain);
92
+ } else {
93
+ $msg1 = __('DELETED REVISIONS','rvg-optimize-database');
94
+ $msg2 = __('revisions deleted', $odb_class->odb_txt_domain);
95
+ }
96
+ ?>
97
+ <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
98
+ <tr>
99
+ <td colspan="4"><div class="odb-found"><?php echo $msg1?></div></td>
100
+ </tr>
101
+ <tr>
102
+ <th align="right" class="odb-border-bottom">#</th>
103
+ <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
104
+ <th align="left" class="odb-border-bottom"><?php _e('post / page', $odb_class->odb_txt_domain);?></th>
105
+ <th align="left" class="odb-border-bottom"><?php _e('revision date', $odb_class->odb_txt_domain);?></th>
106
+ <th align="right" class="odb-border-bottom"><?php echo $msg2?></th>
107
+ </tr>
108
+ <?php
109
+ } // if(!$scheduler)
110
+
111
+ // LOOP THROUGH THE REVISIONS AND DELETE THEM
112
+ $total_deleted = $this->odb_delete_revisions($scheduler, $analyzing);
113
+
114
+ if(!$scheduler) {
115
+ if ($analyzing) {
116
+ $msg1 = __('total number of revisions', $odb_class->odb_txt_domain);
117
+ } else {
118
+ $msg1 = __('total number of revisions deleted', $odb_class->odb_txt_domain);
119
+ } // if (!$analyzing)
120
+ ?>
121
+ <tr>
122
+ <td colspan="5" align="right" class="odb-border-top odb-bold"><?php echo $msg1 ?>: <?php echo $total_deleted?></td>
123
+ </tr>
124
+ </table>
125
+ <?php
126
+ } // if(!$scheduler)
127
+ } else {
128
+ if(!$scheduler) {
129
+ ?>
130
+ <div class="odb-not-found">
131
+ <?php _e('No REVISIONS found to delete', $odb_class->odb_txt_domain);?>
132
+ </div>
133
+ <?php
134
+ } // if(!$scheduler)
135
+ } // if(count($results)>0)
136
+
137
+ // NUMBER OF DELETED REVISIONS FOR LOG FILE
138
+ $odb_class->log_arr["revisions"] = $total_deleted;
139
+ } // if($odb_class->odb_rvg_options['delete_older'] == 'Y' || $odb_class->odb_rvg_options['rvg_revisions'] == 'Y')
140
+
141
+
142
+ /****************************************************************************************
143
+ * DELETE TRASHED ITEMS
144
+ ****************************************************************************************/
145
+ if($odb_class->odb_rvg_options['clear_trash'] == 'Y') {
146
+ // GET TRASHED POSTS / PAGES AND COMMENTS
147
+ $results = $this->odb_get_trash($analyzing);
148
+
149
+ $total_deleted = 0;
150
+ if(count($results)>0) {
151
+ // WE HAVE TRASH TO DELETE!
152
+ if(!$scheduler) {
153
+ if ($analyzing) {
154
+ $msg1 = __('TRASHED ITEMS', $odb_class->odb_txt_domain);
155
+ $msg2 = __('total number of trashed items', $odb_class->odb_txt_domain);
156
+ } else {
157
+ $msg1 = __('DELETED TRASHED ITEMS', $odb_class->odb_txt_domain);
158
+ $msg2 = __('total number of trashed items deleted', $odb_class->odb_txt_domain);
159
+ } // if ($analyzing)
160
+ ?>
161
+ <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
162
+ <tr>
163
+ <td colspan="4"><div class="odb-found">
164
+ <?php echo $msg1 ?>
165
+ </div></td>
166
+ </tr>
167
+ <tr>
168
+ <th align="right" class="odb-border-bottom">#</th>
169
+ <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
170
+ <th align="left" class="odb-border-bottom"><?php _e('type', $odb_class->odb_txt_domain);?></th>
171
+ <th align="left" class="odb-border-bottom"><?php _e('IP address / title', $odb_class->odb_txt_domain);?></th>
172
+ <th align="left" nowrap="nowrap" class="odb-border-bottom"><?php _e('date', $odb_class->odb_txt_domain);?></th>
173
+ </tr>
174
+ <?php
175
+ } // if(!$scheduler)
176
+
177
+ // LOOP THROUGH THE TRASHED ITEMS AND DELETE THEM
178
+ $total_deleted = $this->odb_delete_trash($results, $scheduler, $analyzing);
179
+
180
+ if(!$scheduler) {
181
+ ?>
182
+ <tr>
183
+ <td colspan="5" align="right" class="odb-border-top odb-bold"><?php echo $msg2 ?>: <?php echo $total_deleted?></td>
184
+ </tr>
185
+ </table>
186
+ <?php
187
+ } // if(!$scheduler)
188
+ } else {
189
+ if(!$scheduler) {
190
+ ?>
191
+ <div class="odb-not-found">
192
+ <?php _e('No TRASHED ITEMS found to delete', $odb_class->odb_txt_domain);?>
193
+ </div>
194
+ <?php
195
+ } // if(!$scheduler)
196
+ } // if(count($results)>0)
197
+
198
+ // NUMBER OF DELETED TRASH FOR LOG FILE
199
+ $odb_class->log_arr["trash"] = $total_deleted;
200
+ } // if($odb_class->odb_rvg_options['clear_trash'] == 'Y')
201
+
202
+
203
+ /****************************************************************************************
204
+ * DELETE SPAMMED ITEMS
205
+ ****************************************************************************************/
206
+ if($odb_class->odb_rvg_options['clear_spam'] == 'Y') {
207
+ // GET SPAMMED COMMENTS
208
+ $results = $this->odb_get_spam($analyzing);
209
+
210
+ $total_deleted = 0;
211
+ if(count($results)>0) {
212
+ // WE HAVE SPAM TO DELETE!
213
+ if (!$scheduler) {
214
+ if ($analyzing) {
215
+ $msg1 = __('SPAMMED ITEMS', $odb_class->odb_txt_domain);
216
+ $msg2 = __('total number of spammed items', $odb_class->odb_txt_domain);
217
+ } else {
218
+ $msg1 = __('DELETED SPAMMED ITEMS', $odb_class->odb_txt_domain);
219
+ $msg2 = __('total number of spammed items deleted', $odb_class->odb_txt_domain);
220
+ } // if ($analyzing)
221
+ ?>
222
+ <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
223
+ <tr>
224
+ <td colspan="4"><div class="odb-found">
225
+ <?php echo $msg1 ?>
226
+ </div></td>
227
+ </tr>
228
+ <tr>
229
+ <th align="right" class="odb-border-bottom">#</th>
230
+ <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
231
+ <th align="left" class="odb-border-bottom"><?php _e('comment author', $odb_class->odb_txt_domain);?></th>
232
+ <th align="left" class="odb-border-bottom"><?php _e('comment author email', $odb_class->odb_txt_domain);?></th>
233
+ <th align="left" nowrap="nowrap" class="odb-border-bottom"><?php _e('comment date', $odb_class->odb_txt_domain);?></th>
234
+ </tr>
235
+ <?php
236
+ } // if (!$scheduler)
237
+
238
+ // LOOP THROUGH SPAMMED ITEMS AND DELETE THEM
239
+ $total_deleted = $this->odb_delete_spam($results, $scheduler, $analyzing);
240
+
241
+ if (!$scheduler) {
242
+ ?>
243
+ <tr>
244
+ <td colspan="5" align="right" class="odb-border-top odb-bold"><?php echo $msg2 ?>: <?php echo $total_deleted?></td>
245
+ </tr>
246
+ </table>
247
+ <?php
248
+ } // if (!$scheduler)
249
+ } else{
250
+ if (!$scheduler) {
251
+ ?>
252
+ <div class="odb-not-found">
253
+ <?php _e('No SPAMMED ITEMS found to delete', $odb_class->odb_txt_domain);?>
254
+ </div>
255
+ <?php
256
+ } // if (!$scheduler)
257
+ } // if(count($results)>0)
258
+
259
+ // NUMBER OF SPAM DELETED FOR LOG FILE
260
+ $odb_class->log_arr["spam"] = $total_deleted;
261
+ } // if($odb_class->odb_rvg_options['clear_spam'] == 'Y')
262
+
263
+
264
+ /****************************************************************************************
265
+ * DELETE UNUSED TAGS
266
+ ****************************************************************************************/
267
+ if($odb_class->odb_rvg_options['clear_tags'] == 'Y') {
268
+ // GET UNUSED TAGS
269
+ $results = $this->odb_get_unused_tags($analyzing);
270
+
271
+ $total_deleted = 0;
272
+
273
+ if(count($results)>0) {
274
+ // WE HAVE TAGS TO DELETE!
275
+ if (!$scheduler) {
276
+ if ($analyzing) {
277
+ $msg1 = __('UNUSED TAGS', $odb_class->odb_txt_domain);
278
+ $msg2 = __('total number of unused tags', $odb_class->odb_txt_domain);
279
+ } else {
280
+ $msg1 = __('DELETED UNUSED TAGS', $odb_class->odb_txt_domain);
281
+ $msg2 = __('total number of unused tags deleted', $odb_class->odb_txt_domain);
282
+ }
283
+ ?>
284
+ <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
285
+ <tr>
286
+ <td colspan="4"><div class="odb-found">
287
+ <?php echo $msg1 ?>
288
+ </div></td>
289
+ </tr>
290
+ <tr>
291
+ <th align="right" class="odb-border-bottom">#</th>
292
+ <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
293
+ <th align="left" class="odb-border-bottom"><?php _e('tag', $odb_class->odb_txt_domain);?></th>
294
+ </tr>
295
+ <?php
296
+ } // if (!$scheduler)
297
+
298
+ // LOOP THROUGH UNUSED TAGS AND DELETE THEM
299
+ $total_deleted = $this->odb_delete_unused_tags($results, $scheduler, $analyzing);
300
+
301
+ if (!$scheduler) {
302
+ ?>
303
+ <tr>
304
+ <td colspan="5" align="right" class="odb-border-top odb-bold"><?php echo $msg2 ?>: <?php echo $total_deleted?></td>
305
+ </tr>
306
+ </table>
307
+ <?php
308
+ } // if (!$scheduler)
309
+ } else {
310
+ if (!$scheduler) {
311
+ ?>
312
+ <div class="odb-not-found">
313
+ <?php _e('No UNUSED TAGE found to delete', $odb_class->odb_txt_domain);?>
314
+ </div>
315
+ <?php
316
+ } // if (!$scheduler)
317
+ } // if(count($results)>0)
318
+
319
+ // NUMBER OF SPAM DELETED FOR LOG FILE
320
+ $odb_class->log_arr["tags"] = $total_deleted;
321
+ } // if($odb_class->odb_rvg_options['clear_spam'] == 'Y')
322
+
323
+
324
+ /****************************************************************************************
325
+ * DELETE EXPIRED TRANSIENTS
326
+ ****************************************************************************************/
327
+ if ($odb_class->odb_rvg_options['clear_transients'] !== 'N') {
328
+ // DELETE TRAMSIENTS ENABLED
329
+ $total_deleted = 0;
330
+
331
+ if (!$scheduler) {
332
+ // NOT VIA SCHEDULER
333
+ if ($odb_class->odb_rvg_options['clear_transients'] == 'Y') {
334
+ // EXPRIRED TRANSIENTS ONLY
335
+ if ($analyzing){
336
+ $msg1 = __('EXPIRED TRANSIENTS', $odb_class->odb_txt_domain);
337
+ $msg2 = __('total number of expired transients', $odb_class->odb_txt_domain);
338
+ } else {
339
+ $msg1 = __('EXPIRED TRANSIENTS DELETED', $odb_class->odb_txt_domain);
340
+ $msg2 = __('total number of expired transients deleted', $odb_class->odb_txt_domain);
341
+ } // if ($analyzing)
342
+ } else {
343
+ // ALL TRANSIENTS
344
+ if ($analyzing){
345
+ $msg1 = __('TRANSIENTS', $odb_class->odb_txt_domain);
346
+ $msg2 = __('total number of transients', $odb_class->odb_txt_domain);
347
+ } else {
348
+ $msg1 = __('TRANSIENTS DELETED', $odb_class->odb_txt_domain);
349
+ $msg2 = __('total number of transients', $odb_class->odb_txt_domain);
350
+ } // if ($analyzing
351
+ } // if ($odb_class->odb_rvg_options['clear_transients'] == 'Y')
352
+ $res = $this->odb_delete_transients($scheduler, $analyzing);
353
+ $total_deleted = count($res);
354
+ if ($total_deleted > 0) {
355
+ ?>
356
+ <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
357
+ <tr>
358
+ <td colspan="4"><div class="odb-found">
359
+ <?php echo $msg1 ?>
360
+ </div></td>
361
+ </tr>
362
+ <tr>
363
+ <th align="right" class="odb-border-bottom">#</th>
364
+ <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
365
+ <th align="left" class="odb-border-bottom"><?php _e('option name', $odb_class->odb_txt_domain);?></th>
366
+ </tr>
367
+ <?php
368
+ // LOOP THROUGH TRANSIENS ITEMS AND DELETE THEM
369
+ $nr = 1;
370
+ for ($j = 0; $j < $total_deleted; $j++) {
371
+ ?>
372
+ <tr>
373
+ <td align="right" valign="top"><?php echo $nr; ?></td>
374
+ <td align="left" valign="top"><?php echo $res[$j]['site']?></td>
375
+ <td valign="top"><?php echo $res[$j]['option_name']; ?></td>
376
+ </tr>
377
+ <?php
378
+ $nr++;
379
+ } // for ($j = 0; $j < count($res);$j++) {
380
+ ?>
381
+ <tr>
382
+ <td colspan="3" align="right" class="odb-border-top odb-bold"<?php echo $msg2 ?>: <?php echo $total_deleted?></td>
383
+ </tr>
384
+ </table>
385
+ <?php
386
+ } else {
387
+ ?>
388
+ <div class="odb-not-found">
389
+ <?php
390
+ if ($odb_class->odb_rvg_options['clear_transients'] == 'Y') {
391
+ $msg = _e('No EXPIRED TRANSIENTS found to delete', $odb_class->odb_txt_domain);
392
+ } else {
393
+ $msg = _e('No TRANSIENTS found to delete', $odb_class->odb_txt_domain);
394
+ }
395
+ ?>
396
+ </div>
397
+ <?php
398
+ }
399
+ } else {
400
+ return;
401
+ } // if (!$scheduler)
402
+ } // if($odb_class->odb_rvg_options['clear_transients'] != 'N')
403
+
404
+ /****************************************************************************************
405
+ * DELETE PINGBACKS AND TRACKBACKS
406
+ ****************************************************************************************/
407
+ if($odb_class->odb_rvg_options['clear_pingbacks'] == 'Y') {
408
+ // GET PINGBACKS AND TRACKBACKS
409
+ $results = $this->odb_get_pingbacks($analyzing);
410
+
411
+ $total_deleted = 0;
412
+ if(count($results)>0) {
413
+ // WE HAVE TRASH TO DELETE!
414
+ if(!$scheduler) {
415
+ if ($analyzing) {
416
+ $msg1 = __('PINGBACKS AND TRACKBACKS', $odb_class->odb_txt_domain);
417
+ $msg2 = __('total number of pingbacks and trackbacks', $odb_class->odb_txt_domain);
418
+ } else {
419
+ $msg1 = __('DELETED PINGBACKS AND TRACKBACKS', $odb_class->odb_txt_domain);
420
+ $msg2 = __('total number of pingbacks and trackbacks deleted', $odb_class->odb_txt_domain);
421
+ } // if ($analyzing)
422
+ ?>
423
+ <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
424
+ <tr>
425
+ <td colspan="4"><div class="odb-found">
426
+ <?php echo $msg1 ?>
427
+ </div></td>
428
+ </tr>
429
+ <tr>
430
+ <th align="right" class="odb-border-bottom">#</th>
431
+ <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
432
+ <th align="left" class="odb-border-bottom"><?php _e('type', $odb_class->odb_txt_domain);?></th>
433
+ <th align="left" class="odb-border-bottom"><?php _e('comment_author', $odb_class->odb_txt_domain);?></th>
434
+ <th align="left" nowrap="nowrap" class="odb-border-bottom"><?php _e('date', $odb_class->odb_txt_domain);?></th>
435
+ </tr>
436
+ <?php
437
+ } // if(!$scheduler)
438
+
439
+ // LOOP THROUGH THE TRASHED ITEMS AND DELETE THEM
440
+ $total_deleted = $this->odb_delete_pingbacks($results, $scheduler, $analyzing);
441
+
442
+ if(!$scheduler) {
443
+ ?>
444
+ <tr>
445
+ <td colspan="5" align="right" class="odb-border-top odb-bold"><?php echo $msg2 ?>: <?php echo $total_deleted?></td>
446
+ </tr>
447
+ </table>
448
+ <?php
449
+ } // if(!$scheduler)
450
+ } else {
451
+ if(!$scheduler) {
452
+ ?>
453
+ <div class="odb-not-found">
454
+ <?php _e('No PINGBACKS nor TRACKBACKS found to delete', $odb_class->odb_txt_domain);?>
455
+ </div>
456
+ <?php
457
+ } // if(!$scheduler)
458
+ } // if(count($results)>0)
459
+
460
+ // NUMBER OF DELETED PINGBACKS FOR LOG FILE
461
+ $odb_class->log_arr["pingbacks"] = $total_deleted;
462
+ } // if($odb_class->odb_rvg_options['clear_pingbacks'] == 'Y')
463
+
464
+
465
+ /****************************************************************************************
466
+ * DELETE OEMBED CACHE
467
+ ****************************************************************************************/
468
+ if($odb_class->odb_rvg_options['clear_oembed'] == 'Y') {
469
+
470
+ // GET OEMBED CACHE
471
+ $results = $this->odb_get_oembed($analyzing);
472
+
473
+ $total_deleted = 0;
474
+ if(count($results)>0) {
475
+ // WE HAVE TRASH TO DELETE!
476
+ if(!$scheduler) {
477
+ if ($analyzing) {
478
+ $msg1 = __('OEMBED CACHE', $odb_class->odb_txt_domain);
479
+ $msg2 = __('total number of oEmbeds', $odb_class->odb_txt_domain);
480
+ } else {
481
+ $msg1 = __('DELETED OEMBEDS', $odb_class->odb_txt_domain);
482
+ $msg2 = __('total number of oEmbeds deleted', $odb_class->odb_txt_domain);
483
+ } // if ($analyzing)
484
+ ?>
485
+ <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
486
+ <tr>
487
+ <td colspan="4"><div class="odb-found">
488
+ <?php echo $msg1 ?>
489
+ </div></td>
490
+ </tr>
491
+ <tr>
492
+ <th align="right" class="odb-border-bottom">#</th>
493
+ <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
494
+ <th align="left" class="odb-border-bottom"><?php _e('meta key', $odb_class->odb_txt_domain);?></th>
495
+ <th align="left" class="odb-border-bottom"><?php _e('meta value', $odb_class->odb_txt_domain);?></th>
496
+ </tr>
497
+ <?php
498
+ } // if(!$scheduler)
499
+
500
+ // LOOP THROUGH THE TRASHED ITEMS AND DELETE THEM
501
+ $total_deleted = $this->odb_delete_oembed($results, $scheduler, $analyzing);
502
+
503
+ if(!$scheduler) {
504
+ ?>
505
+ <tr>
506
+ <td colspan="4" align="right" class="odb-border-top odb-bold"><?php echo $msg2 ?>: <?php echo $total_deleted?></td>
507
+ </tr>
508
+ </table>
509
+ <?php
510
+ } // if(!$scheduler)
511
+ } else {
512
+ if(!$scheduler) {
513
+ ?>
514
+ <div class="odb-not-found">
515
+ <?php _e('No OEMED CHACHE found to delete', $odb_class->odb_txt_domain);?>
516
+ </div>
517
+ <?php
518
+ } // if(!$scheduler)
519
+ } // if(count($results)>0)
520
+
521
+ // NUMBER OF DELETED PINGBACKS FOR LOG FILE
522
+ $odb_class->log_arr["oembeds"] = $total_deleted;
523
+ } // if($odb_class->odb_rvg_options['clear_oembed'] == 'Y')
524
+
525
+
526
+ /****************************************************************************************
527
+ * DELETE ORPHANS
528
+ ****************************************************************************************/
529
+ if($odb_class->odb_rvg_options['clear_orphans'] == 'Y') {
530
+ $results = $this->odb_get_orphans($results, $scheduler,$analyzing);
531
+
532
+ $total_deleted = count($results);
533
+
534
+ //$total_deleted = $this->odb_delete_orphans($analyzing);
535
+
536
+ if($total_deleted > 0) {
537
+ if (!$scheduler) {
538
+ if ($analyzing) {
539
+ $msg1 = __('POSTMETA ORPHANS', $odb_class->odb_txt_domain);
540
+ $msg2 = __('total number of orphans', $odb_class->odb_txt_domain);
541
+ } else {
542
+ $msg1 = __('DELETED POSTMETA ORPHANS', $odb_class->odb_txt_domain);
543
+ $msg2 = __('total number of orphans', $odb_class->odb_txt_domain);
544
+ }
545
+ ?>
546
+ <!-- <div class="odb-found-number">
547
+ <?php echo $msg1 ?>: <span class="odb-blue"><?php echo $total_deleted;?></span>
548
+ </div>-->
549
+ <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
550
+ <tr>
551
+ <td colspan="8"><div class="odb-found">
552
+ <?php echo $msg1 ?>
553
+ </div></td>
554
+ </tr>
555
+ <tr>
556
+ <th align="right" class="odb-border-bottom">#</th>
557
+ <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
558
+ <th align="left" class="odb-border-bottom"><?php _e('type', $odb_class->odb_txt_domain);?></th>
559
+ <th align="left" class="odb-border-bottom"><?php _e('id', $odb_class->odb_txt_domain);?></th>
560
+ <th align="left" class="odb-border-bottom"><?php _e('title', $odb_class->odb_txt_domain);?></th>
561
+ <th align="left" nowrap="nowrap" class="odb-border-bottom"><?php _e('modified', $odb_class->odb_txt_domain);?></th>
562
+ <th align="left" class="odb-border-bottom"><?php _e('meta key', $odb_class->odb_txt_domain);?></th>
563
+ <th align="left" class="odb-border-bottom"><?php _e('meta value', $odb_class->odb_txt_domain);?></th>
564
+ </tr>
565
+ <?php
566
+ } // if(!$scheduler)
567
+
568
+ // LOOP THROUGH THE TRASHED ITEMS AND DELETE THEM
569
+ $total_deleted = $this->odb_delete_orphans($results, $scheduler, $analyzing);
570
+
571
+ if(!$scheduler) {
572
+ ?>
573
+ <tr>
574
+ <td colspan="8" align="right" class="odb-border-top odb-bold"><?php echo $msg2 ?> <?php echo $total_deleted?></td>
575
+ </tr>
576
+ </table>
577
+
578
+ <?php
579
+ } // if (!$scheduler)
580
+ } else {
581
+ if (!$scheduler) {
582
+ ?>
583
+ <div class="odb-not-found">
584
+ <?php _e('No POSTMETA ORPHANS found to delete', $odb_class->odb_txt_domain);?>
585
+ </div>
586
+ <?php
587
+ } // if (!$scheduler)
588
+ } // if($total_deleted > 0)
589
+ // FOR LOG FILE
590
+ $odb_class->log_arr["orphans"] = $total_deleted;
591
+
592
+ if (!$scheduler) {
593
+ ?>
594
+ </div><!-- /odb-cleaner -->
595
+ <?php
596
+ } // if (!$scheduler)
597
+ } // if($odb_class->odb_rvg_options['clear_oembed'] == 'Y')
598
+ } // odb_run_cleaner()
599
+
600
+
601
+ /********************************************************************************************
602
+ * RUN OPTIMIZER
603
+ ********************************************************************************************/
604
+ function odb_run_optimizer($scheduler) {
605
+ global $odb_class;
606
+
607
+ if(!$scheduler) {
608
+ ?>
609
+ <div class="odb-optimizing-table" class="odb-padding-left">
610
+ <div class="odb-title-bar">
611
+ <h2><?php _e('Optimizing Database Tables', $odb_class->odb_txt_domain);?></h2>
612
+ </div>
613
+ <br>
614
+ <br>
615
+ <table border="0" cellspacing="8" cellpadding="2">
616
+ <tr>
617
+ <th class="odb-border-bottom" align="right">#</th>
618
+ <th class="odb-border-bottom" align="left"><?php _e('table name', $odb_class->odb_txt_domain);?></th>
619
+ <th class="odb-border-bottom" align="left"><?php _e('optimization result', $odb_class->odb_txt_domain);?></th>
620
+ <th class="odb-border-bottom" align="left"><?php _e('engine', $odb_class->odb_txt_domain);?></th>
621
+ <th class="odb-border-bottom" align="right"><?php _e('table rows', $odb_class->odb_txt_domain);?></th>
622
+ <th class="odb-border-bottom" align="right"><?php _e('table size', $odb_class->odb_txt_domain);?></th>
623
+ </tr>
624
+ <?php
625
+ } // if(!$scheduler)
626
+
627
+ # OPTIMIZE THE DATABASE TABLES
628
+ $this->nr_of_optimized_tables = $this->odb_optimize_tables($scheduler);
629
+
630
+ if(!$scheduler) {
631
+ ?>
632
+ </table>
633
+ </div><!-- /odb-optimizing-table -->
634
+ <?php
635
+ } // if(!$scheduler)
636
+ } // odb_run_optimizer()
637
+
638
+
639
+ /********************************************************************************************
640
+ * CALCULATE AND DISPLAY SAVINGS
641
+ ********************************************************************************************/
642
+ function odb_savings($scheduler) {
643
+ global $odb_class;
644
+ global $odb_logger_obj;
645
+
646
+ // NUMBER OF TABLES
647
+ $odb_class->log_arr["tables"] = $this->nr_of_optimized_tables;
648
+ // DATABASE SIZE BEFORE OPTIMIZATION
649
+ $odb_class->log_arr["before"] = $odb_class->odb_utilities_obj->odb_format_size($this->start_size,3);
650
+ // DATABASE SIZE AFTER OPTIMIZATION
651
+ $end_size = $odb_class->odb_utilities_obj->odb_get_db_size();
652
+ $odb_class->log_arr["after"] = $odb_class->odb_utilities_obj->odb_format_size($end_size,3);
653
+ // TOTAL SAVING
654
+ $odb_class->log_arr["savings"] = $odb_class->odb_utilities_obj->odb_format_size(($this->start_size - $end_size),3);
655
+
656
+ // WRITE RESULTS TO LOG FILE - v4.6
657
+ $odb_class->odb_logger_obj->odb_add_log($odb_class->log_arr);
658
+
659
+ $total_savings = $odb_class->odb_rvg_options['total_savings'];
660
+ $total_savings += ($this->start_size - $end_size);
661
+ $odb_class->odb_rvg_options['total_savings'] = $total_savings;
662
+
663
+ $odb_class->odb_multisite_obj->odb_ms_update_option('odb_rvg_options', $odb_class->odb_rvg_options);
664
+
665
+ if(!$scheduler) {
666
+ ?>
667
+ <div id="odb-savings" class="odb-padding-left">
668
+ <div class="odb-title-bar">
669
+ <h2><?php _e('Savings', $odb_class->odb_txt_domain);?></h2>
670
+ </div>
671
+ <br>
672
+ <br>
673
+ <table border="0" cellspacing="8" cellpadding="2">
674
+ <tr>
675
+ <th>&nbsp;</th>
676
+ <th class="odb-border-bottom"><?php _e('size of the database', $odb_class->odb_txt_domain);?></th>
677
+ </tr>
678
+ <tr>
679
+ <td align="right"><?php _e('BEFORE optimization', $odb_class->odb_txt_domain);?></td>
680
+ <td align="right" class="odb-bold"><?php echo $odb_class->odb_utilities_obj->odb_format_size($this->start_size,3); ?></td>
681
+ </tr>
682
+ <tr>
683
+ <td align="right"><?php _e('AFTER optimization', $odb_class->odb_txt_domain);?></td>
684
+ <td align="right" class="odb-bold"><?php echo $odb_class->odb_utilities_obj->odb_format_size($end_size,3); ?></td>
685
+ </tr>
686
+ <tr>
687
+ <td align="right" class="odb-bold"><?php _e('SAVINGS THIS TIME', $odb_class->odb_txt_domain);?></td>
688
+ <td align="right" class="odb-border-top odb-bold"><?php echo $odb_class->odb_utilities_obj->odb_format_size(($this->start_size - $end_size),3); ?></td>
689
+ </tr>
690
+ <tr>
691
+ <td align="right" class="odb-bold"><?php _e('TOTAL SAVINGS SINCE THE FIRST RUN', $odb_class->odb_txt_domain);?></td>
692
+ <td align="right" class="odb-border-top odb-bold"><?php echo $odb_class->odb_utilities_obj->odb_format_size($total_savings,3); ?></td>
693
+ </tr>
694
+ </table>
695
+ </div><!-- /odb-savings -->
696
+ <?php
697
+ } // if(!$scheduler)
698
+ } // odb_savings()
699
+
700
+
701
+ /********************************************************************************************
702
+ * SHOW LOADING TIME
703
+ ********************************************************************************************/
704
+ function odb_done($analyze = false) {
705
+ global $odb_class;
706
+
707
+ $time = microtime();
708
+ $time = explode(' ', $time);
709
+ $time = $time[1] + $time[0];
710
+ $finish = $time;
711
+
712
+ $total_time = round(($finish - $odb_class->odb_start_time), 4);
713
+ ?>
714
+ <div id="odb-done" class="odb-padding-left">
715
+ <div class="odb-title-bar">
716
+ <h2>
717
+ <?php _e('DONE!', $odb_class->odb_txt_domain);?>
718
+ </h2>
719
+ </div>
720
+ <br>
721
+ <br>
722
+ <?php
723
+ if (!$analyze) {
724
+ ?>
725
+ <span class="odb-padding-left"><?php _e('Optimization took', $odb_class->odb_txt_domain)?>&nbsp;<strong><?php echo $total_time;?></strong>&nbsp;<?php _e('seconds', $odb_class->odb_txt_domain)?>.</span>
726
+ <?php
727
+ } // if ($analyze)
728
+ ?>
729
+ <?php
730
+ // v4.5.1
731
+ $odb_class->odb_last_run_seconds = $total_time;
732
+
733
+ if($odb_class->odb_logger_obj->odb_log_count() > 0) {
734
+ ?>
735
+ <script>
736
+ function odb_confirm_delete() {
737
+ <?php
738
+ // v4.6.2
739
+ $msg = str_replace("'", "\'", __('Clear the log?', $odb_class->odb_txt_domain));
740
+ ?>
741
+ if(confirm('<?php echo $msg?>')) {
742
+ self.location = 'tools.php?page=rvg-optimize-database&action=clear_log'
743
+ return;
744
+ }
745
+ } // odb_confirm_delete()
746
+ </script>
747
+ <br><br>
748
+ &nbsp;
749
+ <input class="button odb-normal" type="button" name="view_log" value="<?php _e('View Log', $odb_class->odb_txt_domain);?>" onclick="self.location='tools.php?page=rvg-optimize-database&action=view_log'" />
750
+ &nbsp;
751
+ <input class="button odb-normal" type="button" name="clear_log" value="<?php _e('Clear Log', $odb_class->odb_txt_domain);?>" onclick="return odb_confirm_delete();" />
752
+ <?php
753
+ } // if($odb_class->odb_logger_obj->odb_log_count() > 0)
754
+ ?>
755
+ </div><!-- /odb-done -->
756
+ <?php
757
+ } // odb_done()
758
+
759
+
760
+ /********************************************************************************************
761
+ * GET REVISIONS (OLDER THAN x DAYS)
762
+ ********************************************************************************************/
763
+ function odb_get_revisions_older_than() {
764
+ global $odb_class, $wpdb;
765
+
766
+ $res_arr = array();
767
+
768
+ // CUSTOM POST TYPES (from v4.4)
769
+ $rel_posttypes = $odb_class->odb_rvg_options['post_types'];
770
+ $in = '';
771
+ foreach ($rel_posttypes as $posttype => $value) {
772
+ if ($value == 'Y') {
773
+ if ($in != '') $in .= ',';
774
+ $in .= "'" . $posttype . "'";
775
+ } // if ($value == 'Y')
776
+ } // foreach($rel_posttypes as $posttypes)
777
+
778
+ $where = '';
779
+ if($in != '') {
780
+ $where = " AND p2.`post_type` IN ($in)";
781
+ } else {
782
+ // NO POST TYPES TO DELETE REVISIONS FOR... SKIP!
783
+ return $res_arr;
784
+ } // if($in != '')
785
+
786
+ $older_than = $odb_class->odb_rvg_options['older_than'];
787
+
788
+ $index = 0;
789
+
790
+ // LOOP THROUGH THE SITES (IF MULTI SITE)
791
+ for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
792
+ $prefix = $odb_class->odb_ms_prefixes[$i];
793
+
794
+ $sql = sprintf("
795
+ SELECT '%s' AS site,
796
+ p1.`ID`,
797
+ p1.`post_parent`,
798
+ p1.`post_title`,
799
+ p1.`post_modified`
800
+ FROM %sposts p1, %sposts p2
801
+ WHERE p1.`post_type` = 'revision'
802
+ AND p1.`post_parent` = p2.ID
803
+ %s
804
+ AND p1.`post_modified` < date_sub(now(), INTERVAL %d DAY)
805
+ ORDER BY UCASE(p1.`post_title`)
806
+ ",
807
+ $prefix,
808
+ $prefix,
809
+ $prefix,
810
+ $where,
811
+ $older_than);
812
+
813
+ //echo 'OLDER: '.$sql.'<br>';
814
+
815
+ $res = $wpdb->get_results($sql, ARRAY_A);
816
+
817
+ for($j=0; $j<count($res); $j++) {
818
+ if(isset($res[$j]) && !$this->odb_post_is_excluded($res[$j]['post_parent'])) {
819
+ $res_arr[$index] = $res[$j];
820
+ $index++;
821
+ } // if(isset($res[$j]) && !$this->odb_post_is_excluded($res[$j]['post_parent']))
822
+ } // for($j=0; $j<count($res); $j++)
823
+
824
+ } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
825
+
826
+ return $res_arr;
827
+ } // odb_get_revisions_older_than()
828
+
829
+
830
+ /********************************************************************************************
831
+ * GET REVISIONS (KEEP MAX NUMBER OF REVISIONS)
832
+ ********************************************************************************************/
833
+ function odb_get_revisions_keep_revisions() {
834
+ global $odb_class, $wpdb;
835
+
836
+ $res_arr = array();
837
+
838
+ // CUSTOM POST TYPES (from v4.4)
839
+ $rel_posttypes = $odb_class->odb_rvg_options['post_types'];
840
+ $in = '';
841
+ foreach ($rel_posttypes as $posttype => $value) {
842
+ if ($value == 'Y') {
843
+ if ($in != '') $in .= ',';
844
+ $in .= "'" . $posttype . "'";
845
+ } // if ($value == 'Y')
846
+ } // foreach($rel_posttypes as $posttypes)
847
+
848
+ $where1 = '';
849
+ if($in != '') {
850
+ $where1 = " AND p2.`post_type` IN ($in)";
851
+ } else {
852
+ // NO POST TYPES TO DELETE REVISIONS FOR... SKIP!
853
+ return $res_arr;
854
+ } // if($in != '')
855
+
856
+ // MAX NUMBER OF REVISIONS TO KEEP
857
+ $max_revisions = $odb_class->odb_rvg_options['nr_of_revisions'];
858
+
859
+ $index = 0;
860
+
861
+ // SKIP REVISIONS THAT WILL BE DELETED BY THE 'OLDER THAN' OPTION
862
+ $where2 = '';
863
+ if($odb_class->odb_rvg_options['delete_older'] == 'Y') {
864
+ $older_than = $odb_class->odb_rvg_options['older_than'];
865
+ $where2 = 'AND p1.`post_modified` >= date_sub(now(), INTERVAL '.$older_than.' DAY)';
866
+ }
867
+
868
+ for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
869
+ $prefix = $odb_class->odb_ms_prefixes[$i];
870
+
871
+ $sql = sprintf ("
872
+ SELECT '%s' AS site,
873
+ p1.`ID`, p1.`post_parent`, p1.`post_title`, COUNT(*) cnt
874
+ FROM %sposts p1, %sposts p2
875
+ WHERE p1.`post_type` = 'revision'
876
+ AND p1.`post_parent` = p2.ID
877
+ %s
878
+ %s
879
+ GROUP BY p1.`post_parent`
880
+ HAVING COUNT(*) > %d
881
+ ORDER BY UCASE(p1.`post_title`)
882
+ ",
883
+ $prefix,
884
+ $prefix,
885
+ $prefix,
886
+ $where1,
887
+ $where2,
888
+ $max_revisions);
889
+
890
+ //echo 'KEEP: '.$sql.'<br>';
891
+
892
+ $res = $wpdb->get_results($sql, ARRAY_A);
893
+ for($j=0; $j<count($res); $j++) {
894
+ if(isset($res[$j]) && !$this->odb_post_is_excluded($res[$j]['post_parent'])) {
895
+ $res_arr[$index] = $res[$j];
896
+ $index++;
897
+ }
898
+ } // for($j=0; $j<count($res); $j++)
899
+ } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
900
+
901
+ return $res_arr;
902
+ } // odb_get_revisions_keep_revisions()
903
+
904
+
905
+ /********************************************************************************************
906
+ * DELETE THE REVISIONS
907
+ ********************************************************************************************/
908
+ function odb_delete_revisions($scheduler, $analyzing = false) {
909
+ global $odb_class, $wpdb;
910
+
911
+ $total_deleted = 0;
912
+ $nr = 1;
913
+
914
+ if($odb_class->odb_rvg_options['delete_older'] == 'Y') {
915
+ // DELETE REVISIONS OLDER THAN x DAYS
916
+ $results = $this->odb_get_revisions_older_than();
917
+ $older_than = $odb_class->odb_rvg_options['older_than'];
918
+ $total_deleted += count($results);
919
+
920
+ for($i=0; $i<count($results); $i++) {
921
+ if (!$scheduler) {
922
+ ?>
923
+ <tr>
924
+ <td align="right" valign="top"><?php echo $nr?>.</td>
925
+ <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
926
+ <td valign="top" class="odb-bold"><?php echo $results[$i]['post_title']?></td>
927
+ <td valign="top" class="odb-bold"><?php echo $results[$i]['post_modified']?></td><?php
928
+ } // if (!$scheduler)
929
+
930
+ if (!$analyzing) {
931
+ $sql_delete = sprintf ("
932
+ DELETE FROM %sposts
933
+ WHERE `ID` = %d
934
+ ", $results[$i]['site'], $results[$i]['ID']);
935
+
936
+ $wpdb->get_results($sql_delete);
937
+ } // if (!$analyzing)
938
+
939
+ $nr++;
940
+ if(!$scheduler) {
941
+ ?>
942
+ <td align="right" valign="top" class="odb-bold">1</td>
943
+ </tr>
944
+ <?php
945
+ } // if(!$scheduler)
946
+ } // for($i=0; $i<count($results); $i++)
947
+ } // if($odb_class->odb_rvg_options['delete_older'] == 'Y')
948
+
949
+ if($odb_class->odb_rvg_options['rvg_revisions'] == 'Y') {
950
+ // KEEP MAX NUMBER OF REVISIONS
951
+ $results = $this->odb_get_revisions_keep_revisions();
952
+ $max_revisions = $odb_class->odb_rvg_options['nr_of_revisions'];
953
+
954
+ for($i=0; $i<count($results); $i++) {
955
+ $nr_to_delete = $results[$i]['cnt'] - $max_revisions;
956
+ $total_deleted += $nr_to_delete;
957
+
958
+ if (!$scheduler) {
959
+ ?>
960
+ <tr>
961
+ <td align="right" valign="top"><?php echo $nr?>.</td>
962
+ <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
963
+ <td valign="top" class="odb-bold"><?php echo $results[$i]['post_title']?></td>
964
+ <td valign="top"><?php
965
+ } // if (!$scheduler)
966
+
967
+ $sql_get_posts = sprintf( "
968
+ SELECT `ID`, `post_modified`
969
+ FROM %sposts
970
+ WHERE `post_parent` = %d
971
+ AND `post_type` = 'revision'
972
+ ORDER BY `post_modified` ASC
973
+ ", $results[$i]['site'], $results[$i]['post_parent']);
974
+
975
+ $results_get_posts = $wpdb->get_results($sql_get_posts);
976
+
977
+ for($j=0; $j<$nr_to_delete; $j++) {
978
+ if(!$scheduler) echo $results_get_posts[$j]->post_modified.'<br>';
979
+ if (!$analyzing) {
980
+ $sql_delete = sprintf ("
981
+ DELETE FROM %sposts
982
+ WHERE `ID` = %d
983
+ ", $results[$i]['site'], $results_get_posts[$j]->ID);
984
+
985
+ $wpdb->get_results($sql_delete);
986
+ } // if (!$analyzing)
987
+ } // for($j=0; $j<$nr_to_delete; $j++)
988
+
989
+ $nr++;
990
+ if(!$scheduler) {
991
+ ?></td>
992
+ <td align="right" valign="top" class="odb-bold"><?php echo $nr_to_delete?> <?php _e('of', $odb_class->odb_txt_domain)?> <?php echo $results[$i]['cnt'];?></td>
993
+ </tr>
994
+ <?php
995
+ } // if(!$scheduler)
996
+ } // for($i=0; $i<count($results); $i++)
997
+ } // if($odb_class->odb_rvg_options['rvg_revisions'] == 'Y')
998
+
999
+ return $total_deleted;
1000
+ } // function odb_delete_revisions()
1001
+
1002
+
1003
+ /********************************************************************************************
1004
+ * CHECK IF POST IS EXCLUDED BY A CUSTOM FIELD ('keep_revisions')
1005
+ ********************************************************************************************/
1006
+ function odb_post_is_excluded($parent_id) {
1007
+ $keep_revisions = get_post_meta($parent_id, 'keep_revisions', true);
1008
+ return ($keep_revisions === 'Y');
1009
+ } // odb_post_is_exclude()
1010
+
1011
+
1012
+ /********************************************************************************************
1013
+ * GET TRASHED POSTS / PAGES AND COMMENTS
1014
+ ********************************************************************************************/
1015
+ function odb_get_trash($analyzing = false) {
1016
+ global $wpdb, $odb_class;
1017
+
1018
+ $res_arr = array();
1019
+
1020
+ $index = 0;
1021
+ // LOOP TROUGH SITES
1022
+ for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1023
+ $prefix = $odb_class->odb_ms_prefixes[$i];
1024
+
1025
+ $sql = sprintf ("
1026
+ SELECT '%s' AS site,
1027
+ `ID` AS id,
1028
+ 'post' AS post_type,
1029
+ `post_title` AS title,
1030
+ `post_modified` AS modified
1031
+ FROM %sposts
1032
+ WHERE `post_status` = 'trash'
1033
+ UNION ALL
1034
+ SELECT '%s' AS site,
1035
+ `comment_ID` AS id,
1036
+ 'comment' AS post_type,
1037
+ `comment_author_IP` AS title,
1038
+ `comment_date` AS modified
1039
+ FROM %scomments
1040
+ WHERE `comment_approved` = 'trash'
1041
+ ORDER BY post_type, UCASE(title)
1042
+ ", $prefix, $prefix, $prefix, $prefix);
1043
+
1044
+ $res = $wpdb->get_results($sql, ARRAY_A);
1045
+
1046
+ if($res != null) {
1047
+ $res_arr[$index] = $res[0];
1048
+ $index++;
1049
+ } // if($res != null)
1050
+ } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1051
+
1052
+ return $res_arr;
1053
+ } // odb_get_trash()
1054
+
1055
+
1056
+ /********************************************************************************************
1057
+ * DELETE TRASHED POSTS AND PAGES
1058
+ ********************************************************************************************/
1059
+ function odb_delete_trash($results, $scheduler, $analyzing) {
1060
+ global $wpdb;
1061
+
1062
+ $nr = 1;
1063
+ $total_deleted = count($results);
1064
+
1065
+ for($i=0; $i<$total_deleted; $i++) {
1066
+ if(!$scheduler) {
1067
+ ?>
1068
+ <tr>
1069
+ <td align="right" valign="top"><?php echo $nr; ?></td>
1070
+ <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
1071
+ <td valign="top"><?php echo $results[$i]['post_type']; ?></td>
1072
+ <td valign="top"><?php echo $results[$i]['title']; ?></td>
1073
+ <td valign="top" nowrap="nowrap"><?php echo $results[$i]['modified']; ?></td>
1074
+ </tr>
1075
+ <?php
1076
+ } // if(!$scheduler)
1077
+
1078
+ if($results[$i]['post_type'] == 'comment') {
1079
+ // DELETE META DATA (IF ANY...)
1080
+ if (!$analyzing) {
1081
+ $sql_delete = sprintf ("
1082
+ DELETE FROM %scommentmeta
1083
+ WHERE `comment_id` = %d
1084
+ ", $results[$i]['site'], $results[$i]['id']);
1085
+ $wpdb->get_results($sql_delete);
1086
+ } // if (!$analyzing)
1087
+ } // if($results[$i]['post_type'] == 'comment')
1088
+
1089
+ if (!$analyzing) {
1090
+ // DELETE TRASHED POSTS / PAGES
1091
+ $sql_delete = sprintf ("
1092
+ DELETE FROM %sposts
1093
+ WHERE `post_status` = 'trash'
1094
+ ", $results[$i]['site']);
1095
+ $wpdb->get_results($sql_delete);
1096
+
1097
+ // DELETE TRASHED COMMENTS
1098
+ $sql_delete = sprintf ("
1099
+ DELETE FROM %scomments
1100
+ WHERE `comment_approved` = 'trash'
1101
+ ", $results[$i]['site']);
1102
+ $wpdb->get_results($sql_delete);
1103
+ } // if (!$analyzing)
1104
+
1105
+ $nr++;
1106
+ } // for($i=0; $i<count($results); $i++)
1107
+
1108
+ return $total_deleted;
1109
+ } // odb_delete_trash()
1110
+
1111
+
1112
+ /********************************************************************************************
1113
+ * GET SPAMMED COMMENTS
1114
+ ********************************************************************************************/
1115
+ function odb_get_spam($analyzing = false) {
1116
+ global $wpdb, $odb_class;
1117
+
1118
+ $res_arr = array();
1119
+
1120
+ // LOOP THROUGH SITES
1121
+ for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1122
+ $prefix = $odb_class->odb_ms_prefixes[$i];
1123
+
1124
+ $sql = sprintf ("
1125
+ SELECT '%s' AS site,
1126
+ `comment_ID`,
1127
+ `comment_author`,
1128
+ `comment_author_email`,
1129
+ `comment_date`
1130
+ FROM %scomments
1131
+ WHERE `comment_approved` = 'spam'
1132
+ ORDER BY UCASE(`comment_author`)
1133
+ ", $prefix, $prefix);
1134
+
1135
+ $res = $wpdb->get_results($sql, ARRAY_A);
1136
+
1137
+ for($j = 0; $j < count($res); $j++) {
1138
+ array_push($res_arr, $res[$j]);
1139
+ } // for($j = 0; $j < count($res); $j++)
1140
+ } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1141
+ return $res_arr;
1142
+ } // odb_get_spam()
1143
+
1144
+
1145
+ /********************************************************************************************
1146
+ * DELETE SPAMMED ITEMS
1147
+ ********************************************************************************************/
1148
+ function odb_delete_spam($results, $scheduler, $analyzing = false) {
1149
+ global $wpdb;
1150
+
1151
+ $nr = 1;
1152
+ $total_deleted = count($results);
1153
+ for($i=0; $i<count($results); $i++) {
1154
+ if (!$scheduler) {
1155
+ ?>
1156
+ <tr>
1157
+ <td align="right" valign="top"><?php echo $nr; ?></td>
1158
+ <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
1159
+ <td valign="top"><?php echo $results[$i]['comment_author']; ?></td>
1160
+ <td valign="top"><?php echo $results[$i]['comment_author_email']; ?></td>
1161
+ <td valign="top" nowrap="nowrap"><?php echo $results[$i]['comment_date']; ?></td>
1162
+ </tr>
1163
+ <?php
1164
+ } // if (!$scheduler)
1165
+
1166
+ if (!$analyzing) {
1167
+ $sql_delete = sprintf ("
1168
+ DELETE FROM %scommentmeta
1169
+ WHERE `comment_id` = %d
1170
+ ", $results[$i]['site'], $results[$i]['comment_ID']);
1171
+ $wpdb->get_results($sql_delete);
1172
+
1173
+ $sql_delete = sprintf ("
1174
+ DELETE FROM %scomments
1175
+ WHERE `comment_approved` = 'spam'
1176
+ ", $results[$i]['site']);
1177
+ $wpdb->get_results($sql_delete);
1178
+ } // if (!$analyzing)
1179
+
1180
+ $nr++;
1181
+ } // for($i=0; $i<count($results); $i++)
1182
+
1183
+ return $total_deleted;
1184
+ } // odb_delete_spam()
1185
+
1186
+
1187
+ /********************************************************************************************
1188
+ * GET UNUSED TAGS
1189
+ ********************************************************************************************/
1190
+ function odb_get_unused_tags($analyzing = false) {
1191
+ global $wpdb, $odb_class;
1192
+
1193
+ $res_arr = array();
1194
+
1195
+ // LOOP THROUGH SITES
1196
+ for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1197
+ $prefix = $odb_class->odb_ms_prefixes[$i];
1198
+
1199
+ $sql = sprintf ("
1200
+ SELECT '%s' AS site,
1201
+ a.term_id AS term_id, a.name AS name
1202
+ FROM `%sterms` a, `%sterm_taxonomy` b
1203
+ WHERE a.term_id = b.term_id
1204
+ AND b.taxonomy = 'post_tag'
1205
+ AND b.term_taxonomy_id NOT IN (
1206
+ SELECT term_taxonomy_id
1207
+ FROM %sterm_relationships
1208
+ )
1209
+ ORDER BY name
1210
+ ", $prefix, $prefix, $prefix, $prefix);
1211
+
1212
+ $res = $wpdb->get_results($sql, ARRAY_A);
1213
+
1214
+ for($j = 0; $j < count($res); $j++) {
1215
+ array_push($res_arr, $res[$j]);
1216
+ } // for($j = 0; $j < count($res); $j++)
1217
+ } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1218
+ return $res_arr;
1219
+ } // odb_get_unused_tags
1220
+
1221
+
1222
+ /********************************************************************************************
1223
+ * DELETE UNUSED TAGS
1224
+ ********************************************************************************************/
1225
+ function odb_delete_unused_tags($results, $scheduler, $analyzing = false) {
1226
+ global $wpdb, $odb_class;
1227
+
1228
+ $nr = 1;
1229
+ $total_deleted = count($results);
1230
+ for($i=0; $i<count($results); $i++) {
1231
+ if (!$scheduler) {
1232
+ ?>
1233
+ <tr>
1234
+ <td align="right" valign="top"><?php echo $nr; ?></td>
1235
+ <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
1236
+ <td valign="top"><?php echo $results[$i]['name']; ?></td>
1237
+ </tr>
1238
+ <?php
1239
+ } // if (!$scheduler)
1240
+
1241
+ if (!$analyzing) {
1242
+ $sql_del = sprintf ("
1243
+ DELETE FROM %sterm_taxonomy
1244
+ WHERE term_id = %d
1245
+ ", $results[$i]['site'], $results[$i]['term_id']);
1246
+ $wpdb->get_results($sql_del);
1247
+
1248
+ $sql_del = sprintf ("
1249
+ DELETE FROM %sterms
1250
+ WHERE term_id = %d
1251
+ ", $results[$i]['site'], $results[$i]['term_id']);
1252
+ $wpdb->get_results($sql_del);
1253
+ } // if (!$analyzing)
1254
+
1255
+ $nr++;
1256
+ } // for($i=0; $i<count($results); $i++)
1257
+
1258
+ return $total_deleted;
1259
+ } // odb_delete_unused_tags()
1260
+
1261
+
1262
+ /********************************************************************************************
1263
+ * IS THE UNUSED TAG USED IN ONE OR MORE SCHEDULED POSTS?
1264
+ ********************************************************************************************/
1265
+ function odb_delete_tags_is_scheduled($term_id, $odb_prefix) {
1266
+ global $wpdb;
1267
+
1268
+ $sql_get_posts = sprintf ("
1269
+ SELECT p.post_status
1270
+ FROM %sterm_relationships t, %sposts p
1271
+ WHERE t.term_taxonomy_id = '%s'
1272
+ AND t.object_id = p.ID
1273
+ ", $odb_prefix, $odb_prefix, $term_id);
1274
+
1275
+ $results_get_posts = $wpdb->get_results($sql_get_posts);
1276
+ for($i=0; $i<count($results_get_posts); $i++)
1277
+ if($results_get_posts[$i]->post_status == 'future') return true;
1278
+
1279
+ return false;
1280
+ } // odb_delete_tags_is_scheduled()
1281
+
1282
+ /********************************************************************************************
1283
+ * DELETE TRANSIENTS (v4.7.3)
1284
+ ********************************************************************************************/
1285
+ function odb_delete_transients($scheduler, $analyzing = false) {
1286
+ global $wpdb, $odb_class;
1287
+
1288
+ $total_deleted = 0;
1289
+ $nr = 1;
1290
+
1291
+ if ($odb_class->odb_rvg_options['clear_transients'] !== 'Y' && $odb_class->odb_rvg_options['clear_transients'] !== 'A') {
1292
+ // DISABLED
1293
+ return $total_deleted;
1294
+ }
1295
+
1296
+ // ONE MINUTE DELAY
1297
+ $delay = time() - 60;
1298
+
1299
+ // LOOP THROUGH SITES
1300
+ for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1301
+ $prefix = $odb_class->odb_ms_prefixes[$i];
1302
+
1303
+ if ($odb_class->odb_rvg_options['clear_transients'] == 'Y') {
1304
+ // EXPIRED TRANSIENTS ONLY
1305
+ $sql = "
1306
+ SELECT '" . $prefix . "' AS site,
1307
+ `option_name`
1308
+ FROM " . $prefix . "options
1309
+ WHERE (
1310
+ option_name LIKE '_transient_timeout_%'
1311
+ OR option_name LIKE '_site_transient_timeout_%'
1312
+ )
1313
+ AND option_value < '" . $delay . "'" . "
1314
+ ORDER BY `option_name`
1315
+ ";
1316
+
1317
+ // DELETE EXPIRED TRANSINTS FOR THIS (MULTI-) SITE
1318
+ $sqldel = "
1319
+ DELETE FROM " . $prefix . "options
1320
+ WHERE (
1321
+ option_name LIKE '_transient_timeout_%'
1322
+ OR option_name LIKE '_site_transient_timeout_%'
1323
+ )
1324
+ AND option_value < '" . $delay . "'" . "
1325
+ ";
1326
+ } else if ($odb_class->odb_rvg_options['clear_transients'] == 'A') {
1327
+ // ALL TRANSIENTS
1328
+ $sql = "
1329
+ SELECT '" . $prefix . "' AS site,
1330
+ `option_name`
1331
+ FROM " . $prefix . "options
1332
+ WHERE (
1333
+ option_name LIKE '_transient_timeout_%'
1334
+ OR option_name LIKE '_site_transient_timeout_%'
1335
+ )
1336
+ ORDER BY `option_name`
1337
+ ";
1338
+
1339
+ // DELETE TRANSINTS FOR THIS (MULTI-) SITE
1340
+ $sqldel = "
1341
+ DELETE FROM " . $prefix . "options
1342
+ WHERE (
1343
+ option_name LIKE '_transient_timeout_%'
1344
+ OR option_name LIKE '_site_transient_timeout_%'
1345
+ )
1346
+ ";
1347
+ } // if ($odb_class->odb_rvg_options['clear_transients'] == 'Y')
1348
+
1349
+ $res = $wpdb->get_results($sql, ARRAY_A);
1350
+ // ACTUALLY DELETE THE TRANSIENTS
1351
+ if (!$analyzing) $resdel = $wpdb->get_results($sqldel, ARRAY_A);
1352
+ } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1353
+
1354
+ return $res;
1355
+ } // odb_delete_transients()
1356
+
1357
+ /********************************************************************************************
1358
+ * GET PINGBACKS AND TRACKBACKS
1359
+ ********************************************************************************************/
1360
+ function odb_get_pingbacks($analyzing = false) {
1361
+
1362
+ global $wpdb, $odb_class;
1363
+
1364
+ $res_arr = array();
1365
+
1366
+ // LOOP THROUGH SITES
1367
+ for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1368
+ $prefix = $odb_class->odb_ms_prefixes[$i];;
1369
+
1370
+ $sql = sprintf ("
1371
+ SELECT '%s' AS site,
1372
+ `comment_ID`,
1373
+ `comment_type`,
1374
+ `comment_author`,
1375
+ `comment_date`
1376
+ FROM %scomments
1377
+ WHERE (
1378
+ `comment_type` = 'pingback' OR `comment_type` = 'trackback'
1379
+ )
1380
+ ORDER BY `comment_type`, `comment_author`
1381
+ ", $prefix, $prefix);
1382
+
1383
+ $res = $wpdb->get_results($sql, ARRAY_A);
1384
+
1385
+ for($j = 0; $j < count($res); $j++) {
1386
+ array_push($res_arr, $res[$j]);
1387
+ } // for($j = 0; $j < count($res); $j++)
1388
+ } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1389
+ return $res_arr;
1390
+ } // odb_get_pingbacks
1391
+
1392
+
1393
+ /********************************************************************************************
1394
+ * DELETE PINGBACKS AND TRACKBACKS
1395
+ ********************************************************************************************/
1396
+ function odb_delete_pingbacks($results, $scheduler, $analyzing) {
1397
+ global $wpdb, $odb_class;
1398
+
1399
+ $nr = 1;
1400
+ $total_deleted = count($results);
1401
+ for($i=0; $i<count($results); $i++) {
1402
+ if (!$scheduler) {
1403
+ ?>
1404
+ <tr>
1405
+ <td align="right" valign="top"><?php echo $nr; ?></td>
1406
+ <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
1407
+ <td valign="top"><?php echo $results[$i]['comment_type']?></td>
1408
+ <td valign="top"><?php echo $results[$i]['comment_author']?></td>
1409
+ <td valign="top" nowrap="nowrap"><?php echo $results[$i]['comment_date']; ?></td>
1410
+ </tr>
1411
+ <?php
1412
+ } // if (!$scheduler)
1413
+
1414
+ if (!$analyzing) {
1415
+ for($j=0; $j<count($results); $j++) {
1416
+ // DELETE METADATA FOR THIS COMMENT (IF ANY)
1417
+ $sql = sprintf ("
1418
+ DELETE FROM %scommentmeta
1419
+ WHERE `comment_id` = %d
1420
+ ", $results[$j]['site'], $results[$j]['comment_ID']);
1421
+ $wpdb->get_results($sql);
1422
+
1423
+ $sql = sprintf ("
1424
+ DELETE FROM %scomments
1425
+ WHERE (
1426
+ `comment_type` = 'pingback'
1427
+ OR `comment_type` = 'trackback'
1428
+ )
1429
+ ", $results[$j]['site']);
1430
+ $wpdb->get_results($sql);
1431
+ } // for($j=0; $j<count($results); $j++)
1432
+ } // if (!$analyzing)
1433
+
1434
+ $nr++;
1435
+ } // for($i=0; $i<count($results); $i++)
1436
+
1437
+ return $total_deleted;
1438
+ } // odb_delete_pingbacks()
1439
+
1440
+
1441
+ /********************************************************************************************
1442
+ * GET OEMBED CACHE
1443
+ ********************************************************************************************/
1444
+ function odb_get_oembed($analyzing = false) {
1445
+ global $wpdb, $odb_class;
1446
+
1447
+ $res_arr = array();
1448
+
1449
+ // LOOP THROUGH SITES
1450
+ for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1451
+ $prefix = $odb_class->odb_ms_prefixes[$i];
1452
+
1453
+ $sql = sprintf ("
1454
+ SELECT '%s' AS site,
1455
+ `meta_id`,
1456
+ `meta_key`,
1457
+ `meta_value`
1458
+ FROM %spostmeta
1459
+ WHERE `meta_key` LIKE '_oembed_%%'
1460
+ ORDER BY `meta_key`
1461
+ ", $prefix, $prefix);
1462
+
1463
+ $res = $wpdb->get_results($sql, ARRAY_A);
1464
+
1465
+ for($j = 0; $j < count($res); $j++) {
1466
+ array_push($res_arr, $res[$j]);
1467
+ } // for($j = 0; $j < count($res); $j++)
1468
+ } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1469
+ return $res_arr;
1470
+ } // odb_get_oembed()
1471
+
1472
+
1473
+ /********************************************************************************************
1474
+ * CLEAR OEMBED CACHE
1475
+ ********************************************************************************************/
1476
+ function odb_delete_oembed($results, $scheduler, $analyzing) {
1477
+ global $wpdb, $odb_class;
1478
+
1479
+ $nr = 1;
1480
+ $total_deleted = count($results);
1481
+ for($i=0; $i<count($results); $i++) {
1482
+ if (!$scheduler) {
1483
+ ?>
1484
+ <tr>
1485
+ <td align="right" valign="top"><?php echo $nr; ?></td>
1486
+ <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
1487
+ <td valign="top"><?php echo $results[$i]['meta_key']?></td>
1488
+ <td valign="top"><?php echo $results[$i]['meta_value']?></td>
1489
+ </tr>
1490
+ <?php
1491
+ } // if (!$scheduler)
1492
+
1493
+ if (!$analyzing) {
1494
+ // DELETE COMMENTS
1495
+ $sql = sprintf ("
1496
+ DELETE FROM %spostmeta
1497
+ WHERE `meta_key` LIKE '_oembed_%%'
1498
+ ", $results[$i]['site']);
1499
+
1500
+ $wpdb->get_results($sql);
1501
+ } // if (!$analyzing)
1502
+
1503
+ $nr++;
1504
+ } // for($i=0; $i<count($results); $i++)
1505
+
1506
+ return $total_deleted;
1507
+ } // odb_delete_oembed()
1508
+
1509
+
1510
+ /********************************************************************************************
1511
+ * GET ORPHAN POSTMETA AND MEDIA RECORDS
1512
+ ********************************************************************************************/
1513
+ function odb_get_orphans($results, $scheduler, $analyzing) {
1514
+ global $wpdb, $odb_class;
1515
+
1516
+ $res_arr = array();
1517
+
1518
+ // LOOP THROUGH SITES
1519
+ for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1520
+ $prefix = $odb_class->odb_ms_prefixes[$i];
1521
+
1522
+ $sql = sprintf ("
1523
+ SELECT '%s' AS site,
1524
+ `ID`,
1525
+ 'post' AS type,
1526
+ `post_title`,
1527
+ `post_modified`,
1528
+ '' AS meta_key,
1529
+ '' AS meta_value
1530
+ FROM %sposts
1531
+ WHERE ID NOT IN (SELECT post_id FROM %spostmeta)
1532
+ AND post_status = 'auto-draft'
1533
+ ORDER BY `ID`
1534
+ ", $prefix, $prefix, $prefix);
1535
+
1536
+ $results = $wpdb->get_results($sql, ARRAY_A);
1537
+ for ($j = 0; $j < count($results); $j++) {
1538
+ array_push($res_arr, $results[$j]);
1539
+ } // for ($j = 0; $j < count($results); $j++)
1540
+
1541
+ // DELETE POSTMETA ORPHANS
1542
+ $sql = sprintf ("
1543
+ SELECT '%s' AS site,
1544
+ `post_id` AS ID,
1545
+ 'meta' AS type,
1546
+ '' AS post_title,
1547
+ '' AS post_modified,`meta_key`, `meta_value`
1548
+ FROM %spostmeta
1549
+ WHERE post_id NOT IN (SELECT ID FROM %sposts)
1550
+ ORDER BY `meta_key`
1551
+ ", $prefix, $prefix, $prefix);
1552
+
1553
+ $results = $wpdb->get_results($sql, ARRAY_A);
1554
+ for ($j = 0; $j < count($results); $j++) {
1555
+ array_push($res_arr, $results[$j]);
1556
+ } // for ($j = 0; $j < count($results); $j++)
1557
+ } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1558
+ return $res_arr;
1559
+ } // odb_get_orphans()
1560
+
1561
+
1562
+ /********************************************************************************************
1563
+ * DELETE ORPHAN POSTMETA AND MEDIA RECORDS
1564
+ ********************************************************************************************/
1565
+ function odb_delete_orphans($results, $scheduler, $analyzing) {
1566
+
1567
+ global $wpdb, $odb_class;
1568
+
1569
+ $nr = 1;
1570
+ $total_deleted = count($results);
1571
+ for($i=0; $i<count($results); $i++) {
1572
+ if (!$scheduler) {
1573
+ ?>
1574
+ <tr>
1575
+ <td align="right" valign="top"><?php echo $nr; ?></td>
1576
+ <td align="left" valign="top"><?php echo $results[$i]['site']?></td>
1577
+ <td valign="top"><?php echo $results[$i]['type']?></td>
1578
+ <td valign="top"><?php echo $results[$i]['ID']?></td>
1579
+ <td valign="top"><?php echo $results[$i]['post_title']?></td>
1580
+ <td valign="top" nowrap="nowrap"><?php echo substr($results[$i]['post_modified'], 0, 10); ?></td>
1581
+ <td valign="top" nowrap="nowrap"><?php echo $results[$i]['meta_key']; ?></td>
1582
+ <td valign="top" nowrap="nowrap"><?php echo $results[$i]['meta_value']; ?></td>
1583
+ </tr>
1584
+ <?php
1585
+ } // if (!$scheduler)
1586
+
1587
+ if (!$analyzing) {
1588
+ for($j=0; $j<count($results); $j++) {
1589
+ // DELETE METADATA FOR THIS COMMENT (IF ANY)
1590
+ if ($results[$j]['type'] == 'meta') {
1591
+ $sql = sprintf ("
1592
+ DELETE FROM %spostmeta
1593
+ WHERE `post_id` = %d
1594
+ ", $results[$j]['site'], $results[$j]['ID']);
1595
+ } else if ($results[$j]['type'] == 'post') {
1596
+ $sql = sprintf ("
1597
+ DELETE FROM %sposts
1598
+ WHERE `ID` = %d
1599
+ ", $results[$j]['site'], $results[$j]['ID']);
1600
+ } // if ($results[$j]['type'] == 'meta')
1601
+ //echo 'SQL: ' . $sql.'<br>';
1602
+ $wpdb->get_results($sql);
1603
+ }// for($j=0; $j<count($results); $j++)
1604
+ } // if (!$analyzing)
1605
+ $nr++;
1606
+ } // for($i=0; $i<count($results); $i++)
1607
+
1608
+ return $total_deleted;
1609
+ } // odb_delete_orphans()
1610
+
1611
+
1612
+ /********************************************************************************************
1613
+ * OPTIMIZE DATABASE TABLES
1614
+ ********************************************************************************************/
1615
+ function odb_optimize_tables($scheduler) {
1616
+ global $odb_class, $wpdb;
1617
+
1618
+ $cnt = 0;
1619
+ for ($i=0; $i<count($odb_class->odb_tables); $i++) {
1620
+ if(!isset($odb_class->odb_rvg_excluded_tabs[$odb_class->odb_tables[$i][0]])) {
1621
+ # TABLE NOT EXCLUDED
1622
+ $cnt++;
1623
+
1624
+ $sql = sprintf ("
1625
+ SELECT engine, (data_length + index_length) AS size, table_rows
1626
+ FROM information_schema.TABLES
1627
+ WHERE table_schema = '%s'
1628
+ AND table_name = '%s'
1629
+ ", DB_NAME, $odb_class->odb_tables[$i][0]);
1630
+ $table_info = $wpdb->get_results($sql);
1631
+
1632
+ if($odb_class->odb_rvg_options["optimize_innodb"] == 'N' && strtolower($table_info[0]->engine) == 'innodb') {
1633
+ // SKIP InnoDB tables
1634
+ $msg = __('InnoDB table: skipped...', 'rvg-optimize-database');
1635
+ } else {
1636
+ // v4.6.3
1637
+ if (strtolower($table_info[0]->engine) == 'myisam') {
1638
+ $result = $this->odb_optimize_myisam($odb_class->odb_tables[$i][0]);
1639
+ $msg = $result[0]->Msg_text;
1640
+ if ($msg == 'OK') {
1641
+ $msg = __('<span class="odb-optimized">TABLE OPTIMIZED</span>', 'rvg-optimize-database');
1642
+ } else if ($msg == 'Table is already up to date') {
1643
+ $msg = __('Table is already up to date', 'rvg-optimize-database');
1644
+ }
1645
+ } else {
1646
+ $result = $this->odb_optimize_innodb($odb_class->odb_tables[$i][0]);
1647
+ $msg = $result[0]->Msg_text;
1648
+ if ($msg == 'Table is already up to date') {
1649
+ $msg = __('Table is already up to date', 'rvg-optimize-database');
1650
+ } else {
1651
+ $msg = __('<span class="odb-optimized">TABLE OPTIMIZED</span>', 'rvg-optimize-database');
1652
+ }
1653
+ } // if (strtolower($table_info[0]->engine) == 'myisam')
1654
+ } // if($odb_class->odb_rvg_options["optimize_innodb"] == 'N' && strtolower($table_info[0]->engine) == 'innodb')
1655
+
1656
+ if (!$scheduler)
1657
+ { // NOT FROM THE SCEDULER
1658
+ ?>
1659
+ <tr>
1660
+ <td align="right" valign="top"><?php echo $cnt?>.</td>
1661
+ <td valign="top" class="odb-bold"><?php echo $odb_class->odb_tables[$i][0] ?></td>
1662
+ <td valign="top"><?php echo $msg ?></td>
1663
+ <td valign="top"><?php echo $table_info[0]->engine ?></td>
1664
+ <td align="right" valign="top"><?php echo $table_info[0]->table_rows ?></td>
1665
+ <td align="right" valign="top"><?php echo $odb_class->odb_utilities_obj->odb_format_size($table_info[0]->size) ?></td>
1666
+ </tr>
1667
+ <?php
1668
+ } // if (!$scheduler)
1669
+ } // if(!$excluded)
1670
+ } // for ($i=0; $i<count($tables); $i++)
1671
+ return $cnt;
1672
+
1673
+ } // odb_optimize_tables()
1674
+
1675
+
1676
+ /********************************************************************************************
1677
+ * OPTIMIZE A MyISAM TABLE
1678
+ ********************************************************************************************/
1679
+ function odb_optimize_myisam($table_name) {
1680
+ global $wpdb;
1681
+ $query = "OPTIMIZE TABLE " . $table_name;
1682
+ return $wpdb->get_results($query);
1683
+ } // odb_optimize_myisam()
1684
+
1685
+
1686
+ /********************************************************************************************
1687
+ * OPTIMIZE AN InnoDB TABLE
1688
+ ********************************************************************************************/
1689
+ function odb_optimize_innodb($table_name) {
1690
+ global $wpdb;
1691
+
1692
+ $query = "OPTIMIZE TABLE " . $table_name;
1693
+ return $wpdb->get_results($query);
1694
+
1695
+ /* // https://www.percona.com/blog/2010/12/09/mysql-optimize-tables-innodb-stop/
1696
+ $query = "SHOW KEYS FROM " . $table_name . " WHERE Key_name <> 'PRIMARY'";
1697
+ $result = $wpdb->get_results($query);
1698
+ if (count($result) > 0) {
1699
+ for ($i = 0; $i < count($result); $i++) {
1700
+ $key_name = $result[$i]->Key_name;
1701
+
1702
+ $query = "ALTER TABLE " . $table_name . " DROP KEY " . $key_name;
1703
+ $result = $wpdb->get_results($query);
1704
+
1705
+ $query = "ALTER TABLE " . $table_name . " add key(" . $key_name . ")";
1706
+ $result = $wpdb->get_results($query);
1707
+ } // for ($i = 0; $i < count($result); $i++)
1708
+ return __('<span class="odb-optimized">TABLE OPTIMIZED</span>', 'rvg-optimize-database');
1709
+ } else {
1710
+ return __('Table is already up to date', 'rvg-optimize-database');
1711
+ } // if (count($result) > 0*/
1712
+ } // odb_optimize_innodb()
1713
+
1714
+ } // ODB_Cleaner
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1715
  ?>
language/rvg-optimize-database-de_DE.mo CHANGED
Binary file
language/rvg-optimize-database-de_DE.po CHANGED
@@ -2,9 +2,9 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Optimize Database after Deleting Revisions\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2015-11-20 17:03+0100\n"
6
- "PO-Revision-Date: 2015-11-20 17:03+0100\n"
7
- "Last-Translator: Rolf van Gelder <info@cagewebdev.com>\n"
8
  "Language-Team: \n"
9
  "Language: de\n"
10
  "MIME-Version: 1.0\n"
@@ -12,464 +12,774 @@ msgstr ""
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
  "X-Poedit-SourceCharset: UTF-8\n"
15
- "X-Poedit-Basepath: C:\\My Dropbox\\WordPress\\wp-plugins\\rvg-optimize-db\n"
16
  "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
17
  "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
18
  "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
19
  "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
20
  "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
21
  "X-Loco-Target-Locale: de_DE\n"
22
- "X-Generator: Poedit 1.7.4\n"
 
23
  "X-Poedit-SearchPath-0: .\n"
24
 
25
- #: classes/odb-cleaner.php:35
 
 
 
 
26
  msgid "Cleaning Database"
27
  msgstr "Datenbank bereiningen"
28
 
29
- #: classes/odb-cleaner.php:78
 
 
 
 
 
 
 
 
30
  msgid "DELETED REVISIONS"
31
  msgstr "GELÖSCHTE REVISIONEN"
32
 
33
- #: classes/odb-cleaner.php:83 classes/odb-cleaner.php:142
34
- #: classes/odb-cleaner.php:203
 
 
 
 
 
 
35
  msgid "prefix"
36
  msgstr "Präfix"
37
 
38
- #: classes/odb-cleaner.php:84
39
  msgid "post / page"
40
  msgstr "Beitrag / Seite"
41
 
42
- #: classes/odb-cleaner.php:85
43
  msgid "revision date"
44
  msgstr "Datum"
45
 
46
- #: classes/odb-cleaner.php:86
47
- msgid "revisions deleted"
48
- msgstr "Revisionen gelöscht"
49
 
50
- #: classes/odb-cleaner.php:98
51
  msgid "total number of revisions deleted"
52
  msgstr "insgesamt gelöschte Revisionen"
53
 
54
- #: classes/odb-cleaner.php:110
55
  msgid "No REVISIONS found to delete"
56
- msgstr "Keine Revisionen zum Löschen gefunden"
57
 
58
- #: classes/odb-cleaner.php:137
 
 
 
 
 
 
 
 
59
  msgid "DELETED TRASHED ITEMS"
60
  msgstr "Aus dem Papierkorb gelöscht"
61
 
62
- #: classes/odb-cleaner.php:143
 
 
 
 
 
63
  msgid "type"
64
  msgstr "Typ"
65
 
66
- #: classes/odb-cleaner.php:144
67
  msgid "IP address / title"
68
  msgstr "IP Adresse / Titel"
69
 
70
- #: classes/odb-cleaner.php:145
 
71
  msgid "date"
72
  msgstr "Datum"
73
 
74
- #: classes/odb-cleaner.php:157
75
- msgid "total number of trashed items deleted"
76
- msgstr "gesamt gelöscht"
77
-
78
- #: classes/odb-cleaner.php:170
79
  msgid "No TRASHED ITEMS found to delete"
80
- msgstr "Nichts zum Löschen im Papierkorb gefunden"
81
-
82
- #: classes/odb-cleaner.php:198
83
- msgid "DELETEED SPAMMED ITEMS"
84
- msgstr "Gelöschte Spambeiträge"
85
 
86
- #: classes/odb-cleaner.php:204
87
- msgid "comment author"
88
- msgstr "Autor"
89
 
90
- #: classes/odb-cleaner.php:205
91
- msgid "comment author email"
92
- msgstr "Email"
93
-
94
- #: classes/odb-cleaner.php:206
95
- msgid "comment date"
96
- msgstr "Datum"
97
 
98
  #: classes/odb-cleaner.php:218
 
 
 
 
99
  msgid "total number of spammed items deleted"
100
  msgstr "gesamt Spam gelöscht"
101
 
102
  #: classes/odb-cleaner.php:231
 
 
 
 
 
 
 
 
 
 
 
 
103
  msgid "No SPAMMED ITEMS found to delete"
104
- msgstr "kein Spam zum Löschen gefunden"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
- #: classes/odb-cleaner.php:256
107
- msgid "NUMBER OF UNUSED TAGS DELETED"
108
- msgstr "gelöschte unbenutzte Tags"
109
 
110
- #: classes/odb-cleaner.php:266
111
- msgid "No UNUSED TAGS found to delete"
112
- msgstr "keine unbenutzten Tags zum Löschen gefunden"
113
 
114
- #: classes/odb-cleaner.php:290
115
- msgid "NUMBER OF EXPIRED TRANSIENTS DELETED"
116
- msgstr "gelöschte abgelaufene Zwischenversionen"
117
 
118
- #: classes/odb-cleaner.php:300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  msgid "No EXPIRED TRANSIENTS found to delete"
120
- msgstr "keine abgelaufenen Zwischenversionen zum Löschen gefunden"
 
 
 
 
 
 
 
 
 
 
 
 
121
 
122
- #: classes/odb-cleaner.php:324
123
- msgid "NUMBER OF PINGBACKS AND TRACKBACKS DELETED"
124
- msgstr "gelöschte Pingbacks und Trackbacks"
125
 
126
- #: classes/odb-cleaner.php:334
 
 
 
 
 
 
 
 
127
  msgid "No PINGBACKS nor TRACKBACKS found to delete"
128
- msgstr "keine Pingbacks und Trackbacks zum Löschen gefunden"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
 
130
- #: classes/odb-cleaner.php:355
131
- msgid "NUMBER OF POSTMETA ORPHANS DELETED"
132
- msgstr "Anzahl gelöschter verwaister Einträge in postmeta"
133
 
134
- #: classes/odb-cleaner.php:365
135
  msgid "No POSTMETA ORPHANS found to delete"
136
- msgstr "keine verwaisten Einträge zum Löschen gefunden"
137
 
138
- #: classes/odb-cleaner.php:393
139
  msgid "Optimizing Database Tables"
140
- msgstr "Tabellen optimieren"
141
 
142
- #: classes/odb-cleaner.php:400
143
  msgid "table name"
144
  msgstr "Tabelle"
145
 
146
- #: classes/odb-cleaner.php:401
147
  msgid "optimization result"
148
  msgstr "Ergebnis"
149
 
150
- #: classes/odb-cleaner.php:402
151
  msgid "engine"
152
  msgstr "Typ"
153
 
154
- #: classes/odb-cleaner.php:403
155
  msgid "table rows"
156
  msgstr "Zeilen"
157
 
158
- #: classes/odb-cleaner.php:404
159
  msgid "table size"
160
  msgstr "Größe"
161
 
162
- #: classes/odb-cleaner.php:452
163
  msgid "Savings"
164
  msgstr "Einsparungen"
165
 
166
- #: classes/odb-cleaner.php:459
167
  msgid "size of the database"
168
  msgstr "Datenbank-Größe"
169
 
170
- #: classes/odb-cleaner.php:462
171
  msgid "BEFORE optimization"
172
  msgstr "VORHER"
173
 
174
- #: classes/odb-cleaner.php:466
175
  msgid "AFTER optimization"
176
  msgstr "NACHHER"
177
 
178
- #: classes/odb-cleaner.php:470
179
  msgid "SAVINGS THIS TIME"
180
  msgstr "Einsparungen bei diesem Lauf"
181
 
182
- #: classes/odb-cleaner.php:474
183
  msgid "TOTAL SAVINGS SINCE THE FIRST RUN"
184
  msgstr "Einsparungen insgesamt seit dem ersten Lauf"
185
 
186
- #: classes/odb-cleaner.php:501
187
  msgid "DONE!"
188
  msgstr "FERTIG!"
189
 
190
- #: classes/odb-cleaner.php:506
191
- msgid "Optimization took"
192
- msgstr "Optimierung dauerte"
193
 
194
- #: classes/odb-cleaner.php:506
 
195
  msgid "seconds"
196
  msgstr "Sekunden"
197
 
198
- #: classes/odb-cleaner.php:514 classes/odb-displayer.php:131
199
- msgid "View Log File"
200
- msgstr "Log anzeigen"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
 
202
- #: classes/odb-cleaner.php:516 classes/odb-displayer.php:133
203
- msgid "Delete Log File"
204
- msgstr "Log löschen"
205
 
206
- #: classes/odb-cleaner.php:1043
207
  msgid "InnoDB table: skipped..."
208
- msgstr "InnoDB table: ignoriert..."
209
 
210
- #: classes/odb-cleaner.php:1049
211
  msgid "<span class=\"odb-optimized\">TABLE OPTIMIZED</span>"
212
  msgstr "<span class=\"odb-optimized\">TABELLE OPTIMIERT</span>"
213
 
214
- #: classes/odb-cleaner.php:1050
215
  msgid "Table is already up to date"
216
  msgstr "Tabelle ist aktuell"
217
 
218
- #: classes/odb-displayer.php:28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  msgid "YES"
220
  msgstr "JA"
221
 
222
- #: classes/odb-displayer.php:29
223
  msgid "NO"
224
  msgstr "NEIN"
225
 
226
- #: classes/odb-displayer.php:40
 
 
 
 
 
 
 
 
227
  msgid "EVERY FIVE MINUTES"
228
- msgstr ""
229
 
230
- #: classes/odb-displayer.php:42
231
  msgid "ONCE HOURLY"
232
  msgstr "STÜNDLICH"
233
 
234
- #: classes/odb-displayer.php:44
235
  msgid "TWICE DAILY"
236
  msgstr "ZWEIMAL TÄGLICH"
237
 
238
- #: classes/odb-displayer.php:46
239
  msgid "ONCE DAILY"
240
  msgstr "EINMAL TÄGLICH"
241
 
242
- #: classes/odb-displayer.php:48
243
  msgid "ONCE WEEKLY"
244
  msgstr "WÖCHENTLICH"
245
 
246
- #: classes/odb-displayer.php:49 includes/settings-page.php:174
 
 
 
 
247
  msgid "NOT SCHEDULED"
248
- msgstr "NICHTS GEPLANT"
249
 
250
- #: classes/odb-displayer.php:54
251
  msgid "Current settings"
252
- msgstr "aktuelle Einstellungen"
 
 
 
 
253
 
254
- #: classes/odb-displayer.php:57
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  msgid "Maximum number of - most recent - revisions to keep per post / page"
256
- msgstr "Maximal gespeicherte Anzahl Revisionen pro Beitrag / Seite"
257
 
258
- #: classes/odb-displayer.php:58 includes/settings-page.php:133
259
  msgid "Delete trashed items"
260
  msgstr "Papierkorb leeren"
261
 
262
- #: classes/odb-displayer.php:59 includes/settings-page.php:139
263
  msgid "Delete spammed items"
264
  msgstr "Spam löschen"
265
 
266
- #: classes/odb-displayer.php:60 includes/settings-page.php:145
267
  msgid "Delete unused tags"
268
- msgstr "Unbenutzte Tags löschen"
269
 
270
- #: classes/odb-displayer.php:61 includes/settings-page.php:151
271
- msgid "Delete expired transients"
272
- msgstr "Abgelaufene Zwischenversionen löschen"
273
 
274
- #: classes/odb-displayer.php:62 includes/settings-page.php:157
275
  msgid "Delete pingbacks and trackbacks"
276
  msgstr "Pingbacks und Trackbacks löschen"
277
 
278
- #: classes/odb-displayer.php:63 includes/settings-page.php:163
 
 
 
 
279
  msgid "Keep a log"
280
- msgstr "Log mitschreiben"
281
 
282
- #: classes/odb-displayer.php:64
 
 
 
 
 
 
 
 
283
  msgid "Last run"
284
- msgstr ""
285
 
286
- #: classes/odb-displayer.php:64 classes/odb-displayer.php:73
287
- #: includes/settings-page.php:208
288
  msgid "hrs"
289
- msgstr "h"
290
 
291
- #: classes/odb-displayer.php:65
292
- msgid "Number of excluded tables"
293
- msgstr "Anzahl ausgeschlossener Tabellen"
294
 
295
- #: classes/odb-displayer.php:66 includes/settings-page.php:170
296
  msgid "Scheduler"
297
  msgstr "Zeitplan"
298
 
299
- #: classes/odb-displayer.php:73
300
  msgid "Next scheduled run"
301
  msgstr "Nächste geplante Optimierung"
302
 
303
- #: classes/odb-displayer.php:73
304
- msgid "current server time"
305
- msgstr ""
306
-
307
- #: classes/odb-displayer.php:78
308
  msgid "Total savings since the first run"
309
  msgstr "Einsparungen insgesamt seit erstem Lauf"
310
 
311
- #: classes/odb-displayer.php:95
312
- msgid "Optimize Database after Deleting Revisions"
313
- msgstr "Datenbank bereinigen und optimieren"
314
 
315
- #: classes/odb-displayer.php:98
316
- msgid ""
317
- "A popular 'one-click' plugin to clean and optimize your WordPress database."
318
- msgstr ""
319
 
320
- #: classes/odb-displayer.php:101
321
- msgid "Plugin version"
322
- msgstr ""
323
 
324
- #: classes/odb-displayer.php:102
325
- msgid "Plugin page"
326
- msgstr ""
327
-
328
- #: classes/odb-displayer.php:103
329
- msgid "Download page"
330
- msgstr ""
331
-
332
- #: classes/odb-displayer.php:104
333
- msgid "Author"
334
- msgstr ""
335
-
336
- #: classes/odb-displayer.php:105
337
- msgid "Company"
338
- msgstr ""
339
-
340
- #: classes/odb-displayer.php:106
341
- msgid "Donation page"
342
- msgstr ""
343
-
344
- #: classes/odb-displayer.php:124
345
  msgid "Change Settings"
346
  msgstr "Einstellungen ändern"
347
 
348
- #: classes/odb-displayer.php:139
 
 
 
 
 
349
  msgid "Start Optimization"
350
  msgstr "Optimierung starten"
351
 
352
- #: classes/odb-logger.php:55
353
- msgid "A WordPress Plugin by"
354
- msgstr "Ein WordPress Plugin von"
355
 
356
- #: classes/odb-logger.php:55
357
- msgid "The Netherlands"
358
- msgstr "Niederlande"
359
-
360
- #: classes/odb-logger.php:59
361
- msgid "time"
362
- msgstr "Zeit"
363
-
364
- #: classes/odb-logger.php:60
365
- msgid "deleted<br />revisions"
366
  msgstr "gelöschte<br />Revisionen"
367
 
368
- #: classes/odb-logger.php:61
369
- msgid "deleted<br />trash"
370
  msgstr "gelöschter<br />Papierkorb"
371
 
372
- #: classes/odb-logger.php:62
373
- msgid "deleted<br />spam"
374
  msgstr "gelöschter<br />Spam"
375
 
376
- #: classes/odb-logger.php:63
377
- msgid "deleted<br />tags"
378
- msgstr "gelöschte<br />Tags"
379
 
380
- #: classes/odb-logger.php:64
381
- msgid "deleted<br />transients"
382
  msgstr "gelöschte<br />Zwischenversionen"
383
 
384
- #: classes/odb-logger.php:65
385
- msgid "deleted<br />pingbacks<br />trackbacks"
386
  msgstr "gelöschte<br />Pingbacks<br />Trackbacks"
387
 
388
- #: classes/odb-logger.php:66
389
- msgid "deleted<br />orphans"
390
- msgstr "gelöschte<br />Waisen"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
 
392
- #: classes/odb-logger.php:67
 
 
 
 
 
 
 
 
 
 
 
 
393
  msgid "nr of optimized tables"
394
  msgstr "optimierte Tabellen"
395
 
396
- #: classes/odb-logger.php:68
397
  msgid "database size BEFORE"
398
  msgstr "Datenbankgröße VORHER"
399
 
400
- #: classes/odb-logger.php:69
401
  msgid "database size AFTER"
402
  msgstr "Datenbankgröße NACHHER"
403
 
404
- #: classes/odb-logger.php:70
405
- msgid "SAVINGS"
406
- msgstr "Einsparungen"
407
-
408
- #: classes/odb-scheduler.php:34
409
  msgid "Once Weekly"
410
  msgstr "einmal wöchentlich"
411
 
412
- #: classes/odb-scheduler.php:39
 
 
 
 
413
  msgid "Every Five Minutes"
414
- msgstr ""
415
 
416
- #: includes/settings-page.php:82
417
  msgid "Optimize Database after Deleting Revisions SETTINGS UPDATED"
418
  msgstr "Einstellungen aktualisiert"
419
 
420
- #: includes/settings-page.php:84
421
  msgid ""
422
  "Click <a href=\"tools.php?page=rvg-optimize-database\" class=\"odb-bold"
423
  "\">HERE</a> to run the optimization"
424
  msgstr ""
 
 
425
 
426
- #: includes/settings-page.php:120 rvg-optimize-db.php:257
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
427
  msgid "Settings"
428
  msgstr "Einstellungen"
429
 
430
- #: includes/settings-page.php:125
431
- msgid "Maximum number of - most recent - revisions<br>to keep per post / page"
432
  msgstr ""
 
 
 
 
 
433
 
434
- #: includes/settings-page.php:129
 
 
 
 
435
  msgid "('0' means: delete <u>ALL</u> revisions)"
436
- msgstr "('0' bedeutet: <u>ALLE</u> Revisionen löschen)"
 
 
 
 
 
 
 
 
 
 
 
 
437
 
438
- #: includes/settings-page.php:184
439
  msgid "run optimization HOURLY"
440
  msgstr "STÜNDLICH optimieren"
441
 
442
- #: includes/settings-page.php:187
443
  msgid "run optimization TWICE A DAY"
444
  msgstr "ZWEIMAL TÄGLICH optimieren"
445
 
446
- #: includes/settings-page.php:190
447
  msgid "run optimization DAILY"
448
  msgstr "TÄGLICH optimieren"
449
 
450
- #: includes/settings-page.php:193
451
  msgid "run optimization WEEKLY"
452
  msgstr "WÖCHENTLICH optimieren"
453
 
454
- #: includes/settings-page.php:200
 
 
 
 
455
  msgid "Time"
456
  msgstr "Zeit"
457
 
458
- #: includes/settings-page.php:223
459
  msgid "Show '1-click' link in Admin Bar"
460
- msgstr "Zeige '1-Klick' Link in Admin Bar"
 
 
 
 
461
 
462
- #: includes/settings-page.php:226 includes/settings-page.php:233
463
- msgid "(change will be visible after loading the next page)"
464
  msgstr "(Änderungen werden sichtbar, nachdem die nächste Seite geladen wurde)"
465
 
466
- #: includes/settings-page.php:230
467
- msgid "Show an icon in the Admin Menu"
468
- msgstr "Zeige Icon im Admin-Menü"
469
 
470
- #: includes/settings-page.php:239
 
 
 
 
471
  msgid ""
472
- "EXCLUDE DATABASE TABLES FROM OPTIMIZATION: <span class=\"odb-underline-red"
473
  "\">CHECKED</span> TABLES <span class=\"odb-underline-red\">WON'T</span> BE "
474
  "OPTIMIZED!</span>"
475
  msgstr ""
@@ -477,39 +787,160 @@ msgstr ""
477
  "\">MARKIERTE</span> TABELLEN WERDEN <span class=\"odb-underline-red\">NICHT</"
478
  "span> OPTIMIERT!</span>"
479
 
480
- #: includes/settings-page.php:245
481
  msgid "check all tables"
482
  msgstr "alle Tabellen markieren"
483
 
484
- #: includes/settings-page.php:247
485
  msgid "uncheck all tables"
486
  msgstr "alle Markierungen entfernen"
487
 
488
- #: includes/settings-page.php:249
489
  msgid "check all NON-WordPress tables"
490
  msgstr "alle NICHT-WordPress-Tabellen markieren"
491
 
492
- #: includes/settings-page.php:276
493
- msgid "Save Settings"
494
- msgstr "Einstellungen speichern"
495
-
496
- #: includes/settings-page.php:278
497
- msgid "Go To Optimizer"
498
- msgstr "Zur Optimierung"
499
-
500
- #: rvg-optimize-db.php:229 rvg-optimize-db.php:230 rvg-optimize-db.php:244
501
- #: rvg-optimize-db.php:245 rvg-optimize-db.php:286 rvg-optimize-db.php:287
502
- #: rvg-optimize-db.php:305 rvg-optimize-db.php:306
503
  msgid "Optimize Database"
504
  msgstr "Datenbank optimieren"
505
 
506
- #: rvg-optimize-db.php:273
507
  msgid "Optimize DB (1 click)"
508
  msgstr "DB optimieren (1 Klick)"
509
 
510
- #: rvg-optimize-db.php:451
511
- msgid "Optimize Database after Deleting Revisions LOG FILE HAS BEEN DELETED"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
512
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
513
 
514
  #~ msgid ""
515
  #~ "Click <a href=\"tools.php?page=rvg-optimize-db.php\" class=\"odb-bold"
@@ -523,10 +954,6 @@ msgstr ""
523
  #~ "ist ein 1-Klick Plugin zum Bereinigen und Optimieren der WordPress "
524
  #~ "Datenbank"
525
 
526
- #~ msgid ""
527
- #~ "Maximum number of - most recent - revisions<br />to keep per post / page"
528
- #~ msgstr "Maximal gespeicherte Anzahl<br />Revisionen pro Beitrag / Seite"
529
-
530
  #~ msgid "Optimize your WordPress Database"
531
  #~ msgstr "WordPress Datenbank optimieren"
532
 
@@ -541,3 +968,108 @@ msgstr ""
541
 
542
  #~ msgid "Download URL:"
543
  #~ msgstr "Download URL:"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  msgstr ""
3
  "Project-Id-Version: Optimize Database after Deleting Revisions\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2018-11-09 18:34+0100\n"
6
+ "PO-Revision-Date: 2018-12-12 06:01+0100\n"
7
+ "Last-Translator: Kolja Spyra <mail@kolja-spyra.de>\n"
8
  "Language-Team: \n"
9
  "Language: de\n"
10
  "MIME-Version: 1.0\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
  "X-Poedit-SourceCharset: UTF-8\n"
15
+ "X-Poedit-Basepath: C:/My Dropbox/WordPress/wp-plugins/rvg-optimize-db\n"
16
  "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
17
  "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
18
  "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
19
  "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
20
  "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
21
  "X-Loco-Target-Locale: de_DE\n"
22
+ "X-Generator: Poedit 2.2\n"
23
+ "X-Poedit-Flags-xgettext: --add-comments\n"
24
  "X-Poedit-SearchPath-0: .\n"
25
 
26
+ #: classes/odb-cleaner.php:32
27
+ msgid "Analyzing Database"
28
+ msgstr "Datenbank Analysieren"
29
+
30
+ #: classes/odb-cleaner.php:41
31
  msgid "Cleaning Database"
32
  msgstr "Datenbank bereiningen"
33
 
34
+ #: classes/odb-cleaner.php:90
35
+ msgid "REVISIONS"
36
+ msgstr "REVISIONEN"
37
+
38
+ #: classes/odb-cleaner.php:91
39
+ msgid "revisions"
40
+ msgstr "Revisionen"
41
+
42
+ #: classes/odb-cleaner.php:93
43
  msgid "DELETED REVISIONS"
44
  msgstr "GELÖSCHTE REVISIONEN"
45
 
46
+ #: classes/odb-cleaner.php:94
47
+ msgid "revisions deleted"
48
+ msgstr "Revisionen gelöscht"
49
+
50
+ #: classes/odb-cleaner.php:103 classes/odb-cleaner.php:169
51
+ #: classes/odb-cleaner.php:230 classes/odb-cleaner.php:292
52
+ #: classes/odb-cleaner.php:362 classes/odb-cleaner.php:426
53
+ #: classes/odb-cleaner.php:488 classes/odb-cleaner.php:552
54
  msgid "prefix"
55
  msgstr "Präfix"
56
 
57
+ #: classes/odb-cleaner.php:104
58
  msgid "post / page"
59
  msgstr "Beitrag / Seite"
60
 
61
+ #: classes/odb-cleaner.php:105
62
  msgid "revision date"
63
  msgstr "Datum"
64
 
65
+ #: classes/odb-cleaner.php:116
66
+ msgid "total number of revisions"
67
+ msgstr "Gesamt Anzahl der Revisionen"
68
 
69
+ #: classes/odb-cleaner.php:118
70
  msgid "total number of revisions deleted"
71
  msgstr "insgesamt gelöschte Revisionen"
72
 
73
+ #: classes/odb-cleaner.php:131
74
  msgid "No REVISIONS found to delete"
75
+ msgstr "Keine REVISIONEN zum Löschen gefunden"
76
 
77
+ #: classes/odb-cleaner.php:154
78
+ msgid "TRASHED ITEMS"
79
+ msgstr "GELÖSCHTE EINTRÄGE"
80
+
81
+ #: classes/odb-cleaner.php:155
82
+ msgid "total number of trashed items"
83
+ msgstr "Gesamtzahl der gelöschten Einträge"
84
+
85
+ #: classes/odb-cleaner.php:157
86
  msgid "DELETED TRASHED ITEMS"
87
  msgstr "Aus dem Papierkorb gelöscht"
88
 
89
+ #: classes/odb-cleaner.php:158
90
+ msgid "total number of trashed items deleted"
91
+ msgstr "gesamt gelöscht"
92
+
93
+ #: classes/odb-cleaner.php:170 classes/odb-cleaner.php:427
94
+ #: classes/odb-cleaner.php:553
95
  msgid "type"
96
  msgstr "Typ"
97
 
98
+ #: classes/odb-cleaner.php:171
99
  msgid "IP address / title"
100
  msgstr "IP Adresse / Titel"
101
 
102
+ #: classes/odb-cleaner.php:172 classes/odb-cleaner.php:429
103
+ #: classes/odb-logger.php:114 classes/odb-logger.php:242
104
  msgid "date"
105
  msgstr "Datum"
106
 
107
+ #: classes/odb-cleaner.php:192
 
 
 
 
108
  msgid "No TRASHED ITEMS found to delete"
109
+ msgstr "Nichts zum Löschen im PAPIERKORB gefunden"
 
 
 
 
110
 
111
+ #: classes/odb-cleaner.php:215
112
+ msgid "SPAMMED ITEMS"
113
+ msgstr "SPAM EINTRÄGE"
114
 
115
+ #: classes/odb-cleaner.php:216
116
+ msgid "total number of spammed items"
117
+ msgstr "Gesamtzahl der spam Einträge"
 
 
 
 
118
 
119
  #: classes/odb-cleaner.php:218
120
+ msgid "DELETED SPAMMED ITEMS"
121
+ msgstr "GELÖSCHTE SPAM EINTRÄGE"
122
+
123
+ #: classes/odb-cleaner.php:219
124
  msgid "total number of spammed items deleted"
125
  msgstr "gesamt Spam gelöscht"
126
 
127
  #: classes/odb-cleaner.php:231
128
+ msgid "comment author"
129
+ msgstr "Kommentar Autor"
130
+
131
+ #: classes/odb-cleaner.php:232
132
+ msgid "comment author email"
133
+ msgstr "Kommentar Autor E-Mail"
134
+
135
+ #: classes/odb-cleaner.php:233
136
+ msgid "comment date"
137
+ msgstr "Kommentar Datum"
138
+
139
+ #: classes/odb-cleaner.php:253
140
  msgid "No SPAMMED ITEMS found to delete"
141
+ msgstr "kein SPAM EINTRÄGE zum Löschen gefunden"
142
+
143
+ #: classes/odb-cleaner.php:277
144
+ msgid "UNUSED TAGS"
145
+ msgstr "UNBENUTZTE SCHLAGWORTE"
146
+
147
+ #: classes/odb-cleaner.php:278
148
+ msgid "total number of unused tags"
149
+ msgstr "Gesamtzahl der ungenutzten Schlagworte"
150
+
151
+ #: classes/odb-cleaner.php:280
152
+ msgid "DELETED UNUSED TAGS"
153
+ msgstr "GELÖSCHTE UNBENUTZTE SCHLAGWORTE"
154
+
155
+ #: classes/odb-cleaner.php:281
156
+ msgid "total number of unused tags deleted"
157
+ msgstr "Gesamtzahl der ungenutzten Schlagworte gelöscht"
158
+
159
+ #: classes/odb-cleaner.php:293
160
+ msgid "tag"
161
+ msgstr "Schlagwort"
162
+
163
+ #: classes/odb-cleaner.php:313
164
+ msgid "No UNUSED TAGE found to delete"
165
+ msgstr "Kein UNBENUTZTEN SCHLAGWORTE gefunden, um zu löschen"
166
+
167
+ #: classes/odb-cleaner.php:338
168
+ msgid "EXPIRED TRANSIENTS"
169
+ msgstr "ABGELAUFENEN ZWISCHENVERSIONEN "
170
 
171
+ #: classes/odb-cleaner.php:339
172
+ msgid "total number of expired transients"
173
+ msgstr "Gesamtzahl der abgelaufenen Zwischenversionen"
174
 
175
+ #: classes/odb-cleaner.php:341
176
+ msgid "EXPIRED TRANSIENTS DELETED"
177
+ msgstr "ABGELAUFENE ZWISCHENVERSIONEN GELÖSCHT"
178
 
179
+ #: classes/odb-cleaner.php:342
180
+ msgid "total number of expired transients deleted"
181
+ msgstr "Gesamtzahl abgelaufener gelöschter Zwischenversionen"
182
 
183
+ #: classes/odb-cleaner.php:346
184
+ msgid "TRANSIENTS"
185
+ msgstr "TRANSIENTEN"
186
+
187
+ #: classes/odb-cleaner.php:347 classes/odb-cleaner.php:350
188
+ msgid "total number of transients"
189
+ msgstr "Gesamtzahl der Zwischenversionen"
190
+
191
+ #: classes/odb-cleaner.php:349
192
+ msgid "TRANSIENTS DELETED"
193
+ msgstr "ZWISCHENVERSIONEN GELÖSCHT"
194
+
195
+ #: classes/odb-cleaner.php:363
196
+ msgid "option name"
197
+ msgstr "Optionsname"
198
+
199
+ #: classes/odb-cleaner.php:385
200
  msgid "No EXPIRED TRANSIENTS found to delete"
201
+ msgstr "Keine ABGELAUFENEN ZWISCHENVERSIONEN zum Löschen gefunden"
202
+
203
+ #: classes/odb-cleaner.php:387
204
+ msgid "No TRANSIENTS found to delete"
205
+ msgstr "keine abgelaufenen ZWISCHENVERSIONEN zum Löschen gefunden"
206
+
207
+ #: classes/odb-cleaner.php:411
208
+ msgid "PINGBACKS AND TRACKBACKS"
209
+ msgstr "PINGBACKS UND TRACKBACKS"
210
+
211
+ #: classes/odb-cleaner.php:412
212
+ msgid "total number of pingbacks and trackbacks"
213
+ msgstr "Gesamtzahl der Pingbacks und Trackbacks"
214
 
215
+ #: classes/odb-cleaner.php:414
216
+ msgid "DELETED PINGBACKS AND TRACKBACKS"
217
+ msgstr "GELÖSCHTE PINGBACKS UND TRACKBACKS"
218
 
219
+ #: classes/odb-cleaner.php:415
220
+ msgid "total number of pingbacks and trackbacks deleted"
221
+ msgstr "Gesamtzahl der gelöschten Pingbacks und Trackbacks "
222
+
223
+ #: classes/odb-cleaner.php:428
224
+ msgid "comment_author"
225
+ msgstr "Kommentar Autor"
226
+
227
+ #: classes/odb-cleaner.php:449
228
  msgid "No PINGBACKS nor TRACKBACKS found to delete"
229
+ msgstr "keine PINGBACKS und TRACKBACKS zum Löschen gefunden"
230
+
231
+ #: classes/odb-cleaner.php:473
232
+ msgid "OEMBED CACHE"
233
+ msgstr "OEMBED CACHE"
234
+
235
+ #: classes/odb-cleaner.php:474
236
+ msgid "total number of oEmbeds"
237
+ msgstr "Gesamtzahl der oEmbeds"
238
+
239
+ #: classes/odb-cleaner.php:476
240
+ msgid "DELETED OEMBEDS"
241
+ msgstr "GELÖSCHTE OEMBEDS"
242
+
243
+ #: classes/odb-cleaner.php:477
244
+ msgid "total number of oEmbeds deleted"
245
+ msgstr "Gesamtzahl der gelöschten oEmbeds"
246
+
247
+ #: classes/odb-cleaner.php:489 classes/odb-cleaner.php:557
248
+ msgid "meta key"
249
+ msgstr "Meta-Schlüssel"
250
+
251
+ #: classes/odb-cleaner.php:490 classes/odb-cleaner.php:558
252
+ msgid "meta value"
253
+ msgstr "Meta-Wert"
254
+
255
+ #: classes/odb-cleaner.php:510
256
+ msgid "No OEMED CHACHE found to delete"
257
+ msgstr "Kein OEMBED CACHE gefunden, der geleert werden konnte"
258
+
259
+ #: classes/odb-cleaner.php:534
260
+ msgid "POSTMETA ORPHANS"
261
+ msgstr "VERWAISTE META EINTRÄGE"
262
+
263
+ #: classes/odb-cleaner.php:535 classes/odb-cleaner.php:538
264
+ msgid "total number of orphans"
265
+ msgstr "Gesamtzahl der Waisen Einträge"
266
+
267
+ #: classes/odb-cleaner.php:537
268
+ msgid "DELETED POSTMETA ORPHANS"
269
+ msgstr "GELÖSCHTE VERWAISTE META EINTRÄGE"
270
+
271
+ #: classes/odb-cleaner.php:554 classes/odb-logger.php:241
272
+ msgid "id"
273
+ msgstr "ID"
274
+
275
+ #: classes/odb-cleaner.php:555
276
+ msgid "title"
277
+ msgstr "Titel"
278
 
279
+ #: classes/odb-cleaner.php:556
280
+ msgid "modified"
281
+ msgstr "geändert"
282
 
283
+ #: classes/odb-cleaner.php:579
284
  msgid "No POSTMETA ORPHANS found to delete"
285
+ msgstr "keine VERWAISTEN METADATEN zum Löschen gefunden"
286
 
287
+ #: classes/odb-cleaner.php:606
288
  msgid "Optimizing Database Tables"
289
+ msgstr "Optimiere Datenbank Tabellen"
290
 
291
+ #: classes/odb-cleaner.php:613
292
  msgid "table name"
293
  msgstr "Tabelle"
294
 
295
+ #: classes/odb-cleaner.php:614
296
  msgid "optimization result"
297
  msgstr "Ergebnis"
298
 
299
+ #: classes/odb-cleaner.php:615
300
  msgid "engine"
301
  msgstr "Typ"
302
 
303
+ #: classes/odb-cleaner.php:616
304
  msgid "table rows"
305
  msgstr "Zeilen"
306
 
307
+ #: classes/odb-cleaner.php:617
308
  msgid "table size"
309
  msgstr "Größe"
310
 
311
+ #: classes/odb-cleaner.php:664
312
  msgid "Savings"
313
  msgstr "Einsparungen"
314
 
315
+ #: classes/odb-cleaner.php:671
316
  msgid "size of the database"
317
  msgstr "Datenbank-Größe"
318
 
319
+ #: classes/odb-cleaner.php:674
320
  msgid "BEFORE optimization"
321
  msgstr "VORHER"
322
 
323
+ #: classes/odb-cleaner.php:678
324
  msgid "AFTER optimization"
325
  msgstr "NACHHER"
326
 
327
+ #: classes/odb-cleaner.php:682
328
  msgid "SAVINGS THIS TIME"
329
  msgstr "Einsparungen bei diesem Lauf"
330
 
331
+ #: classes/odb-cleaner.php:686
332
  msgid "TOTAL SAVINGS SINCE THE FIRST RUN"
333
  msgstr "Einsparungen insgesamt seit dem ersten Lauf"
334
 
335
+ #: classes/odb-cleaner.php:712
336
  msgid "DONE!"
337
  msgstr "FERTIG!"
338
 
339
+ #: classes/odb-cleaner.php:720
340
+ msgid "Analysis took"
341
+ msgstr "Analyse dauerte"
342
 
343
+ #: classes/odb-cleaner.php:720 classes/odb-cleaner.php:724
344
+ #: classes/odb-displayer.php:139 classes/odb-displayer.php:174
345
  msgid "seconds"
346
  msgstr "Sekunden"
347
 
348
+ #: classes/odb-cleaner.php:724
349
+ msgid "Optimization took"
350
+ msgstr "Optimierung dauerte"
351
+
352
+ #: classes/odb-cleaner.php:738 classes/odb-displayer.php:196
353
+ #: classes/odb-logger.php:157
354
+ msgid "Clear the log?"
355
+ msgstr "Protokoll löschen?"
356
+
357
+ #: classes/odb-cleaner.php:748 classes/odb-displayer.php:215
358
+ msgid "View Log"
359
+ msgstr "Protokoll anzeigen"
360
+
361
+ #: classes/odb-cleaner.php:750 classes/odb-displayer.php:217
362
+ #: classes/odb-logger.php:170
363
+ msgid "Clear Log"
364
+ msgstr "Protokoll löschen"
365
 
366
+ #: classes/odb-cleaner.php:991
367
+ msgid "of"
368
+ msgstr "von"
369
 
370
+ #: classes/odb-cleaner.php:1655
371
  msgid "InnoDB table: skipped..."
372
+ msgstr "InnoDB table: übersprungen…"
373
 
374
+ #: classes/odb-cleaner.php:1662 classes/odb-cleaner.php:1672
375
  msgid "<span class=\"odb-optimized\">TABLE OPTIMIZED</span>"
376
  msgstr "<span class=\"odb-optimized\">TABELLE OPTIMIERT</span>"
377
 
378
+ #: classes/odb-cleaner.php:1664 classes/odb-cleaner.php:1670
379
  msgid "Table is already up to date"
380
  msgstr "Tabelle ist aktuell"
381
 
382
+ #: classes/odb-displayer.php:29
383
+ msgid "Optimize Database after Deleting Revisions"
384
+ msgstr "Datenbank bereinigen und optimieren"
385
+
386
+ #: classes/odb-displayer.php:33
387
+ msgid ""
388
+ "A popular 'one-click' plugin to clean and optimize your WordPress database."
389
+ msgstr ""
390
+ "Eine populäre „Ein-Klick“-Erweiterung, um Ihre WordPress-Datenbank zu "
391
+ "reinigen und zu optimieren."
392
+
393
+ #: classes/odb-displayer.php:34
394
+ msgid "Plugin version"
395
+ msgstr "Erweiterungs-Version"
396
+
397
+ #: classes/odb-displayer.php:34
398
+ msgid "Plugin page"
399
+ msgstr "Hersteller-Seite"
400
+
401
+ #: classes/odb-displayer.php:34
402
+ msgid "Download page"
403
+ msgstr "WordPress-Seite"
404
+
405
+ #: classes/odb-displayer.php:34
406
+ msgid "Author"
407
+ msgstr "Herausgeber"
408
+
409
+ #: classes/odb-displayer.php:34
410
+ msgid "Company"
411
+ msgstr "Unternehmen"
412
+
413
+ #: classes/odb-displayer.php:63
414
  msgid "YES"
415
  msgstr "JA"
416
 
417
+ #: classes/odb-displayer.php:64
418
  msgid "NO"
419
  msgstr "NEIN"
420
 
421
+ #: classes/odb-displayer.php:72 includes/settings-page.php:325
422
+ msgid "DELETE EXPIRED TRANSIENTS"
423
+ msgstr "LÖSCHE ABGELAUFENEN ZWISCHENVERSIONEN "
424
+
425
+ #: classes/odb-displayer.php:74 includes/settings-page.php:328
426
+ msgid "DELETE ALL TRANSIENTS"
427
+ msgstr "LÖSCHE ALLE ZWISCHENVERSIONEN "
428
+
429
+ #: classes/odb-displayer.php:86
430
  msgid "EVERY FIVE MINUTES"
431
+ msgstr "ALLE FÜNF MINUTEN"
432
 
433
+ #: classes/odb-displayer.php:88
434
  msgid "ONCE HOURLY"
435
  msgstr "STÜNDLICH"
436
 
437
+ #: classes/odb-displayer.php:90
438
  msgid "TWICE DAILY"
439
  msgstr "ZWEIMAL TÄGLICH"
440
 
441
+ #: classes/odb-displayer.php:92
442
  msgid "ONCE DAILY"
443
  msgstr "EINMAL TÄGLICH"
444
 
445
+ #: classes/odb-displayer.php:94
446
  msgid "ONCE WEEKLY"
447
  msgstr "WÖCHENTLICH"
448
 
449
+ #: classes/odb-displayer.php:96
450
+ msgid "ONCE MONTHLY"
451
+ msgstr "EINMAL MONATLICH"
452
+
453
+ #: classes/odb-displayer.php:97 includes/settings-page.php:371
454
  msgid "NOT SCHEDULED"
455
+ msgstr "NICHT PLANEN"
456
 
457
+ #: classes/odb-displayer.php:102
458
  msgid "Current settings"
459
+ msgstr "Aktuelle Einstellungen"
460
+
461
+ #: classes/odb-displayer.php:117
462
+ msgid "NONE"
463
+ msgstr "KEINE"
464
 
465
+ #: classes/odb-displayer.php:119
466
+ msgid "Delete revisions of"
467
+ msgstr "Lösche Revisionen von"
468
+
469
+ #: classes/odb-displayer.php:122 includes/settings-page.php:155
470
+ #: includes/settings-page.php:267
471
+ msgid "Delete revisions older than"
472
+ msgstr "Revisionen löschen, die älter sind als"
473
+
474
+ #: classes/odb-displayer.php:122 classes/odb-displayer.php:170
475
+ msgid "days"
476
+ msgstr "Tage"
477
+
478
+ #: classes/odb-displayer.php:126
479
  msgid "Maximum number of - most recent - revisions to keep per post / page"
480
+ msgstr "Maximal gespeicherte Anzahl von Revisionen pro Beitrag / Seite"
481
 
482
+ #: classes/odb-displayer.php:130 includes/settings-page.php:300
483
  msgid "Delete trashed items"
484
  msgstr "Papierkorb leeren"
485
 
486
+ #: classes/odb-displayer.php:131 includes/settings-page.php:306
487
  msgid "Delete spammed items"
488
  msgstr "Spam löschen"
489
 
490
+ #: classes/odb-displayer.php:132 includes/settings-page.php:312
491
  msgid "Delete unused tags"
492
+ msgstr "Unbenutzte Schlagworte löschen"
493
 
494
+ #: classes/odb-displayer.php:133 includes/settings-page.php:318
495
+ msgid "Delete transients"
496
+ msgstr "Zwischenversionen löschen"
497
 
498
+ #: classes/odb-displayer.php:134 includes/settings-page.php:337
499
  msgid "Delete pingbacks and trackbacks"
500
  msgstr "Pingbacks und Trackbacks löschen"
501
 
502
+ #: classes/odb-displayer.php:135 includes/settings-page.php:343
503
+ msgid "Clear oEmbed cache"
504
+ msgstr "oEmbed-Cache leeren"
505
+
506
+ #: classes/odb-displayer.php:136 includes/settings-page.php:361
507
  msgid "Keep a log"
508
+ msgstr "Protokoll mitschreiben"
509
 
510
+ #: classes/odb-displayer.php:137
511
+ msgid "Optimize InnoDB tables"
512
+ msgstr "InnoDB-Tabellen optimieren"
513
+
514
+ #: classes/odb-displayer.php:138
515
+ msgid "Number of excluded tables"
516
+ msgstr "Anzahl ausgeschlossener Tabellen"
517
+
518
+ #: classes/odb-displayer.php:139
519
  msgid "Last run"
520
+ msgstr "Letzte Ausführung"
521
 
522
+ #: classes/odb-displayer.php:139 includes/settings-page.php:405
 
523
  msgid "hrs"
524
+ msgstr "Uhr"
525
 
526
+ #: classes/odb-displayer.php:139
527
+ msgid "in"
528
+ msgstr "vor"
529
 
530
+ #: classes/odb-displayer.php:140 includes/settings-page.php:367
531
  msgid "Scheduler"
532
  msgstr "Zeitplan"
533
 
534
+ #: classes/odb-displayer.php:150
535
  msgid "Next scheduled run"
536
  msgstr "Nächste geplante Optimierung"
537
 
538
+ #: classes/odb-displayer.php:155
 
 
 
 
539
  msgid "Total savings since the first run"
540
  msgstr "Einsparungen insgesamt seit erstem Lauf"
541
 
542
+ #: classes/odb-displayer.php:171
543
+ msgid "hours"
544
+ msgstr "Stunden"
545
 
546
+ #: classes/odb-displayer.php:172
547
+ msgid "minutes"
548
+ msgstr "Minuten"
 
549
 
550
+ #: classes/odb-displayer.php:173
551
+ msgid "and"
552
+ msgstr "und"
553
 
554
+ #: classes/odb-displayer.php:189 classes/odb-logger.php:168
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555
  msgid "Change Settings"
556
  msgstr "Einstellungen ändern"
557
 
558
+ #: classes/odb-displayer.php:224
559
+ msgid "Analyze Database"
560
+ msgstr "Datenbank analysieren"
561
+
562
+ #: classes/odb-displayer.php:226 classes/odb-logger.php:174
563
+ #: rvg-optimize-database.php:674
564
  msgid "Start Optimization"
565
  msgstr "Optimierung starten"
566
 
567
+ #: classes/odb-logger.php:102
568
+ msgid "Logs"
569
+ msgstr "Protokolle"
570
 
571
+ #: classes/odb-logger.php:115
572
+ msgid "deleted<br>revisions"
 
 
 
 
 
 
 
 
573
  msgstr "gelöschte<br />Revisionen"
574
 
575
+ #: classes/odb-logger.php:116
576
+ msgid "deleted<br>trash"
577
  msgstr "gelöschter<br />Papierkorb"
578
 
579
+ #: classes/odb-logger.php:117
580
+ msgid "deleted<br>spam"
581
  msgstr "gelöschter<br />Spam"
582
 
583
+ #: classes/odb-logger.php:118
584
+ msgid "deleted<br>tags"
585
+ msgstr "gelöschte<br />Schlagworte"
586
 
587
+ #: classes/odb-logger.php:119
588
+ msgid "deleted<br>transients"
589
  msgstr "gelöschte<br />Zwischenversionen"
590
 
591
+ #: classes/odb-logger.php:120
592
+ msgid "deleted<br>pingbacks<br>trackbacks"
593
  msgstr "gelöschte<br />Pingbacks<br />Trackbacks"
594
 
595
+ #: classes/odb-logger.php:121
596
+ msgid "deleted<br>oEmbed<br>records"
597
+ msgstr "gelöschte<br>oEmbed<br>Datensätze"
598
+
599
+ #: classes/odb-logger.php:122
600
+ msgid "deleted<br>orphans"
601
+ msgstr "gelöschte<br />cerwaiste Einträge"
602
+
603
+ #: classes/odb-logger.php:123
604
+ msgid "nr of<br>optimized<br>tables"
605
+ msgstr "Anzahl<br>optimierter<br>Tabellen"
606
+
607
+ #: classes/odb-logger.php:124
608
+ msgid "database<br> size<br>BEFORE"
609
+ msgstr "Datenbank<br>Größe<br>VORHER"
610
+
611
+ #: classes/odb-logger.php:125
612
+ msgid "database<br>size<br>AFTER"
613
+ msgstr "Datenbank<br>Größe<br>DANACH"
614
+
615
+ #: classes/odb-logger.php:126 classes/odb-logger.php:253
616
+ msgid "SAVINGS"
617
+ msgstr "Einsparungen"
618
+
619
+ #: classes/odb-logger.php:172
620
+ msgid "Export to CSV"
621
+ msgstr "Als CSV exportieren"
622
+
623
+ #: classes/odb-logger.php:243
624
+ msgid "deleted revisions"
625
+ msgstr "gelöschte Revisionen"
626
+
627
+ #: classes/odb-logger.php:244
628
+ msgid "deleted trash"
629
+ msgstr "gelöschter Papierkorb"
630
+
631
+ #: classes/odb-logger.php:245
632
+ msgid "deleted spam"
633
+ msgstr "gelöschter Spam"
634
+
635
+ #: classes/odb-logger.php:246
636
+ msgid "deleted tags"
637
+ msgstr "gelöschte Schlagworte"
638
 
639
+ #: classes/odb-logger.php:247
640
+ msgid "deleted transients"
641
+ msgstr "gelöschte Zwischenversionen"
642
+
643
+ #: classes/odb-logger.php:248
644
+ msgid "deleted pingbacks"
645
+ msgstr "geklöschte Pingbacks Pingbacks"
646
+
647
+ #: classes/odb-logger.php:249
648
+ msgid "deleted orphans"
649
+ msgstr "gelöschte verwaiste Einträge"
650
+
651
+ #: classes/odb-logger.php:250
652
  msgid "nr of optimized tables"
653
  msgstr "optimierte Tabellen"
654
 
655
+ #: classes/odb-logger.php:251
656
  msgid "database size BEFORE"
657
  msgstr "Datenbankgröße VORHER"
658
 
659
+ #: classes/odb-logger.php:252
660
  msgid "database size AFTER"
661
  msgstr "Datenbankgröße NACHHER"
662
 
663
+ #: classes/odb-scheduler.php:38
 
 
 
 
664
  msgid "Once Weekly"
665
  msgstr "einmal wöchentlich"
666
 
667
+ #: classes/odb-scheduler.php:42
668
+ msgid "Once Monthly"
669
+ msgstr "Einmal monatlich"
670
+
671
+ #: classes/odb-scheduler.php:47
672
  msgid "Every Five Minutes"
673
+ msgstr "Alle Fünf Minuten"
674
 
675
+ #: includes/settings-page.php:118
676
  msgid "Optimize Database after Deleting Revisions SETTINGS UPDATED"
677
  msgstr "Einstellungen aktualisiert"
678
 
679
+ #: includes/settings-page.php:120
680
  msgid ""
681
  "Click <a href=\"tools.php?page=rvg-optimize-database\" class=\"odb-bold"
682
  "\">HERE</a> to run the optimization"
683
  msgstr ""
684
+ "Klicken Sie <a href=\"tools.php?page=rvg-optimize-database\" class=\"odb-bold"
685
+ "\">HIER </a>, um die Optimierung auszuführen"
686
 
687
+ #: includes/settings-page.php:155
688
+ msgid "You have to enter: "
689
+ msgstr "Sie müssen eingeben:"
690
+
691
+ #: includes/settings-page.php:160
692
+ msgid "<Delete revisions older than> should be a number"
693
+ msgstr "<Löschen von Revisionen, älter als> sollte eine Zahl sein"
694
+
695
+ #: includes/settings-page.php:168
696
+ msgid "You have to enter the <Maximum number of revisions>"
697
+ msgstr "Sie müssen die maximale Anzahl von Revisionen eingeben"
698
+
699
+ #: includes/settings-page.php:173
700
+ msgid "<Maximum number of revisions> should be a number"
701
+ msgstr "<Maximalzahl der Zwischenversionen> sollte eine Zahl sein"
702
+
703
+ #: includes/settings-page.php:231 rvg-optimize-database.php:464
704
  msgid "Settings"
705
  msgstr "Einstellungen"
706
 
707
+ #: includes/settings-page.php:236
708
+ msgid "Delete revisions for the following (custom) post type(s):"
709
  msgstr ""
710
+ "Revisionen für folgende (benutzerdefinierte) Beitragsarten-Typen löschen:"
711
+
712
+ #: includes/settings-page.php:272
713
+ msgid "day(s)"
714
+ msgstr "Tag(e)"
715
 
716
+ #: includes/settings-page.php:284
717
+ msgid "Maximum number of - most recent - revisions<br>to keep per post / page"
718
+ msgstr "Maximale Anzahl der-letzten-Revisionen<br>pro Beitrag/Seite"
719
+
720
+ #: includes/settings-page.php:290
721
  msgid "('0' means: delete <u>ALL</u> revisions)"
722
+ msgstr "('0' bedeutet: <u>ALLE</u> Revisoren werden gelöscht)"
723
+
724
+ #: includes/settings-page.php:322
725
+ msgid "DO NOT DELETE TRANSIENTS"
726
+ msgstr "ZWISCHENVERSIONEN NICHT LÖSCHEN"
727
+
728
+ #: includes/settings-page.php:349
729
+ msgid "Clear orphans"
730
+ msgstr "Verwaiste Einträge löschen"
731
+
732
+ #: includes/settings-page.php:355
733
+ msgid "Optimize InnoDB tables too"
734
+ msgstr "InnoDB-Tabellen optimieren"
735
 
736
+ #: includes/settings-page.php:374
737
  msgid "run optimization HOURLY"
738
  msgstr "STÜNDLICH optimieren"
739
 
740
+ #: includes/settings-page.php:377
741
  msgid "run optimization TWICE A DAY"
742
  msgstr "ZWEIMAL TÄGLICH optimieren"
743
 
744
+ #: includes/settings-page.php:380
745
  msgid "run optimization DAILY"
746
  msgstr "TÄGLICH optimieren"
747
 
748
+ #: includes/settings-page.php:383
749
  msgid "run optimization WEEKLY"
750
  msgstr "WÖCHENTLICH optimieren"
751
 
752
+ #: includes/settings-page.php:386
753
+ msgid "run optimization MONTHLY"
754
+ msgstr "MONATLICH optimieren"
755
+
756
+ #: includes/settings-page.php:396
757
  msgid "Time"
758
  msgstr "Zeit"
759
 
760
+ #: includes/settings-page.php:420
761
  msgid "Show '1-click' link in Admin Bar"
762
+ msgstr "Zeige einen ‚1-Klick' Link in der Adminleiste"
763
+
764
+ #: includes/settings-page.php:426
765
+ msgid "Show an icon in the Admin Menu"
766
+ msgstr "Zeige ein Symbol im Admin-Menü"
767
 
768
+ #: includes/settings-page.php:431
769
+ msgid "change will be visible after loading the next page"
770
  msgstr "(Änderungen werden sichtbar, nachdem die nächste Seite geladen wurde)"
771
 
772
+ #: includes/settings-page.php:436 includes/settings-page.php:482
773
+ msgid "Save Settings"
774
+ msgstr "Einstellungen speichern"
775
 
776
+ #: includes/settings-page.php:438 includes/settings-page.php:484
777
+ msgid "Go To Optimizer"
778
+ msgstr "Zur Optimierung"
779
+
780
+ #: includes/settings-page.php:445
781
  msgid ""
782
+ "EXCLUDE DATABASE TABLES FROM OPTIMIZATION:<br><span class=\"odb-underline-red"
783
  "\">CHECKED</span> TABLES <span class=\"odb-underline-red\">WON'T</span> BE "
784
  "OPTIMIZED!</span>"
785
  msgstr ""
787
  "\">MARKIERTE</span> TABELLEN WERDEN <span class=\"odb-underline-red\">NICHT</"
788
  "span> OPTIMIERT!</span>"
789
 
790
+ #: includes/settings-page.php:451
791
  msgid "check all tables"
792
  msgstr "alle Tabellen markieren"
793
 
794
+ #: includes/settings-page.php:453
795
  msgid "uncheck all tables"
796
  msgstr "alle Markierungen entfernen"
797
 
798
+ #: includes/settings-page.php:455
799
  msgid "check all NON-WordPress tables"
800
  msgstr "alle NICHT-WordPress-Tabellen markieren"
801
 
802
+ #: rvg-optimize-database.php:436 rvg-optimize-database.php:437
803
+ #: rvg-optimize-database.php:451 rvg-optimize-database.php:452
804
+ #: rvg-optimize-database.php:492 rvg-optimize-database.php:493
805
+ #: rvg-optimize-database.php:510 rvg-optimize-database.php:511
 
 
 
 
 
 
 
806
  msgid "Optimize Database"
807
  msgstr "Datenbank optimieren"
808
 
809
+ #: rvg-optimize-database.php:481
810
  msgid "Optimize DB (1 click)"
811
  msgstr "DB optimieren (1 Klick)"
812
 
813
+ #: rvg-optimize-database.php:629
814
+ #, fuzzy
815
+ #| msgid "Optimize Database after Deleting Revisions LOG FILE HAS BEEN DELETED"
816
+ msgid "Optimize Database after Deleting Revisions LOGS HAVE BEEN CLEARED"
817
+ msgstr ""
818
+ "Optimierung der Datenbank nach dem Löschen von Revisionen LOGS HAVE BEEN "
819
+ "CLEARED"
820
+
821
+ #: rvg-optimize-database.php:672
822
+ msgid "CLICK 'Start Optimization' TO ACTUALLY DELETE THE FOUND ITEMS"
823
+ msgstr ""
824
+ "KLICKEN Sie ' Optimierung starten ' um die GEFUNDENEN EINTRÄGE JETZT ZU "
825
+ "LÖSCHEN"
826
+
827
+ #: rvg-optimize-database.php:673
828
+ msgid "Cancel"
829
+ msgstr "Abbrechen"
830
+
831
+ #: rvg-optimize-database.php:677
832
+ msgid "Analysis Done!"
833
+ msgstr "Analyse abgeschlossen!"
834
+
835
+ msgid "NUMBER OF oEmbed RECORDS"
836
+ msgstr "Anzahl der oEmbed EINTRÄGE"
837
+
838
+ msgid "PLEASE DONATE!"
839
+ msgstr "Bitte Unterstützen Sie uns!"
840
+
841
+ msgid "POSTS only"
842
+ msgstr "Nur BEITRÄGE"
843
+
844
+ msgid "PAGES only"
845
+ msgstr "Nur SEITEN"
846
+
847
+ msgid "POSTS and PAGES"
848
+ msgstr "BEITRÄGE und SEITEN"
849
+
850
+ msgid "You have to enter the maximum number of revisions"
851
+ msgstr "Sie müssen die maximale Anzahl von Revisionen eingeben"
852
+
853
+ msgid "OR"
854
+ msgstr "ODER"
855
+
856
+ msgid "OPTIMIZING DATABASE TABLES"
857
+ msgstr "DATENBANK TABELLEN OPTIMIEREN"
858
+
859
+ msgid "<strong>TABLE OPTIMIZED</strong>"
860
+ msgstr "<strong>TABEL GEOPTIMALISEERD</strong>"
861
+
862
+ msgid "TABLE OPTIMIZED"
863
+ msgstr "TABEL GEOPTIMALISEERD"
864
+
865
+ msgid "TABLE OPTIMIZED!"
866
+ msgstr "TABEL GEOPTIMALISEERD!"
867
+
868
+ msgid ""
869
+ "<strong>WP Admin Panel</strong> &raquo; <strong>Tools</strong> &raquo; "
870
+ "<strong>Optimize Database</strong>. Then click the '<strong>Start "
871
+ "Optimization</strong>'-button. Et voila!"
872
  msgstr ""
873
+ "<strong>WP Admin Panel</strong> &raquo; <strong>Werkzeuge</strong> &raquo; "
874
+ "<strong>Datenbank Optimieren</strong>. Klicken Sie auf die Schaltfläche "
875
+ "\"<strong>Optimierung Starten</strong>\". Et voila!"
876
+
877
+ msgid "Note: if you use the Scheduler the Optimization will run automatically!"
878
+ msgstr ""
879
+ "Hinweis: Wenn Sie den Zeitplan verwenden, läuft die Optimierung automatisch!"
880
+
881
+ # @ rvg-optimize-database
882
+ msgid "Hello world!"
883
+ msgstr "Hallo Welt!"
884
+
885
+ #, fuzzy
886
+ #~| msgid "NUMBER OF POSTMETA ORPHANS DELETED"
887
+ #~ msgid "NUMBER OF oEmbed RECORDS DELETED"
888
+ #~ msgstr "Anzahl gelöschter verwaister Einträge in postmeta"
889
+
890
+ #, fuzzy
891
+ #~| msgid "No UNUSED TAGS found to delete"
892
+ #~ msgid "No oEmbed records found to delete"
893
+ #~ msgstr "keine unbenutzten Tags zum Löschen gefunden"
894
+
895
+ #~ msgid "NUMBER OF UNUSED TAGS DELETED"
896
+ #~ msgstr "gelöschte unbenutzte Tags"
897
+
898
+ #~ msgid "Delete Log File"
899
+ #~ msgstr "Log löschen"
900
+
901
+ #~ msgid "A WordPress Plugin by"
902
+ #~ msgstr "Ein WordPress Plugin von"
903
+
904
+ #~ msgid "The Netherlands"
905
+ #~ msgstr "Niederlande"
906
+
907
+ #~ msgid "time"
908
+ #~ msgstr "Zeit"
909
+
910
+ #~ msgid "current server time"
911
+ #~ msgstr "Aktuelle Serverzeit"
912
+
913
+ #, fuzzy
914
+ #~| msgid "total number of revisions deleted"
915
+ #~ msgid "Maximum number of revisions should be a number"
916
+ #~ msgstr "insgesamt gelöschte Revisionen"
917
+
918
+ #~ msgid ""
919
+ #~ "EXCLUDE DATABASE TABLES FROM OPTIMIZATION: <span class=\"odb-underline-red"
920
+ #~ "\">CHECKED</span> TABLES <span class=\"odb-underline-red\">WON'T</span> "
921
+ #~ "BE OPTIMIZED!</span>"
922
+ #~ msgstr ""
923
+ #~ "TABELLEN VON DER OPTIMIERUNG AUSSCHLIESSEN: <span class=\"odb-underline-"
924
+ #~ "red\">MARKIERTE</span> TABELLEN WERDEN <span class=\"odb-underline-red"
925
+ #~ "\">NICHT</span> OPTIMIERT!</span>"
926
+
927
+ #~ msgid "(change will be visible after loading the next page)"
928
+ #~ msgstr ""
929
+ #~ "(Änderungen werden sichtbar, nachdem die nächste Seite geladen wurde)"
930
+
931
+ #, fuzzy
932
+ #~| msgid ""
933
+ #~| "A popular 'one-click' plugin to clean and optimize your WordPress "
934
+ #~| "database."
935
+ #~ msgid ""
936
+ #~ "A popular one-click plugin to clean and optimize your WordPress database."
937
+ #~ msgstr ""
938
+ #~ "Eine populäre „Ein-Klick“-Erweiterung, um Ihre WordPress-Datenbank zu "
939
+ #~ "reinigen und zu optimieren."
940
+
941
+ #~ msgid ""
942
+ #~ "Maximum number of - most recent - revisions<br />to keep per post / page"
943
+ #~ msgstr "Maximal gespeicherte Anzahl<br />Revisionen pro Beitrag / Seite"
944
 
945
  #~ msgid ""
946
  #~ "Click <a href=\"tools.php?page=rvg-optimize-db.php\" class=\"odb-bold"
954
  #~ "ist ein 1-Klick Plugin zum Bereinigen und Optimieren der WordPress "
955
  #~ "Datenbank"
956
 
 
 
 
 
957
  #~ msgid "Optimize your WordPress Database"
958
  #~ msgstr "WordPress Datenbank optimieren"
959
 
968
 
969
  #~ msgid "Download URL:"
970
  #~ msgstr "Download URL:"
971
+
972
+ #, fuzzy
973
+ #~| msgid "Delete trashed items"
974
+ #~ msgid "Delete all trashed items"
975
+ #~ msgstr "Papierkorb leeren"
976
+
977
+ #, fuzzy
978
+ #~| msgid "Delete spammed items"
979
+ #~ msgid "Delete all spammed items"
980
+ #~ msgstr "Spam löschen"
981
+
982
+ #, fuzzy
983
+ #~| msgid "Optimize Database after Deleting Revisions"
984
+ #~ msgid "Using Optimize Database after Deleting Revisions"
985
+ #~ msgstr "Datenbank bereinigen und optimieren"
986
+
987
+ #, fuzzy
988
+ #~| msgid "Optimize Database after Deleting Revisions"
989
+ #~ msgid "Optimize Database after Deleting Revisions - Settings"
990
+ #~ msgstr "Datenbank bereinigen und optimieren"
991
+
992
+ #, fuzzy
993
+ #~| msgid "Start Optimization"
994
+ #~ msgid "Starting Optimization"
995
+ #~ msgstr "Optimierung starten"
996
+
997
+ #, fuzzy
998
+ #~| msgid "DELETED REVISIONS"
999
+ #~ msgid "DELETING REVISIONS"
1000
+ #~ msgstr "GELÖSCHTE REVISIONEN"
1001
+
1002
+ #, fuzzy
1003
+ #~| msgid "DELETED TRASHED ITEMS"
1004
+ #~ msgid "DELETING TRASHED ITEMS"
1005
+ #~ msgstr "Aus dem Papierkorb gelöscht"
1006
+
1007
+ #, fuzzy
1008
+ #~| msgid "DELETEED SPAMMED ITEMS"
1009
+ #~ msgid "DELETING SPAMMED ITEMS"
1010
+ #~ msgstr "Gelöschte Spambeiträge"
1011
+
1012
+ #, fuzzy
1013
+ #~| msgid "DONE!"
1014
+ #~ msgid "DONE"
1015
+ #~ msgstr "FERTIG!"
1016
+
1017
+ #, fuzzy
1018
+ #~| msgid "Optimize Database"
1019
+ #~ msgid "Optimize DB Options"
1020
+ #~ msgstr "Datenbank optimieren"
1021
+
1022
+ #, fuzzy
1023
+ #~| msgid "Optimize Database after Deleting Revisions SETTINGS UPDATED"
1024
+ #~ msgid "Optimize Database after Deleting Revisions OPTIONS UPDATED"
1025
+ #~ msgstr "Einstellungen aktualisiert"
1026
+
1027
+ #, fuzzy
1028
+ #~| msgid ""
1029
+ #~| "Click <a href=\"tools.php?page=rvg-optimize-db.php\" class=\"odb-bold"
1030
+ #~| "\">HERE</a> to run the optimization"
1031
+ #~ msgid ""
1032
+ #~ "Click <a href=\"tools.php?page=rvg-optimize-db.php\" style=\"font-weight:"
1033
+ #~ "bold\">HERE</a> to run the optimization"
1034
+ #~ msgstr ""
1035
+ #~ "<a href=\"tools.php?page=rvg-optimize-db.php\" class=\"odb-bold\">HIER</"
1036
+ #~ "a> klicken, um die Optimierung zu starten"
1037
+
1038
+ #, fuzzy
1039
+ #~| msgid "Start Optimization"
1040
+ #~ msgid "To start the optimization:"
1041
+ #~ msgstr "Optimierung starten"
1042
+
1043
+ #, fuzzy
1044
+ #~| msgid "Optimize Database after Deleting Revisions"
1045
+ #~ msgid "Optimize Database after Deleting Revisions - Options"
1046
+ #~ msgstr "Datenbank bereinigen und optimieren"
1047
+
1048
+ #, fuzzy
1049
+ #~| msgid ""
1050
+ #~| "EXCLUDE DATABASE TABLES FROM OPTIMIZATION: <span class=\"odb-underline-"
1051
+ #~| "red\">CHECKED</span> TABLES <span class=\"odb-underline-red\">WON'T</"
1052
+ #~| "span> BE OPTIMIZED!</span>"
1053
+ #~ msgid ""
1054
+ #~ "EXCLUDE DATABASE TABLES FROM OPTIMIZATION: <span style=\"text-decoration:"
1055
+ #~ "underline;color:#F00;\">CHECKED</span> TABLES <span style=\"text-"
1056
+ #~ "decoration:underline;color:#F00;\">WON'T</span> BE OPTIMIZED!</span>"
1057
+ #~ msgstr ""
1058
+ #~ "TABELLEN VON DER OPTIMIERUNG AUSSCHLIESSEN: <span class=\"odb-underline-"
1059
+ #~ "red\">MARKIERTE</span> TABELLEN WERDEN <span class=\"odb-underline-red"
1060
+ #~ "\">NICHT</span> OPTIMIERT!</span>"
1061
+
1062
+ #, fuzzy
1063
+ #~| msgid "Save Settings"
1064
+ #~ msgid "Save Options"
1065
+ #~ msgstr "Einstellungen speichern"
1066
+
1067
+ #, fuzzy
1068
+ #~| msgid "Current settings"
1069
+ #~ msgid "Current options"
1070
+ #~ msgstr "Aktuelle Einstellungen"
1071
+
1072
+ #, fuzzy
1073
+ #~| msgid "Change Settings"
1074
+ #~ msgid "Change Options"
1075
+ #~ msgstr "Einstellungen ändern"
readme.txt CHANGED
@@ -10,8 +10,8 @@ Contributors: cageehv
10
  Requires at least: 2.8
11
  Requires PHP: 5.0
12
  Tested up to: 5.0
13
- Stable tag: 4.7.2
14
- Version: 4.7.2
15
  License: GPLv2 or later
16
 
17
  == Description ==
@@ -70,7 +70,7 @@ Then, start the .php file from your crontab!<br>
70
  * Dutch [nl_NL] - translated by Rolf van Gelder, CAGE Web Design - http://cagewebdev.com
71
  * English [en_US] - translated by Rolf van Gelder, CAGE Web Design - http://cagewebdev.com
72
  * French [fr_FR] - translated by Guillaume Blet - http://www.mycinetheque.fr
73
- * German [de_DE] - translated by the.mnbvcx
74
  * Indonesian [id_ID] - translated by ChameleonJohn.com
75
  * Italian [it_IT] - translated by Fabio Marzocca
76
  * Persian [fa_IR] - translated by Milad Mordi, http://seodaramal.ir
@@ -111,6 +111,11 @@ http://cagewebdev.com/wordpress-plugins/
111
  * If you run the plugin from any of the sites, it will cleanup ALL the sites in the network!
112
 
113
  == Changelog ==
 
 
 
 
 
114
  = 4.7.2 [11/12/2018] =
115
  * BUG FIX: Fixed a MySQL query
116
 
10
  Requires at least: 2.8
11
  Requires PHP: 5.0
12
  Tested up to: 5.0
13
+ Stable tag: 4.7.3
14
+ Version: 4.7.3
15
  License: GPLv2 or later
16
 
17
  == Description ==
70
  * Dutch [nl_NL] - translated by Rolf van Gelder, CAGE Web Design - http://cagewebdev.com
71
  * English [en_US] - translated by Rolf van Gelder, CAGE Web Design - http://cagewebdev.com
72
  * French [fr_FR] - translated by Guillaume Blet - http://www.mycinetheque.fr
73
+ * German [de_DE] - translated by Kolja Spyra
74
  * Indonesian [id_ID] - translated by ChameleonJohn.com
75
  * Italian [it_IT] - translated by Fabio Marzocca
76
  * Persian [fa_IR] - translated by Milad Mordi, http://seodaramal.ir
111
  * If you run the plugin from any of the sites, it will cleanup ALL the sites in the network!
112
 
113
  == Changelog ==
114
+ = 4.7.3 [12/12/2018] =
115
+ * CHANGE: The deletion of transients has been fully rewritten and is many times faster now!
116
+ * CHANGE: Increased the time_limit
117
+ * CHANGE: German translations have been updated
118
+
119
  = 4.7.2 [11/12/2018] =
120
  * BUG FIX: Fixed a MySQL query
121
 
rvg-optimize-database.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package Optimize Database after Deleting Revisions
4
- * @version 4.7.2
5
  */
6
  /*
7
  Plugin Name: Optimize Database after Deleting Revisions
@@ -10,7 +10,7 @@ Description: Optimizes the Wordpress Database after Cleaning it out
10
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
11
  Author URI: http://cagewebdev.com
12
  Network: True
13
- Version: 4.7.2
14
  */
15
 
16
  /********************************************************************************************
@@ -18,14 +18,18 @@ Version: 4.7.2
18
  * MAIN CLASS
19
  *
20
  ********************************************************************************************/
 
 
 
 
21
  // CREATE INSTANCE
22
  global $odb_class;
23
  $odb_class = new OptimizeDatabase();
24
 
25
  class OptimizeDatabase {
26
  // VERSION
27
- var $odb_version = '4.7.2';
28
- var $odb_release_date = '11/12/2018';
29
 
30
  // PLUGIN OPTIONS
31
  var $odb_rvg_options = array();
@@ -666,7 +670,8 @@ class OptimizeDatabase {
666
  $this->odb_cleaner_obj->odb_savings($scheduler);
667
  }
668
  // SHOW 'DONE' PARAGRAPH
669
- if (!$scheduler && !$analyze) $this->odb_cleaner_obj->odb_done($analyze);
 
670
 
671
  if ($analyze) {
672
  $msg1 = __("CLICK 'Start Optimization' TO ACTUALLY DELETE THE FOUND ITEMS", $this->odb_txt_domain);
1
  <?php
2
  /**
3
  * @package Optimize Database after Deleting Revisions
4
+ * @version 4.7.3
5
  */
6
  /*
7
  Plugin Name: Optimize Database after Deleting Revisions
10
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
11
  Author URI: http://cagewebdev.com
12
  Network: True
13
+ Version: 4.7.3
14
  */
15
 
16
  /********************************************************************************************
18
  * MAIN CLASS
19
  *
20
  ********************************************************************************************/
21
+
22
+ // INCREASE THE TIME LIMIT v4.7.3
23
+ set_time_limit ( 4 * 3600 );
24
+
25
  // CREATE INSTANCE
26
  global $odb_class;
27
  $odb_class = new OptimizeDatabase();
28
 
29
  class OptimizeDatabase {
30
  // VERSION
31
+ var $odb_version = '4.7.3';
32
+ var $odb_release_date = '12/12/2018';
33
 
34
  // PLUGIN OPTIONS
35
  var $odb_rvg_options = array();
670
  $this->odb_cleaner_obj->odb_savings($scheduler);
671
  }
672
  // SHOW 'DONE' PARAGRAPH
673
+ if (!$scheduler && !$analyze)
674
+ $this->odb_cleaner_obj->odb_done($analyze);
675
 
676
  if ($analyze) {
677
  $msg1 = __("CLICK 'Start Optimization' TO ACTUALLY DELETE THE FOUND ITEMS", $this->odb_txt_domain);