Optimize Database after Deleting Revisions - Version 2.7.6

Version Description

[01/16/2014] = * BUG FIX: empty lines removed from output (gave problems with some RSS feeds)

Download this release

Release Info

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

Code changes from version 2.7.5 to 2.7.6

Files changed (2) hide show
  1. readme.txt +5 -2
  2. rvg-optimize-db.php +53 -95
readme.txt CHANGED
@@ -8,8 +8,8 @@ Author URI: http://cagewebdev.com
8
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
9
  Requires at least: 2.0
10
  Tested up to: 3.8
11
- Stable tag: 2.7.5
12
- Version: 2.7.5
13
 
14
  == Description ==
15
 
@@ -54,6 +54,9 @@ No warranty, use at own risk!
54
 
55
  == Changelog ==
56
 
 
 
 
57
  = 2.7.5 [12/13/2013] =
58
  * CHANGE: two queries optimized for better performance
59
 
8
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
9
  Requires at least: 2.0
10
  Tested up to: 3.8
11
+ Stable tag: 2.7.6
12
+ Version: 2.7.6
13
 
14
  == Description ==
15
 
54
 
55
  == Changelog ==
56
 
57
+ = 2.7.6 [01/16/2014] =
58
+ * BUG FIX: empty lines removed from output (gave problems with some RSS feeds)
59
+
60
  = 2.7.5 [12/13/2013] =
61
  * CHANGE: two queries optimized for better performance
62
 
rvg-optimize-db.php CHANGED
@@ -1,20 +1,19 @@
1
  <?php
2
- $odb_version = '2.7.5';
3
- $odb_release_date = '12/13/2013';
4
  /**
5
  * @package Optimize Database after Deleting Revisions
6
- * @version 2.7.5
7
  */
8
  /*
9
  Plugin Name: Optimize Database after Deleting Revisions
10
  Plugin URI: http://cagewebdev.com/index.php/optimize-database-after-deleting-revisions-wordpress-plugin/
11
  Description: Optimizes the Wordpress Database after Cleaning it out - <a href="options-general.php?page=rvg_odb_admin"><strong>plug in options</strong></a>
12
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
13
- Version: 2.7.5
14
  Author URI: http://cagewebdev.com
15
  */
16
- ?>
17
- <?php
18
  /********************************************************************************************
19
 
20
  ADD THE 'OPTIMIZE DATABASE' ITEM TO THE TOOLS MENU
@@ -27,7 +26,6 @@ function optimize_db_main()
27
  }
28
  add_action('admin_menu', 'optimize_db_main');
29
 
30
-
31
  /********************************************************************************************
32
 
33
  ADD THE 'OPTIMIZE DB OPTIONS' ITEM TO THE SETTINGS MENU
@@ -41,7 +39,6 @@ function rvg_odb_admin_menu()
41
  }
42
  add_action( 'admin_menu', 'rvg_odb_admin_menu' );
43
 
44
-
45
  /********************************************************************************************
46
 
47
  ADD THE '1 CLICK OPTIMIZE DATABASE' ITEM TO THE ADMIN BAR (IF ACTIVATED)
@@ -56,7 +53,6 @@ function rvg_odb_admin_bar()
56
  $rvg_odb_adminbar = get_option('rvg_odb_adminbar');
57
  if($rvg_odb_adminbar == "Y") add_action( 'wp_before_admin_bar_render', 'rvg_odb_admin_bar' );
58
 
59
-
60
  /********************************************************************************************
61
 
62
  ACTIONS FOR THE SCHEDULER
@@ -92,8 +88,7 @@ function rvg_activate_plugin()
92
  if( !wp_next_scheduled( 'rvg_optimize_database' ))
93
  wp_schedule_event( time(), $rvg_odb_schedule, 'rvg_optimize_database' );
94
  }
95
- } # rvg_activate_plugin()
96
-
97
 
98
  /********************************************************************************************
99
 
@@ -250,6 +245,7 @@ function schedule_changed()
250
  $("#schedulehour").hide();
251
  }
252
  </script>
 
253
  <form name="options" method="post" action="">
254
  <div class="wrap">
255
  <h2>Using Optimize Database after Deleting Revisions</h2>
@@ -302,7 +298,7 @@ if($rvg_odb_logging_on == 'Y') $rvg_odb_logging_on_checked = ' checked="checke
302
  <tr>
303
  <td width="50%" align="right" valign="top"><span style="font-weight:bold;">Delete expired transients</span></td>
304
  <td width="50%" valign="top"><input name="rvg_clear_transients" type="checkbox" value="Y" <?php echo $rvg_clear_transients_checked?> /></td>
305
- </tr>
306
  <tr>
307
  <td width="50%" align="right" valign="top"><span style="font-weight:bold;">Keep a log</span></td>
308
  <td width="50%" valign="top"><input name="rvg_odb_logging_on" type="checkbox" value="Y" <?php echo $rvg_odb_logging_on_checked?> /></td>
@@ -319,9 +315,8 @@ if($rvg_odb_logging_on == 'Y') $rvg_odb_logging_on_checked = ' checked="checke
319
  </select>
320
  <script type="text/javascript">
321
  document.options.rvg_odb_schedule.value = '<?php echo $rvg_odb_schedule; ?>';
322
- </script>
323
- <span id="schedulehour" style="display:none;">
324
- <span style="font-weight:bold;">Time</span>
325
  <select name="rvg_odb_schedulehour" id="rvg_odb_schedulehour">
326
  <?php
327
  for($i=0; $i<=23; $i++)
@@ -334,10 +329,9 @@ if($rvg_odb_logging_on == 'Y') $rvg_odb_logging_on_checked = ' checked="checke
334
  </select>
335
  <script type="text/javascript">
336
  document.options.rvg_odb_schedulehour.value = '<?php echo $rvg_odb_schedulehour; ?>';
337
- </script>
338
- </span>
339
- <script type="text/javascript">schedule_changed();</script>
340
- </td>
341
  </tr>
342
  <tr>
343
  <td align="right" valign="top"><span style="font-weight:bold;">Show '1-click' link in Admin Bar</span></td>
@@ -397,8 +391,7 @@ if($rvg_odb_logging_on == 'Y') $rvg_odb_logging_on_checked = ' checked="checke
397
  </div>
398
  </form>
399
  <?php
400
- } // rvg_odb_options_page
401
-
402
 
403
  /********************************************************************************************
404
 
@@ -516,7 +509,7 @@ function rvg_optimize_db()
516
  <strong>Delete trashed items:</strong> <span style="font-weight:bold;color:#00F;"><?php echo $clear_trash_yn?></span><br />
517
  <strong>Delete spammed items:</strong> <span style="font-weight:bold;color:#00F;"><?php echo $clear_spam_yn?></span><br />
518
  <strong>Delete unused tags:</strong> <span style="font-weight:bold;color:#00F;"><?php echo $clear_tags_yn?></span><br />
519
- <strong>Delete expired transients:</strong> <span style="font-weight:bold;color:#00F;"><?php echo $clear_transients_yn?></span><br />
520
  <strong>Keep a log:</strong> <span style="font-weight:bold;color:#00F;"><?php echo $rvg_odb_logging_on_yn?></span><br />
521
  <strong>Number of excluded tables:</strong> <span style="font-weight:bold;color:#00F;"><?php echo $number_excluded?></span><br />
522
  <strong>Scheduler:</strong> <span style="font-weight:bold;color:#00F;"><?php echo $rvg_odb_schedule_txt?></span>
@@ -548,8 +541,6 @@ function rvg_optimize_db()
548
  <input class="button" type="button" name="delete_log" value="Delete Log File" onclick="self.location='tools.php?page=rvg-optimize-db.php&action=delete_log'" style="font-weight:normal;" />
549
  <?php
550
  }
551
- ?>
552
- <?php
553
  $action = '';
554
  if(isset($_REQUEST['action'])) $action = $_REQUEST['action'];
555
  if($action != 'run')
@@ -618,15 +609,12 @@ function rvg_optimize_db()
618
 
619
  // NUMBER OF DELETED REVISIONS FOR LOG FILE
620
  $log_arr["revisions"] = $total_deleted;
621
- ?>
622
- <?php
623
  /****************************************************************************************
624
 
625
  DELETE TRASHED ITEMS
626
 
627
  ******************************************************************************************/
628
- ?>
629
- <?php
630
  if($clear_trash == 'Y')
631
  {
632
  // GET TRASHED POSTS / PAGES AND COMMENTS
@@ -670,15 +658,12 @@ function rvg_optimize_db()
670
  $log_arr["trash"] = $total_deleted;
671
 
672
  } // if($clear_trash == 'Y')
673
- ?>
674
- <?php
675
  /****************************************************************************************
676
 
677
  DELETE SPAMMED ITEMS
678
 
679
  ******************************************************************************************/
680
- ?>
681
- <?php
682
  if($clear_spam == 'Y')
683
  {
684
  // GET SPAMMED COMMENTS
@@ -722,15 +707,12 @@ function rvg_optimize_db()
722
 
723
  // NUMBER OF SPAM DELETED FOR LOG FILE
724
  $log_arr["spam"] = $total_deleted;
725
- ?>
726
- <?php
727
  /****************************************************************************************
728
 
729
  DELETE UNUSED TAGS
730
 
731
  ******************************************************************************************/
732
- ?>
733
- <?php
734
  if($clear_tags == 'Y')
735
  {
736
  // DELETE UNUSED TAGS
@@ -763,15 +745,12 @@ function rvg_optimize_db()
763
 
764
  // NUMBER OF tags DELETED FOR LOG FILE
765
  $log_arr["tags"] = $total_deleted;
766
- ?>
767
- <?php
768
  /****************************************************************************************
769
 
770
  DELETE EXPIRED TRANSIENTS
771
 
772
  ******************************************************************************************/
773
- ?>
774
- <?php
775
  if($clear_transients == 'Y')
776
  {
777
  // DELETE UNUSED TAGS
@@ -804,15 +783,12 @@ function rvg_optimize_db()
804
 
805
  // NUMBER OF transients DELETED FOR LOG FILE
806
  $log_arr["transients"] = $total_deleted;
807
- ?>
808
- <?php
809
  /****************************************************************************************
810
 
811
  DELETE ORPHANS
812
 
813
  ******************************************************************************************/
814
- ?>
815
- <?php
816
  $total_deleted = rvg_delete_orphans(true);
817
  if($total_deleted)
818
  {
@@ -838,8 +814,7 @@ function rvg_optimize_db()
838
  }
839
  // FOR LOG FILE
840
  $log_arr["orphans"] = $total_deleted;
841
- ?>
842
- <?php
843
  /****************************************************************************************
844
 
845
  OPTIMIZE DATABASE TABLES
@@ -921,11 +896,8 @@ function rvg_optimize_db()
921
  <input class="button" type="button" name="delete_log" value="Delete Log File" onclick="self.location='tools.php?page=rvg-optimize-db.php&action=delete_log'" style="font-weight:normal;" />
922
  <?php
923
  }
924
- ?>
925
- <?php
926
- } // rvg_optimize_db()
927
- ?>
928
- <?php
929
  /********************************************************************************************
930
 
931
  EXECUTE OPTIMIZATION VIA CRON JOB
@@ -1053,9 +1025,8 @@ function rvg_optimize_db_cron()
1053
  $total_savings += ($start_size - $end_size);
1054
  update_option('rvg_odb_total_savings',$total_savings);
1055
 
1056
- } // rvg_optimize_db_cron()
1057
- ?>
1058
- <?php
1059
  /********************************************************************************************
1060
 
1061
  DELETE THE REVISIONS
@@ -1111,9 +1082,8 @@ function rvg_delete_revisions($results, $display, $max_revisions)
1111
  } // if($display)
1112
  } // for($i=0; $i<count($results); $i++)
1113
  return $total_deleted;
1114
- } // rvg_delete_revisions()
1115
- ?>
1116
- <?php
1117
  /********************************************************************************************
1118
 
1119
  DELETE TRASHED POSTS AND PAGES
@@ -1162,9 +1132,8 @@ function rvg_delete_trash($results, $display)
1162
 
1163
  return $total_deleted;
1164
 
1165
- } // rvg_delete_trash()
1166
- ?>
1167
- <?php
1168
  /********************************************************************************************
1169
 
1170
  DELETE SPAMMED ITEMS
@@ -1202,9 +1171,8 @@ function rvg_delete_spam($results, $display)
1202
 
1203
  return $total_deleted;
1204
 
1205
- } // rvg_delete_spam()
1206
- ?>
1207
- <?php
1208
  /********************************************************************************************
1209
 
1210
  DELETE UNUSED TAGS
@@ -1223,9 +1191,8 @@ function rvg_delete_tags()
1223
  }
1224
 
1225
  return $total_deleted;
1226
- } // rvg_delete_tags()
1227
- ?>
1228
- <?php
1229
  /********************************************************************************************
1230
 
1231
  DELETE EXPIRED TRANSIENTS
@@ -1290,9 +1257,8 @@ function rvg_delete_transients()
1290
  $wpdb -> get_results($sql);
1291
 
1292
  return $total_deleted;
1293
- } // rvg_delete_transients()
1294
- ?>
1295
- <?php
1296
  /********************************************************************************************
1297
 
1298
  DELETE ORPHAN POSTMETA RECORDS
@@ -1348,9 +1314,8 @@ function rvg_delete_orphans($display)
1348
 
1349
  return ($meta_orphans + $post_orphans);
1350
 
1351
- } // rvg_delete_orphans()
1352
- ?>
1353
- <?php
1354
  /********************************************************************************************
1355
 
1356
  OPTIMIZE DATABASE TABLES
@@ -1404,9 +1369,8 @@ function rvg_optimize_tables($display)
1404
  } // while($row = mysql_fetch_row($names))
1405
  return $cnt;
1406
 
1407
- } // rvg_optimize_tables()
1408
- ?>
1409
- <?php
1410
  /********************************************************************************************
1411
 
1412
  FIX WP_ONLY (DEPRECIATED FROM v2.2)
@@ -1437,9 +1401,8 @@ function rvg_fix_wp_only()
1437
  ";
1438
  $wpdb -> get_results($sql);
1439
 
1440
- } # function rvg_fix_wp_only()
1441
- ?>
1442
- <?php
1443
  /********************************************************************************************
1444
 
1445
  WRITE LINE TO LOG FILE
@@ -1543,9 +1506,8 @@ td {
1543
  file_put_contents($file,$html,FILE_APPEND);
1544
  }
1545
 
1546
- } // rvg_write_log
1547
- ?>
1548
- <?php
1549
  /********************************************************************************************
1550
 
1551
  GET REVISIONS
@@ -1566,9 +1528,8 @@ function rvg_get_revisions($max_revisions)
1566
 
1567
  return $wpdb -> get_results($sql);
1568
 
1569
- } // rvg_get_revisions
1570
- ?>
1571
- <?php
1572
  /********************************************************************************************
1573
 
1574
  GET TRASHED POSTS / PAGES AND COMMENTS
@@ -1591,9 +1552,8 @@ function rvg_get_trash()
1591
 
1592
  return $wpdb -> get_results($sql);
1593
 
1594
- } // rvg_get_trash
1595
- ?>
1596
- <?php
1597
  /********************************************************************************************
1598
 
1599
  GET SPAMMED COMMENTS
@@ -1612,9 +1572,8 @@ function rvg_get_spam()
1612
 
1613
  return $wpdb -> get_results($sql);
1614
 
1615
- } // rvg_get_trash
1616
- ?>
1617
- <?php
1618
  /********************************************************************************************
1619
 
1620
  CALCULATE THE SIZE OF THE WORDPRESS DATABASE (IN BYTES)
@@ -1636,9 +1595,8 @@ function rvg_get_db_size()
1636
 
1637
  return $res[0]->size;
1638
 
1639
- } // rvg_get_db_size
1640
- ?>
1641
- <?php
1642
  /********************************************************************************************
1643
 
1644
  FORMAT SIZES FROM BYTES TO KB OR MB
@@ -1652,5 +1610,5 @@ function rvg_format_size($size, $precision=1)
1652
  $table_size = (round($size/1024,$precision)).' KB';
1653
 
1654
  return $table_size;
1655
- } // rvg_format_size
1656
- ?>
1
  <?php
2
+ $odb_version = '2.7.6';
3
+ $odb_release_date = '01/16/2014';
4
  /**
5
  * @package Optimize Database after Deleting Revisions
6
+ * @version 2.7.6
7
  */
8
  /*
9
  Plugin Name: Optimize Database after Deleting Revisions
10
  Plugin URI: http://cagewebdev.com/index.php/optimize-database-after-deleting-revisions-wordpress-plugin/
11
  Description: Optimizes the Wordpress Database after Cleaning it out - <a href="options-general.php?page=rvg_odb_admin"><strong>plug in options</strong></a>
12
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
13
+ Version: 2.7.6
14
  Author URI: http://cagewebdev.com
15
  */
16
+
 
17
  /********************************************************************************************
18
 
19
  ADD THE 'OPTIMIZE DATABASE' ITEM TO THE TOOLS MENU
26
  }
27
  add_action('admin_menu', 'optimize_db_main');
28
 
 
29
  /********************************************************************************************
30
 
31
  ADD THE 'OPTIMIZE DB OPTIONS' ITEM TO THE SETTINGS MENU
39
  }
40
  add_action( 'admin_menu', 'rvg_odb_admin_menu' );
41
 
 
42
  /********************************************************************************************
43
 
44
  ADD THE '1 CLICK OPTIMIZE DATABASE' ITEM TO THE ADMIN BAR (IF ACTIVATED)
53
  $rvg_odb_adminbar = get_option('rvg_odb_adminbar');
54
  if($rvg_odb_adminbar == "Y") add_action( 'wp_before_admin_bar_render', 'rvg_odb_admin_bar' );
55
 
 
56
  /********************************************************************************************
57
 
58
  ACTIONS FOR THE SCHEDULER
88
  if( !wp_next_scheduled( 'rvg_optimize_database' ))
89
  wp_schedule_event( time(), $rvg_odb_schedule, 'rvg_optimize_database' );
90
  }
91
+ } # rvg_activate_plugin ()
 
92
 
93
  /********************************************************************************************
94
 
245
  $("#schedulehour").hide();
246
  }
247
  </script>
248
+
249
  <form name="options" method="post" action="">
250
  <div class="wrap">
251
  <h2>Using Optimize Database after Deleting Revisions</h2>
298
  <tr>
299
  <td width="50%" align="right" valign="top"><span style="font-weight:bold;">Delete expired transients</span></td>
300
  <td width="50%" valign="top"><input name="rvg_clear_transients" type="checkbox" value="Y" <?php echo $rvg_clear_transients_checked?> /></td>
301
+ </tr>
302
  <tr>
303
  <td width="50%" align="right" valign="top"><span style="font-weight:bold;">Keep a log</span></td>
304
  <td width="50%" valign="top"><input name="rvg_odb_logging_on" type="checkbox" value="Y" <?php echo $rvg_odb_logging_on_checked?> /></td>
315
  </select>
316
  <script type="text/javascript">
317
  document.options.rvg_odb_schedule.value = '<?php echo $rvg_odb_schedule; ?>';
318
+ </script>
319
+ <span id="schedulehour" style="display:none;"> <span style="font-weight:bold;">Time</span>
 
320
  <select name="rvg_odb_schedulehour" id="rvg_odb_schedulehour">
321
  <?php
322
  for($i=0; $i<=23; $i++)
329
  </select>
330
  <script type="text/javascript">
331
  document.options.rvg_odb_schedulehour.value = '<?php echo $rvg_odb_schedulehour; ?>';
332
+ </script>
333
+ </span>
334
+ <script type="text/javascript">schedule_changed();</script></td>
 
335
  </tr>
336
  <tr>
337
  <td align="right" valign="top"><span style="font-weight:bold;">Show '1-click' link in Admin Bar</span></td>
391
  </div>
392
  </form>
393
  <?php
394
+ } // rvg_odb_options_page ()
 
395
 
396
  /********************************************************************************************
397
 
509
  <strong>Delete trashed items:</strong> <span style="font-weight:bold;color:#00F;"><?php echo $clear_trash_yn?></span><br />
510
  <strong>Delete spammed items:</strong> <span style="font-weight:bold;color:#00F;"><?php echo $clear_spam_yn?></span><br />
511
  <strong>Delete unused tags:</strong> <span style="font-weight:bold;color:#00F;"><?php echo $clear_tags_yn?></span><br />
512
+ <strong>Delete expired transients:</strong> <span style="font-weight:bold;color:#00F;"><?php echo $clear_transients_yn?></span><br />
513
  <strong>Keep a log:</strong> <span style="font-weight:bold;color:#00F;"><?php echo $rvg_odb_logging_on_yn?></span><br />
514
  <strong>Number of excluded tables:</strong> <span style="font-weight:bold;color:#00F;"><?php echo $number_excluded?></span><br />
515
  <strong>Scheduler:</strong> <span style="font-weight:bold;color:#00F;"><?php echo $rvg_odb_schedule_txt?></span>
541
  <input class="button" type="button" name="delete_log" value="Delete Log File" onclick="self.location='tools.php?page=rvg-optimize-db.php&action=delete_log'" style="font-weight:normal;" />
542
  <?php
543
  }
 
 
544
  $action = '';
545
  if(isset($_REQUEST['action'])) $action = $_REQUEST['action'];
546
  if($action != 'run')
609
 
610
  // NUMBER OF DELETED REVISIONS FOR LOG FILE
611
  $log_arr["revisions"] = $total_deleted;
612
+
 
613
  /****************************************************************************************
614
 
615
  DELETE TRASHED ITEMS
616
 
617
  ******************************************************************************************/
 
 
618
  if($clear_trash == 'Y')
619
  {
620
  // GET TRASHED POSTS / PAGES AND COMMENTS
658
  $log_arr["trash"] = $total_deleted;
659
 
660
  } // if($clear_trash == 'Y')
661
+
 
662
  /****************************************************************************************
663
 
664
  DELETE SPAMMED ITEMS
665
 
666
  ******************************************************************************************/
 
 
667
  if($clear_spam == 'Y')
668
  {
669
  // GET SPAMMED COMMENTS
707
 
708
  // NUMBER OF SPAM DELETED FOR LOG FILE
709
  $log_arr["spam"] = $total_deleted;
710
+
 
711
  /****************************************************************************************
712
 
713
  DELETE UNUSED TAGS
714
 
715
  ******************************************************************************************/
 
 
716
  if($clear_tags == 'Y')
717
  {
718
  // DELETE UNUSED TAGS
745
 
746
  // NUMBER OF tags DELETED FOR LOG FILE
747
  $log_arr["tags"] = $total_deleted;
748
+
 
749
  /****************************************************************************************
750
 
751
  DELETE EXPIRED TRANSIENTS
752
 
753
  ******************************************************************************************/
 
 
754
  if($clear_transients == 'Y')
755
  {
756
  // DELETE UNUSED TAGS
783
 
784
  // NUMBER OF transients DELETED FOR LOG FILE
785
  $log_arr["transients"] = $total_deleted;
786
+
 
787
  /****************************************************************************************
788
 
789
  DELETE ORPHANS
790
 
791
  ******************************************************************************************/
 
 
792
  $total_deleted = rvg_delete_orphans(true);
793
  if($total_deleted)
794
  {
814
  }
815
  // FOR LOG FILE
816
  $log_arr["orphans"] = $total_deleted;
817
+
 
818
  /****************************************************************************************
819
 
820
  OPTIMIZE DATABASE TABLES
896
  <input class="button" type="button" name="delete_log" value="Delete Log File" onclick="self.location='tools.php?page=rvg-optimize-db.php&action=delete_log'" style="font-weight:normal;" />
897
  <?php
898
  }
899
+ } // rvg_optimize_db ()
900
+
 
 
 
901
  /********************************************************************************************
902
 
903
  EXECUTE OPTIMIZATION VIA CRON JOB
1025
  $total_savings += ($start_size - $end_size);
1026
  update_option('rvg_odb_total_savings',$total_savings);
1027
 
1028
+ } // rvg_optimize_db_cron ()
1029
+
 
1030
  /********************************************************************************************
1031
 
1032
  DELETE THE REVISIONS
1082
  } // if($display)
1083
  } // for($i=0; $i<count($results); $i++)
1084
  return $total_deleted;
1085
+ } // rvg_delete_revisions ()
1086
+
 
1087
  /********************************************************************************************
1088
 
1089
  DELETE TRASHED POSTS AND PAGES
1132
 
1133
  return $total_deleted;
1134
 
1135
+ } // rvg_delete_trash ()
1136
+
 
1137
  /********************************************************************************************
1138
 
1139
  DELETE SPAMMED ITEMS
1171
 
1172
  return $total_deleted;
1173
 
1174
+ } // rvg_delete_spam ()
1175
+
 
1176
  /********************************************************************************************
1177
 
1178
  DELETE UNUSED TAGS
1191
  }
1192
 
1193
  return $total_deleted;
1194
+ } // rvg_delete_tags ()
1195
+
 
1196
  /********************************************************************************************
1197
 
1198
  DELETE EXPIRED TRANSIENTS
1257
  $wpdb -> get_results($sql);
1258
 
1259
  return $total_deleted;
1260
+ } // rvg_delete_transients ()
1261
+
 
1262
  /********************************************************************************************
1263
 
1264
  DELETE ORPHAN POSTMETA RECORDS
1314
 
1315
  return ($meta_orphans + $post_orphans);
1316
 
1317
+ } // rvg_delete_orphans ()
1318
+
 
1319
  /********************************************************************************************
1320
 
1321
  OPTIMIZE DATABASE TABLES
1369
  } // while($row = mysql_fetch_row($names))
1370
  return $cnt;
1371
 
1372
+ } // rvg_optimize_tables ()
1373
+
 
1374
  /********************************************************************************************
1375
 
1376
  FIX WP_ONLY (DEPRECIATED FROM v2.2)
1401
  ";
1402
  $wpdb -> get_results($sql);
1403
 
1404
+ } # function rvg_fix_wp_only ()
1405
+
 
1406
  /********************************************************************************************
1407
 
1408
  WRITE LINE TO LOG FILE
1506
  file_put_contents($file,$html,FILE_APPEND);
1507
  }
1508
 
1509
+ } // rvg_write_log ()
1510
+
 
1511
  /********************************************************************************************
1512
 
1513
  GET REVISIONS
1528
 
1529
  return $wpdb -> get_results($sql);
1530
 
1531
+ } // rvg_get_revisions ()
1532
+
 
1533
  /********************************************************************************************
1534
 
1535
  GET TRASHED POSTS / PAGES AND COMMENTS
1552
 
1553
  return $wpdb -> get_results($sql);
1554
 
1555
+ } // rvg_get_trash ()
1556
+
 
1557
  /********************************************************************************************
1558
 
1559
  GET SPAMMED COMMENTS
1572
 
1573
  return $wpdb -> get_results($sql);
1574
 
1575
+ } // rvg_get_trash ()
1576
+
 
1577
  /********************************************************************************************
1578
 
1579
  CALCULATE THE SIZE OF THE WORDPRESS DATABASE (IN BYTES)
1595
 
1596
  return $res[0]->size;
1597
 
1598
+ } // rvg_get_db_size ()
1599
+
 
1600
  /********************************************************************************************
1601
 
1602
  FORMAT SIZES FROM BYTES TO KB OR MB
1610
  $table_size = (round($size/1024,$precision)).' KB';
1611
 
1612
  return $table_size;
1613
+ } // rvg_format_size ()
1614
+ ?>