Optimize Database after Deleting Revisions - Version 4.7.1

Version Description

[11/11/2018] = * BUG FIX: Fixed an 'undefined variable' notice

Download this release

Release Info

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

Code changes from version 4.6.3 to 4.7.1

classes/odb-cleaner.php CHANGED
@@ -16,23 +16,34 @@ class ODB_Cleaner {
16
  ********************************************************************************************/
17
  function __construct() {
18
  } // __construct()
19
-
20
 
21
  /********************************************************************************************
22
  * RUN CLEANER
23
  ********************************************************************************************/
24
- function odb_run_cleaner($scheduler) {
25
  global $odb_class;
26
 
27
  if(!$scheduler) {
28
- echo '
29
- <div id="odb-cleaner" class="odb-padding-left">
30
- <div class="odb-title-bar">
31
- <h2>'.__('Cleaning Database', $odb_class->odb_txt_domain).'</h2>
32
- </div>
33
- <br>
34
- <br>
35
- ';
 
 
 
 
 
 
 
 
 
 
 
36
  } // if(!$scheduler)
37
 
38
  // GET THE SIZE OF THE DATABASE BEFORE OPTIMIZATION
@@ -47,6 +58,7 @@ class ODB_Cleaner {
47
  $odb_class->log_arr["orphans"] = 0;
48
  $odb_class->log_arr["pingbacks"] = 0;
49
  $odb_class->log_arr["oembeds"] = 0;
 
50
  $odb_class->log_arr["revisions"] = 0;
51
  $odb_class->log_arr["savings"] = 0;
52
  $odb_class->log_arr["spam"] = 0;
@@ -74,31 +86,40 @@ class ODB_Cleaner {
74
  if(count($results_older_than) > 0 || count($results_keep_revisions) > 0) {
75
  // WE HAVE REVISIONS TO DELETE!
76
  if(!$scheduler) {
 
 
 
 
 
 
 
77
  ?>
78
  <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
79
  <tr>
80
- <td colspan="4"><div class="odb-found">
81
- <?php _e('DELETED REVISIONS','rvg-optimize-database');?>
82
- </div></td>
83
  </tr>
84
  <tr>
85
  <th align="right" class="odb-border-bottom">#</th>
86
  <th align="left" class="odb-border-bottom"><?php _e('prefix', $odb_class->odb_txt_domain);?></th>
87
  <th align="left" class="odb-border-bottom"><?php _e('post / page', $odb_class->odb_txt_domain);?></th>
88
  <th align="left" class="odb-border-bottom"><?php _e('revision date', $odb_class->odb_txt_domain);?></th>
89
- <th align="right" class="odb-border-bottom"><?php _e('revisions deleted', $odb_class->odb_txt_domain);?></th>
90
  </tr>
91
  <?php
92
  } // if(!$scheduler)
93
 
94
  // LOOP THROUGH THE REVISIONS AND DELETE THEM
95
- $total_deleted = $this->odb_delete_revisions($scheduler);
96
 
97
  if(!$scheduler) {
 
 
 
 
 
98
  ?>
99
  <tr>
100
- <td colspan="4" align="right" class="odb-border-top odb-bold"><?php _e('total number of revisions deleted', $odb_class->odb_txt_domain);?></td>
101
- <td align="right" class="odb-border-top odb-bold"><?php echo $total_deleted?></td>
102
  </tr>
103
  </table>
104
  <?php
@@ -123,17 +144,24 @@ class ODB_Cleaner {
123
  ****************************************************************************************/
124
  if($odb_class->odb_rvg_options['clear_trash'] == 'Y') {
125
  // GET TRASHED POSTS / PAGES AND COMMENTS
126
- $results = $this->odb_get_trash();
127
 
128
  $total_deleted = 0;
129
  if(count($results)>0) {
130
  // WE HAVE TRASH TO DELETE!
131
  if(!$scheduler) {
 
 
 
 
 
 
 
132
  ?>
133
  <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
134
  <tr>
135
  <td colspan="4"><div class="odb-found">
136
- <?php _e('DELETED TRASHED ITEMS', $odb_class->odb_txt_domain);?>
137
  </div></td>
138
  </tr>
139
  <tr>
@@ -147,13 +175,12 @@ class ODB_Cleaner {
147
  } // if(!$scheduler)
148
 
149
  // LOOP THROUGH THE TRASHED ITEMS AND DELETE THEM
150
- $total_deleted = $this->odb_delete_trash($results, $scheduler);
151
 
152
  if(!$scheduler) {
153
  ?>
154
  <tr>
155
- <td colspan="4" align="right" class="odb-border-top odb-bold"><?php _e('total number of trashed items deleted', $odb_class->odb_txt_domain);?></td>
156
- <td align="right" class="odb-border-top odb-bold"><?php echo $total_deleted?></td>
157
  </tr>
158
  </table>
159
  <?php
@@ -178,17 +205,24 @@ class ODB_Cleaner {
178
  ****************************************************************************************/
179
  if($odb_class->odb_rvg_options['clear_spam'] == 'Y') {
180
  // GET SPAMMED COMMENTS
181
- $results = $this->odb_get_spam();
182
 
183
  $total_deleted = 0;
184
  if(count($results)>0) {
185
  // WE HAVE SPAM TO DELETE!
186
  if (!$scheduler) {
 
 
 
 
 
 
 
187
  ?>
188
  <table border="0" cellspacing="8" cellpadding="2" class="odb-result-table">
189
  <tr>
190
  <td colspan="4"><div class="odb-found">
191
- <?php _e('DELETED SPAMMED ITEMS', $odb_class->odb_txt_domain);?>
192
  </div></td>
193
  </tr>
194
  <tr>
@@ -202,13 +236,12 @@ class ODB_Cleaner {
202
  } // if (!$scheduler)
203
 
204
  // LOOP THROUGH SPAMMED ITEMS AND DELETE THEM
205
- $total_deleted = $this->odb_delete_spam($results, $scheduler);
206
 
207
  if (!$scheduler) {
208
  ?>
209
  <tr>
210
- <td colspan="4" align="right" class="odb-border-top odb-bold"><?php _e('total number of spammed items deleted', $odb_class->odb_txt_domain);?></td>
211
- <td align="right" class="odb-border-top odb-bold"><?php echo $total_deleted?></td>
212
  </tr>
213
  </table>
214
  <?php
@@ -232,95 +265,194 @@ class ODB_Cleaner {
232
  * DELETE UNUSED TAGS
233
  ****************************************************************************************/
234
  if($odb_class->odb_rvg_options['clear_tags'] == 'Y') {
235
- // DELETE UNUSED TAGS
236
- $total_deleted = $this->odb_delete_tags();
237
- if($total_deleted > 0) {
238
- // TAGS DELETED
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  if (!$scheduler) {
240
  ?>
241
- <div class="odb-found-number">
242
- <?php _e('NUMBER OF UNUSED TAGS DELETED', $odb_class->odb_txt_domain);?>: <span class="odb-blue"><?php echo $total_deleted;?></span> </div>
 
 
243
  <?php
244
  } // if (!$scheduler)
245
  } else {
246
  if (!$scheduler) {
247
  ?>
248
  <div class="odb-not-found">
249
- <?php _e('No UNUSED TAGS found to delete', $odb_class->odb_txt_domain);?>
250
  </div>
251
  <?php
252
  } // if (!$scheduler)
253
  } // if(count($results)>0)
254
-
255
- // NUMBER OF tags DELETED FOR LOG FILE
256
- $odb_class->log_arr["tags"] = $total_deleted;
257
- } // if($odb_class->odb_rvg_options['clear_tags'] == 'Y')
258
 
259
 
260
  /****************************************************************************************
261
  * DELETE EXPIRED TRANSIENTS
262
  ****************************************************************************************/
263
  if($odb_class->odb_rvg_options['clear_transients'] != 'N') {
264
- // DELETE UNUSED TAGS
265
- $total_deleted = $this->odb_delete_transients();
266
- if($total_deleted > 0) {
267
- // TRANSIENTS DELETED
 
 
 
268
  if (!$scheduler) {
269
  if ($odb_class->odb_rvg_options['clear_transients'] == 'Y') {
270
- $msg = __('NUMBER OF EXPIRED TRANSIENTS DELETED', $odb_class->odb_txt_domain);
 
 
 
 
 
 
271
  } else {
272
- $msg = __('NUMBER OF TRANSIENTS DELETED', $odb_class->odb_txt_domain);
273
- }
 
 
 
 
 
 
274
  ?>
275
- <div class="odb-found-number">
276
- <?php echo $msg; ?>: <span class="odb-blue"><?php echo $total_deleted;?></span> </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  <?php
278
  } // if (!$scheduler)
279
- } else {
280
  if (!$scheduler) {
 
 
 
281
  if ($odb_class->odb_rvg_options['clear_transients'] == 'Y') {
282
  $msg = __('No EXPIRED TRANSIENTS found to delete', $odb_class->odb_txt_domain);
283
  } else {
284
  $msg = __('No TRANSIENTS found to delete', $odb_class->odb_txt_domain);
285
- }
286
- ?>
287
- <div class="odb-not-found">
288
- <?php echo $msg;?>
289
  </div>
290
  <?php
291
  } // if (!$scheduler)
292
  } // if(count($results)>0)
293
-
294
- // NUMBER OF transients DELETED FOR LOG FILE
295
  $odb_class->log_arr["transients"] = $total_deleted;
296
- } // if($odb_class->odb_rvg_options['clear_transients'] != 'N')
297
-
298
 
299
  /****************************************************************************************
300
  * DELETE PINGBACKS AND TRACKBACKS
301
  ****************************************************************************************/
302
  if($odb_class->odb_rvg_options['clear_pingbacks'] == 'Y') {
303
- // DELETE PINGBACKS AND TRACKBACKS
304
- $total_deleted = $this->odb_delete_pingbacks();
305
- if($total_deleted > 0) {
306
- // PINGBACKS / TRACKBACKS DELETED\
307
- if (!$scheduler) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  ?>
309
- <div class="odb-found-number">
310
- <?php _e('NUMBER OF PINGBACKS AND TRACKBACKS DELETED', $odb_class->odb_txt_domain);?>: <span class="odb-blue"><?php echo $total_deleted;?></span> </div>
 
 
311
  <?php
312
- } // if (!$scheduler)
313
  } else {
314
- if (!$scheduler) {
315
  ?>
316
  <div class="odb-not-found">
317
  <?php _e('No PINGBACKS nor TRACKBACKS found to delete', $odb_class->odb_txt_domain);?>
318
  </div>
319
  <?php
320
- } // if (!$scheduler)
321
  } // if(count($results)>0)
322
-
323
- // NUMBER OF pingbacks / trackbacks DELETED (FOR LOG FILE)
324
  $odb_class->log_arr["pingbacks"] = $total_deleted;
325
  } // if($odb_class->odb_rvg_options['clear_pingbacks'] == 'Y')
326
 
@@ -329,59 +461,135 @@ class ODB_Cleaner {
329
  * DELETE OEMBED CACHE
330
  ****************************************************************************************/
331
  if($odb_class->odb_rvg_options['clear_oembed'] == 'Y') {
332
- // DELETE OEMBED CACHE
333
- $total_deleted = $this->odb_delete_oembed();
334
- if($total_deleted > 0) {
335
- // OEMBED CACHE CLEARED
336
- if (!$scheduler) {
 
 
 
 
 
 
 
 
 
 
337
  ?>
338
- <div class="odb-found-number">
339
- <?php _e('NUMBER OF oEmbed RECORDS DELETED', $odb_class->odb_txt_domain);?>: <span class="odb-blue"><?php echo $total_deleted;?></span> </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  <?php
341
- } // if (!$scheduler)
342
  } else {
343
- if (!$scheduler) {
344
  ?>
345
  <div class="odb-not-found">
346
- <?php _e('No oEmbed records found to delete', $odb_class->odb_txt_domain);?>
347
  </div>
348
  <?php
349
- } // if (!$scheduler)
350
  } // if(count($results)>0)
351
-
352
- // NUMBER OF OEMBED RECORDS DELETED (FOR LOG FILE)
353
- $odb_class->log_arr["oembeds"] = $total_deleted;
354
  } // if($odb_class->odb_rvg_options['clear_oembed'] == 'Y')
355
 
356
 
357
  /****************************************************************************************
358
  * DELETE ORPHANS
359
- ****************************************************************************************/
360
- $total_deleted = $this->odb_delete_orphans();
361
- if($total_deleted > 0) {
362
- if (!$scheduler) {
363
- ?>
364
- <div class="odb-found-number">
365
- <?php _e('NUMBER OF POSTMETA ORPHANS DELETED', $odb_class->odb_txt_domain);?>: <span class="odb-blue"><?php echo $total_deleted;?></span> </div>
366
- <?php
367
- } // if (!$scheduler)
368
- } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369
  if (!$scheduler) {
370
- ?>
371
- <div class="odb-not-found">
372
- <?php _e('No POSTMETA ORPHANS found to delete', $odb_class->odb_txt_domain);?>
373
- </div>
374
- <?php
375
  } // if (!$scheduler)
376
- } // if($total_deleted > 0)
377
- // FOR LOG FILE
378
- $odb_class->log_arr["orphans"] = $total_deleted;
379
-
380
- if (!$scheduler) {
381
- ?>
382
- </div><!-- /odb-cleaner -->
383
- <?php
384
- } // if (!$scheduler)
385
  } // odb_run_cleaner()
386
 
387
 
@@ -488,7 +696,7 @@ class ODB_Cleaner {
488
  /********************************************************************************************
489
  * SHOW LOADING TIME
490
  ********************************************************************************************/
491
- function odb_done() {
492
  global $odb_class;
493
 
494
  $time = microtime();
@@ -506,7 +714,17 @@ class ODB_Cleaner {
506
  </div>
507
  <br>
508
  <br>
 
 
 
 
 
 
 
509
  <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>
 
 
 
510
  <?php
511
  // v4.5.1
512
  $odb_class->odb_last_run_seconds = $total_time;
@@ -570,9 +788,14 @@ function odb_confirm_delete() {
570
 
571
  // LOOP THROUGH THE SITES (IF MULTI SITE)
572
  for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
 
573
 
574
  $sql = sprintf("
575
- SELECT p1.`ID`, p1.`post_parent`, p1.`post_title`, p1.`post_modified`
 
 
 
 
576
  FROM %sposts p1, %sposts p2
577
  WHERE p1.`post_type` = 'revision'
578
  AND p1.`post_parent` = p2.ID
@@ -580,8 +803,9 @@ function odb_confirm_delete() {
580
  AND p1.`post_modified` < date_sub(now(), INTERVAL %d DAY)
581
  ORDER BY UCASE(p1.`post_title`)
582
  ",
583
- $odb_class->odb_ms_prefixes[$i],
584
- $odb_class->odb_ms_prefixes[$i],
 
585
  $where,
586
  $older_than);
587
 
@@ -591,8 +815,7 @@ function odb_confirm_delete() {
591
 
592
  for($j=0; $j<count($res); $j++) {
593
  if(isset($res[$j]) && !$this->odb_post_is_excluded($res[$j]['post_parent'])) {
594
- $res_arr[$index] = $res[$j];
595
- $res_arr[$index]['site'] = $odb_class->odb_ms_prefixes[$i];
596
  $index++;
597
  } // if(isset($res[$j]) && !$this->odb_post_is_excluded($res[$j]['post_parent']))
598
  } // for($j=0; $j<count($res); $j++)
@@ -642,9 +865,11 @@ function odb_confirm_delete() {
642
  }
643
 
644
  for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
 
645
 
646
  $sql = sprintf ("
647
- SELECT p1.`ID`, p1.`post_parent`, p1.`post_title`, COUNT(*) cnt
 
648
  FROM %sposts p1, %sposts p2
649
  WHERE p1.`post_type` = 'revision'
650
  AND p1.`post_parent` = p2.ID
@@ -654,8 +879,9 @@ function odb_confirm_delete() {
654
  HAVING COUNT(*) > %d
655
  ORDER BY UCASE(p1.`post_title`)
656
  ",
657
- $odb_class->odb_ms_prefixes[$i],
658
- $odb_class->odb_ms_prefixes[$i],
 
659
  $where1,
660
  $where2,
661
  $max_revisions);
@@ -666,7 +892,6 @@ function odb_confirm_delete() {
666
  for($j=0; $j<count($res); $j++) {
667
  if(isset($res[$j]) && !$this->odb_post_is_excluded($res[$j]['post_parent'])) {
668
  $res_arr[$index] = $res[$j];
669
- $res_arr[$index]['site'] = $odb_class->odb_ms_prefixes[$i];
670
  $index++;
671
  }
672
  } // for($j=0; $j<count($res); $j++)
@@ -679,7 +904,7 @@ function odb_confirm_delete() {
679
  /********************************************************************************************
680
  * DELETE THE REVISIONS
681
  ********************************************************************************************/
682
- function odb_delete_revisions($scheduler) {
683
  global $odb_class, $wpdb;
684
 
685
  $total_deleted = 0;
@@ -701,12 +926,14 @@ function odb_confirm_delete() {
701
  <td valign="top" class="odb-bold"><?php echo $results[$i]['post_modified']?></td><?php
702
  } // if (!$scheduler)
703
 
704
- $sql_delete = sprintf ("
705
- DELETE FROM %sposts
706
- WHERE `ID` = %d
707
- ", $results[$i]['site'], $results[$i]['ID']);
708
-
709
- $wpdb->get_results($sql_delete);
 
 
710
 
711
  $nr++;
712
  if(!$scheduler) {
@@ -748,13 +975,14 @@ function odb_confirm_delete() {
748
 
749
  for($j=0; $j<$nr_to_delete; $j++) {
750
  if(!$scheduler) echo $results_get_posts[$j]->post_modified.'<br>';
751
-
752
- $sql_delete = sprintf ("
753
- DELETE FROM %sposts
754
- WHERE `ID` = %d
755
- ", $results[$i]['site'], $results_get_posts[$j]->ID);
756
-
757
- $wpdb->get_results($sql_delete);
 
758
  } // for($j=0; $j<$nr_to_delete; $j++)
759
 
760
  $nr++;
@@ -783,7 +1011,7 @@ function odb_confirm_delete() {
783
  /********************************************************************************************
784
  * GET TRASHED POSTS / PAGES AND COMMENTS
785
  ********************************************************************************************/
786
- function odb_get_trash() {
787
  global $wpdb, $odb_class;
788
 
789
  $res_arr = array();
@@ -791,21 +1019,31 @@ function odb_confirm_delete() {
791
  $index = 0;
792
  // LOOP TROUGH SITES
793
  for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
 
 
794
  $sql = sprintf ("
795
- SELECT `ID` AS id, 'post' AS post_type, `post_title` AS title, `post_modified` AS modified
 
 
 
 
796
  FROM %sposts
797
  WHERE `post_status` = 'trash'
798
  UNION ALL
799
- SELECT `comment_ID` AS id, 'comment' AS post_type, `comment_author_IP` AS title, `comment_date` AS modified
 
 
 
 
800
  FROM %scomments
801
  WHERE `comment_approved` = 'trash'
802
  ORDER BY post_type, UCASE(title)
803
- ", $odb_class->odb_ms_prefixes[$i], $odb_class->odb_ms_prefixes[$i]);
 
804
  $res = $wpdb->get_results($sql, ARRAY_A);
805
 
806
  if($res != null) {
807
- $res_arr[$index] = $res[0];
808
- $res_arr[$index]['site'] = $odb_class->odb_ms_prefixes[$i];
809
  $index++;
810
  } // if($res != null)
811
  } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
@@ -817,7 +1055,7 @@ function odb_confirm_delete() {
817
  /********************************************************************************************
818
  * DELETE TRASHED POSTS AND PAGES
819
  ********************************************************************************************/
820
- function odb_delete_trash($results, $scheduler) {
821
  global $wpdb;
822
 
823
  $nr = 1;
@@ -838,26 +1076,30 @@ function odb_confirm_delete() {
838
 
839
  if($results[$i]['post_type'] == 'comment') {
840
  // DELETE META DATA (IF ANY...)
841
- $sql_delete = sprintf ("
842
- DELETE FROM %scommentmeta
843
- WHERE `comment_id` = %d
844
- ", $results[$i]['site'], $results[$i]['id']);
845
- $wpdb->get_results($sql_delete);
 
 
846
  } // if($results[$i]['post_type'] == 'comment')
847
 
848
- // DELETE TRASHED POSTS / PAGES
849
- $sql_delete = sprintf ("
850
- DELETE FROM %sposts
851
- WHERE `post_status` = 'trash'
852
- ", $results[$i]['site']);
853
- $wpdb->get_results($sql_delete);
854
-
855
- // DELETE TRASHED COMMENTS
856
- $sql_delete = sprintf ("
857
- DELETE FROM %scomments
858
- WHERE `comment_approved` = 'trash'
859
- ", $results[$i]['site']);
860
- $wpdb->get_results($sql_delete);
 
 
861
 
862
  $nr++;
863
  } // for($i=0; $i<count($results); $i++)
@@ -869,29 +1111,32 @@ function odb_confirm_delete() {
869
  /********************************************************************************************
870
  * GET SPAMMED COMMENTS
871
  ********************************************************************************************/
872
- function odb_get_spam() {
873
  global $wpdb, $odb_class;
874
 
875
  $res_arr = array();
876
-
877
- $index = 0;
878
  // LOOP THROUGH SITES
879
  for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
 
 
880
  $sql = sprintf ("
881
- SELECT `comment_ID`, `comment_author`, `comment_author_email`, `comment_date`
 
 
 
 
882
  FROM %scomments
883
  WHERE `comment_approved` = 'spam'
884
  ORDER BY UCASE(`comment_author`)
885
- ", $odb_class->odb_ms_prefixes[$i]);
 
886
  $res = $wpdb->get_results($sql, ARRAY_A);
887
 
888
- if($res != null) {
889
- $res_arr[$index] = $res[0];
890
- $res_arr[$index]['site'] = $odb_class->odb_ms_prefixes[$i];
891
- $index++;
892
- } // if($res != null)
893
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
894
-
895
  return $res_arr;
896
  } // odb_get_spam()
897
 
@@ -899,8 +1144,7 @@ function odb_confirm_delete() {
899
  /********************************************************************************************
900
  * DELETE SPAMMED ITEMS
901
  ********************************************************************************************/
902
- function odb_delete_spam($results, $scheduler)
903
- {
904
  global $wpdb;
905
 
906
  $nr = 1;
@@ -918,17 +1162,19 @@ function odb_confirm_delete() {
918
  <?php
919
  } // if (!$scheduler)
920
 
921
- $sql_delete = sprintf ("
922
- DELETE FROM %scommentmeta
923
- WHERE `comment_id` = %d
924
- ", $results[$i]['site'], $results[$i]['comment_ID']);
925
- $wpdb->get_results($sql_delete);
926
-
927
- $sql_delete = sprintf ("
928
- DELETE FROM %scomments
929
- WHERE `comment_approved` = 'spam'
930
- ", $results[$i]['site']);
931
- $wpdb->get_results($sql_delete);
 
 
932
 
933
  $nr++;
934
  } // for($i=0; $i<count($results); $i++)
@@ -938,17 +1184,20 @@ function odb_confirm_delete() {
938
 
939
 
940
  /********************************************************************************************
941
- * DELETE UNUSED TAGS
942
  ********************************************************************************************/
943
- function odb_delete_tags() {
944
- global $wpdb, $odb_class;
945
-
946
- $total_deleted = 0;
947
 
948
- // LOOP THROUGH THE NETWORK
949
  for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
 
 
950
  $sql = sprintf ("
951
- SELECT a.term_id AS term_id, a.name AS name
 
952
  FROM `%sterms` a, `%sterm_taxonomy` b
953
  WHERE a.term_id = b.term_id
954
  AND b.taxonomy = 'post_tag'
@@ -956,31 +1205,57 @@ function odb_confirm_delete() {
956
  SELECT term_taxonomy_id
957
  FROM %sterm_relationships
958
  )
959
- ", $odb_class->odb_ms_prefixes[$i], $odb_class->odb_ms_prefixes[$i], $odb_class->odb_ms_prefixes[$i]);
960
-
961
- $res = $wpdb->get_results($sql);
962
- for($j=0; $j<count($res); $j++) {
963
- if(!$this->odb_delete_tags_is_scheduled($res[$j]->term_id, $odb_class->odb_ms_prefixes[$i])) {
964
- // TAG NOT USED IN SCHEDULED POSTS: CAN BE DELETED
965
- $total_deleted++;
966
-
967
- $sql_del = sprintf ("
968
- DELETE FROM %sterm_taxonomy
969
- WHERE term_id = %d
970
- ", $odb_class->odb_ms_prefixes[$i], $res[$j]->term_id);
971
- $wpdb->get_results($sql_del);
972
-
973
- $sql_del = sprintf ("
974
- DELETE FROM %sterms
975
- WHERE term_id = %d
976
- ", $odb_class->odb_ms_prefixes[$i], $res[$j]->term_id);
977
- $wpdb->get_results($sql_del);
978
- }
979
- } // for($j=0; $j<count($res); $j++)
980
  } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
981
 
982
  return $total_deleted;
983
- } // odb_delete_tags()
984
 
985
 
986
  /********************************************************************************************
@@ -1007,234 +1282,353 @@ function odb_confirm_delete() {
1007
  /********************************************************************************************
1008
  * DELETE TRANSIENTS (v4.3.1)
1009
  ********************************************************************************************/
1010
- function odb_delete_transients() {
1011
  global $wpdb, $odb_class;
1012
 
1013
- $total_deleted = 0;
1014
 
1015
- if ($odb_class->odb_rvg_options['clear_transients'] == 'Y') {
1016
- // ONLY DELETE EXPIRED TRANSIENTS
1017
-
1018
- $delay = time() - 60; // ONE MINUTE DELAY
 
1019
 
1020
- // LOOP THROUGH THE NETWORK
1021
- for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1022
- // FIND EXPIRED TRANSIENTS
1023
- $sql = "
1024
- SELECT `option_name`
1025
- FROM ".$odb_class->odb_ms_prefixes[$i]."options
1026
- WHERE (
1027
- option_name LIKE '_transient_timeout_%'
1028
- OR option_name LIKE '_site_transient_timeout_%'
1029
- )
1030
- AND option_value < '".$delay."'
1031
- ";
1032
-
1033
- $results = $wpdb->get_results($sql);
1034
- $total_deleted += count($results);
1035
-
1036
- // LOOP THROUGH THE RESULTS
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1037
  for($j=0; $j<count($results); $j++) {
1038
- if(substr($results[$j]->option_name, 0, 19) == '_transient_timeout_') {
1039
  // _transient_timeout_%
1040
- $transient = substr($results[$j]->option_name, 19);
1041
  // DELETE THE TRANSIENT
1042
  delete_transient($transient);
1043
  } else {
1044
  // _site_transient_timeout_%
1045
- $transient = substr($results[$j]->option_name, 24);
1046
  // DELETE THE TRANSIENT
1047
- delete_site_transient($transient);
1048
  } // if(substr($results[$j]->option_name, 0, 19) == '_transient_timeout_')
1049
  } // for($j=0; $j<count($results); $j++)
1050
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1051
- } else {
1052
- // DELETE ALL TRANSIENTS
1053
-
1054
- // LOOP THROUGH THE NETWORK
1055
- for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1056
- // FIND EXPIRED TRANSIENTS
1057
- $sql = "
1058
- SELECT `option_name`
1059
- FROM ".$odb_class->odb_ms_prefixes[$i]."options
1060
- WHERE option_name LIKE '%_transient_%'
1061
- ";
1062
-
1063
- $results = $wpdb->get_results($sql);
1064
- $total_deleted += count($results);
1065
-
1066
- // LOOP THROUGH THE RESULTS
1067
- for($j=0; $j<count($results); $j++) {
1068
- delete_option($results[$j]->option_name);
1069
- } // for($j=0; $j<count($results); $j++)
1070
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
1071
- } // if ($odb_class->odb_rvg_options['clear_transients'] == 'Y')
1072
 
1073
  return $total_deleted;
1074
-
1075
  } // odb_delete_transients()
1076
 
1077
 
1078
  /********************************************************************************************
1079
- * DELETE PINGBACKS AND TRACKBACKS
1080
  ********************************************************************************************/
1081
- function odb_delete_pingbacks() {
 
1082
  global $wpdb, $odb_class;
 
 
1083
 
1084
- $total_deleted = 0;
1085
-
1086
- // LOOP THROUGH THE NETWORK
1087
  for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
 
 
1088
  $sql = sprintf ("
1089
- SELECT `comment_ID`
 
 
 
 
1090
  FROM %scomments
1091
  WHERE (
1092
- `comment_type` = 'pingback'
1093
- OR `comment_type` = 'trackback'
1094
  )
1095
- ", $odb_class->odb_ms_prefixes[$i]);
1096
-
1097
- $results = $wpdb->get_results($sql);
1098
- $total_deleted = count($results);
1099
-
1100
- for($j=0; $j<count($results); $j++) {
1101
- // DELETE METADATA FOR THIS COMMENT (IF ANY)
1102
- $sql_delete_meta = sprintf ("
1103
- DELETE FROM %scommentmeta
1104
- WHERE `comment_id` = %d
1105
- ", $odb_class->odb_ms_prefixes[$i], $results[$j]->comment_ID);
1106
- $wpdb->get_results($sql_delete_meta);
1107
- }
1108
 
1109
- // DELETE COMMENTS
1110
- $sql_delete_comments = sprintf ("
1111
- DELETE FROM %scomments
1112
- WHERE (
1113
- `comment_type` = 'pingback'
1114
- OR `comment_type` = 'trackback'
1115
- )
1116
- ", $odb_class->odb_ms_prefixes[$i]);
1117
- $wpdb->get_results($sql_delete_comments);
1118
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1119
 
 
 
 
1120
  return $total_deleted;
1121
  } // odb_delete_pingbacks()
1122
 
1123
 
1124
  /********************************************************************************************
1125
- * CLEAR OEMBED CACHE
1126
  ********************************************************************************************/
1127
- function odb_delete_oembed() {
1128
  global $wpdb, $odb_class;
 
 
1129
 
1130
- $total_deleted = 0;
1131
-
1132
- // LOOP THROUGH THE NETWORK
1133
  for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1134
-
1135
- //SELECT * FROM `cage2016_postmeta` WHERE `meta_value` LIKE '_OEMBED_%'
1136
- // SELECT * FROM `cage2016_postmeta` WHERE `meta_key` LIKE '_oembed_%'
1137
 
1138
  $sql = sprintf ("
1139
- SELECT `meta_id`
 
 
 
1140
  FROM %spostmeta
1141
  WHERE `meta_key` LIKE '_oembed_%%'
1142
- ", $odb_class->odb_ms_prefixes[$i]);
1143
-
1144
- $results = $wpdb->get_results($sql);
1145
- $total_deleted = count($results);
1146
 
1147
- // DELETE COMMENTS
1148
- $sql_delete_comments = sprintf ("
1149
- DELETE FROM %spostmeta
1150
- WHERE `meta_key` LIKE '_oembed_%%'
1151
- ", $odb_class->odb_ms_prefixes[$i]);
1152
- $wpdb->get_results($sql_delete_comments);
1153
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1154
 
 
 
 
1155
  return $total_deleted;
1156
  } // odb_delete_oembed()
1157
 
1158
 
1159
  /********************************************************************************************
1160
- * DELETE ORPHAN POSTMETA AND MEDIA RECORDS
1161
  ********************************************************************************************/
1162
- function odb_delete_orphans() {
1163
  global $wpdb, $odb_class;
1164
-
1165
- $meta_orphans = 0;
1166
- $post_orphans = 0;
1167
- $media_orphans = 0; // v4.1.7
1168
-
1169
- // LOOP THROUGH THE NETWORK
1170
  for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
1171
- // DELETE POST ORPHANS (AUTO DRAFTS)
1172
- $sql_delete = sprintf ("
1173
- SELECT COUNT(*) cnt
 
 
 
 
 
 
 
1174
  FROM %sposts
1175
  WHERE ID NOT IN (SELECT post_id FROM %spostmeta)
1176
  AND post_status = 'auto-draft'
1177
- ", $odb_class->odb_ms_prefixes[$i], $odb_class->odb_ms_prefixes[$i]);
1178
-
1179
- $results = $wpdb->get_results($sql_delete);
1180
-
1181
- $post_orphans = $results[0]->cnt;
1182
-
1183
- if($post_orphans > 0) {
1184
- $sql_delete = sprintf ("
1185
- DELETE FROM %sposts
1186
- WHERE ID NOT IN (SELECT post_id FROM %spostmeta)
1187
- AND post_status = 'auto-draft'
1188
- ", $odb_class->odb_ms_prefixes[$i], $odb_class->odb_ms_prefixes[$i]);
1189
- $wpdb->get_results($sql_delete);
1190
- }
1191
 
1192
  // DELETE POSTMETA ORPHANS
1193
- $sql_delete = sprintf ("
1194
- SELECT COUNT(*) cnt
 
 
 
 
1195
  FROM %spostmeta
1196
  WHERE post_id NOT IN (SELECT ID FROM %sposts)
1197
- ", $odb_class->odb_ms_prefixes[$i], $odb_class->odb_ms_prefixes[$i]);
1198
-
1199
- $results = $wpdb->get_results($sql_delete);
1200
-
1201
- $meta_orphans = $results[0]->cnt;
1202
-
1203
- if($meta_orphans > 0) {
1204
- $sql_delete = sprintf ("
1205
- DELETE FROM %spostmeta
1206
- WHERE post_id NOT IN (SELECT ID FROM %sposts)
1207
- ", $odb_class->odb_ms_prefixes[$i], $odb_class->odb_ms_prefixes[$i]);
1208
- $wpdb->get_results($sql_delete);
1209
- }
1210
- /*
1211
- // DELETE MEDIA ORPHANS (v4.1.7)
1212
- $sql_delete = sprintf ("
1213
- SELECT `ID`
1214
- FROM %sposts
1215
- WHERE `post_type` = 'attachment'
1216
- AND `post_mime_type` LIKE 'image/%%'
1217
- AND `post_parent` != 0
1218
- AND `post_parent` NOT IN (SELECT `ID` FROM %sposts)
1219
- ", $odb_class->odb_ms_prefixes[$i], $odb_class->odb_ms_prefixes[$i]);
1220
-
1221
- $results = $wpdb->get_results($sql_delete);
1222
- $media_orphans = count($results);
1223
-
1224
- if($media_orphans > 0)
1225
- { for ($j=0; $j<$media_orphans; $j++)
1226
- { $sql_delete = sprintf("
1227
- DELETE FROM %sposts WHERE `ID` = %d
1228
- ", $odb_class->odb_ms_prefixes[$i], $results[$j]->ID);
1229
-
1230
- $wpdb->get_results($sql_delete);
1231
- } // for ($j=0; $j<count($results); $j++)
1232
- } // if($media_orphans > 0)
1233
- */
1234
 
1235
- } // for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1236
 
1237
- return ($meta_orphans + $post_orphans);
1238
  } // odb_delete_orphans()
1239
 
1240
 
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
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;
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
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>
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
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>
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
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
 
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
 
696
  /********************************************************************************************
697
  * SHOW LOADING TIME
698
  ********************************************************************************************/
699
+ function odb_done($analyze = false) {
700
  global $odb_class;
701
 
702
  $time = microtime();
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;
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
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
 
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++)
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
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);
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++)
904
  /********************************************************************************************
905
  * DELETE THE REVISIONS
906
  ********************************************************************************************/
907
+ function odb_delete_revisions($scheduler, $analyzing = false) {
908
  global $odb_class, $wpdb;
909
 
910
  $total_deleted = 0;
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) {
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++;
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();
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++)
1055
  /********************************************************************************************
1056
  * DELETE TRASHED POSTS AND PAGES
1057
  ********************************************************************************************/
1058
+ function odb_delete_trash($results, $scheduler, $analyzing) {
1059
  global $wpdb;
1060
 
1061
  $nr = 1;
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++)
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
 
1144
  /********************************************************************************************
1145
  * DELETE SPAMMED ITEMS
1146
  ********************************************************************************************/
1147
+ function odb_delete_spam($results, $scheduler, $analyzing = false) {
 
1148
  global $wpdb;
1149
 
1150
  $nr = 1;
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++)
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'
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
  /********************************************************************************************
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
 
classes/odb-displayer.php CHANGED
@@ -220,7 +220,10 @@ function odb_confirm_delete() {
220
  } // if($odb_class->odb_logger_obj->odb_log_count() > 0)
221
 
222
  echo '
223
- &nbsp;<input class="button-primary button-large" type="button" name="start_optimization" value="'.__('Start Optimization', $odb_class->odb_txt_domain).'" onclick="self.location=\'tools.php?page=rvg-optimize-database&action=run\'" class="odb-bold" />
 
 
 
224
  ';
225
  } // if($odb_class->odb_logger_obj->odb_log_count() > 0)
226
 
220
  } // if($odb_class->odb_logger_obj->odb_log_count() > 0)
221
 
222
  echo '
223
+ &nbsp;
224
+ <input class="button-primary button-large" type="button" name="analyze" value="'.__('Analyze Database', $odb_class->odb_txt_domain).'" onclick="self.location=\'tools.php?page=rvg-optimize-database&action=analyze\'" class="odb-bold">
225
+ &nbsp;
226
+ &nbsp;<input class="button-primary button-large" type="button" name="start_optimization" value="'.__('Start Optimization', $odb_class->odb_txt_domain).'" onclick="self.location=\'tools.php?page=rvg-optimize-database&action=run\'" class="odb-bold">
227
  ';
228
  } // if($odb_class->odb_logger_obj->odb_log_count() > 0)
229
 
css/style.css CHANGED
@@ -34,6 +34,9 @@
34
  /*color: #00F;*/
35
  color: #0074a2;
36
  }
 
 
 
37
  /* v4.1.9: RUNNING INDICATOR ADDED */
38
  #odb-running {
39
  background: rgba(0,0,0,.08) url('../images/running.gif') no-repeat 50% 50%;
34
  /*color: #00F;*/
35
  color: #0074a2;
36
  }
37
+ .odb-red {
38
+ color: #C30;
39
+ }
40
  /* v4.1.9: RUNNING INDICATOR ADDED */
41
  #odb-running {
42
  background: rgba(0,0,0,.08) url('../images/running.gif') no-repeat 50% 50%;
css/style.min.css CHANGED
@@ -1 +1 @@
1
- @charset "utf-8";.odb-title-bar{width:96%;background-color:#0074a2;color:#fff!important;display:inline-block;padding-left:16px;margin-top:30px}.odb-title-bar h2{color:#fff}.odb-subheader-container{width:96%}.odb-subheader-left{float:left}.odb-subheader-right{float:right;margin-top:20px}.odb-bold{font-weight:900}.odb-normal{font-weight:400}.odb-italic{font-style:italic}.odb-blue{color:#0074a2}#odb-running{background:rgba(0,0,0,.08) url(../images/running.gif) no-repeat 50% 50%;width:100%;height:100%;position:fixed;top:0;left:0;z-index:999}.odb-action{font-size:13px;font-weight:700;color:#000}.odb-wp-table{font-weight:700;color:#0074a2}.odb-padding-left{padding-left:8px}.odb-border-bottom{border-bottom:solid 1px #999}.odb-border-top{border-top:solid 1px #999}.odb-optimizing-table{margin-top:16px}.odb-optimized{color:#0074a2;font-weight:700}.odb-underline-red{text-decoration:underline;color:red}.odb-updated{position:relative;left:-15px}.odb-found{font-size:13px;font-weight:700;color:#000}.odb-found-number{margin-left:8px;margin-bottom:18px;font-size:13px;font-weight:700;color:#000}.odb-result-table{background-color:#e8e8e8;margin-bottom:20px}.odb-not-found{margin-left:8px;margin-bottom:16px;color:#999}.odb-post-type-select{font-size:inherit}.odb-schedule-select{font-size:inherit;padding:0;margin:0}.odb-schedulehour{display:none}.odb-schedulehour-select{font-size:inherit}.odb-table-excludes{margin-top:10px;border:solid 1px #ccc;padding:10px}.odb-table-excludes td{padding:3px}#odb-options-tables-container{text-align:center}#odb-options-tables-wrapper{width:97%;display:inline-block;margin-top:16px;margin-left:-16px;padding:8px 0 8px 0}.odb-options-table{background-color:#f0f0f0;display:inline-block;height:17px;margin:3px;border:solid 1px #e0e0e0;overflow:hidden;padding:2px;text-align:left;white-space:nowrap;width:200px}.odb-log-table{font-size:13px}.odb-log-table th{border-top:solid 1px #000;border-bottom:solid 1px #000}.odb-log-table td{padding-bottom:4px;border-bottom:dotted 1px #ccc}
1
+ @charset "utf-8";.odb-title-bar{width:96%;background-color:#0074a2;color:#fff!important;display:inline-block;padding-left:16px;margin-top:30px}.odb-title-bar h2{color:#fff}.odb-subheader-container{width:96%}.odb-subheader-left{float:left}.odb-subheader-right{float:right;margin-top:20px}.odb-bold{font-weight:900}.odb-normal{font-weight:400}.odb-italic{font-style:italic}.odb-blue{color:#0074a2}.odb-red{color:#c30}#odb-running{background:rgba(0,0,0,.08) url(../images/running.gif) no-repeat 50% 50%;width:100%;height:100%;position:fixed;top:0;left:0;z-index:999}.odb-action{font-size:13px;font-weight:700;color:#000}.odb-wp-table{font-weight:700;color:#0074a2}.odb-padding-left{padding-left:8px}.odb-border-bottom{border-bottom:solid 1px #999}.odb-border-top{border-top:solid 1px #999}.odb-optimizing-table{margin-top:16px}.odb-optimized{color:#0074a2;font-weight:700}.odb-underline-red{text-decoration:underline;color:red}.odb-updated{position:relative;left:-15px}.odb-found{font-size:13px;font-weight:700;color:#000}.odb-found-number{margin-left:8px;margin-bottom:18px;font-size:13px;font-weight:700;color:#000}.odb-result-table{background-color:#e8e8e8;margin-bottom:20px}.odb-not-found{margin-left:8px;margin-bottom:16px;color:#999}.odb-post-type-select{font-size:inherit}.odb-schedule-select{font-size:inherit;padding:0;margin:0}.odb-schedulehour{display:none}.odb-schedulehour-select{font-size:inherit}.odb-table-excludes{margin-top:10px;border:solid 1px #ccc;padding:10px}.odb-table-excludes td{padding:3px}#odb-options-tables-container{text-align:center}#odb-options-tables-wrapper{width:97%;display:inline-block;margin-top:16px;margin-left:-16px;padding:8px 0 8px 0}.odb-options-table{background-color:#f0f0f0;display:inline-block;height:17px;margin:3px;border:solid 1px #e0e0e0;overflow:hidden;padding:2px;text-align:left;white-space:nowrap;width:200px}.odb-log-table{font-size:13px}.odb-log-table th{border-top:solid 1px #000;border-bottom:solid 1px #000}.odb-log-table td{padding-bottom:4px;border-bottom:dotted 1px #ccc}
includes/settings-page.php CHANGED
@@ -60,6 +60,9 @@ if (isset($_POST['info_update'])) {
60
  if(isset($_POST['rvg_clear_oembed'])) $this->odb_rvg_options['clear_oembed'] = sanitize_text_field($_POST['rvg_clear_oembed']);
61
  else $this->odb_rvg_options['clear_oembed'] = 'N';
62
 
 
 
 
63
  if(isset($_POST['rvg_odb_logging_on'])) $this->odb_rvg_options['logging_on'] = sanitize_text_field($_POST['rvg_odb_logging_on']);
64
  else $this->odb_rvg_options['logging_on'] = 'N';
65
 
@@ -207,6 +210,7 @@ $cb_spam = ($this->odb_rvg_options['clear_spam'] == "Y") ? $c :
207
  $cb_tags = ($this->odb_rvg_options['clear_tags'] == "Y") ? $c : '';
208
  $cb_ping = ($this->odb_rvg_options['clear_pingbacks'] == "Y") ? $c : '';
209
  $cb_oembed = ($this->odb_rvg_options['clear_oembed'] == "Y") ? $c : '';
 
210
  $cb_logging = ($this->odb_rvg_options['logging_on'] == "Y") ? $c : '';
211
  $cb_adminbar = ($this->odb_rvg_options['adminbar'] == "Y") ? $c : '';
212
  $cb_adminmenu = ($this->odb_rvg_options['adminmenu'] == "Y") ? $c : '';
@@ -339,7 +343,13 @@ echo '
339
  '.__('Clear oEmbed cache',$this->odb_txt_domain).'
340
  </span></td>
341
  <td width="50%" valign="top"><input name="rvg_clear_oembed" type="checkbox" value="Y" '.$cb_oembed.'></td>
342
- </tr>
 
 
 
 
 
 
343
  <tr>
344
  <td align="right" valign="top"><span class="odb-bold">
345
  '. __('Optimize InnoDB tables too',$this->odb_txt_domain).'
60
  if(isset($_POST['rvg_clear_oembed'])) $this->odb_rvg_options['clear_oembed'] = sanitize_text_field($_POST['rvg_clear_oembed']);
61
  else $this->odb_rvg_options['clear_oembed'] = 'N';
62
 
63
+ if(isset($_POST['rvg_clear_orphans'])) $this->odb_rvg_options['clear_orphans'] = sanitize_text_field($_POST['rvg_clear_orphans']);
64
+ else $this->odb_rvg_options['clear_orphans'] = 'N';
65
+
66
  if(isset($_POST['rvg_odb_logging_on'])) $this->odb_rvg_options['logging_on'] = sanitize_text_field($_POST['rvg_odb_logging_on']);
67
  else $this->odb_rvg_options['logging_on'] = 'N';
68
 
210
  $cb_tags = ($this->odb_rvg_options['clear_tags'] == "Y") ? $c : '';
211
  $cb_ping = ($this->odb_rvg_options['clear_pingbacks'] == "Y") ? $c : '';
212
  $cb_oembed = ($this->odb_rvg_options['clear_oembed'] == "Y") ? $c : '';
213
+ $cb_orphans = ($this->odb_rvg_options['clear_orphans'] == "Y") ? $c : '';
214
  $cb_logging = ($this->odb_rvg_options['logging_on'] == "Y") ? $c : '';
215
  $cb_adminbar = ($this->odb_rvg_options['adminbar'] == "Y") ? $c : '';
216
  $cb_adminmenu = ($this->odb_rvg_options['adminmenu'] == "Y") ? $c : '';
343
  '.__('Clear oEmbed cache',$this->odb_txt_domain).'
344
  </span></td>
345
  <td width="50%" valign="top"><input name="rvg_clear_oembed" type="checkbox" value="Y" '.$cb_oembed.'></td>
346
+ </tr>
347
+ <tr>
348
+ <td width="50%" align="right" valign="top"><span class="odb-bold">
349
+ '.__('Clear orphans',$this->odb_txt_domain).'
350
+ </span></td>
351
+ <td width="50%" valign="top"><input name="rvg_clear_orphans" type="checkbox" value="Y" '.$cb_orphans.'></td>
352
+ </tr>
353
  <tr>
354
  <td align="right" valign="top"><span class="odb-bold">
355
  '. __('Optimize InnoDB tables too',$this->odb_txt_domain).'
language/rvg-optimize-database-nl_NL.mo CHANGED
Binary file
language/rvg-optimize-database-nl_NL.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Optimize Database after Deleting Revisions v4.3\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2018-06-26 15:19+0200\n"
6
- "PO-Revision-Date: 2018-06-26 15:20+0200\n"
7
  "Last-Translator: Rolf van Gelder <info@cagewebdev.com>\n"
8
  "Language-Team: CAGE <info@cagewebdev.com>\n"
9
  "Language: nl_NL\n"
@@ -11,7 +11,7 @@ msgstr ""
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
- "X-Generator: Poedit 2.0.8\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
  "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
@@ -19,224 +19,359 @@ msgstr ""
19
  "X-Textdomain-Support: yes\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
 
22
- #: classes/odb-cleaner.php:31
 
 
 
 
23
  msgid "Cleaning Database"
24
  msgstr "Opschonen Database"
25
 
26
- #: classes/odb-cleaner.php:81
 
 
 
 
 
 
 
 
27
  msgid "DELETED REVISIONS"
28
  msgstr "VERWIJDERDE REVISIES"
29
 
30
- #: classes/odb-cleaner.php:86 classes/odb-cleaner.php:141
31
- #: classes/odb-cleaner.php:196
 
 
 
 
 
 
32
  msgid "prefix"
33
  msgstr "prefix"
34
 
35
- #: classes/odb-cleaner.php:87
36
  msgid "post / page"
37
  msgstr "bericht / pagina"
38
 
39
- #: classes/odb-cleaner.php:88
40
  msgid "revision date"
41
  msgstr "revisiedatum"
42
 
43
- #: classes/odb-cleaner.php:89
44
- msgid "revisions deleted"
45
- msgstr "revisies verwijderd"
46
 
47
- #: classes/odb-cleaner.php:100
48
  msgid "total number of revisions deleted"
49
  msgstr "totaal aantal verwijderde revisies"
50
 
51
- #: classes/odb-cleaner.php:110
52
  msgid "No REVISIONS found to delete"
53
  msgstr "Geen REVISIES gevonden om te verwijderen"
54
 
55
- #: classes/odb-cleaner.php:136
 
 
 
 
 
 
 
 
56
  msgid "DELETED TRASHED ITEMS"
57
  msgstr "VERWIJDERDE TRASHED ITEMS"
58
 
59
- #: classes/odb-cleaner.php:142
 
 
 
 
 
60
  msgid "type"
61
  msgstr "type"
62
 
63
- #: classes/odb-cleaner.php:143
64
  msgid "IP address / title"
65
  msgstr "IP adres / titel"
66
 
67
- #: classes/odb-cleaner.php:144 classes/odb-logger.php:114
68
- #: classes/odb-logger.php:242
69
  msgid "date"
70
  msgstr "datum"
71
 
72
- #: classes/odb-cleaner.php:155
73
- msgid "total number of trashed items deleted"
74
- msgstr "totaal aantal verwijderede trashed items"
75
-
76
- #: classes/odb-cleaner.php:165
77
  msgid "No TRASHED ITEMS found to delete"
78
  msgstr "Geen PRULLENBAK ITEMS gevonden om te verwijderen"
79
 
80
- #: classes/odb-cleaner.php:191
 
 
 
 
 
 
 
 
81
  msgid "DELETED SPAMMED ITEMS"
82
  msgstr "VERWIJDERDE SPAMMEND ITEMS"
83
 
84
- #: classes/odb-cleaner.php:197
 
 
 
 
85
  msgid "comment author"
86
  msgstr "plaatser van de reactie"
87
 
88
- #: classes/odb-cleaner.php:198
89
  msgid "comment author email"
90
  msgstr "email van de plaatser van de reactie"
91
 
92
- #: classes/odb-cleaner.php:199
93
  msgid "comment date"
94
  msgstr "datum van de reactie"
95
 
96
- #: classes/odb-cleaner.php:210
97
- msgid "total number of spammed items deleted"
98
- msgstr "totaal aantal verwijderde spammed items"
99
-
100
- #: classes/odb-cleaner.php:220
101
  msgid "No SPAMMED ITEMS found to delete"
102
  msgstr "Geen SPAM gevonden om te verwijderen"
103
 
104
- #: classes/odb-cleaner.php:242
105
- msgid "NUMBER OF UNUSED TAGS DELETED"
106
- msgstr "AANTAL VERWIJDERDE ONGEBRUIKTE TAGS"
 
 
 
 
 
 
 
 
107
 
108
- #: classes/odb-cleaner.php:249
109
- msgid "No UNUSED TAGS found to delete"
 
 
 
 
 
 
 
 
110
  msgstr "Geen ONGEBRUIKTE TAGS gevonden om te verwijderen"
111
 
112
- #: classes/odb-cleaner.php:270
113
- msgid "NUMBER OF EXPIRED TRANSIENTS DELETED"
114
- msgstr "AANTAL VERWIJDERDE VERLOPEN TRANSIËNTS"
115
 
116
- #: classes/odb-cleaner.php:272
117
- msgid "NUMBER OF TRANSIENTS DELETED"
118
- msgstr "AANTAL VERWIJDERDE VERLOPEN TRANSIËNTS"
 
 
 
 
 
 
 
 
 
 
 
 
119
 
120
- #: classes/odb-cleaner.php:282
 
 
 
 
 
 
 
 
 
 
 
 
121
  msgid "No EXPIRED TRANSIENTS found to delete"
122
  msgstr "Geen VERLOPEN TRANSIËNTS gevonden om te verwijderen"
123
 
124
- #: classes/odb-cleaner.php:284
125
  msgid "No TRANSIENTS found to delete"
126
  msgstr "Geen VERLOPEN TRANSIËNTS gevonden om te verwijderen"
127
 
128
- #: classes/odb-cleaner.php:310
129
- msgid "NUMBER OF PINGBACKS AND TRACKBACKS DELETED"
130
- msgstr "AANTAL VERWIJDERDE PINGBACKS EN TRACKBACKS"
 
 
 
 
 
 
 
 
131
 
132
- #: classes/odb-cleaner.php:317
 
 
 
 
 
 
 
 
133
  msgid "No PINGBACKS nor TRACKBACKS found to delete"
134
  msgstr "Geen PINGBACKS en TRACKBACKS gevonden om te verwijderen"
135
 
136
- #: classes/odb-cleaner.php:339
137
- msgid "NUMBER OF oEmbed RECORDS DELETED"
138
- msgstr "AANTAL VERWIJDERDE oEmbed RECORDS"
139
 
140
- #: classes/odb-cleaner.php:346
141
- msgid "No oEmbed records found to delete"
142
- msgstr "Geen oEmbed records gevonden om te verwijderen"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
 
144
- #: classes/odb-cleaner.php:365
145
- msgid "NUMBER OF POSTMETA ORPHANS DELETED"
146
- msgstr "AANTAL VERWIJDERDE POSTMETA WEZEN"
 
 
 
 
 
 
 
 
147
 
148
- #: classes/odb-cleaner.php:372
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  msgid "No POSTMETA ORPHANS found to delete"
150
  msgstr "Geen POSTMETA WEZEN gevonden om te verwijderen"
151
 
152
- #: classes/odb-cleaner.php:398
153
  msgid "Optimizing Database Tables"
154
  msgstr "Optimaliseren van Databasetabellen"
155
 
156
- #: classes/odb-cleaner.php:405
157
  msgid "table name"
158
  msgstr "tabelnaam"
159
 
160
- #: classes/odb-cleaner.php:406
161
  msgid "optimization result"
162
  msgstr "resultaat optimalisatie"
163
 
164
- #: classes/odb-cleaner.php:407
165
  msgid "engine"
166
  msgstr "engine"
167
 
168
- #: classes/odb-cleaner.php:408
169
  msgid "table rows"
170
  msgstr "tabelrijen"
171
 
172
- #: classes/odb-cleaner.php:409
173
  msgid "table size"
174
  msgstr "tabelgrootte"
175
 
176
- #: classes/odb-cleaner.php:456
177
  msgid "Savings"
178
  msgstr "Besparingen"
179
 
180
- #: classes/odb-cleaner.php:463
181
  msgid "size of the database"
182
  msgstr "grootte van de database"
183
 
184
- #: classes/odb-cleaner.php:466
185
  msgid "BEFORE optimization"
186
  msgstr "VOOR de optimalisatie"
187
 
188
- #: classes/odb-cleaner.php:470
189
  msgid "AFTER optimization"
190
  msgstr "NA de optimalisatie"
191
 
192
- #: classes/odb-cleaner.php:474
193
  msgid "SAVINGS THIS TIME"
194
  msgstr "DIT KEER BESPAARD"
195
 
196
- #: classes/odb-cleaner.php:478
197
  msgid "TOTAL SAVINGS SINCE THE FIRST RUN"
198
  msgstr "TOTALE BESPARING SINDS DE EERSTE UITVOERING"
199
 
200
- #: classes/odb-cleaner.php:504
201
  msgid "DONE!"
202
  msgstr "KLAAR!"
203
 
204
- #: classes/odb-cleaner.php:509
205
- msgid "Optimization took"
206
- msgstr "Optimalizatie duurde"
207
 
208
- #: classes/odb-cleaner.php:509 classes/odb-displayer.php:139
209
- #: classes/odb-displayer.php:174
210
  msgid "seconds"
211
  msgstr "seconden"
212
 
213
- #: classes/odb-cleaner.php:520 classes/odb-displayer.php:196
 
 
 
 
214
  #: classes/odb-logger.php:157
215
  msgid "Clear the log?"
216
  msgstr "Logs wissen?"
217
 
218
- #: classes/odb-cleaner.php:530 classes/odb-displayer.php:215
219
  msgid "View Log"
220
  msgstr "Bekijk Logs"
221
 
222
- #: classes/odb-cleaner.php:532 classes/odb-displayer.php:217
223
  #: classes/odb-logger.php:170
224
  msgid "Clear Log"
225
  msgstr "Wis Logs"
226
 
227
- #: classes/odb-cleaner.php:763
228
  msgid "of"
229
  msgstr "van"
230
 
231
- #: classes/odb-cleaner.php:1263
232
  msgid "InnoDB table: skipped..."
233
  msgstr "InnoDB tabel overgeslagen..."
234
 
235
- #: classes/odb-cleaner.php:1270 classes/odb-cleaner.php:1318
236
  msgid "<span class=\"odb-optimized\">TABLE OPTIMIZED</span>"
237
  msgstr "<span class=\"odb-optimized\">TABEL GEOPTIMALISEERD</span>"
238
 
239
- #: classes/odb-cleaner.php:1271 classes/odb-cleaner.php:1320
240
  msgid "Table is already up to date"
241
  msgstr "Tabel is al optimaal"
242
 
@@ -279,11 +414,11 @@ msgstr "JA"
279
  msgid "NO"
280
  msgstr "NEE"
281
 
282
- #: classes/odb-displayer.php:72 includes/settings-page.php:321
283
  msgid "DELETE EXPIRED TRANSIENTS"
284
  msgstr "AANTAL VERWIJDERDE VERLOPEN TRANSIËNTS"
285
 
286
- #: classes/odb-displayer.php:74 includes/settings-page.php:324
287
  msgid "DELETE ALL TRANSIENTS"
288
  msgstr "VERWIJDER ALLE TRANSIENTS"
289
 
@@ -311,7 +446,7 @@ msgstr "WEKELIJKS"
311
  msgid "ONCE MONTHLY"
312
  msgstr "MAANDELIJKS"
313
 
314
- #: classes/odb-displayer.php:97 includes/settings-page.php:361
315
  msgid "NOT SCHEDULED"
316
  msgstr "NIET GEPLAND"
317
 
@@ -327,8 +462,8 @@ msgstr "GEEN"
327
  msgid "Delete revisions of"
328
  msgstr "Verwijder revisies van"
329
 
330
- #: classes/odb-displayer.php:122 includes/settings-page.php:152
331
- #: includes/settings-page.php:263
332
  msgid "Delete revisions older than"
333
  msgstr "Verwijder revisies ouder dan"
334
 
@@ -342,31 +477,31 @@ msgstr ""
342
  "Maximaal aantal (meest recente) revisies die bewaard worden per bericht / "
343
  "pagina"
344
 
345
- #: classes/odb-displayer.php:130 includes/settings-page.php:296
346
  msgid "Delete trashed items"
347
  msgstr "Verwijder trashed items"
348
 
349
- #: classes/odb-displayer.php:131 includes/settings-page.php:302
350
  msgid "Delete spammed items"
351
  msgstr "Verwijder spammed items"
352
 
353
- #: classes/odb-displayer.php:132 includes/settings-page.php:308
354
  msgid "Delete unused tags"
355
  msgstr "Verwijder ongebruikte tags"
356
 
357
- #: classes/odb-displayer.php:133 includes/settings-page.php:314
358
  msgid "Delete transients"
359
  msgstr "Verwijder transiënts"
360
 
361
- #: classes/odb-displayer.php:134 includes/settings-page.php:333
362
  msgid "Delete pingbacks and trackbacks"
363
  msgstr "Verwijder pingback en trackbacks"
364
 
365
- #: classes/odb-displayer.php:135 includes/settings-page.php:339
366
  msgid "Clear oEmbed cache"
367
  msgstr "Leeg de oEmbed cache"
368
 
369
- #: classes/odb-displayer.php:136 includes/settings-page.php:351
370
  msgid "Keep a log"
371
  msgstr "Gebruik een logbestand"
372
 
@@ -382,7 +517,7 @@ msgstr "Aantal uitgesloten tabellen"
382
  msgid "Last run"
383
  msgstr "Laatste uitvoering"
384
 
385
- #: classes/odb-displayer.php:139 includes/settings-page.php:395
386
  msgid "hrs"
387
  msgstr "uur"
388
 
@@ -390,7 +525,7 @@ msgstr "uur"
390
  msgid "in"
391
  msgstr "in"
392
 
393
- #: classes/odb-displayer.php:140 includes/settings-page.php:357
394
  msgid "Scheduler"
395
  msgstr "Planner"
396
 
@@ -418,7 +553,13 @@ msgstr "en"
418
  msgid "Change Settings"
419
  msgstr "Wijzig instellingen"
420
 
421
- #: classes/odb-displayer.php:223 classes/odb-logger.php:174
 
 
 
 
 
 
422
  msgid "Start Optimization"
423
  msgstr "Start Optimalisatie"
424
 
@@ -479,10 +620,6 @@ msgstr "BESPARINGEN"
479
  msgid "Export to CSV"
480
  msgstr "Exporteer naar CSV"
481
 
482
- #: classes/odb-logger.php:241
483
- msgid "id"
484
- msgstr "id"
485
-
486
  #: classes/odb-logger.php:243
487
  msgid "deleted revisions"
488
  msgstr "verw. revisies"
@@ -538,11 +675,11 @@ msgstr "Maandelijks"
538
  msgid "Every Five Minutes"
539
  msgstr "Iedere vijf minuten"
540
 
541
- #: includes/settings-page.php:115
542
  msgid "Optimize Database after Deleting Revisions SETTINGS UPDATED"
543
  msgstr "Optimize Database after Deleting Revisions INSTELLINGEN AANGEPAST"
544
 
545
- #: includes/settings-page.php:117
546
  msgid ""
547
  "Click <a href=\"tools.php?page=rvg-optimize-database\" class=\"odb-bold"
548
  "\">HERE</a> to run the optimization"
@@ -550,96 +687,100 @@ msgstr ""
550
  "Klik <a href=\"tools.php?page=rvg-optimize-database\" class=\"odb-bold"
551
  "\">HIER</a> om de optimalisatie te starten"
552
 
553
- #: includes/settings-page.php:152
554
  msgid "You have to enter: "
555
  msgstr "Je moet invullen:"
556
 
557
- #: includes/settings-page.php:157
558
  msgid "<Delete revisions older than> should be a number"
559
  msgstr "<Verwijder revisites ouder dan> moet een getal zijn"
560
 
561
- #: includes/settings-page.php:165
562
  msgid "You have to enter the <Maximum number of revisions>"
563
  msgstr "Je moet het <Maximaal aantal revisies> invullen"
564
 
565
- #: includes/settings-page.php:170
566
  msgid "<Maximum number of revisions> should be a number"
567
  msgstr "<Maximaal aantal revisies> moet een getal zijn"
568
 
569
- #: includes/settings-page.php:227 rvg-optimize-database.php:456
570
  msgid "Settings"
571
  msgstr "Instellingen"
572
 
573
- #: includes/settings-page.php:232
574
  msgid "Delete revisions for the following (custom) post type(s):"
575
  msgstr "Verwijder revisies voor de volgende (custom) post type(s):"
576
 
577
- #: includes/settings-page.php:268
578
  msgid "day(s)"
579
  msgstr "dag(en)"
580
 
581
- #: includes/settings-page.php:280
582
  msgid "Maximum number of - most recent - revisions<br>to keep per post / page"
583
  msgstr ""
584
  "Maximaal aantal - meest recente - revisies<br>om te bewaren per post/pagina"
585
 
586
- #: includes/settings-page.php:286
587
  msgid "('0' means: delete <u>ALL</u> revisions)"
588
  msgstr "('0' betekent: verwijder <u>ALLE</u> revisies)"
589
 
590
- #: includes/settings-page.php:318
591
  msgid "DO NOT DELETE TRANSIENTS"
592
  msgstr "GEEN TRANSIENTS VERWIJDEREN"
593
 
594
- #: includes/settings-page.php:345
 
 
 
 
595
  msgid "Optimize InnoDB tables too"
596
  msgstr "Optimiliseer ook InnoDB tabellen"
597
 
598
- #: includes/settings-page.php:364
599
  msgid "run optimization HOURLY"
600
  msgstr "voer de optimalisatie ELK UUR uit"
601
 
602
- #: includes/settings-page.php:367
603
  msgid "run optimization TWICE A DAY"
604
  msgstr "voer de optimalisatie TWEE KEER PER DAG uit"
605
 
606
- #: includes/settings-page.php:370
607
  msgid "run optimization DAILY"
608
  msgstr "voer de optimalisatie DAGELIJKS uit"
609
 
610
- #: includes/settings-page.php:373
611
  msgid "run optimization WEEKLY"
612
  msgstr "voer de optimalisatie WEKELIJKS uit"
613
 
614
- #: includes/settings-page.php:376
615
  msgid "run optimization MONTHLY"
616
  msgstr "voer de optimalisatie MAANDELIJKS uit"
617
 
618
- #: includes/settings-page.php:386
619
  msgid "Time"
620
  msgstr "Tijd"
621
 
622
- #: includes/settings-page.php:410
623
  msgid "Show '1-click' link in Admin Bar"
624
  msgstr "Toon de '1-klik' link in de Admin Balk"
625
 
626
- #: includes/settings-page.php:416
627
  msgid "Show an icon in the Admin Menu"
628
  msgstr "Toon een icon in het Admin Menu"
629
 
630
- #: includes/settings-page.php:421
631
  msgid "change will be visible after loading the next page"
632
  msgstr "wijziging wordt pas zichtbaar na het laden van de volgende pagina"
633
 
634
- #: includes/settings-page.php:426 includes/settings-page.php:472
635
  msgid "Save Settings"
636
  msgstr "Bewaar instellingen"
637
 
638
- #: includes/settings-page.php:428 includes/settings-page.php:474
639
  msgid "Go To Optimizer"
640
  msgstr "Ga naar Optimalisatie"
641
 
642
- #: includes/settings-page.php:435
643
  msgid ""
644
  "EXCLUDE DATABASE TABLES FROM OPTIMIZATION:<br><span class=\"odb-underline-red"
645
  "\">CHECKED</span> TABLES <span class=\"odb-underline-red\">WON'T</span> BE "
@@ -649,41 +790,62 @@ msgstr ""
649
  "underline-red\">AANGEVINKTE</span> TABELLEN ZULLEN <span class=\"odb-"
650
  "underline-red\">NIET</span> GEOPTIMALISEERD WORDEN!</span>"
651
 
652
- #: includes/settings-page.php:441
653
  msgid "check all tables"
654
  msgstr "vink alle tabellen aan"
655
 
656
- #: includes/settings-page.php:443
657
  msgid "uncheck all tables"
658
  msgstr "vink alle tabellen uit"
659
 
660
- #: includes/settings-page.php:445
661
  msgid "check all NON-WordPress tables"
662
  msgstr "vink alle NIET-WordPress tabellen aan"
663
 
664
  # @ rvg-optimize-database
665
- #: rvg-optimize-database.php:428 rvg-optimize-database.php:429
666
- #: rvg-optimize-database.php:443 rvg-optimize-database.php:444
667
- #: rvg-optimize-database.php:484 rvg-optimize-database.php:485
668
- #: rvg-optimize-database.php:502 rvg-optimize-database.php:503
669
  msgid "Optimize Database"
670
  msgstr "Optimaliseer Database"
671
 
672
  # @ optimize_db
673
- #: rvg-optimize-database.php:473
674
  msgid "Optimize DB (1 click)"
675
  msgstr "Optimaliseer DB (1 klik)"
676
 
677
- #: rvg-optimize-database.php:621
678
  msgid "Optimize Database after Deleting Revisions LOGS HAVE BEEN CLEARED"
679
  msgstr "Optimize Database after Deleting Revisions LOGS ZIJN VERWIJDERD"
680
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
681
  #~ msgid "PLEASE DONATE!"
682
  #~ msgstr "DONEER!"
683
 
684
- #~ msgid "Donation page"
685
- #~ msgstr "Donatiepagina"
686
-
687
  #~ msgid "Delete Log File"
688
  #~ msgstr "Verwijder Logbestand"
689
 
2
  msgstr ""
3
  "Project-Id-Version: Optimize Database after Deleting Revisions v4.3\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2018-11-09 18:34+0100\n"
6
+ "PO-Revision-Date: 2018-11-09 18:40+0100\n"
7
  "Last-Translator: Rolf van Gelder <info@cagewebdev.com>\n"
8
  "Language-Team: CAGE <info@cagewebdev.com>\n"
9
  "Language: nl_NL\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
+ "X-Generator: Poedit 2.2\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
  "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
19
  "X-Textdomain-Support: yes\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
 
22
+ #: classes/odb-cleaner.php:32
23
+ msgid "Analyzing Database"
24
+ msgstr "Analiseer Database"
25
+
26
+ #: classes/odb-cleaner.php:41
27
  msgid "Cleaning Database"
28
  msgstr "Opschonen Database"
29
 
30
+ #: classes/odb-cleaner.php:90
31
+ msgid "REVISIONS"
32
+ msgstr "REVISIES"
33
+
34
+ #: classes/odb-cleaner.php:91
35
+ msgid "revisions"
36
+ msgstr "revisies"
37
+
38
+ #: classes/odb-cleaner.php:93
39
  msgid "DELETED REVISIONS"
40
  msgstr "VERWIJDERDE REVISIES"
41
 
42
+ #: classes/odb-cleaner.php:94
43
+ msgid "revisions deleted"
44
+ msgstr "revisies verwijderd"
45
+
46
+ #: classes/odb-cleaner.php:103 classes/odb-cleaner.php:169
47
+ #: classes/odb-cleaner.php:230 classes/odb-cleaner.php:292
48
+ #: classes/odb-cleaner.php:362 classes/odb-cleaner.php:426
49
+ #: classes/odb-cleaner.php:488 classes/odb-cleaner.php:552
50
  msgid "prefix"
51
  msgstr "prefix"
52
 
53
+ #: classes/odb-cleaner.php:104
54
  msgid "post / page"
55
  msgstr "bericht / pagina"
56
 
57
+ #: classes/odb-cleaner.php:105
58
  msgid "revision date"
59
  msgstr "revisiedatum"
60
 
61
+ #: classes/odb-cleaner.php:116
62
+ msgid "total number of revisions"
63
+ msgstr "totaal aantal revisies"
64
 
65
+ #: classes/odb-cleaner.php:118
66
  msgid "total number of revisions deleted"
67
  msgstr "totaal aantal verwijderde revisies"
68
 
69
+ #: classes/odb-cleaner.php:131
70
  msgid "No REVISIONS found to delete"
71
  msgstr "Geen REVISIES gevonden om te verwijderen"
72
 
73
+ #: classes/odb-cleaner.php:154
74
+ msgid "TRASHED ITEMS"
75
+ msgstr "TRASHED ITEMS"
76
+
77
+ #: classes/odb-cleaner.php:155
78
+ msgid "total number of trashed items"
79
+ msgstr "totaal aantal trashed items"
80
+
81
+ #: classes/odb-cleaner.php:157
82
  msgid "DELETED TRASHED ITEMS"
83
  msgstr "VERWIJDERDE TRASHED ITEMS"
84
 
85
+ #: classes/odb-cleaner.php:158
86
+ msgid "total number of trashed items deleted"
87
+ msgstr "totaal aantal verwijderede trashed items"
88
+
89
+ #: classes/odb-cleaner.php:170 classes/odb-cleaner.php:427
90
+ #: classes/odb-cleaner.php:553
91
  msgid "type"
92
  msgstr "type"
93
 
94
+ #: classes/odb-cleaner.php:171
95
  msgid "IP address / title"
96
  msgstr "IP adres / titel"
97
 
98
+ #: classes/odb-cleaner.php:172 classes/odb-cleaner.php:429
99
+ #: classes/odb-logger.php:114 classes/odb-logger.php:242
100
  msgid "date"
101
  msgstr "datum"
102
 
103
+ #: classes/odb-cleaner.php:192
 
 
 
 
104
  msgid "No TRASHED ITEMS found to delete"
105
  msgstr "Geen PRULLENBAK ITEMS gevonden om te verwijderen"
106
 
107
+ #: classes/odb-cleaner.php:215
108
+ msgid "SPAMMED ITEMS"
109
+ msgstr "SPAMMEND ITEMS"
110
+
111
+ #: classes/odb-cleaner.php:216
112
+ msgid "total number of spammed items"
113
+ msgstr "totaal aantal spammed items"
114
+
115
+ #: classes/odb-cleaner.php:218
116
  msgid "DELETED SPAMMED ITEMS"
117
  msgstr "VERWIJDERDE SPAMMEND ITEMS"
118
 
119
+ #: classes/odb-cleaner.php:219
120
+ msgid "total number of spammed items deleted"
121
+ msgstr "totaal aantal verwijderde spammed items"
122
+
123
+ #: classes/odb-cleaner.php:231
124
  msgid "comment author"
125
  msgstr "plaatser van de reactie"
126
 
127
+ #: classes/odb-cleaner.php:232
128
  msgid "comment author email"
129
  msgstr "email van de plaatser van de reactie"
130
 
131
+ #: classes/odb-cleaner.php:233
132
  msgid "comment date"
133
  msgstr "datum van de reactie"
134
 
135
+ #: classes/odb-cleaner.php:253
 
 
 
 
136
  msgid "No SPAMMED ITEMS found to delete"
137
  msgstr "Geen SPAM gevonden om te verwijderen"
138
 
139
+ #: classes/odb-cleaner.php:277
140
+ msgid "UNUSED TAGS"
141
+ msgstr "ONGEBRUIKTE TAGS"
142
+
143
+ #: classes/odb-cleaner.php:278
144
+ msgid "total number of unused tags"
145
+ msgstr "totaal aantal trashed items"
146
+
147
+ #: classes/odb-cleaner.php:280
148
+ msgid "DELETED UNUSED TAGS"
149
+ msgstr "VERWIJDERDE ONGEBRUIKTE TAGS"
150
 
151
+ #: classes/odb-cleaner.php:281
152
+ msgid "total number of unused tags deleted"
153
+ msgstr "totaal aantal verwijderede trashed items"
154
+
155
+ #: classes/odb-cleaner.php:293
156
+ msgid "tag"
157
+ msgstr "tag"
158
+
159
+ #: classes/odb-cleaner.php:313
160
+ msgid "No UNUSED TAGE found to delete"
161
  msgstr "Geen ONGEBRUIKTE TAGS gevonden om te verwijderen"
162
 
163
+ #: classes/odb-cleaner.php:338
164
+ msgid "EXPIRED TRANSIENTS"
165
+ msgstr "VERLOPEN TRANSIËNTS"
166
 
167
+ #: classes/odb-cleaner.php:339
168
+ msgid "total number of expired transients"
169
+ msgstr "totaal aantal verlopen transients"
170
+
171
+ #: classes/odb-cleaner.php:341
172
+ msgid "EXPIRED TRANSIENTS DELETED"
173
+ msgstr "VERWIJDERDE VERLOPEN TRANSIËNTS"
174
+
175
+ #: classes/odb-cleaner.php:342
176
+ msgid "total number of expired transients deleted"
177
+ msgstr "totaal aantal verwijderde revisies"
178
+
179
+ #: classes/odb-cleaner.php:346
180
+ msgid "TRANSIENTS"
181
+ msgstr "TRANSIENTS"
182
 
183
+ #: classes/odb-cleaner.php:347 classes/odb-cleaner.php:350
184
+ msgid "total number of transients"
185
+ msgstr "totaal aantal trashed items"
186
+
187
+ #: classes/odb-cleaner.php:349
188
+ msgid "TRANSIENTS DELETED"
189
+ msgstr "VERWIJDERDE VERLOPEN TRANSIËNTS"
190
+
191
+ #: classes/odb-cleaner.php:363
192
+ msgid "option name"
193
+ msgstr "optienaam"
194
+
195
+ #: classes/odb-cleaner.php:385
196
  msgid "No EXPIRED TRANSIENTS found to delete"
197
  msgstr "Geen VERLOPEN TRANSIËNTS gevonden om te verwijderen"
198
 
199
+ #: classes/odb-cleaner.php:387
200
  msgid "No TRANSIENTS found to delete"
201
  msgstr "Geen VERLOPEN TRANSIËNTS gevonden om te verwijderen"
202
 
203
+ #: classes/odb-cleaner.php:411
204
+ msgid "PINGBACKS AND TRACKBACKS"
205
+ msgstr "PINGBACKS EN TRACKBACKS"
206
+
207
+ #: classes/odb-cleaner.php:412
208
+ msgid "total number of pingbacks and trackbacks"
209
+ msgstr "total aantal pingbacks en trackbacks"
210
+
211
+ #: classes/odb-cleaner.php:414
212
+ msgid "DELETED PINGBACKS AND TRACKBACKS"
213
+ msgstr "VERWIJDERDE PINGBACKS EN TRACKBACKS"
214
 
215
+ #: classes/odb-cleaner.php:415
216
+ msgid "total number of pingbacks and trackbacks deleted"
217
+ msgstr "totaal aantal verwijderede trashed items"
218
+
219
+ #: classes/odb-cleaner.php:428
220
+ msgid "comment_author"
221
+ msgstr "plaatser van de reactie"
222
+
223
+ #: classes/odb-cleaner.php:449
224
  msgid "No PINGBACKS nor TRACKBACKS found to delete"
225
  msgstr "Geen PINGBACKS en TRACKBACKS gevonden om te verwijderen"
226
 
227
+ #: classes/odb-cleaner.php:473
228
+ msgid "OEMBED CACHE"
229
+ msgstr "OEMBED CACHE"
230
 
231
+ #: classes/odb-cleaner.php:474
232
+ msgid "total number of oEmbeds"
233
+ msgstr "totaal aantal oEmbeds"
234
+
235
+ #: classes/odb-cleaner.php:476
236
+ msgid "DELETED OEMBEDS"
237
+ msgstr "VERWIJDERDE OEMBEDS"
238
+
239
+ #: classes/odb-cleaner.php:477
240
+ msgid "total number of oEmbeds deleted"
241
+ msgstr "totaal aantal verwijderde oEmbeds"
242
+
243
+ #: classes/odb-cleaner.php:489 classes/odb-cleaner.php:557
244
+ msgid "meta key"
245
+ msgstr "meta sleutel"
246
+
247
+ #: classes/odb-cleaner.php:490 classes/odb-cleaner.php:558
248
+ msgid "meta value"
249
+ msgstr "meta waarde"
250
 
251
+ #: classes/odb-cleaner.php:510
252
+ msgid "No OEMED CHACHE found to delete"
253
+ msgstr "Geen ONGEBRUIKTE TAGS gevonden om te verwijderen"
254
+
255
+ #: classes/odb-cleaner.php:534
256
+ msgid "POSTMETA ORPHANS"
257
+ msgstr "POSTMETA WEZEN"
258
+
259
+ #: classes/odb-cleaner.php:535 classes/odb-cleaner.php:538
260
+ msgid "total number of orphans"
261
+ msgstr "totaal aantal wezen"
262
 
263
+ #: classes/odb-cleaner.php:537
264
+ msgid "DELETED POSTMETA ORPHANS"
265
+ msgstr "VERWIJDERDE POSTMETA WEZEN"
266
+
267
+ #: classes/odb-cleaner.php:554 classes/odb-logger.php:241
268
+ msgid "id"
269
+ msgstr "id"
270
+
271
+ #: classes/odb-cleaner.php:555
272
+ msgid "title"
273
+ msgstr "titel"
274
+
275
+ #: classes/odb-cleaner.php:556
276
+ msgid "modified"
277
+ msgstr "gewijzigd"
278
+
279
+ #: classes/odb-cleaner.php:579
280
  msgid "No POSTMETA ORPHANS found to delete"
281
  msgstr "Geen POSTMETA WEZEN gevonden om te verwijderen"
282
 
283
+ #: classes/odb-cleaner.php:606
284
  msgid "Optimizing Database Tables"
285
  msgstr "Optimaliseren van Databasetabellen"
286
 
287
+ #: classes/odb-cleaner.php:613
288
  msgid "table name"
289
  msgstr "tabelnaam"
290
 
291
+ #: classes/odb-cleaner.php:614
292
  msgid "optimization result"
293
  msgstr "resultaat optimalisatie"
294
 
295
+ #: classes/odb-cleaner.php:615
296
  msgid "engine"
297
  msgstr "engine"
298
 
299
+ #: classes/odb-cleaner.php:616
300
  msgid "table rows"
301
  msgstr "tabelrijen"
302
 
303
+ #: classes/odb-cleaner.php:617
304
  msgid "table size"
305
  msgstr "tabelgrootte"
306
 
307
+ #: classes/odb-cleaner.php:664
308
  msgid "Savings"
309
  msgstr "Besparingen"
310
 
311
+ #: classes/odb-cleaner.php:671
312
  msgid "size of the database"
313
  msgstr "grootte van de database"
314
 
315
+ #: classes/odb-cleaner.php:674
316
  msgid "BEFORE optimization"
317
  msgstr "VOOR de optimalisatie"
318
 
319
+ #: classes/odb-cleaner.php:678
320
  msgid "AFTER optimization"
321
  msgstr "NA de optimalisatie"
322
 
323
+ #: classes/odb-cleaner.php:682
324
  msgid "SAVINGS THIS TIME"
325
  msgstr "DIT KEER BESPAARD"
326
 
327
+ #: classes/odb-cleaner.php:686
328
  msgid "TOTAL SAVINGS SINCE THE FIRST RUN"
329
  msgstr "TOTALE BESPARING SINDS DE EERSTE UITVOERING"
330
 
331
+ #: classes/odb-cleaner.php:712
332
  msgid "DONE!"
333
  msgstr "KLAAR!"
334
 
335
+ #: classes/odb-cleaner.php:720
336
+ msgid "Analysis took"
337
+ msgstr "Analyze duurde"
338
 
339
+ #: classes/odb-cleaner.php:720 classes/odb-cleaner.php:724
340
+ #: classes/odb-displayer.php:139 classes/odb-displayer.php:174
341
  msgid "seconds"
342
  msgstr "seconden"
343
 
344
+ #: classes/odb-cleaner.php:724
345
+ msgid "Optimization took"
346
+ msgstr "Optimalizatie duurde"
347
+
348
+ #: classes/odb-cleaner.php:738 classes/odb-displayer.php:196
349
  #: classes/odb-logger.php:157
350
  msgid "Clear the log?"
351
  msgstr "Logs wissen?"
352
 
353
+ #: classes/odb-cleaner.php:748 classes/odb-displayer.php:215
354
  msgid "View Log"
355
  msgstr "Bekijk Logs"
356
 
357
+ #: classes/odb-cleaner.php:750 classes/odb-displayer.php:217
358
  #: classes/odb-logger.php:170
359
  msgid "Clear Log"
360
  msgstr "Wis Logs"
361
 
362
+ #: classes/odb-cleaner.php:991
363
  msgid "of"
364
  msgstr "van"
365
 
366
+ #: classes/odb-cleaner.php:1655
367
  msgid "InnoDB table: skipped..."
368
  msgstr "InnoDB tabel overgeslagen..."
369
 
370
+ #: classes/odb-cleaner.php:1662 classes/odb-cleaner.php:1672
371
  msgid "<span class=\"odb-optimized\">TABLE OPTIMIZED</span>"
372
  msgstr "<span class=\"odb-optimized\">TABEL GEOPTIMALISEERD</span>"
373
 
374
+ #: classes/odb-cleaner.php:1664 classes/odb-cleaner.php:1670
375
  msgid "Table is already up to date"
376
  msgstr "Tabel is al optimaal"
377
 
414
  msgid "NO"
415
  msgstr "NEE"
416
 
417
+ #: classes/odb-displayer.php:72 includes/settings-page.php:325
418
  msgid "DELETE EXPIRED TRANSIENTS"
419
  msgstr "AANTAL VERWIJDERDE VERLOPEN TRANSIËNTS"
420
 
421
+ #: classes/odb-displayer.php:74 includes/settings-page.php:328
422
  msgid "DELETE ALL TRANSIENTS"
423
  msgstr "VERWIJDER ALLE TRANSIENTS"
424
 
446
  msgid "ONCE MONTHLY"
447
  msgstr "MAANDELIJKS"
448
 
449
+ #: classes/odb-displayer.php:97 includes/settings-page.php:371
450
  msgid "NOT SCHEDULED"
451
  msgstr "NIET GEPLAND"
452
 
462
  msgid "Delete revisions of"
463
  msgstr "Verwijder revisies van"
464
 
465
+ #: classes/odb-displayer.php:122 includes/settings-page.php:155
466
+ #: includes/settings-page.php:267
467
  msgid "Delete revisions older than"
468
  msgstr "Verwijder revisies ouder dan"
469
 
477
  "Maximaal aantal (meest recente) revisies die bewaard worden per bericht / "
478
  "pagina"
479
 
480
+ #: classes/odb-displayer.php:130 includes/settings-page.php:300
481
  msgid "Delete trashed items"
482
  msgstr "Verwijder trashed items"
483
 
484
+ #: classes/odb-displayer.php:131 includes/settings-page.php:306
485
  msgid "Delete spammed items"
486
  msgstr "Verwijder spammed items"
487
 
488
+ #: classes/odb-displayer.php:132 includes/settings-page.php:312
489
  msgid "Delete unused tags"
490
  msgstr "Verwijder ongebruikte tags"
491
 
492
+ #: classes/odb-displayer.php:133 includes/settings-page.php:318
493
  msgid "Delete transients"
494
  msgstr "Verwijder transiënts"
495
 
496
+ #: classes/odb-displayer.php:134 includes/settings-page.php:337
497
  msgid "Delete pingbacks and trackbacks"
498
  msgstr "Verwijder pingback en trackbacks"
499
 
500
+ #: classes/odb-displayer.php:135 includes/settings-page.php:343
501
  msgid "Clear oEmbed cache"
502
  msgstr "Leeg de oEmbed cache"
503
 
504
+ #: classes/odb-displayer.php:136 includes/settings-page.php:361
505
  msgid "Keep a log"
506
  msgstr "Gebruik een logbestand"
507
 
517
  msgid "Last run"
518
  msgstr "Laatste uitvoering"
519
 
520
+ #: classes/odb-displayer.php:139 includes/settings-page.php:405
521
  msgid "hrs"
522
  msgstr "uur"
523
 
525
  msgid "in"
526
  msgstr "in"
527
 
528
+ #: classes/odb-displayer.php:140 includes/settings-page.php:367
529
  msgid "Scheduler"
530
  msgstr "Planner"
531
 
553
  msgid "Change Settings"
554
  msgstr "Wijzig instellingen"
555
 
556
+ # @ rvg-optimize-database
557
+ #: classes/odb-displayer.php:224
558
+ msgid "Analyze Database"
559
+ msgstr "Analyseer Database"
560
+
561
+ #: classes/odb-displayer.php:226 classes/odb-logger.php:174
562
+ #: rvg-optimize-database.php:674
563
  msgid "Start Optimization"
564
  msgstr "Start Optimalisatie"
565
 
620
  msgid "Export to CSV"
621
  msgstr "Exporteer naar CSV"
622
 
 
 
 
 
623
  #: classes/odb-logger.php:243
624
  msgid "deleted revisions"
625
  msgstr "verw. revisies"
675
  msgid "Every Five Minutes"
676
  msgstr "Iedere vijf minuten"
677
 
678
+ #: includes/settings-page.php:118
679
  msgid "Optimize Database after Deleting Revisions SETTINGS UPDATED"
680
  msgstr "Optimize Database after Deleting Revisions INSTELLINGEN AANGEPAST"
681
 
682
+ #: includes/settings-page.php:120
683
  msgid ""
684
  "Click <a href=\"tools.php?page=rvg-optimize-database\" class=\"odb-bold"
685
  "\">HERE</a> to run the optimization"
687
  "Klik <a href=\"tools.php?page=rvg-optimize-database\" class=\"odb-bold"
688
  "\">HIER</a> om de optimalisatie te starten"
689
 
690
+ #: includes/settings-page.php:155
691
  msgid "You have to enter: "
692
  msgstr "Je moet invullen:"
693
 
694
+ #: includes/settings-page.php:160
695
  msgid "<Delete revisions older than> should be a number"
696
  msgstr "<Verwijder revisites ouder dan> moet een getal zijn"
697
 
698
+ #: includes/settings-page.php:168
699
  msgid "You have to enter the <Maximum number of revisions>"
700
  msgstr "Je moet het <Maximaal aantal revisies> invullen"
701
 
702
+ #: includes/settings-page.php:173
703
  msgid "<Maximum number of revisions> should be a number"
704
  msgstr "<Maximaal aantal revisies> moet een getal zijn"
705
 
706
+ #: includes/settings-page.php:231 rvg-optimize-database.php:464
707
  msgid "Settings"
708
  msgstr "Instellingen"
709
 
710
+ #: includes/settings-page.php:236
711
  msgid "Delete revisions for the following (custom) post type(s):"
712
  msgstr "Verwijder revisies voor de volgende (custom) post type(s):"
713
 
714
+ #: includes/settings-page.php:272
715
  msgid "day(s)"
716
  msgstr "dag(en)"
717
 
718
+ #: includes/settings-page.php:284
719
  msgid "Maximum number of - most recent - revisions<br>to keep per post / page"
720
  msgstr ""
721
  "Maximaal aantal - meest recente - revisies<br>om te bewaren per post/pagina"
722
 
723
+ #: includes/settings-page.php:290
724
  msgid "('0' means: delete <u>ALL</u> revisions)"
725
  msgstr "('0' betekent: verwijder <u>ALLE</u> revisies)"
726
 
727
+ #: includes/settings-page.php:322
728
  msgid "DO NOT DELETE TRANSIENTS"
729
  msgstr "GEEN TRANSIENTS VERWIJDEREN"
730
 
731
+ #: includes/settings-page.php:349
732
+ msgid "Clear orphans"
733
+ msgstr "Verwijder wezen"
734
+
735
+ #: includes/settings-page.php:355
736
  msgid "Optimize InnoDB tables too"
737
  msgstr "Optimiliseer ook InnoDB tabellen"
738
 
739
+ #: includes/settings-page.php:374
740
  msgid "run optimization HOURLY"
741
  msgstr "voer de optimalisatie ELK UUR uit"
742
 
743
+ #: includes/settings-page.php:377
744
  msgid "run optimization TWICE A DAY"
745
  msgstr "voer de optimalisatie TWEE KEER PER DAG uit"
746
 
747
+ #: includes/settings-page.php:380
748
  msgid "run optimization DAILY"
749
  msgstr "voer de optimalisatie DAGELIJKS uit"
750
 
751
+ #: includes/settings-page.php:383
752
  msgid "run optimization WEEKLY"
753
  msgstr "voer de optimalisatie WEKELIJKS uit"
754
 
755
+ #: includes/settings-page.php:386
756
  msgid "run optimization MONTHLY"
757
  msgstr "voer de optimalisatie MAANDELIJKS uit"
758
 
759
+ #: includes/settings-page.php:396
760
  msgid "Time"
761
  msgstr "Tijd"
762
 
763
+ #: includes/settings-page.php:420
764
  msgid "Show '1-click' link in Admin Bar"
765
  msgstr "Toon de '1-klik' link in de Admin Balk"
766
 
767
+ #: includes/settings-page.php:426
768
  msgid "Show an icon in the Admin Menu"
769
  msgstr "Toon een icon in het Admin Menu"
770
 
771
+ #: includes/settings-page.php:431
772
  msgid "change will be visible after loading the next page"
773
  msgstr "wijziging wordt pas zichtbaar na het laden van de volgende pagina"
774
 
775
+ #: includes/settings-page.php:436 includes/settings-page.php:482
776
  msgid "Save Settings"
777
  msgstr "Bewaar instellingen"
778
 
779
+ #: includes/settings-page.php:438 includes/settings-page.php:484
780
  msgid "Go To Optimizer"
781
  msgstr "Ga naar Optimalisatie"
782
 
783
+ #: includes/settings-page.php:445
784
  msgid ""
785
  "EXCLUDE DATABASE TABLES FROM OPTIMIZATION:<br><span class=\"odb-underline-red"
786
  "\">CHECKED</span> TABLES <span class=\"odb-underline-red\">WON'T</span> BE "
790
  "underline-red\">AANGEVINKTE</span> TABELLEN ZULLEN <span class=\"odb-"
791
  "underline-red\">NIET</span> GEOPTIMALISEERD WORDEN!</span>"
792
 
793
+ #: includes/settings-page.php:451
794
  msgid "check all tables"
795
  msgstr "vink alle tabellen aan"
796
 
797
+ #: includes/settings-page.php:453
798
  msgid "uncheck all tables"
799
  msgstr "vink alle tabellen uit"
800
 
801
+ #: includes/settings-page.php:455
802
  msgid "check all NON-WordPress tables"
803
  msgstr "vink alle NIET-WordPress tabellen aan"
804
 
805
  # @ rvg-optimize-database
806
+ #: rvg-optimize-database.php:436 rvg-optimize-database.php:437
807
+ #: rvg-optimize-database.php:451 rvg-optimize-database.php:452
808
+ #: rvg-optimize-database.php:492 rvg-optimize-database.php:493
809
+ #: rvg-optimize-database.php:510 rvg-optimize-database.php:511
810
  msgid "Optimize Database"
811
  msgstr "Optimaliseer Database"
812
 
813
  # @ optimize_db
814
+ #: rvg-optimize-database.php:481
815
  msgid "Optimize DB (1 click)"
816
  msgstr "Optimaliseer DB (1 klik)"
817
 
818
+ #: rvg-optimize-database.php:629
819
  msgid "Optimize Database after Deleting Revisions LOGS HAVE BEEN CLEARED"
820
  msgstr "Optimize Database after Deleting Revisions LOGS ZIJN VERWIJDERD"
821
 
822
+ #: rvg-optimize-database.php:672
823
+ msgid "CLICK 'Start Optimization' TO ACTUALLY DELETE THE FOUND ITEMS"
824
+ msgstr "KLIK 'Start Optimization' OM DE GEVONDEN ITEMS TE VERWIJDEREN"
825
+
826
+ #: rvg-optimize-database.php:673
827
+ msgid "Cancel"
828
+ msgstr "Annuleer"
829
+
830
+ #: rvg-optimize-database.php:677
831
+ msgid "Analysis Done!"
832
+ msgstr "Analyze Gereed!"
833
+
834
+ #~ msgid "NUMBER OF oEmbed RECORDS"
835
+ #~ msgstr "AANTAL oEmbed RECORDS"
836
+
837
+ #~ msgid "NUMBER OF oEmbed RECORDS DELETED"
838
+ #~ msgstr "AANTAL VERWIJDERDE oEmbed RECORDS"
839
+
840
+ #~ msgid "No oEmbed records found to delete"
841
+ #~ msgstr "Geen oEmbed records gevonden om te verwijderen"
842
+
843
+ #~ msgid "NUMBER OF UNUSED TAGS DELETED"
844
+ #~ msgstr "AANTAL VERWIJDERDE ONGEBRUIKTE TAGS"
845
+
846
  #~ msgid "PLEASE DONATE!"
847
  #~ msgstr "DONEER!"
848
 
 
 
 
849
  #~ msgid "Delete Log File"
850
  #~ msgstr "Verwijder Logbestand"
851
 
readme.txt CHANGED
@@ -6,10 +6,12 @@ Plugin URI: http://cagewebdev.com/optimize-database-after-deleting-revisions-wor
6
  Tags: database, delete, revisions, optimize, post, posts, page, pages, clean, clean up, trash, spam, trashed, spammed, database size, scheduler, transients, unused tags, pingback, trackback, unix cron tab, crontab, multisite, custom post types, oembed
7
  Author URI: http://cagewebdev.com
8
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
 
9
  Requires at least: 2.8
10
- Tested up to: 4.9.8
11
- Stable tag: 4.6.3
12
- Version: 4.6.3
 
13
  License: GPLv2 or later
14
 
15
  == Description ==
@@ -38,6 +40,11 @@ You can find the settings page in the WP Admin Panel &raquo; Optimize Database -
38
  = Excluding specific posts/pages from deleting revisions =
39
  If you want to keep revisions for a specific post/page (no matter what the other settings are), create a custom field named 'keep_revisions' for that post/page and give it the value 'Y'<br>
40
 
 
 
 
 
 
41
  = Starting the Optimization =
42
  You can start the Optimization in the WP Admin Panel &raquo; Optimize Database.<br>
43
  Note: if you use the Scheduler the Optimization will run automatically!<br>
@@ -104,6 +111,14 @@ http://cagewebdev.com/wordpress-plugins/
104
  * If you run the plugin from any of the sites, it will cleanup ALL the sites in the network!
105
 
106
  == Changelog ==
 
 
 
 
 
 
 
 
107
  = 4.6.3 [08/23/2018] =
108
  * CHANGE: Removed the MyISAM engine for the log table (now it uses the default-storage-engine of the database)
109
 
@@ -473,9 +488,12 @@ http://cagewebdev.com/wordpress-plugins/
473
  * Change the settings in the WP Admin Panel &raquo; Settings &raquo; Optimize Database -or- via the WP Admin Panel &raquo; Optimize Database icon (depends on settings)
474
 
475
  = How do I run this plugin? =
476
- * WP Admin Panel &raquo; Optimize Database. Then click the 'Start Optimization'-button -or- via the WP Admin Panel &raquo; Optimize Database icon (depends on settings)
477
  * Click the 'Optimize DB (1 click)' link in the Admin Bar (if enabled)
478
 
 
 
 
479
  = Why do I see 'InnoDB table: skipped...'? =
480
  * That's because optimizing InnoDB tables is not really efficient, so change the table type to MyISAM to have them being optimized.
481
  * Update: if you want to optimize your InnoDB tables too, just check the 'Optimize InnoDB tables too' option on the settings page
6
  Tags: database, delete, revisions, optimize, post, posts, page, pages, clean, clean up, trash, spam, trashed, spammed, database size, scheduler, transients, unused tags, pingback, trackback, unix cron tab, crontab, multisite, custom post types, oembed
7
  Author URI: http://cagewebdev.com
8
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
9
+ Contributors: cageehv
10
  Requires at least: 2.8
11
+ Requires PHP: 5.0
12
+ Tested up to: 5.0
13
+ Stable tag: 4.7.1
14
+ Version: 4.7.1
15
  License: GPLv2 or later
16
 
17
  == Description ==
40
  = Excluding specific posts/pages from deleting revisions =
41
  If you want to keep revisions for a specific post/page (no matter what the other settings are), create a custom field named 'keep_revisions' for that post/page and give it the value 'Y'<br>
42
 
43
+ = Running the Analyzer =
44
+ Before running the Optimization, you can run the Database Analyzer first<br>
45
+ Go to: Dashboard > Tools > Optimize Database<br>
46
+ Click the 'Analyze Database' button<br>
47
+
48
  = Starting the Optimization =
49
  You can start the Optimization in the WP Admin Panel &raquo; Optimize Database.<br>
50
  Note: if you use the Scheduler the Optimization will run automatically!<br>
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.1 [11/11/2018] =
115
+ * BUG FIX: Fixed an 'undefined variable' notice
116
+
117
+ = 4.7 [11/10/2018] =
118
+ * NEW: Optional analysis before actual cleaning
119
+ * CHANGE: Many minor improvements
120
+ * BUG FIX: Several bug fixes
121
+
122
  = 4.6.3 [08/23/2018] =
123
  * CHANGE: Removed the MyISAM engine for the log table (now it uses the default-storage-engine of the database)
124
 
488
  * Change the settings in the WP Admin Panel &raquo; Settings &raquo; Optimize Database -or- via the WP Admin Panel &raquo; Optimize Database icon (depends on settings)
489
 
490
  = How do I run this plugin? =
491
+ * Go to: Dashboard &raquo; Tools &araquo; Optimize Database. Then click the 'Start Optimization'-button -or- via the WP Admin Panel &raquo; Optimize Database icon (depends on settings)
492
  * Click the 'Optimize DB (1 click)' link in the Admin Bar (if enabled)
493
 
494
+ = How do I run the Analyzer? =
495
+ * Go to: Dashboard &raquo; Tools &raquo; Optimize Database and click the 'Analyze Database' button
496
+
497
  = Why do I see 'InnoDB table: skipped...'? =
498
  * That's because optimizing InnoDB tables is not really efficient, so change the table type to MyISAM to have them being optimized.
499
  * Update: if you want to optimize your InnoDB tables too, just check the 'Optimize InnoDB tables too' option on the settings page
rvg-optimize-database.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package Optimize Database after Deleting Revisions
4
- * @version 4.6.3
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.6.3
14
  */
15
 
16
  /********************************************************************************************
@@ -24,8 +24,8 @@ $odb_class = new OptimizeDatabase();
24
 
25
  class OptimizeDatabase {
26
  // VERSION
27
- var $odb_version = '4.6.3';
28
- var $odb_release_date = '08/23/2018';
29
 
30
  // PLUGIN OPTIONS
31
  var $odb_rvg_options = array();
@@ -203,7 +203,9 @@ class OptimizeDatabase {
203
  if(!isset($this->odb_rvg_options['clear_pingbacks']))
204
  $this->odb_rvg_options['clear_pingbacks'] = 'N';
205
  if(!isset($this->odb_rvg_options['clear_oembed']))
206
- $this->odb_rvg_options['clear_oembed'] = 'N';
 
 
207
  if(!isset($this->odb_rvg_options['clear_spam']))
208
  $this->odb_rvg_options['clear_spam'] = 'N';
209
  if(!isset($this->odb_rvg_options['clear_tags']))
@@ -295,7 +297,13 @@ class OptimizeDatabase {
295
  if($setting) {
296
  $this->odb_rvg_options['rvg_clear_oembed'] = $this->odb_multisite_obj->odb_ms_get_option('rvg_clear_oembed');
297
  $this->odb_multisite_obj->odb_ms_delete_option('rvg_clear_oembed');
298
- }
 
 
 
 
 
 
299
 
300
  $setting = $this->odb_multisite_obj->odb_ms_get_option('rvg_clear_spam');
301
  if($setting) {
@@ -633,28 +641,53 @@ class OptimizeDatabase {
633
  // SHOW CURRENT SETTINGS
634
  $this->odb_displayer_obj->display_current_settings();
635
  } // if(!$scheduler)
636
-
637
- if ($action != 'run' && !$scheduler) {
638
  /****************************************************************************************
639
  * START SCREEN (SHOW SETTINGS + BUTTONS)
640
  ****************************************************************************************/
641
  $this->odb_displayer_obj->display_start_buttons($action);
642
  } else {
 
643
  /****************************************************************************************
644
  * RUN CLEANING AND OPTIMIZATION
645
  ****************************************************************************************/
646
  $this->odb_displayer_obj->display_start_buttons($action);
647
-
648
  // REGISTER THE LAST RUN
649
  $this->odb_rvg_options['last_run'] = current_time('M j, Y @ H:i', 0);
650
  // DELETE REDUNDANT DATA
651
- $this->odb_cleaner_obj->odb_run_cleaner($scheduler);
652
- // OPTIMIZE DATABASE TABLES
653
- $this->odb_cleaner_obj->odb_run_optimizer($scheduler);
654
- // SHOW RESULTS
655
- $this->odb_cleaner_obj->odb_savings($scheduler);
 
 
 
656
  // SHOW 'DONE' PARAGRAPH
657
- if(!$scheduler) $this->odb_cleaner_obj->odb_done();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
658
 
659
  $this->odb_rvg_options['last_run_seconds'] = $this->odb_last_run_seconds;
660
 
1
  <?php
2
  /**
3
  * @package Optimize Database after Deleting Revisions
4
+ * @version 4.7.1
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.1
14
  */
15
 
16
  /********************************************************************************************
24
 
25
  class OptimizeDatabase {
26
  // VERSION
27
+ var $odb_version = '4.7.1';
28
+ var $odb_release_date = '11/11/2018';
29
 
30
  // PLUGIN OPTIONS
31
  var $odb_rvg_options = array();
203
  if(!isset($this->odb_rvg_options['clear_pingbacks']))
204
  $this->odb_rvg_options['clear_pingbacks'] = 'N';
205
  if(!isset($this->odb_rvg_options['clear_oembed']))
206
+ $this->odb_rvg_options['clear_oembed'] = 'N';
207
+ if(!isset($this->odb_rvg_options['clear_orphans']))
208
+ $this->odb_rvg_options['clear_orphans'] = 'N';
209
  if(!isset($this->odb_rvg_options['clear_spam']))
210
  $this->odb_rvg_options['clear_spam'] = 'N';
211
  if(!isset($this->odb_rvg_options['clear_tags']))
297
  if($setting) {
298
  $this->odb_rvg_options['rvg_clear_oembed'] = $this->odb_multisite_obj->odb_ms_get_option('rvg_clear_oembed');
299
  $this->odb_multisite_obj->odb_ms_delete_option('rvg_clear_oembed');
300
+ }
301
+
302
+ $setting = $this->odb_multisite_obj->odb_ms_get_option('rvg_clear_orphans');
303
+ if($setting) {
304
+ $this->odb_rvg_options['rvg_clear_orphans'] = $this->odb_multisite_obj->odb_ms_get_option('rvg_clear_orphans');
305
+ $this->odb_multisite_obj->odb_ms_delete_option('rvg_clear_orphans');
306
+ }
307
 
308
  $setting = $this->odb_multisite_obj->odb_ms_get_option('rvg_clear_spam');
309
  if($setting) {
641
  // SHOW CURRENT SETTINGS
642
  $this->odb_displayer_obj->display_current_settings();
643
  } // if(!$scheduler)
644
+
645
+ if ($action != 'run' && $action != 'analyze' && !$scheduler) {
646
  /****************************************************************************************
647
  * START SCREEN (SHOW SETTINGS + BUTTONS)
648
  ****************************************************************************************/
649
  $this->odb_displayer_obj->display_start_buttons($action);
650
  } else {
651
+ $analyze = ($action == 'analyze');
652
  /****************************************************************************************
653
  * RUN CLEANING AND OPTIMIZATION
654
  ****************************************************************************************/
655
  $this->odb_displayer_obj->display_start_buttons($action);
656
+
657
  // REGISTER THE LAST RUN
658
  $this->odb_rvg_options['last_run'] = current_time('M j, Y @ H:i', 0);
659
  // DELETE REDUNDANT DATA
660
+ $this->odb_cleaner_obj->odb_run_cleaner($scheduler, $analyze);
661
+
662
+ if (!$analyze) {
663
+ // OPTIMIZE DATABASE TABLES
664
+ $this->odb_cleaner_obj->odb_run_optimizer($scheduler);
665
+ // SHOW RESULTS
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);
673
+ $btn1 = __('Cancel', $this->odb_txt_domain);
674
+ $btn2 = __('Start Optimization', $this->odb_txt_domain);
675
+ ?>
676
+ <div class="odb-title-bar">
677
+ <h2><?php _e('Analysis Done!', $this->odb_txt_domain)?></h2>
678
+ </div>
679
+ <br><br>
680
+ <div id="odb-start-buttons" class="odb-padding-left">
681
+ <p>
682
+ <h4 class="odb-red odb-bold"><?php echo $msg1?></h4>
683
+ <br>
684
+ <input class="button odb-normal" type="button" name="cancel" value="<?php echo $btn1?>" onclick="self.location='tools.php?page=rvg-optimize-database'">
685
+ &nbsp;
686
+ &nbsp;<input class="button-primary button-large" type="button" name="start_optimization" value="Start Optimization" onclick="self.location='tools.php?page=rvg-optimize-database&action=run'" class="odb-bold">
687
+ </p>
688
+ </div><!-- /odb-start-buttons -->
689
+ <?php
690
+ } // if ($analyze)
691
 
692
  $this->odb_rvg_options['last_run_seconds'] = $this->odb_last_run_seconds;
693