Optimize Database after Deleting Revisions - Version 4.8.6

Version Description

[09/22/2019] = * BUG FIX: Some bug fixes + other minor changes

Download this release

Release Info

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

Code changes from version 4.8.5 to 4.8.6

classes/odb-cleaner.php CHANGED
@@ -1154,7 +1154,7 @@ function odb_confirm_delete() {
1154
  <td valign="top" class="odb-bold"><?php echo $results[$i]['post_modified']?></td><?php
1155
  } // if (!$scheduler && ($action == 'analyze_detail' || $action == 'run_detail'))
1156
 
1157
- if ($action == 'run_summary' || $action == 'run_detail') {
1158
  $sql_delete = sprintf ("
1159
  DELETE FROM %sposts
1160
  WHERE `ID` = %d
@@ -1202,7 +1202,7 @@ function odb_confirm_delete() {
1202
 
1203
  for($j = 0; $j < $nr_to_delete; $j++) {
1204
  // if(!$scheduler) echo $results_get_posts[$j]->post_modified.'<br>';
1205
- if ($action == 'run_summary' || $action == 'run_detail') {
1206
  $sql_delete = sprintf ("
1207
  DELETE FROM %sposts
1208
  WHERE `ID` = %d
@@ -1307,7 +1307,7 @@ function odb_confirm_delete() {
1307
 
1308
  if($results[$i]['post_type'] == 'comment') {
1309
  // DELETE META DATA (IF ANY...)
1310
- if ($action == 'run_summary' || $action == 'run_detail') {
1311
  $sql_delete = sprintf ("
1312
  DELETE FROM %scommentmeta
1313
  WHERE `comment_id` = %d
@@ -1316,7 +1316,7 @@ function odb_confirm_delete() {
1316
  } // if ($action == 'run_summary' || $action == 'run_detail')
1317
  } // if($results[$i]['post_type'] == 'comment')
1318
 
1319
- if ($action == 'run_summary' || $action == 'run_detail') {
1320
  // DELETE TRASHED POSTS / PAGES
1321
  $sql_delete = sprintf ("
1322
  DELETE FROM %sposts
@@ -1395,7 +1395,7 @@ function odb_confirm_delete() {
1395
  <?php
1396
  } // if (!$scheduler && ($action == 'analyze_detail' || $action == 'run_detail'))
1397
 
1398
- if ($action == 'run_summary' || $action == 'run_detail') {
1399
  $sql_delete = sprintf ("
1400
  DELETE FROM %scommentmeta
1401
  WHERE `comment_id` = %d
@@ -1472,7 +1472,7 @@ function odb_confirm_delete() {
1472
  <?php
1473
  } // if (!$scheduler && ($action = 'analyze_detail' || $action == 'run_detail'))
1474
 
1475
- if ($action == 'run_summary' || $action == 'run_detail') {
1476
  $sql_del = sprintf ("
1477
  DELETE FROM %sterm_taxonomy
1478
  WHERE term_id = %d
@@ -1603,12 +1603,11 @@ function odb_confirm_delete() {
1603
  } // if (!$scheduler && ($action == 'analyze_detail' || $action == 'run_detail'))
1604
 
1605
  // v4.8.2
1606
- if ($action == 'run_summary' || $action == 'run_detail') {
1607
  $timeout = $results[$j]['option_name'];
1608
  $trans = str_replace('_timeout', '', $timeout);
1609
  $sqldel = sprintf ("
1610
- DELETE
1611
- FROM `%soptions`
1612
  WHERE (
1613
  option_name = '%s'
1614
  OR option_name = '%s'
@@ -1686,7 +1685,7 @@ function odb_confirm_delete() {
1686
  <?php
1687
  } // if (!$scheduler && ($action == 'analyze_detail' | $action == 'run_detail'))
1688
 
1689
- if ($action == 'run_summary' || $action == 'run_detail') {
1690
  for($j = 0; $j < count($results); $j++) {
1691
  // DELETE METADATA FOR THIS COMMENT (IF ANY)
1692
  $sql = sprintf ("
@@ -1767,7 +1766,7 @@ function odb_confirm_delete() {
1767
  <?php
1768
  } // if (!$scheduler && ($action == 'analyze_detail' | $action == 'run_detail'))
1769
 
1770
- if ($action == 'run_summary' || $action == 'run_detail') {
1771
  // DELETE COMMENTS
1772
  $sql = sprintf ("
1773
  DELETE FROM %spostmeta
@@ -1862,7 +1861,7 @@ function odb_confirm_delete() {
1862
  <?php
1863
  } // if (!$scheduler && ($action == 'analyze_detail' || $action == 'run_detail'))
1864
 
1865
- if ($action == 'run_summary' || $action == 'run_detail') {
1866
  for($j = 0; $j < count($results); $j++) {
1867
  // DELETE METADATA FOR THIS COMMENT (IF ANY)
1868
  if ($results[$j]['type'] == 'meta') {
1154
  <td valign="top" class="odb-bold"><?php echo $results[$i]['post_modified']?></td><?php
1155
  } // if (!$scheduler && ($action == 'analyze_detail' || $action == 'run_detail'))
1156
 
1157
+ if ($scheduler || $action == 'run_summary' || $action == 'run_detail') {
1158
  $sql_delete = sprintf ("
1159
  DELETE FROM %sposts
1160
  WHERE `ID` = %d
1202
 
1203
  for($j = 0; $j < $nr_to_delete; $j++) {
1204
  // if(!$scheduler) echo $results_get_posts[$j]->post_modified.'<br>';
1205
+ if ($scheduler || $action == 'run_summary' || $action == 'run_detail') {
1206
  $sql_delete = sprintf ("
1207
  DELETE FROM %sposts
1208
  WHERE `ID` = %d
1307
 
1308
  if($results[$i]['post_type'] == 'comment') {
1309
  // DELETE META DATA (IF ANY...)
1310
+ if ($scheduler || $action == 'run_summary' || $action == 'run_detail') {
1311
  $sql_delete = sprintf ("
1312
  DELETE FROM %scommentmeta
1313
  WHERE `comment_id` = %d
1316
  } // if ($action == 'run_summary' || $action == 'run_detail')
1317
  } // if($results[$i]['post_type'] == 'comment')
1318
 
1319
+ if ($scheduler || $action == 'run_summary' || $action == 'run_detail') {
1320
  // DELETE TRASHED POSTS / PAGES
1321
  $sql_delete = sprintf ("
1322
  DELETE FROM %sposts
1395
  <?php
1396
  } // if (!$scheduler && ($action == 'analyze_detail' || $action == 'run_detail'))
1397
 
1398
+ if ($scheduler || $action == 'run_summary' || $action == 'run_detail') {
1399
  $sql_delete = sprintf ("
1400
  DELETE FROM %scommentmeta
1401
  WHERE `comment_id` = %d
1472
  <?php
1473
  } // if (!$scheduler && ($action = 'analyze_detail' || $action == 'run_detail'))
1474
 
1475
+ if ($scheduler || $action == 'run_summary' || $action == 'run_detail') {
1476
  $sql_del = sprintf ("
1477
  DELETE FROM %sterm_taxonomy
1478
  WHERE term_id = %d
1603
  } // if (!$scheduler && ($action == 'analyze_detail' || $action == 'run_detail'))
1604
 
1605
  // v4.8.2
1606
+ if ($scheduler || $action == 'run_summary' || $action == 'run_detail') {
1607
  $timeout = $results[$j]['option_name'];
1608
  $trans = str_replace('_timeout', '', $timeout);
1609
  $sqldel = sprintf ("
1610
+ DELETE FROM `%soptions`
 
1611
  WHERE (
1612
  option_name = '%s'
1613
  OR option_name = '%s'
1685
  <?php
1686
  } // if (!$scheduler && ($action == 'analyze_detail' | $action == 'run_detail'))
1687
 
1688
+ if ($scheduler || $action == 'run_summary' || $action == 'run_detail') {
1689
  for($j = 0; $j < count($results); $j++) {
1690
  // DELETE METADATA FOR THIS COMMENT (IF ANY)
1691
  $sql = sprintf ("
1766
  <?php
1767
  } // if (!$scheduler && ($action == 'analyze_detail' | $action == 'run_detail'))
1768
 
1769
+ if ($scheduler || $action == 'run_summary' || $action == 'run_detail') {
1770
  // DELETE COMMENTS
1771
  $sql = sprintf ("
1772
  DELETE FROM %spostmeta
1861
  <?php
1862
  } // if (!$scheduler && ($action == 'analyze_detail' || $action == 'run_detail'))
1863
 
1864
+ if ($scheduler || $action == 'run_summary' || $action == 'run_detail') {
1865
  for($j = 0; $j < count($results); $j++) {
1866
  // DELETE METADATA FOR THIS COMMENT (IF ANY)
1867
  if ($results[$j]['type'] == 'meta') {
classes/odb-displayer.php CHANGED
@@ -126,6 +126,14 @@ class ODB_Displayer {
126
  echo '<span class="odb-bold">'.__('Maximum number of - most recent - revisions to keep per post / page', $odb_class->odb_txt_domain).':</span> <span class="odb-bold odb-blue">'.$odb_class->odb_rvg_options['nr_of_revisions'].'</span><br>';
127
  }
128
 
 
 
 
 
 
 
 
 
129
  echo '
130
  <span class="odb-bold">'.__('Delete trashed items', $odb_class->odb_txt_domain).':</span> <span class="odb-bold odb-blue">'.$trash.'</span><br>
131
  <span class="odb-bold">'.__('Delete spammed items', $odb_class->odb_txt_domain).':</span> <span class="odb-bold odb-blue">'.$spam.'</span><br>
@@ -136,7 +144,7 @@ class ODB_Displayer {
136
  <span class="odb-bold">'.__('Keep a log', $odb_class->odb_txt_domain).':</span> <span class="odb-bold odb-blue">'.$log.'</span><br>
137
  <span class="odb-bold">'.__('Optimize InnoDB tables', $odb_class->odb_txt_domain).':</span> <span class="odb-bold odb-blue">'.$innodb.'</span><br>
138
  <span class="odb-bold">'.__('Number of excluded tables', $odb_class->odb_txt_domain).':</span> <span class="odb-bold odb-blue">'.count($odb_class->odb_rvg_excluded_tabs).'</span><br>
139
- <span class="odb-bold">'.__('Last run', $odb_class->odb_txt_domain) . ':</span> <span class="odb-bold odb-blue">'.$odb_class->odb_rvg_options['last_run'] . ' ' . __('hrs', $odb_class->odb_txt_domain). ' (' . __('in', $odb_class->odb_txt_domain) . ' ' .$odb_class->odb_rvg_options['last_run_seconds'] . ' ' . __('seconds', $odb_class->odb_txt_domain) . ')</span><br>
140
  <span class="odb-bold">' . __('Scheduler', $odb_class->odb_txt_domain) . ':</span> <span class="odb-bold odb-blue">' . $schedule . '</span><br>
141
  ';
142
 
126
  echo '<span class="odb-bold">'.__('Maximum number of - most recent - revisions to keep per post / page', $odb_class->odb_txt_domain).':</span> <span class="odb-bold odb-blue">'.$odb_class->odb_rvg_options['nr_of_revisions'].'</span><br>';
127
  }
128
 
129
+ // v4.8.6
130
+ $lastrun = '';
131
+ if ($odb_class->odb_rvg_options['last_run_seconds'] == '') {
132
+ $lastrun = '<span class="odb-bold">' . __('Last run', $odb_class->odb_txt_domain) . ':</span> <span class="odb-bold odb-blue">' . $odb_class->odb_rvg_options['last_run'] . '</span><br>';
133
+ } else {
134
+ $lastrun = '<span class="odb-bold">' . __('Last run', $odb_class->odb_txt_domain) . ':</span> <span class="odb-bold odb-blue">' . $odb_class->odb_rvg_options['last_run'] . ' ' . __('hrs', $odb_class->odb_txt_domain) . ' (' . __('in', $odb_class->odb_txt_domain) . ' ' .$odb_class->odb_rvg_options['last_run_seconds'] . ' ' . __('seconds', $odb_class->odb_txt_domain) . ')</span><br>';
135
+ }
136
+
137
  echo '
138
  <span class="odb-bold">'.__('Delete trashed items', $odb_class->odb_txt_domain).':</span> <span class="odb-bold odb-blue">'.$trash.'</span><br>
139
  <span class="odb-bold">'.__('Delete spammed items', $odb_class->odb_txt_domain).':</span> <span class="odb-bold odb-blue">'.$spam.'</span><br>
144
  <span class="odb-bold">'.__('Keep a log', $odb_class->odb_txt_domain).':</span> <span class="odb-bold odb-blue">'.$log.'</span><br>
145
  <span class="odb-bold">'.__('Optimize InnoDB tables', $odb_class->odb_txt_domain).':</span> <span class="odb-bold odb-blue">'.$innodb.'</span><br>
146
  <span class="odb-bold">'.__('Number of excluded tables', $odb_class->odb_txt_domain).':</span> <span class="odb-bold odb-blue">'.count($odb_class->odb_rvg_excluded_tabs).'</span><br>
147
+ ' . $lastrun . '
148
  <span class="odb-bold">' . __('Scheduler', $odb_class->odb_txt_domain) . ':</span> <span class="odb-bold odb-blue">' . $schedule . '</span><br>
149
  ';
150
 
readme.txt CHANGED
@@ -10,8 +10,8 @@ Contributors: cageehv
10
  Requires at least: 2.8
11
  Requires PHP: 5.0
12
  Tested up to: 5.2.3
13
- Stable tag: 4.8.5
14
- Version: 4.8.5
15
  License: GPLv2 or later
16
 
17
  == Description ==
@@ -111,6 +111,9 @@ http://cagewebdev.com/category/news-tech-art/wordpress/
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.8.5 [09/19/2019] =
115
  * BUG FIX: Logging bug fixed
116
 
10
  Requires at least: 2.8
11
  Requires PHP: 5.0
12
  Tested up to: 5.2.3
13
+ Stable tag: 4.8.6
14
+ Version: 4.8.6
15
  License: GPLv2 or later
16
 
17
  == Description ==
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.8.6 [09/22/2019] =
115
+ * BUG FIX: Some bug fixes + other minor changes
116
+
117
  = 4.8.5 [09/19/2019] =
118
  * BUG FIX: Logging bug fixed
119
 
rvg-optimize-database.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package Optimize Database after Deleting Revisions
4
- * @version 4.8.5
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.8.5
14
  */
15
 
16
  /********************************************************************************************
@@ -28,8 +28,8 @@ $odb_class = new OptimizeDatabase();
28
 
29
  class OptimizeDatabase {
30
  // VERSION
31
- var $odb_version = '4.8.5';
32
- var $odb_release_date = '09/19/2019';
33
 
34
  // PLUGIN OPTIONS
35
  var $odb_rvg_options = array();
1
  <?php
2
  /**
3
  * @package Optimize Database after Deleting Revisions
4
+ * @version 4.8.6
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.8.6
14
  */
15
 
16
  /********************************************************************************************
28
 
29
  class OptimizeDatabase {
30
  // VERSION
31
+ var $odb_version = '4.8.6';
32
+ var $odb_release_date = '09/22/2019';
33
 
34
  // PLUGIN OPTIONS
35
  var $odb_rvg_options = array();